@one-grid-core/angular 0.5.2 → 0.5.4
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/README.md +4 -2
- package/esm2022/lib/components/one-grid/one-grid.component.mjs +102 -20
- package/esm2022/lib/components/one-grid-row-action/one-grid-row-action.component.mjs +14 -8
- package/esm2022/lib/core/instants/one-grid-api.class.mjs +78 -9
- package/esm2022/lib/core/models/one-column-def-types.model.mjs +1 -1
- package/esm2022/lib/core/models/one-event-types.model.mjs +1 -1
- package/esm2022/lib/core/services/og-column.service.mjs +11 -1
- package/esm2022/lib/helpers/one-row-grouping.helper.mjs +14 -4
- package/fesm2022/one-grid-core-angular.mjs +217 -40
- package/fesm2022/one-grid-core-angular.mjs.map +1 -1
- package/lib/components/one-grid/one-grid.component.d.ts +43 -0
- package/lib/components/one-grid-row-action/one-grid-row-action.component.d.ts +1 -0
- package/lib/core/instants/one-grid-api.class.d.ts +27 -4
- package/lib/core/models/one-column-def-types.model.d.ts +5 -0
- package/lib/core/models/one-event-types.model.d.ts +13 -0
- package/lib/core/services/og-column.service.d.ts +8 -0
- package/lib/helpers/one-row-grouping.helper.d.ts +7 -1
- package/package.json +1 -1
- package/scss/_one-grid.scss +27 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"one-grid-core-angular.mjs","sources":["../../../projects/one-grid/src/lib/helpers/one-column-def.helper.ts","../../../projects/one-grid/src/lib/helpers/one-csv.helper.ts","../../../projects/one-grid/src/lib/helpers/one-row-grouping.helper.ts","../../../projects/one-grid/src/lib/helpers/one-validation.helper.ts","../../../projects/one-grid/src/lib/core/instants/one-row-node.class.ts","../../../projects/one-grid/src/lib/helpers/one-filter.helper.ts","../../../projects/one-grid/src/lib/helpers/one-cell.helper.ts","../../../projects/one-grid/src/lib/core/services/og-column.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-row.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-cell.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-event.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-selection.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-expansion.service.ts","../../../projects/one-grid/src/lib/core/instants/one-grid-api.class.ts","../../../projects/one-grid/src/lib/core/services/one-grid-row-drag.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-tree-data.service.ts","../../../projects/one-grid/src/lib/core/models/constants/one-pagination.constant.ts","../../../projects/one-grid/src/lib/core/models/one-row.model.ts","../../../projects/one-grid/src/lib/core/icons/one-grid-icons.ts","../../../projects/one-grid/src/lib/core/pipes/header-checkbox-checked.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/header-checkbox-disabled.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/header-checkbox-indeterminate.pipe.ts","../../../projects/one-grid/src/lib/components/one-grid-checkbox-header/one-grid-checkbox-header.component.ts","../../../projects/one-grid/src/lib/components/one-grid-checkbox-header/one-grid-checkbox-header.component.html","../../../projects/one-grid/src/lib/components/one-grid-header-menu/one-grid-header-menu.component.ts","../../../projects/one-grid/src/lib/components/one-grid-header-menu/one-grid-header-menu.component.html","../../../projects/one-grid/src/lib/core/pipes/column-sort-state.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/aria-sort.pipe.ts","../../../projects/one-grid/src/lib/components/one-grid-header/one-grid-header.component.ts","../../../projects/one-grid/src/lib/components/one-grid-header/one-grid-header.component.html","../../../projects/one-grid/src/lib/core/pipes/cell-editable.pipe.ts","../../../projects/one-grid/src/lib/components/one-grid-checkbox/one-grid-checkbox.component.ts","../../../projects/one-grid/src/lib/components/one-grid-checkbox/one-grid-checkbox.component.html","../../../projects/one-grid/src/lib/components/one-grid-cell-group-renderer/one-grid-cell-group-renderer.component.ts","../../../projects/one-grid/src/lib/components/one-grid-cell-group-renderer/one-grid-cell-group-renderer.component.html","../../../projects/one-grid/src/lib/components/one-grid-cell-option-menu/one-grid-cell-option-menu.component.ts","../../../projects/one-grid/src/lib/components/one-grid-cell-option-menu/one-grid-cell-option-menu.component.html","../../../projects/one-grid/src/lib/components/one-grid-row-action/one-grid-row-action.component.ts","../../../projects/one-grid/src/lib/components/one-grid-row-action/one-grid-row-action.component.html","../../../projects/one-grid/src/lib/components/one-grid-row-drag-handle/one-grid-row-drag-handle.component.ts","../../../projects/one-grid/src/lib/components/one-grid-row-drag-handle/one-grid-row-drag-handle.component.html","../../../projects/one-grid/src/lib/core/directives/one-cell-input-validator.directive.ts","../../../projects/one-grid/src/lib/core/directives/one-cell-renderer-component.directive.ts","../../../projects/one-grid/src/lib/core/directives/one-cell-text-expand.directive.ts","../../../projects/one-grid/src/lib/core/pipes/cell-action-button-enable.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/cell-invalid.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/cell-key.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/cell-level-padding.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/cell-selected.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/cell-state-renderer.pipe.ts","../../../projects/one-grid/src/lib/components/one-grid-body/one-grid-body.component.ts","../../../projects/one-grid/src/lib/components/one-grid-body/one-grid-body.component.html","../../../projects/one-grid/src/lib/components/one-grid-pagination/one-grid-pagination.component.ts","../../../projects/one-grid/src/lib/components/one-grid-pagination/one-grid-pagination.component.html","../../../projects/one-grid/src/lib/components/one-grid/one-grid.component.ts","../../../projects/one-grid/src/lib/components/one-grid/one-grid.component.html","../../../projects/one-grid/src/lib/components/one-grid-status/one-grid-status.component.ts","../../../projects/one-grid/src/lib/components/one-grid-status/one-grid-status.component.html","../../../projects/one-grid/src/lib/components/one-grid-cell-currency/one-grid-cell-currency.component.ts","../../../projects/one-grid/src/lib/components/one-grid-cell-currency/one-grid-cell-currency.component.html","../../../projects/one-grid/src/lib/one-grid.module.ts","../../../projects/one-grid/src/public-api.ts","../../../projects/one-grid/src/one-grid-core-angular.ts"],"sourcesContent":["import { OneCellRendererParams, OneColumnDef, OneValueGetterParams } from \"../core/models/one-column-def-types.model\";\nimport type { OneRowNode } from \"../core/instants/one-row-node.class\";\n\n/** Width used when a column defines neither `width` nor `minWidth`. */\nexport const ONE_DEFAULT_COLUMN_WIDTH = 150;\n\n/**\n * The rendered width of a column, clamped to its bounds.\n *\n * `width`, `minWidth` and `maxWidth` are all optional, and the previous inline\n * expression — repeated in two places — fell back to `minWidth` when `width`\n * was absent. With neither set that produced `undefined`, and summing it gave\n * a `NaN` row width, so the row collapsed. This is total: every combination of\n * present and absent bounds resolves to a usable number.\n */\nexport function resolveColumnWidth<T>(column: OneColumnDef<T>): number {\n\n const min = column?.minWidth ?? 0;\n const max = column?.maxWidth ?? Number.POSITIVE_INFINITY;\n const width = column?.width ?? column?.minWidth ?? ONE_DEFAULT_COLUMN_WIDTH;\n\n return Math.min(Math.max(width, min), max);\n}\n\n/**\n * Apply Default Column Definitions\n */\nexport function applyDefaultColumnDef<T>(columnDefs: OneColumnDef<T>[], defaultColumnDef: OneColumnDef<T>): OneColumnDef<T>[] {\n\n return columnDefs.map(colDef => ({\n ...defaultColumnDef,\n ...colDef\n }));\n}\n\n/**\n * One Column Params Resolver (Cell Renderer)\n */\nexport function resolveOneCellRendererParams<T>(\n prop: boolean | ((params: any) => boolean),\n params: OneCellRendererParams<T>,\n /**\n * What an unset property means: `false` for a capability you opt into,\n * `true` for a restriction you opt out of. `!!prop` could not tell the two\n * apart, which left `updatable` — a restriction — defaulting to \"deny\".\n */\n whenUnset: boolean = false,\n): boolean {\n\n if (prop === undefined || prop === null) return whenUnset;\n\n return typeof prop === 'function' ? prop(params) : !!prop;\n}\n\n/**\n * One Column Params Resolver (Generics)\n */\nexport function resolveOneColumDefParams<R>(prop: R | ((params: any) => R), params: any): R {\n\n return typeof prop === 'function' ? (prop as (p: any) => R)(params) : prop;\n}\n\n/**\n * One Column Params Resolver (Value Getter)\n */\nexport function resolveOneValueGetterParams<T, R>(prop: R | ((params: OneValueGetterParams<T>) => R), params: OneValueGetterParams<T>): R {\n\n return typeof prop === 'function' ? (prop as (p: OneValueGetterParams<T>) => R) (params): prop;\n}\n\n/**\n * Run a column's `valueGetter` for one row.\n *\n * Was `CellValueGetterPipe`, which existed only to call this resolver from a\n * service. The pipe added a module declaration and an indirection for a\n * template use that never existed.\n */\nexport function resolveCellValueGetter<T>(data: T, node: OneRowNode, column: OneColumnDef, context: unknown): string {\n\n return resolveOneValueGetterParams(column?.valueGetter, {\n data,\n rowIndex: node?.rowIndex,\n node,\n context,\n });\n}\n","import type { OneRowNode } from \"../core/instants/one-row-node.class\";\nimport type { OneColumnDef } from \"../core/models/one-column-def-types.model\";\n\n/** Options for `api.getDataAsCsv` / `api.exportDataAsCsv`. */\nexport interface OneCsvExportOptions {\n /** Field separator. Defaults to ','. */\n columnSeparator?: string;\n /** Whether the first line carries the header names. Defaults to true. */\n includeHeaders?: boolean;\n /** Export only the selected rows instead of every visible one. */\n onlySelected?: boolean;\n /** Download name for `exportDataAsCsv`. Defaults to 'export.csv'. */\n fileName?: string;\n}\n\n/**\n * The columns an export can say anything about: those that read a row —\n * through a field or a valueGetter. Action columns have neither, and the\n * row-number column reads state the data does not hold; both are skipped.\n */\nexport function exportableColumns<T>(columns: OneColumnDef<T>[]): OneColumnDef<T>[] {\n\n return (columns ?? []).filter(column =>\n (column.field && column.field !== '_oneRowNumber') || column.valueGetter);\n}\n\n/**\n * Serialize rows to RFC 4180 CSV.\n *\n * Each cell goes through the same value pipeline the grid renders with:\n * `valueGetter` when declared, the field otherwise, then `valueFormatter` —\n * so the file says what the screen says. Null and undefined export as empty\n * cells, before the formatter, exactly as the grid leaves them to the\n * placeholder.\n */\nexport function buildCsv<T>(\n nodes: readonly OneRowNode<T>[],\n columns: OneColumnDef<T>[],\n context: any = null,\n options: OneCsvExportOptions = {},\n): string {\n\n const separator = options.columnSeparator ?? ',';\n const exportable = exportableColumns(columns);\n\n const lines: string[] = [];\n\n if (options.includeHeaders ?? true) {\n\n lines.push(exportable.map(column => escapeCsvCell(column.headerName ?? column.field ?? '', separator)).join(separator));\n }\n\n nodes?.forEach((node, rowIndex) => {\n\n const cells = exportable.map(column => {\n\n let value = column.valueGetter\n ? column.valueGetter({ data: node.data, rowIndex, node, context })\n : (node.data as Record<string, unknown>)?.[column.field as string];\n\n if (value === null || value === undefined) return '';\n\n if (column.valueFormatter) {\n\n value = column.valueFormatter({\n value,\n data: node.data,\n node,\n rowIndex,\n field: column.field as string,\n columnDef: column,\n context,\n });\n }\n\n return escapeCsvCell(value, separator);\n });\n\n lines.push(cells.join(separator));\n });\n\n // CRLF is what RFC 4180 asks for, and what spreadsheet apps expect.\n return lines.join('\\r\\n');\n}\n\n/** Quote a cell when it holds the separator, a quote, or a line break. */\nfunction escapeCsvCell(value: unknown, separator: string): string {\n\n const text = `${value}`;\n\n if (text.includes(separator) || text.includes('\"') || text.includes('\\n') || text.includes('\\r')) {\n\n return `\"${text.replace(/\"/g, '\"\"')}\"`;\n }\n\n return text;\n}\n","import { OneAggFunc, OneAggFuncParams, OneColumnDef } from \"../core/models/one-column-def-types.model\";\n\n/** Marks a synthetic group row, so anything can tell it from real data. */\nexport const ONE_GROUP_FLAG = '__oneGroup';\n\n/** Stable id for a group row: its value path. Survives every rebuild. */\nexport const ONE_GROUP_ID_FIELD = '__oneGroupId';\n\n/** The label the auto group column shows for a group row. */\nexport const ONE_GROUP_VALUE_FIELD = '__oneGroupValue';\n\n/** Where a group row keeps its children, for the tree pipeline to recurse. */\nexport const ONE_GROUP_CHILDREN_FIELD = '__oneGroupChildren';\n\n/** What a group of rows with no value in the grouped field is labelled. */\nexport const ONE_GROUP_BLANK_LABEL = '(Blank)';\n\n/** One column's aggregation, captured from the column definitions. */\nexport interface OneAggColumn<T = any> {\n field: string;\n aggFunc: OneAggFunc<T>;\n}\n\n/** The `rowGroup` fields of a column set, in definition order. */\nexport function rowGroupFields<T>(columns: readonly OneColumnDef<T>[]): string[] {\n\n return (columns ?? [])\n .filter(column => column.rowGroup && column.field)\n .map(column => column.field as string);\n}\n\n/** The `aggFunc` columns of a column set. */\nexport function aggColumns<T>(columns: readonly OneColumnDef<T>[]): OneAggColumn<T>[] {\n\n return (columns ?? [])\n .filter(column => column.aggFunc && column.field)\n .map(column => ({ field: column.field as string, aggFunc: column.aggFunc }));\n}\n\n/**\n * Fold flat rows into a tree of synthetic group rows, one level per group\n * field, in first-appearance order. Each group row carries:\n *\n * - the marker, id and label fields above;\n * - its own grouped field's value, so sorting and filtering read it naturally;\n * - one aggregated value per `aggFunc` column, computed over the group's\n * leaves (not its child groups), stored under the column's own field so the\n * ordinary cell pipeline renders it.\n *\n * Pure: the input rows are referenced, never mutated.\n */\nexport function buildGroupedRows<T>(\n rows: readonly T[],\n groupFields: readonly string[],\n aggregations: readonly OneAggColumn<T>[] = [],\n): any[] {\n\n if (!groupFields?.length) return [...(rows ?? [])];\n\n return groupLevel(rows ?? [], groupFields, 0, aggregations, 'og-group');\n}\n\nfunction groupLevel<T>(\n rows: readonly T[],\n groupFields: readonly string[],\n level: number,\n aggregations: readonly OneAggColumn<T>[],\n idPrefix: string,\n): any[] {\n\n const field = groupFields[level];\n\n // Insertion-ordered buckets, keyed by the value's string form. The raw\n // value is kept as well, so the group row exposes the real value under the\n // grouped field, not its stringification.\n const buckets = new Map<string, { value: unknown; rows: T[] }>();\n\n for (const row of rows) {\n\n const value = (row as Record<string, unknown>)?.[field];\n const key = value === null || value === undefined || value === '' ? ONE_GROUP_BLANK_LABEL : String(value);\n\n const bucket = buckets.get(key);\n\n if (bucket) {\n\n bucket.rows.push(row);\n\n } else {\n\n buckets.set(key, { value, rows: [row] });\n }\n }\n\n return [...buckets.entries()].map(([key, bucket]) => {\n\n const id = `${idPrefix}:${key}`;\n\n const children = level + 1 < groupFields.length\n ? groupLevel(bucket.rows, groupFields, level + 1, aggregations, id)\n : bucket.rows;\n\n const groupRow: Record<string, unknown> = {\n [ONE_GROUP_FLAG]: true,\n [ONE_GROUP_ID_FIELD]: id,\n [ONE_GROUP_VALUE_FIELD]: key,\n [field]: bucket.value,\n [ONE_GROUP_CHILDREN_FIELD]: children,\n };\n\n // Aggregates always read the original leaves, so a two-level group's\n // parent is not averaging averages.\n for (const aggregation of aggregations) {\n\n groupRow[aggregation.field] = aggregate(bucket.rows, aggregation.field, aggregation.aggFunc);\n }\n\n return groupRow;\n });\n}\n\n/** Apply one aggregation over a set of leaf rows. */\nexport function aggregate<T>(rows: readonly T[], field: string, aggFunc: OneAggFunc<T>): any {\n\n const values = rows\n .map(row => (row as Record<string, unknown>)?.[field])\n .filter(value => value !== null && value !== undefined);\n\n if (typeof aggFunc === 'function') {\n\n return aggFunc({ values, rows: rows as T[], field } as OneAggFuncParams<T>);\n }\n\n switch (aggFunc) {\n\n case 'count': return values.length;\n\n case 'first': return values.length ? values[0] : null;\n\n case 'last': return values.length ? values[values.length - 1] : null;\n }\n\n // The numeric aggregates ignore what does not parse, so one stray string in\n // a column does not turn the whole group's total into NaN.\n const numbers = values.map(Number).filter(Number.isFinite);\n\n if (!numbers.length) return null;\n\n switch (aggFunc) {\n\n case 'sum': return numbers.reduce((total, value) => total + value, 0);\n\n case 'min': return Math.min(...numbers);\n\n case 'max': return Math.max(...numbers);\n\n case 'avg': return numbers.reduce((total, value) => total + value, 0) / numbers.length;\n\n default: return null;\n }\n}\n","\nimport { OneRowNode } from \"../core/instants/one-row-node.class\";\nimport { OneColumnDef } from \"../core/models/one-column-def-types.model\";\nimport { OneValidationRules, OneValidatorFn } from \"../core/models/one-validation.model\";\n\n/**\n * One Grid Validators\n */\nexport const Validators = {\n required: (message = 'This field is required'): OneValidatorFn => {\n\n return (value) => {\n\n if (value === null || value === undefined || value === '') {\n\n return message;\n }\n\n return null;\n };\n },\n minLength: (min: number, message?: string): OneValidatorFn => {\n\n return (value) => {\n\n if (value != null && value.length < min) {\n\n return message || `Minimum length is ${min} digits`;\n }\n\n return null;\n };\n },\n maxLength: (max: number, message?: string): OneValidatorFn => {\n\n return (value) => {\n\n if (value != null && value.length > max) {\n\n return message || `Maximum length is ${max} digits`;\n }\n\n return null;\n };\n },\n pattern: (regex: RegExp, message = 'Format is not valid'): OneValidatorFn => {\n\n return (value) => {\n\n if (value != null && !regex.test(value)) {\n\n return message;\n }\n\n return null;\n };\n },\n custom: (fn: (value: any, row?: any) => string | null): OneValidatorFn => fn,\n};\n\n/**\n * One Grid Validation Rules\n */\nexport const ValidationRules: OneValidationRules = {\n required: [\n Validators.required()\n ],\n title: [\n Validators.required('Title is required'),\n Validators.minLength(1, 'Title must be at least 1 digit'),\n Validators.maxLength(250, 'Code must be less than 36 digits'),\n ],\n code: [\n Validators.required(\"Code is required\"),\n Validators.minLength(1, 'Code must be at least 1 digit'),\n Validators.maxLength(36, 'Code must be less than 36 digits'),\n ],\n email: [\n Validators.required(),\n Validators.pattern(/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/, 'Email format is invalid'),\n ],\n phone: [\n Validators.required('Phone number is required'),\n Validators.pattern(/^0(10|11|12|13|14|15|16|17|18|19|20|23|24|25|26|27|28|29)\\d{7}$/, 'Phone must be a valid pattern')\n ],\n datetime: [\n Validators.required('Datetime is required'),\n ]\n};\n\n/**\n * Helper fuction to return invalid cell on UI\n */\nexport function getCellError<T>(column: OneColumnDef<T>, node: OneRowNode, value: any, row: T): string | null {\n\n if (!column?.validationRules || column?.validationRules?.length === 0) return null;\n\n if (column?.autoGroupField) {\n\n // `editableLevels` is optional, and this read was unguarded — a tree grid\n // with validation rules on its group column threw on the first cell it\n // rendered. Undeclared means no level is validated, matching the property's\n // meaning elsewhere: it names the levels that are editable, and a level not\n // named is not one of them.\n if (column.editableLevels?.includes(node.level)) {\n\n for (const ruleFn of column?.validationRules) {\n\n const error = ruleFn(value, row);\n\n if (error) return error;\n }\n }\n\n return null;\n \n } else {\n\n if (!node.group) {\n\n for (const ruleFn of column?.validationRules) {\n\n const error = ruleFn(value, row);\n\n if (error) return error;\n }\n }\n\n return null;\n }\n}\n","import { Type } from \"@angular/core\";\nimport { OneCellOptions, OneCellStates } from \"../models/one-column-def-types.model\";\nimport { OneRowNodeEventMap, OneRowNodeListener } from \"../models/one-row.model\";\nimport { OneCellRendererComponent } from \"../models/one-tree-data.model\";\n\n/**\n * The grid's wrapper around one row of your data.\n *\n * A node owns three kinds of state: its identity and position, the structural\n * facts the grid derived while building the tree, and the per-cell UI state.\n * `data` is your object, held by reference and mutated in place when a cell is\n * committed — the node never copies it.\n *\n * @typeParam T - the row type\n * @typeParam D - the detail row type, for master/detail grids\n */\nexport class OneRowNode<T = any, D = any> {\n\n // ---------------------------------------------------------------------------\n // Identity\n // ---------------------------------------------------------------------------\n\n /**\n * Stable key for this row, from `context.componentParent.getRowId` or a\n * generated uuid. Selection, expansion and cell state are all keyed by it,\n * which is why it never changes for the life of the node.\n */\n public readonly rowId: string;\n\n /** Position in the flattened row list. Reassigned whenever rows are rebuilt. */\n public rowIndex: number;\n\n /** Your row object, by reference. */\n public data: T;\n\n /** Depth in the tree. 0 at the root; always 0 outside tree data. */\n public level = 0;\n\n // ---------------------------------------------------------------------------\n // Structure, derived by the grid while building rows\n // ---------------------------------------------------------------------------\n\n /** Has no children of its own. */\n public leaf = false;\n\n /** Is a group, but an empty one. */\n public leafGroup = false;\n\n /** Has children. */\n public group = false;\n\n /** Can be opened — a non-empty group, or any row in a master/detail grid. */\n public expandable = false;\n\n /** Survives the active filters. Recomputed on every filter pass. */\n public visible = false;\n\n public selected = false;\n public expanded = false;\n\n public parent: OneRowNode<T> | null = null;\n public children: OneRowNode<T>[] | null = null;\n\n // ---------------------------------------------------------------------------\n // Per-cell UI state, keyed by column field\n // ---------------------------------------------------------------------------\n\n /** Which cells currently have an open editor. */\n public editing: { [field: string]: boolean } = {};\n\n /** Rendered value and kind for each cell, computed when the row is built. */\n public cellStates: OneCellStates = {};\n\n public cellOptions: OneCellOptions = {};\n\n // ---------------------------------------------------------------------------\n // Master / detail\n // ---------------------------------------------------------------------------\n\n /** Detail rows for this master row. `null` until they have been supplied. */\n public detailRowData: D[] | null = null;\n\n /** Whether the custom detail renderer is showing. Toggled by the row action. */\n public detailActive = false;\n\n /** Height reserved for the detail area, computed from the detail row count. */\n public detailRowHeight: number | null = null;\n\n public detailRendererComponent?: Type<OneCellRendererComponent>;\n\n /**\n * Listeners per event. Typed as a payload-agnostic callback because the map\n * is heterogeneous; `on` and `emit` restore the per-event type at the edges.\n */\n private readonly listeners = new Map<keyof OneRowNodeEventMap<T>, Set<(payload: never) => void>>();\n\n constructor(rowId: string, data: T, rowIndex: number) {\n\n this.rowId = rowId;\n this.data = data;\n this.rowIndex = rowIndex;\n }\n\n // ---------------------------------------------------------------------------\n // Mutators\n // ---------------------------------------------------------------------------\n\n /**\n * Write one field of the row and announce it.\n *\n * `null` is allowed because that is what the grid itself stores for a cleared\n * cell; anything else must match the field's declared type.\n */\n setDataValue<K extends keyof T & string>(field: K, value: T[K] | null): void {\n\n const previousData = { ...this.data };\n\n this.data[field] = value as T[K];\n\n this.emit('rowDataChanged', { node: this, data: this.data, previousData });\n }\n\n setSelected(selected: boolean): void {\n\n this.selected = selected;\n }\n\n setRowIndex(index: number): void {\n\n this.rowIndex = index;\n }\n\n setCellStates(cellStates: OneCellStates): void {\n\n this.cellStates = cellStates;\n }\n\n /** @deprecated Read `node.selected`. */\n isSelected(): boolean {\n\n return this.selected;\n }\n\n /** @deprecated Read `node.expanded`. */\n isExpanded(): boolean {\n\n return this.expanded;\n }\n\n /** Supply or replace this master row's detail rows. */\n setDetailRowData(detailRowData: D[]): void {\n\n const previousDetailRowData = this.detailRowData;\n\n this.detailRowData = detailRowData;\n\n this.emit('detailRowDataChanged', { node: this, detailRowData, previousDetailRowData });\n }\n\n setExpanded(expanded: boolean): void {\n\n if (this.expanded === expanded) return; // no event for a no-op\n\n this.expanded = expanded;\n\n this.emit('expandedChanged', { node: this, expanded });\n }\n\n // ---------------------------------------------------------------------------\n // Events\n // ---------------------------------------------------------------------------\n\n /**\n * Subscribe to one of this node's events.\n *\n * @returns an unsubscribe function. Call it, or `destroy()`, to release the\n * listener — a node outlives any single render.\n */\n on<K extends keyof OneRowNodeEventMap<T>>(event: K, listener: OneRowNodeListener<T, K>): () => void {\n\n let listeners = this.listeners.get(event);\n\n if (!listeners) {\n\n listeners = new Set();\n\n this.listeners.set(event, listeners);\n }\n\n listeners.add(listener as (payload: never) => void);\n\n return () => this.off(event, listener);\n }\n\n off<K extends keyof OneRowNodeEventMap<T>>(event: K, listener: OneRowNodeListener<T, K>): void {\n\n this.listeners.get(event)?.delete(listener as (payload: never) => void);\n }\n\n /**\n * Notify listeners. Private on purpose: every event this class publishes is\n * raised by the mutator that caused it, and a forged `expandedChanged` would\n * leave the node's flag and the grid's view of it disagreeing.\n */\n private emit<K extends keyof OneRowNodeEventMap<T>>(event: K, payload: OneRowNodeEventMap<T>[K]): void {\n\n const listeners = this.listeners.get(event);\n\n if (!listeners?.size) return;\n\n // Snapshot: a listener is allowed to unsubscribe itself, or another, while\n // the event is being delivered.\n for (const listener of Array.from(listeners)) {\n\n (listener as (payload: OneRowNodeEventMap<T>[K]) => void)(payload);\n }\n }\n\n /**\n * Release everything this node holds. Called by the grid when the row leaves\n * the data or the grid is torn down.\n *\n * The tree links matter as much as the listeners: a parent holding children\n * that hold the parent keeps the whole subtree — and its data — reachable.\n */\n destroy(): void {\n\n this.listeners.clear();\n\n this.parent = null;\n this.children = null;\n this.detailRowData = null;\n this.detailRendererComponent = undefined;\n\n this.editing = {};\n this.cellStates = {};\n this.cellOptions = {};\n }\n}\n","import { OneRowNode } from \"../core/instants/one-row-node.class\";\nimport { OneFilterModel } from \"../core/models/one-filter.model\";\n\n/**\n * Recursively filters a tree and updates each node's UI state.\n *\n * Rules:\n * - A node is visible if it matches the filters or has a matching descendant.\n * - While a filter is active, a node is expanded iff it has a matching\n * descendant, so the hit is revealed.\n *\n * Overwriting `expanded` is only correct *while filtering*. This runs from\n * `applyFilters`, which every `setRowData` / `updateRowData` calls, so doing it\n * unconditionally force-expanded every parent on each data update: it made\n * `groupDefaultExpanded` inert for tree data and collapsed expanded\n * master-detail rows (they have no children, so `childMatch` is false).\n *\n * @returns True if the current node or any descendant matches.\n */\nexport function filterTreeNode<T = any>(node: OneRowNode<T>, filters: OneFilterModel[] | null, quick: string, fields?: readonly string[]): boolean {\n\n const filtering = isFilterActive(filters, quick);\n\n // Check whether the current node matches all active filters.\n const selfMatch = matchesAdvancedFilters(node, filters) && matchesQuickFilter(node, quick, fields);\n\n // Recursively determine whether any child matches.\n const childMatch = node.children?.some(child => filterTreeNode(child, filters, quick, fields)) ?? false;\n\n // Keep the node visible when it or any descendant matches.\n node.visible = selfMatch || childMatch;\n\n if (filtering) {\n\n // Expand parents to reveal matching descendants.\n node.expanded = childMatch;\n }\n\n return node.visible;\n}\n\n/**\n * Whether anything is actually filtering right now. A model entry with no\n * conditions matches everything, so it does not count as active.\n */\nexport function isFilterActive(filters: OneFilterModel[] | null, quick: string): boolean {\n\n if (quick) return true;\n\n return !!filters?.some(filter => filter?.conditions?.length > 0);\n}\n\n/**\n * Apply advanced per-column filters\n */\nexport function matchesAdvancedFilters<T = any>(node: OneRowNode<T>, filters: OneFilterModel[] | null): boolean {\n\n if (!filters || filters.length === 0) return true;\n\n return filters.every(filter => {\n\n const val = (node.data[filter.field as keyof T] ?? '').toString().toLowerCase();\n\n const results = filter.conditions.map(condition => {\n\n const cmp = (condition.value ?? '').toString().toLowerCase();\n const cmpTo = (condition.valueTo ?? '').toString().toLowerCase();\n\n switch (condition.operator) {\n\n case 'equals': return val === cmp;\n\n case 'notEqual': return val !== cmp;\n\n case 'contains': return val.includes(cmp);\n\n case 'notContains': return !val.includes(cmp);\n\n case 'startsWith': return val.startsWith(cmp);\n\n case 'endsWith': return val.endsWith(cmp);\n\n case 'greaterThan': return compare(val, cmp) > 0;\n\n case 'greaterThanOrEqual': return compare(val, cmp) >= 0;\n\n case 'lessThan': return compare(val, cmp) < 0;\n\n case 'lessThanOrEqual': return compare(val, cmp) <= 0;\n\n case 'inRange': return compare(val, cmp) >= 0 && compare(val, cmpTo) <= 0;\n\n // `val` has already been through `?? ''`, so null and undefined land\n // here as the empty string. 0 stringifies to '0' and does not.\n case 'blank': return val === '';\n\n case 'notBlank': return val !== '';\n\n default: return true; // Unknown operator = ignore\n }\n });\n\n return filter.logicOperator === 'AND' ? results.every(Boolean) : results.some(Boolean);\n });\n}\n\n/**\n * Order two already-lowercased cell values.\n *\n * Numeric when both sides parse as numbers, lexicographic otherwise. This used\n * to be `+val > +cmp` unconditionally, so anything non-numeric compared NaN\n * against NaN — always false. A date column filtered with `greaterThan` matched\n * nothing at all rather than reporting a problem, and ISO dates happen to sort\n * correctly as strings, which is what the fallback gives them.\n */\nfunction compare(val: string, cmp: string): number {\n\n const left = Number(val);\n const right = Number(cmp);\n\n const numeric = val !== '' && cmp !== '' && !Number.isNaN(left) && !Number.isNaN(right);\n\n if (numeric) return left === right ? 0 : left < right ? -1 : 1;\n\n return val === cmp ? 0 : val < cmp ? -1 : 1;\n}\n\n/**\n * Apply the quick filter to one row.\n *\n * Searches the fields the grid actually shows, when it is told what they are.\n * It used to walk `Object.values(node.data)`, which had three consequences, all\n * of them wrong:\n *\n * - a property with no column was searchable, so a user could match rows on\n * data the grid never displayed;\n * - a nested object stringified to `[object Object]`, so typing `object`\n * matched every row holding one;\n * - in a tree, `children` did the same, so most parents matched most queries.\n *\n * Non-primitive values are skipped regardless, so the `[object Object]` haystack\n * cannot come back through a declared column either.\n */\nexport function matchesQuickFilter<T = any>(node: OneRowNode<T>, quick: string, fields?: readonly string[]): boolean {\n\n if (!quick) return true;\n\n const data = node.data as Record<string, unknown>;\n\n const values = fields?.length ? fields.map(field => data?.[field]) : Object.values(data ?? {});\n\n return values.some(value => {\n\n if (value === null || value === undefined) return false;\n\n // Objects, arrays and functions have no useful text form. Skipping them is\n // what keeps `[object Object]` out of the search.\n if (typeof value === 'object' || typeof value === 'function') return false;\n\n return value.toString().toLowerCase().includes(quick);\n });\n}\n","import { OneColumnDef } from \"../core/models/one-column-def-types.model\";\n\n/**\n * Generate Cell Field\n */\nexport function getCellField(rowIndex: number, field: string): string {\n\n return `${rowIndex}--${field}`;\n}\n\nexport function getCellKey(rowId: string, field: string): string {\n\n return `${rowId}--${field}`;\n}\n\n/**\n * Get Value From Data Field\n */\nexport function getFieldValue<T>(data: T, field: string): string {\n\n return field?.split('.')?.reduce((obj, key) => obj?.[key], data) as string;\n}\n\n/**\n * Resolve cell style (handles both static and function-based)\n * @param column \n * @param row \n * @returns \n */\nexport function resolveCellStyle(column: OneColumnDef, row: any): { [key: string]: string } {\n\n if (!column.cellStyle) return {};\n\n return typeof column.cellStyle === 'function'\n ? column.cellStyle(row)\n : column.cellStyle;\n}\n\n/**\n * Resolve cell class (handles both static and function-based)\n * @param column \n * @param row \n * @returns \n */\nexport function resolveCellClass(column: OneColumnDef, row: any): string | string[] {\n\n if (!column.cellClass) return '';\n\n return typeof column.cellClass === 'function'\n ? column.cellClass(row)\n : column.cellClass;\n}\n\n/**\n * The cell's raw field value, with blank treated as absent.\n *\n * Was `CellFieldValuePipe`. It lived as an Angular pipe but was only ever\n * instantiated inside a service — a utility wearing a `@Pipe` decorator, which\n * also cost it a module declaration for a template use that never existed.\n */\nexport function readCellValue<T>(data: T, field: string): string | null {\n\n const value = getFieldValue(data, field);\n\n if (value === null || value === undefined) return null;\n\n if (typeof value === 'string' && value.trim() === '') return null;\n\n return value;\n}\n\n/**\n * Whether a cell has nothing to show.\n *\n * Was `CellFieldValueEmptyPipe`. `field` is optional on `OneColumnDef` — an\n * action-only column legitimately has none — and reading it unguarded used to\n * throw while the grid built cell state, taking the whole grid down. No field\n * means nothing to read, which is empty by definition.\n */\nexport function isCellEmpty<T>(data: T, field: string): boolean {\n\n if (!data || !field) return true;\n\n const value = getFieldValue(data, field);\n\n return value === null || value === undefined || value === '';\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { OneCellPresentationParams, OneCellRendererParams, OneColumnDef, OneColumnStateEntry, OneGroupColumnDef, OneHeaderPresentationParams } from '../models/one-column-def-types.model';\nimport lodash from 'lodash';\nimport { ColumnChangedEvent } from '../models/one-event-types.model';\nimport { resolveColumnWidth, resolveOneCellRendererParams } from '../../helpers/one-column-def.helper';\n\n@Injectable()\nexport class OgColumnService {\n\n private defaultColumnDef: OneColumnDef = null;\n\n /**\n * The grid's `context`, so header callbacks receive the same one cell\n * callbacks do. Set during init; null in a bare service.\n */\n private context: unknown = null;\n\n /**\n * Every column, hidden ones included, in display order. `columnDefs$` below\n * carries only the visible subset — it is what the header and body render\n * from, so hiding a column means leaving it out of the emission, and every\n * consumer keeps working with no notion of visibility at all. This list is\n * what remembers a hidden column's place, width and pin for when it returns.\n */\n private allColumnDefs: OneColumnDef[] = [];\n private columnDefs$ = new BehaviorSubject<OneColumnDef[]>([]);\n private groupColumnDefs$ = new BehaviorSubject<OneGroupColumnDef[]>([]);\n\n initColumnDefs(defaultColumnDef: OneColumnDef, columnDefs: OneColumnDef[], groupColumnDefs: OneGroupColumnDef[], context: unknown = null): void {\n\n this.defaultColumnDef = defaultColumnDef;\n\n this.context = context;\n\n this.setGroupColumnDefs(groupColumnDefs);\n \n this.setColumnDefs(columnDefs);\n }\n\n getColumnState(): ColumnChangedEvent {\n\n const columns = this.columnDefs$.getValue();\n\n const groups = this.groupColumnDefs$.getValue();\n\n return { columns, groups };\n }\n\n setGroupColumnDefs(groupColumnDefs: OneGroupColumnDef[]): void {\n\n const groups = groupColumnDefs.map((group: OneGroupColumnDef) => this.resolveGroupPresentation(group, { context: this.context }));\n\n this.groupColumnDefs$.next(groups);\n }\n\n setColumnDefs(columnDefs: OneColumnDef[]): void {\n\n const columns = columnDefs.map((col: OneColumnDef) => {\n\n const column = {\n ...this.defaultColumnDef,\n ...col,\n id: col?.field ? col.field : lodash.uniqueId('col_'),\n };\n\n return this.resolveHeaderPresentation(column);\n });\n\n this.commit(columns);\n }\n\n /**\n * Re-band, re-measure and publish a new column list.\n *\n * Every mutation funnels here so the master list and the visible emission\n * cannot drift apart.\n */\n private commit(columns: OneColumnDef[]): void {\n\n const ordered = this.applyPinning(columns);\n\n this.allColumnDefs = ordered;\n\n const visible = ordered.filter(column => !column.hide);\n\n this.recalculateGroups(visible);\n\n this.columnDefs$.next(visible);\n }\n\n /**\n * Move pinned columns to their edge and measure how far in each one sits.\n *\n * Display order becomes left-pinned, unpinned, right-pinned, with declared\n * order preserved inside each band. `_pinnedOffset` is the distance from that\n * column's own edge — the sum of the widths of the pinned columns outside it\n * — which is what the sticky `left` / `right` binding needs.\n *\n * With nothing pinned this returns the same array, in the same order, so a\n * grid that does not use the feature is unaffected.\n */\n private applyPinning(columns: OneColumnDef[]): OneColumnDef[] {\n\n const left = columns.filter(column => column.pinned === 'left');\n const right = columns.filter(column => column.pinned === 'right');\n\n if (!left.length && !right.length) {\n\n for (const column of columns) {\n\n column._pinnedOffset = null;\n column._pinnedEdge = false;\n }\n\n return columns;\n }\n\n const center = columns.filter(column => column.pinned !== 'left' && column.pinned !== 'right');\n\n // Hidden columns keep their place in the band but take up no space, so\n // they are skipped when measuring offsets and never carry the divider.\n let offset = 0;\n\n for (const column of left) {\n\n column._pinnedOffset = offset;\n column._pinnedEdge = false;\n\n if (!column.hide) offset += resolveColumnWidth(column);\n }\n\n // Right-pinned columns are measured from the right edge inwards, so the\n // last declared one sits flush and the earlier ones stack outside it.\n offset = 0;\n\n for (let index = right.length - 1; index >= 0; index--) {\n\n right[index]._pinnedOffset = offset;\n right[index]._pinnedEdge = false;\n\n if (!right[index].hide) offset += resolveColumnWidth(right[index]);\n }\n\n for (const column of center) {\n\n column._pinnedOffset = null;\n column._pinnedEdge = false;\n }\n\n // Only the innermost visible column of each band carries the divider, so\n // stacked pinned columns do not each cast a shadow onto the next.\n const leftVisible = left.filter(column => !column.hide);\n const rightVisible = right.filter(column => !column.hide);\n\n if (leftVisible.length) leftVisible[leftVisible.length - 1]._pinnedEdge = true;\n if (rightVisible.length) rightVisible[0]._pinnedEdge = true;\n\n return [...left, ...center, ...right];\n }\n\n /** Total width of the visible columns frozen against the given edge. */\n public getPinnedWidth(side: 'left' | 'right'): number {\n\n return this.columnDefs$.getValue()\n .filter(column => column.pinned === side)\n .reduce((total, column) => total + resolveColumnWidth(column), 0);\n }\n\n // Update single column. Works on the master list, so a hidden column can be\n // patched — including `hide` itself, which is how visibility toggles.\n updateColumnDef(id: string, changes: Partial<OneColumnDef>): void {\n\n const updatedColumns = this.allColumnDefs.map(col => col.id === id ? { ...col, ...changes } : col);\n\n // Re-pinned (inside commit), not just re-grouped: resizing a pinned column\n // changes where the ones inside it have to sit, and this is the path a\n // column resize takes.\n this.commit(updatedColumns);\n }\n\n /**\n * Reorder columns. The indexes are *visible* positions — they come from the\n * header, which only renders visible columns — so they are mapped onto the\n * master list before splicing. A hidden column between the two keeps its\n * place relative to its neighbours.\n */\n reorderColumnDefs(fromIndex: number, toIndex: number): void {\n\n const columns = lodash.clone(this.allColumnDefs);\n const visible = columns.filter(column => !column.hide);\n\n const moved = visible[fromIndex];\n\n if (!moved) return;\n\n columns.splice(columns.indexOf(moved), 1);\n\n // Land before the visible column now at the target index — the same splice\n // the visible-only list used to do after removal — or at the end when the\n // target is past the last visible column.\n const visibleAfter = visible.filter(column => column !== moved);\n const anchor = visibleAfter[toIndex];\n\n columns.splice(anchor ? columns.indexOf(anchor) : columns.length, 0, moved);\n\n // Dragging can drop a column between two pinned ones; re-pinning (inside\n // commit) puts the bands back in order rather than leaving them\n // interleaved, which would make the computed offsets meaningless.\n this.commit(columns);\n }\n\n /**\n * Distribute the viewport width left over by fixed columns among the flex\n * ones, in proportion to their `flex` values and clamped to their bounds.\n *\n * @returns Whether any width actually changed — the caller only dispatches\n * (and the body only re-triggers) on a real change, which is what terminates\n * the columnChanged → flex → columnChanged loop.\n */\n applyFlexWidths(availableWidth: number): boolean {\n\n const visible = this.columnDefs$.getValue();\n const flexColumns = visible.filter(column => (column.flex ?? 0) > 0);\n\n if (!flexColumns.length || !(availableWidth > 0)) return false;\n\n const fixedWidth = visible\n .filter(column => !((column.flex ?? 0) > 0))\n .reduce((total, column) => total + resolveColumnWidth(column), 0);\n\n let remaining = Math.max(availableWidth - fixedWidth, 0);\n\n // Clamped columns stop flexing and release their share to the rest, so\n // the pass repeats until the split is stable. Each pass settles at least\n // one column; the loop is bounded by the column count.\n const widths = new Map<string, number>();\n let unsettled = [...flexColumns];\n\n while (unsettled.length) {\n\n const totalFlex = unsettled.reduce((total, column) => total + (column.flex ?? 0), 0);\n const share = remaining / totalFlex;\n\n const clamped = unsettled.filter(column => {\n\n const ideal = share * (column.flex ?? 0);\n const min = Math.max(column.minWidth ?? 0, 50);\n const max = column.maxWidth ?? Number.POSITIVE_INFINITY;\n const width = Math.min(Math.max(ideal, min), max);\n\n if (width === ideal) return false;\n\n widths.set(column.id, Math.round(width));\n remaining = Math.max(remaining - width, 0);\n\n return true;\n });\n\n unsettled = unsettled.filter(column => !clamped.includes(column));\n\n if (!clamped.length) {\n\n unsettled.forEach(column => widths.set(column.id, Math.floor(share * (column.flex ?? 0))));\n\n break;\n }\n }\n\n const changed = flexColumns.some(column => widths.get(column.id) !== resolveColumnWidth(column));\n\n if (!changed) return false;\n\n this.commit(this.allColumnDefs.map(column =>\n widths.has(column.id) ? { ...column, width: widths.get(column.id) } : column));\n\n return true;\n }\n\n /**\n * One JSON-safe entry per column — hidden ones included — in display order.\n */\n getColumnStateSnapshot(): OneColumnStateEntry[] {\n\n return this.allColumnDefs.map(column => {\n\n const entry: OneColumnStateEntry = { id: column.id, hide: !!column.hide, pinned: column.pinned ?? null };\n\n if (column.width != null) entry.width = column.width;\n\n return entry;\n });\n }\n\n /**\n * Restore a saved snapshot: order, width, pin and visibility.\n *\n * Entries are applied in the order given and become the front of the new\n * column order; columns the snapshot does not mention keep their current\n * relative order behind them, and ids the grid no longer has are skipped —\n * so a stale snapshot degrades to a partial restore instead of an error.\n * Only the properties present on an entry are applied.\n */\n applyColumnState(entries: OneColumnStateEntry[]): void {\n\n const byId = new Map(this.allColumnDefs.map(column => [column.id, column]));\n\n const mentioned = (entries ?? []).filter(entry => entry && byId.has(entry.id));\n const mentionedIds = new Set(mentioned.map(entry => entry.id));\n\n const restored = mentioned.map(entry => {\n\n const column = { ...byId.get(entry.id) };\n\n if (entry.width != null) column.width = entry.width;\n if ('pinned' in entry) column.pinned = entry.pinned ?? undefined;\n if ('hide' in entry) column.hide = !!entry.hide;\n\n return column;\n });\n\n const rest = this.allColumnDefs.filter(column => !mentionedIds.has(column.id));\n\n this.commit([...restored, ...rest]);\n }\n\n /**\n * Group Header Columns\n */\n private recalculateGroups(columnDefs: OneColumnDef[]) {\n\n if (this.groupColumnDefs$.getValue().length > 0) {\n\n const groups = this.groupColumnDefs$.value.map(group => ({\n ...group,\n width: columnDefs.filter(c => c.groupId === group.id).reduce((sum, col) => sum + resolveColumnWidth(col), 0)\n }));\n\n this.groupColumnDefs$.next(groups);\n }\n }\n\n resolveGroupPresentation(col: OneGroupColumnDef, params?: OneCellRendererParams): OneGroupColumnDef {\n\n col._resolvedGroupClass = typeof col.groupClass === 'function' ? col.groupClass(params) : col.groupClass;\n col._resolvedGroupStyle = typeof col.groupStyle === 'function' ? col.groupStyle(params) : col.groupStyle;\n\n return col;\n }\n\n /**\n * Resolve a column's header presentation. Once per column, when the columns\n * are set — a header is one cell for the whole column, so there is no row to\n * resolve it against and nothing to redo per render.\n *\n * This used to resolve the cell hooks too, from the same call, with no params\n * at all. Two bugs came out of that: any callback touching `params` threw a\n * TypeError at init, and the header's resolved value was then overwritten by\n * every cell that rendered, since the body re-ran the same method per cell\n * with row params. In dev mode the disagreement surfaced as NG0100.\n */\n resolveHeaderPresentation(col: OneColumnDef): OneColumnDef {\n\n const params: OneHeaderPresentationParams = {\n columnDef: col,\n field: col.field as string,\n context: this.context,\n };\n\n col._resolvedHeaderClass = typeof col.headerClass === 'function' ? col.headerClass(params) : col.headerClass;\n col._resolvedHeaderStyle = typeof col.headerStyle === 'function' ? col.headerStyle(params) : col.headerStyle;\n\n // The header's own predicates. Declared as `boolean | ((params) => boolean)`\n // and read straight off the column in the template, where a function is\n // simply truthy — so `sortable: () => false` rendered a sort button that a\n // consumer had explicitly asked not to have. Resolved here to a real\n // boolean, once, because none of them depends on a row.\n col._resolvedSortable = resolveOneCellRendererParams(col.sortable, params);\n col._resolvedResizable = resolveOneCellRendererParams(col.resizable, params);\n col._resolvedDragable = resolveOneCellRendererParams(col.dragable, params);\n col._resolvedFilterable = resolveOneCellRendererParams(col.filterable, params);\n col._resolvedSuppressHeaderMenuButton = resolveOneCellRendererParams(col.suppressHeaderMenuButton, params);\n\n return col;\n }\n\n /**\n * Resolve one cell's class, for one row.\n *\n * Pure: the result is returned rather than written back onto the column def,\n * which every row of that column shares. Writing to it worked only because\n * the template resolved and read in the same expression — one render order\n * away from every row showing the last row's class.\n */\n resolveCellClass(col: OneColumnDef, params: OneCellPresentationParams): string | string[] | undefined {\n\n return typeof col?.cellClass === 'function' ? col.cellClass(params) : col?.cellClass;\n }\n\n /** Resolve one cell's inline style, for one row. Pure, as above. */\n resolveCellStyle(col: OneColumnDef, params: OneCellPresentationParams): Record<string, string> | undefined {\n\n return typeof col?.cellStyle === 'function' ? col.cellStyle(params) : col?.cellStyle;\n }\n}","import { Injectable } from '@angular/core';\nimport { OneGridGetRowIdParams } from '../models/one-grid-types.model';\nimport { v4 as uuidv4 } from 'uuid';\n\n@Injectable()\nexport class OneGridRowService {\n\n private _getRowId: (params: OneGridGetRowIdParams) => string = null;\n\n /**\n * Set Row Id Funciton\n */\n public setGetRowIdFn(getRowId: (params: OneGridGetRowIdParams) => string) {\n\n this._getRowId = getRowId;\n }\n\n /**\n * Generate Unique Row ID\n */\n public generateRowId(data: any, rowIndex: number): string {\n\n if (this._getRowId) {\n\n return this._getRowId({ data, rowIndex }) ?? uuidv4();\n }\n\n return uuidv4();\n }\n\n /**\n * The row's id, or null when it cannot be known — no id function, or one\n * that answers nothing for this row. Unlike `generateRowId` this never\n * mints an id, which is what row matching (transactions) needs: a minted\n * id matches nothing and must not pretend otherwise.\n */\n public resolveRowId(data: any): string | null {\n\n return this._getRowId?.({ data, rowIndex: -1 }) ?? null;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { OneCellPresentationParams, OneCellState, OneCellStates, OneColumnDef } from '../models/one-column-def-types.model';\nimport { OneRowNode } from '../instants/one-row-node.class';\nimport { isCellEmpty, readCellValue } from '../../helpers/one-cell.helper';\nimport { resolveCellValueGetter, resolveOneCellRendererParams, resolveOneValueGetterParams } from '../../helpers/one-column-def.helper';\nimport type { OneGridApi } from '../instants/one-grid-api.class';\n\n@Injectable()\nexport class OneGridCellService {\n\n private _columnDefs: OneColumnDef[] = [];\n private _context: any;\n private _api: OneGridApi | null = null;\n\n public applyColumnDefs(columnDefs: OneColumnDef[], context: any) {\n\n this._columnDefs = columnDefs;\n this._context = context;\n }\n\n /**\n * Back-reference to the grid api, so predicate params can carry it.\n *\n * Pushed in rather than injected: `OneGridApi` already depends on this\n * service, and injecting it back would close a DI cycle.\n */\n public setGridApi(api: OneGridApi | null): void {\n\n this._api = api;\n }\n\n /**\n * The params every row-scoped column callback receives.\n *\n * One builder, deliberately: `editable`, `updatable`, `disable`, `rowDrag`,\n * `hideActionButton`, `cellClass`, `cellStyle`, `cellRenderer` and\n * `valueFormatter` are all \"decide something about this cell\", and a consumer\n * should not have to remember which of them happens to be handed `value` or\n * `field`. Each used to be called with a slightly different subset.\n */\n public cellParams(column: OneColumnDef, node: OneRowNode): OneCellPresentationParams {\n\n return {\n // Column config first, so the grid's own fields win a name collision: a\n // stale `value` left in `cellRendererParams` must not shadow this cell's.\n ...(column?.cellRendererParams ?? {}),\n value: this.resolveValue(node, column),\n data: node.data,\n node,\n rowIndex: node.rowIndex,\n field: column?.field as string,\n columnDef: column,\n api: this._api ?? undefined,\n context: this._context,\n };\n }\n\n /**\n * Generate New Node States\n */\n public generateCellStates(node: OneRowNode): OneCellStates | null {\n\n if (!node) return null;\n\n const newStates: OneCellStates = {};\n\n for (const column of this._columnDefs) {\n\n const field = column.field;\n\n // Cell state is keyed by field, so a column without one contributes\n // nothing. Skipping it keeps `undefined` out of the state object; such a\n // column still renders its action buttons, which do not read cell state.\n if (!field) continue;\n\n if (field !== '_oneRowNumber') {\n\n newStates[field] = this.generateCellState(node, column) ?? node.cellStates[field] ?? { type: 'none', value: '' };\n\n } else {\n\n newStates[field] = node.cellStates[field];\n }\n }\n\n return newStates;\n }\n\n /**\n * The cell's value: the `valueGetter`'s output where the column declares one,\n * the raw field otherwise. This is the value, not the display text — see\n * {@link formatValue}.\n */\n private resolveValue(node: OneRowNode, column: OneColumnDef): any {\n\n return column?.valueGetter\n ? resolveCellValueGetter(node.data, node, column, this._context)\n : readCellValue(node.data, column.field);\n }\n\n /**\n * Apply the column's `valueFormatter`.\n *\n * `valueFormatter` was declared on the column definition and called from\n * nowhere — a consumer could write one, get no error, and see nothing happen.\n * It runs on displayed text only, after the `valueGetter`, and is deliberately\n * skipped for placeholders: an empty cell already has its own mechanism in\n * `cellRendererParams.placeholder`, and two features competing to fill the\n * same gap is worse than one.\n *\n * Note that sorting and filtering read the underlying row data, not this —\n * which is exactly why formatting belongs here rather than in the getter.\n */\n private formatValue(node: OneRowNode, column: OneColumnDef, value: any): any {\n\n if (typeof column?.valueFormatter !== 'function') return value;\n\n // `value` is passed explicitly rather than left to `cellParams`: the empty\n // -cell branch resolves it through the getter before deciding whether there\n // is anything to format, and the formatter must see that same value.\n return column.valueFormatter({ ...this.cellParams(column, node), value });\n }\n\n /**\n * The placeholder for an empty cell, or `undefined` when this row's tree\n * depth may not be edited.\n *\n * `cellRendererParams.placeholder` is a prompt, not data: it renders at half\n * opacity where the value would go, which reads as \"click here and fill this\n * in\". On the auto group column `editableLevels` decides which depths accept\n * an edit at all, so a depth outside that list was advertising an edit the\n * grid then refuses — the cell offers no input and the prompt never clears.\n *\n * The suppression is scoped to columns that actually declare `editableLevels`.\n * The list is opt-in, and a column without one has no per-level rules rather\n * than no editable levels, so plain grids and untouched tree columns keep\n * showing their placeholder exactly as before.\n */\n private resolvePlaceholder(node: OneRowNode, column: OneColumnDef): string | undefined {\n\n const placeholder = column?.cellRendererParams?.placeholder;\n const editableLevels = column?.editableLevels;\n\n if (!column?.autoGroupField || !Array.isArray(editableLevels)) return placeholder;\n\n return editableLevels.includes(node?.level) ? placeholder : undefined;\n }\n\n /**\n * Generate New Node State Based on Column Field\n */\n public generateCellState(node: OneRowNode, column: OneColumnDef): OneCellState {\n\n // This was `field !== undefined || field !== '' || field !== null`, which is\n // true for every possible value including all three it meant to exclude —\n // `||` where `&&` was intended. It gated the four branches below, so none\n // of them could ever fall through to the default. Reduced to the check it\n // was reaching for: a column with no field has no value to render.\n const field = column?.field;\n\n if (!field) {\n\n return { type: 'none', value: '' };\n }\n\n const isEmpty = isCellEmpty(node.data, field);\n const isGroup = node.group || node.leafGroup;\n const isAutoGroup = column?.autoGroupField;\n\n if (column && column.cellRenderer && !isGroup) {\n\n // The renderer used to be handed `{ node, columnDef }` and nothing else,\n // so the obvious way to write one — `params.value` — produced the string\n // \"undefined\", and `params.data.x` threw. It now gets exactly what every\n // other row-scoped hook gets.\n return { type: 'html', value: column.cellRenderer(this.cellParams(column, node)) }\n }\n\n // 1. Cell Group Placeholder\n if (isEmpty && isGroup && isAutoGroup) {\n\n return { type: 'placeholder', value: this.resolvePlaceholder(node, column) ?? resolveCellValueGetter(node.data, node, column, this._context) ?? '' };\n }\n\n // 2. Cell Group Text Value\n if (isGroup && isAutoGroup) {\n\n const value = this.formatValue(node, column, this.resolveValue(node, column));\n\n return { type: 'text', value: value ?? '' };\n }\n\n // 3. Cell Placeholder\n //\n // The auto group column is deliberately NOT excluded here. Cases 1 and 2\n // above already claimed the group rows, so what reaches this point is a\n // leaf — and a leaf on the auto group column has to render its label too,\n // indented by level. Excluding it dropped every leaf through to case 5 and\n // rendered the group column blank for the whole bottom row of a tree.\n if (isEmpty && !isGroup) {\n\n const valueGetter = resolveCellValueGetter(node.data, node, column, this._context);\n\n if (valueGetter) {\n\n return { type: 'text', value: this.formatValue(node, column, valueGetter) };\n }\n\n const placeholder = this.resolvePlaceholder(node, column) ?? '';\n\n return { type: 'placeholder', value: placeholder };\n }\n\n // 4. Cell Text Value (leaves, including the auto group column — see above)\n if (!isGroup) {\n\n const value = this.formatValue(node, column, this.resolveValue(node, column));\n\n return { type: 'text', value: value ?? '' };\n }\n\n // 5. A group row outside the group column: render the value when the row\n // actually carries one — aggregates land in these cells, and a tree\n // parent's own data belongs on screen too. Blank stays blank.\n if (!isEmpty) {\n\n const value = this.formatValue(node, column, this.resolveValue(node, column));\n\n return { type: 'text', value: value ?? '' };\n }\n\n // 6. Default\n return { type: 'none', value: '' };\n }\n\n // ---------------------------------------------------------------------------\n // Row-scoped column predicates\n //\n // Every one of these resolves the same way and receives the same params, via\n // `cellParams`. They used to each build their own subset inline, which is how\n // `value`, `field` and `api` came to be missing from all of them.\n // ---------------------------------------------------------------------------\n\n /** Whether this cell may be edited at all. A capability: unset means no. */\n public editableFn = (column: OneColumnDef, node: OneRowNode): boolean =>\n resolveOneCellRendererParams(column?.editable, this.cellParams(column, node));\n\n /**\n * The second edit gate, ANDed with `editable`.\n *\n * A restriction, so unset means \"no restriction\". It used to resolve through\n * `!!undefined` to `false`, closing the gate on every column that did not name\n * it — so `editable: true` on its own made nothing editable.\n */\n public updatableFn = (column: OneColumnDef, node: OneRowNode): boolean =>\n resolveOneCellRendererParams(column?.updatable, this.cellParams(column, node), true);\n\n /** Disables this column's row action buttons. Not an edit gate. */\n public disableFn = (column: OneColumnDef, node: OneRowNode): boolean =>\n resolveOneCellRendererParams(column?.disable, this.cellParams(column, node));\n\n /** Hides this column's row action buttons entirely. */\n public hideActionButtonFn = (column: OneColumnDef, node: OneRowNode): boolean =>\n resolveOneCellRendererParams(column?.hideActionButton, this.cellParams(column, node));\n\n /** Whether this cell carries a row drag handle. */\n public rowDragFn = (column: OneColumnDef, node: OneRowNode): boolean =>\n resolveOneCellRendererParams(column?.rowDrag, this.cellParams(column, node));\n\n public valueGetterFn = (column: OneColumnDef, node: OneRowNode) =>\n resolveOneValueGetterParams(column?.valueGetter, { data: node.data, rowIndex: node.rowIndex, node, context: this._context });\n}\n","import { Injectable, OnDestroy } from '@angular/core';\nimport { Subject, Observable, Subscription } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\nimport { EventPayloadMap, EventType } from '../models/one-event-types.model';\n\n@Injectable()\nexport class OneGridEventService implements OnDestroy {\n\n private events$ = new Subject<{ type: EventType; payload: any }>();\n private subscriptions: Subscription[] = [];\n\n // Dispatch event\n dispatchEvent<K extends EventType>(type: K, payload: EventPayloadMap[K]): void {\n\n this.events$.next({ type, payload });\n }\n\n // Subscribe to event\n addEventListener<K extends EventType>(type: K, handler: (payload: EventPayloadMap[K]) => void): () => void {\n\n const subscription = this.events$\n .pipe(filter(e => e.type === type), map(e => e.payload as EventPayloadMap[K]))\n .subscribe(handler);\n\n // Track subscription for bulk cleanup\n this.subscriptions.push(subscription);\n\n // Return an unsubscribe function\n return () => subscription.unsubscribe();\n }\n\n // RxJS API\n eventStream<K extends EventType>(type: K): Observable<EventPayloadMap[K]> {\n\n return this.events$.pipe(filter(e => e.type === type), map(e => e.payload as EventPayloadMap[K]));\n }\n\n /**\n * Clear All Subscriptions\n */\n ngOnDestroy(): void {\n\n this.subscriptions.forEach(sub => sub.unsubscribe());\n\n this.subscriptions = [];\n\n this.events$.complete();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { OneCheckboxState, RowSelectionMode } from '../models/one-event-types.model';\n\n@Injectable()\nexport class OneGridSelectionService {\n\n private _selectedIds = new Set<string>();\n private _selectionMode: RowSelectionMode = null;\n\n public getSelectedIds(): Set<string> {\n\n return this._selectedIds;\n }\n\n public setSelectedIds(rowIds: string[]) {\n\n this._selectedIds = new Set(rowIds);\n }\n\n public getSelectionMode(): RowSelectionMode {\n\n return this._selectionMode;\n }\n\n public setSelectionMode(mode: RowSelectionMode) {\n\n this._selectionMode = mode;\n\n if (mode === 'single' && this._selectedIds.size > 1) {\n\n // keep only one if mode is single\n const first = this._selectedIds.values().next().value;\n\n this._selectedIds = new Set([first]);\n }\n }\n\n public toggleSelection(rowId: string, selected: boolean) {\n\n if (this._selectionMode === 'single') {\n\n this._selectedIds.clear();\n }\n\n selected ? this._selectedIds.add(rowId) : this._selectedIds.delete(rowId);\n }\n\n public toggleAllSelection(allIds: string[], selected: boolean) {\n\n selected ? this._selectedIds = new Set(allIds) : this._selectedIds.clear();\n }\n\n /**\n * Tri-state for the header checkbox, over the rows currently present.\n *\n * This compared `_selectedIds.size` with `allIds.length` and never checked\n * that the selected ids were among the present ones. Selecting two rows and\n * then swapping in two different rows reported `checked` with nothing\n * actually selected, because the two counts happened to match. Counting the\n * intersection is the only thing that answers the question being asked.\n */\n public getSelectAllState(allIds: (string)[]): OneCheckboxState {\n\n if (!allIds?.length) return 'unchecked';\n\n let selected = 0;\n\n for (const rowId of allIds) {\n\n if (this._selectedIds.has(rowId)) selected++;\n }\n\n if (selected === 0) return 'unchecked';\n\n return selected === allIds.length ? 'checked' : 'indeterminate';\n }\n\n public selectAll(rowIds: string[]): void {\n\n this._selectedIds = new Set(rowIds);\n }\n\n public deselectAll(): void {\n\n this._selectedIds.clear();\n }\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable()\nexport class OneGridExpansionService {\n\n private _expandedIds = new Set<string>();\n private _collapsedIds = new Set<string>();\n\n getExpandedIds(): Set<string> {\n\n return this._expandedIds;\n }\n\n getCollapsedIds(): Set<string> {\n\n return this._collapsedIds;\n }\n\n toggleExpanded(rowId: string, expanded: boolean): void {\n\n if (expanded) {\n\n this._expandedIds.add(rowId);\n\n this._collapsedIds.delete(rowId);\n\n } else {\n\n this._expandedIds.delete(rowId);\n\n this._collapsedIds.add(rowId);\n }\n }\n\n isExpanded(rowId: string): boolean {\n\n return this._expandedIds.has(rowId);\n }\n\n isCollapsed(rowId: string): boolean {\n\n return this._collapsedIds.has(rowId);\n }\n\n clear(): void {\n\n this._expandedIds.clear();\n\n this._collapsedIds.clear();\n }\n}\n","import { OneCellRendererComponent } from '../models/one-tree-data.model';\nimport { OneColumnDef, OneColumnStateEntry } from '../models/one-column-def-types.model';\nimport { OneRowNode } from \"./one-row-node.class\";\nimport { OneGridInitOptions, OneGridType, OneRowTransaction, OneSortModel } from '../models/one-grid-types.model';\nimport { OneGridEventService } from '../services/one-grid-event.service';\nimport { OneGridSelectionService } from '../services/one-grid-selection.service';\nimport { OneRowValidationErrors, OneValidationResult } from '../models/one-validation.model';\nimport { OneFilterModel } from \"../models/one-filter.model\";\nimport { OneGridExpansionService } from '../services/one-grid-expansion.service';\nimport { OneDetailCellRendererParams, OneGetDetailRowDataParams } from \"../models/one-master-detail.model\";\nimport { OneGridRowService } from \"../services/one-grid-row.service\";\nimport { filterTreeNode, isFilterActive } from \"../../helpers/one-filter.helper\";\nimport { buildCsv, OneCsvExportOptions } from \"../../helpers/one-csv.helper\";\nimport { buildGroupedRows, OneAggColumn, ONE_GROUP_ID_FIELD } from \"../../helpers/one-row-grouping.helper\";\nimport { OneRowDragSuppressedReason } from \"../models/one-row-drag.model\";\nimport { getFieldValue } from \"../../helpers/one-cell.helper\";\nimport { OneGridCellService } from '../services/one-grid-cell.service';\nimport { v4 as uuidv4 } from 'uuid';\nimport { Injectable, Type } from \"@angular/core\";\nimport { CellValueChangedEvent, ColumnChangedEvent, OnePinnedRowSide, RowSelectionMode } from \"../models/one-event-types.model\";\nimport { OneGroupColumnDef } from \"../models/one-column-def-types.model\";\nimport { OgColumnService } from \"../services/og-column.service\";\n\n@Injectable()\nexport class OneGridApi<T = any> {\n\n // ---------------------------------------------------------------------------\n // Public state\n //\n // Exposed as getters, not fields. These were writable, so a consumer could\n // corrupt the grid by assigning to them — swapping `rowNodes` for an\n // unrelated array, or setting `sortModel` without the rows ever being\n // re-sorted. Reads are unchanged; only assignment is now a compile error.\n //\n // The array-valued ones are typed `readonly T[]`, which stops `push` and\n // `splice` at compile time without copying on every read. Use\n // `getAllRowNodes()` when you want a copy you own.\n // ---------------------------------------------------------------------------\n private _id: string;\n private _context: any = null;\n private _rowSelection: RowSelectionMode = null;\n private _apiType: OneGridType = null;\n private _rowNodes: OneRowNode<T>[] = [];\n private _sortModel: OneSortModel<T>[] = [];\n\n /** Unique per grid instance, assigned during `init`. */\n public get id(): string {\n return this._id;\n }\n\n /** The `[context]` the grid was given. */\n public get context(): any {\n return this._context;\n }\n\n /** Selection mode, captured during `init`. Changing the input later has no effect. */\n public get rowSelection(): RowSelectionMode {\n return this._rowSelection;\n }\n\n /** Which role this instance plays: simple, master, detail or tree. */\n public get apiType(): OneGridType {\n return this._apiType;\n }\n\n /** Every node the grid holds, in flattened order. */\n public get rowNodes(): readonly OneRowNode<T>[] {\n return this._rowNodes;\n }\n\n /** The sort model currently applied. Change it with `onSortChanged`. */\n public get sortModel(): readonly OneSortModel<T>[] {\n return this._sortModel;\n }\n\n\n private rowHeight: number = 26;\n private headerRowHeight: number = 32;\n private _currentIndex: number = 0;\n private _quickFilterValue: string = null;\n private _activeFilters: OneFilterModel[] = [];\n\n private _visibleRowNodes: OneRowNode<T>[] = [];\n private readonly _pinnedRowNodes: Record<OnePinnedRowSide, OneRowNode<T>[]> = { top: [], bottom: [] };\n private _originalRowNodes: Map<string, OneRowNode<T>> = new Map();\n private _nodeCleanupMap = new Map<string, Array<() => void>>(); // Cleanup registry (prevents memory leaks)\n private _destroyed: boolean = false;\n\n // Advanced Features\n private treeData: boolean = false;\n private treeDataChildrenField: string = null;\n private groupDefaultExpanded: number = 0;\n\n private masterDetail: boolean = false;\n private detailCellRendererParams: OneDetailCellRendererParams;\n private detailRendererComponent?: Type<OneCellRendererComponent>;\n\n /**\n * Supplies a master row's detail rows. Set through `setGetDetailRowData`;\n * previously a writable public field with a setter beside it, which left two\n * ways to do the same thing and one of them unchecked.\n */\n private _getDetailRowData: (params: OneGetDetailRowDataParams) => void;\n\n constructor(\n private columnService: OgColumnService,\n private rowService: OneGridRowService,\n private cellService: OneGridCellService,\n private eventService: OneGridEventService,\n private selectionService: OneGridSelectionService,\n private expansionService: OneGridExpansionService\n ) { }\n\n /**\n * Stand the grid up. Called by `OneGridComponent` from `ngOnInit`.\n *\n * Takes a single `OneGridInitOptions` rather than the ten positional\n * arguments it used to, so a call site reads as the configuration it is and\n * a new option no longer means editing every caller.\n *\n * @internal Applications obtain a ready-made API from `(onGridReady)`; they\n * should never call this themselves.\n */\n init(options: OneGridInitOptions<T>): void {\n\n const {\n gridType,\n columnDefs,\n defaultColumnDef = {},\n groupColumnDefs = [],\n context = null,\n rowSelection = null,\n masterDetail = false,\n detailCellRendererParams = null,\n detailRendererComponent = null,\n treeData = false,\n } = options;\n\n this._id = uuidv4();\n this._apiType = gridType;\n this._rowSelection = rowSelection;\n this._context = context;\n this.masterDetail = masterDetail;\n this.detailCellRendererParams = detailCellRendererParams;\n this.detailRendererComponent = detailRendererComponent;\n this.treeData = treeData;\n\n this.selectionService.setSelectionMode(rowSelection);\n\n // Synthetic group rows carry their own stable id — the path of group\n // values — which no host getRowId knows how to derive. The wrapper reads\n // it first and defers to the host's function (or the uuid fallback) for\n // real rows, so grouping keeps expansion across rebuilds even when the\n // host provided no id function at all.\n const hostGetRowId = context?.componentParent?.getRowId ?? null;\n\n this.rowService.setGetRowIdFn((params: { data: any; rowIndex: number }) =>\n params?.data?.[ONE_GROUP_ID_FIELD] ?? hostGetRowId?.(params) ?? null);\n\n this.cellService.applyColumnDefs(columnDefs, context);\n this.cellService.setGridApi(this);\n this.columnService.initColumnDefs(defaultColumnDef, columnDefs, groupColumnDefs, context);\n\n const columnState = this.columnService.getColumnState();\n\n setTimeout(() => this.eventService.dispatchEvent('columnChanged', columnState as ColumnChangedEvent));\n }\n\n /**\n * Replace every row, discarding selection and expansion.\n *\n * Use this when the rows represent something new. To swap the data while\n * keeping what the user has selected and opened, use `updateRowData`.\n */\n public setRowData(rowData: T[]) {\n\n this.rebuildRows(rowData, true);\n }\n\n /**\n * Replace every row, keeping selection and expansion.\n *\n * State is keyed by row id, so this only preserves anything if the grid has a\n * `context.componentParent.getRowId` — otherwise each rebuild mints new ids\n * and there is nothing left to match against.\n */\n public updateRowData(rowData: T[]) {\n\n this.rebuildRows(rowData, false);\n }\n\n /**\n * Apply a batch of row changes without the host rebinding the dataset:\n * append rows (at the root, or under a parent by id on tree data), replace\n * rows by id, drop rows at any depth. Selection and expansion survive —\n * this is `updateRowData` fed from the grid's own current rows, so the\n * host keeps no parallel copy to reconcile.\n *\n * Requires a stable `context.componentParent.getRowId`: rows are matched by\n * id, and without an id function there is nothing to match on — the\n * transaction is refused with a warning rather than half-applied.\n */\n public applyTransaction(transaction: OneRowTransaction<T>): void {\n\n if (this._destroyed || !transaction) return;\n\n const sample = transaction.update?.[0] ?? transaction.add?.[0]\n ?? (transaction.remove ?? []).find(entry => typeof entry !== 'string');\n\n if (sample !== undefined && this.rowService.resolveRowId(sample) === null) {\n\n console.warn('[one-grid] applyTransaction needs context.componentParent.getRowId — rows are matched by id. Nothing was applied.');\n\n return;\n }\n\n const removeIds = new Set(\n (transaction.remove ?? []).map(entry =>\n typeof entry === 'string' ? entry : this.rowService.resolveRowId(entry)),\n );\n\n const updates = new Map(\n (transaction.update ?? []).map(data => [this.rowService.resolveRowId(data), data]),\n );\n\n const childrenField = this.treeDataChildrenField;\n\n // Row grouping folds flat rows itself, so the transaction operates on the\n // leaves and re-groups; a parent target would name a synthetic group row,\n // which is not a place data can live.\n const grouping = this._rowGroupFields.length > 0;\n const addToParentId = grouping ? undefined : transaction.addToParentId;\n\n if (grouping && transaction.addToParentId) {\n\n console.warn('[one-grid] applyTransaction: addToParentId is ignored under row grouping — groups are synthetic. Rows were added at the root.');\n }\n\n // Copy-on-write over the grid's own current rows: the node graph carries\n // the data, so the host's original arrays are never mutated and untouched\n // branches keep their object identity for the node-reuse path.\n const applyTo = (rows: T[]): T[] => rows\n .filter(data => !removeIds.has(this.rowService.resolveRowId(data)))\n .map(data => {\n\n const id = this.rowService.resolveRowId(data);\n\n let next = updates.get(id) ?? data;\n\n if (this.treeData && childrenField) {\n\n const children = (next as Record<string, unknown>)[childrenField] as T[] | undefined;\n const rebuilt = children ? applyTo(children) : undefined;\n\n const withAdded = id != null && id === addToParentId\n ? [...(rebuilt ?? []), ...(transaction.add ?? [])]\n : rebuilt;\n\n if (withAdded !== children) next = { ...next, [childrenField]: withAdded ?? [] };\n }\n\n return next;\n });\n\n const currentRows = grouping\n ? this._rowNodes.filter(node => node.leaf).map(node => node.data)\n : this._rowNodes.filter(node => !node.parent).map(node => node.data);\n\n let roots = applyTo(currentRows);\n\n if (transaction.add?.length && !addToParentId) {\n\n roots = [...roots, ...transaction.add];\n }\n\n this.rebuildRows(roots, false);\n }\n\n /**\n * The one row-loading path. `setRowData` and `updateRowData` differed only in\n * whether they cleared the state services first, so everything else — build,\n * filter, prune — lives here once.\n */\n private rebuildRows(rowData: T[], resetState: boolean): void {\n\n if (this._destroyed) return;\n\n if (resetState) {\n\n this.selectionService.deselectAll();\n this.expansionService.clear();\n }\n\n // Row grouping is a transform on the way in: the host keeps handing the\n // grid flat rows, and the tree pipeline below sees synthetic group rows\n // with children — the same shape tree data arrives in.\n if (this._rowGroupFields.length) {\n\n rowData = buildGroupedRows(rowData, this._rowGroupFields, this._aggColumns) as T[];\n }\n\n const validRowIds = new Set<string>();\n\n this.buildRowNodes(rowData, null, 0, validRowIds);\n\n // Prune BEFORE sorting and filtering: both read `_originalRowNodes`, and\n // with the prune last, a data swap while a sort was active resurrected\n // the removed rows into `_rowNodes` for one whole render — the old and\n // the new dataset on screen together until the next rebuild.\n this.pruneRemovedNodes(validRowIds);\n\n // Re-apply the active sort. `buildRowNodes` rebuilds the row list in the\n // order the data arrived, so without this a data update silently returned\n // the rows to that order while `sortModel` — and therefore the header's\n // sort arrow — still said they were sorted. Sorting before filtering\n // because filtering only sets visibility on whatever order this leaves.\n if (this._sortModel.length > 0) this.applySorting();\n\n this.applyFilters();\n }\n\n /**\n * Recursive Build Row Nodes (Optimized)\n */\n private buildRowNodes(\n rowData: T[],\n parent: OneRowNode<T> | null = null,\n level: number = 0,\n validRowIds: Set<string> = new Set(),\n expandedIds: Set<string> = new Set(this.expansionService.getExpandedIds()),\n collapsedIds: Set<string> = new Set(this.expansionService.getCollapsedIds()),\n selectedIds: Set<string> = new Set(this.selectionService.getSelectedIds()),\n visitedData: Set<unknown> = new Set()\n ): OneRowNode[] {\n\n if (parent === null) {\n\n this._rowNodes = [];\n this._currentIndex = 0;\n }\n\n if (!rowData?.length) return [];\n\n const nodes: OneRowNode<T>[] = [];\n\n for (const data of rowData) {\n\n const rowId = this.rowService.generateRowId(data, this._currentIndex);\n\n // A cycle in the children graph — a row reachable from its own subtree,\n // the classic ORM back-reference — used to recurse until the stack blew,\n // freezing the app; and with generated row ids it did so while minting\n // nodes the whole way down. The same guard also drops a duplicate row id\n // (or the same row object appearing twice): first occurrence wins.\n if (visitedData.has(data) || validRowIds.has(rowId)) {\n\n console.warn(`[one-grid] cyclic or duplicate row (id \"${rowId}\") — skipped, first occurrence wins. Tree data must be acyclic and row ids unique.`);\n\n continue;\n }\n\n visitedData.add(data);\n\n const children = (data as any)[this.treeDataChildrenField] || null;\n\n let node: OneRowNode = this._originalRowNodes.get(rowId);\n\n validRowIds.add(rowId);\n\n if (node) {\n\n node.data = data;\n node.setRowIndex(this._currentIndex);\n\n } else {\n\n node = new OneRowNode<T>(rowId, data, this._currentIndex);\n node.level = level;\n node.parent = parent;\n node.detailRendererComponent = this.detailRendererComponent;\n\n this._originalRowNodes.set(rowId, node);\n\n if (this.masterDetail) {\n\n this.subscribeToDetailChanges(node);\n }\n }\n\n const childrenExist = children && children.length >= 0;\n\n // Coerced, because `childrenExist` is `children && children.length >= 0`\n // — which is `null` for a row with no children field, not `false`. These\n // are declared `boolean`, and assigning null made every consumer compare\n // truthiness instead of the value.\n node.group = this.masterDetail ? false : !!childrenExist;\n node.leaf = this.masterDetail ? true : !node.group;\n node.leafGroup = this.masterDetail ? false : (node.group && !childrenExist);\n node.expandable = this.masterDetail ? true : (node.group && !node.leafGroup);\n\n const defaultExpanded = node.expandable && (level < this.groupDefaultExpanded || this.groupDefaultExpanded === -1);\n\n node.setExpanded(expandedIds.has(rowId) ? true : collapsedIds.has(rowId) ? false : defaultExpanded);\n node.setSelected(selectedIds.has(rowId));\n node.setCellStates(this.cellService.generateCellStates(node));\n\n if (this.masterDetail && this._apiType === 'master') {\n\n this._getDetailRowData({ data, node: node, successCallback: (detailRowData) => node.setDetailRowData(detailRowData) });\n }\n\n this._currentIndex++;\n this._rowNodes.push(node);\n\n nodes.push(node);\n\n node.children = this.treeData && childrenExist ? this.buildRowNodes(children || [], node, level + 1, validRowIds, expandedIds, collapsedIds, selectedIds, visitedData) : [];\n }\n\n return nodes;\n }\n\n /**\n * Filter Feature\n */\n private applyFilters(): void {\n\n const filters = this._activeFilters;\n\n const quick = this._quickFilterValue?.toLowerCase() ?? '';\n\n // The fields the grid actually shows. Without them the quick filter falls\n // back to every property on the row, which lets a user match on data that\n // has no column and never appears on screen.\n const fields = this.quickFilterFields();\n\n this._rowNodes.forEach(node => filterTreeNode(node, filters, quick, fields));\n\n this.refreshVisibleNodes();\n }\n\n /**\n * Which fields the quick filter searches: every column that has one.\n *\n * Empty while the columns are still being registered, in which case the\n * helper falls back to searching the row — the same behaviour as before, and\n * the only sensible answer when the grid does not yet know its columns.\n */\n private quickFilterFields(): string[] {\n\n return this.columnService\n .getColumnState()\n .columns\n .map(column => column.field as string)\n .filter((field): field is string => !!field && field !== '_oneRowNumber');\n }\n\n /**\n * Update Row Nodes Display\n */\n private refreshVisibleNodes(dispatch: boolean = true): void {\n\n if (this._destroyed) return;\n\n const visibleNodes: OneRowNode[] = [];\n\n let rowNumber = 1;\n\n const visibilityCache = new Map<string, boolean>();\n\n for (const node of this._rowNodes) {\n\n const parentVisible = node.parent ? visibilityCache.get(node.parent.rowId) : true;\n\n const isVisible = node.visible && parentVisible && (!node.parent || node.parent.expanded);\n\n visibilityCache.set(node.rowId, isVisible);\n\n if (isVisible) {\n\n node.cellStates['_oneRowNumber'] = { type: 'text', value: rowNumber++ };\n\n node.cellStates = { ...node.cellStates };\n\n visibleNodes.push(node);\n\n } else {\n\n node.cellStates['_oneRowNumber'] = { type: 'none', value: null };\n }\n }\n\n this._visibleRowNodes = [...visibleNodes];\n\n if (dispatch) this.eventService.dispatchEvent('rowDataChanged', { nodes: visibleNodes });\n }\n\n /**\n * Replace the rows anchored to one edge of the grid.\n *\n * Pinned rows are deliberately kept out of `rowNodes` and\n * `_originalRowNodes`: they are not data. Sorting, filtering, selection,\n * expansion, pagination and the visible row count all ignore them, which is\n * the whole point of a summary row. They render with the same column\n * definitions, so renderers and value getters work as they do everywhere\n * else.\n */\n public setPinnedRowData(side: OnePinnedRowSide, rowData: T[]): void {\n\n if (this._destroyed) return;\n\n for (const node of this._pinnedRowNodes[side]) node.destroy();\n\n this._pinnedRowNodes[side] = (rowData ?? []).map((data, index) => {\n\n // Ids are namespaced by side and position. They never collide with a data\n // row's id, and they are stable across rebuilds, which keeps the rendered\n // `data-cell-id` attributes stable too.\n const node = new OneRowNode<T>(`one-pinned-${side}-${index}`, data, index);\n\n node.level = 0;\n node.leaf = true;\n node.visible = true;\n node.setCellStates(this.cellService.generateCellStates(node));\n\n return node;\n });\n\n this.eventService.dispatchEvent('pinnedRowDataChanged', {\n side,\n nodes: this._pinnedRowNodes[side],\n });\n }\n\n /** The rows anchored to one edge. Read-only; change them with `setPinnedRowData`. */\n public getPinnedRowNodes(side: OnePinnedRowSide): readonly OneRowNode<T>[] {\n\n return this._pinnedRowNodes[side];\n }\n\n /**\n * Row reordering\n * --------------------------------------------------------------------------\n *\n * `_originalRowNodes` is the source of truth for row order: its insertion\n * order is what `applySorting` falls back to when the sort model empties, and\n * what a rebuild walks. `_rowNodes` is only the current display order. A move\n * that touched one and not the other would either be undone by the next sort\n * change or invisible until one happened, so both are rewritten together.\n */\n\n /**\n * Whether the displayed order is the data order, and so whether a manual move\n * would survive.\n *\n * @returns the reason reordering is unavailable, or `null` when it is fine.\n */\n public getRowDragSuppressedReason(): OneRowDragSuppressedReason | null {\n\n if (this.treeData) return 'treeData';\n\n if (this._sortModel.length > 0) return 'sorted';\n\n if (isFilterActive(this._activeFilters, this._quickFilterValue ?? '')) return 'filtered';\n\n return null;\n }\n\n /** Convenience inverse of {@link getRowDragSuppressedReason}. */\n public canReorderRows(): boolean {\n\n return this.getRowDragSuppressedReason() === null;\n }\n\n /**\n * Move a row from one position to another.\n *\n * Indices are positions in the grid's row order, the same order\n * `getAllRowNodes()` returns. `targetIndex` is where the row ends up *after*\n * it has been lifted out of `sourceIndex` — dragging row 0 to the bottom of a\n * 5-row grid is `moveRow(0, 4)`, not `moveRow(0, 5)`.\n *\n * @returns `true` if the rows moved. `false` when the move was rejected —\n * out-of-range indices, a no-op, or an order the grid does not own\n * (see {@link getRowDragSuppressedReason}) — so a caller can tell a\n * refused move from an applied one.\n */\n public moveRow(sourceIndex: number, targetIndex: number): boolean {\n\n if (this._destroyed) return false;\n\n if (!this.canReorderRows()) return false;\n\n const order = [...this._originalRowNodes.values()];\n\n if (!Number.isInteger(sourceIndex) || !Number.isInteger(targetIndex)) return false;\n\n if (sourceIndex < 0 || sourceIndex >= order.length) return false;\n\n if (targetIndex < 0 || targetIndex >= order.length) return false;\n\n if (sourceIndex === targetIndex) return false;\n\n const [moved] = order.splice(sourceIndex, 1);\n\n order.splice(targetIndex, 0, moved);\n\n // Rebuilt rather than mutated: a Map preserves insertion order, and there\n // is no way to reposition a key within one.\n this._originalRowNodes = new Map(order.map(node => [node.rowId, node]));\n\n this._rowNodes = order;\n\n this.reindexRows();\n\n this.eventService.dispatchEvent('rowOrderChanged', { nodes: this._visibleRowNodes as OneRowNode<T>[], node: moved, fromIndex: sourceIndex, toIndex: targetIndex });\n\n return true;\n }\n\n /**\n * Move a row identified by id. Convenient when the caller holds a node rather\n * than a position — the index it was built with goes stale after any move.\n */\n public moveRowById(rowId: string, targetIndex: number): boolean {\n\n const sourceIndex = [...this._originalRowNodes.values()].findIndex(node => node.rowId === rowId);\n\n return sourceIndex === -1 ? false : this.moveRow(sourceIndex, targetIndex);\n }\n\n /**\n * Re-stamp `rowIndex` from the current order.\n *\n * Row index is denormalised onto every node, and half the grid reads it —\n * cell params, the range selection, the detail lookup. Leaving it stale after\n * a move puts every row below the drop point one out.\n */\n private reindexRows(): void {\n\n this._rowNodes.forEach((node, index) => node.setRowIndex(index));\n\n // Silent: row numbers and the visible list have to be rebuilt, but the\n // `rowDataChanged` that normally follows defers a frame and re-seeds detail\n // rows. A keyboard drag fires one of these per arrow key, and `moveRow`\n // announces itself through `rowOrderChanged` instead.\n this.refreshVisibleNodes(false);\n }\n\n public getVisibleRowNodes(): OneRowNode<T>[] {\n\n return this._visibleRowNodes;\n }\n\n /**\n * Sorting Model Feature\n */\n public onSortChanged(sortModel: OneSortModel<T>[]) {\n\n if (this._destroyed) return;\n\n this._sortModel = sortModel;\n\n this.applySorting();\n\n this.eventService.dispatchEvent('sortChanged', { nodes: this._rowNodes, sortModel: this._sortModel });\n }\n\n private applySorting(): void {\n\n if (this._sortModel.length === 0) {\n\n this._rowNodes = [...this._originalRowNodes.values()];\n\n return;\n }\n\n const comparator = (a: OneRowNode<T>, b: OneRowNode<T>): number => {\n\n for (const sortItem of this._sortModel) {\n\n const { colId, sort } = sortItem;\n const valA = getFieldValue(a.data, colId as string);\n const valB = getFieldValue(b.data, colId as string);\n const comparisonResult = this.compareValues(valA, valB, sort);\n\n if (comparisonResult !== 0) {\n\n return comparisonResult;\n }\n }\n return 0;\n };\n\n if (!this.treeData) {\n\n this._rowNodes = [...this._originalRowNodes.values()].sort(comparator);\n\n return;\n }\n\n // A tree sorts siblings within their parent, never across it — a flat\n // sort of the whole list interleaved parents with other parents' children\n // and scrambled the hierarchy. Sorting the sibling arrays and re-walking\n // depth-first keeps every parent immediately above its own children,\n // which `refreshVisibleNodes` also depends on for its visibility cache.\n // Group rows carry their aggregates in `data`, so sorting a grouped grid\n // on an aggregated column orders the groups by their aggregate.\n const flattened: OneRowNode<T>[] = [];\n\n const walk = (siblings: OneRowNode<T>[]): OneRowNode<T>[] => {\n\n const sorted = [...siblings].sort(comparator);\n\n for (const node of sorted) {\n\n flattened.push(node);\n\n if (node.children?.length) {\n\n node.children = walk(node.children as OneRowNode<T>[]);\n }\n }\n\n return sorted;\n };\n\n walk([...this._originalRowNodes.values()].filter(node => !node.parent));\n\n this._rowNodes = flattened;\n }\n\n private compareValues(valA: any, valB: any, sortDirection: 'asc' | 'desc'): number {\n\n // `undefined` has to be treated as empty alongside `null`: getFieldValue\n // returns undefined for a missing field or an unresolved dotted path, and\n // comparing undefined with < / > yields false both ways, which made such\n // rows settle in whatever order the sort happened to encounter them.\n const aEmpty = valA === null || valA === undefined;\n const bEmpty = valB === null || valB === undefined;\n\n if (aEmpty && bEmpty) return 0;\n if (aEmpty) return sortDirection === 'asc' ? 1 : -1;\n if (bEmpty) return sortDirection === 'asc' ? -1 : 1;\n\n if (typeof valA === 'string' && typeof valB === 'string') {\n\n const comparison = valA.localeCompare(valB, undefined, { numeric: true });\n return sortDirection === 'asc' ? comparison : -comparison;\n }\n\n if (valA < valB) return sortDirection === 'asc' ? -1 : 1;\n if (valA > valB) return sortDirection === 'asc' ? 1 : -1;\n return 0;\n }\n\n /**\n * Row Selection Feature (Optimized)\n */\n public selectAll(): void {\n\n const rowIds: string[] = [];\n\n this._originalRowNodes.forEach(node => {\n\n node.setSelected(true);\n\n node.cellStates = { ...node.cellStates };\n\n rowIds.push(node.rowId);\n });\n\n this.selectionService.selectAll(rowIds);\n\n this.eventService.dispatchEvent('selectionChanged', { allNodesNotSelected: false, allNodesSelected: true, selected: true, node: null });\n }\n\n /**\n * Deselect all nodes (optimized)\n */\n public deselectAll(): void {\n\n this._originalRowNodes.forEach(node => {\n\n node.setSelected(false);\n\n node.cellStates = { ...node.cellStates };\n });\n\n this.selectionService.deselectAll();\n\n if (this.selectionService.getSelectionMode() === 'multiple') {\n\n this.eventService.dispatchEvent('selectionChanged', {\n allNodesNotSelected: true,\n allNodesSelected: false,\n selected: false,\n node: null\n });\n }\n }\n\n /**\n * Select or deselect one row, honouring the grid's selection mode.\n *\n * The mode rule used to live in the checkbox component, which meant the only\n * way to select a row was to click that checkbox — anything else reaching for\n * `toggleSelection` got multi-select behaviour on a single-select grid. It\n * lives here so every path into selection obeys the same rule.\n *\n * @returns `false` when the grid has no selection mode, so a caller can tell\n * a refused request from an applied one.\n */\n public toggleRowSelection(rowId: string, selected: boolean): boolean {\n\n if (this._destroyed || !this._rowSelection) return false;\n\n const node = this.getRowNodeById(rowId);\n\n if (!node) return false;\n\n // Single select is \"this row and no other\", which means clearing first.\n if (this._rowSelection === 'single') this.deselectAll();\n\n this.toggleSelection(rowId, selected);\n\n node.cellStates = { ...node.cellStates };\n\n return true;\n }\n\n /**\n * Select every row between two, inclusive, in display order.\n *\n * What a shift-extended keyboard selection needs. Multi-select only — a\n * single-select grid has no meaningful range.\n */\n public selectRowRange(fromRowId: string, toRowId: string): boolean {\n\n if (this._destroyed || this._rowSelection !== 'multiple') return false;\n\n const order = this._visibleRowNodes.length ? this._visibleRowNodes : this._rowNodes;\n\n const from = order.findIndex(node => node.rowId === fromRowId);\n const to = order.findIndex(node => node.rowId === toRowId);\n\n if (from === -1 || to === -1) return false;\n\n const ids = order\n .slice(Math.min(from, to), Math.max(from, to) + 1)\n .map(node => node.rowId);\n\n this.setSelectedByIds(ids, true);\n\n return true;\n }\n\n public toggleSelection(rowId: string, selected: boolean): void {\n\n const node = this.getRowNodeById(rowId);\n\n if (node) {\n\n node.setSelected(selected);\n\n this.selectionService.toggleSelection(rowId, selected);\n\n this.eventService.dispatchEvent('selectionChanged', { node, data: node.data, selected });\n }\n }\n\n public setSelectedById(rowId: string) {\n\n const node = this.getRowNodeById(rowId);\n\n if (node) {\n\n if (this.selectionService.getSelectionMode() === 'single') {\n\n this._rowNodes.forEach(rowNode => rowNode.setSelected(rowNode.rowId === node.rowId));\n\n this._originalRowNodes.forEach(rowNode => rowNode.setSelected(rowNode.rowId === node.rowId));\n\n } else {\n\n node.setSelected(true);\n }\n\n this.selectionService.toggleSelection(rowId, true);\n\n this.eventService.dispatchEvent('selectionChanged', { node, selected: true });\n }\n }\n\n public setSelectedByIds(rowIds: string[], selected: boolean = true) {\n\n rowIds.forEach(rowId => {\n\n const node = this._originalRowNodes.get(rowId);\n\n if (node) {\n\n node.setSelected(selected);\n\n node.cellStates = { ...node.cellStates };\n\n this.selectionService.toggleSelection(rowId, selected);\n }\n });\n\n this.eventService.dispatchEvent('selectionChanged', { node: null });\n }\n\n /**\n * Get & Set Functions\n */\n public getAllRowNodes(): OneRowNode<T>[] {\n\n return this._rowNodes?.length > 0 ? [...this._rowNodes] : [];\n }\n\n public getRowDataSelected(): T[] {\n\n return this._rowNodes.filter(node => node.selected).map(node => ({ ...node.data }));\n }\n\n public getSelectedRowNodes(): OneRowNode<T>[] {\n\n const nodes = this._rowNodes.filter(node => node.selected);\n\n return nodes && nodes.length > 0 ? [...nodes] : [];\n }\n\n /**\n * Column filters\n */\n public getFilterModel(): OneFilterModel[] {\n\n return this._activeFilters;\n }\n\n public setFilterModel(model: OneFilterModel[]): void {\n\n if (this._destroyed) return;\n\n this._activeFilters = model;\n\n this.applyFilters();\n }\n\n public filterActive(field: string): boolean {\n\n return this._activeFilters.some(f => f.field === field && f.conditions.length > 0);\n }\n\n /**\n * Quick filter\n */\n public setQuickFilter(value: string): void {\n\n if (this._destroyed) return;\n\n this._quickFilterValue = (value || '').toLowerCase();\n\n this.applyFilters();\n }\n\n /**\n * Run the column validators over one row.\n *\n * Rules run in order and stop at the first failure, so a field appears at\n * most once. Fields that passed are absent rather than mapped to `null`.\n *\n * The row type comes from the grid's own `T` — this used to declare its own\n * `<T>`, which shadowed the class parameter and let an `OneGridApi<Employee>`\n * happily validate an unrelated shape against employee columns.\n */\n public validateRow(row: T, columns: OneColumnDef<T>[]): OneRowValidationErrors<T> {\n\n const errors: OneRowValidationErrors<T> = {};\n\n for (const column of columns) {\n\n // A column can only contribute an error if it has both rules and a field\n // to key them under.\n if (!column.field || !column.validationRules?.length) continue;\n\n for (const rule of column.validationRules) {\n\n const error = rule(row[column.field], row);\n\n if (error) {\n\n errors[column.field] = error;\n\n break; // first failure per column wins\n }\n }\n }\n\n return errors;\n }\n\n /**\n * Run the column validators over a whole dataset.\n *\n * Delegates to `validateRow` so the two can never disagree about what counts\n * as invalid — they previously carried separate copies of the same loop.\n */\n public validateAllRows(rowData: T[], columns: OneColumnDef<T>[]): OneValidationResult<T> {\n\n const allErrors = rowData.map(row => this.validateRow(row, columns));\n\n const hasErrors = allErrors.some(errors => Object.keys(errors).length > 0);\n\n return { errors: allErrors, valid: !hasErrors, invalid: hasErrors };\n }\n\n /**\n * Traverse every node, depth-first, once each.\n *\n * `rowNodes` is already the flattened tree — `buildRowNodes` pushes every\n * node into it as it descends — so walking it is the whole traversal. The\n * previous implementation walked that flat list *and* recursed into\n * `children`, visiting every nested node twice and every depth-3 node three\n * times. `index` is the node's position in the flattened order, matching\n * `node.rowIndex`, rather than its position among its siblings.\n */\n public forEachNode(callback: (node: OneRowNode<T>, index: number) => void) {\n\n this._rowNodes.forEach((node, index) => callback(node, index));\n }\n\n /** Traverse only leaf nodes, once each, in flattened order. */\n public forEachLeafNode(callback: (node: OneRowNode<T>, index: number) => void) {\n\n let leafIndex = 0;\n\n for (const node of this._rowNodes) {\n\n if (node.leaf) callback(node, leafIndex++);\n }\n }\n\n public getRowNodeById(rowId: string): OneRowNode<T> {\n\n return this._originalRowNodes.get(rowId);\n }\n\n /**\n * Expand/collapse a node\n */\n public setTreeDataChildrenField(field: string) {\n\n this.treeDataChildrenField = field;\n }\n\n public setGroupDefaultExpanded(defaultExpanded: number) {\n\n this.groupDefaultExpanded = defaultExpanded;\n }\n\n /**\n * Expansion state lives in two places, and they answer different questions.\n *\n * `OneGridExpansionService` records only *deliberate* changes — a click, or\n * one of the methods below. It is an override layer: `buildRowNodes` consults\n * it first and falls back to `groupDefaultExpanded` for every row the user\n * has not touched. That is what lets a later `groupDefaultExpanded` change\n * take effect, and what lets a collapse survive a rebuild.\n *\n * `node.expanded` is the resolved truth for a row, defaults included. Public\n * reads report that; the override sets stay internal.\n *\n * The invariant the setters below maintain: `expanded` is only ever true for\n * a node that can expand.\n */\n public toggleExpandAll(expanded: boolean) {\n\n this.forEachNode(node => {\n\n if (!node.expandable) return;\n\n node.setExpanded(expanded);\n\n this.expansionService.toggleExpanded(node.rowId, expanded)\n });\n\n this.refreshVisibleNodes();\n }\n\n public setExpandedById(rowId: string, expanded: boolean) {\n\n const node = this._originalRowNodes.get(rowId);\n\n if (node?.expandable) {\n\n node.setExpanded(expanded);\n\n this.expansionService.toggleExpanded(rowId, expanded);\n }\n\n this.refreshVisibleNodes();\n }\n\n public setExpandedByIds(rowIds: string[], expanded: boolean) {\n\n if (rowIds && rowIds.length > 0) {\n\n for (let rowId of rowIds) {\n\n const node = this._originalRowNodes.get(rowId);\n\n if (node?.expandable) {\n\n node.setExpanded(expanded);\n\n this.expansionService.toggleExpanded(rowId, expanded);\n }\n }\n\n this.refreshVisibleNodes();\n }\n }\n\n /**\n * Every currently expanded row, in tree order.\n *\n * Derived from the nodes rather than read off the override record, so rows\n * opened by `groupDefaultExpanded` are included — previously this returned\n * only rows someone had explicitly toggled, and came back empty on first load\n * while the first level was visibly open.\n */\n public getExpandedByIds(): string[] {\n\n return this._rowNodes\n\n .filter(node => node.expandable && node.expanded)\n\n .map(node => node.rowId);\n }\n\n /**\n * Master Detail Feature\n */\n public setDetailRowData(node: OneRowNode<T>, detailData: any[]) {\n\n if (this._destroyed) return;\n\n const rowNode = this.getRowNodeById(node.rowId);\n\n if (rowNode) {\n\n rowNode.setDetailRowData(detailData);\n }\n }\n\n public setGetDetailRowData(getDetailRowData: (params: OneGetDetailRowDataParams) => void) {\n\n this._getDetailRowData = getDetailRowData;\n }\n\n /**\n * Columns State\n */\n public getColumnState(): ColumnChangedEvent {\n\n return this.columnService.getColumnState();\n }\n\n public setColumnDefs(columnDefs: OneColumnDef<T>[]): void {\n\n if (this._destroyed) return;\n\n this.columnService.setColumnDefs(columnDefs);\n\n const columnState = this.columnService.getColumnState();\n\n this.cellService.applyColumnDefs(columnState.columns, this._context);\n\n // Cell state is derived from the columns, so replacing them wholesale\n // stales every node built before this ran. Tree and grouping mode hit\n // this on every load: the group column registers from a deferred\n // setColumnDefs, after the host has typically already loaded rows —\n // hosts used to have to defer setRowData themselves to dodge it.\n this.regenerateCellStates();\n\n this.eventService.dispatchEvent('columnChanged', columnState);\n }\n\n public updateColumn(id: string, changes: Partial<OneColumnDef<T>>): void {\n\n const before = this.visibleColumnFields();\n\n this.columnService.updateColumnDef(id, changes);\n\n const columnState = this.columnService.getColumnState();\n\n this.cellService.applyColumnDefs(columnState.columns, this._context);\n\n // Only when the set of visible columns changed (a hide, a show): a cell\n // state can appear or disappear then. Width patches — this method runs\n // per mousemove during a resize — skip the O(rows × columns) pass.\n if (this.visibleColumnFields() !== before) this.regenerateCellStates();\n\n this.eventService.dispatchEvent('columnChanged', columnState);\n }\n\n /** The visible fields as one comparable key. */\n private visibleColumnFields(): string {\n\n return this.columnService.getColumnState().columns?.map(column => column.field).join('|') ?? '';\n }\n\n /** Recompute every node's cell states against the current columns. */\n private regenerateCellStates(): void {\n\n const refresh = (node: OneRowNode) => node.setCellStates(this.cellService.generateCellStates(node));\n\n this._rowNodes.forEach(refresh);\n this._pinnedRowNodes.top.forEach(refresh);\n this._pinnedRowNodes.bottom.forEach(refresh);\n }\n\n public reorderColumnDefs(fromIndex: number, toIndex: number): void {\n\n this.columnService.reorderColumnDefs(fromIndex, toIndex);\n\n const columnState = this.columnService.getColumnState();\n\n this.eventService.dispatchEvent('columnChanged', columnState);\n }\n\n // ---------------------------------------------------------------------------\n // Row grouping\n // ---------------------------------------------------------------------------\n\n private _rowGroupFields: string[] = [];\n private _aggColumns: OneAggColumn<T>[] = [];\n\n /** The fields the rows are grouped by, in nesting order. Empty when off. */\n public get rowGroupFields(): readonly string[] {\n\n return this._rowGroupFields;\n }\n\n /**\n * Turn row grouping on. Called by `OneGridComponent` when column\n * definitions declare `rowGroup`; the grid then behaves as a tree over\n * synthetic group rows, and `setRowData` / `updateRowData` keep taking the\n * flat rows they always took.\n */\n public setRowGrouping(groupFields: string[], aggregations: OneAggColumn<T>[] = []): void {\n\n this._rowGroupFields = groupFields ?? [];\n this._aggColumns = aggregations ?? [];\n }\n\n // ---------------------------------------------------------------------------\n // Undo / redo of cell edits\n // ---------------------------------------------------------------------------\n\n private _undoLimit = 0;\n private _undoStack: { rowId: string; field: string; oldValue: any; newValue: any }[] = [];\n private _redoStack: { rowId: string; field: string; oldValue: any; newValue: any }[] = [];\n\n /**\n * Start recording committed cell edits for undo/redo. Called by\n * `OneGridComponent` from `[undoRedoCellEditing]`; the stack keeps the last\n * `limit` edits. Programmatic `setDataValue` writes are not recorded — only\n * commits, the ones that raise `cellValueChanged` without a source.\n */\n public enableUndoRedoCellEditing(limit: number = 10): void {\n\n if (this._undoLimit > 0) return;\n\n this._undoLimit = Math.max(Math.floor(limit), 1);\n\n this.eventService.addEventListener('cellValueChanged', (event: CellValueChangedEvent<T>) => {\n\n if (event.source) return;\n\n this._undoStack.push({ rowId: event.node.rowId, field: event.field, oldValue: event.oldValue, newValue: event.newValue });\n\n if (this._undoStack.length > this._undoLimit) this._undoStack.shift();\n\n // A new edit forks history; what was undone can no longer be redone.\n this._redoStack = [];\n });\n }\n\n /** Revert the most recent committed edit. Returns whether one was undone. */\n public undoCellEditing(): boolean {\n\n return this.replayEdit(this._undoStack, this._redoStack, 'undo');\n }\n\n /** Re-apply the most recently undone edit. Returns whether one was redone. */\n public redoCellEditing(): boolean {\n\n return this.replayEdit(this._redoStack, this._undoStack, 'redo');\n }\n\n public getCurrentUndoSize(): number {\n\n return this._undoStack.length;\n }\n\n public getCurrentRedoSize(): number {\n\n return this._redoStack.length;\n }\n\n private replayEdit(\n from: { rowId: string; field: string; oldValue: any; newValue: any }[],\n to: { rowId: string; field: string; oldValue: any; newValue: any }[],\n source: 'undo' | 'redo',\n ): boolean {\n\n if (this._destroyed) return false;\n\n const edit = from.pop();\n\n if (!edit) return false;\n\n const node = this.getRowNodeById(edit.rowId);\n\n // The row can be gone — a setRowData replaced the data under the stack.\n // The edit is dropped rather than replayed onto nothing.\n if (!node) return false;\n\n const value = source === 'undo' ? edit.oldValue : edit.newValue;\n const previous = source === 'undo' ? edit.newValue : edit.oldValue;\n\n (node.data as Record<string, unknown>)[edit.field] = value;\n\n this.updateCellStates(node);\n\n to.push(edit);\n\n const column = this.columnService.getColumnState().columns?.find(col => col.field === edit.field) ?? null;\n\n this.eventService.dispatchEvent('cellValueChanged', {\n node,\n data: node.data,\n column: column as OneColumnDef<T>,\n field: edit.field,\n oldValue: previous,\n newValue: value,\n source,\n });\n\n return true;\n }\n\n // ---------------------------------------------------------------------------\n // Client-side pagination\n // ---------------------------------------------------------------------------\n\n private _clientPagination = false;\n private _pageSize = 25;\n private _currentPage = 1;\n\n /** The paging state, when the grid pages its own rows. */\n public get paginationState(): Readonly<{ enabled: boolean; pageSize: number; currentPage: number }> {\n\n return { enabled: this._clientPagination, pageSize: this._pageSize, currentPage: this._currentPage };\n }\n\n /**\n * Turn grid-owned paging on or off. Called by `OneGridComponent` from its\n * `clientSidePagination` input; the display slice is what changes — the\n * full dataset stays behind the API (selection, filters and sorting keep\n * operating on all of it).\n */\n public setClientSidePagination(enabled: boolean, pageSize?: number): void {\n\n this._clientPagination = enabled;\n\n if (pageSize && pageSize > 0) this._pageSize = pageSize;\n\n this._currentPage = 1;\n }\n\n /** Change the page size and return to the first page. */\n public setPageSize(pageSize: number): void {\n\n if (this._destroyed || !(pageSize > 0)) return;\n\n this._pageSize = Math.floor(pageSize);\n this._currentPage = 1;\n\n this.applyFilters();\n }\n\n /** Move to a page (1-based). Clamped to at least 1; the top end clamps when the slice is taken. */\n public setCurrentPage(page: number): void {\n\n if (this._destroyed) return;\n\n const target = Math.max(Math.floor(page), 1);\n\n if (target === this._currentPage) return;\n\n this._currentPage = target;\n\n this.applyFilters();\n }\n\n /**\n * The slice of rows the current page shows — a passthrough while paging is\n * off. The body routes its render list through here, after reporting the\n * full count, so `rowCountChanged` keeps meaning \"rows after filtering\"\n * whether or not the grid pages.\n */\n public pageNodes(nodes: readonly OneRowNode<T>[]): OneRowNode<T>[] {\n\n if (!this._clientPagination) return (nodes ?? []) as OneRowNode<T>[];\n\n const lastPage = Math.max(Math.ceil((nodes?.length ?? 0) / this._pageSize), 1);\n\n // A shrinking dataset (a filter, a delete) can strand the page past the\n // end; clamping here shows the last page instead of an empty one.\n if (this._currentPage > lastPage) this._currentPage = lastPage;\n\n const start = (this._currentPage - 1) * this._pageSize;\n\n return (nodes ?? []).slice(start, start + this._pageSize) as OneRowNode<T>[];\n }\n\n /**\n * Size the flex columns into the given width.\n *\n * Called by the grid body with its own viewport width — on first render, on\n * container resize and after column changes — so `columnDef.flex` works\n * without the host doing anything. Also callable directly with any width.\n * A no-op when no visible column declares `flex` or nothing would change.\n */\n public applyFlexWidths(availableWidth: number): void {\n\n if (this._destroyed) return;\n\n if (!this.columnService.applyFlexWidths(availableWidth)) return;\n\n const columnState = this.columnService.getColumnState();\n\n this.cellService.applyColumnDefs(columnState.columns, this._context);\n\n this.eventService.dispatchEvent('columnChanged', columnState);\n }\n\n /**\n * The current grid as CSV: visible columns in display order, visible rows\n * in current sort order, values through the same getter/formatter pipeline\n * the cells render with. Pinned rows and detail grids are not data and are\n * not included.\n */\n public getDataAsCsv(options: OneCsvExportOptions = {}): string {\n\n const nodes = options.onlySelected ? this.getSelectedRowNodes() : this._visibleRowNodes;\n\n return buildCsv(nodes as OneRowNode<T>[], this.columnService.getColumnState().columns as OneColumnDef<T>[], this._context, options);\n }\n\n /** Build the CSV and hand it to the browser as a download. */\n public exportDataAsCsv(options: OneCsvExportOptions = {}): void {\n\n if (typeof document === 'undefined') return;\n\n const blob = new Blob([this.getDataAsCsv(options)], { type: 'text/csv;charset=utf-8;' });\n\n const link = document.createElement('a');\n\n link.href = URL.createObjectURL(blob);\n link.download = options.fileName ?? 'export.csv';\n link.click();\n\n URL.revokeObjectURL(link.href);\n }\n\n /**\n * Show or hide one column. A hidden column keeps its order, width and pin,\n * so showing it again restores it exactly.\n */\n public setColumnVisible(id: string, visible: boolean): void {\n\n this.updateColumn(id, { hide: !visible });\n }\n\n /**\n * Persistable layout state: one JSON-safe entry per column — hidden ones\n * included — in display order. Feed it back through `applyColumnState`.\n */\n public getColumnStateSnapshot(): OneColumnStateEntry[] {\n\n return this.columnService.getColumnStateSnapshot();\n }\n\n /**\n * Restore a snapshot from `getColumnStateSnapshot`: order, width, pin and\n * visibility. Ids the grid no longer has are skipped, so a stale snapshot\n * degrades to a partial restore rather than an error.\n */\n public applyColumnState(entries: OneColumnStateEntry[]): void {\n\n if (this._destroyed) return;\n\n this.columnService.applyColumnState(entries);\n\n const columnState = this.columnService.getColumnState();\n\n this.cellService.applyColumnDefs(columnState.columns, this._context);\n\n // A restore can show columns that were hidden when the rows were built,\n // and their cells have no state yet.\n this.regenerateCellStates();\n\n this.eventService.dispatchEvent('columnChanged', columnState);\n }\n\n /**\n * Update checkbox selection features\n */\n public setNodeAndChildrenSelected(node: OneRowNode, selected: boolean) {\n\n const rowIds = new Set<string>();\n\n const collect = (n: OneRowNode) => {\n\n rowIds.add(n.rowId);\n\n if (n.children && n.children.length) {\n\n n.children.forEach(child => collect(child));\n }\n };\n\n collect(node);\n\n this.setSelectedByIds(Array.from(rowIds), selected);\n }\n\n /**\n * @deprecated Identical to `updateCellStates`. Kept as an alias so existing\n * callers keep working; prefer `updateCellStates`, which says what it does.\n */\n public updateNodeStates(node: OneRowNode) {\n\n this.updateCellStates(node);\n }\n\n public updateCellState(node: OneRowNode, column: OneColumnDef): void {\n\n const rowNode = this.getRowNodeById(node.rowId);\n\n if (rowNode) {\n\n rowNode.cellStates[column.field] = this.cellService.generateCellState(rowNode, column);\n }\n }\n\n /**\n * Recompute every cell of one row and repaint it.\n *\n * The repaint is the point: this is what a caller reaches for after mutating\n * a row in place, and it used to regenerate the state and stop there. The\n * body renders with OnPush, so nothing marked it dirty and the new state sat\n * unread until some unrelated event happened to trigger change detection —\n * which is why callers ended up nudging the grid with a synthetic DOM event.\n */\n public updateCellStates(node: OneRowNode): void {\n\n if (this._destroyed) return;\n\n const rowNode = this.getRowNodeById(node.rowId);\n\n if (!rowNode) return;\n\n rowNode.cellStates = this.cellService.generateCellStates(rowNode);\n\n this.eventService.dispatchEvent('cellStateChanged', { data: rowNode.data, node: rowNode });\n }\n\n /**\n * Handler that Reacts to Detail Changes\n */\n /**\n * Keep a master row's reserved height in step with its detail rows.\n *\n * Two listeners used to be registered here and thrown away: an empty\n * `rowDataChanged` handler whose unsubscribe was never kept, and an\n * `expandedChanged` handler whose body was entirely commented out. Both are\n * gone — a listener with no behaviour is a leak with no upside.\n */\n private subscribeToDetailChanges(node: OneRowNode): void {\n\n const unsubscribeDetail = node.on('detailRowDataChanged', ({ node }) => {\n\n if (this._apiType === 'master') {\n\n this.resolveDetailRowHeight(node);\n }\n });\n\n this.registerNodeCleanup(node.rowId, [unsubscribeDetail]);\n }\n\n private registerNodeCleanup(rowId: string, unsubs: Array<() => void>): void {\n\n // Merge with any existing cleanups for this rowId\n const existing = this._nodeCleanupMap.get(rowId) ?? [];\n\n this._nodeCleanupMap.set(rowId, [...existing, ...unsubs]);\n }\n\n private cleanupNode(rowId: string): void {\n\n const cleanups = this._nodeCleanupMap.get(rowId);\n\n cleanups?.forEach(fn => fn());\n\n this._nodeCleanupMap.delete(rowId);\n }\n\n /**\n * Drop nodes that are no longer in the data, releasing what they hold.\n *\n * This existed but was never called: `setRowData` and `updateRowData` each\n * deleted straight out of `_originalRowNodes`, so a removed node kept its\n * listeners and its entry in `_nodeCleanupMap` for the lifetime of the grid.\n * Both now come through here, which unsubscribes and clears the node first.\n */\n private pruneRemovedNodes(validRowIds: Set<string>): void {\n\n for (const [rowId, node] of this._originalRowNodes) {\n\n if (!validRowIds.has(rowId)) {\n\n this.cleanupNode(rowId); // unsubscribe listeners\n\n node.destroy(); // clear node's own listener map\n\n this._originalRowNodes.delete(rowId);\n }\n }\n }\n\n /**\n * Height a master row must reserve for its detail grid:\n * rowHeight x clamp(rows, minRows, maxRows) + headerHeight.\n */\n private resolveDetailRowHeight(node: OneRowNode): void {\n\n const heightOptions = this.detailCellRendererParams?.detailGridOptions?.detailRowHeightOptions;\n\n // Reachable whenever masterDetail is on but detailCellRendererParams is\n // incomplete; without the guard this threw from inside an event listener.\n if (!heightOptions) return;\n\n const minRows = heightOptions.minRows;\n const maxRows = heightOptions.maxRows;\n\n const minHeight = (this.rowHeight * minRows) + this.headerRowHeight;\n const maxHeight = (this.rowHeight * maxRows) + this.headerRowHeight;\n\n const rows = node.detailRowData && node.detailRowData.length ? node.detailRowData.length : 0;\n\n node.detailRowHeight = rows <= minRows ? minHeight : rows >= maxRows ? maxHeight : (this.rowHeight * rows) + this.headerRowHeight;\n }\n\n /**\n * Release everything the grid holds. Called by `OneGridComponent.ngOnDestroy`.\n *\n * The services are deliberately *not* nulled out any more. They are injected,\n * Angular owns their lifetime, and nulling them only guaranteed a\n * `TypeError` for any callback that arrived after teardown — a detail-row\n * fetch resolving late, or the body's deferred update. `_destroyed` makes\n * those calls no-ops instead, which is what a torn-down object should do.\n */\n public destroy(): void {\n\n if (this._destroyed) return;\n\n this._destroyed = true;\n\n // Unsubscribe every per-node listener before dropping the nodes.\n for (const rowId of Array.from(this._nodeCleanupMap.keys())) {\n\n this.cleanupNode(rowId);\n }\n\n // `destroy` drops the tree links and the listeners; the API no longer has\n // to reach in and unpick each node itself.\n this._originalRowNodes.forEach(node => node.destroy());\n this._rowNodes.forEach(node => node.destroy());\n\n for (const side of ['top', 'bottom'] as OnePinnedRowSide[]) {\n\n this._pinnedRowNodes[side].forEach(node => node.destroy());\n this._pinnedRowNodes[side] = [];\n }\n\n this._rowNodes = [];\n this._visibleRowNodes = [];\n this._originalRowNodes.clear();\n this._nodeCleanupMap.clear();\n this._currentIndex = 0;\n\n // Release the back-reference the cell service holds, so a torn-down api is\n // not kept alive by the service that outlives this call.\n this.cellService.setGridApi(null);\n\n this.selectionService.deselectAll();\n this.expansionService.clear();\n\n this._activeFilters = [];\n this._quickFilterValue = null;\n this._sortModel = [];\n this._context = null;\n\n this.masterDetail = false;\n this.treeData = false;\n this.treeDataChildrenField = null;\n this.groupDefaultExpanded = 0;\n this.detailCellRendererParams = null;\n this.detailRendererComponent = null;\n this._getDetailRowData = null;\n }\n\n /** Whether `destroy` has run. Late callbacks check this before doing work. */\n public get destroyed(): boolean {\n\n return this._destroyed;\n }\n}\n","import { Injectable, NgZone, OnDestroy, inject } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { OneRowDragEvent, OneRowDragState } from '../models/one-row-drag.model';\nimport { OneRowNode } from '../instants/one-row-node.class';\n\n/** What the body has to lend the service to run a drag. */\nexport interface OneRowDragContext<T = any> {\n\n /** The scrolling element the rows live in. */\n viewport: HTMLElement;\n\n /** Fixed row height. The whole index calculation rests on rows being uniform. */\n itemSize: number;\n\n /** Current display order. Read fresh on every move — a drag mutates it. */\n nodes: () => OneRowNode<T>[];\n\n /** Apply the move. Returns false if the grid refused it. */\n move: (fromIndex: number, toIndex: number) => boolean;\n}\n\n/** Pointer distance before a press becomes a drag. */\nconst DRAG_THRESHOLD_PX = 4;\n\n/** How close to an edge auto-scroll kicks in, and how fast it goes. */\nconst EDGE_ZONE_PX = 36;\nconst EDGE_SPEED_PX = 12;\n\n/**\n * Owns one row-drag gesture at a time.\n *\n * Built on pointer events rather than HTML5 drag-and-drop or the CDK's\n * drag-drop:\n *\n * - HTML5 DnD does not fire for touch at all, and its drag image cannot be\n * styled to match the grid.\n * - `cdkDropList` assumes every item it manages is in the DOM. Inside a virtual\n * scroll viewport rows unmount as they leave the buffer, so the list it\n * thinks it is sorting is only ever the visible window.\n * - Pointer events cover mouse, touch and pen in one path, and pointer capture\n * keeps the gesture alive when the finger leaves the row it started on.\n *\n * Because rows are a fixed `itemSize`, the drop target is arithmetic on the\n * pointer's Y rather than a hit test against row elements — which is also why\n * it stays correct for rows that are scrolled out and not rendered.\n */\n@Injectable()\nexport class OneGridRowDragService<T = any> implements OnDestroy {\n\n private readonly zone = inject(NgZone);\n\n /** Live drag, for the body to render the handle state and the indicator. */\n readonly state$ = new BehaviorSubject<OneRowDragState | null>(null);\n\n /** Screen-reader narration for the keyboard path. */\n readonly announcement$ = new BehaviorSubject<string>('');\n\n private context: OneRowDragContext<T> | null = null;\n\n private pointerId: number | null = null;\n private handle: HTMLElement | null = null;\n private startY = 0;\n private armed = false;\n private lastClientY = 0;\n private scrollFrame: number | null = null;\n\n /** A move already applied during this drag, so a cancel can undo it. */\n private appliedFrom: number | null = null;\n\n private onMove?: (event: OneRowDragEvent<T>) => void;\n private onEnd?: (event: OneRowDragEvent<T> | null) => void;\n\n attach(context: OneRowDragContext<T>): void {\n\n this.context = context;\n }\n\n get state(): OneRowDragState | null {\n\n return this.state$.value;\n }\n\n get dragging(): boolean {\n\n return this.state$.value !== null;\n }\n\n // -------------------------------------------------------------------------\n // Pointer\n // -------------------------------------------------------------------------\n\n /**\n * Begin a pointer drag. Nothing visible happens until the pointer has moved\n * {@link DRAG_THRESHOLD_PX}, so a click on the handle — which is also the\n * keyboard affordance — is not swallowed by a zero-distance drag.\n */\n startPointerDrag(\n event: PointerEvent,\n node: OneRowNode<T>,\n handlers: { onEnd?: (event: OneRowDragEvent<T> | null) => void } = {},\n ): void {\n\n if (!this.context || this.dragging || this.pointerId !== null) return;\n\n // Secondary buttons open context menus; they are not a drag.\n if (event.button !== 0) return;\n\n const index = this.indexOf(node);\n\n if (index === -1) return;\n\n this.pointerId = event.pointerId;\n this.handle = event.target as HTMLElement;\n this.startY = event.clientY;\n this.lastClientY = event.clientY;\n this.armed = false;\n this.appliedFrom = index;\n this.onEnd = handlers.onEnd;\n\n this.handle.setPointerCapture?.(event.pointerId);\n\n // Outside Angular: pointermove fires at the display's refresh rate and\n // every one of them would otherwise run change detection over the grid.\n // The few that change the drop target re-enter through `publish`.\n this.zone.runOutsideAngular(() => {\n document.addEventListener('pointermove', this.handlePointerMove, { passive: false });\n document.addEventListener('pointerup', this.handlePointerUp);\n document.addEventListener('pointercancel', this.handlePointerCancel);\n document.addEventListener('keydown', this.handlePointerKeydown);\n });\n }\n\n private handlePointerMove = (event: PointerEvent): void => {\n\n if (this.pointerId === null || event.pointerId !== this.pointerId) return;\n\n if (!this.armed) {\n\n if (Math.abs(event.clientY - this.startY) < DRAG_THRESHOLD_PX) return;\n\n this.armed = true;\n\n this.publish({ rowId: this.nodeAt(this.appliedFrom!)?.rowId ?? '', fromIndex: this.appliedFrom!, insertAt: this.appliedFrom!, source: 'pointer' });\n }\n\n // Held so the auto-scroll loop can recompute the target as the viewport\n // moves under a stationary finger.\n this.lastClientY = event.clientY;\n\n // Touch scrolling would otherwise pan the viewport out from under us.\n event.preventDefault();\n\n this.updateFromPointer();\n this.updateAutoScroll();\n };\n\n private handlePointerUp = (event: PointerEvent): void => {\n\n if (this.pointerId === null || event.pointerId !== this.pointerId) return;\n\n const dragged = this.armed;\n\n this.teardownPointer();\n\n if (!dragged) {\n\n this.reset();\n\n return;\n }\n\n this.commit('pointer');\n };\n\n private handlePointerCancel = (): void => {\n\n this.teardownPointer();\n\n this.cancel();\n };\n\n /** Escape aborts a pointer drag, the same as it does a keyboard one. */\n private handlePointerKeydown = (event: KeyboardEvent): void => {\n\n if (event.key !== 'Escape') return;\n\n event.preventDefault();\n\n this.teardownPointer();\n\n this.cancel();\n };\n\n /**\n * Turn the pointer's Y into an insertion boundary.\n *\n * Boundaries, not rows: the value is where the row would be *inserted*, so\n * 0 is above the first row and `length` is below the last. Rounding rather\n * than flooring puts the split at the middle of each row, which is what\n * makes the indicator flip when you cross the halfway point.\n */\n private updateFromPointer(): void {\n\n const current = this.state$.value;\n\n if (!this.context || !current) return;\n\n const rect = this.context.viewport.getBoundingClientRect();\n const offset = this.lastClientY - rect.top + this.context.viewport.scrollTop;\n\n const insertAt = this.clamp(Math.round(offset / this.context.itemSize), 0, this.context.nodes().length);\n\n if (insertAt === current.insertAt) return;\n\n this.publish({ ...current, insertAt });\n }\n\n /**\n * Scroll when the pointer sits near an edge, so rows outside the viewport\n * are reachable without letting go. Runs on rAF while the pointer is parked\n * in the zone, and re-derives the target each frame because the content\n * moves while the pointer does not.\n */\n private updateAutoScroll(): void {\n\n if (!this.context) return;\n\n const rect = this.context.viewport.getBoundingClientRect();\n\n const distanceToTop = this.lastClientY - rect.top;\n const distanceToBottom = rect.bottom - this.lastClientY;\n\n let delta = 0;\n\n if (distanceToTop < EDGE_ZONE_PX) delta = -EDGE_SPEED_PX;\n else if (distanceToBottom < EDGE_ZONE_PX) delta = EDGE_SPEED_PX;\n\n if (delta === 0) {\n\n this.stopAutoScroll();\n\n return;\n }\n\n if (this.scrollFrame !== null) return;\n\n const step = (): void => {\n\n if (!this.context || !this.dragging) {\n\n this.stopAutoScroll();\n\n return;\n }\n\n const viewport = this.context.viewport;\n const before = viewport.scrollTop;\n\n viewport.scrollTop = before + delta;\n\n // Hit the end — nothing more to reveal, so stop burning frames.\n if (viewport.scrollTop === before) {\n\n this.stopAutoScroll();\n\n return;\n }\n\n this.updateFromPointer();\n\n this.scrollFrame = requestAnimationFrame(step);\n };\n\n this.scrollFrame = requestAnimationFrame(step);\n }\n\n private stopAutoScroll(): void {\n\n if (this.scrollFrame === null) return;\n\n cancelAnimationFrame(this.scrollFrame);\n\n this.scrollFrame = null;\n }\n\n private teardownPointer(): void {\n\n this.stopAutoScroll();\n\n if (this.handle && this.pointerId !== null) {\n\n this.handle.releasePointerCapture?.(this.pointerId);\n }\n\n document.removeEventListener('pointermove', this.handlePointerMove);\n document.removeEventListener('pointerup', this.handlePointerUp);\n document.removeEventListener('pointercancel', this.handlePointerCancel);\n document.removeEventListener('keydown', this.handlePointerKeydown);\n\n this.pointerId = null;\n this.handle = null;\n this.armed = false;\n }\n\n // -------------------------------------------------------------------------\n // Keyboard\n //\n // WCAG 2.5.7 Dragging Movements: anything achievable by dragging needs a\n // single-pointer, non-dragging alternative. Arrow-key moves are that, and\n // they are also simply how a keyboard user reorders a list.\n // -------------------------------------------------------------------------\n\n /** Space/Enter on the handle: pick the row up, or put it down. */\n toggleKeyboardDrag(node: OneRowNode<T>, handlers: { onEnd?: (event: OneRowDragEvent<T> | null) => void } = {}): void {\n\n if (!this.context) return;\n\n if (this.state$.value?.source === 'keyboard') {\n\n this.commit('keyboard');\n\n return;\n }\n\n if (this.dragging) return;\n\n const index = this.indexOf(node);\n\n if (index === -1) return;\n\n this.appliedFrom = index;\n this.onEnd = handlers.onEnd;\n\n this.publish({ rowId: node.rowId, fromIndex: index, insertAt: index, source: 'keyboard' });\n\n this.announce(`${this.describe(node, index)} grabbed. Use the arrow keys to move it, space to drop, escape to cancel.`);\n }\n\n /**\n * Arrow keys move the row a position at a time, applying as they go.\n *\n * Applied rather than previewed because the row has to be seen to move: a\n * keyboard user gets no drag image, and a preview line alone tells someone\n * relying on a screen reader nothing about where the row now sits. Escape\n * still restores the original position.\n */\n moveKeyboard(delta: number): boolean {\n\n const current = this.state$.value;\n\n if (!this.context || current?.source !== 'keyboard') return false;\n\n const nodes = this.context.nodes();\n const from = current.insertAt;\n const to = this.clamp(from + delta, 0, nodes.length - 1);\n\n if (to === from) {\n\n this.announce(to === 0 ? 'Already at the top.' : 'Already at the bottom.');\n\n return true;\n }\n\n if (!this.context.move(from, to)) return true;\n\n this.publish({ ...current, insertAt: to });\n\n const node = this.nodeAt(to);\n\n this.announce(node ? `Moved to position ${to + 1} of ${nodes.length}.` : '');\n\n return true;\n }\n\n // -------------------------------------------------------------------------\n // Commit / cancel\n // -------------------------------------------------------------------------\n\n private commit(source: 'pointer' | 'keyboard'): void {\n\n const current = this.state$.value;\n\n if (!this.context || !current) {\n\n this.reset();\n\n return;\n }\n\n const nodes = this.context.nodes();\n\n // Pointer drags apply once, at the end. A boundary index becomes a row\n // index by dropping one when the row travelled downwards, since lifting\n // it out first shifts everything below it up.\n if (source === 'pointer') {\n\n const from = current.fromIndex;\n const to = this.clamp(current.insertAt > from ? current.insertAt - 1 : current.insertAt, 0, nodes.length - 1);\n\n const node = this.nodeAt(from);\n\n if (node && to !== from && this.context.move(from, to)) {\n\n this.finish({ node, fromIndex: from, toIndex: to, source });\n\n return;\n }\n\n this.reset();\n\n return;\n }\n\n // Keyboard moves were applied as they happened; this only confirms.\n const node = this.nodeAt(current.insertAt);\n\n const moved = node && current.insertAt !== current.fromIndex;\n\n this.announce(moved ? `Dropped at position ${current.insertAt + 1} of ${nodes.length}.` : 'Cancelled. Row returned to its original position.');\n\n if (moved) {\n\n this.finish({ node: node!, fromIndex: current.fromIndex, toIndex: current.insertAt, source });\n\n return;\n }\n\n this.reset();\n }\n\n /** Abort, restoring anything a keyboard drag already applied. */\n cancel(): void {\n\n const current = this.state$.value;\n\n if (current?.source === 'keyboard' && this.context && current.insertAt !== current.fromIndex) {\n\n this.context.move(current.insertAt, current.fromIndex);\n\n this.announce('Cancelled. Row returned to its original position.');\n\n } else if (current) {\n\n this.announce('Cancelled.');\n }\n\n this.reset();\n }\n\n private finish(event: OneRowDragEvent<T>): void {\n\n const done = this.onEnd;\n\n this.reset();\n\n this.zone.run(() => done?.(event));\n }\n\n private reset(): void {\n\n this.stopAutoScroll();\n\n this.appliedFrom = null;\n this.onEnd = undefined;\n\n if (this.state$.value !== null) {\n\n this.zone.run(() => this.state$.next(null));\n }\n }\n\n // -------------------------------------------------------------------------\n // Helpers\n // -------------------------------------------------------------------------\n\n private publish(state: OneRowDragState): void {\n\n this.zone.run(() => this.state$.next(state));\n }\n\n private announce(message: string): void {\n\n this.zone.run(() => this.announcement$.next(message));\n }\n\n private describe(node: OneRowNode<T>, index: number): string {\n\n return `Row ${index + 1} of ${this.context?.nodes().length ?? 0},`;\n }\n\n private indexOf(node: OneRowNode<T>): number {\n\n return this.context?.nodes().findIndex(candidate => candidate.rowId === node.rowId) ?? -1;\n }\n\n private nodeAt(index: number): OneRowNode<T> | null {\n\n return this.context?.nodes()[index] ?? null;\n }\n\n private clamp(value: number, min: number, max: number): number {\n\n return Math.min(Math.max(value, min), max);\n }\n\n ngOnDestroy(): void {\n\n this.teardownPointer();\n\n this.state$.next(null);\n this.state$.complete();\n this.announcement$.complete();\n\n this.context = null;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { TreeNode } from '../models/one-tree-data.model';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OneGridTreeDataService {\n\n create<T>(tree: TreeNode<T>[], parentId: string | null, newNode: TreeNode<T>): TreeNode<T>[] {\n \n if (!parentId) {\n\n return [newNode, ...tree];\n }\n \n return tree.map(node => {\n\n if (node.id === parentId) {\n\n return { ...node, children: [newNode, ...(node.children || [])] };\n }\n \n if (node.children) {\n\n return { ...node, children: this.create(node.children, parentId, newNode) };\n }\n \n return node;\n });\n }\n \n update<T>(tree: TreeNode<T>[], nodeId: string, updatedData: Partial<T>): TreeNode<T>[] {\n \n return tree.map(node => {\n\n if (node.id === nodeId) {\n\n return { ...node, ...updatedData };\n }\n \n if (node.children) {\n\n return { ...node, children: this.update(node.children, nodeId, updatedData) };\n }\n \n return node;\n });\n }\n\n delete<T>(tree: TreeNode<T>[], nodeId: string): TreeNode<T>[] {\n\n return tree.map(node => {\n\n if (node.children && node.children.length > 0) {\n\n return { ...node, children: this.delete(node.children, nodeId) };\n }\n\n return node;\n\n }).filter(node => node.id !== nodeId);\n }\n\n \n find<T = any>(treeData: TreeNode<T>[], nodeId: string): TreeNode<T> | null {\n \n for (const node of treeData) {\n\n if (node.id === nodeId) {\n\n return node;\n }\n \n if (node.children) {\n\n const found = this.find(node.children, nodeId);\n\n if (found) return found;\n }\n }\n \n return null;\n }\n}\n","export const OnePageSizeOption = [25, 50, 100, 250];","import type { OneGridApi } from \"../instants/one-grid-api.class\";\nimport type { OneRowNode } from \"../instants/one-row-node.class\";\n\nexport interface OneGetRowHeightParams<T = any> {\n node?: OneRowNode<T>;\n api?: OneGridApi<T>;\n context?: any;\n}\n\nexport type OneGetRowHeight<T = any> = (params: OneGetRowHeightParams<T>) => number | null | undefined;\n\nexport function resolveRowHeight<T>(params: OneGetRowHeightParams<T>, getRowHeight: OneGetRowHeight, rowHeight: number = 26): number {\n\n if (getRowHeight) {\n\n const result = getRowHeight(params);\n\n // fallback behavior like AG Grid\n if (result == null) {\n\n return rowHeight;\n }\n\n // guard against invalid values\n return Math.max(1, result);\n }\n\n return rowHeight;\n}\n\nexport type OneDetailRowHeightOption = {\n minRows: number;\n maxRows: number;\n}\n\n\n/**\n * Handle One Row Node Event\n */\n\n// events.ts - Strongly typed event map\nexport interface OneRowNodeEventMap<T> {\n\n rowDataChanged: {\n node: OneRowNode<T>;\n data: T;\n previousData: T;\n };\n\n detailRowDataChanged: {\n node: OneRowNode<T>;\n detailRowData: any[];\n previousDetailRowData: any[] | null;\n };\n\n expandedChanged: {\n node: OneRowNode<T>;\n expanded: boolean;\n };\n}\n\n// `childrenChanged` used to be declared here and raised by `setDetailRowData`\n// with `node.children` — which is always `[]` for a master row, because detail\n// rows are not children. Nothing in the library or any consumer could listen\n// for it usefully, so the event and its emit are both gone rather than left as\n// a documented lie. Subscribe to `detailRowDataChanged` for detail rows.\n\nexport type OneRowNodeListener<T, K extends keyof OneRowNodeEventMap<T>> = (event: OneRowNodeEventMap<T>[K]) => void;","import { Provider } from '@angular/core';\nimport {\n LUCIDE_ICONS,\n LucideIconProvider,\n ArrowDownUp,\n ArrowDownZA,\n ArrowUpAZ,\n ChevronFirst,\n ChevronLast,\n ChevronLeft,\n ChevronRight,\n GripVertical,\n} from 'lucide-angular';\n\n/**\n * The Lucide icons the grid draws, and only those.\n *\n * Every component that renders a `<lucide-icon>` picks this set itself, so the\n * icons travel with the component. That matters now the components are\n * standalone: a consumer importing `OneGridComponent` directly never touches\n * `OneGridModule`, and previously got a runtime error — \"The 'chevron-first'\n * icon has not been provided by any available icon providers\" — the moment the\n * pagination bar rendered.\n *\n * Eight icons rather than `LucideAngularModule.pick(icons)`, which registered\n * the entire Lucide set. Nothing else in the grid uses one, and the rest were\n * dead weight in every consumer's bundle.\n */\nexport const ONE_GRID_ICONS = {\n ArrowDownUp,\n ArrowDownZA,\n ArrowUpAZ,\n ChevronFirst,\n ChevronLast,\n ChevronLeft,\n ChevronRight,\n GripVertical,\n} as const;\n\n/**\n * Providers that register {@link ONE_GRID_ICONS} for one standalone component.\n *\n * `LucideAngularModule.pick()` cannot be used here: it returns a\n * `ModuleWithProviders`, and a standalone component's `imports` only accepts\n * components, directives, pipes and NgModule classes. This is the same\n * registration `pick` performs, expressed as providers so it can sit on the\n * component instead.\n */\nexport const ONE_GRID_ICON_PROVIDERS: Provider[] = [\n { provide: LUCIDE_ICONS, multi: true, useValue: new LucideIconProvider(ONE_GRID_ICONS) },\n];\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneRowNode } from '../instants/one-row-node.class';\nimport { OneCheckboxState, RowSelectionMode } from '../models/one-event-types.model';\n\n@Pipe({\n standalone: true,\n name: 'headerCheckboxChecked'\n})\nexport class HeaderCheckboxCheckedPipe implements PipeTransform {\n\n transform(rowNodes: OneRowNode[], selectionMode: RowSelectionMode, state: OneCheckboxState): boolean {\n\n return rowNodes?.length > 0 && selectionMode === 'multiple' && state === 'checked';\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneRowNode } from '../instants/one-row-node.class';\nimport { RowSelectionMode } from '../models/one-event-types.model';\n\n@Pipe({\n standalone: true,\n name: 'headerCheckboxDisabled'\n})\nexport class HeaderCheckboxDisabledPipe implements PipeTransform {\n\n transform(rowNodes: OneRowNode[], selectionMode: RowSelectionMode, allowedEdit: boolean): boolean {\n\n return rowNodes?.length === 0 || selectionMode !== 'multiple' || !allowedEdit;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneRowNode } from '../instants/one-row-node.class';\nimport { OneCheckboxState, RowSelectionMode } from '../models/one-event-types.model';\n\n@Pipe({\n standalone: true,\n name: 'headerCheckboxIndeterminate'\n})\nexport class HeaderCheckboxIndeterminatePipe implements PipeTransform {\n\n transform(rowNodes: OneRowNode[], selectionMode: RowSelectionMode, state: OneCheckboxState): unknown {\n\n return rowNodes?.length > 0 && selectionMode === 'multiple' && state === 'indeterminate';\n }\n}\n","import { Component, Input, OnDestroy, OnInit } from '@angular/core';\nimport { OneGridSelectionService } from '../../core/services/one-grid-selection.service';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridApi } from '../../core/instants/one-grid-api.class';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport {\n OneCheckboxState, RowDataChangedEvent,\n RowSelectionMode,\n SelectionChangedEvent,\n} from '../../core/models/one-event-types.model'\nimport { HeaderCheckboxCheckedPipe } from '../../core/pipes/header-checkbox-checked.pipe';\nimport { HeaderCheckboxDisabledPipe } from '../../core/pipes/header-checkbox-disabled.pipe';\nimport { HeaderCheckboxIndeterminatePipe } from '../../core/pipes/header-checkbox-indeterminate.pipe';\n\n@Component({\n standalone: true,\n imports: [HeaderCheckboxCheckedPipe, HeaderCheckboxDisabledPipe, HeaderCheckboxIndeterminatePipe],\n selector: 'one-grid-checkbox-header',\n templateUrl: './one-grid-checkbox-header.component.html',\n styleUrl: './one-grid-checkbox-header.component.scss',\n})\nexport class OneGridCheckboxHeaderComponent<T> implements OnInit, OnDestroy {\n\n @Input() api!: OneGridApi<T>;\n @Input() allowedEdit: boolean = false;\n\n /** Unsubscribe callbacks for the two grid listeners below. */\n private readonly teardown: Array<() => void> = [];\n\n public state: OneCheckboxState = 'unchecked';\n public rowNodes: OneRowNode<T>[] = [];\n public selectionMode: RowSelectionMode;\n\n constructor(\n private eventService: OneGridEventService,\n private selectionService: OneGridSelectionService\n ) { }\n\n ngOnInit(): void {\n\n this.selectionMode = this.api.rowSelection;\n\n /**\n * Listen Row Node Selection Changed Event\n */\n this.teardown.push(this.eventService.addEventListener('selectionChanged', (payload: SelectionChangedEvent<T>) => {\n\n this.rowNodes = this.api.getAllRowNodes();\n\n const rowIds = this.rowNodes && this.rowNodes.length > 0 ? this.rowNodes.map((node: OneRowNode<T>) => node.rowId) : [];\n\n this.state = this.selectionService.getSelectAllState(rowIds);\n }));\n\n /**\n * Listen Row Data Changed Event\n */\n this.teardown.push(this.eventService.addEventListener('rowDataChanged', (payload: RowDataChangedEvent<T>) => {\n\n this.rowNodes = this.api.getAllRowNodes();\n\n const rowIds: string[] = this.rowNodes && this.rowNodes.length > 0 ? this.rowNodes.map((node: OneRowNode<T>) => node.rowId) : [];\n\n this.state = this.selectionService.getSelectAllState(rowIds);\n }));\n }\n\n ngOnDestroy(): void {\n\n // Both listeners were registered and never released. The component-scoped\n // event service happened to clean up after them; relying on that left the\n // component's own lifecycle incomplete.\n this.teardown.forEach(unsubscribe => unsubscribe());\n\n this.teardown.length = 0;\n }\n\n /**\n * Toggle Selection Action\n */\n toggleSelectionAll(event: any): void {\n\n if (this.selectionMode === 'single') return;\n\n const checked: boolean = event.target.checked;\n\n if (this.rowNodes && this.rowNodes.length > 0) {\n\n if (checked) {\n\n this.api.selectAll();\n\n } else {\n\n this.api.deselectAll();\n }\n }\n }\n}\n","<div class=\"one-grid-checkbox\">\n <input\n [id]=\"api.id\"\n [type]=\"'checkbox'\"\n [class.disabled]=\"rowNodes | headerCheckboxDisabled:selectionMode:allowedEdit\"\n [checked]=\"rowNodes | headerCheckboxChecked:selectionMode:state\"\n [indeterminate]=\"rowNodes | headerCheckboxIndeterminate:selectionMode:state\"\n (change)=\"toggleSelectionAll($event)\" />\n</div>","import { AfterViewInit, Component, ElementRef, EventEmitter, HostListener, Input, OnInit, Output, QueryList, ViewChildren } from '@angular/core';\nimport { OneColumnDef } from '../../core/models/one-column-def-types.model';\n\n/** What a default header menu entry does when chosen. */\nexport type OneHeaderMenuAction =\n | 'sortAsc'\n | 'sortDesc'\n | 'clearSort'\n | 'pinLeft'\n | 'pinRight'\n | 'unpin'\n | 'hide';\n\ninterface HeaderMenuEntry {\n action: OneHeaderMenuAction;\n label: string;\n}\n\n/**\n * The grid's default column menu, opened by the header's ⋮ button when the\n * grid sets `[headerMenu]=\"true\"`.\n *\n * Entries follow the column: sorting only on a sortable column and only the\n * transitions that make sense from the current state, pinning without the\n * side it is already on, hiding never for the last visible column. The menu\n * only reports the chosen action — the header executes it against the API,\n * for the same reason the cell option menu does not mutate rows itself.\n *\n * Keyboard behaviour is the menu pattern the cell option menu established:\n * focus moves in on open, arrows rove, Escape and outside clicks close.\n */\n@Component({\n selector: 'one-grid-header-menu',\n standalone: true,\n templateUrl: './one-grid-header-menu.component.html',\n})\nexport class OneGridHeaderMenuComponent implements OnInit, AfterViewInit {\n\n @Input() column: OneColumnDef = null;\n /** The column's current sort, so the menu offers only the other states. */\n @Input() sortState: 'asc' | 'desc' | null = null;\n /** False when this is the last visible column, which must stay visible. */\n @Input() canHide: boolean = true;\n\n @Output() menuAction = new EventEmitter<OneHeaderMenuAction>();\n @Output() menuClose = new EventEmitter<void>();\n\n @ViewChildren('item') private items?: QueryList<ElementRef<HTMLButtonElement>>;\n\n protected entries: HeaderMenuEntry[] = [];\n protected activeIndex = 0;\n\n protected get menuLabel(): string {\n\n return `Column menu for ${this.column?.headerName ?? this.column?.field ?? 'this column'}`;\n }\n\n constructor(private elementRef: ElementRef) {}\n\n /**\n * Built once on open rather than in a getter: the entries feed the roving\n * tabindex, and a list that re-derives mid-interaction would move focus.\n */\n ngOnInit(): void {\n\n const entries: HeaderMenuEntry[] = [];\n const column = this.column;\n\n if (column?._resolvedSortable && column.field) {\n\n if (this.sortState !== 'asc') entries.push({ action: 'sortAsc', label: 'Sort ascending' });\n if (this.sortState !== 'desc') entries.push({ action: 'sortDesc', label: 'Sort descending' });\n if (this.sortState) entries.push({ action: 'clearSort', label: 'Clear sort' });\n }\n\n if (column?.pinned !== 'left') entries.push({ action: 'pinLeft', label: 'Pin left' });\n if (column?.pinned !== 'right') entries.push({ action: 'pinRight', label: 'Pin right' });\n if (column?.pinned) entries.push({ action: 'unpin', label: 'Unpin' });\n\n if (this.canHide) entries.push({ action: 'hide', label: 'Hide column' });\n\n this.entries = entries;\n }\n\n ngAfterViewInit(): void {\n\n this.focusItem(0);\n }\n\n protected onEntrySelected(entry: HeaderMenuEntry): void {\n\n this.menuAction.emit(entry.action);\n this.menuClose.emit();\n }\n\n protected onItemKeydown(event: KeyboardEvent, index: number, entry: HeaderMenuEntry): void {\n\n switch (event.key) {\n\n case 'ArrowDown':\n event.preventDefault();\n this.focusItem((index + 1) % this.entries.length);\n return;\n\n case 'ArrowUp':\n event.preventDefault();\n this.focusItem((index - 1 + this.entries.length) % this.entries.length);\n return;\n\n case 'Home':\n event.preventDefault();\n this.focusItem(0);\n return;\n\n case 'End':\n event.preventDefault();\n this.focusItem(this.entries.length - 1);\n return;\n\n case 'Enter':\n case ' ':\n event.preventDefault();\n this.onEntrySelected(entry);\n return;\n\n default:\n return;\n }\n }\n\n private focusItem(index: number): void {\n\n if (!this.entries.length) return;\n\n this.activeIndex = index;\n\n this.items?.get(index)?.nativeElement?.focus();\n }\n\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: MouseEvent) {\n\n if (!this.elementRef.nativeElement.contains(event.target as HTMLElement)) {\n\n this.menuClose.emit();\n }\n }\n\n @HostListener('document:keydown.escape')\n onEscape() {\n\n this.menuClose.emit();\n }\n\n @HostListener('document:scroll')\n onScroll() {\n\n this.menuClose.emit();\n }\n}\n","<div class=\"one-header-menu\" role=\"menu\" [attr.aria-label]=\"menuLabel\">\n @for (entry of entries; let index = $index; track entry.action) {\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"one-header-menu-item\"\n #item\n [tabindex]=\"index === activeIndex ? 0 : -1\"\n (click)=\"onEntrySelected(entry)\"\n (keydown)=\"onItemKeydown($event, index, entry)\">\n <span>{{ entry.label }}</span>\n </button>\n }\n</div>\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneSortModel } from '../models/one-grid-types.model';\n\n@Pipe({\n standalone: true,\n name: 'columnSortState'\n})\nexport class ColumnSortStatePipe implements PipeTransform {\n\n // `readonly`, because this is fed straight from `api.sortModel`, which is\n // now a readonly view rather than the mutable array it used to hand out.\n transform(field: string, sortModel: readonly OneSortModel[]): 'asc' | 'desc' | null {\n\n if (!sortModel || !field) return null;\n\n return sortModel.find(s => s.colId === field)?.sort ?? null;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Maps the grid's sort state onto the values `aria-sort` accepts.\n *\n * The attribute takes `ascending` / `descending` / `none`, not the `asc` /\n * `desc` the sort model uses. `none` is only correct on a column that *can* be\n * sorted — on one that cannot, the attribute is omitted entirely, because\n * \"not sorted\" and \"not sortable\" are different statements.\n */\n@Pipe({\n standalone: true,\n name: 'ariaSort',\n})\nexport class AriaSortPipe implements PipeTransform {\n\n transform(sort: 'asc' | 'desc' | null, sortable: boolean | undefined): string | null {\n\n if (!sortable) return null;\n\n if (sort === 'asc') return 'ascending';\n\n if (sort === 'desc') return 'descending';\n\n return 'none';\n }\n}\n","import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core';\nimport { OneColumnDef, OneGroupColumnDef } from '../../core/models/one-column-def-types.model';\nimport { Subject, Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { OneGridApi } from '../../core/instants/one-grid-api.class';\nimport { OneSortModel } from '../../core/models/one-grid-types.model';\nimport { ColumnChangedEvent } from '../../core/models/one-event-types.model';\nimport { OneFilterModel } from '../../core/models/one-filter.model';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport { resolveColumnWidth } from '../../helpers/one-column-def.helper';\nimport { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport { LucideAngularModule } from 'lucide-angular';\nimport { ONE_GRID_ICON_PROVIDERS } from '../../core/icons/one-grid-icons';\nimport { OneGridCheckboxHeaderComponent } from '../one-grid-checkbox-header/one-grid-checkbox-header.component';\nimport { OneGridHeaderMenuComponent, OneHeaderMenuAction } from '../one-grid-header-menu/one-grid-header-menu.component';\nimport { ColumnSortStatePipe } from '../../core/pipes/column-sort-state.pipe';\nimport { AriaSortPipe } from '../../core/pipes/aria-sort.pipe';\n\n@Component({\n standalone: true,\n imports: [\n NgClass,\n NgStyle,\n NgTemplateOutlet,\n LucideAngularModule,\n OneGridCheckboxHeaderComponent,\n OneGridHeaderMenuComponent,\n ColumnSortStatePipe,\n AriaSortPipe,\n ],\n selector: 'one-grid-header',\n // The host sits between role=\"grid\" and the rows it must own; a generic\n // element there breaks the ownership chain, so it leaves the a11y tree.\n host: { 'role': 'presentation' },\n providers: [ONE_GRID_ICON_PROVIDERS],\n templateUrl: './one-grid-header.component.html',\n styleUrl: './one-grid-header.component.scss'\n})\nexport class OneGridHeaderComponent<T> implements OnInit, AfterViewInit, OnDestroy {\n\n @ViewChild('headerViewport', { static: true }) private headerViewport?: ElementRef<HTMLElement>;\n\n /**\n * Horizontal offset of the body, mirrored here so the header tracks it.\n *\n * Applied to the viewport's `scrollLeft` rather than as a transform on the\n * row: sticky positioning needs a real scrollport above it. The group row,\n * which is a sibling of that viewport, still reads this for its transform.\n */\n @Input()\n set scrollLeft(value: number) {\n\n this._scrollLeft = value ?? 0;\n\n this.applyScrollLeft();\n }\n\n get scrollLeft(): number {\n\n return this._scrollLeft;\n }\n\n private _scrollLeft = 0;\n @Input() allowedEdit: boolean = false;\n @Input() enableGroupColumnDefs: boolean = false;\n @Input() api!: OneGridApi<T>;\n\n protected groupColumnDefs: OneGroupColumnDef[] = [];\n protected columnDefs: OneColumnDef<T>[] = [];\n\n private sortModel: OneSortModel<T>[] = [];\n private subscriptions = new Subscription();\n private draggedIndex: number | null = null;\n /** Where the drag started, for reporting the completed move as one event. */\n private dragSourceIndex: number | null = null;\n\n // Track resize state\n private resizing = false;\n private resizeColumnIndex: number | null = null;\n private startX = 0;\n private startWidth = 0;\n\n constructor(\n private eventService: OneGridEventService,\n private cdr: ChangeDetectorRef,\n private elementRef: ElementRef,\n ) {}\n\n /**\n * Render a filter input under each column whose `filterable` resolves true.\n *\n * The inputs build a contains-filter per column and hand it to\n * `api.setFilterModel`, debounced. Fields without a filter input are left\n * alone: a programmatic filter on a non-filterable column survives typing\n * here, while the filterable fields belong to the row — last writer wins.\n */\n @Input() filterRow: boolean = false;\n\n /** Current filter text per field. */\n protected filterTexts: Record<string, string> = {};\n\n private filterInput$ = new Subject<void>();\n\n /** Debounce for the filter row, in ms. */\n private static readonly FILTER_DEBOUNCE = 200;\n\n protected onFilterInput(col: OneColumnDef<T>, event: Event): void {\n\n this.filterTexts[col.field as string] = (event.target as HTMLInputElement).value;\n\n this.filterInput$.next();\n }\n\n private applyFilterRow(): void {\n\n const managed = new Set(\n this.columnDefs\n .filter(column => column._resolvedFilterable && column.field)\n .map(column => column.field as string),\n );\n\n const preserved = this.api.getFilterModel().filter(entry => !managed.has(entry.field));\n\n const own: OneFilterModel[] = Object.entries(this.filterTexts)\n .filter(([field, text]) => managed.has(field) && text.trim() !== '')\n .map(([field, text]) => ({\n field,\n logicOperator: 'AND' as const,\n conditions: [{ operator: 'contains' as const, value: text.trim() }],\n }));\n\n this.api.setFilterModel([...preserved, ...own]);\n }\n\n ngOnInit(): void {\n\n this.subscriptions.add(\n this.filterInput$\n .pipe(debounceTime(OneGridHeaderComponent.FILTER_DEBOUNCE))\n .subscribe(() => this.applyFilterRow()),\n );\n\n // Listen Column Changed Event\n this.subscriptions.add(this.eventService.addEventListener('columnChanged', (payload: ColumnChangedEvent) => {\n\n const { groups, columns } = payload;\n\n if (groups) {\n\n this.groupColumnDefs = groups as OneGroupColumnDef[];\n }\n\n if (columns) {\n\n this.columnDefs = columns as OneColumnDef[];\n }\n\n // this.cdr.markForCheck();\n }));\n }\n\n ngAfterViewInit(): void {\n\n // The input setter can run before the view exists, so whatever arrived\n // first is applied once here.\n this.applyScrollLeft();\n }\n\n private applyScrollLeft(): void {\n\n if (this.headerViewport) {\n\n this.headerViewport.nativeElement.scrollLeft = this._scrollLeft;\n }\n }\n\n /**\n * Minimum a column can be resized to, by pointer or keyboard.\n *\n * Exposed to the template for `aria-valuemin`, so what the resizer announces\n * and what it enforces cannot drift apart.\n */\n protected readonly MIN_COLUMN_WIDTH = 50;\n\n /**\n * The header's ⋮ button was a div with an empty handler — it rendered,\n * looked interactive, and did nothing at all. Making it keyboard-reachable\n * without giving it a purpose would only have added a dead tab stop per\n * column, so it now reports the press the same way every row action does and\n * the host decides what a column menu means.\n */\n @Output() headerMenuClick = new EventEmitter<OneColumnDef<T>>();\n\n /**\n * Render the grid's default column menu behind the ⋮ button.\n *\n * Opt-in: hosts that bound `(headerMenuClick)` to open their own menu keep\n * exactly the behaviour they had — the intent still emits either way.\n */\n @Input() headerMenu: boolean = false;\n\n /** The column whose default menu is open, or null. */\n protected openMenuColumn: OneColumnDef<T> | null = null;\n\n /** Distance from the header's right edge to the open column's, in px. */\n protected menuOffsetRight = 0;\n\n onHeaderMenuOptionClick(columnDef: OneColumnDef<T>, event?: MouseEvent) {\n\n this.headerMenuClick.emit(columnDef);\n\n if (!this.headerMenu) return;\n\n if (this.openMenuColumn?.id === columnDef.id) {\n\n this.openMenuColumn = null;\n\n return;\n }\n\n // Right-aligned under the opening column. Measured because the menu\n // cannot render inside the column — every box in the header clips — so\n // it sits outside and has to be told where the column is.\n const columnElement = (event?.target as HTMLElement)?.closest('.one-grid-header-column');\n const hostElement = this.elementRef.nativeElement as HTMLElement;\n\n this.menuOffsetRight = columnElement\n ? Math.max(hostElement.getBoundingClientRect().right - columnElement.getBoundingClientRect().right, 0)\n : 0;\n\n this.openMenuColumn = columnDef;\n }\n\n /** The open column's current sort, so the menu offers the other states. */\n protected menuSortState(col: OneColumnDef<T>): 'asc' | 'desc' | null {\n\n return this.api.sortModel.find(entry => entry.colId === col.field)?.sort ?? null;\n }\n\n protected onHeaderMenuAction(action: OneHeaderMenuAction, col: OneColumnDef<T>): void {\n\n switch (action) {\n\n case 'sortAsc':\n case 'sortDesc': {\n\n // Mirrors a sort-button click: a single-column model. The header's own\n // cycle state follows, so the sort button keeps cycling from here.\n this.sortModel = [{ colId: col.field as keyof T, sort: action === 'sortAsc' ? 'asc' : 'desc' }];\n this.api.onSortChanged(this.sortModel);\n return;\n }\n\n case 'clearSort':\n this.sortModel = [];\n this.api.onSortChanged(this.sortModel);\n return;\n\n case 'pinLeft':\n this.api.updateColumn(col.id, { pinned: 'left' });\n return;\n\n case 'pinRight':\n this.api.updateColumn(col.id, { pinned: 'right' });\n return;\n\n case 'unpin':\n this.api.updateColumn(col.id, { pinned: undefined });\n return;\n\n case 'hide':\n this.api.setColumnVisible(col.id, false);\n return;\n }\n }\n\n protected closeHeaderMenu(): void {\n\n this.openMenuColumn = null;\n }\n\n /**\n * Resize from the keyboard.\n *\n * The pointer path is a drag, and WCAG 2.5.7 requires a single-pointer\n * alternative that is not one. Arrows step, shift steps coarser, and\n * Home/End go to the column's own bounds.\n */\n protected onResizeKeydown(event: KeyboardEvent, columnIndex: number): void {\n\n const column = this.columnDefs[columnIndex];\n\n if (!column) return;\n\n const step = event.shiftKey ? 50 : 10;\n const current = column.width ?? resolveColumnWidth(column);\n\n let width: number;\n\n switch (event.key) {\n\n case 'ArrowLeft': width = current - step; break;\n case 'ArrowRight': width = current + step; break;\n case 'Home': width = column.minWidth ?? this.MIN_COLUMN_WIDTH; break;\n case 'End': width = column.maxWidth ?? current + step; break;\n default: return;\n }\n\n event.preventDefault();\n\n const min = Math.max(column.minWidth ?? 0, this.MIN_COLUMN_WIDTH);\n const max = column.maxWidth ?? Number.POSITIVE_INFINITY;\n\n const newWidth = Math.min(Math.max(width, min), max);\n\n // Home at the minimum, End at the maximum: already clamped there, nothing\n // changed, nothing to announce.\n if (newWidth === current) return;\n\n // A hand-resized column stops flexing — otherwise the next reflow would\n // overwrite the width the user just chose.\n this.api.updateColumn(column.id, { width: newWidth, flex: undefined });\n\n this.eventService.dispatchEvent('columnResized', { columnId: column.id, newWidth });\n }\n\n onHeaderMenuSortClick(colId: keyof T) {\n\n const currentSort = this.sortModel.find(sort => sort.colId === colId)?.sort ?? null;\n\n const nextSort = this.cycleSort(currentSort);\n\n this.sortModel = nextSort ? [{ colId, sort: nextSort }] : [];\n\n this.api.onSortChanged(this.sortModel);\n }\n\n // Cycle Sorting Model\n private cycleSort(current: 'asc' | 'desc' | null): 'asc' | 'desc' | null {\n\n switch (current) {\n\n case null: return 'asc';\n\n case 'asc': return 'desc';\n\n case 'desc': return null;\n\n default: return null;\n }\n }\n\n onResizeStart(event: MouseEvent, columnIndex: number): void {\n\n // Prevent text selection and default behavior\n event.preventDefault();\n event.stopPropagation();\n\n // Store initial values\n this.resizing = true;\n this.resizeColumnIndex = columnIndex;\n this.startX = event.clientX;\n\n // Measure what is on screen rather than trusting `col.width`, which is\n // optional: a column sized purely by minWidth had `undefined` here, and\n // `Math.max(50, undefined + deltaX)` is NaN — the column collapsed on the\n // first mouse move and could not be recovered.\n const columnElement = (event.target as HTMLElement)?.closest<HTMLElement>('.one-grid-header-column');\n\n this.startWidth = columnElement?.offsetWidth || resolveColumnWidth(this.columnDefs[columnIndex]);\n\n // Add document-level listeners for drag and release\n document.addEventListener('mousemove', this.onResizeMove);\n document.addEventListener('mouseup', this.onResizeEnd);\n\n // Add a class to body to maintain cursor during drag\n document.body.style.cursor = 'col-resize';\n }\n\n // Arrow function to preserve 'this' context\n private onResizeMove = (event: MouseEvent): void => {\n\n if (!this.resizing || this.resizeColumnIndex === null) return;\n\n // Calculate how far the mouse has moved\n const deltaX = event.clientX - this.startX;\n\n // Calculate new width (with minimum of 50px)\n const newWidth = Math.max(this.MIN_COLUMN_WIDTH, this.startWidth + deltaX);\n\n // Update the column width. A hand-resized column stops flexing, or the\n // next reflow would overwrite the width the user is dragging out.\n this.api.updateColumn(this.columnDefs[this.resizeColumnIndex].id, { width: newWidth, flex: undefined });\n }\n\n private onResizeEnd = (): void => {\n\n // One event per completed gesture, not one per mousemove — and none at all\n // for a click on the handle that never moved.\n if (this.resizeColumnIndex !== null) {\n\n const column = this.columnDefs[this.resizeColumnIndex];\n const newWidth = column?.width ?? this.startWidth;\n\n if (column && newWidth !== this.startWidth) {\n\n this.eventService.dispatchEvent('columnResized', { columnId: column.id, newWidth });\n }\n }\n\n // Clean up\n this.resizing = false;\n this.resizeColumnIndex = null;\n document.body.style.cursor = '';\n\n // Remove document listeners\n document.removeEventListener('mousemove', this.onResizeMove);\n document.removeEventListener('mouseup', this.onResizeEnd);\n }\n\n // Track the dragged column index\n onDragColumnStart(event: DragEvent, index: number): void {\n\n this.draggedIndex = index;\n this.dragSourceIndex = index;\n\n // Optional: Set drag image/effect\n if (event.dataTransfer) {\n\n event.dataTransfer.effectAllowed = 'move';\n }\n }\n\n onDragColumnOver(event: DragEvent, targetIndex: number): void {\n\n event.preventDefault();\n\n // Skip if dragging over itself or no drag in progress\n if (this.draggedIndex === null || this.draggedIndex === targetIndex) {\n\n return;\n }\n\n // IMMEDIATELY reorder columns\n this.api.reorderColumnDefs(this.draggedIndex, targetIndex);\n\n // Update draggedIndex to the new position\n this.draggedIndex = targetIndex;\n }\n\n onDragColumnEnd(event: DragEvent): void {\n\n this.finishColumnDrag();\n }\n\n onDropColumn(event: DragEvent): void {\n\n event.preventDefault();\n\n this.finishColumnDrag();\n }\n\n /**\n * The reorder itself already happened, step by step, during dragover — this\n * only reports the completed move. Both `drop` and `dragend` funnel here and\n * both can fire for one gesture; nulling the indexes makes the second call a\n * no-op, so one gesture reports once.\n */\n private finishColumnDrag(): void {\n\n if (this.draggedIndex !== null && this.dragSourceIndex !== null && this.draggedIndex !== this.dragSourceIndex) {\n\n const column = this.columnDefs[this.draggedIndex];\n\n if (column) {\n\n this.eventService.dispatchEvent('columnMoved', { columnId: column.id, toIndex: this.draggedIndex });\n }\n }\n\n this.draggedIndex = null;\n this.dragSourceIndex = null;\n }\n\n ngOnDestroy(): void {\n\n // This completed an unused Subject and left the real subscription running.\n // It survived only because OneGridEventService is component-scoped and\n // tears its own listeners down — the header was relying on that by accident.\n this.subscriptions.unsubscribe();\n\n // A resize in flight owns two listeners on `document`. Without this they\n // outlive the component, and their closures keep it alive with them.\n if (this.resizing) {\n\n this.onResizeEnd();\n }\n }\n}\n","<div class=\"one-grid-header\" role=\"rowgroup\">\n @if (enableGroupColumnDefs) {\n <div class=\"one-group-header-row\" role=\"presentation\" [style.transform]=\"'translateX(-' + scrollLeft + 'px)'\">\n <ng-container *ngTemplateOutlet=\"groupColumns; context: { groups: groupColumnDefs }\"></ng-container>\n </div>\n }\n <!-- The column row is scrolled rather than translated. `position: sticky`\n resolves against the nearest scrollport, and a transformed ancestor is\n not one — pinned headers could never hold their place inside it. The\n group row above keeps its transform: groups span contiguous columns,\n which pinning reorders, so the two features do not combine. -->\n <div #headerViewport class=\"one-grid-header-viewport\" role=\"presentation\">\n <div class=\"one-header-row\" role=\"row\" aria-rowindex=\"1\">\n <ng-container *ngTemplateOutlet=\"headerColumns; context: { columns: columnDefs }\"></ng-container>\n </div>\n\n <!-- Filter Row (grid opt-in). Lives inside the header viewport so it\n scrolls with the columns and its pinned cells stick the same way. -->\n @if (filterRow) {\n <div class=\"one-filter-row\" role=\"row\" aria-rowindex=\"2\">\n @for (col of columnDefs; track col.id) {\n <div class=\"one-filter-cell\"\n role=\"gridcell\"\n [attr.aria-colindex]=\"$index + 1\"\n [class.one-column-pinned-left]=\"col.pinned === 'left'\"\n [class.one-column-pinned-right]=\"col.pinned === 'right'\"\n [class.one-column-pinned-edge]=\"col._pinnedEdge\"\n [style.left.px]=\"col.pinned === 'left' ? col._pinnedOffset : null\"\n [style.right.px]=\"col.pinned === 'right' ? col._pinnedOffset : null\"\n [style.width.px]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\">\n @if (col._resolvedFilterable && col.field) {\n <input class=\"one-filter-input\"\n type=\"text\"\n [attr.aria-label]=\"'Filter ' + (col.headerName || col.field)\"\n [value]=\"filterTexts[col.field] ?? ''\"\n (input)=\"onFilterInput(col, $event)\" />\n }\n </div>\n }\n </div>\n }\n </div>\n</div>\n\n<!-- The default column menu (grid opt-in). A sibling of the header block\n because everything inside it clips with overflow: hidden; the host\n positions it just below, right-aligned to the opening column. -->\n@if (headerMenu && openMenuColumn) {\n <one-grid-header-menu\n [style.right.px]=\"menuOffsetRight\"\n [column]=\"openMenuColumn\"\n [sortState]=\"menuSortState(openMenuColumn)\"\n [canHide]=\"columnDefs.length > 1\"\n (menuAction)=\"onHeaderMenuAction($event, openMenuColumn)\"\n (menuClose)=\"closeHeaderMenu()\" />\n}\n\n<!-- Group Header Cell Template -->\n<ng-template #groupColumns let-groups=\"groups\">\n @for(group of groups; track group.id) {\n <div class=\"one-group-header-cell\"\n [style.width.px]=\"group.width\"\n [ngClass]=\"group._resolvedGroupClass\"\n [ngStyle]=\"group._resolvedGroupStyle\">\n <div class=\"one-group-header-cell-text\">\n {{ group.headerName }}\n </div>\n </div>\n }\n</ng-template>\n\n<!-- Header Cell Template -->\n<ng-template #headerColumns let-columns=\"columns\">\n @for (col of columns; let colIndex = $index; track col.id) {\n <div class=\"one-grid-header-column\"\n role=\"columnheader\"\n [attr.aria-colindex]=\"colIndex + 1\"\n [attr.aria-sort]=\"col.field | columnSortState:api.sortModel | ariaSort:col._resolvedSortable\"\n [attr.data-index]=\"colIndex\"\n [class.one-column-pinned-left]=\"col.pinned === 'left'\"\n [class.one-column-pinned-right]=\"col.pinned === 'right'\"\n [class.one-column-pinned-edge]=\"col._pinnedEdge\"\n [class.one-column-pinned-edge]=\"col._pinnedEdge\"\n [style.left.px]=\"col.pinned === 'left' ? col._pinnedOffset : null\"\n [style.right.px]=\"col.pinned === 'right' ? col._pinnedOffset : null\"\n [style.width.px]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\"\n [draggable]=\"col._resolvedDragable\"\n (dragstart)=\"onDragColumnStart($event, colIndex)\"\n (dragover)=\"onDragColumnOver($event, colIndex)\"\n (dragend)=\"onDragColumnEnd($event)\"\n (drop)=\"onDropColumn($event)\">\n <div class=\"one-grid-header-cell\"\n [ngClass]=\"col._resolvedHeaderClass\"\n [ngStyle]=\"col._resolvedHeaderStyle\"\n >\n <span class=\"one-grid-header-cell-group\">\n @if (col?.headerCheckboxSelection) {\n <one-grid-checkbox-header\n [api]=\"api\"\n [allowedEdit]=\"allowedEdit\"\n />\n }\n\n {{ col?.headerName ?? '' }}\n </span>\n\n <!-- Og Resize Handler -->\n @if (col._resolvedResizable) {\n <!-- `separator` is the ARIA window-splitter pattern, which is\n what a column resizer is. Focusable and arrow-operable\n because WCAG 2.5.7 requires everything achievable by\n dragging to have a non-dragging alternative. -->\n <div\n class=\"og-resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + (col.headerName || col.field)\"\n [attr.aria-valuenow]=\"col.width\"\n [attr.aria-valuemin]=\"col.minWidth || MIN_COLUMN_WIDTH\"\n [attr.aria-valuemax]=\"col.maxWidth || null\"\n (mousedown)=\"onResizeStart($event, colIndex)\"\n (keydown)=\"onResizeKeydown($event, colIndex)\">\n <i class=\"bi bi-grip-vertical\"></i>\n </div>\n }\n\n <div class=\"one-grid-header-cell-group\">\n\n <!-- Sort Menu Button -->\n @if (col._resolvedSortable) {\n <!-- A button, not a div with a click handler: sorting was\n pointer-only. The current state is not repeated here —\n it is on the columnheader's `aria-sort`, and saying it\n twice makes a screen reader read it twice. -->\n <button\n type=\"button\"\n class=\"one-grid-header-menu-button\"\n [attr.aria-label]=\"'Sort by ' + (col.headerName || col.field)\"\n [title]=\"'Sort by ' + (col.headerName || col.field)\"\n (click)=\"onHeaderMenuSortClick(col.field)\">\n\n @if ((col.field | columnSortState:api.sortModel) === 'asc') {\n <lucide-icon name=\"arrow-up-a-z\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n }\n @else if ((col.field | columnSortState:api.sortModel) === 'desc') {\n <lucide-icon name=\"arrow-down-z-a\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n }\n @else {\n <lucide-icon name=\"arrow-down-up\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n }\n </button>\n }\n\n <!-- Og Option Menu Button -->\n @if (col && !col._resolvedSuppressHeaderMenuButton) {\n <button\n type=\"button\"\n class=\"one-grid-header-menu-button\"\n [attr.aria-label]=\"'Options for ' + (col.headerName || col.field)\"\n [attr.aria-haspopup]=\"headerMenu ? 'menu' : null\"\n [attr.aria-expanded]=\"headerMenu ? openMenuColumn?.id === col.id : null\"\n [title]=\"'Options for ' + (col.headerName || col.field)\"\n (click)=\"onHeaderMenuOptionClick(col, $event)\">\n <i class=\"bi bi-three-dots-vertical\"></i>\n </button>\n }\n </div>\n </div>\n </div>\n }\n</ng-template>\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneCellStates, OneColumnDef } from '../models/one-column-def-types.model';\nimport { OneRowNode } from '../instants/one-row-node.class';\n\n@Pipe({\n name: 'cellEditable',\n standalone: true\n})\nexport class CellEditablePipe implements PipeTransform {\n transform(\n cellStates: OneCellStates,\n column: OneColumnDef,\n node: OneRowNode,\n editable: (column: OneColumnDef, node: OneRowNode) => boolean,\n updatable: (column: OneColumnDef, node: OneRowNode) => boolean,\n allowedEdit: boolean\n ): boolean {\n if (cellStates) {\n return (\n editable(column, node) &&\n updatable(column, node) &&\n allowedEdit &&\n !(\n column?.cellRendererParams?.validateSelectedRowOnly && !node?.selected\n ) &&\n ((node?.leaf &&\n !(node?.group && node?.leafGroup) &&\n !column?.autoGroupField) ||\n (!node?.leaf &&\n (node?.group || node?.leafGroup) &&\n column?.autoGroupField &&\n column?.editableLevels?.includes(node.level)))\n )\n }\n\n return false\n }\n}\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridSelectionService } from '../../core/services/one-grid-selection.service';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport { OneGridApi } from '../../core/instants/one-grid-api.class';\nimport { OneGridRowActionEvent } from '../../core/models/one-grid-types.model';\n\n@Component({\n standalone: true,\n selector: 'one-grid-checkbox',\n templateUrl: './one-grid-checkbox.component.html',\n styleUrl: './one-grid-checkbox.component.scss'\n})\nexport class OneGridCheckboxComponent<T> {\n\n @Input() node: OneRowNode<T>;\n @Input() allowedEdit: boolean = false;\n @Input() api!: OneGridApi<T>;\n @Output() onRowSelection = new EventEmitter<OneGridRowActionEvent<T>>();\n\n constructor(\n private selectionService: OneGridSelectionService,\n private eventService: OneGridEventService\n ) {}\n\n onToggleSelection(event: any) {\n\n const isChecked = event.target.checked;\n const { rowId, rowIndex, data } = this.node;\n\n // The mode rule (single clears the rest, multiple toggles) lives on the api\n // now, so pressing Space on a focused row and clicking this checkbox cannot\n // drift apart. It dispatches `selectionChanged` itself.\n this.api.toggleRowSelection(rowId, isChecked);\n\n this.onRowSelection.emit({ rowIndex, selected: isChecked, data, node: this.node });\n }\n}\n","\n<div class=\"one-grid-checkbox\">\n <input type=\"checkbox\"\n [name]=\"node.rowId\"\n [class.disabled]=\"!(allowedEdit)\"\n [checked]=\"node.selected\"\n (change)=\"onToggleSelection($event)\"/>\n</div>","import { Component, EventEmitter, Input, Output, Type } from '@angular/core';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { ExpansionChangedEvent } from '../../core/models/one-event-types.model';\nimport { OneDetailCellRendererParams } from '../../core/models/one-master-detail.model';\nimport { OneCellRendererComponent } from '../../core/models/one-tree-data.model';\n\n@Component({\n standalone: true,\n selector: 'one-grid-cell-group-renderer',\n templateUrl: './one-grid-cell-group-renderer.component.html',\n styleUrl: './one-grid-cell-group-renderer.component.scss'\n})\nexport class OneGridCellGroupRendererComponent<T> {\n\n @Input() node: OneRowNode<T>;\n @Input() masterDetail: boolean = false;\n @Input() detailCellRendererParams: OneDetailCellRendererParams;\n @Input() detailRendererComponent: Type<OneCellRendererComponent>;\n @Output() expansionChanged = new EventEmitter<ExpansionChangedEvent<T>>();\n\n /**\n * Presentational only: report the click and let the body, which holds the\n * API, perform the toggle. The click is stopped from bubbling so it is not\n * also read as a cell click by the cell underneath.\n */\n invokeChangedClick(event: MouseEvent) {\n\n event.stopPropagation();\n\n this.expansionChanged.emit({ rowIndex: this.node.rowIndex, data: this.node.data, node: this.node });\n }\n}\n","@if (node.expandable) {\n <span class=\"cell-group-renderer\" [style.padding-left.px]=\"6\">\n @if (node.children?.length > 0 || masterDetail) {\n <!-- A real button, not a div with a click handler: this is a\n disclosure control, so it needs to be focusable, operable with\n Enter and Space, and to expose its state via aria-expanded.\n mousedown is stopped so pressing the expander does not also\n begin a cell range selection on the cell underneath. -->\n <button\n type=\"button\"\n class=\"expansion-button\"\n [attr.aria-expanded]=\"node.expanded\"\n [attr.aria-label]=\"node.expanded ? 'Collapse row' : 'Expand row'\"\n (mousedown)=\"$event.stopPropagation()\"\n (dblclick)=\"$event.stopPropagation()\"\n (click)=\"invokeChangedClick($event)\">\n <i [class.node-expanded]=\"node.expanded\" class=\"bi bi-chevron-right expansion-icon\"></i>\n </button>\n }\n </span>\n}\n","import { AfterViewInit, Component, ElementRef, EventEmitter, HostListener, Input, Output, QueryList, ViewChild, ViewChildren } from '@angular/core';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneColumnDef } from '../../core/models/one-column-def-types.model';\nimport { CellOptionMenuSelectedEvent, OneCellOptionMenu } from '../../core/models/one-event-types.model';\n\n@Component({\n selector: 'one-grid-cell-option-menu',\n standalone: true,\n templateUrl: './one-grid-cell-option-menu.component.html',\n styleUrl: './one-grid-cell-option-menu.component.scss',\n})\nexport class OneGridCellOptionMenuComponent implements AfterViewInit {\n\n @Input() column: OneColumnDef = null;\n @Input() node: OneRowNode = null;\n @Input() options: OneCellOptionMenu[] = [];\n @Output() cellOptionMenuSelect = new EventEmitter<CellOptionMenuSelectedEvent>();\n @Output() cellOptionMenuClose = new EventEmitter<void>();\n\n @ViewChildren('item') private items?: QueryList<ElementRef<HTMLButtonElement>>;\n\n /**\n * Roving tabindex: one item is tabbable and the arrows move which. Standard\n * for a menu — a list of separately tabbable buttons makes a keyboard user\n * tab through every option to get past the menu.\n */\n protected activeIndex = 0;\n\n protected get menuLabel(): string {\n\n return `Options for ${this.column?.headerName ?? this.column?.field ?? 'this cell'}`;\n }\n\n constructor(private elementRef: ElementRef) {}\n\n /**\n * Move focus into the menu once it exists.\n *\n * Opening a menu and leaving focus on the trigger strands a keyboard user:\n * the menu is on screen and nothing they press reaches it.\n */\n ngAfterViewInit(): void {\n\n this.focusItem(0);\n }\n\n protected onItemKeydown(event: KeyboardEvent, index: number, option: OneCellOptionMenu): void {\n\n switch (event.key) {\n\n case 'ArrowDown':\n event.preventDefault();\n this.focusItem((index + 1) % this.options.length);\n return;\n\n case 'ArrowUp':\n event.preventDefault();\n this.focusItem((index - 1 + this.options.length) % this.options.length);\n return;\n\n case 'Home':\n event.preventDefault();\n this.focusItem(0);\n return;\n\n case 'End':\n event.preventDefault();\n this.focusItem(this.options.length - 1);\n return;\n\n case 'Enter':\n case ' ':\n // A <button> already activates on both, but only once the default runs.\n // Handling it here keeps the menu's behaviour independent of that.\n event.preventDefault();\n this.onOptionSelected(option);\n return;\n\n default:\n return;\n }\n }\n\n private focusItem(index: number): void {\n\n if (!this.options?.length) return;\n\n this.activeIndex = index;\n\n this.items?.get(index)?.nativeElement?.focus();\n }\n\n // Click outside\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: MouseEvent) {\n\n const target = event.target as HTMLElement;\n\n if (!this.elementRef.nativeElement.contains(target)) {\n\n this.close();\n }\n }\n\n // Escape key\n @HostListener('document:keydown.escape')\n onEscape() {\n\n this.close();\n }\n\n // Scroll closes menu (prevents misalignment)\n @HostListener('document:scroll')\n onScroll() {\n\n this.close();\n }\n\n // Option selected\n onOptionSelected(option: any) {\n\n this.cellOptionMenuSelect.emit({\n column: this.column,\n node: this.node,\n option: option\n });\n this.close();\n }\n\n // Single close method\n private close() {\n\n this.node.cellOptions[this.column.field] = false;\n this.cellOptionMenuClose.emit();\n }\n}\n","<!-- A menu, so it is announced as one and operable from the keyboard: the items\n were `<div (click)>` with no role, which meant the menu could be opened by\n mouse and then not used at all without one. -->\n<div class=\"cell-option-menu\" role=\"menu\" #menuEl [attr.aria-label]=\"menuLabel\">\n @for (opt of options; let index = $index; track opt.value) {\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"cell-option-menu-item\"\n #item\n [tabindex]=\"index === activeIndex ? 0 : -1\"\n (click)=\"onOptionSelected(opt)\"\n (keydown)=\"onItemKeydown($event, index, opt)\">\n <span>{{ opt.text }}</span>\n </button>\n }\n</div>\n","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridRowActionEvent, OneGridType } from '../../core/models/one-grid-types.model';\nimport { OneCellRendererParams, OneColumnDef } from '../../core/models/one-column-def-types.model';\nimport { OneGridCellService } from '../../core/services/one-grid-cell.service';\nimport { NgClass } from '@angular/common';\n\n@Component({\n standalone: true,\n imports: [NgClass],\n selector: 'one-grid-row-action',\n templateUrl: './one-grid-row-action.component.html',\n styleUrl: './one-grid-row-action.component.scss'\n})\nexport class OneGridRowActionComponent<T> implements OnInit {\n\n /**\n * Get Node & Cell Renderer From Parent Component\n */\n @Input({ required: true }) column: OneColumnDef<T>;\n @Input({ required: true }) node: OneRowNode<T>;\n @Input({ required: true }) allowedEdit: boolean = false;\n @Input() masterDetail: boolean = false;\n @Input() masterNode: OneRowNode<T> = null;\n @Input() cellRendererParams: OneCellRendererParams<T>;\n @Input() gridType: OneGridType = null;\n @Input() context: any = null;\n\n /**\n * Bind Event to Parent Component\n */\n @Output() onRowGotoDetail = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowAddNew = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowView = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLocation = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDocument = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowCopy = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDelete = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowGotoList = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowEdit = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowPrint = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowHistory = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowOption = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLanguage = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowCellOption = new EventEmitter<OneGridRowActionEvent<T>>();\n\n protected detailActiveExcludeLevels: Set<number>;\n protected gotoDetailExcludeLevels: Set<number>;\n protected addNewExcludeLevels: Set<number>;\n\n /**\n * Accessible names for the action buttons.\n *\n * Every one of them is an icon with no text, and none carried a label — a\n * screen reader announced \"button\" and nothing more, fourteen times per row.\n * These are also the `title`, so the icons are identifiable by pointer too.\n */\n protected readonly labels = {\n gotoDetail: 'Open detail',\n addNew: 'Add new row',\n view: 'View row',\n location: 'Show location',\n document: 'Open document',\n copy: 'Copy row',\n delete: 'Delete row',\n gotoList: 'Open list',\n edit: 'Edit row',\n print: 'Print row',\n history: 'View history',\n option: 'Row options',\n language: 'Change language',\n cellOption: 'Cell options',\n } as const;\n\n constructor(private readonly cellService: OneGridCellService) {}\n\n /**\n * Whether this column's action buttons are hidden for this row.\n *\n * The templates read `column?.hideActionButton` directly, which is truthy for\n * any function — so a predicate asking to hide the buttons showed them, and\n * one asking to show them showed them too. Resolved here instead, with the\n * same params every other row-scoped predicate gets.\n */\n protected get hideActionButton(): boolean {\n\n return this.cellService.hideActionButtonFn(this.column as OneColumnDef, this.node as OneRowNode);\n }\n\n /**\n * Whether this column's action buttons are disabled for this row.\n *\n * `disable` used to be resolved by `CellDisableResolverPipe`, which built its\n * own params — a different set from every other row-scoped predicate. It goes\n * through the shared builder now, so `disable` sees exactly what `editable`\n * and `hideActionButton` see.\n */\n protected get actionDisabled(): boolean {\n\n return this.cellService.disableFn(this.column as OneColumnDef, this.node as OneRowNode) || !this.allowedEdit;\n }\n\n ngOnInit(): void {\n\n this.detailActiveExcludeLevels = new Set(this.column.cellRendererParams?.detailActiveExcludeLevels ?? [])\n this.gotoDetailExcludeLevels = new Set(this.column.cellRendererParams?.gotoDetailExcludeLevels ?? [])\n this.addNewExcludeLevels = new Set(this.column.cellRendererParams?.addNewExcludeLevels ?? []);\n }\n\n /**\n * Trigger Invoke Click Event\n */\n invokeRowToggleDetailActiveExpand(node: OneRowNode): void {\n\n node.detailActive = !node.detailActive;\n }\n\n invokeRowActionGotoDetail(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowGotoDetail.emit(data);\n }\n\n invokeRowActionAddNew(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowAddNew.emit(data);\n }\n\n invokeRowActionView(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowView.emit(data);\n }\n\n invokeRowActionLocation(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowLocation.emit(data);\n }\n\n invokeRowActionDocument(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowDocument.emit(data);\n }\n\n invokeRowActionCopy(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowCopy.emit(data);\n }\n\n invokeRowActionDelete(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowDelete.emit(data);\n }\n\n invokeRowActionGotoList(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowGotoList.emit(data);\n }\n\n invokeRowActionEdit(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowEdit.emit(data);\n }\n\n invokeRowActionPrint(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowPrint.emit(data);\n }\n\n invokeRowActionHistory(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowHistory.emit(data);\n }\n\n invokeRowActionOption(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowOption.emit(data);\n }\n\n invokeRowActionLanguage(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowLanguage.emit(data);\n }\n\n invokeRowActionCellOption(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowCellOption.emit(data);\n }\n}\n","@if ((cellRendererParams && node?.leaf && !column?.autoGroupField && !(node.group && node.leafGroup)) || (column?.rowActionLevels?.includes(node.level) && column?.autoGroupField)) {\n <div class=\"btn-action-container\">\n\n <!-- Expansion Button Status -->\n @if ((cellRendererParams?.detailActiveButtonStatus == 1 && !(detailActiveExcludeLevels?.has(node.level)))) {\n <!-- A button, not an <a> with a click handler: it has no href, so\n it was neither focusable nor operable from the keyboard. -->\n <button\n type=\"button\"\n class=\"btn-action btn-action-plain me-2\"\n [attr.aria-expanded]=\"node.detailActive\"\n [attr.aria-label]=\"node.detailActive ? 'Collapse row' : 'Expand row'\"\n [title]=\"node.detailActive ? 'Collapse' : 'Expand'\"\n (click)=\"invokeRowToggleDetailActiveExpand(node)\">\n\n <i class=\"bi\" [ngClass]=\"{ 'bi-chevron-down': node.detailActive, 'bi-chevron-right': !node.detailActive }\"></i>\n </button>\n }\n\n <!-- Goto Detail Button Status -->\n @if ((cellRendererParams?.gotoDetailButtonStatus == 1 && !(gotoDetailExcludeLevels?.has(node.level))) && (!hideActionButton || allowedEdit)) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [attr.aria-label]=\"labels.gotoDetail\"\n [title]=\"labels.gotoDetail\"\n (click)=\"invokeRowActionGotoDetail(node, column)\">\n\n <i class=\"bi bi-list-task\"></i>\n </button>\n }\n\n <!-- Add New Button Status -->\n @if ((cellRendererParams?.addNewButtonStatus == 1 && !(addNewExcludeLevels?.has(node.level))) && (!hideActionButton || allowedEdit)) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.addNew\"\n [title]=\"labels.addNew\"\n (click)=\"invokeRowActionAddNew(node, column)\">\n\n <i class=\"bi bi-plus\"></i>\n </button>\n }\n\n <!-- View Button Status -->\n @if (cellRendererParams?.viewButtonStatus == 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [attr.aria-label]=\"labels.view\"\n [title]=\"labels.view\"\n (click)=\"invokeRowActionView(node, column)\">\n\n <i class=\"bi bi-eye\"></i>\n </button>\n }\n @if (cellRendererParams?.locationButtonStatus == 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [attr.aria-label]=\"labels.location\"\n [title]=\"labels.location\"\n (click)=\"invokeRowActionLocation(node, column)\">\n\n <i class=\"bi bi-geo-alt\"></i>\n </button>\n }\n\n <!-- Document Button Status -->\n @if (cellRendererParams?.documentButtonStatus == 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [attr.aria-label]=\"labels.document\"\n [title]=\"labels.document\"\n (click)=\"invokeRowActionDocument(node, column)\">\n\n <i class=\"bi bi-file-earmark-text\"></i>\n </button>\n }\n\n <!-- Copy Button Status -->\n @if (cellRendererParams?.copyButtonStatus == 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [attr.aria-label]=\"labels.copy\"\n [title]=\"labels.copy\"\n (click)=\"invokeRowActionCopy(node, column)\">\n\n <i class=\"bi bi-files\"></i>\n </button>\n }\n\n\n <!-- Delete Button Status -->\n @if (cellRendererParams?.deleteButtonStatus == 1 && (!hideActionButton || allowedEdit)) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-danger\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.delete\"\n [title]=\"labels.delete\"\n (click)=\"invokeRowActionDelete(node, column)\">\n\n <i class=\"bi bi-trash3\"></i>\n </button>\n }\n\n <!-- Goto List Button Status -->\n @if (cellRendererParams?.gotoListButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-success\"\n [attr.aria-label]=\"labels.gotoList\"\n [title]=\"labels.gotoList\"\n (click)=\"invokeRowActionGotoList(node, column)\">\n\n <i class=\"bi bi-list-ul\"></i>\n </button>\n }\n\n <!-- Edit Button Status -->\n @if (cellRendererParams?.editButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.edit\"\n [title]=\"labels.edit\"\n (click)=\"invokeRowActionEdit(node, column)\">\n\n <i class=\"bi bi-pencil\"></i>\n </button>\n }\n\n <!-- Print Button Status -->\n @if (cellRendererParams?.printButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.print\"\n [title]=\"labels.print\"\n (click)=\"invokeRowActionPrint(node, column)\">\n\n <i class=\"bi bi-printer\"></i>\n </button>\n }\n\n <!-- History Button Status -->\n @if (cellRendererParams?.historyButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.history\"\n [title]=\"labels.history\"\n (click)=\"invokeRowActionHistory(node, column)\">\n\n <i class=\"bi bi-clock-history\"></i>\n </button>\n }\n\n <!-- Option Button Status -->\n @if (cellRendererParams?.optionButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.option\"\n [title]=\"labels.option\"\n (click)=\"invokeRowActionOption(node, column)\">\n\n <i class=\"bi bi-three-dots-vertical\"></i>\n </button>\n }\n\n <!-- Language Button Status -->\n @if (cellRendererParams?.languageButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.language\"\n [title]=\"labels.language\"\n (click)=\"invokeRowActionLanguage(node, column)\">\n\n <i class=\"bi bi-translate\"></i>\n </button>\n }\n\n <!-- Cell Optoion Button Status (Context Menu) -->\n @if (cellRendererParams?.cellOptionButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary border-0 text-body\"\n [style.background]=\"'transparent'\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.cellOption\"\n [title]=\"labels.cellOption\"\n (click)=\"invokeRowActionCellOption(node, column)\">\n\n <i class=\"bi bi-three-dots-vertical\"></i>\n </button>\n }\n </div>\n}","import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridRowDragService } from '../../core/services/one-grid-row-drag.service';\nimport { OneRowDragEvent, OneRowDragSuppressedReason } from '../../core/models/one-row-drag.model';\nimport { LucideAngularModule } from 'lucide-angular';\nimport { ONE_GRID_ICON_PROVIDERS } from '../../core/icons/one-grid-icons';\n\n/** Why the handle is disabled, in words a user can act on. */\nconst SUPPRESSED_TEXT: Record<OneRowDragSuppressedReason, string> = {\n sorted: 'Rows cannot be reordered while a sort is applied. Clear the sort to reorder.',\n filtered: 'Rows cannot be reordered while a filter is applied. Clear the filter to reorder.',\n treeData: 'Rows cannot be reordered in a tree grid.',\n};\n\n/**\n * The grab handle for one row.\n *\n * A real `<button>`, not a styled div: it has to be focusable and operable from\n * the keyboard, because WCAG 2.5.7 requires everything achievable by dragging\n * to have a non-dragging alternative. Space picks the row up, the arrows move\n * it, space drops it and escape puts it back.\n *\n * When reordering is unavailable the handle is disabled and says why, rather\n * than disappearing — a control that vanishes when the user sorts looks like a\n * bug, and one that silently does nothing is worse.\n */\n@Component({\n standalone: true,\n imports: [LucideAngularModule],\n selector: 'one-grid-row-drag-handle',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [ONE_GRID_ICON_PROVIDERS],\n templateUrl: './one-grid-row-drag-handle.component.html',\n styleUrl: './one-grid-row-drag-handle.component.scss',\n})\nexport class OneGridRowDragHandleComponent<T> {\n\n @Input({ required: true }) node!: OneRowNode<T>;\n\n /** Non-null when the grid's order is not its own; see the model docs. */\n @Input() suppressedReason: OneRowDragSuppressedReason | null = null;\n\n @Output() dragEnd = new EventEmitter<OneRowDragEvent<T>>();\n\n constructor(private readonly dragService: OneGridRowDragService<T>) {}\n\n protected get disabled(): boolean {\n\n return this.suppressedReason !== null;\n }\n\n protected get label(): string {\n\n if (this.suppressedReason) return SUPPRESSED_TEXT[this.suppressedReason];\n\n return this.grabbed\n ? 'Moving row. Arrow keys to move, space to drop, escape to cancel.'\n : 'Drag to reorder row, or press space to move it with the arrow keys.';\n }\n\n /** True while this specific row is the one being moved. */\n protected get grabbed(): boolean {\n\n return this.dragService.state?.rowId === this.node.rowId;\n }\n\n protected onPointerDown(event: PointerEvent): void {\n\n if (this.disabled) return;\n\n // The body starts a cell range selection on mousedown; the handle is not\n // part of that, and a press here must not also select.\n event.stopPropagation();\n\n this.dragService.startPointerDrag(event, this.node, { onEnd: (result) => this.emit(result) });\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n\n if (this.disabled) return;\n\n switch (event.key) {\n\n case ' ':\n case 'Enter':\n event.preventDefault();\n this.dragService.toggleKeyboardDrag(this.node, { onEnd: (result) => this.emit(result) });\n return;\n\n case 'ArrowUp':\n if (!this.grabbed) return;\n event.preventDefault();\n this.dragService.moveKeyboard(-1);\n return;\n\n case 'ArrowDown':\n if (!this.grabbed) return;\n event.preventDefault();\n this.dragService.moveKeyboard(1);\n return;\n\n case 'Escape':\n if (!this.grabbed) return;\n event.preventDefault();\n this.dragService.cancel();\n return;\n\n default:\n return;\n }\n }\n\n /**\n * A row that is picked up and dropped where it started produces no event.\n * Blur while grabbed would otherwise strand the row mid-move, so it cancels.\n */\n protected onBlur(): void {\n\n if (this.grabbed && this.dragService.state?.source === 'keyboard') {\n\n this.dragService.cancel();\n }\n }\n\n private emit(result: OneRowDragEvent<T> | null): void {\n\n if (result) this.dragEnd.emit(result);\n }\n}\n","<button\n type=\"button\"\n class=\"one-row-drag-handle\"\n [class.one-row-drag-handle-grabbed]=\"grabbed\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"label\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\n [attr.aria-pressed]=\"disabled ? null : grabbed\"\n [title]=\"label\"\n (pointerdown)=\"onPointerDown($event)\"\n (keydown)=\"onKeyDown($event)\"\n (blur)=\"onBlur()\"\n (click)=\"$event.stopPropagation()\"\n (dblclick)=\"$event.stopPropagation()\">\n <lucide-icon name=\"grip-vertical\" [size]=\"14\" [strokeWidth]=\"2\"></lucide-icon>\n</button>\n","import { Directive, ElementRef, HostListener, Input } from '@angular/core';\nimport { OneCellValidationType } from '../models/one-column-def-types.model';\n\n@Directive({\n standalone: true,\n selector: '[oneCellInputValidator]'\n})\nexport class OneCellInputValidatorDirective {\n\n @Input() validationType?: OneCellValidationType;\n @Input() regex?: string = '';\n\n private readonly MAX_CODE_LENGTH: number = 36;\n private readonly KHMER_CHARACTER_RANGE = /[\\u1780-\\u17FF]/;\n\n constructor(private el: ElementRef<HTMLInputElement>) {}\n\n @HostListener('keypress', ['$event'])\n onKeyPress(event: KeyboardEvent) {\n\n let isValid = false;\n const char = event.key;\n const inputElement = this.el.nativeElement;\n\n switch (this.validationType) {\n\n case 'disabled':\n event.preventDefault();\n return;\n\n case 'integer':\n isValid = /^\\d+$/.test(char);\n break;\n\n case 'code':\n isValid = /[a-zA-Z\\d]/.test(char);\n if (isValid) {\n event.preventDefault();\n if (inputElement.value.length < this.MAX_CODE_LENGTH) {\n inputElement.value += char.toUpperCase();\n }\n }\n return;\n\n case 'title':\n isValid = /^[a-zA-Z\\s\\d]+$/.test(char) || this.KHMER_CHARACTER_RANGE.test(char);\n break;\n\n case 'number':\n isValid = /^[0-9.]$/.test(char) && !(char === '.' && inputElement.value.includes('.'));\n break;\n\n case 'regex':\n isValid = this.regex ? new RegExp(this.regex).test(char) : false;\n break;\n\n default:\n isValid = true;\n }\n\n if (!isValid) {\n event.preventDefault();\n }\n }\n\n @HostListener('keydown', ['$event'])\n onKeyDown(event: KeyboardEvent) {\n\n if (this.validationType === 'disabled') {\n\n event.preventDefault();\n }\n }\n}","import { ComponentRef, Directive, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, Type, ViewContainerRef } from '@angular/core';\nimport { OneCellRendererParams } from '../models/one-column-def-types.model';\nimport { OneCellRendererComponent } from '../models/one-tree-data.model';\nimport { getFieldValue } from '../../helpers/one-cell.helper';\n\n@Directive({\n standalone: true,\n selector: '[oneCellRendererComponent]'\n})\nexport class OneCellRendererComponentDirective implements OnInit, OnChanges, OnDestroy {\n\n @Input({ required: true }) cellRendererComponent!: Type<OneCellRendererComponent>;\n @Input({ required: true }) params: OneCellRendererParams;\n\n private compRef?: ComponentRef<OneCellRendererComponent>;\n private initialized = false;\n\n constructor(private vcr: ViewContainerRef) {}\n\n ngOnInit(): void {\n\n this.initialized = true;\n\n this.createOrUpdateComponent(true);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n\n if (!this.initialized) return;\n\n const componentChanged = changes['cellRendererComponent'];\n \n const paramsChanged = changes['params'];\n\n if (componentChanged) {\n\n this.destroyComponent();\n\n this.createOrUpdateComponent(true);\n\n } else if (paramsChanged) {\n\n this.updateComponentInputs();\n }\n }\n\n private createOrUpdateComponent(forceCreate = false): void {\n\n if (!this.cellRendererComponent) return;\n\n if (forceCreate || !this.compRef) {\n this.vcr.clear();\n this.compRef = this.vcr.createComponent(this.cellRendererComponent);\n }\n\n this.updateComponentInputs();\n }\n\n private updateComponentInputs(): void {\n\n if (!this.compRef?.instance) return;\n\n const instance = this.compRef.instance as OneCellRendererComponent;\n\n if (typeof instance.oneInit === 'function') {\n\n // The body supplies `value` already, and it honours the column's\n // valueGetter. Only derive it here when nothing did — this used to\n // overwrite unconditionally with the raw field, so a column with both a\n // valueGetter and a component renderer showed the underlying field\n // instead of the value every other part of the grid displays.\n const newParams = { ...this.params };\n\n if (newParams.value === undefined) {\n\n newParams.value = getFieldValue(this.params.data, this.params?.columnDef?.field) ?? null;\n }\n\n instance.oneInit(newParams);\n\n } else {\n\n Object.assign(instance, this.params);\n }\n\n // Optional: call change detector if needed\n // if (this.compRef.changeDetectorRef) {\n\n // this.compRef.changeDetectorRef.detectChanges();\n // }\n }\n\n private destroyComponent(): void {\n\n if (this.compRef) {\n\n this.compRef.destroy();\n\n this.compRef = undefined;\n }\n }\n\n ngOnDestroy(): void {\n\n this.destroyComponent();\n }\n}","import { Directive, ElementRef, HostListener, OnDestroy, Renderer2 } from '@angular/core';\n\n/**\n * Reveals a truncated cell in full while the pointer rests on it.\n *\n * Presentation lives in the stylesheet, under `.one-cell-text-expanded`. It\n * used to be applied as inline styles here, one of which was\n * `background: var(--ins-card-bg)` — a token from the application this library\n * was extracted from, which no consumer defines. The expanded cell therefore\n * had a transparent background and its text overlapped the next column. The\n * inline rules also set `z-index` on a statically positioned element, where it\n * does nothing.\n *\n * Overflow is measured on hover rather than after every view check. The old\n * version measured on init and on every text change, and reading `scrollWidth`\n * forces a synchronous layout — several hundred of them per render for a\n * normal viewport, to answer a question only the hovered cell ever asks.\n */\n@Directive({\n standalone: true,\n selector: '[oneCellTextExpand]'\n})\nexport class OneCellTextExpandDirective implements OnDestroy {\n\n private static readonly EXPANDED_CLASS = 'one-cell-text-expanded';\n private static readonly HOVER_DELAY_MS = 800;\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n\n constructor(private cell: ElementRef<HTMLElement>, private renderer: Renderer2) {}\n\n @HostListener('mouseenter')\n onMouseEnter(): void {\n\n const element = this.cell.nativeElement;\n\n // Measured here, so the layout read happens once for the cell being\n // hovered instead of for every cell on screen.\n if (element.scrollWidth <= element.clientWidth) return;\n\n this.timer = setTimeout(() => this.expand(), OneCellTextExpandDirective.HOVER_DELAY_MS);\n }\n\n @HostListener('mouseleave')\n onMouseLeave(): void {\n\n this.collapse();\n }\n\n ngOnDestroy(): void {\n\n this.collapse();\n }\n\n private expand(): void {\n\n this.renderer.addClass(this.cell.nativeElement, OneCellTextExpandDirective.EXPANDED_CLASS);\n }\n\n private collapse(): void {\n\n clearTimeout(this.timer);\n\n this.timer = undefined;\n\n this.renderer.removeClass(this.cell.nativeElement, OneCellTextExpandDirective.EXPANDED_CLASS);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneCellRendererParams } from '../models/one-column-def-types.model';\n\n@Pipe({\n standalone: true,\n name: 'cellActionButtonEnable'\n})\nexport class CellActionButtonEnablePipe<T> implements PipeTransform {\n\n transform(params: OneCellRendererParams<T> | null): boolean {\n\n if (!params) {\n \n return false;\n }\n\n const statusValues = Object.values(params);\n\n return statusValues.some(status => status === 1);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { getCellError } from '../../helpers/one-validation.helper';\nimport { OneCellStates, OneColumnDef } from '../models/one-column-def-types.model';\nimport { OneRowNode } from '../instants/one-row-node.class';\n\n@Pipe({\n standalone: true,\n name: 'cellInvalid'\n})\nexport class CellInvalidPipe<T> implements PipeTransform {\n\n transform(cellStates: OneCellStates, value: any, column: OneColumnDef<T>, node: OneRowNode<T>, allowedEdit: boolean, submitted: boolean): boolean {\n\n if (!column.validationRules?.length) {\n\n return false;\n }\n\n return getCellError(column, node, value, node.data) !== null && !(node.editing[column.field]) && !(column?.cellRendererParams?.validateSelectedRowOnly && !node?.selected) && allowedEdit && submitted;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { getCellKey } from '../../helpers/one-cell.helper';\n\n@Pipe({\n standalone: true,\n name: 'cellKey'\n})\nexport class CellKeyPipe implements PipeTransform {\n\n transform(rowId?: string | null, field?: string | null): string {\n\n if (!rowId || !field) {\n\n return '';\n }\n\n return getCellKey(rowId, field);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneRowNode } from '../instants/one-row-node.class';\n\n@Pipe({\n standalone: true,\n name: 'cellLevelPadding'\n})\nexport class CellLevelPaddingPipe implements PipeTransform {\n\n transform(level: number, factor: number): number {\n\n level += 1;\n \n return level * factor;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { getCellKey } from '../../helpers/one-cell.helper';\n\n@Pipe({\n standalone: true,\n name: 'cellSelected'\n})\nexport class CellSelectedPipe implements PipeTransform {\n\n transform(selectedCells: Set<string>, rowId: string, field: string): boolean {\n\n if (!selectedCells) return false;\n\n return selectedCells.has(getCellKey(rowId, field));\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneCellStates } from '../models/one-column-def-types.model';\n\n@Pipe({\n standalone: true,\n name: 'cellStateRenderer'\n})\nexport class CellStateRendererPipe implements PipeTransform {\n\n transform(cellStates: OneCellStates | null | undefined, field: string): string {\n\n const value = cellStates?.[field]?.value;\n\n if (value === null || value === undefined) {\n\n return null;\n }\n \n if (typeof value === 'string' && value.trim() === '') {\n\n return null;\n }\n\n return value;\n }\n}\n","import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output, QueryList, TemplateRef, Type, ViewChild, ViewChildren } from '@angular/core';\nimport { CellSelection, OneCellPresentationParams, OneCellRendererParams, OneColumnDef } from '../../core/models/one-column-def-types.model';\nimport { OneCellRendererComponent } from '../../core/models/one-tree-data.model';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridApi } from '../../core/instants/one-grid-api.class';\nimport { Subject, Subscription } from 'rxjs';\nimport { filter, take } from 'rxjs/operators';\nimport { OneGridGetRowIdParams, OneGridReadyEvent, OneGridRowActionEvent, OneGridType } from '../../core/models/one-grid-types.model';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport { CellOptionMenuSelectedEvent, ColumnChangedEvent, ExpansionChangedEvent, PinnedRowDataChangedEvent, RowDataChangedEvent, RowOrderChangedEvent, SelectionChangedEvent, SortChangedEvent } from '../../core/models/one-event-types.model';\nimport { OneDetailCellRendererParams } from '../../core/models/one-master-detail.model';\nimport { CellEditablePipe } from '../../core/pipes/cell-editable.pipe';\nimport { getCellKey, getFieldValue } from '../../helpers/one-cell.helper';\nimport { OneGridCellService } from '../../core/services/one-grid-cell.service';\nimport { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';\nimport { OgColumnService } from '../../core/services/og-column.service';\nimport { resolveColumnWidth } from '../../helpers/one-column-def.helper';\nimport { OneGridRowDragService } from '../../core/services/one-grid-row-drag.service';\nimport { OneRowDragEvent, OneRowDragState, OneRowDragSuppressedReason } from '../../core/models/one-row-drag.model';\nimport { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport { OneGridCheckboxComponent } from '../one-grid-checkbox/one-grid-checkbox.component';\nimport { OneGridCellGroupRendererComponent } from '../one-grid-cell-group-renderer/one-grid-cell-group-renderer.component';\nimport { OneGridCellOptionMenuComponent } from '../one-grid-cell-option-menu/one-grid-cell-option-menu.component';\nimport { OneGridRowActionComponent } from '../one-grid-row-action/one-grid-row-action.component';\nimport { OneGridRowDragHandleComponent } from '../one-grid-row-drag-handle/one-grid-row-drag-handle.component';\nimport { OneCellInputValidatorDirective } from '../../core/directives/one-cell-input-validator.directive';\nimport { OneCellRendererComponentDirective } from '../../core/directives/one-cell-renderer-component.directive';\nimport { OneCellTextExpandDirective } from '../../core/directives/one-cell-text-expand.directive';\nimport { CellActionButtonEnablePipe } from '../../core/pipes/cell-action-button-enable.pipe';\nimport { CellInvalidPipe } from '../../core/pipes/cell-invalid.pipe';\nimport { CellKeyPipe } from '../../core/pipes/cell-key.pipe';\nimport { CellLevelPaddingPipe } from '../../core/pipes/cell-level-padding.pipe';\nimport { CellSelectedPipe } from '../../core/pipes/cell-selected.pipe';\nimport { CellStateRendererPipe } from '../../core/pipes/cell-state-renderer.pipe';\n\n@Component({\n standalone: true,\n imports: [\n NgClass,\n NgStyle,\n NgTemplateOutlet,\n ScrollingModule,\n OneGridCheckboxComponent,\n OneGridCellGroupRendererComponent,\n OneGridCellOptionMenuComponent,\n OneGridRowActionComponent,\n OneGridRowDragHandleComponent,\n OneCellInputValidatorDirective,\n OneCellRendererComponentDirective,\n OneCellTextExpandDirective,\n CellActionButtonEnablePipe,\n CellEditablePipe,\n CellInvalidPipe,\n CellKeyPipe,\n CellLevelPaddingPipe,\n CellSelectedPipe,\n CellStateRendererPipe,\n ],\n selector: 'one-grid-body',\n // The host sits between role=\"grid\" and the rows it must own; a generic\n // element there breaks the ownership chain, so it leaves the a11y tree.\n host: { 'role': 'presentation' },\n templateUrl: './one-grid-body.component.html',\n styleUrl: './one-grid-body.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class OneGridBodyComponent<T> implements OnInit, AfterViewInit, OnDestroy {\n\n /**\n * Core Properties\n */\n @ViewChild('bodyRef', { static: true }) bodyRef!: ElementRef<HTMLElement>;\n @Input({ required: true }) rowData: T[] = [];\n @Input() rowNumber: boolean;\n @Input() api!: OneGridApi<T>;\n @Input() pagination: boolean = false;\n @Input() allowedEdit: boolean = true;\n @Input() enableGroupColumnDefs: boolean = false;\n @Input() submitted: boolean = false;\n\n /**\n * `'fullRow'`: a double-click opens every editable cell of the row, Enter or\n * focus leaving the row commits them together, Escape closes them all\n * without committing. Default: one cell at a time.\n */\n @Input() editType: 'fullRow' | null = null;\n @Input() context: any = null;\n @Input() getRowId: (params: OneGridGetRowIdParams<T>) => string;\n @Input({ required: true }) gridCopy$!: Subject<ClipboardEvent>;\n\n /**\n * Pinned rows are bound only so the component re-renders when they change;\n * the nodes themselves come from the API, which owns them.\n */\n @Input() pinnedTopRowData: T[] = [];\n @Input() pinnedBottomRowData: T[] = [];\n\n /**\n * The pinned row containers sit outside the scroll viewport, so they have to\n * be told the horizontal offset — the same arrangement the header uses.\n */\n @ViewChildren('pinnedViewport') private pinnedViewports?: QueryList<ElementRef<HTMLElement>>;\n\n protected pinnedTopNodes: OneRowNode<T>[] = [];\n protected pinnedBottomNodes: OneRowNode<T>[] = [];\n @ViewChild(CdkVirtualScrollViewport) viewport!: CdkVirtualScrollViewport;\n\n protected columnDefs: OneColumnDef<T>[] = [];\n protected cellRenderer: boolean = false;\n\n /**\n * Master Detail Properties\n */\n @Input() gridType: OneGridType = 'simple';\n @Input() masterDetail: boolean = false;\n @Input() masterNode: OneRowNode<T> = null;\n // @Input() detailRowHeight: number = null;\n // @Input() detailRowAutoHeight: boolean = false;\n @Input() detailRowMaxHeight: number = null;\n @Input() detailCellRendererParams: OneDetailCellRendererParams;\n @Input() detailGridTemplate: TemplateRef<unknown> = null;\n @Input() detailRendererComponent: Type<OneCellRendererComponent>;\n\n /**\n * Tree Data Properties\n */\n @Input() treeData: boolean = false;\n @Input() treeDataChildrenField: string;\n @Input() autoGroupColumnDef: OneColumnDef<T>;\n @Input() groupDefaultExpanded: number = -1; // It's work with master detail also\n\n /**\n * Passing Row Action Events to Parent\n */\n @Output() onRowGotoDetail = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowAddNew = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowView = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowCopy = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLocation = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDocument = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDelete = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowGotoList = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowEdit = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowPrint = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowHistory = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowOption = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLanguage = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowCellOption = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowSelection = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onShiftDoubleClick = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() rowCountChanged = new EventEmitter<number>();\n\n @Output() expansionChanged = new EventEmitter<ExpansionChangedEvent<T>>();\n @Output() bodyScroll = new EventEmitter<number>();\n @Output() cellOptionSelect = new EventEmitter<any>();\n @Output() rowDragEnd = new EventEmitter<OneRowDragEvent<T>>();\n\n /**\n * Selection Range Variables\n */\n protected rowWidth: number = 0;\n protected nodes: OneRowNode<T>[] = [];\n\n /**\n * Row drag state, mirrored from the service so the template can read it\n * synchronously. `null` whenever no drag is in flight.\n */\n protected dragState: OneRowDragState | null = null;\n protected dragAnnouncement = '';\n protected rowDragSuppressed: OneRowDragSuppressedReason | null = null;\n protected selectedCells = new Set<string>();\n private isMouseDown = false;\n private startCell: CellSelection = null;\n private lastScrollLeft = 0;\n private cellEditablePipe = new CellEditablePipe();\n private subscriptions = new Subscription();\n\n protected cellRendererParams: OneCellRendererParams = {\n gotoDetailButtonStatus: 1,\n addNewButtonStatus: 1,\n viewButtonStatus: 1,\n locationButtonStatus: 1,\n documentButtonStatus: 1,\n copyButtonStatus: 1,\n deleteButtonStatus: 1,\n gotoListButtonStatus: 1,\n optionButtonStatus: 1,\n languageButtonStatus: 1,\n editButtonStatus: 1,\n printButtonStatus: 1,\n historyButtonStatus: 1,\n }\n\n /**\n * Virtual Scroll Properties\n */\n protected itemSize: number = 30;\n protected minBufferPx: number = 200;\n protected maxBufferPx: number = 400;\n\n constructor(\n protected colService: OgColumnService,\n protected cellService: OneGridCellService,\n private eventService: OneGridEventService,\n protected rowDragService: OneGridRowDragService<T>,\n private cdr: ChangeDetectorRef\n ) { }\n\n ngOnInit(): void {\n\n /**\n * Listen Grid Copy Event\n */\n this.subscriptions.add(this.gridCopy$.subscribe((event: ClipboardEvent) => {\n\n this.onGridCopy(event);\n }));\n\n /**\n * Row drag\n *\n * The service owns the gesture; the body only renders it and lends it the\n * viewport, the row height and a way to apply a move. The suppression\n * reason is re-read on every event that could change the order, so the\n * handle disables itself the moment a sort or filter is applied.\n */\n this.subscriptions.add(this.rowDragService.state$.subscribe((state) => {\n\n this.dragState = state;\n\n this.updateDropIndicator();\n\n this.cdr.markForCheck();\n }));\n\n this.subscriptions.add(this.rowDragService.announcement$.subscribe((message) => {\n\n this.dragAnnouncement = message;\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Column Changed Event\n */\n this.subscriptions.add(this.eventService.addEventListener('columnChanged', (payload: ColumnChangedEvent) => {\n\n this.columnDefs = [...payload.columns] as OneColumnDef[];\n\n // Params carry the columnDef, so a column change invalidates them all.\n this.rendererParamsCache.clear();\n\n this.cellRenderer = this.columnDefs.some(col => col.cellRendererComponent);\n\n this.rowWidth = this.columnDefs.reduce((sum, col) => sum + resolveColumnWidth(col), 0);\n\n // A column change can alter the width left for flex columns (a hide, a\n // resize, new defs). Re-flexing only dispatches when a width actually\n // changes, so this cannot ping-pong.\n this.applyFlexWidths();\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Row Data Changed Event\n */\n this.subscriptions.add(this.eventService.addEventListener('rowDataChanged', ({ nodes: allNodes }: RowDataChangedEvent<T>) => {\n\n // The full post-filter count, reported before the page slice is taken,\n // so the host's paging totals see everything.\n this.rowCountChanged.emit(allNodes?.length ?? 0);\n\n // New rows, new renderer params — and removed rows leave no stale\n // cache entries behind.\n this.rendererParamsCache.clear();\n\n const nodes = this.api.pageNodes(allNodes);\n\n setTimeout(() => {\n\n this.viewport?.checkViewportSize();\n\n this.setVirtualScroll(nodes?.length);\n\n if (this.masterDetail) {\n\n this.nodes = nodes.map((node: OneRowNode) => {\n\n if (node.leaf && this.detailRendererComponent) {\n\n node.detailRendererComponent = this.detailRendererComponent;\n }\n\n // Detail rows can still be in flight when a row is expanded, and\n // spreading null throws. Nothing to re-seed until they arrive.\n if (node.expanded && node.detailRowData) {\n\n this.api.setDetailRowData(node, [...node.detailRowData]);\n }\n\n return node;\n });\n\n } else {\n\n this.nodes = nodes as OneRowNode<T>[];\n }\n\n this.refreshRowDragSuppressed();\n\n this.cdr.markForCheck();\n });\n }));\n\n\n /**\n * Listen Pinned Row Data Changed Event\n */\n this.subscriptions.add(this.eventService.addEventListener('pinnedRowDataChanged', ({ side, nodes }: PinnedRowDataChangedEvent<T>) => {\n\n this.rendererParamsCache.clear();\n\n if (side === 'top') {\n\n this.pinnedTopNodes = nodes as OneRowNode<T>[];\n\n } else {\n\n this.pinnedBottomNodes = nodes as OneRowNode<T>[];\n }\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Sort Changed Event\n */\n this.subscriptions.add(this.eventService.addEventListener('sortChanged', ({ nodes }: SortChangedEvent) => {\n\n this.nodes = this.api.pageNodes(nodes as OneRowNode<T>[]);\n\n // Sorting takes ownership of the order away from the user, so the handles\n // have to disable in the same frame the rows re-sort.\n this.refreshRowDragSuppressed();\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Row Order Changed Event\n *\n * Deliberately not folded into `rowDataChanged`: that path defers a frame\n * and re-seeds detail rows, which is right for a data load and far too much\n * for a move. A reorder is the same nodes in a different order.\n */\n this.subscriptions.add(this.eventService.addEventListener('rowOrderChanged', ({ nodes }: RowOrderChangedEvent<T>) => {\n\n this.nodes = this.api.pageNodes([...nodes] as OneRowNode<T>[]);\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Cell State Changed Event\n *\n * The body renders OnPush, so regenerating a row's cell state is invisible\n * until something marks the body dirty. This is that something.\n */\n this.subscriptions.add(this.eventService.addEventListener('cellStateChanged', () => {\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Selection Changed Event\n */\n this.subscriptions.add(this.eventService.addEventListener('selectionChanged', (payload: SelectionChangedEvent<T>) => {\n\n if (payload) {\n\n this.cdr.markForCheck();\n }\n }));\n }\n\n onGridReady(params: OneGridReadyEvent) {\n\n params.api.setRowData(this.masterNode?.detailRowData ?? []);\n }\n\n onBodyScroll(event: Event) {\n\n const scrollLeft = (event.target as HTMLElement).scrollLeft;\n\n if (scrollLeft !== this.lastScrollLeft) {\n\n this.lastScrollLeft = scrollLeft;\n\n this.syncPinnedRows(scrollLeft);\n\n this.bodyScroll.emit(scrollLeft);\n\n // The indicator is clipped to the row content, which moves sideways too.\n if (this.dragState) {\n\n this.updateDropIndicator();\n\n this.cdr.markForCheck();\n }\n\n return;\n }\n\n // Vertical: the drop indicator is anchored to the body, not the content, so\n // it has to be repositioned as the rows move beneath it — which they do on\n // their own during auto-scroll, with the pointer standing still.\n if (this.dragState) {\n\n this.updateDropIndicator();\n\n this.cdr.markForCheck();\n }\n }\n\n /**\n * Keep the pinned rows in step with the body's horizontal position.\n *\n * Assigned rather than transformed, for the same reason as the header: sticky\n * positioning for pinned *columns* has to resolve against a real scrollport,\n * and a transformed ancestor is not one. Pinned rows and pinned columns\n * therefore compose — a frozen corner cell stays frozen on both axes.\n */\n private syncPinnedRows(scrollLeft: number): void {\n\n this.pinnedViewports?.forEach(viewport => (viewport.nativeElement.scrollLeft = scrollLeft));\n }\n\n /**\n * Track Rendering Row Node By Row ID\n */\n trackByRowId(index: number, node: OneRowNode<T>): string {\n\n return node.rowId;\n }\n\n /**\n * Cell Selection Range Feature\n */\n startSelection(rowId: string, field: string) {\n\n this.isMouseDown = true;\n this.startCell = { rowId, field };\n this.selectedCells.clear();\n this.selectedCells = new Set(this.selectedCells).add(getCellKey(rowId, field));\n }\n\n extendSelection(rowId: string, field: string) {\n\n if (!this.isMouseDown || !this.startCell) return;\n\n const rows = this.nodes; // already sorted\n const startRowIndex = rows.findIndex(r => r.rowId === this.startCell!.rowId);\n const endRowIndex = rows.findIndex(r => r.rowId === rowId);\n\n if (startRowIndex === -1 || endRowIndex === -1) return;\n\n const colStartIndex = this.columnDefs.findIndex(c => c.field === this.startCell!.field);\n const colEndIndex = this.columnDefs.findIndex(c => c.field === field);\n\n if (colStartIndex === -1 || colEndIndex === -1) return;\n\n const rowStart = Math.min(startRowIndex, endRowIndex);\n const rowEnd = Math.max(startRowIndex, endRowIndex);\n const colStart = Math.min(colStartIndex, colEndIndex);\n const colEnd = Math.max(colStartIndex, colEndIndex);\n\n const next = new Set<string>();\n\n for (let r = rowStart; r <= rowEnd; r++) {\n for (let c = colStart; c <= colEnd; c++) {\n next.add(getCellKey(rows[r].rowId, this.columnDefs[c].field));\n }\n }\n\n this.selectedCells = next;\n }\n\n\n endSelection() {\n\n this.isMouseDown = false;\n this.startCell = null;\n }\n\n /**\n * Clear Cells Selected\n */\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: MouseEvent): void {\n\n if (this.bodyRef?.nativeElement) {\n\n const clickedInside = this.bodyRef.nativeElement.contains(event.target as Node);\n\n if (!clickedInside) {\n\n this.selectedCells.clear();\n }\n }\n }\n\n /**\n * Selection Range Event Hold Mouse Click\n */\n @HostListener('document:mouseup')\n onGlobalMouseUp() {\n\n this.endSelection();\n }\n\n /**\n * Listen Copy Clipboard Event\n */\n onGridCopy(event: ClipboardEvent) {\n\n event.preventDefault();\n\n if (this.selectedCells.size > 0) {\n\n const text = this.buildClipboardText();\n\n event.clipboardData?.setData('text/plain', text);\n\n this.selectedCells.forEach(cellId => {\n\n const cellElement = document.querySelector(`[data-cell-id=\"${cellId}\"]`);\n\n if (cellElement) {\n\n cellElement.classList.add('one-cell-copied');\n\n setTimeout(() => cellElement.classList.remove('one-cell-copied'), 400);\n }\n });\n }\n }\n\n copyToClipboard(value: string) {\n\n if (navigator.clipboard?.writeText) {\n\n navigator.clipboard.writeText(value);\n\n } else {\n\n // Fallback (Safari / older browsers)\n const textarea = document.createElement('textarea');\n textarea.value = value;\n textarea.style.position = 'fixed';\n textarea.style.opacity = '0';\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n }\n }\n\n /**\n * Build Copy Cell Text to Clipboard\n */\n private buildClipboardText(): string {\n\n if (!this.selectedCells.size) return '';\n\n // Parse selected cells\n const selected = Array.from(this.selectedCells).map(key => {\n\n const [rowId, field] = key.split('--');\n return { rowId, field };\n });\n\n // Resolve visual row indexes from displayedRows\n const rowIndexes = selected\n .map(s => this.nodes.findIndex(r => r.rowId === s.rowId))\n .filter(i => i !== -1);\n\n const colIndexes = selected\n .map(s => this.columnDefs.findIndex(c => c.field === s.field))\n .filter(i => i !== -1);\n\n if (!rowIndexes.length || !colIndexes.length) return '';\n\n const rowStart = Math.min(...rowIndexes);\n const rowEnd = Math.max(...rowIndexes);\n const colStart = Math.min(...colIndexes);\n const colEnd = Math.max(...colIndexes);\n\n const selectedFields = this.columnDefs\n .slice(colStart, colEnd + 1)\n .map(c => c.field);\n\n const clipboardLines: string[] = [];\n\n for (let r = rowStart; r <= rowEnd; r++) {\n\n const row = this.nodes[r];\n const line = selectedFields\n .map(field => {\n\n const key = `${row.rowId}--${field}`;\n\n if (!this.selectedCells.has(key)) {\n\n return '';\n }\n const value = getFieldValue(row.data, field);\n\n return value ?? '';\n\n }).join('\\t');\n\n clipboardLines.push(line);\n }\n\n return clipboardLines.join('\\n');\n }\n\n /**\n * Binding Events Row Action to Parent\n */\n invokeRowActionGotoDetail(event: OneGridRowActionEvent<T>) {\n\n this.onRowGotoDetail.emit(event);\n }\n\n invokeRowActionAddNew(event: OneGridRowActionEvent<T>) {\n\n this.onRowAddNew.emit(event);\n }\n\n invokeRowActionView(event: OneGridRowActionEvent<T>) {\n\n this.onRowView.emit(event);\n }\n\n invokeRowActionLocation(event: OneGridRowActionEvent<T>) {\n\n this.onRowLocation.emit(event);\n }\n\n invokeRowActionDocument(event: OneGridRowActionEvent<T>) {\n\n this.onRowDocument.emit(event);\n }\n\n invokeRowActionCopy(event: OneGridRowActionEvent<T>) {\n\n this.onRowCopy.emit(event);\n }\n\n invokeRowActionDelete(event: OneGridRowActionEvent<T>) {\n\n this.onRowDelete.emit(event);\n }\n\n invokeRowActionGotoList(event: OneGridRowActionEvent<T>) {\n\n this.onRowGotoList.emit(event);\n }\n\n invokeRowActionEdit(event: OneGridRowActionEvent<T>) {\n\n this.onRowEdit.emit(event);\n }\n\n invokeRowActionPrint(event: OneGridRowActionEvent<T>) {\n\n this.onRowPrint.emit(event);\n }\n\n invokeRowActionHistory(event: OneGridRowActionEvent<T>) {\n\n this.onRowHistory.emit(event);\n }\n\n invokeRowActionOption(event: OneGridRowActionEvent<T>) {\n\n this.onRowOption.emit(event);\n }\n\n invokeRowActionLanguage(event: OneGridRowActionEvent<T>) {\n\n this.onRowLanguage.emit(event);\n }\n\n /**\n * Open the cell option menu, and tell the host it was asked for.\n *\n * The opening is the part that was missing. Everything else existed — the\n * trigger button behind `cellRendererParams.cellOptionButtonStatus`, the menu\n * component, the `cellOptionMenu` column property, the selection event wired\n * through to the grid's output — but nothing ever set the flag the template\n * renders on, so the button did nothing at all.\n *\n * Done here rather than in the row-action component because this is the\n * component whose template renders the menu, and so the one that has to be\n * marked for check.\n */\n invokeRowActionCellOption(event: OneGridRowActionEvent<T>) {\n\n const field = event.column?.field as string;\n\n // Nothing to open when the column declared no options; the event still\n // goes to the host, which may be driving something of its own.\n if (field && event.node && event.column?.cellOptionMenu?.length) {\n\n event.node.cellOptions[field] = true;\n\n this.cdr.markForCheck();\n }\n\n this.onRowCellOption.emit(event);\n }\n\n /**\n * The menu closed itself — on select, on Escape, or on a click outside. It\n * has already cleared its own flag; this is what repaints without it.\n */\n cellOptionMenuClosed(): void {\n\n this.cdr.markForCheck();\n }\n\n invokeRowActionSelection(event: OneGridRowActionEvent<T>) {\n\n this.onRowSelection.emit(event);\n }\n\n /**\n * Toggle a group / master row, then report the result.\n *\n * The group renderer is presentational: it says \"the expander was clicked\"\n * and nothing more. Performing the state change belongs here, where the API\n * is available. Previously this method only re-emitted, so the expander\n * rendered, animated on hover and did nothing at all — every consumer had to\n * discover for itself that `expansionChanged` was a request rather than the\n * notification its past-tense name promises.\n *\n * The event is re-emitted *after* the toggle, so `event.node.expanded` is the\n * new state, which is what a past-tense event should carry.\n */\n invokeExpansionChangedClick(event: ExpansionChangedEvent): void {\n\n const node = this.api.getRowNodeById(event.node.rowId) ?? event.node;\n\n this.api.setExpandedById(node.rowId, !node.expanded);\n\n this.expansionChanged.emit({ ...event, node, api: this.api });\n }\n\n cellOptionMenuSelected(event: CellOptionMenuSelectedEvent) {\n\n this.cellOptionSelect.emit(event);\n }\n\n /**\n * Special Events\n */\n private invokeShiftDoubleClick(node:OneRowNode, column: OneColumnDef): void {\n\n let event: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n event = { ...event, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onShiftDoubleClick.emit(event);\n }\n\n /**\n * Cell Edit Feature\n */\n startEdit(event: MouseEvent, node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n const target = event.target as HTMLElement;\n\n if (target.tagName.toLowerCase() === 'i') {\n\n return;\n }\n\n if (event.shiftKey) {\n\n this.invokeShiftDoubleClick(node, column);\n return;\n }\n\n if (!this.cellEditablePipe.transform(node.cellStates, column, node, this.cellService.editableFn, this.cellService.updatableFn, this.allowedEdit)) {\n\n this.selectedCells.clear();\n\n const cellKey = getCellKey(node.rowId, column.field);\n\n this.selectedCells.add(cellKey);\n\n return;\n }\n\n let rowNode: OneRowNode = this.api.getRowNodeById(node.rowId);\n\n if (rowNode) {\n\n if (this.editType === 'fullRow') {\n\n // The whole row edits together, so every cell that would accept its\n // own double-click opens now. The clicked one still takes focus below.\n for (const col of this.columnDefs) {\n\n if (!col.field) continue;\n\n if (this.cellEditablePipe.transform(rowNode.cellStates, col, rowNode, this.cellService.editableFn, this.cellService.updatableFn, this.allowedEdit)) {\n\n rowNode.editing[col.field] = true;\n }\n }\n\n } else {\n\n rowNode.editing[column.field] = true;\n }\n\n setTimeout(() => {\n\n const input = document.querySelector<HTMLInputElement | HTMLSelectElement>(`[data-cell-id=\"${ getCellKey(node.rowId, column.field) }\"] input, [data-cell-id=\"${ getCellKey(node.rowId, column.field) }\"] select`);\n\n if (input) {\n\n input.focus();\n\n const value = input.value;\n\n // A select reports type 'select-one', so only a text input gets its\n // caret placed.\n if (value && [\"text\"].includes(input.type) && 'setSelectionRange' in input) {\n\n input.setSelectionRange(value.length, value.length);\n }\n }\n }, 10);\n }\n }\n\n /**\n * Save Cell Edit Mode\n */\n stopEdit(node: OneRowNode<T>, column: OneColumnDef<T>, event: any) {\n\n if (this.editType === 'fullRow') {\n\n this.stopRowEditFromEvent(node, event);\n\n return;\n }\n\n let rowNode: OneRowNode = this.api.getRowNodeById(node.rowId);\n\n // The editing guard makes a second commit for one edit a no-op: a select\n // commits on (change), which closes the editor, and the (blur) that can\n // follow must not commit again.\n if (rowNode && rowNode.editing[column.field]) {\n\n event.preventDefault();\n event.stopPropagation();\n\n const value = event.target.value ?? '';\n const oldValue = rowNode.data[column.field];\n\n this.setCellValueByRowId(node.rowId, column, value);\n\n this.finishEdit(rowNode, column, oldValue);\n }\n }\n\n /**\n * Save a `select` editor's choice.\n *\n * Separate from `stopEdit` because the value is not the element's string:\n * the chosen index maps back into `selectOptions`, so the committed value\n * keeps whatever type the option declared.\n */\n stopEditSelect(node: OneRowNode<T>, column: OneColumnDef<T>, event: any) {\n\n if (this.editType === 'fullRow') {\n\n // (change) is not a commit in full-row mode — the choice sits in the\n // select until the row commits and reads every editor at once. Only a\n // blur that actually leaves the row closes it.\n if (event.type === 'blur') this.stopRowEditFromEvent(node, event);\n\n return;\n }\n\n let rowNode: OneRowNode = this.api.getRowNodeById(node.rowId);\n\n if (rowNode && rowNode.editing[column.field]) {\n\n event.stopPropagation();\n\n const options = column?.cellRendererParams?.selectOptions ?? [];\n const option = options[(event.target as HTMLSelectElement).selectedIndex];\n\n if (!option) return;\n\n const oldValue = rowNode.data[column.field];\n\n rowNode.data[column.field] = option.value;\n\n this.finishEdit(rowNode, column, oldValue);\n }\n }\n\n /** Close the editor and announce the commit. Shared by both editor kinds. */\n private finishEdit(rowNode: OneRowNode, column: OneColumnDef<T>, oldValue: any) {\n\n const newValue = rowNode.data[column.field];\n\n rowNode.cellStates = this.cellService.generateCellStates(rowNode);\n rowNode.editing[column.field] = false;\n\n this.eventService.dispatchEvent('cellStateChanged', {\n data: rowNode.data,\n node: rowNode,\n column: column\n });\n\n // Compared after normalisation ('' -> null, number coercion), so a blur\n // that leaves the value as it was does not announce an edit.\n if (newValue !== oldValue) {\n\n this.eventService.dispatchEvent('cellValueChanged', {\n node: rowNode,\n data: rowNode.data,\n column: column,\n field: column.field,\n oldValue,\n newValue,\n });\n }\n }\n\n /**\n * Cancel Cell Edit Mode\n */\n cancelEdit(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let rowNode: OneRowNode = this.api.getRowNodeById(node.rowId);\n\n if (rowNode) {\n\n if (this.editType === 'fullRow') {\n\n // Escape abandons the whole row: every editor closes, nothing commits.\n Object.keys(rowNode.editing).forEach(field => rowNode.editing[field] = false);\n\n return;\n }\n\n rowNode.editing[column.field] = false;\n }\n }\n\n /**\n * Full-row commit, routed from any one editor's Enter or blur.\n *\n * A blur that lands on another editor in the same row is the user tabbing\n * between fields, not leaving the row — the editors stay open and their\n * typed values stay in the DOM until the row commits.\n */\n private stopRowEditFromEvent(node: OneRowNode<T>, event: any) {\n\n if (event.type === 'blur') {\n\n const next = (event as FocusEvent).relatedTarget as HTMLElement | null;\n\n if (next?.matches?.('input.one-cell-input, select.one-cell-input')\n && next.closest?.(`[data-cell-id^=\"${node.rowId}--\"]`)) {\n\n return;\n }\n }\n\n event.preventDefault?.();\n event.stopPropagation?.();\n\n this.stopRowEdit(node);\n }\n\n /** Commit every open editor of one row, reading each from the DOM. */\n private stopRowEdit(node: OneRowNode<T>) {\n\n const rowNode: OneRowNode = this.api.getRowNodeById(node.rowId);\n\n if (!rowNode) return;\n\n for (const column of this.columnDefs) {\n\n const field = column.field as string;\n\n if (!field || !rowNode.editing[field]) continue;\n\n const key = getCellKey(rowNode.rowId, field);\n const editor = document.querySelector<HTMLInputElement | HTMLSelectElement>(\n `[data-cell-id=\"${key}\"] input, [data-cell-id=\"${key}\"] select`);\n\n const oldValue = rowNode.data[field];\n\n if (editor?.tagName === 'SELECT') {\n\n const options = column.cellRendererParams?.selectOptions ?? [];\n const option = options[(editor as HTMLSelectElement).selectedIndex];\n\n if (option) rowNode.data[field] = option.value;\n\n } else if (editor) {\n\n const raw = editor.value ?? '';\n\n rowNode.data[field] = raw === ''\n ? null\n : column.cellRendererParams?.inputType === 'number' ? Number(raw) : raw;\n }\n\n // finishEdit closes the editor, refreshes the cell state and raises\n // cellValueChanged when the value moved — one event per changed cell,\n // the same contract as single-cell editing.\n this.finishEdit(rowNode, column, oldValue);\n }\n }\n\n /**\n * Set Cell Value\n */\n setCellValueByRowId(rowId: string, column: OneColumnDef, value: any) {\n\n const node = this.api.getRowNodeById(rowId);\n\n if (node && column.field) {\n\n if (column?.cellRendererParams?.inputType !== 'number') {\n\n node.data[column.field] = value === '' ? null : value;\n\n } else {\n\n node.data[column.field] = value === '' ? null : Number(value);\n }\n }\n }\n\n /**\n * Virtual Scroll Properties\n *\n * The buffer scales with the row count so small grids render in one pass, but\n * it is capped: `itemSize * items * 1.5` is 1.5x the *total* content height,\n * and CdkFixedSizeVirtualScroll expands its rendered range until the buffer is\n * satisfied. Uncapped, that makes the viewport materialise every row and\n * virtual scrolling stops doing anything at all (100k rows locked the tab).\n * MAX_BUFFER_PX keeps roughly twenty rows of overscan either side instead.\n */\n private readonly MAX_BUFFER_PX: number = 600;\n\n setVirtualScroll(items: number = 0): void {\n\n this.minBufferPx = Math.min(this.itemSize * items * 1.5, this.MAX_BUFFER_PX);\n\n this.maxBufferPx = this.minBufferPx * 2;\n }\n\n /**\n * Unsubscribe All Subscriptions\n */\n /**\n * Hand the drag service what it needs to run a gesture.\n *\n * Deferred to here because the viewport element does not exist until the view\n * is up, and `nodes` is passed as a getter rather than a value — a drag\n * mutates the order underneath it, so a snapshot taken at attach time would\n * go stale on the first move.\n */\n ngAfterViewInit(): void {\n\n const element = this.viewport?.elementRef?.nativeElement;\n\n if (!element) return;\n\n this.rowDragService.attach({\n viewport: element,\n itemSize: this.itemSize,\n nodes: () => this.nodes,\n move: (fromIndex: number, toIndex: number) => {\n\n const moved = this.api.moveRow(fromIndex, toIndex);\n\n if (moved) this.cdr.markForCheck();\n\n return moved;\n },\n });\n\n this.refreshRowDragSuppressed();\n\n // The CDK inserts its own content wrapper between the viewport and the\n // rows. It has no template of ours to annotate, and left generic it breaks\n // the `grid > row` ownership the roles depend on.\n const wrapper = element.querySelector('.cdk-virtual-scroll-content-wrapper');\n\n wrapper?.setAttribute('role', 'presentation');\n\n // Flex columns size against this viewport, now and whenever it resizes.\n // applyFlexWidths is a no-op without flex columns and dispatches only on a\n // real change, so grids that never use flex pay nothing here.\n this.applyFlexWidths();\n\n if (typeof ResizeObserver !== 'undefined') {\n\n this.flexResizeObserver = new ResizeObserver(() => this.applyFlexWidths());\n this.flexResizeObserver.observe(element);\n }\n }\n\n private flexResizeObserver?: ResizeObserver;\n\n private applyFlexWidths(): void {\n\n const width = this.viewport?.elementRef?.nativeElement?.clientWidth ?? 0;\n\n if (width > 0) this.api.applyFlexWidths(width);\n }\n\n /**\n * The params every per-cell callback receives.\n *\n * Built here rather than inline in the template so the whole documented\n * shape is passed — `value`, `field`, `rowIndex`, `api` and `context` were\n * all declared on `OneCellRendererParams` and none of them were being sent,\n * so a `cellClass` reading `params.value` silently got `undefined`.\n */\n protected cellParams(node: OneRowNode<T>, column: OneColumnDef<T>): OneCellPresentationParams<T> {\n\n return this.cellService.cellParams(column, node) as OneCellPresentationParams<T>;\n }\n\n /**\n * Params for a component cell renderer.\n *\n * The cell params, plus whatever the column declared in\n * `cellRendererParams` — a field that exists precisely so a renderer can be\n * configured per column, and that nothing had ever forwarded to it. Column\n * config goes first so the grid's own fields win a name collision.\n */\n /**\n * Cached per cell, keyed on the identities that mean \"this cell changed\":\n * its cellStates object (replaced on every edit and state refresh) and its\n * data object. Building a fresh object per call — which a template method\n * does per change-detection pass — made the renderer directive see \"params\n * changed\" every pass and re-run the component's oneInit each time. A\n * renderer whose oneInit touched grid state (a custom tree expander is the\n * classic case) then re-triggered change detection and looped forever.\n */\n private rendererParamsCache = new Map<string, { states: unknown; data: unknown; params: OneCellRendererParams<T> }>();\n\n protected rendererParams(node: OneRowNode<T>, column: OneColumnDef<T>): OneCellRendererParams<T> {\n\n const key = getCellKey(node.rowId, (column.field as string) ?? column.id ?? '');\n const cached = this.rendererParamsCache.get(key);\n\n if (cached && cached.states === node.cellStates && cached.data === node.data) return cached.params;\n\n const params = { ...(column?.cellRendererParams ?? {}), ...this.cellParams(node, column) };\n\n this.rendererParamsCache.set(key, { states: node.cellStates, data: node.data, params });\n\n return params;\n }\n\n /**\n * `aria-rowindex` is 1-based over the whole grid, not over what is rendered.\n *\n * That is the point of it: the body virtualises, so the DOM holds a sliding\n * window of rows and the index is how a screen reader knows where the window\n * sits. Row 1 is the header, then any pinned-top rows, then the data.\n */\n protected dataRowAriaIndex(node: OneRowNode<T>): number {\n\n return 2 + this.pinnedTopNodes.length + node.rowIndex;\n }\n\n /** Pinned rows bracket the data: top ones follow the header, bottom ones end the grid. */\n protected pinnedRowAriaIndex(node: OneRowNode<T>, side: 'top' | 'bottom'): number {\n\n const index = (side === 'top' ? this.pinnedTopNodes : this.pinnedBottomNodes).indexOf(node);\n\n return side === 'top'\n ? 2 + index\n : 2 + this.pinnedTopNodes.length + this.nodes.length + index;\n }\n\n /**\n * Whether rows can be selected at all.\n *\n * `aria-selected=\"false\"` on every row of a grid nobody can select announces\n * a selection affordance that does not exist, so the attribute is omitted\n * rather than set false.\n */\n protected get rowSelectionEnabled(): boolean {\n\n return !!this.api?.rowSelection;\n }\n\n // ---------------------------------------------------------------------------\n // Cell navigation\n //\n // The WAI-ARIA grid pattern: the whole grid is one tab stop, and the arrows\n // move a focused cell within it. Before this the only tab stop was the scroll\n // viewport, so a keyboard user could scroll the rows and reach nothing in\n // them — and a screen reader had no cursor to read a cell from.\n //\n // Focus is real DOM focus on a roving tabindex rather than\n // `aria-activedescendant`, because the rows are virtualised: the element a\n // descendant id pointed at would keep being destroyed underneath it.\n // ---------------------------------------------------------------------------\n\n /** The cell holding the grid's tab stop. Null until something is focused. */\n protected activeCell: { rowId: string; field: string } | null = null;\n\n protected isActiveCell(node: OneRowNode<T>, column: OneColumnDef<T>): boolean {\n\n if (this.activeCell) {\n\n return this.activeCell.rowId === node.rowId && this.activeCell.field === column.field;\n }\n\n // Nothing focused yet, so the first cell holds the tab stop. Without this\n // fallback a grid nobody has clicked has *no* tabbable cell, and a keyboard\n // user cannot get into it at all — the roving tabindex has to start\n // somewhere.\n return node === this.nodes[0] && column === this.navigableColumns()[0];\n }\n\n /**\n * Adopt whatever the user focused, however they got there — click, tab, or\n * the arrow keys below. Keeping this in one place is what stops the roving\n * tabindex drifting away from the element that actually has focus.\n */\n protected onCellFocus(node: OneRowNode<T>, column: OneColumnDef<T>): void {\n\n if (this.isActiveCell(node, column)) return;\n\n this.activeCell = { rowId: node.rowId, field: column.field as string };\n\n this.cdr.markForCheck();\n }\n\n protected onGridKeydown(event: KeyboardEvent): void {\n\n // Undo/redo of committed edits, anywhere in the grid except inside an\n // open editor — a text input's Ctrl+Z is the browser's, and it operates\n // on the uncommitted text.\n if ((event.ctrlKey || event.metaKey) && ['z', 'y'].includes(event.key.toLowerCase())) {\n\n const tag = (event.target as HTMLElement)?.tagName?.toLowerCase();\n\n if (tag === 'input' || tag === 'select' || tag === 'textarea') return;\n\n event.preventDefault();\n\n const redo = event.key.toLowerCase() === 'y' || event.shiftKey;\n const applied = redo ? this.api.redoCellEditing() : this.api.undoCellEditing();\n\n if (applied) this.cdr.markForCheck();\n\n return;\n }\n\n const columns = this.navigableColumns();\n\n if (!this.nodes.length || !columns.length) return;\n\n // Navigate only when a cell itself holds focus. Anything focusable *inside*\n // a cell owns its own keys — a text editor's caret, the row drag handle's\n // reorder keys, the option menu's arrows — and all of them bubble to here.\n // Checking the target rather than blocklisting tag names is what keeps this\n // correct as more controls are added to cells.\n const target = event.target as HTMLElement | null;\n\n if (!target?.matches?.('[role=\"gridcell\"]')) return;\n\n const current = this.activeCellPosition(columns);\n\n let row = current.row;\n let col = current.col;\n\n switch (event.key) {\n\n case 'ArrowDown': row += 1; break;\n case 'ArrowUp': row -= 1; break;\n case 'ArrowRight': col += 1; break;\n case 'ArrowLeft': col -= 1; break;\n\n // Selection. Space is the grid pattern's toggle, and it has to be caught\n // here or the browser scrolls the page with it.\n case ' ': {\n const node = this.nodes[current.row];\n if (node) {\n event.preventDefault();\n this.toggleRowSelection(node);\n }\n return;\n }\n\n case 'a':\n case 'A':\n if (!event.ctrlKey && !event.metaKey) return;\n event.preventDefault();\n this.api.selectAll();\n this.cdr.markForCheck();\n return;\n\n case 'Home':\n col = 0;\n if (event.ctrlKey || event.metaKey) row = 0;\n break;\n\n case 'End':\n col = columns.length - 1;\n if (event.ctrlKey || event.metaKey) row = this.nodes.length - 1;\n break;\n\n // A page is what the viewport can show, which is the only definition that\n // matches what the user sees move.\n case 'PageDown': row += this.rowsPerPage(); break;\n case 'PageUp': row -= this.rowsPerPage(); break;\n\n case 'Enter':\n case 'F2': {\n const node = this.nodes[current.row];\n const column = columns[current.col];\n if (node && column) {\n event.preventDefault();\n this.startEdit({ target: event.target } as unknown as MouseEvent, node, column);\n }\n return;\n }\n\n default: return;\n }\n\n event.preventDefault();\n\n const targetRow = Math.min(Math.max(row, 0), this.nodes.length - 1);\n\n this.focusCell(targetRow, Math.min(Math.max(col, 0), columns.length - 1));\n\n // Shift with a vertical move extends the selection, anchored where the\n // extension began — the same gesture a file list uses.\n if (event.shiftKey && targetRow !== current.row) {\n\n this.extendSelectionTo(current.row, targetRow);\n }\n }\n\n /** The row a shift-extended selection is measured from. */\n private selectionAnchorRowId: string | null = null;\n\n private toggleRowSelection(node: OneRowNode<T>): void {\n\n if (!this.api.toggleRowSelection(node.rowId, !node.selected)) return;\n\n // Where a subsequent shift-extension counts from.\n this.selectionAnchorRowId = node.rowId;\n\n this.cdr.markForCheck();\n }\n\n private extendSelectionTo(fromRow: number, toRow: number): void {\n\n const target = this.nodes[toRow];\n\n if (!target) return;\n\n // With nothing selected yet the row the extension started on becomes the\n // anchor, so shift+arrow selects both ends rather than only the far one.\n const anchor = this.selectionAnchorRowId ?? this.nodes[fromRow]?.rowId;\n\n if (!anchor) return;\n\n this.selectionAnchorRowId = anchor;\n\n this.api.selectRowRange(anchor, target.rowId);\n\n this.cdr.markForCheck();\n }\n\n /**\n * Columns a cell cursor can land on.\n *\n * A column with no field renders no cell state and is keyed by field, so it\n * cannot be addressed — an action-only column is a legitimate example.\n */\n private navigableColumns(): OneColumnDef<T>[] {\n\n return this.columnDefs.filter(column => !!column?.field);\n }\n\n private activeCellPosition(columns: OneColumnDef<T>[]): { row: number; col: number } {\n\n if (!this.activeCell) return { row: 0, col: 0 };\n\n const row = this.nodes.findIndex(node => node.rowId === this.activeCell!.rowId);\n const col = columns.findIndex(column => column.field === this.activeCell!.field);\n\n return { row: row < 0 ? 0 : row, col: col < 0 ? 0 : col };\n }\n\n private rowsPerPage(): number {\n\n const height = this.viewport?.elementRef?.nativeElement?.clientHeight ?? 0;\n\n return Math.max(1, Math.floor(height / this.itemSize));\n }\n\n /**\n * Move the cursor, scrolling the row into view first when it is outside the\n * rendered window.\n *\n * The scroll is the reason focusing is deferred: a virtualised row that is\n * not on screen has no element to focus until the viewport has rendered it.\n */\n private focusCell(rowIndex: number, colIndex: number): void {\n\n const node = this.nodes[rowIndex];\n const column = this.navigableColumns()[colIndex];\n\n if (!node || !column) return;\n\n this.activeCell = { rowId: node.rowId, field: column.field as string };\n\n this.cdr.markForCheck();\n\n const range = this.viewport?.getRenderedRange();\n const rendered = range && rowIndex >= range.start && rowIndex < range.end;\n\n if (rendered) {\n\n setTimeout(() => this.focusCellElement(node, column));\n\n return;\n }\n\n this.viewport?.scrollToIndex(rowIndex);\n\n // Scrolling is not enough: the CDK renders on its own schedule, so the row\n // has no element to focus until it has. Waiting for the rendered range to\n // actually contain the row is the only reliable signal — a fixed delay\n // races the viewport and silently drops focus when it loses.\n this.subscriptions.add(\n this.viewport?.renderedRangeStream\n .pipe(\n filter(next => rowIndex >= next.start && rowIndex < next.end),\n take(1),\n )\n .subscribe(() => setTimeout(() => this.focusCellElement(node, column))),\n );\n }\n\n private focusCellElement(node: OneRowNode<T>, column: OneColumnDef<T>): void {\n\n const key = getCellKey(node.rowId, column.field as string);\n\n this.bodyRef?.nativeElement?.querySelector<HTMLElement>(`[data-cell-id=\"${key}\"]`)?.focus();\n }\n\n /** Is this the row currently being moved? */\n protected isRowDragging(node: OneRowNode<T>): boolean {\n\n return this.dragState?.rowId === node.rowId;\n }\n\n /**\n * Where to paint the drop indicator, in pixels from the top of the body.\n *\n * `insertAt` is a boundary, so the line sits at row-height times the number\n * of rows above it — in content space. The indicator is a sibling of the\n * viewport rather than a child, because anything inside it either scrolls\n * away with the transformed content wrapper or ignores the scroll entirely,\n * so the viewport's own scroll offset and its position within the body are\n * both subtracted back out here.\n *\n * A field rather than a getter: it is read from the template on every change\n * detection pass, and it only actually moves when the drag state or the\n * scroll position does.\n */\n protected dropIndicatorTop: number | null = null;\n\n /**\n * How wide the line is drawn. Rows are `width: fit-content`, so they are\n * often narrower than the viewport — a full-bleed line would hang past the\n * last column into empty space and read as part of the frame rather than the\n * rows. This is the visible extent of the row content, which also shrinks\n * correctly as the grid is scrolled sideways.\n */\n protected dropIndicatorWidth = 0;\n\n private updateDropIndicator(): void {\n\n const state = this.dragState;\n const element = this.viewport?.elementRef?.nativeElement;\n\n if (state?.source !== 'pointer' || !element) {\n\n this.dropIndicatorTop = null;\n\n return;\n }\n\n this.dropIndicatorTop = (state.insertAt * this.itemSize) - element.scrollTop + element.offsetTop;\n\n this.dropIndicatorWidth = Math.max(Math.min(this.rowWidth - element.scrollLeft, element.clientWidth), 0);\n }\n\n protected onRowDragEnd(event: OneRowDragEvent<T>): void {\n\n this.rowDragEnd.emit(event);\n }\n\n private refreshRowDragSuppressed(): void {\n\n const reason = this.api?.getRowDragSuppressedReason?.() ?? null;\n\n if (reason === this.rowDragSuppressed) return;\n\n this.rowDragSuppressed = reason;\n\n this.cdr.markForCheck();\n }\n\n ngOnDestroy(): void {\n\n this.flexResizeObserver?.disconnect();\n\n this.subscriptions.unsubscribe();\n }\n}\n","<div #bodyRef class=\"one-grid-body\" role=\"presentation\">\n\n <!-- Pinned rows live outside the scroll viewport so they never scroll\n vertically, and mirror its scrollLeft so the columns stay aligned. -->\n @if (pinnedTopNodes.length) {\n <div #pinnedViewport class=\"one-pinned-rows one-pinned-rows-top\" role=\"rowgroup\">\n <ng-container [ngTemplateOutlet]=\"pinnedRows\" [ngTemplateOutletContext]=\"{ nodes: pinnedTopNodes, side: 'top' }\"></ng-container>\n </div>\n }\n\n <!-- tabindex makes the scroll container reachable, so a keyboard user can\n scroll the rows with the arrow keys, Page Up/Down and Home/End. Without\n it the body is scrollable by pointer only (WCAG 2.1.1). -->\n <cdk-virtual-scroll-viewport\n class=\"one-grid-body-viewport\"\n role=\"rowgroup\"\n [attr.tabindex]=\"nodes?.length ? null : 0\"\n (keydown)=\"onGridKeydown($event)\"\n [itemSize]=\"itemSize\"\n [minBufferPx]=\"minBufferPx\"\n [maxBufferPx]=\"maxBufferPx\"\n (scroll)=\"onBodyScroll($event)\">\n\n <ng-container *cdkVirtualFor=\"let node of nodes; trackBy: trackByRowId;\">\n \n <div class=\"one-row\"\n role=\"row\"\n [attr.aria-rowindex]=\"dataRowAriaIndex(node)\"\n [attr.aria-selected]=\"rowSelectionEnabled ? node.selected : null\"\n [attr.data-row-id]=\"node.rowId\"\n [class.one-row-selected]=\"node.selected\"\n [class.one-row-dragging]=\"isRowDragging(node)\">\n @for (col of columnDefs; track col.field;) {\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{ node, rowIndex: node.rowIndex, column: col, colIndex: $index }\"></ng-container>\n }\n </div>\n\n <!-- Custom Detail Component -->\n @if(node.leaf && node.detailActive && node?.detailRendererComponent) {\n <ng-container\n oneCellRendererComponent\n [cellRendererComponent]=\"node?.detailRendererComponent\"\n [params]=\"{ data: node.data, rowIndex: node.rowIndex, node: node, context: context }\">\n </ng-container>\n }\n\n <!-- Master Detail Grid (template provided by the parent one-grid to avoid a compile-time import cycle) -->\n @if (masterDetail && node.expanded && node?.detailRowData) {\n <div class=\"one-row-detail-container\" [attr.data-row-id]=\"node.rowId + '-detail'\">\n <ng-container\n [ngTemplateOutlet]=\"detailGridTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: node, node: node }\">\n </ng-container>\n </div>\n }\n </ng-container>\n @if (!nodes?.length) {\n <div style=\"width: max-content; border-top: 1px solid transparent;\">\n <div [style.width.px]=\"rowWidth\"></div>\n </div>\n }\n </cdk-virtual-scroll-viewport>\n\n <!-- Drop indicator.\n A line at the insertion point rather than a gap opened between rows:\n the viewport is virtualised at a fixed itemSize, so shifting rows apart\n would desynchronise the scroller from its own geometry. It is also the\n clearer signal — the row lands exactly where the line is.\n Positioned against the body, with the viewport's scroll subtracted, so\n it stays put while the content moves under it during auto-scroll. -->\n @if (dropIndicatorTop !== null) {\n <div class=\"one-row-drop-indicator\" aria-hidden=\"true\"\n [style.top.px]=\"dropIndicatorTop\"\n [style.width.px]=\"dropIndicatorWidth\"></div>\n }\n\n <!-- Keyboard reordering has no drag image to watch, so it narrates instead.\n Assertive because the message is the only feedback that the row moved. -->\n <div class=\"one-grid-visually-hidden\" role=\"status\" aria-live=\"assertive\" aria-atomic=\"true\">{{ dragAnnouncement }}</div>\n @if (!nodes?.length) {\n <span class=\"one-grid-empty-message\" style=\"position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);\">No Rows to Show</span>\n }\n\n @if (pinnedBottomNodes.length) {\n <div #pinnedViewport class=\"one-pinned-rows one-pinned-rows-bottom\" role=\"rowgroup\">\n <ng-container [ngTemplateOutlet]=\"pinnedRows\" [ngTemplateOutletContext]=\"{ nodes: pinnedBottomNodes, side: 'bottom' }\"></ng-container>\n </div>\n }\n</div>\n\n<!-- Pinned rows are display-only: they render exactly what a data cell renders,\n but carry none of its interactions. A totals row should not open an editor\n on double-click or start a range selection on drag. -->\n<ng-template #pinnedRows let-nodes=\"nodes\" let-side=\"side\">\n @for (node of nodes; track node.rowId) {\n <div class=\"one-row one-row-pinned\"\n role=\"row\"\n [attr.aria-rowindex]=\"pinnedRowAriaIndex(node, side)\"\n [attr.data-row-id]=\"node.rowId\">\n @for (column of columnDefs; track column.field) {\n <div\n class=\"one-column\"\n role=\"gridcell\"\n [attr.aria-colindex]=\"$index + 1\"\n [attr.data-cell-id]=\"node.rowId | cellKey:column.field\"\n [class.one-column-pinned-left]=\"column.pinned === 'left'\"\n [class.one-column-pinned-right]=\"column.pinned === 'right'\"\n [class.one-column-pinned-edge]=\"column._pinnedEdge\"\n [style.left.px]=\"column.pinned === 'left' ? column._pinnedOffset : null\"\n [style.right.px]=\"column.pinned === 'right' ? column._pinnedOffset : null\"\n [style.width.px]=\"column?.width\"\n [style.min-width.px]=\"column?.minWidth\"\n [style.max-width.px]=\"column?.maxWidth\">\n\n @if (column?.cellRendererComponent) {\n <ng-container\n oneCellRendererComponent\n [cellRendererComponent]=\"column?.cellRendererComponent\"\n [params]=\"rendererParams(node, column)\">\n </ng-container>\n }\n @else if (column?.cellRenderer) {\n <div\n [ngStyle]=\"{ width: column.width + 'px', position: 'relative' }\"\n [innerHTML]=\"node.cellStates | cellStateRenderer:column.field\">\n </div>\n }\n @else {\n <div class=\"one-cell\"\n [class.align-content-left]=\"column?.alignContent === 'left'\"\n [class.align-content-center]=\"column?.alignContent === 'center'\"\n [class.align-content-right]=\"column?.alignContent === 'right'\"\n [ngClass]=\"colService.resolveCellClass(column, cellParams(node, column))\"\n [ngStyle]=\"colService.resolveCellStyle(column, cellParams(node, column))\">\n <div class=\"one-cell-text\">{{ (node.cellStates | cellStateRenderer:column.field) }}</div>\n </div>\n }\n </div>\n }\n </div>\n }\n</ng-template>\n\n<!-- Master Column Template -->\n<ng-template #cellTemplate let-node=\"node\" let-rowIndex=\"rowIndex\" let-column=\"column\" let-colIndex=\"colIndex\">\n <div\n class=\"one-column\"\n role=\"gridcell\"\n [attr.aria-colindex]=\"colIndex + 1\"\n [attr.tabindex]=\"isActiveCell(node, column) ? 0 : -1\"\n [class.one-cell-active]=\"isActiveCell(node, column)\"\n (focus)=\"onCellFocus(node, column)\"\n [attr.data-cell-id]=\"node.rowId | cellKey:column.field\"\n [class.one-column-pinned-left]=\"column.pinned === 'left'\"\n [class.one-column-pinned-right]=\"column.pinned === 'right'\"\n [class.one-column-pinned-edge]=\"column._pinnedEdge\"\n [style.left.px]=\"column.pinned === 'left' ? column._pinnedOffset : null\"\n [style.right.px]=\"column.pinned === 'right' ? column._pinnedOffset : null\"\n [style.width.px]=\"column?.width\"\n [style.min-width.px]=\"column?.minWidth\"\n [style.max-width.px]=\"column?.maxWidth\"\n [class.one-column-border-top]=\"masterDetail && nodes?.length > 0 && nodes[node.rowIndex - 1]?.expanded\"\n [class.one-cell-selected]=\"selectedCells | cellSelected:node.rowId:column.field\"\n [class.one-cell-invalid]=\"node.cellStates | cellInvalid:node.data[column.field]:column:node:allowedEdit:submitted\"\n (dblclick)=\"startEdit($event, node, column)\"\n (mousedown)=\"startSelection(node.rowId, column.field)\"\n (mouseenter)=\"extendSelection(node.rowId, column.field)\"\n (mouseup)=\"endSelection()\">\n\n <!-- One Grid Cell Option -->\n @if (node.cellOptions[column.field]) {\n <one-grid-cell-option-menu\n #contextOptionMenuRef\n [node]=\"node\"\n [column]=\"column\"\n [options]=\"column.cellOptionMenu\"\n (cellOptionMenuSelect)=\"cellOptionMenuSelected($event)\"\n (cellOptionMenuClose)=\"cellOptionMenuClosed()\"/>\n }\n\n <!-- Grid Cell Template -->\n @if(column?.cellRendererComponent) {\n <ng-container\n oneCellRendererComponent\n [cellRendererComponent]=\"column?.cellRendererComponent\"\n [params]=\"rendererParams(node, column)\">\n </ng-container>\n }\n @else if (node.editing[column.field]) {\n @if (column?.cellRendererParams?.inputType === 'select') {\n <!-- Cell Editing Select. Commits on change — picking an option\n is the whole edit — with blur as the keyboard fallback. -->\n <select class=\"one-cell-input\"\n name=\"{{ node.rowId + '' + column.field }}\"\n (change)=\"stopEditSelect(node, column, $event)\"\n (blur)=\"stopEditSelect(node, column, $event)\"\n (keydown.esc)=\"cancelEdit(node, column)\">\n @for (option of column?.cellRendererParams?.selectOptions ?? []; track $index) {\n <option [selected]=\"option.value === node.data[column.field]\">{{ option.label }}</option>\n }\n </select>\n }\n @else {\n <!-- Cell Editing Input -->\n <input class=\"one-cell-input\"\n name=\"{{ node.rowId + '' + column.field }}\"\n oneCellInputValidator\n [validationType]=\"column?.cellRendererParams?.inputType === 'number' ? 'number' : 'none'\"\n [placeholder]=\"column?.cellRendererParams?.placeholder\"\n [type]=\"column?.cellRendererParams?.inputType === 'number' ? 'text' : column?.cellRendererParams?.inputType\"\n [value]=\"node?.data[column?.field]\"\n [maxLength]=\"250\"\n (blur)=\"stopEdit(node, column, $event)\"\n (keydown.enter)=\"stopEdit(node, column, $event)\"\n (keydown.esc)=\"cancelEdit(node, column)\"\n />\n }\n }\n @else if (column?.cellRenderer) {\n <div\n [ngStyle]=\"{ width: column.width + 'px' , position: 'relative' }\"\n [innerHTML]=\"node.cellStates | cellStateRenderer:column.field\"\n [class.editable-active]=\"node.cellStates | cellEditable:column:node:cellService.editableFn:cellService.updatableFn:allowedEdit\">\n </div>\n }\n @else {\n <div class=\"one-cell\"\n [class.align-content-left]=\"column?.alignContent === 'left'\"\n [class.align-content-center]=\"column?.alignContent === 'center'\"\n [class.align-content-right]=\"column?.alignContent === 'right'\"\n [ngClass]=\"colService.resolveCellClass(column, cellParams(node, column))\"\n [ngStyle]=\"colService.resolveCellStyle(column, cellParams(node, column))\"\n [style.padding-left.px]=\"column.autoGroupField && node.level | cellLevelPadding:24\"\n [class.one-cell-allowed-edit-active]=\"node.cellStates | cellEditable:column:node:cellService.editableFn:cellService.updatableFn:allowedEdit\">\n\n <!-- Row Drag Handle -->\n @if (cellService.rowDragFn(column, node)) {\n <one-grid-row-drag-handle\n [node]=\"node\"\n [suppressedReason]=\"rowDragSuppressed\"\n (dragEnd)=\"onRowDragEnd($event)\"\n />\n }\n\n <!-- Cell Checkbox Selection -->\n @if (column?.checkboxSelection) {\n <one-grid-checkbox\n [node]=\"node\"\n [allowedEdit]=\"allowedEdit\"\n [api]=\"api\"\n (onRowSelection)=\"invokeRowActionSelection($event)\"\n />\n }\n\n <!-- Expand & Collapse Icon -->\n @if (((node?.group || detailRendererComponent) && column?.autoGroupField) || (masterDetail && node?.expandable && gridType === 'master' && column?.masterGroupField)) {\n <one-grid-cell-group-renderer\n [node]=\"node\"\n [masterDetail]=\"masterDetail\"\n [detailCellRendererParams]=\"detailCellRendererParams\"\n [detailRendererComponent]=\"detailRendererComponent\"\n (expansionChanged)=\"invokeExpansionChangedClick($event)\"\n />\n }\n\n @if(column?.cellRendererComponent) {\n <ng-container\n oneCellRendererComponent\n [cellRendererComponent]=\"column?.cellRendererComponent\"\n [params]=\"rendererParams(node, column)\">\n </ng-container>\n }\n @else {\n <!-- Cell Value OR Placeholder -->\n <div oneCellTextExpand class=\"one-cell-text\" [class.one-cell-placeholder]=\"node.cellStates[column.field]?.type === 'placeholder'\">\n {{ (node.cellStates | cellStateRenderer:column.field) }}\n </div>\n }\n\n <!-- Cell Action Buttons -->\n @if (column.cellRendererParams | cellActionButtonEnable) {\n <one-grid-row-action\n [ngStyle]=\"{ marginLeft: 'auto' }\"\n [column]=\"column\"\n [node]=\"node\"\n [allowedEdit]=\"allowedEdit\"\n [masterNode]=\"masterNode\"\n [masterDetail]=\"masterDetail\"\n [gridType]=\"gridType\"\n [context]=\"context\"\n [cellRendererParams]=\"column?.cellRendererParams\"\n (onRowGotoDetail)=\"invokeRowActionGotoDetail($event)\"\n (onRowAddNew)=\"invokeRowActionAddNew($event)\"\n (onRowView)=\"invokeRowActionView($event)\"\n (onRowLocation)=\"invokeRowActionLocation($event)\"\n (onRowDocument)=\"invokeRowActionDocument($event)\"\n (onRowCopy)=\"invokeRowActionCopy($event)\"\n (onRowDelete)=\"invokeRowActionDelete($event)\"\n (onRowGotoList)=\"invokeRowActionGotoList($event)\"\n (onRowEdit)=\"invokeRowActionEdit($event)\"\n (onRowPrint)=\"invokeRowActionPrint($event)\"\n (onRowHistory)=\"invokeRowActionHistory($event)\"\n (onRowOption)=\"invokeRowActionOption($event)\"\n (onRowLanguage)=\"invokeRowActionLanguage($event)\"\n (onRowCellOption)=\"invokeRowActionCellOption($event)\"\n />\n }\n </div>\n }\n </div>\n</ng-template>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { OnePaginationParams } from '../../core/models/one-pagination-types.model';\nimport { OnePageSizeOption } from '../../core/models/constants/one-pagination.constant';\nimport { LucideAngularModule } from 'lucide-angular';\nimport { ONE_GRID_ICON_PROVIDERS } from '../../core/icons/one-grid-icons';\n\n@Component({\n standalone: true,\n imports: [LucideAngularModule],\n selector: 'one-grid-pagination',\n providers: [ONE_GRID_ICON_PROVIDERS],\n templateUrl: './one-grid-pagination.component.html',\n styleUrl: './one-grid-pagination.component.scss'\n})\nexport class OneGridPaginationComponent {\n\n @Input() paginate: OnePaginationParams = {\n total: 0,\n currentPage: 1,\n lastPage: 1,\n perPage: 25,\n firstRowIndex: 1,\n lastRowIndex: 1,\n };\n\n @Output() goToFirst = new EventEmitter();\n @Output() goToPrevious = new EventEmitter();\n @Output() goToNext = new EventEmitter();\n @Output() goToLast = new EventEmitter();\n @Output() pageSizeChange = new EventEmitter();\n\n /**\n * The page size the bar shows.\n *\n * Derived from the input rather than held locally. The bar is a display of\n * the host's paging state — it does not own it — and a local copy meant a\n * host that supplied `perPage: 50` still saw \"25 rows\" selected.\n */\n public get pageSize(): number {\n\n return this.paginate?.perPage ?? OnePageSizeOption[0];\n }\n\n /**\n * The size options offered.\n *\n * Also derived. These used to be copied out of the input in\n * `ngAfterViewInit` — after the view had already been checked with the\n * defaults — so any grid supplying its own options threw `NG0100` in dev\n * mode, and later changes to the list were ignored entirely.\n */\n public get pageSizeOptions(): number[] {\n\n return this.paginate?.pageSizeOptions?.length ? this.paginate.pageSizeOptions : OnePageSizeOption;\n }\n\n /** Whether there is a page before the current one. */\n public get hasPrevious(): boolean {\n\n return this.pageCount > 1 && (this.paginate?.currentPage ?? 1) > 1;\n }\n\n /** Whether there is a page after the current one. */\n public get hasNext(): boolean {\n\n return this.pageCount > 1 && (this.paginate?.currentPage ?? 1) < (this.paginate?.lastPage ?? 1);\n }\n\n private get pageCount(): number {\n\n return this.paginate?.lastPage ?? 1;\n }\n\n goToFirstPage() {\n\n if (!this.hasPrevious) return;\n\n this.goToFirst.emit(this.paginate?.currentPage);\n }\n\n goToPreviousPage() {\n\n if (!this.hasPrevious) return;\n\n this.goToPrevious.emit(this.paginate?.currentPage);\n }\n\n goToNextPage() {\n\n if (!this.hasNext) return;\n\n this.goToNext.emit(this.paginate?.currentPage);\n }\n\n goToLastPage() {\n\n if (!this.hasNext) return;\n\n this.goToLast.emit(this.paginate?.currentPage);\n }\n\n onPageSizeChange(event: Event) {\n\n const select = event.target as HTMLSelectElement;\n\n const newSize = Number(select.value);\n\n if (newSize !== this.pageSize) {\n\n this.pageSizeChange.emit(newSize);\n }\n }\n}\n","<!-- A navigation landmark, so the bar is reachable as one thing rather than as\n four unlabelled icon buttons floating under the grid. -->\n<div class=\"one-grid-pagination\" role=\"navigation\" aria-label=\"Pagination\">\n <div class=\"one-pagination-row\">\n @if (paginate?.firstRowIndex > 0 && paginate?.lastRowIndex > 0 && paginate?.total > 0) {\n <div class=\"one-pagination-columns-group\">\n <div class=\"one-pagination-column\">\n <span>{{ paginate?.firstRowIndex }}</span>\n <span>-</span>\n <span>{{ paginate?.lastRowIndex }}</span>\n <span>/</span> \n <span>{{ paginate?.total }}</span>\n </div>\n </div>\n }\n <div class=\"one-pagination-columns-group\">\n <div class=\"one-pagination-column\">\n <!-- `type=\"button\"` so the bar cannot submit a surrounding form,\n a real `disabled` rather than a class that only stops the\n mouse, and a name on every icon-only control. -->\n <button\n type=\"button\"\n class=\"one-pagination-btn\"\n aria-label=\"First page\"\n title=\"First page\"\n [disabled]=\"!hasPrevious\"\n [class.disabled]=\"!hasPrevious\"\n (click)=\"goToFirstPage()\">\n <lucide-icon name=\"chevron-first\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n </button>\n <button\n type=\"button\"\n class=\"one-pagination-btn\"\n aria-label=\"Previous page\"\n title=\"Previous page\"\n [disabled]=\"!hasPrevious\"\n [class.disabled]=\"!hasPrevious\"\n (click)=\"goToPreviousPage()\">\n <lucide-icon name=\"chevron-left\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n </button>\n </div>\n <!-- Announced as a live region: the numbers are the only feedback a\n screen reader gets that the page actually changed. -->\n <div class=\"one-pagination-column\" role=\"status\" aria-live=\"polite\">\n <span class=\"one-grid-visually-hidden\">Page </span>{{ paginate?.currentPage }}<span>/</span>{{ paginate?.lastPage }} \n </div>\n <div class=\"one-pagination-column\">\n <button\n type=\"button\"\n class=\"one-pagination-btn\"\n aria-label=\"Next page\"\n title=\"Next page\"\n [disabled]=\"!hasNext\"\n [class.disabled]=\"!hasNext\"\n (click)=\"goToNextPage()\">\n <lucide-icon name=\"chevron-right\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n </button>\n <button\n type=\"button\"\n class=\"one-pagination-btn\"\n aria-label=\"Last page\"\n title=\"Last page\"\n [disabled]=\"!hasNext\"\n [class.disabled]=\"!hasNext\"\n (click)=\"goToLastPage()\">\n <lucide-icon name=\"chevron-last\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n </button>\n </div>\n <div class=\"one-pagination-columns-group\">\n <div class=\"one-pagination-column\">\n <!-- `[selected]` per option, not `[value]` on the select:\n with options rendered by `@for`, the select's value is\n set before they exist and does not stick. -->\n <select name=\"row-per-page\" aria-label=\"Rows per page\" (change)=\"onPageSizeChange($event)\">\n @for (size of pageSizeOptions; track size) {\n <option [value]=\"size\" [selected]=\"size === pageSize\">{{ size }} rows</option>\n }\n </select>\n </div>\n </div>\n </div>\n </div>\n</div>\n","import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, Type, ViewChild } from '@angular/core';\nimport { OneColumnDef, OneGroupColumnDef } from '../../core/models/one-column-def-types.model';\nimport { OneGridApi } from '../../core/instants/one-grid-api.class';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridReadyEvent, OneGridRowActionEvent, OneGridType } from '../../core/models/one-grid-types.model';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport { OnePaginationParams } from '../../core/models/one-pagination-types.model';\nimport { OneGridSelectionService } from '../../core/services/one-grid-selection.service';\nimport { CellOptionMenuSelectedEvent, CellValueChangedEvent, ColumnMovedEvent, ColumnResizedEvent, ExpansionChangedEvent, RowSelectionMode, SelectionChangedEvent, SortChangedEvent } from '../../core/models/one-event-types.model';\nimport { Subject, Subscription } from 'rxjs';\nimport { OneGridExpansionService } from '../../core/services/one-grid-expansion.service';\nimport { OneDetailCellRendererParams } from '../../core/models/one-master-detail.model';\nimport { OneGridRowService } from '../../core/services/one-grid-row.service';\nimport { OneGridCellService } from '../../core/services/one-grid-cell.service';\nimport { OgColumnService } from '../../core/services/og-column.service';\nimport _ from 'lodash';\nimport { OneCellRendererComponent } from '../../core/models/one-tree-data.model';\nimport { OneGridRowDragService } from '../../core/services/one-grid-row-drag.service';\nimport { OneRowDragEvent } from '../../core/models/one-row-drag.model';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { aggColumns, ONE_GROUP_CHILDREN_FIELD, ONE_GROUP_VALUE_FIELD, rowGroupFields } from '../../helpers/one-row-grouping.helper';\nimport { OneGridHeaderComponent } from '../one-grid-header/one-grid-header.component';\nimport { OneGridBodyComponent } from '../one-grid-body/one-grid-body.component';\nimport { OneGridPaginationComponent } from '../one-grid-pagination/one-grid-pagination.component';\n\n@Component({\n standalone: true,\n imports: [\n NgTemplateOutlet,\n OneGridHeaderComponent,\n OneGridBodyComponent,\n OneGridPaginationComponent,\n ],\n selector: 'one-grid',\n templateUrl: './one-grid.component.html',\n styleUrl: './one-grid.component.scss',\n providers: [\n OneGridEventService,\n OneGridApi,\n OgColumnService,\n OneGridSelectionService,\n OneGridExpansionService,\n OneGridRowService,\n OneGridCellService,\n OneGridRowDragService\n ],\n})\nexport class OneGridComponent<T> implements OnInit, OnChanges, AfterViewInit, OnDestroy {\n\n /**\n * Get General Data from Parent\n */\n @ViewChild('ogRef', { static: true }) ogRef!: ElementRef;\n @Input() rowNumber: boolean = false;\n @Input() allowedEdit: boolean = true;\n @Input() submitted: boolean = false;\n @Input() context: any = null;\n @Input() rowData: T[] = [];\n @Input() rowSelection: RowSelectionMode = null;\n\n /**\n * The grid's accessible name.\n *\n * A `role=\"grid\"` with no name is announced as an unlabelled grid, which\n * tells a screen-reader user nothing about what they have landed in. Set it\n * to whatever the grid is showing — \"Employees\", \"Order lines\".\n */\n @Input() gridLabel: string = 'Data grid';\n\n @Input() enableGroupColumnDefs: boolean = false;\n @Input() groupColumnDefs: OneGroupColumnDef[] = [];\n\n @Input() defaultColumnDef: OneColumnDef<T> = {};\n @Input() columnDefs: OneColumnDef<T>[] = [];\n\n /**\n * Rows anchored above the scrolling area — a header summary, or an entry line.\n * They keep column alignment and scroll sideways with the body, but are not\n * data: sorting, filtering, selection and the row count all pass them by.\n */\n @Input() pinnedTopRowData: T[] = [];\n\n /** Rows anchored below the scrolling area, typically a totals row. */\n @Input() pinnedBottomRowData: T[] = [];\n\n // RXJS Properties\n protected gridCopy$ = new Subject<ClipboardEvent>();\n\n /**\n * Master Detail Feature\n */\n @Input() gridType: OneGridType = 'master';\n @Input() masterDetail: boolean = false;\n @Input() masterNode: OneRowNode = null;\n @Input() detailCellRendererParams: OneDetailCellRendererParams;\n @Input() detailRendererComponent: Type<OneCellRendererComponent>;\n\n /**\n * Tree Data Feature\n */\n @Input() treeData: boolean = false;\n @Input() treeDataChildrenField: string = null;\n @Input() autoGroupColumnDef: OneColumnDef;\n @Input() groupDefaultExpanded: number = 0;\n\n /**\n * Bind Row Action Events & Data to Parent\n */\n /**\n * A row finished moving. Fires once per completed reorder — not while the\n * pointer is in flight — and only when the position actually changed.\n */\n @Output() rowDragEnd = new EventEmitter<OneRowDragEvent<T>>();\n\n /**\n * The header's ⋮ button was pressed for this column.\n *\n * The grid has no column menu of its own — this reports the intent so the\n * host can show whatever a column menu means in its app. Set\n * `columnDef.suppressHeaderMenuButton` to hide the button entirely.\n */\n @Output() headerMenuClick = new EventEmitter<OneColumnDef<T>>();\n\n /**\n * Render the grid's own column menu behind the header ⋮ button: sort, pin,\n * hide. Opt-in — a host that built its menu on `(headerMenuClick)` keeps\n * exactly what it had, and the intent still emits either way.\n */\n @Input() headerMenu: boolean = false;\n\n /**\n * Render a filter input under every column whose `filterable` resolves\n * true. The inputs feed `api.setFilterModel` with contains-conditions,\n * debounced; filters on fields without an input are left untouched.\n */\n @Input() filterRow: boolean = false;\n\n /**\n * Record committed cell edits so `api.undoCellEditing` /\n * `api.redoCellEditing` (and Ctrl+Z / Ctrl+Y in the grid) can walk them.\n * Programmatic `setDataValue` writes are not recorded.\n */\n @Input() undoRedoCellEditing: boolean = false;\n\n /** How many edits the undo stack keeps. */\n @Input() undoRedoCellEditingLimit: number = 10;\n\n /**\n * `'fullRow'` opens every editable cell of the row on a double-click and\n * commits them together — Enter anywhere in the row, or focus leaving the\n * row. Escape closes the whole row without committing. Default: cells edit\n * one at a time.\n */\n @Input() editType: 'fullRow' | null = null;\n\n @Output() onGridReady = new EventEmitter<OneGridReadyEvent<T>>();\n @Output() onRowGotoDetail = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowAddNew = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowView = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLocation = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDocument = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowCopy = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDelete = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowGotoList = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowEdit = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowPrint = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowHistory = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowOption = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLanguage = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowSelection = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onShiftDoubleClick = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() rowCountChanged = new EventEmitter<number>();\n\n @Output() selectionChanged = new EventEmitter<SelectionChangedEvent<T>>();\n @Output() expansionChanged = new EventEmitter<ExpansionChangedEvent<T>>();\n\n /**\n * The sort model changed — a header click or `api.onSortChanged`. Carries\n * the re-sorted nodes and the model that produced them; `api.sortModel`\n * stays readable between emissions.\n */\n @Output() sortChanged = new EventEmitter<SortChangedEvent<T>>();\n\n /**\n * An inline edit was committed with a value different from the one it\n * started with. Programmatic `node.setDataValue` does not emit here — the\n * caller already holds both values.\n */\n @Output() cellValueChanged = new EventEmitter<CellValueChangedEvent<T>>();\n\n /** A header drag finished somewhere other than where it started. */\n @Output() columnMoved = new EventEmitter<ColumnMovedEvent>();\n\n /** A resize gesture finished — one event per gesture, not per pixel. */\n @Output() columnResized = new EventEmitter<ColumnResizedEvent>();\n\n // For context menu option\n @Output() cellOptionSelect = new EventEmitter<CellOptionMenuSelectedEvent>();\n @Output() onRowCellOption = new EventEmitter<OneGridRowActionEvent<T>>();\n\n /**\n * Bind One Grid Pagination Feature\n */\n @Input() pagination: boolean = false;\n @Input() paginate: OnePaginationParams;\n\n /**\n * Let the grid page its own rows. The bar renders, the grid slices the\n * filtered rows to the current page, and the navigation buttons work\n * without the host handling anything — `[paginate]` is ignored in this\n * mode (the grid owns those numbers) except for `pageSizeOptions`. The\n * navigation outputs still emit, as notifications rather than intents.\n * Selection, filtering and sorting keep operating on the whole dataset.\n */\n @Input() clientSidePagination: boolean = false;\n\n /** Rows per page for `clientSidePagination`. */\n @Input() pageSize: number = 25;\n\n @Output() goToFirst = new EventEmitter();\n @Output() goToPrevious = new EventEmitter();\n @Output() goToNext = new EventEmitter();\n @Output() goToLast = new EventEmitter();\n @Output() pageSizeChange = new EventEmitter<number>();\n\n /** The paging numbers the bar shows when the grid pages its own rows. */\n protected internalPaginate: OnePaginationParams = {\n total: 0, currentPage: 1, lastPage: 1, perPage: 25, firstRowIndex: 0, lastRowIndex: 0,\n };\n\n /**\n * Recompute the bar's numbers from the filtered row count and the API's\n * paging state. Deferred a tick for the same reason the aria counts are:\n * the count arrives while the first change detection pass is still running.\n */\n private refreshClientPagination(total: number): void {\n\n const { pageSize, currentPage } = this.api.paginationState;\n\n const lastPage = Math.max(Math.ceil(total / pageSize), 1);\n const page = Math.min(currentPage, lastPage);\n\n setTimeout(() => {\n\n this.internalPaginate = {\n total,\n currentPage: page,\n lastPage,\n perPage: pageSize,\n firstRowIndex: total === 0 ? 0 : (page - 1) * pageSize + 1,\n lastRowIndex: Math.min(page * pageSize, total),\n pageSizeOptions: this.paginate?.pageSizeOptions,\n };\n\n this.cdr.markForCheck();\n });\n }\n\n /**\n * One Grid Properties\n */\n protected bodyScrollLeft: number = 0;\n private _oneRowNumberColumnDef: OneColumnDef = null;\n private subscriptions = new Subscription();\n\n constructor(\n protected api: OneGridApi,\n protected eventService: OneGridEventService,\n private elementRef: ElementRef,\n private cdr: ChangeDetectorRef,\n ) { }\n\n ngOnChanges(changes: SimpleChanges): void {\n\n if (changes['masterNode'] && changes['masterNode'].isFirstChange) {\n\n if (this.masterDetail && this.masterNode.expanded && this.gridType === 'detail') {\n\n setTimeout(() => this.api.setRowData([...this.masterNode.detailRowData]));\n }\n }\n\n if (changes[\"rowData\"] && !changes[\"rowData\"]?.firstChange) {\n\n this.treeData || this.masterDetail ? this.api.updateRowData(this.rowData) : this.api.setRowData(this.rowData);\n }\n\n // Only later changes. The first one arrives before ngOnInit has run\n // api.init, so the column definitions are not registered yet and the body\n // has not subscribed — the initial load happens in ngAfterViewInit instead.\n if (changes[\"pinnedTopRowData\"] && !changes[\"pinnedTopRowData\"].firstChange) {\n\n this.api.setPinnedRowData('top', this.pinnedTopRowData);\n }\n\n if (changes[\"pinnedBottomRowData\"] && !changes[\"pinnedBottomRowData\"].firstChange) {\n\n this.api.setPinnedRowData('bottom', this.pinnedBottomRowData);\n }\n }\n\n ngOnInit(): void {\n\n /**\n * Init Row Number Column Def\n */\n if (this.rowNumber) {\n\n this._oneRowNumberColumnDef = {\n groupId: this.columnDefs[0]?.groupId ?? null,\n field: '_oneRowNumber',\n headerName: 'Nº',\n resizable: true,\n headerStyle: {\n textAlign: 'center',\n display: 'flex',\n justifyContent: 'center',\n alignItem: 'center'\n },\n alignContent: 'right',\n cellClass: 'fw-bold',\n width: 60,\n minWidth: 40,\n maxWidth: 200\n }\n }\n\n /**\n * Row grouping: column defs declaring `rowGroup` turn the grid into a\n * tree over synthetic group rows. Configured before `api.init` because\n * everything downstream — the treeData flag the API captures, the group\n * column the tree block below prepends — has to see the tree shape.\n */\n const rowGroupColumnFields = this.treeData || this.masterDetail\n ? []\n : rowGroupFields(this.columnDefs);\n\n if (rowGroupColumnFields.length) {\n\n this.treeData = true;\n this.treeDataChildrenField = ONE_GROUP_CHILDREN_FIELD;\n\n // The group column: host-tuned through autoGroupColumnDef, but its\n // field is always the synthetic label — that is where a group row\n // carries its display value.\n this.autoGroupColumnDef = {\n headerName: 'Group',\n minWidth: 200,\n ...this.autoGroupColumnDef,\n field: ONE_GROUP_VALUE_FIELD,\n // The marker the tree machinery keys on: the expander renders on this\n // column and group rows print their label here.\n autoGroupField: true,\n };\n\n // A grouped-by column's value is on the group row; showing the flat\n // column too repeats it down every leaf. Hidden, not removed — the\n // host can bring it back with api.setColumnVisible.\n this.columnDefs = this.columnDefs.map(column =>\n column.rowGroup ? { ...column, hide: true } : column);\n }\n\n /**\n * Initialize One Grid API\n */\n this.api.init({\n gridType: this.gridType,\n columnDefs: this.columnDefs,\n defaultColumnDef: this.defaultColumnDef,\n groupColumnDefs: this.groupColumnDefs,\n context: this.context,\n rowSelection: this.rowSelection,\n masterDetail: this.masterDetail,\n detailCellRendererParams: this.detailCellRendererParams,\n detailRendererComponent: this.detailRendererComponent,\n treeData: this.treeData,\n });\n\n if (rowGroupColumnFields.length) {\n\n this.api.setRowGrouping(rowGroupColumnFields, aggColumns(this.columnDefs));\n }\n\n if (this.undoRedoCellEditing) {\n\n this.api.enableUndoRedoCellEditing(this.undoRedoCellEditingLimit);\n }\n\n if (this.clientSidePagination) {\n\n this.api.setClientSidePagination(true, this.paginate?.perPage ?? this.pageSize);\n }\n\n /**\n * Setup Master Detail Configuration\n */\n if (this.masterDetail) {\n\n this.api.setGroupDefaultExpanded(this.groupDefaultExpanded);\n this.api.setGetDetailRowData(this.detailCellRendererParams?.getDetailRowData ?? null);\n\n if (this.rowNumber) {\n\n const columnDefs = _.concat(this._oneRowNumberColumnDef, this.columnDefs);\n\n setTimeout(() => this.api.setColumnDefs(columnDefs));\n }\n }\n\n /**\n * Setup Tree Data Configuration\n */\n if (this.treeData) {\n\n this.gridType = 'tree';\n\n const columnDefs = this.rowNumber ? _.concat(this._oneRowNumberColumnDef, this.autoGroupColumnDef, this.columnDefs) : _.concat(this.autoGroupColumnDef, this.columnDefs);\n\n this.api.setTreeDataChildrenField(this.treeDataChildrenField);\n this.api.setGroupDefaultExpanded(this.groupDefaultExpanded);\n\n setTimeout(() => this.api.setColumnDefs(columnDefs));\n }\n\n // Listen Selection Changed Event\n // Columns can be replaced at runtime through `api.setColumnDefs`, and\n // `aria-colcount` has to follow.\n this.subscriptions.add(this.eventService.addEventListener('columnChanged', () => {\n\n this.ariaColCount = this.api?.getColumnState()?.columns?.length ?? -1;\n }));\n\n this.subscriptions.add(this.eventService.addEventListener('selectionChanged', (payload: SelectionChangedEvent<T>) => {\n\n this.selectionChanged.emit(payload);\n }));\n\n // The internal events a host can act on, surfaced as outputs. Same\n // forwarding pattern as selectionChanged above.\n this.subscriptions.add(this.eventService.addEventListener('sortChanged', (payload: SortChangedEvent<T>) => {\n\n this.sortChanged.emit(payload);\n }));\n\n this.subscriptions.add(this.eventService.addEventListener('cellValueChanged', (payload: CellValueChangedEvent<T>) => {\n\n this.cellValueChanged.emit(payload);\n }));\n\n this.subscriptions.add(this.eventService.addEventListener('columnMoved', (payload: ColumnMovedEvent) => {\n\n this.columnMoved.emit(payload);\n }));\n\n this.subscriptions.add(this.eventService.addEventListener('columnResized', (payload: ColumnResizedEvent) => {\n\n this.columnResized.emit(payload);\n }));\n }\n\n ngAfterViewInit(): void {\n\n // The header follows the body through (bodyScroll) -> [scrollLeft]. A second\n // subscription used to live here that queried '.one-grid-header-column' — a\n // header *cell*, not the viewport — and assigned scrollLeft to it, which\n // does nothing. It has been removed rather than repaired: the binding path\n // is the one that works, and it now drives the pinned columns too.\n\n // Pinned rows, now that the columns are registered and the body is\n // listening. Unlike rowData these are not loaded through (onGridReady) —\n // binding them is the whole contract — so the grid loads them itself.\n if (this.pinnedTopRowData?.length) {\n\n this.api.setPinnedRowData('top', this.pinnedTopRowData);\n }\n\n if (this.pinnedBottomRowData?.length) {\n\n this.api.setPinnedRowData('bottom', this.pinnedBottomRowData);\n }\n\n /**\n * Emit Grid Ready Event\n */\n this.onGridReady.emit({ api: this.api });\n }\n\n /**\n * Handle Body Scroll Event\n */\n onBodyScroll(scrollLeft: number) {\n\n this.bodyScrollLeft = scrollLeft;\n }\n\n /**\n * Handle Ready Event of a nested Master Detail Grid\n */\n onDetailGridReady(params: OneGridReadyEvent) {\n\n params.api.setRowData(this.masterNode?.detailRowData ?? []);\n }\n\n /**\n * Passing copy event to grid body\n */\n onGridCopy(event: ClipboardEvent) {\n\n this.gridCopy$.next(event);\n }\n\n /**\n * Bind Row Action Events to Parent Component\n */\n invokeRowActionGotoDetail(event: OneGridRowActionEvent<T>) {\n\n this.onRowGotoDetail.emit(event);\n }\n\n invokeRowActionAddNew(event: OneGridRowActionEvent<T>) {\n\n this.onRowAddNew.emit(event);\n }\n\n invokeRowActionView(event: OneGridRowActionEvent<T>) {\n\n this.onRowView.emit(event);\n }\n\n invokeRowActionLocation(event: OneGridRowActionEvent<T>) {\n\n this.onRowLocation.emit(event);\n }\n\n invokeRowActionDocument(event: OneGridRowActionEvent<T>) {\n\n this.onRowDocument.emit(event);\n }\n\n invokeRowActionCopy(event: OneGridRowActionEvent<T>) {\n\n this.onRowCopy.emit(event);\n }\n\n invokeRowActionDelete(event: OneGridRowActionEvent<T>) {\n\n this.onRowDelete.emit(event);\n }\n\n invokeRowActionGotoList(event: OneGridRowActionEvent<T>) {\n\n this.onRowGotoList.emit(event);\n }\n\n invokeRowActionEdit(event: OneGridRowActionEvent<T>) {\n\n this.onRowEdit.emit(event);\n }\n\n invokeRowActionPrint(event: OneGridRowActionEvent<T>) {\n\n this.onRowPrint.emit(event);\n }\n\n invokeRowActionHistory(event: OneGridRowActionEvent<T>) {\n\n this.onRowHistory.emit(event);\n }\n\n invokeRowActionOption(event: OneGridRowActionEvent<T>) {\n\n this.onRowOption.emit(event);\n }\n\n invokeRowActionLanguage(event: OneGridRowActionEvent<T>) {\n\n this.onRowLanguage.emit(event);\n }\n\n invokeRowActionCellOption(event: OneGridRowActionEvent<T>) {\n\n this.onRowCellOption.emit(event);\n }\n\n invokeRowActionSelection(event: OneGridRowActionEvent<T>) {\n\n this.onRowSelection.emit(event);\n }\n\n invokeShiftDoubleClick(event: OneGridRowActionEvent<T>) {\n\n this.onShiftDoubleClick.emit(event);\n }\n\n /**\n * Totals for `aria-rowcount` / `aria-colcount`.\n *\n * Held as fields rather than computed in the template: they are read on every\n * change detection pass and only actually change when the data or the columns\n * do. `-1` is the ARIA value for \"unknown\", which is the honest answer before\n * the first row arrives.\n */\n protected ariaRowCount = -1;\n protected ariaColCount = -1;\n\n invokeRowCountChanged(length: number) {\n\n this.refreshAriaCounts(length);\n\n if (this.clientSidePagination) this.refreshClientPagination(length);\n\n this.rowCountChanged.emit(length);\n }\n\n /**\n * Recompute the totals a screen reader is told about.\n *\n * `aria-rowcount` counts every row the grid represents, not the handful the\n * virtual scroller currently has in the DOM — the header row, the pinned rows\n * either side, and all the data rows.\n */\n private refreshAriaCounts(dataRows: number): void {\n\n const pinned = (this.pinnedTopRowData?.length ?? 0) + (this.pinnedBottomRowData?.length ?? 0);\n\n const rows = 1 + pinned + dataRows;\n const cols = this.api?.getColumnState()?.columns?.length ?? -1;\n\n if (rows === this.ariaRowCount && cols === this.ariaColCount) return;\n\n // Deferred a tick. The body emits its row count while the first change\n // detection pass is still running, after this component's own attributes\n // were checked — assigning here directly is the textbook NG0100. The body\n // defers its node list for the same reason.\n setTimeout(() => {\n\n this.ariaRowCount = rows;\n this.ariaColCount = cols;\n\n this.cdr.markForCheck();\n });\n }\n\n cellOptionMenuSelected(event: CellOptionMenuSelectedEvent) {\n\n this.cellOptionSelect.emit(event);\n }\n\n /**\n * Bing Pagination Events to Parent Component\n */\n invokeGoToFirst() {\n\n if (this.clientSidePagination) this.api.setCurrentPage(1);\n\n this.goToFirst.emit();\n }\n\n invokeGoToPrevious() {\n\n if (this.clientSidePagination) this.api.setCurrentPage(this.api.paginationState.currentPage - 1);\n\n this.goToPrevious.emit();\n }\n\n invokeGoToNext() {\n\n if (this.clientSidePagination) this.api.setCurrentPage(this.api.paginationState.currentPage + 1);\n\n this.goToNext.emit();\n }\n\n invokeGoToLast() {\n\n if (this.clientSidePagination) this.api.setCurrentPage(this.internalPaginate.lastPage ?? 1);\n\n this.goToLast.emit();\n }\n\n invokePageSizeChange(pageSize: number) {\n\n if (this.clientSidePagination) this.api.setPageSize(pageSize);\n\n this.pageSizeChange.emit(pageSize);\n }\n\n invokeRowDragEnd(event: OneRowDragEvent<T>) {\n\n this.rowDragEnd.emit(event);\n }\n\n invokeExpansionChangedClick(event: ExpansionChangedEvent<T>) {\n\n this.expansionChanged.emit(event);\n }\n\n /**\n * Handle Unsubscribe All Event Listenders\n */\n ngOnDestroy(): void {\n\n this.rowData = [];\n\n this.api.destroy();\n\n this.subscriptions.unsubscribe();\n }\n}\n","<!-- No tabindex here. The tab stop belongs on the body viewport, which is the\n element that actually scrolls; a focusable wrapper around a scrollable\n child is reachable but cannot be scrolled with the keyboard. The copy\n handler is unaffected: a copy event fired at the focused viewport bubbles\n up to here. -->\n<!-- role=\"grid\" is what turns this from a pile of divs into something a screen\n reader can navigate. The counts are the *total* — `aria-rowcount` includes\n the header row and any pinned rows, and both stay correct while the body is\n virtualised and most rows are not in the DOM, which is exactly what these\n attributes exist to communicate. -->\n<div #ogRef\n class=\"one-grid\"\n role=\"grid\"\n [attr.aria-label]=\"gridLabel\"\n [attr.aria-rowcount]=\"ariaRowCount\"\n [attr.aria-colcount]=\"ariaColCount\"\n [attr.aria-multiselectable]=\"rowSelection === 'multiple' ? true : null\"\n (copy)=\"onGridCopy($event)\">\n \n <!-- Headers -->\n <one-grid-header\n [api]=\"api\"\n [enableGroupColumnDefs]=\"enableGroupColumnDefs\"\n [allowedEdit]=\"allowedEdit\"\n [scrollLeft]=\"bodyScrollLeft\"\n [headerMenu]=\"headerMenu\"\n [filterRow]=\"filterRow\"\n (headerMenuClick)=\"headerMenuClick.emit($event)\"\n />\n\n <!-- Body -->\n <one-grid-body\n [gridCopy$]=\"gridCopy$\"\n [rowData]=\"rowData\"\n [pinnedTopRowData]=\"pinnedTopRowData\"\n [pinnedBottomRowData]=\"pinnedBottomRowData\"\n [api]=\"api\"\n [rowNumber]=\"rowNumber\"\n [pagination]=\"pagination\"\n [allowedEdit]=\"allowedEdit\"\n [editType]=\"editType\"\n [submitted]=\"submitted\"\n [context]=\"context\"\n [treeData]=\"treeData\"\n [gridType]=\"gridType\"\n [masterDetail]=\"masterDetail\"\n [masterNode]=\"masterNode\"\n [detailCellRendererParams]=\"detailCellRendererParams\"\n [detailRendererComponent]=\"detailRendererComponent\"\n [detailGridTemplate]=\"detailGridTpl\"\n [treeDataChildrenField]=\"treeDataChildrenField\"\n [autoGroupColumnDef]=\"autoGroupColumnDef\"\n [groupDefaultExpanded]=\"groupDefaultExpanded\"\n (rowDragEnd)=\"invokeRowDragEnd($event)\"\n (expansionChanged)=\"invokeExpansionChangedClick($event)\"\n (onRowGotoDetail)=\"invokeRowActionGotoDetail($event)\"\n (onRowAddNew)=\"invokeRowActionAddNew($event)\"\n (onRowView)=\"invokeRowActionView($event)\"\n (onRowLocation)=\"invokeRowActionLocation($event)\"\n (onRowDocument)=\"invokeRowActionDocument($event)\"\n (onRowCopy)=\"invokeRowActionCopy($event)\"\n (onRowDelete)=\"invokeRowActionDelete($event)\"\n (onRowGotoList)=\"invokeRowActionGotoList($event)\"\n (onRowEdit)=\"invokeRowActionEdit($event)\"\n (onRowPrint)=\"invokeRowActionPrint($event)\"\n (onRowHistory)=\"invokeRowActionHistory($event)\"\n (onRowOption)=\"invokeRowActionOption($event)\"\n (onRowLanguage)=\"invokeRowActionLanguage($event)\"\n (onRowCellOption)=\"invokeRowActionCellOption($event)\"\n (onRowSelection)=\"invokeRowActionSelection($event)\"\n (onShiftDoubleClick)=\"invokeShiftDoubleClick($event)\"\n (rowCountChanged)=\"invokeRowCountChanged($event)\"\n (cellOptionSelect)=\"cellOptionMenuSelected($event)\"\n (bodyScroll)=\"onBodyScroll($event)\"\n />\n \n <!-- Pagination -->\n @if (pagination || clientSidePagination) {\n <one-grid-pagination\n [paginate]=\"clientSidePagination ? internalPaginate : paginate\"\n (goToFirst)=\"invokeGoToFirst()\"\n (goToLast)=\"invokeGoToLast()\"\n (goToPrevious)=\"invokeGoToPrevious()\"\n (goToNext)=\"invokeGoToNext()\"\n (pageSizeChange)=\"invokePageSizeChange($event)\"\n />\n }\n\n <!-- Master Detail Grid template, rendered inside one-grid-body via ngTemplateOutlet.\n Declared here (self-reference) so one-grid-body's template does not need to\n import one-grid, which would create an unsupported compile-time cycle. -->\n <ng-template #detailGridTpl let-node=\"node\">\n <one-grid\n [style.height.px]=\"node.detailRowHeight\"\n [gridType]=\"'detail'\"\n [masterNode]=\"node\"\n [masterDetail]=\"masterDetail\"\n [defaultColumnDef]=\"detailCellRendererParams.detailGridOptions.defaultColumnDef\"\n [columnDefs]=\"detailCellRendererParams.detailGridOptions.columnDefs\"\n [rowData]=\"node?.detailRowData\"\n [rowNumber]=\"detailCellRendererParams.detailGridOptions?.rowNumber\"\n [allowedEdit]=\"allowedEdit\"\n [submitted]=\"submitted\"\n [context]=\"context\"\n (expansionChanged)=\"invokeExpansionChangedClick($event)\"\n (onRowGotoDetail)=\"invokeRowActionGotoDetail($event)\"\n (onRowAddNew)=\"invokeRowActionAddNew($event)\"\n (onRowView)=\"invokeRowActionView($event)\"\n (onRowLocation)=\"invokeRowActionLocation($event)\"\n (onRowDocument)=\"invokeRowActionDocument($event)\"\n (onRowCopy)=\"invokeRowActionCopy($event)\"\n (onRowDelete)=\"invokeRowActionDelete($event)\"\n (onRowGotoList)=\"invokeRowActionGotoList($event)\"\n (onRowEdit)=\"invokeRowActionEdit($event)\"\n (onRowPrint)=\"invokeRowActionPrint($event)\"\n (onRowHistory)=\"invokeRowActionHistory($event)\"\n (onRowOption)=\"invokeRowActionOption($event)\"\n (onRowLanguage)=\"invokeRowActionLanguage($event)\"\n (onRowCellOption)=\"invokeRowActionCellOption($event)\"\n (onGridReady)=\"onDetailGridReady($event)\"\n />\n </ng-template>\n</div>","import { Component } from '@angular/core';\nimport { OneCellRendererComponent } from '../../core/models/one-tree-data.model';\nimport { OneCellRendererParams } from '../../core/models/one-column-def-types.model';\nimport { NgClass } from '@angular/common';\n\n@Component({\n standalone: true,\n imports: [NgClass],\n selector: 'one-grid-status',\n templateUrl: './one-grid-status.component.html',\n styleUrl: './one-grid-status.component.scss',\n})\nexport class OneGridStatusComponent implements OneCellRendererComponent {\n\n protected params!: OneCellRendererParams;\n protected value = '';\n protected label = 0;\n protected type: 'enableStatus' | 'activeStatus' | 'operationActiveStatus' | null = null;\n\n oneInit(params: OneCellRendererParams): void {\n\n this.params = params;\n this.label = params?.value ?? 0;\n\n this.type = this.getType(params.columnDef.field);\n this.value = this.getLabel(this.type, this.label);\n }\n\n refresh(params: OneCellRendererParams): boolean {\n\n return false;\n }\n\n private getType(field: string): 'enableStatus' | 'activeStatus' | 'operationActiveStatus' | null {\n\n return field === 'enableStatus' || field === 'activeStatus' || field === 'operationActiveStatus' ? field : null;\n }\n\n private getLabel(type: 'enableStatus' | 'activeStatus' | 'operationActiveStatus' | null, status: number): string {\n\n if (!type) return 'N/A';\n\n const labels = { enableStatus: ['Disabled', 'Enabled'], activeStatus: ['Inactive', 'Active'], operationActiveStatus: ['Inactive', 'Active'] } as const;\n\n return labels[type][status === 1 ? 1 : 0];\n }\n}\n","<span class=\"one-cell-status\"\n [style.width.px]=\"params.columnDef?.width\"\n [style.min-width.px]=\"params.columnDef?.minWidth\"\n [style.max-width.px]=\"params.columnDef?.maxWidth\"\n >\n <span class=\"one-cell-status-body\" [ngClass]=\"label === 1 ? 'one-success-bg' : 'one-warning-bg'\">\n {{ value }}\n </span>\n</span>\n","import { Component, Input } from '@angular/core';\nimport { CellStateChangedEvent } from '../../core/models/one-event-types.model';\nimport { OneCellRendererParams, OneColumnDef } from '../../core/models/one-column-def-types.model';\nimport { OneGridCellService } from '../../core/services/one-grid-cell.service';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { getCellField } from '../../helpers/one-cell.helper';\nimport { CellEditablePipe } from '../../core/pipes/cell-editable.pipe';\nimport { DecimalPipe } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { OneCellInputValidatorDirective } from '../../core/directives/one-cell-input-validator.directive';\n\n@Component({\n standalone: true,\n imports: [DecimalPipe, FormsModule, OneCellInputValidatorDirective],\n selector: 'app-one-grid-cell-currency',\n templateUrl: './one-grid-cell-currency.component.html',\n styleUrl: './one-grid-cell-currency.component.scss'\n})\nexport class OneGridCellCurrencyComponent {\n \n value: string = '';\n result: any;\n params!: OneCellRendererParams;\n @Input() allowedEdit: boolean = false;\n\n getCellField = getCellField;\n private unsubscribe?: () => void;\n private cellEditablePipe = new CellEditablePipe();\n\n constructor(\n private cellService: OneGridCellService,\n private eventService: OneGridEventService\n ) { }\n\n oneInit(params: OneCellRendererParams): void {\n\n this.params = params;\n this.value = params.data[params.columnDef.field];\n this.result = this.value;\n this.allowedEdit = params.context.componentParent.allowedEdit || false;\n\n this.unsubscribe = this.eventService.addEventListener('cellStateChanged', (payload: CellStateChangedEvent<any>) => {\n if (this.params.node.rowId === payload.node.rowId) {\n\n this.result = this.cellService.generateCellState(this.params.node, this.params.columnDef).value;\n }\n });\n }\n\n refresh(params: OneCellRendererParams): boolean {\n // Update params and values when grid data refreshes\n this.params = params;\n this.value = params.data[params.columnDef.field];\n this.result = this.value;\n this.allowedEdit = params.context.componentParent.allowedEdit || false;\n\n return true;\n }\n\n get isEditable(): boolean {\n if (!this.params.node || !this.params.columnDef) return false;\n\n return this.cellEditablePipe.transform(\n this.params.node.cellStates,\n this.params.columnDef,\n this.params.node,\n this.cellService.editableFn,\n this.cellService.updatableFn,\n this.allowedEdit\n );\n }\n\n startEdit(node: OneRowNode<any>, column: OneColumnDef<any>) {\n\n if (!this.isEditable) {\n return;\n }\n\n if (node) {\n\n node.editing[column.field] = true;\n\n setTimeout(() => {\n\n const input = document.querySelector<HTMLInputElement>(`[data-cell-id=\"${getCellField(node.rowIndex, column.field)}\"] input`);\n\n if (input) {\n\n input.focus();\n\n const value = input.value;\n\n if (value && [\"text\"].includes(input.type)) {\n\n input.setSelectionRange(value.length, value.length);\n }\n }\n }, 10);\n }\n }\n\n stopEdit(node: OneRowNode<any>, column: OneColumnDef<any>, event: any) {\n\n if (node) {\n\n node.data[column.field] = event.target.value === '' ? null : event.target.value;\n\n node.cellStates = this.cellService.generateCellStates(node);\n\n node.editing[column.field] = false;\n\n this.eventService.dispatchEvent('cellStateChanged', {\n data: { ...node.data },\n node: node,\n column: column\n });\n }\n }\n\n cancelEdit(node: OneRowNode<any>, column: OneColumnDef<any>) {\n\n if (node) {\n\n node.editing[column.field] = false;\n }\n }\n\n ngOnDestroy(): void {\n\n this.unsubscribe?.();\n }\n}\n","<div class=\"cell-wrapper\"\n [class.editable]=\"isEditable\"\n [attr.data-cell-id]=\"getCellField(params.node?.rowIndex, params.columnDef?.field)\"\n [style.min-width.px]=\"params.columnDef?.minWidth\"\n [style.max-width.px]=\"params.columnDef?.maxWidth\">\n\n @if (params.node?.editing?.[params.columnDef?.field]) {\n <input class=\"one-cell-input\"\n name=\"{{ params.node?.rowIndex }}_{{ params.columnDef?.field }}\"\n oneCellInputValidator\n validationType=\"number\"\n [placeholder]=\"params.columnDef?.cellRendererParams?.placeholder || ''\"\n type=\"text\"\n [(ngModel)]=\"value\"\n [maxLength]=\"250\"\n (blur)=\"stopEdit(params.node, params.columnDef, $event)\"\n (keydown.enter)=\"stopEdit(params.node, params.columnDef, $event)\"\n (keydown.esc)=\"cancelEdit(params.node, params.columnDef)\" />\n }\n @else {\n <div class=\"d-flex justify-content-between px-2 pt-1\"\n [class.one-cell-allowed-edit-active]=\"isEditable\"\n (dblclick)=\"startEdit(params.node, params.columnDef)\">\n <span class=\"currency-code\" style=\"font-weight: bold;\">{{ this.params?.data?.currency?.currencyCode || 'USD' }}</span>\n <span class=\"amount-value\">\n {{ result | number:(this.params?.field === 'amount' ? '1.3-3' : '1.2-2') }}\n </span>\n </div>\n }\n</div>\n","import { NgModule } from '@angular/core';\nimport { OneGridComponent } from './components/one-grid/one-grid.component';\nimport { OneGridStatusComponent } from './components/one-grid-status/one-grid-status.component';\nimport { OneGridCellCurrencyComponent } from './components/one-grid-cell-currency/one-grid-cell-currency.component';\n\n/**\n * Compatibility shim.\n *\n * Every component, directive and pipe in the library is standalone, so this\n * module declares nothing — it exists so `imports: [OneGridModule]` keeps\n * working for anyone already on it. New code can import `OneGridComponent`\n * directly instead.\n *\n * Icons no longer need registering here: each component that draws one\n * provides the eight the grid uses, so they travel with the component whichever\n * way it is imported.\n */\n@NgModule({\n imports: [\n OneGridComponent,\n OneGridStatusComponent,\n OneGridCellCurrencyComponent,\n ],\n exports: [\n OneGridComponent,\n OneGridStatusComponent,\n OneGridCellCurrencyComponent,\n ],\n})\nexport class OneGridModule { }\n","/*\n * Public API Surface of one-grid\n */\n\nexport * from './lib/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["lodash","uuidv4","i1.OgColumnService","i2.OneGridRowService","i3.OneGridCellService","i4.OneGridEventService","i5.OneGridSelectionService","i6.OneGridExpansionService","i1.OneGridEventService","i2.OneGridSelectionService","i1.OneGridSelectionService","i2.OneGridEventService","i1.OneGridCellService","i1.OneGridRowDragService","i2.OneGridCellService","i3.OneGridEventService","i4.OneGridRowDragService","i1","i1.OneGridApi"],"mappings":";;;;;;;;;;;;;;AAGA;AACO,MAAM,wBAAwB,GAAG;AAExC;;;;;;;;AAQG;AACG,SAAU,kBAAkB,CAAI,MAAuB,EAAA;AAEzD,IAAA,MAAM,GAAG,GAAG,MAAM,EAAE,QAAQ,IAAI,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sBAAsB;wBACtB,4BAA4B;AAC7B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,gBAAgB;wBAChB,sBAAsB;wBACtB,4BAA4B;AAC7B,qBAAA;AACF,iBAAA;;;AC5BD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"one-grid-core-angular.mjs","sources":["../../../projects/one-grid/src/lib/helpers/one-column-def.helper.ts","../../../projects/one-grid/src/lib/helpers/one-csv.helper.ts","../../../projects/one-grid/src/lib/helpers/one-row-grouping.helper.ts","../../../projects/one-grid/src/lib/helpers/one-validation.helper.ts","../../../projects/one-grid/src/lib/core/instants/one-row-node.class.ts","../../../projects/one-grid/src/lib/helpers/one-filter.helper.ts","../../../projects/one-grid/src/lib/helpers/one-cell.helper.ts","../../../projects/one-grid/src/lib/core/services/og-column.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-row.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-cell.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-event.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-selection.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-expansion.service.ts","../../../projects/one-grid/src/lib/core/instants/one-grid-api.class.ts","../../../projects/one-grid/src/lib/core/services/one-grid-row-drag.service.ts","../../../projects/one-grid/src/lib/core/services/one-grid-tree-data.service.ts","../../../projects/one-grid/src/lib/core/models/constants/one-pagination.constant.ts","../../../projects/one-grid/src/lib/core/models/one-row.model.ts","../../../projects/one-grid/src/lib/core/icons/one-grid-icons.ts","../../../projects/one-grid/src/lib/core/pipes/header-checkbox-checked.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/header-checkbox-disabled.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/header-checkbox-indeterminate.pipe.ts","../../../projects/one-grid/src/lib/components/one-grid-checkbox-header/one-grid-checkbox-header.component.ts","../../../projects/one-grid/src/lib/components/one-grid-checkbox-header/one-grid-checkbox-header.component.html","../../../projects/one-grid/src/lib/components/one-grid-header-menu/one-grid-header-menu.component.ts","../../../projects/one-grid/src/lib/components/one-grid-header-menu/one-grid-header-menu.component.html","../../../projects/one-grid/src/lib/core/pipes/column-sort-state.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/aria-sort.pipe.ts","../../../projects/one-grid/src/lib/components/one-grid-header/one-grid-header.component.ts","../../../projects/one-grid/src/lib/components/one-grid-header/one-grid-header.component.html","../../../projects/one-grid/src/lib/core/pipes/cell-editable.pipe.ts","../../../projects/one-grid/src/lib/components/one-grid-checkbox/one-grid-checkbox.component.ts","../../../projects/one-grid/src/lib/components/one-grid-checkbox/one-grid-checkbox.component.html","../../../projects/one-grid/src/lib/components/one-grid-cell-group-renderer/one-grid-cell-group-renderer.component.ts","../../../projects/one-grid/src/lib/components/one-grid-cell-group-renderer/one-grid-cell-group-renderer.component.html","../../../projects/one-grid/src/lib/components/one-grid-cell-option-menu/one-grid-cell-option-menu.component.ts","../../../projects/one-grid/src/lib/components/one-grid-cell-option-menu/one-grid-cell-option-menu.component.html","../../../projects/one-grid/src/lib/components/one-grid-row-action/one-grid-row-action.component.ts","../../../projects/one-grid/src/lib/components/one-grid-row-action/one-grid-row-action.component.html","../../../projects/one-grid/src/lib/components/one-grid-row-drag-handle/one-grid-row-drag-handle.component.ts","../../../projects/one-grid/src/lib/components/one-grid-row-drag-handle/one-grid-row-drag-handle.component.html","../../../projects/one-grid/src/lib/core/directives/one-cell-input-validator.directive.ts","../../../projects/one-grid/src/lib/core/directives/one-cell-renderer-component.directive.ts","../../../projects/one-grid/src/lib/core/directives/one-cell-text-expand.directive.ts","../../../projects/one-grid/src/lib/core/pipes/cell-action-button-enable.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/cell-invalid.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/cell-key.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/cell-level-padding.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/cell-selected.pipe.ts","../../../projects/one-grid/src/lib/core/pipes/cell-state-renderer.pipe.ts","../../../projects/one-grid/src/lib/components/one-grid-body/one-grid-body.component.ts","../../../projects/one-grid/src/lib/components/one-grid-body/one-grid-body.component.html","../../../projects/one-grid/src/lib/components/one-grid-pagination/one-grid-pagination.component.ts","../../../projects/one-grid/src/lib/components/one-grid-pagination/one-grid-pagination.component.html","../../../projects/one-grid/src/lib/components/one-grid/one-grid.component.ts","../../../projects/one-grid/src/lib/components/one-grid/one-grid.component.html","../../../projects/one-grid/src/lib/components/one-grid-status/one-grid-status.component.ts","../../../projects/one-grid/src/lib/components/one-grid-status/one-grid-status.component.html","../../../projects/one-grid/src/lib/components/one-grid-cell-currency/one-grid-cell-currency.component.ts","../../../projects/one-grid/src/lib/components/one-grid-cell-currency/one-grid-cell-currency.component.html","../../../projects/one-grid/src/lib/one-grid.module.ts","../../../projects/one-grid/src/public-api.ts","../../../projects/one-grid/src/one-grid-core-angular.ts"],"sourcesContent":["import { OneCellRendererParams, OneColumnDef, OneValueGetterParams } from \"../core/models/one-column-def-types.model\";\nimport type { OneRowNode } from \"../core/instants/one-row-node.class\";\n\n/** Width used when a column defines neither `width` nor `minWidth`. */\nexport const ONE_DEFAULT_COLUMN_WIDTH = 150;\n\n/**\n * The rendered width of a column, clamped to its bounds.\n *\n * `width`, `minWidth` and `maxWidth` are all optional, and the previous inline\n * expression — repeated in two places — fell back to `minWidth` when `width`\n * was absent. With neither set that produced `undefined`, and summing it gave\n * a `NaN` row width, so the row collapsed. This is total: every combination of\n * present and absent bounds resolves to a usable number.\n */\nexport function resolveColumnWidth<T>(column: OneColumnDef<T>): number {\n\n const min = column?.minWidth ?? 0;\n const max = column?.maxWidth ?? Number.POSITIVE_INFINITY;\n const width = column?.width ?? column?.minWidth ?? ONE_DEFAULT_COLUMN_WIDTH;\n\n return Math.min(Math.max(width, min), max);\n}\n\n/**\n * Apply Default Column Definitions\n */\nexport function applyDefaultColumnDef<T>(columnDefs: OneColumnDef<T>[], defaultColumnDef: OneColumnDef<T>): OneColumnDef<T>[] {\n\n return columnDefs.map(colDef => ({\n ...defaultColumnDef,\n ...colDef\n }));\n}\n\n/**\n * One Column Params Resolver (Cell Renderer)\n */\nexport function resolveOneCellRendererParams<T>(\n prop: boolean | ((params: any) => boolean),\n params: OneCellRendererParams<T>,\n /**\n * What an unset property means: `false` for a capability you opt into,\n * `true` for a restriction you opt out of. `!!prop` could not tell the two\n * apart, which left `updatable` — a restriction — defaulting to \"deny\".\n */\n whenUnset: boolean = false,\n): boolean {\n\n if (prop === undefined || prop === null) return whenUnset;\n\n return typeof prop === 'function' ? prop(params) : !!prop;\n}\n\n/**\n * One Column Params Resolver (Generics)\n */\nexport function resolveOneColumDefParams<R>(prop: R | ((params: any) => R), params: any): R {\n\n return typeof prop === 'function' ? (prop as (p: any) => R)(params) : prop;\n}\n\n/**\n * One Column Params Resolver (Value Getter)\n */\nexport function resolveOneValueGetterParams<T, R>(prop: R | ((params: OneValueGetterParams<T>) => R), params: OneValueGetterParams<T>): R {\n\n return typeof prop === 'function' ? (prop as (p: OneValueGetterParams<T>) => R) (params): prop;\n}\n\n/**\n * Run a column's `valueGetter` for one row.\n *\n * Was `CellValueGetterPipe`, which existed only to call this resolver from a\n * service. The pipe added a module declaration and an indirection for a\n * template use that never existed.\n */\nexport function resolveCellValueGetter<T>(data: T, node: OneRowNode, column: OneColumnDef, context: unknown): string {\n\n return resolveOneValueGetterParams(column?.valueGetter, {\n data,\n rowIndex: node?.rowIndex,\n node,\n context,\n });\n}\n","import type { OneRowNode } from \"../core/instants/one-row-node.class\";\nimport type { OneColumnDef } from \"../core/models/one-column-def-types.model\";\n\n/** Options for `api.getDataAsCsv` / `api.exportDataAsCsv`. */\nexport interface OneCsvExportOptions {\n /** Field separator. Defaults to ','. */\n columnSeparator?: string;\n /** Whether the first line carries the header names. Defaults to true. */\n includeHeaders?: boolean;\n /** Export only the selected rows instead of every visible one. */\n onlySelected?: boolean;\n /** Download name for `exportDataAsCsv`. Defaults to 'export.csv'. */\n fileName?: string;\n}\n\n/**\n * The columns an export can say anything about: those that read a row —\n * through a field or a valueGetter. Action columns have neither, and the\n * row-number column reads state the data does not hold; both are skipped.\n */\nexport function exportableColumns<T>(columns: OneColumnDef<T>[]): OneColumnDef<T>[] {\n\n return (columns ?? []).filter(column =>\n (column.field && column.field !== '_oneRowNumber') || column.valueGetter);\n}\n\n/**\n * Serialize rows to RFC 4180 CSV.\n *\n * Each cell goes through the same value pipeline the grid renders with:\n * `valueGetter` when declared, the field otherwise, then `valueFormatter` —\n * so the file says what the screen says. Null and undefined export as empty\n * cells, before the formatter, exactly as the grid leaves them to the\n * placeholder.\n */\nexport function buildCsv<T>(\n nodes: readonly OneRowNode<T>[],\n columns: OneColumnDef<T>[],\n context: any = null,\n options: OneCsvExportOptions = {},\n): string {\n\n const separator = options.columnSeparator ?? ',';\n const exportable = exportableColumns(columns);\n\n const lines: string[] = [];\n\n if (options.includeHeaders ?? true) {\n\n lines.push(exportable.map(column => escapeCsvCell(column.headerName ?? column.field ?? '', separator)).join(separator));\n }\n\n nodes?.forEach((node, rowIndex) => {\n\n const cells = exportable.map(column => {\n\n let value = column.valueGetter\n ? column.valueGetter({ data: node.data, rowIndex, node, context })\n : (node.data as Record<string, unknown>)?.[column.field as string];\n\n if (value === null || value === undefined) return '';\n\n if (column.valueFormatter) {\n\n value = column.valueFormatter({\n value,\n data: node.data,\n node,\n rowIndex,\n field: column.field as string,\n columnDef: column,\n context,\n });\n }\n\n return escapeCsvCell(value, separator);\n });\n\n lines.push(cells.join(separator));\n });\n\n // CRLF is what RFC 4180 asks for, and what spreadsheet apps expect.\n return lines.join('\\r\\n');\n}\n\n/** Quote a cell when it holds the separator, a quote, or a line break. */\nfunction escapeCsvCell(value: unknown, separator: string): string {\n\n const text = `${value}`;\n\n if (text.includes(separator) || text.includes('\"') || text.includes('\\n') || text.includes('\\r')) {\n\n return `\"${text.replace(/\"/g, '\"\"')}\"`;\n }\n\n return text;\n}\n","import { OneAggFunc, OneAggFuncParams, OneColumnDef } from \"../core/models/one-column-def-types.model\";\n\n/** Marks a synthetic group row, so anything can tell it from real data. */\nexport const ONE_GROUP_FLAG = '__oneGroup';\n\n/** Stable id for a group row: its value path. Survives every rebuild. */\nexport const ONE_GROUP_ID_FIELD = '__oneGroupId';\n\n/** The label the auto group column shows for a group row. */\nexport const ONE_GROUP_VALUE_FIELD = '__oneGroupValue';\n\n/** Where a group row keeps its children, for the tree pipeline to recurse. */\nexport const ONE_GROUP_CHILDREN_FIELD = '__oneGroupChildren';\n\n/** What a group of rows with no value in the grouped field is labelled. */\nexport const ONE_GROUP_BLANK_LABEL = '(Blank)';\n\n/** One column's aggregation, captured from the column definitions. */\nexport interface OneAggColumn<T = any> {\n field: string;\n aggFunc: OneAggFunc<T>;\n}\n\n/**\n * The `rowGroup` fields of a column set, in definition order.\n *\n * Grouping keys on a row's own field, so a column that asks to group without\n * one has nothing to group by — it is dropped, but not silently: that is a\n * definition that reads as if it works.\n */\nexport function rowGroupFields<T>(columns: readonly OneColumnDef<T>[]): string[] {\n\n const grouping = (columns ?? []).filter(column => column.rowGroup);\n\n for (const column of grouping.filter(column => !column.field)) {\n\n console.warn(`[one-grid] the column \"${column.headerName ?? column.id ?? '(unnamed)'}\" declares rowGroup but has no field — grouping reads the row's own value, so a valueGetter is not enough. The column was left ungrouped.`);\n }\n\n return grouping\n .filter(column => column.field)\n .map(column => column.field as string);\n}\n\n/** The `aggFunc` columns of a column set. */\nexport function aggColumns<T>(columns: readonly OneColumnDef<T>[]): OneAggColumn<T>[] {\n\n return (columns ?? [])\n .filter(column => column.aggFunc && column.field)\n .map(column => ({ field: column.field as string, aggFunc: column.aggFunc }));\n}\n\n/**\n * Fold flat rows into a tree of synthetic group rows, one level per group\n * field, in first-appearance order. Each group row carries:\n *\n * - the marker, id and label fields above;\n * - its own grouped field's value, so sorting and filtering read it naturally;\n * - one aggregated value per `aggFunc` column, computed over the group's\n * leaves (not its child groups), stored under the column's own field so the\n * ordinary cell pipeline renders it.\n *\n * Pure: the input rows are referenced, never mutated.\n */\nexport function buildGroupedRows<T>(\n rows: readonly T[],\n groupFields: readonly string[],\n aggregations: readonly OneAggColumn<T>[] = [],\n): any[] {\n\n if (!groupFields?.length) return [...(rows ?? [])];\n\n return groupLevel(rows ?? [], groupFields, 0, aggregations, 'og-group');\n}\n\nfunction groupLevel<T>(\n rows: readonly T[],\n groupFields: readonly string[],\n level: number,\n aggregations: readonly OneAggColumn<T>[],\n idPrefix: string,\n): any[] {\n\n const field = groupFields[level];\n\n // Insertion-ordered buckets, keyed by the value's string form. The raw\n // value is kept as well, so the group row exposes the real value under the\n // grouped field, not its stringification.\n const buckets = new Map<string, { value: unknown; rows: T[] }>();\n\n for (const row of rows) {\n\n const value = (row as Record<string, unknown>)?.[field];\n const key = value === null || value === undefined || value === '' ? ONE_GROUP_BLANK_LABEL : String(value);\n\n const bucket = buckets.get(key);\n\n if (bucket) {\n\n bucket.rows.push(row);\n\n } else {\n\n buckets.set(key, { value, rows: [row] });\n }\n }\n\n return [...buckets.entries()].map(([key, bucket]) => {\n\n const id = `${idPrefix}:${key}`;\n\n const children = level + 1 < groupFields.length\n ? groupLevel(bucket.rows, groupFields, level + 1, aggregations, id)\n : bucket.rows;\n\n const groupRow: Record<string, unknown> = {\n [ONE_GROUP_FLAG]: true,\n [ONE_GROUP_ID_FIELD]: id,\n [ONE_GROUP_VALUE_FIELD]: key,\n [field]: bucket.value,\n [ONE_GROUP_CHILDREN_FIELD]: children,\n };\n\n // Aggregates always read the original leaves, so a two-level group's\n // parent is not averaging averages.\n for (const aggregation of aggregations) {\n\n groupRow[aggregation.field] = aggregate(bucket.rows, aggregation.field, aggregation.aggFunc);\n }\n\n return groupRow;\n });\n}\n\n/** Apply one aggregation over a set of leaf rows. */\nexport function aggregate<T>(rows: readonly T[], field: string, aggFunc: OneAggFunc<T>): any {\n\n const values = rows\n .map(row => (row as Record<string, unknown>)?.[field])\n .filter(value => value !== null && value !== undefined);\n\n if (typeof aggFunc === 'function') {\n\n return aggFunc({ values, rows: rows as T[], field } as OneAggFuncParams<T>);\n }\n\n switch (aggFunc) {\n\n case 'count': return values.length;\n\n case 'first': return values.length ? values[0] : null;\n\n case 'last': return values.length ? values[values.length - 1] : null;\n }\n\n // The numeric aggregates ignore what does not parse, so one stray string in\n // a column does not turn the whole group's total into NaN.\n const numbers = values.map(Number).filter(Number.isFinite);\n\n if (!numbers.length) return null;\n\n switch (aggFunc) {\n\n case 'sum': return numbers.reduce((total, value) => total + value, 0);\n\n case 'min': return Math.min(...numbers);\n\n case 'max': return Math.max(...numbers);\n\n case 'avg': return numbers.reduce((total, value) => total + value, 0) / numbers.length;\n\n default: return null;\n }\n}\n","\nimport { OneRowNode } from \"../core/instants/one-row-node.class\";\nimport { OneColumnDef } from \"../core/models/one-column-def-types.model\";\nimport { OneValidationRules, OneValidatorFn } from \"../core/models/one-validation.model\";\n\n/**\n * One Grid Validators\n */\nexport const Validators = {\n required: (message = 'This field is required'): OneValidatorFn => {\n\n return (value) => {\n\n if (value === null || value === undefined || value === '') {\n\n return message;\n }\n\n return null;\n };\n },\n minLength: (min: number, message?: string): OneValidatorFn => {\n\n return (value) => {\n\n if (value != null && value.length < min) {\n\n return message || `Minimum length is ${min} digits`;\n }\n\n return null;\n };\n },\n maxLength: (max: number, message?: string): OneValidatorFn => {\n\n return (value) => {\n\n if (value != null && value.length > max) {\n\n return message || `Maximum length is ${max} digits`;\n }\n\n return null;\n };\n },\n pattern: (regex: RegExp, message = 'Format is not valid'): OneValidatorFn => {\n\n return (value) => {\n\n if (value != null && !regex.test(value)) {\n\n return message;\n }\n\n return null;\n };\n },\n custom: (fn: (value: any, row?: any) => string | null): OneValidatorFn => fn,\n};\n\n/**\n * One Grid Validation Rules\n */\nexport const ValidationRules: OneValidationRules = {\n required: [\n Validators.required()\n ],\n title: [\n Validators.required('Title is required'),\n Validators.minLength(1, 'Title must be at least 1 digit'),\n Validators.maxLength(250, 'Code must be less than 36 digits'),\n ],\n code: [\n Validators.required(\"Code is required\"),\n Validators.minLength(1, 'Code must be at least 1 digit'),\n Validators.maxLength(36, 'Code must be less than 36 digits'),\n ],\n email: [\n Validators.required(),\n Validators.pattern(/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/, 'Email format is invalid'),\n ],\n phone: [\n Validators.required('Phone number is required'),\n Validators.pattern(/^0(10|11|12|13|14|15|16|17|18|19|20|23|24|25|26|27|28|29)\\d{7}$/, 'Phone must be a valid pattern')\n ],\n datetime: [\n Validators.required('Datetime is required'),\n ]\n};\n\n/**\n * Helper fuction to return invalid cell on UI\n */\nexport function getCellError<T>(column: OneColumnDef<T>, node: OneRowNode, value: any, row: T): string | null {\n\n if (!column?.validationRules || column?.validationRules?.length === 0) return null;\n\n if (column?.autoGroupField) {\n\n // `editableLevels` is optional, and this read was unguarded — a tree grid\n // with validation rules on its group column threw on the first cell it\n // rendered. Undeclared means no level is validated, matching the property's\n // meaning elsewhere: it names the levels that are editable, and a level not\n // named is not one of them.\n if (column.editableLevels?.includes(node.level)) {\n\n for (const ruleFn of column?.validationRules) {\n\n const error = ruleFn(value, row);\n\n if (error) return error;\n }\n }\n\n return null;\n \n } else {\n\n if (!node.group) {\n\n for (const ruleFn of column?.validationRules) {\n\n const error = ruleFn(value, row);\n\n if (error) return error;\n }\n }\n\n return null;\n }\n}\n","import { Type } from \"@angular/core\";\nimport { OneCellOptions, OneCellStates } from \"../models/one-column-def-types.model\";\nimport { OneRowNodeEventMap, OneRowNodeListener } from \"../models/one-row.model\";\nimport { OneCellRendererComponent } from \"../models/one-tree-data.model\";\n\n/**\n * The grid's wrapper around one row of your data.\n *\n * A node owns three kinds of state: its identity and position, the structural\n * facts the grid derived while building the tree, and the per-cell UI state.\n * `data` is your object, held by reference and mutated in place when a cell is\n * committed — the node never copies it.\n *\n * @typeParam T - the row type\n * @typeParam D - the detail row type, for master/detail grids\n */\nexport class OneRowNode<T = any, D = any> {\n\n // ---------------------------------------------------------------------------\n // Identity\n // ---------------------------------------------------------------------------\n\n /**\n * Stable key for this row, from `context.componentParent.getRowId` or a\n * generated uuid. Selection, expansion and cell state are all keyed by it,\n * which is why it never changes for the life of the node.\n */\n public readonly rowId: string;\n\n /** Position in the flattened row list. Reassigned whenever rows are rebuilt. */\n public rowIndex: number;\n\n /** Your row object, by reference. */\n public data: T;\n\n /** Depth in the tree. 0 at the root; always 0 outside tree data. */\n public level = 0;\n\n // ---------------------------------------------------------------------------\n // Structure, derived by the grid while building rows\n // ---------------------------------------------------------------------------\n\n /** Has no children of its own. */\n public leaf = false;\n\n /** Is a group, but an empty one. */\n public leafGroup = false;\n\n /** Has children. */\n public group = false;\n\n /** Can be opened — a non-empty group, or any row in a master/detail grid. */\n public expandable = false;\n\n /** Survives the active filters. Recomputed on every filter pass. */\n public visible = false;\n\n public selected = false;\n public expanded = false;\n\n public parent: OneRowNode<T> | null = null;\n public children: OneRowNode<T>[] | null = null;\n\n // ---------------------------------------------------------------------------\n // Per-cell UI state, keyed by column field\n // ---------------------------------------------------------------------------\n\n /** Which cells currently have an open editor. */\n public editing: { [field: string]: boolean } = {};\n\n /** Rendered value and kind for each cell, computed when the row is built. */\n public cellStates: OneCellStates = {};\n\n public cellOptions: OneCellOptions = {};\n\n // ---------------------------------------------------------------------------\n // Master / detail\n // ---------------------------------------------------------------------------\n\n /** Detail rows for this master row. `null` until they have been supplied. */\n public detailRowData: D[] | null = null;\n\n /** Whether the custom detail renderer is showing. Toggled by the row action. */\n public detailActive = false;\n\n /** Height reserved for the detail area, computed from the detail row count. */\n public detailRowHeight: number | null = null;\n\n public detailRendererComponent?: Type<OneCellRendererComponent>;\n\n /**\n * Listeners per event. Typed as a payload-agnostic callback because the map\n * is heterogeneous; `on` and `emit` restore the per-event type at the edges.\n */\n private readonly listeners = new Map<keyof OneRowNodeEventMap<T>, Set<(payload: never) => void>>();\n\n constructor(rowId: string, data: T, rowIndex: number) {\n\n this.rowId = rowId;\n this.data = data;\n this.rowIndex = rowIndex;\n }\n\n // ---------------------------------------------------------------------------\n // Mutators\n // ---------------------------------------------------------------------------\n\n /**\n * Write one field of the row and announce it.\n *\n * `null` is allowed because that is what the grid itself stores for a cleared\n * cell; anything else must match the field's declared type.\n */\n setDataValue<K extends keyof T & string>(field: K, value: T[K] | null): void {\n\n const previousData = { ...this.data };\n\n this.data[field] = value as T[K];\n\n this.emit('rowDataChanged', { node: this, data: this.data, previousData });\n }\n\n setSelected(selected: boolean): void {\n\n this.selected = selected;\n }\n\n setRowIndex(index: number): void {\n\n this.rowIndex = index;\n }\n\n setCellStates(cellStates: OneCellStates): void {\n\n this.cellStates = cellStates;\n }\n\n /** @deprecated Read `node.selected`. */\n isSelected(): boolean {\n\n return this.selected;\n }\n\n /** @deprecated Read `node.expanded`. */\n isExpanded(): boolean {\n\n return this.expanded;\n }\n\n /** Supply or replace this master row's detail rows. */\n setDetailRowData(detailRowData: D[]): void {\n\n const previousDetailRowData = this.detailRowData;\n\n this.detailRowData = detailRowData;\n\n this.emit('detailRowDataChanged', { node: this, detailRowData, previousDetailRowData });\n }\n\n setExpanded(expanded: boolean): void {\n\n if (this.expanded === expanded) return; // no event for a no-op\n\n this.expanded = expanded;\n\n this.emit('expandedChanged', { node: this, expanded });\n }\n\n // ---------------------------------------------------------------------------\n // Events\n // ---------------------------------------------------------------------------\n\n /**\n * Subscribe to one of this node's events.\n *\n * @returns an unsubscribe function. Call it, or `destroy()`, to release the\n * listener — a node outlives any single render.\n */\n on<K extends keyof OneRowNodeEventMap<T>>(event: K, listener: OneRowNodeListener<T, K>): () => void {\n\n let listeners = this.listeners.get(event);\n\n if (!listeners) {\n\n listeners = new Set();\n\n this.listeners.set(event, listeners);\n }\n\n listeners.add(listener as (payload: never) => void);\n\n return () => this.off(event, listener);\n }\n\n off<K extends keyof OneRowNodeEventMap<T>>(event: K, listener: OneRowNodeListener<T, K>): void {\n\n this.listeners.get(event)?.delete(listener as (payload: never) => void);\n }\n\n /**\n * Notify listeners. Private on purpose: every event this class publishes is\n * raised by the mutator that caused it, and a forged `expandedChanged` would\n * leave the node's flag and the grid's view of it disagreeing.\n */\n private emit<K extends keyof OneRowNodeEventMap<T>>(event: K, payload: OneRowNodeEventMap<T>[K]): void {\n\n const listeners = this.listeners.get(event);\n\n if (!listeners?.size) return;\n\n // Snapshot: a listener is allowed to unsubscribe itself, or another, while\n // the event is being delivered.\n for (const listener of Array.from(listeners)) {\n\n (listener as (payload: OneRowNodeEventMap<T>[K]) => void)(payload);\n }\n }\n\n /**\n * Release everything this node holds. Called by the grid when the row leaves\n * the data or the grid is torn down.\n *\n * The tree links matter as much as the listeners: a parent holding children\n * that hold the parent keeps the whole subtree — and its data — reachable.\n */\n destroy(): void {\n\n this.listeners.clear();\n\n this.parent = null;\n this.children = null;\n this.detailRowData = null;\n this.detailRendererComponent = undefined;\n\n this.editing = {};\n this.cellStates = {};\n this.cellOptions = {};\n }\n}\n","import { OneRowNode } from \"../core/instants/one-row-node.class\";\nimport { OneFilterModel } from \"../core/models/one-filter.model\";\n\n/**\n * Recursively filters a tree and updates each node's UI state.\n *\n * Rules:\n * - A node is visible if it matches the filters or has a matching descendant.\n * - While a filter is active, a node is expanded iff it has a matching\n * descendant, so the hit is revealed.\n *\n * Overwriting `expanded` is only correct *while filtering*. This runs from\n * `applyFilters`, which every `setRowData` / `updateRowData` calls, so doing it\n * unconditionally force-expanded every parent on each data update: it made\n * `groupDefaultExpanded` inert for tree data and collapsed expanded\n * master-detail rows (they have no children, so `childMatch` is false).\n *\n * @returns True if the current node or any descendant matches.\n */\nexport function filterTreeNode<T = any>(node: OneRowNode<T>, filters: OneFilterModel[] | null, quick: string, fields?: readonly string[]): boolean {\n\n const filtering = isFilterActive(filters, quick);\n\n // Check whether the current node matches all active filters.\n const selfMatch = matchesAdvancedFilters(node, filters) && matchesQuickFilter(node, quick, fields);\n\n // Recursively determine whether any child matches.\n const childMatch = node.children?.some(child => filterTreeNode(child, filters, quick, fields)) ?? false;\n\n // Keep the node visible when it or any descendant matches.\n node.visible = selfMatch || childMatch;\n\n if (filtering) {\n\n // Expand parents to reveal matching descendants.\n node.expanded = childMatch;\n }\n\n return node.visible;\n}\n\n/**\n * Whether anything is actually filtering right now. A model entry with no\n * conditions matches everything, so it does not count as active.\n */\nexport function isFilterActive(filters: OneFilterModel[] | null, quick: string): boolean {\n\n if (quick) return true;\n\n return !!filters?.some(filter => filter?.conditions?.length > 0);\n}\n\n/**\n * Apply advanced per-column filters\n */\nexport function matchesAdvancedFilters<T = any>(node: OneRowNode<T>, filters: OneFilterModel[] | null): boolean {\n\n if (!filters || filters.length === 0) return true;\n\n return filters.every(filter => {\n\n const val = (node.data[filter.field as keyof T] ?? '').toString().toLowerCase();\n\n const results = filter.conditions.map(condition => {\n\n const cmp = (condition.value ?? '').toString().toLowerCase();\n const cmpTo = (condition.valueTo ?? '').toString().toLowerCase();\n\n switch (condition.operator) {\n\n case 'equals': return val === cmp;\n\n case 'notEqual': return val !== cmp;\n\n case 'contains': return val.includes(cmp);\n\n case 'notContains': return !val.includes(cmp);\n\n case 'startsWith': return val.startsWith(cmp);\n\n case 'endsWith': return val.endsWith(cmp);\n\n case 'greaterThan': return compare(val, cmp) > 0;\n\n case 'greaterThanOrEqual': return compare(val, cmp) >= 0;\n\n case 'lessThan': return compare(val, cmp) < 0;\n\n case 'lessThanOrEqual': return compare(val, cmp) <= 0;\n\n case 'inRange': return compare(val, cmp) >= 0 && compare(val, cmpTo) <= 0;\n\n // `val` has already been through `?? ''`, so null and undefined land\n // here as the empty string. 0 stringifies to '0' and does not.\n case 'blank': return val === '';\n\n case 'notBlank': return val !== '';\n\n default: return true; // Unknown operator = ignore\n }\n });\n\n return filter.logicOperator === 'AND' ? results.every(Boolean) : results.some(Boolean);\n });\n}\n\n/**\n * Order two already-lowercased cell values.\n *\n * Numeric when both sides parse as numbers, lexicographic otherwise. This used\n * to be `+val > +cmp` unconditionally, so anything non-numeric compared NaN\n * against NaN — always false. A date column filtered with `greaterThan` matched\n * nothing at all rather than reporting a problem, and ISO dates happen to sort\n * correctly as strings, which is what the fallback gives them.\n */\nfunction compare(val: string, cmp: string): number {\n\n const left = Number(val);\n const right = Number(cmp);\n\n const numeric = val !== '' && cmp !== '' && !Number.isNaN(left) && !Number.isNaN(right);\n\n if (numeric) return left === right ? 0 : left < right ? -1 : 1;\n\n return val === cmp ? 0 : val < cmp ? -1 : 1;\n}\n\n/**\n * Apply the quick filter to one row.\n *\n * Searches the fields the grid actually shows, when it is told what they are.\n * It used to walk `Object.values(node.data)`, which had three consequences, all\n * of them wrong:\n *\n * - a property with no column was searchable, so a user could match rows on\n * data the grid never displayed;\n * - a nested object stringified to `[object Object]`, so typing `object`\n * matched every row holding one;\n * - in a tree, `children` did the same, so most parents matched most queries.\n *\n * Non-primitive values are skipped regardless, so the `[object Object]` haystack\n * cannot come back through a declared column either.\n */\nexport function matchesQuickFilter<T = any>(node: OneRowNode<T>, quick: string, fields?: readonly string[]): boolean {\n\n if (!quick) return true;\n\n const data = node.data as Record<string, unknown>;\n\n const values = fields?.length ? fields.map(field => data?.[field]) : Object.values(data ?? {});\n\n return values.some(value => {\n\n if (value === null || value === undefined) return false;\n\n // Objects, arrays and functions have no useful text form. Skipping them is\n // what keeps `[object Object]` out of the search.\n if (typeof value === 'object' || typeof value === 'function') return false;\n\n return value.toString().toLowerCase().includes(quick);\n });\n}\n","import { OneColumnDef } from \"../core/models/one-column-def-types.model\";\n\n/**\n * Generate Cell Field\n */\nexport function getCellField(rowIndex: number, field: string): string {\n\n return `${rowIndex}--${field}`;\n}\n\nexport function getCellKey(rowId: string, field: string): string {\n\n return `${rowId}--${field}`;\n}\n\n/**\n * Get Value From Data Field\n */\nexport function getFieldValue<T>(data: T, field: string): string {\n\n return field?.split('.')?.reduce((obj, key) => obj?.[key], data) as string;\n}\n\n/**\n * Resolve cell style (handles both static and function-based)\n * @param column \n * @param row \n * @returns \n */\nexport function resolveCellStyle(column: OneColumnDef, row: any): { [key: string]: string } {\n\n if (!column.cellStyle) return {};\n\n return typeof column.cellStyle === 'function'\n ? column.cellStyle(row)\n : column.cellStyle;\n}\n\n/**\n * Resolve cell class (handles both static and function-based)\n * @param column \n * @param row \n * @returns \n */\nexport function resolveCellClass(column: OneColumnDef, row: any): string | string[] {\n\n if (!column.cellClass) return '';\n\n return typeof column.cellClass === 'function'\n ? column.cellClass(row)\n : column.cellClass;\n}\n\n/**\n * The cell's raw field value, with blank treated as absent.\n *\n * Was `CellFieldValuePipe`. It lived as an Angular pipe but was only ever\n * instantiated inside a service — a utility wearing a `@Pipe` decorator, which\n * also cost it a module declaration for a template use that never existed.\n */\nexport function readCellValue<T>(data: T, field: string): string | null {\n\n const value = getFieldValue(data, field);\n\n if (value === null || value === undefined) return null;\n\n if (typeof value === 'string' && value.trim() === '') return null;\n\n return value;\n}\n\n/**\n * Whether a cell has nothing to show.\n *\n * Was `CellFieldValueEmptyPipe`. `field` is optional on `OneColumnDef` — an\n * action-only column legitimately has none — and reading it unguarded used to\n * throw while the grid built cell state, taking the whole grid down. No field\n * means nothing to read, which is empty by definition.\n */\nexport function isCellEmpty<T>(data: T, field: string): boolean {\n\n if (!data || !field) return true;\n\n const value = getFieldValue(data, field);\n\n return value === null || value === undefined || value === '';\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { OneCellPresentationParams, OneCellRendererParams, OneColumnDef, OneColumnStateEntry, OneGroupColumnDef, OneHeaderPresentationParams } from '../models/one-column-def-types.model';\nimport lodash from 'lodash';\nimport { ColumnChangedEvent } from '../models/one-event-types.model';\nimport { resolveColumnWidth, resolveOneCellRendererParams } from '../../helpers/one-column-def.helper';\n\n@Injectable()\nexport class OgColumnService {\n\n private defaultColumnDef: OneColumnDef = null;\n\n /**\n * The grid's `context`, so header callbacks receive the same one cell\n * callbacks do. Set during init; null in a bare service.\n */\n private context: unknown = null;\n\n /**\n * Every column, hidden ones included, in display order. `columnDefs$` below\n * carries only the visible subset — it is what the header and body render\n * from, so hiding a column means leaving it out of the emission, and every\n * consumer keeps working with no notion of visibility at all. This list is\n * what remembers a hidden column's place, width and pin for when it returns.\n */\n private allColumnDefs: OneColumnDef[] = [];\n private columnDefs$ = new BehaviorSubject<OneColumnDef[]>([]);\n private groupColumnDefs$ = new BehaviorSubject<OneGroupColumnDef[]>([]);\n\n initColumnDefs(defaultColumnDef: OneColumnDef, columnDefs: OneColumnDef[], groupColumnDefs: OneGroupColumnDef[], context: unknown = null): void {\n\n this.defaultColumnDef = defaultColumnDef;\n\n this.context = context;\n\n this.setGroupColumnDefs(groupColumnDefs);\n \n this.setColumnDefs(columnDefs);\n }\n\n /**\n * Every registered column, hidden ones included, in display order.\n *\n * `getColumnState` answers what is on screen; this answers what the grid\n * knows about — which is what anything reading a column's *configuration*\n * (an `aggFunc`, say) needs, since hiding a column does not unconfigure it.\n */\n getAllColumnDefs(): readonly OneColumnDef[] {\n\n return this.allColumnDefs;\n }\n\n getColumnState(): ColumnChangedEvent {\n\n const columns = this.columnDefs$.getValue();\n\n const groups = this.groupColumnDefs$.getValue();\n\n return { columns, groups };\n }\n\n setGroupColumnDefs(groupColumnDefs: OneGroupColumnDef[]): void {\n\n const groups = groupColumnDefs.map((group: OneGroupColumnDef) => this.resolveGroupPresentation(group, { context: this.context }));\n\n this.groupColumnDefs$.next(groups);\n }\n\n setColumnDefs(columnDefs: OneColumnDef[]): void {\n\n const columns = columnDefs.map((col: OneColumnDef) => {\n\n const column = {\n ...this.defaultColumnDef,\n ...col,\n id: col?.field ? col.field : lodash.uniqueId('col_'),\n };\n\n return this.resolveHeaderPresentation(column);\n });\n\n this.commit(columns);\n }\n\n /**\n * Re-band, re-measure and publish a new column list.\n *\n * Every mutation funnels here so the master list and the visible emission\n * cannot drift apart.\n */\n private commit(columns: OneColumnDef[]): void {\n\n const ordered = this.applyPinning(columns);\n\n this.allColumnDefs = ordered;\n\n const visible = ordered.filter(column => !column.hide);\n\n this.recalculateGroups(visible);\n\n this.columnDefs$.next(visible);\n }\n\n /**\n * Move pinned columns to their edge and measure how far in each one sits.\n *\n * Display order becomes left-pinned, unpinned, right-pinned, with declared\n * order preserved inside each band. `_pinnedOffset` is the distance from that\n * column's own edge — the sum of the widths of the pinned columns outside it\n * — which is what the sticky `left` / `right` binding needs.\n *\n * With nothing pinned this returns the same array, in the same order, so a\n * grid that does not use the feature is unaffected.\n */\n private applyPinning(columns: OneColumnDef[]): OneColumnDef[] {\n\n const left = columns.filter(column => column.pinned === 'left');\n const right = columns.filter(column => column.pinned === 'right');\n\n if (!left.length && !right.length) {\n\n for (const column of columns) {\n\n column._pinnedOffset = null;\n column._pinnedEdge = false;\n }\n\n return columns;\n }\n\n const center = columns.filter(column => column.pinned !== 'left' && column.pinned !== 'right');\n\n // Hidden columns keep their place in the band but take up no space, so\n // they are skipped when measuring offsets and never carry the divider.\n let offset = 0;\n\n for (const column of left) {\n\n column._pinnedOffset = offset;\n column._pinnedEdge = false;\n\n if (!column.hide) offset += resolveColumnWidth(column);\n }\n\n // Right-pinned columns are measured from the right edge inwards, so the\n // last declared one sits flush and the earlier ones stack outside it.\n offset = 0;\n\n for (let index = right.length - 1; index >= 0; index--) {\n\n right[index]._pinnedOffset = offset;\n right[index]._pinnedEdge = false;\n\n if (!right[index].hide) offset += resolveColumnWidth(right[index]);\n }\n\n for (const column of center) {\n\n column._pinnedOffset = null;\n column._pinnedEdge = false;\n }\n\n // Only the innermost visible column of each band carries the divider, so\n // stacked pinned columns do not each cast a shadow onto the next.\n const leftVisible = left.filter(column => !column.hide);\n const rightVisible = right.filter(column => !column.hide);\n\n if (leftVisible.length) leftVisible[leftVisible.length - 1]._pinnedEdge = true;\n if (rightVisible.length) rightVisible[0]._pinnedEdge = true;\n\n return [...left, ...center, ...right];\n }\n\n /** Total width of the visible columns frozen against the given edge. */\n public getPinnedWidth(side: 'left' | 'right'): number {\n\n return this.columnDefs$.getValue()\n .filter(column => column.pinned === side)\n .reduce((total, column) => total + resolveColumnWidth(column), 0);\n }\n\n // Update single column. Works on the master list, so a hidden column can be\n // patched — including `hide` itself, which is how visibility toggles.\n updateColumnDef(id: string, changes: Partial<OneColumnDef>): void {\n\n const updatedColumns = this.allColumnDefs.map(col => col.id === id ? { ...col, ...changes } : col);\n\n // Re-pinned (inside commit), not just re-grouped: resizing a pinned column\n // changes where the ones inside it have to sit, and this is the path a\n // column resize takes.\n this.commit(updatedColumns);\n }\n\n /**\n * Reorder columns. The indexes are *visible* positions — they come from the\n * header, which only renders visible columns — so they are mapped onto the\n * master list before splicing. A hidden column between the two keeps its\n * place relative to its neighbours.\n */\n reorderColumnDefs(fromIndex: number, toIndex: number): void {\n\n const columns = lodash.clone(this.allColumnDefs);\n const visible = columns.filter(column => !column.hide);\n\n const moved = visible[fromIndex];\n\n if (!moved) return;\n\n columns.splice(columns.indexOf(moved), 1);\n\n // Land before the visible column now at the target index — the same splice\n // the visible-only list used to do after removal — or at the end when the\n // target is past the last visible column.\n const visibleAfter = visible.filter(column => column !== moved);\n const anchor = visibleAfter[toIndex];\n\n columns.splice(anchor ? columns.indexOf(anchor) : columns.length, 0, moved);\n\n // Dragging can drop a column between two pinned ones; re-pinning (inside\n // commit) puts the bands back in order rather than leaving them\n // interleaved, which would make the computed offsets meaningless.\n this.commit(columns);\n }\n\n /**\n * Distribute the viewport width left over by fixed columns among the flex\n * ones, in proportion to their `flex` values and clamped to their bounds.\n *\n * @returns Whether any width actually changed — the caller only dispatches\n * (and the body only re-triggers) on a real change, which is what terminates\n * the columnChanged → flex → columnChanged loop.\n */\n applyFlexWidths(availableWidth: number): boolean {\n\n const visible = this.columnDefs$.getValue();\n const flexColumns = visible.filter(column => (column.flex ?? 0) > 0);\n\n if (!flexColumns.length || !(availableWidth > 0)) return false;\n\n const fixedWidth = visible\n .filter(column => !((column.flex ?? 0) > 0))\n .reduce((total, column) => total + resolveColumnWidth(column), 0);\n\n let remaining = Math.max(availableWidth - fixedWidth, 0);\n\n // Clamped columns stop flexing and release their share to the rest, so\n // the pass repeats until the split is stable. Each pass settles at least\n // one column; the loop is bounded by the column count.\n const widths = new Map<string, number>();\n let unsettled = [...flexColumns];\n\n while (unsettled.length) {\n\n const totalFlex = unsettled.reduce((total, column) => total + (column.flex ?? 0), 0);\n const share = remaining / totalFlex;\n\n const clamped = unsettled.filter(column => {\n\n const ideal = share * (column.flex ?? 0);\n const min = Math.max(column.minWidth ?? 0, 50);\n const max = column.maxWidth ?? Number.POSITIVE_INFINITY;\n const width = Math.min(Math.max(ideal, min), max);\n\n if (width === ideal) return false;\n\n widths.set(column.id, Math.round(width));\n remaining = Math.max(remaining - width, 0);\n\n return true;\n });\n\n unsettled = unsettled.filter(column => !clamped.includes(column));\n\n if (!clamped.length) {\n\n unsettled.forEach(column => widths.set(column.id, Math.floor(share * (column.flex ?? 0))));\n\n break;\n }\n }\n\n const changed = flexColumns.some(column => widths.get(column.id) !== resolveColumnWidth(column));\n\n if (!changed) return false;\n\n this.commit(this.allColumnDefs.map(column =>\n widths.has(column.id) ? { ...column, width: widths.get(column.id) } : column));\n\n return true;\n }\n\n /**\n * One JSON-safe entry per column — hidden ones included — in display order.\n */\n getColumnStateSnapshot(): OneColumnStateEntry[] {\n\n return this.allColumnDefs.map(column => {\n\n const entry: OneColumnStateEntry = { id: column.id, hide: !!column.hide, pinned: column.pinned ?? null };\n\n if (column.width != null) entry.width = column.width;\n\n return entry;\n });\n }\n\n /**\n * Restore a saved snapshot: order, width, pin and visibility.\n *\n * Entries are applied in the order given and become the front of the new\n * column order; columns the snapshot does not mention keep their current\n * relative order behind them, and ids the grid no longer has are skipped —\n * so a stale snapshot degrades to a partial restore instead of an error.\n * Only the properties present on an entry are applied.\n */\n applyColumnState(entries: OneColumnStateEntry[]): void {\n\n const byId = new Map(this.allColumnDefs.map(column => [column.id, column]));\n\n const mentioned = (entries ?? []).filter(entry => entry && byId.has(entry.id));\n const mentionedIds = new Set(mentioned.map(entry => entry.id));\n\n const restored = mentioned.map(entry => {\n\n const column = { ...byId.get(entry.id) };\n\n if (entry.width != null) column.width = entry.width;\n if ('pinned' in entry) column.pinned = entry.pinned ?? undefined;\n if ('hide' in entry) column.hide = !!entry.hide;\n\n return column;\n });\n\n const rest = this.allColumnDefs.filter(column => !mentionedIds.has(column.id));\n\n this.commit([...restored, ...rest]);\n }\n\n /**\n * Group Header Columns\n */\n private recalculateGroups(columnDefs: OneColumnDef[]) {\n\n if (this.groupColumnDefs$.getValue().length > 0) {\n\n const groups = this.groupColumnDefs$.value.map(group => ({\n ...group,\n width: columnDefs.filter(c => c.groupId === group.id).reduce((sum, col) => sum + resolveColumnWidth(col), 0)\n }));\n\n this.groupColumnDefs$.next(groups);\n }\n }\n\n resolveGroupPresentation(col: OneGroupColumnDef, params?: OneCellRendererParams): OneGroupColumnDef {\n\n col._resolvedGroupClass = typeof col.groupClass === 'function' ? col.groupClass(params) : col.groupClass;\n col._resolvedGroupStyle = typeof col.groupStyle === 'function' ? col.groupStyle(params) : col.groupStyle;\n\n return col;\n }\n\n /**\n * Resolve a column's header presentation. Once per column, when the columns\n * are set — a header is one cell for the whole column, so there is no row to\n * resolve it against and nothing to redo per render.\n *\n * This used to resolve the cell hooks too, from the same call, with no params\n * at all. Two bugs came out of that: any callback touching `params` threw a\n * TypeError at init, and the header's resolved value was then overwritten by\n * every cell that rendered, since the body re-ran the same method per cell\n * with row params. In dev mode the disagreement surfaced as NG0100.\n */\n resolveHeaderPresentation(col: OneColumnDef): OneColumnDef {\n\n const params: OneHeaderPresentationParams = {\n columnDef: col,\n field: col.field as string,\n context: this.context,\n };\n\n col._resolvedHeaderClass = typeof col.headerClass === 'function' ? col.headerClass(params) : col.headerClass;\n col._resolvedHeaderStyle = typeof col.headerStyle === 'function' ? col.headerStyle(params) : col.headerStyle;\n\n // The header's own predicates. Declared as `boolean | ((params) => boolean)`\n // and read straight off the column in the template, where a function is\n // simply truthy — so `sortable: () => false` rendered a sort button that a\n // consumer had explicitly asked not to have. Resolved here to a real\n // boolean, once, because none of them depends on a row.\n col._resolvedSortable = resolveOneCellRendererParams(col.sortable, params);\n col._resolvedResizable = resolveOneCellRendererParams(col.resizable, params);\n col._resolvedDragable = resolveOneCellRendererParams(col.dragable, params);\n col._resolvedFilterable = resolveOneCellRendererParams(col.filterable, params);\n col._resolvedSuppressHeaderMenuButton = resolveOneCellRendererParams(col.suppressHeaderMenuButton, params);\n\n return col;\n }\n\n /**\n * Resolve one cell's class, for one row.\n *\n * Pure: the result is returned rather than written back onto the column def,\n * which every row of that column shares. Writing to it worked only because\n * the template resolved and read in the same expression — one render order\n * away from every row showing the last row's class.\n */\n resolveCellClass(col: OneColumnDef, params: OneCellPresentationParams): string | string[] | undefined {\n\n return typeof col?.cellClass === 'function' ? col.cellClass(params) : col?.cellClass;\n }\n\n /** Resolve one cell's inline style, for one row. Pure, as above. */\n resolveCellStyle(col: OneColumnDef, params: OneCellPresentationParams): Record<string, string> | undefined {\n\n return typeof col?.cellStyle === 'function' ? col.cellStyle(params) : col?.cellStyle;\n }\n}","import { Injectable } from '@angular/core';\nimport { OneGridGetRowIdParams } from '../models/one-grid-types.model';\nimport { v4 as uuidv4 } from 'uuid';\n\n@Injectable()\nexport class OneGridRowService {\n\n private _getRowId: (params: OneGridGetRowIdParams) => string = null;\n\n /**\n * Set Row Id Funciton\n */\n public setGetRowIdFn(getRowId: (params: OneGridGetRowIdParams) => string) {\n\n this._getRowId = getRowId;\n }\n\n /**\n * Generate Unique Row ID\n */\n public generateRowId(data: any, rowIndex: number): string {\n\n if (this._getRowId) {\n\n return this._getRowId({ data, rowIndex }) ?? uuidv4();\n }\n\n return uuidv4();\n }\n\n /**\n * The row's id, or null when it cannot be known — no id function, or one\n * that answers nothing for this row. Unlike `generateRowId` this never\n * mints an id, which is what row matching (transactions) needs: a minted\n * id matches nothing and must not pretend otherwise.\n */\n public resolveRowId(data: any): string | null {\n\n return this._getRowId?.({ data, rowIndex: -1 }) ?? null;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { OneCellPresentationParams, OneCellState, OneCellStates, OneColumnDef } from '../models/one-column-def-types.model';\nimport { OneRowNode } from '../instants/one-row-node.class';\nimport { isCellEmpty, readCellValue } from '../../helpers/one-cell.helper';\nimport { resolveCellValueGetter, resolveOneCellRendererParams, resolveOneValueGetterParams } from '../../helpers/one-column-def.helper';\nimport type { OneGridApi } from '../instants/one-grid-api.class';\n\n@Injectable()\nexport class OneGridCellService {\n\n private _columnDefs: OneColumnDef[] = [];\n private _context: any;\n private _api: OneGridApi | null = null;\n\n public applyColumnDefs(columnDefs: OneColumnDef[], context: any) {\n\n this._columnDefs = columnDefs;\n this._context = context;\n }\n\n /**\n * Back-reference to the grid api, so predicate params can carry it.\n *\n * Pushed in rather than injected: `OneGridApi` already depends on this\n * service, and injecting it back would close a DI cycle.\n */\n public setGridApi(api: OneGridApi | null): void {\n\n this._api = api;\n }\n\n /**\n * The params every row-scoped column callback receives.\n *\n * One builder, deliberately: `editable`, `updatable`, `disable`, `rowDrag`,\n * `hideActionButton`, `cellClass`, `cellStyle`, `cellRenderer` and\n * `valueFormatter` are all \"decide something about this cell\", and a consumer\n * should not have to remember which of them happens to be handed `value` or\n * `field`. Each used to be called with a slightly different subset.\n */\n public cellParams(column: OneColumnDef, node: OneRowNode): OneCellPresentationParams {\n\n return {\n // Column config first, so the grid's own fields win a name collision: a\n // stale `value` left in `cellRendererParams` must not shadow this cell's.\n ...(column?.cellRendererParams ?? {}),\n value: this.resolveValue(node, column),\n data: node.data,\n node,\n rowIndex: node.rowIndex,\n field: column?.field as string,\n columnDef: column,\n api: this._api ?? undefined,\n context: this._context,\n };\n }\n\n /**\n * Generate New Node States\n */\n public generateCellStates(node: OneRowNode): OneCellStates | null {\n\n if (!node) return null;\n\n const newStates: OneCellStates = {};\n\n for (const column of this._columnDefs) {\n\n const field = column.field;\n\n // Cell state is keyed by field, so a column without one contributes\n // nothing. Skipping it keeps `undefined` out of the state object; such a\n // column still renders its action buttons, which do not read cell state.\n if (!field) continue;\n\n if (field !== '_oneRowNumber') {\n\n newStates[field] = this.generateCellState(node, column) ?? node.cellStates[field] ?? { type: 'none', value: '' };\n\n } else {\n\n newStates[field] = node.cellStates[field];\n }\n }\n\n return newStates;\n }\n\n /**\n * The cell's value: the `valueGetter`'s output where the column declares one,\n * the raw field otherwise. This is the value, not the display text — see\n * {@link formatValue}.\n */\n private resolveValue(node: OneRowNode, column: OneColumnDef): any {\n\n return column?.valueGetter\n ? resolveCellValueGetter(node.data, node, column, this._context)\n : readCellValue(node.data, column.field);\n }\n\n /**\n * Apply the column's `valueFormatter`.\n *\n * `valueFormatter` was declared on the column definition and called from\n * nowhere — a consumer could write one, get no error, and see nothing happen.\n * It runs on displayed text only, after the `valueGetter`, and is deliberately\n * skipped for placeholders: an empty cell already has its own mechanism in\n * `cellRendererParams.placeholder`, and two features competing to fill the\n * same gap is worse than one.\n *\n * Note that sorting and filtering read the underlying row data, not this —\n * which is exactly why formatting belongs here rather than in the getter.\n */\n private formatValue(node: OneRowNode, column: OneColumnDef, value: any): any {\n\n if (typeof column?.valueFormatter !== 'function') return value;\n\n // `value` is passed explicitly rather than left to `cellParams`: the empty\n // -cell branch resolves it through the getter before deciding whether there\n // is anything to format, and the formatter must see that same value.\n return column.valueFormatter({ ...this.cellParams(column, node), value });\n }\n\n /**\n * The placeholder for an empty cell, or `undefined` when this row's tree\n * depth may not be edited.\n *\n * `cellRendererParams.placeholder` is a prompt, not data: it renders at half\n * opacity where the value would go, which reads as \"click here and fill this\n * in\". On the auto group column `editableLevels` decides which depths accept\n * an edit at all, so a depth outside that list was advertising an edit the\n * grid then refuses — the cell offers no input and the prompt never clears.\n *\n * The suppression is scoped to columns that actually declare `editableLevels`.\n * The list is opt-in, and a column without one has no per-level rules rather\n * than no editable levels, so plain grids and untouched tree columns keep\n * showing their placeholder exactly as before.\n */\n private resolvePlaceholder(node: OneRowNode, column: OneColumnDef): string | undefined {\n\n const placeholder = column?.cellRendererParams?.placeholder;\n const editableLevels = column?.editableLevels;\n\n if (!column?.autoGroupField || !Array.isArray(editableLevels)) return placeholder;\n\n return editableLevels.includes(node?.level) ? placeholder : undefined;\n }\n\n /**\n * Generate New Node State Based on Column Field\n */\n public generateCellState(node: OneRowNode, column: OneColumnDef): OneCellState {\n\n // This was `field !== undefined || field !== '' || field !== null`, which is\n // true for every possible value including all three it meant to exclude —\n // `||` where `&&` was intended. It gated the four branches below, so none\n // of them could ever fall through to the default. Reduced to the check it\n // was reaching for: a column with no field has no value to render.\n const field = column?.field;\n\n if (!field) {\n\n return { type: 'none', value: '' };\n }\n\n const isEmpty = isCellEmpty(node.data, field);\n const isGroup = node.group || node.leafGroup;\n const isAutoGroup = column?.autoGroupField;\n\n if (column && column.cellRenderer && !isGroup) {\n\n // The renderer used to be handed `{ node, columnDef }` and nothing else,\n // so the obvious way to write one — `params.value` — produced the string\n // \"undefined\", and `params.data.x` threw. It now gets exactly what every\n // other row-scoped hook gets.\n return { type: 'html', value: column.cellRenderer(this.cellParams(column, node)) }\n }\n\n // 1. Cell Group Placeholder\n if (isEmpty && isGroup && isAutoGroup) {\n\n return { type: 'placeholder', value: this.resolvePlaceholder(node, column) ?? resolveCellValueGetter(node.data, node, column, this._context) ?? '' };\n }\n\n // 2. Cell Group Text Value\n if (isGroup && isAutoGroup) {\n\n const value = this.formatValue(node, column, this.resolveValue(node, column));\n\n return { type: 'text', value: value ?? '' };\n }\n\n // 3. Cell Placeholder\n //\n // The auto group column is deliberately NOT excluded here. Cases 1 and 2\n // above already claimed the group rows, so what reaches this point is a\n // leaf — and a leaf on the auto group column has to render its label too,\n // indented by level. Excluding it dropped every leaf through to case 5 and\n // rendered the group column blank for the whole bottom row of a tree.\n if (isEmpty && !isGroup) {\n\n const valueGetter = resolveCellValueGetter(node.data, node, column, this._context);\n\n if (valueGetter) {\n\n return { type: 'text', value: this.formatValue(node, column, valueGetter) };\n }\n\n const placeholder = this.resolvePlaceholder(node, column) ?? '';\n\n return { type: 'placeholder', value: placeholder };\n }\n\n // 4. Cell Text Value (leaves, including the auto group column — see above)\n if (!isGroup) {\n\n const value = this.formatValue(node, column, this.resolveValue(node, column));\n\n return { type: 'text', value: value ?? '' };\n }\n\n // 5. A group row outside the group column: render the value when the row\n // actually carries one — aggregates land in these cells, and a tree\n // parent's own data belongs on screen too. Blank stays blank.\n if (!isEmpty) {\n\n const value = this.formatValue(node, column, this.resolveValue(node, column));\n\n return { type: 'text', value: value ?? '' };\n }\n\n // 6. Default\n return { type: 'none', value: '' };\n }\n\n // ---------------------------------------------------------------------------\n // Row-scoped column predicates\n //\n // Every one of these resolves the same way and receives the same params, via\n // `cellParams`. They used to each build their own subset inline, which is how\n // `value`, `field` and `api` came to be missing from all of them.\n // ---------------------------------------------------------------------------\n\n /** Whether this cell may be edited at all. A capability: unset means no. */\n public editableFn = (column: OneColumnDef, node: OneRowNode): boolean =>\n resolveOneCellRendererParams(column?.editable, this.cellParams(column, node));\n\n /**\n * The second edit gate, ANDed with `editable`.\n *\n * A restriction, so unset means \"no restriction\". It used to resolve through\n * `!!undefined` to `false`, closing the gate on every column that did not name\n * it — so `editable: true` on its own made nothing editable.\n */\n public updatableFn = (column: OneColumnDef, node: OneRowNode): boolean =>\n resolveOneCellRendererParams(column?.updatable, this.cellParams(column, node), true);\n\n /** Disables this column's row action buttons. Not an edit gate. */\n public disableFn = (column: OneColumnDef, node: OneRowNode): boolean =>\n resolveOneCellRendererParams(column?.disable, this.cellParams(column, node));\n\n /** Hides this column's row action buttons entirely. */\n public hideActionButtonFn = (column: OneColumnDef, node: OneRowNode): boolean =>\n resolveOneCellRendererParams(column?.hideActionButton, this.cellParams(column, node));\n\n /** Whether this cell carries a row drag handle. */\n public rowDragFn = (column: OneColumnDef, node: OneRowNode): boolean =>\n resolveOneCellRendererParams(column?.rowDrag, this.cellParams(column, node));\n\n public valueGetterFn = (column: OneColumnDef, node: OneRowNode) =>\n resolveOneValueGetterParams(column?.valueGetter, { data: node.data, rowIndex: node.rowIndex, node, context: this._context });\n}\n","import { Injectable, OnDestroy } from '@angular/core';\nimport { Subject, Observable, Subscription } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\nimport { EventPayloadMap, EventType } from '../models/one-event-types.model';\n\n@Injectable()\nexport class OneGridEventService implements OnDestroy {\n\n private events$ = new Subject<{ type: EventType; payload: any }>();\n private subscriptions: Subscription[] = [];\n\n // Dispatch event\n dispatchEvent<K extends EventType>(type: K, payload: EventPayloadMap[K]): void {\n\n this.events$.next({ type, payload });\n }\n\n // Subscribe to event\n addEventListener<K extends EventType>(type: K, handler: (payload: EventPayloadMap[K]) => void): () => void {\n\n const subscription = this.events$\n .pipe(filter(e => e.type === type), map(e => e.payload as EventPayloadMap[K]))\n .subscribe(handler);\n\n // Track subscription for bulk cleanup\n this.subscriptions.push(subscription);\n\n // Return an unsubscribe function\n return () => subscription.unsubscribe();\n }\n\n // RxJS API\n eventStream<K extends EventType>(type: K): Observable<EventPayloadMap[K]> {\n\n return this.events$.pipe(filter(e => e.type === type), map(e => e.payload as EventPayloadMap[K]));\n }\n\n /**\n * Clear All Subscriptions\n */\n ngOnDestroy(): void {\n\n this.subscriptions.forEach(sub => sub.unsubscribe());\n\n this.subscriptions = [];\n\n this.events$.complete();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { OneCheckboxState, RowSelectionMode } from '../models/one-event-types.model';\n\n@Injectable()\nexport class OneGridSelectionService {\n\n private _selectedIds = new Set<string>();\n private _selectionMode: RowSelectionMode = null;\n\n public getSelectedIds(): Set<string> {\n\n return this._selectedIds;\n }\n\n public setSelectedIds(rowIds: string[]) {\n\n this._selectedIds = new Set(rowIds);\n }\n\n public getSelectionMode(): RowSelectionMode {\n\n return this._selectionMode;\n }\n\n public setSelectionMode(mode: RowSelectionMode) {\n\n this._selectionMode = mode;\n\n if (mode === 'single' && this._selectedIds.size > 1) {\n\n // keep only one if mode is single\n const first = this._selectedIds.values().next().value;\n\n this._selectedIds = new Set([first]);\n }\n }\n\n public toggleSelection(rowId: string, selected: boolean) {\n\n if (this._selectionMode === 'single') {\n\n this._selectedIds.clear();\n }\n\n selected ? this._selectedIds.add(rowId) : this._selectedIds.delete(rowId);\n }\n\n public toggleAllSelection(allIds: string[], selected: boolean) {\n\n selected ? this._selectedIds = new Set(allIds) : this._selectedIds.clear();\n }\n\n /**\n * Tri-state for the header checkbox, over the rows currently present.\n *\n * This compared `_selectedIds.size` with `allIds.length` and never checked\n * that the selected ids were among the present ones. Selecting two rows and\n * then swapping in two different rows reported `checked` with nothing\n * actually selected, because the two counts happened to match. Counting the\n * intersection is the only thing that answers the question being asked.\n */\n public getSelectAllState(allIds: (string)[]): OneCheckboxState {\n\n if (!allIds?.length) return 'unchecked';\n\n let selected = 0;\n\n for (const rowId of allIds) {\n\n if (this._selectedIds.has(rowId)) selected++;\n }\n\n if (selected === 0) return 'unchecked';\n\n return selected === allIds.length ? 'checked' : 'indeterminate';\n }\n\n public selectAll(rowIds: string[]): void {\n\n this._selectedIds = new Set(rowIds);\n }\n\n public deselectAll(): void {\n\n this._selectedIds.clear();\n }\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable()\nexport class OneGridExpansionService {\n\n private _expandedIds = new Set<string>();\n private _collapsedIds = new Set<string>();\n\n getExpandedIds(): Set<string> {\n\n return this._expandedIds;\n }\n\n getCollapsedIds(): Set<string> {\n\n return this._collapsedIds;\n }\n\n toggleExpanded(rowId: string, expanded: boolean): void {\n\n if (expanded) {\n\n this._expandedIds.add(rowId);\n\n this._collapsedIds.delete(rowId);\n\n } else {\n\n this._expandedIds.delete(rowId);\n\n this._collapsedIds.add(rowId);\n }\n }\n\n isExpanded(rowId: string): boolean {\n\n return this._expandedIds.has(rowId);\n }\n\n isCollapsed(rowId: string): boolean {\n\n return this._collapsedIds.has(rowId);\n }\n\n clear(): void {\n\n this._expandedIds.clear();\n\n this._collapsedIds.clear();\n }\n}\n","import { OneCellRendererComponent } from '../models/one-tree-data.model';\nimport { OneColumnDef, OneColumnStateEntry } from '../models/one-column-def-types.model';\nimport { OneRowNode } from \"./one-row-node.class\";\nimport { OneGridInitOptions, OneGridType, OneRowTransaction, OneSortModel } from '../models/one-grid-types.model';\nimport { OneGridEventService } from '../services/one-grid-event.service';\nimport { OneGridSelectionService } from '../services/one-grid-selection.service';\nimport { OneRowValidationErrors, OneValidationResult } from '../models/one-validation.model';\nimport { OneFilterModel } from \"../models/one-filter.model\";\nimport { OneGridExpansionService } from '../services/one-grid-expansion.service';\nimport { OneDetailCellRendererParams, OneGetDetailRowDataParams } from \"../models/one-master-detail.model\";\nimport { OneGridRowService } from \"../services/one-grid-row.service\";\nimport { filterTreeNode, isFilterActive } from \"../../helpers/one-filter.helper\";\nimport { buildCsv, OneCsvExportOptions } from \"../../helpers/one-csv.helper\";\nimport { aggColumns, buildGroupedRows, OneAggColumn, ONE_GROUP_CHILDREN_FIELD, ONE_GROUP_ID_FIELD } from \"../../helpers/one-row-grouping.helper\";\nimport { OneRowDragSuppressedReason } from \"../models/one-row-drag.model\";\nimport { getFieldValue } from \"../../helpers/one-cell.helper\";\nimport { OneGridCellService } from '../services/one-grid-cell.service';\nimport { v4 as uuidv4 } from 'uuid';\nimport { Injectable, Type } from \"@angular/core\";\nimport { CellValueChangedEvent, ColumnChangedEvent, OnePinnedRowSide, RowSelectionMode } from \"../models/one-event-types.model\";\nimport { OneGroupColumnDef } from \"../models/one-column-def-types.model\";\nimport { OgColumnService } from \"../services/og-column.service\";\n\n@Injectable()\nexport class OneGridApi<T = any> {\n\n // ---------------------------------------------------------------------------\n // Public state\n //\n // Exposed as getters, not fields. These were writable, so a consumer could\n // corrupt the grid by assigning to them — swapping `rowNodes` for an\n // unrelated array, or setting `sortModel` without the rows ever being\n // re-sorted. Reads are unchanged; only assignment is now a compile error.\n //\n // The array-valued ones are typed `readonly T[]`, which stops `push` and\n // `splice` at compile time without copying on every read. Use\n // `getAllRowNodes()` when you want a copy you own.\n // ---------------------------------------------------------------------------\n private _id: string;\n private _context: any = null;\n private _rowSelection: RowSelectionMode = null;\n private _apiType: OneGridType = null;\n private _rowNodes: OneRowNode<T>[] = [];\n private _sortModel: OneSortModel<T>[] = [];\n\n /** Unique per grid instance, assigned during `init`. */\n public get id(): string {\n return this._id;\n }\n\n /** The `[context]` the grid was given. */\n public get context(): any {\n return this._context;\n }\n\n /** Selection mode, captured during `init`. Changing the input later has no effect. */\n public get rowSelection(): RowSelectionMode {\n return this._rowSelection;\n }\n\n /** Which role this instance plays: simple, master, detail or tree. */\n public get apiType(): OneGridType {\n return this._apiType;\n }\n\n /** Every node the grid holds, in flattened order. */\n public get rowNodes(): readonly OneRowNode<T>[] {\n return this._rowNodes;\n }\n\n /** The sort model currently applied. Change it with `onSortChanged`. */\n public get sortModel(): readonly OneSortModel<T>[] {\n return this._sortModel;\n }\n\n\n private rowHeight: number = 26;\n private headerRowHeight: number = 32;\n private _currentIndex: number = 0;\n private _quickFilterValue: string = null;\n private _activeFilters: OneFilterModel[] = [];\n\n private _visibleRowNodes: OneRowNode<T>[] = [];\n\n /**\n * The rows as the host last handed them over — before grouping folded\n * them. Grouping is a transform on the way in, so this is what a change of\n * grouping re-folds, and it is why regrouping keeps the host's row order\n * instead of inheriting the order the previous grouping happened to leave.\n */\n private _sourceRows: T[] = [];\n private readonly _pinnedRowNodes: Record<OnePinnedRowSide, OneRowNode<T>[]> = { top: [], bottom: [] };\n private _originalRowNodes: Map<string, OneRowNode<T>> = new Map();\n private _nodeCleanupMap = new Map<string, Array<() => void>>(); // Cleanup registry (prevents memory leaks)\n private _destroyed: boolean = false;\n\n // Advanced Features\n private treeData: boolean = false;\n\n /**\n * Whether the *host* declared tree data, as opposed to grouping having\n * turned tree mode on. `treeData` above answers \"is this a tree right now\",\n * which grouping flips; this answers \"whose tree is it\", which decides\n * whether grouping may touch it at all.\n */\n private _hostTreeData: boolean = false;\n private treeDataChildrenField: string = null;\n private groupDefaultExpanded: number = 0;\n\n private masterDetail: boolean = false;\n private detailCellRendererParams: OneDetailCellRendererParams;\n private detailRendererComponent?: Type<OneCellRendererComponent>;\n\n /**\n * Supplies a master row's detail rows. Set through `setGetDetailRowData`;\n * previously a writable public field with a setter beside it, which left two\n * ways to do the same thing and one of them unchecked.\n */\n private _getDetailRowData: (params: OneGetDetailRowDataParams) => void;\n\n constructor(\n private columnService: OgColumnService,\n private rowService: OneGridRowService,\n private cellService: OneGridCellService,\n private eventService: OneGridEventService,\n private selectionService: OneGridSelectionService,\n private expansionService: OneGridExpansionService\n ) { }\n\n /**\n * Stand the grid up. Called by `OneGridComponent` from `ngOnInit`.\n *\n * Takes a single `OneGridInitOptions` rather than the ten positional\n * arguments it used to, so a call site reads as the configuration it is and\n * a new option no longer means editing every caller.\n *\n * @internal Applications obtain a ready-made API from `(onGridReady)`; they\n * should never call this themselves.\n */\n init(options: OneGridInitOptions<T>): void {\n\n const {\n gridType,\n columnDefs,\n defaultColumnDef = {},\n groupColumnDefs = [],\n context = null,\n rowSelection = null,\n masterDetail = false,\n detailCellRendererParams = null,\n detailRendererComponent = null,\n treeData = false,\n } = options;\n\n this._id = uuidv4();\n this._apiType = gridType;\n this._rowSelection = rowSelection;\n this._context = context;\n this.masterDetail = masterDetail;\n this.detailCellRendererParams = detailCellRendererParams;\n this.detailRendererComponent = detailRendererComponent;\n this.treeData = treeData;\n this._hostTreeData = treeData;\n\n this.selectionService.setSelectionMode(rowSelection);\n\n // Synthetic group rows carry their own stable id — the path of group\n // values — which no host getRowId knows how to derive. The wrapper reads\n // it first and defers to the host's function (or the uuid fallback) for\n // real rows, so grouping keeps expansion across rebuilds even when the\n // host provided no id function at all.\n const hostGetRowId = context?.componentParent?.getRowId ?? null;\n\n this.rowService.setGetRowIdFn((params: { data: any; rowIndex: number }) =>\n params?.data?.[ONE_GROUP_ID_FIELD] ?? hostGetRowId?.(params) ?? null);\n\n this.cellService.applyColumnDefs(columnDefs, context);\n this.cellService.setGridApi(this);\n this.columnService.initColumnDefs(defaultColumnDef, columnDefs, groupColumnDefs, context);\n\n const columnState = this.columnService.getColumnState();\n\n setTimeout(() => this.eventService.dispatchEvent('columnChanged', columnState as ColumnChangedEvent));\n }\n\n /**\n * Replace every row, discarding selection and expansion.\n *\n * Use this when the rows represent something new. To swap the data while\n * keeping what the user has selected and opened, use `updateRowData`.\n */\n public setRowData(rowData: T[]) {\n\n this.rebuildRows(rowData, true);\n }\n\n /**\n * Replace every row, keeping selection and expansion.\n *\n * State is keyed by row id, so this only preserves anything if the grid has a\n * `context.componentParent.getRowId` — otherwise each rebuild mints new ids\n * and there is nothing left to match against.\n */\n public updateRowData(rowData: T[]) {\n\n this.rebuildRows(rowData, false);\n }\n\n /**\n * Apply a batch of row changes without the host rebinding the dataset:\n * append rows (at the root, or under a parent by id on tree data), replace\n * rows by id, drop rows at any depth. Selection and expansion survive —\n * this is `updateRowData` fed from the grid's own current rows, so the\n * host keeps no parallel copy to reconcile.\n *\n * Requires a stable `context.componentParent.getRowId`: rows are matched by\n * id, and without an id function there is nothing to match on — the\n * transaction is refused with a warning rather than half-applied.\n */\n public applyTransaction(transaction: OneRowTransaction<T>): void {\n\n if (this._destroyed || !transaction) return;\n\n const sample = transaction.update?.[0] ?? transaction.add?.[0]\n ?? (transaction.remove ?? []).find(entry => typeof entry !== 'string');\n\n if (sample !== undefined && this.rowService.resolveRowId(sample) === null) {\n\n console.warn('[one-grid] applyTransaction needs context.componentParent.getRowId — rows are matched by id. Nothing was applied.');\n\n return;\n }\n\n const removeIds = new Set(\n (transaction.remove ?? []).map(entry =>\n typeof entry === 'string' ? entry : this.rowService.resolveRowId(entry)),\n );\n\n const updates = new Map(\n (transaction.update ?? []).map(data => [this.rowService.resolveRowId(data), data]),\n );\n\n const childrenField = this.treeDataChildrenField;\n\n // Row grouping folds flat rows itself, so the transaction operates on the\n // leaves and re-groups; a parent target would name a synthetic group row,\n // which is not a place data can live.\n const grouping = this._rowGroupFields.length > 0;\n const addToParentId = grouping ? undefined : transaction.addToParentId;\n\n if (grouping && transaction.addToParentId) {\n\n console.warn('[one-grid] applyTransaction: addToParentId is ignored under row grouping — groups are synthetic. Rows were added at the root.');\n }\n\n // Copy-on-write over the grid's own current rows: the node graph carries\n // the data, so the host's original arrays are never mutated and untouched\n // branches keep their object identity for the node-reuse path.\n const applyTo = (rows: T[]): T[] => rows\n .filter(data => !removeIds.has(this.rowService.resolveRowId(data)))\n .map(data => {\n\n const id = this.rowService.resolveRowId(data);\n\n let next = updates.get(id) ?? data;\n\n if (this.treeData && childrenField) {\n\n const children = (next as Record<string, unknown>)[childrenField] as T[] | undefined;\n const rebuilt = children ? applyTo(children) : undefined;\n\n const withAdded = id != null && id === addToParentId\n ? [...(rebuilt ?? []), ...(transaction.add ?? [])]\n : rebuilt;\n\n if (withAdded !== children) next = { ...next, [childrenField]: withAdded ?? [] };\n }\n\n return next;\n });\n\n // Grouped roots are synthetic, so the data is on the leaves; otherwise the\n // roots are the data. Read from the nodes rather than from `_sourceRows`\n // so a reorder the user dragged into place survives the transaction.\n const currentRows = grouping\n ? this._rowNodes.filter(node => node.leaf).map(node => node.data)\n : this._rowNodes.filter(node => !node.parent).map(node => node.data);\n\n let roots = applyTo(currentRows);\n\n if (transaction.add?.length && !addToParentId) {\n\n roots = [...roots, ...transaction.add];\n }\n\n this.rebuildRows(roots, false);\n }\n\n /**\n * The one row-loading path. `setRowData` and `updateRowData` differed only in\n * whether they cleared the state services first, so everything else — build,\n * filter, prune — lives here once.\n */\n private rebuildRows(rowData: T[], resetState: boolean): void {\n\n if (this._destroyed) return;\n\n if (resetState) {\n\n this.selectionService.deselectAll();\n this.expansionService.clear();\n }\n\n this._sourceRows = rowData ?? [];\n\n // Row grouping is a transform on the way in: the host keeps handing the\n // grid flat rows, and the tree pipeline below sees synthetic group rows\n // with children — the same shape tree data arrives in.\n if (this._rowGroupFields.length) {\n\n rowData = buildGroupedRows(rowData, this._rowGroupFields, this._aggColumns) as T[];\n }\n\n const validRowIds = new Set<string>();\n\n this.buildRowNodes(rowData, null, 0, validRowIds);\n\n // Prune BEFORE sorting and filtering: both read `_originalRowNodes`, and\n // with the prune last, a data swap while a sort was active resurrected\n // the removed rows into `_rowNodes` for one whole render — the old and\n // the new dataset on screen together until the next rebuild.\n this.pruneRemovedNodes(validRowIds);\n\n // Re-apply the active sort. `buildRowNodes` rebuilds the row list in the\n // order the data arrived, so without this a data update silently returned\n // the rows to that order while `sortModel` — and therefore the header's\n // sort arrow — still said they were sorted. Sorting before filtering\n // because filtering only sets visibility on whatever order this leaves.\n if (this._sortModel.length > 0) this.applySorting();\n\n this.applyFilters();\n }\n\n /**\n * Recursive Build Row Nodes (Optimized)\n */\n private buildRowNodes(\n rowData: T[],\n parent: OneRowNode<T> | null = null,\n level: number = 0,\n validRowIds: Set<string> = new Set(),\n expandedIds: Set<string> = new Set(this.expansionService.getExpandedIds()),\n collapsedIds: Set<string> = new Set(this.expansionService.getCollapsedIds()),\n selectedIds: Set<string> = new Set(this.selectionService.getSelectedIds()),\n visitedData: Set<unknown> = new Set()\n ): OneRowNode[] {\n\n if (parent === null) {\n\n this._rowNodes = [];\n this._currentIndex = 0;\n }\n\n if (!rowData?.length) return [];\n\n const nodes: OneRowNode<T>[] = [];\n\n for (const data of rowData) {\n\n const rowId = this.rowService.generateRowId(data, this._currentIndex);\n\n // A cycle in the children graph — a row reachable from its own subtree,\n // the classic ORM back-reference — used to recurse until the stack blew,\n // freezing the app; and with generated row ids it did so while minting\n // nodes the whole way down. The same guard also drops a duplicate row id\n // (or the same row object appearing twice): first occurrence wins.\n if (visitedData.has(data) || validRowIds.has(rowId)) {\n\n console.warn(`[one-grid] cyclic or duplicate row (id \"${rowId}\") — skipped, first occurrence wins. Tree data must be acyclic and row ids unique.`);\n\n continue;\n }\n\n visitedData.add(data);\n\n const children = (data as any)[this.treeDataChildrenField] || null;\n\n let node: OneRowNode = this._originalRowNodes.get(rowId);\n\n validRowIds.add(rowId);\n\n if (node) {\n\n node.data = data;\n node.setRowIndex(this._currentIndex);\n\n // Where a row sits is rebuilt, not remembered. A reused node used to\n // keep the level and parent it had when it was first built, so a row\n // that changed place in the hierarchy — a leaf moved to another\n // parent, or lifted to the root when the grouping changed — kept\n // pointing at its old parent, and the visibility walk (which climbs\n // parents) hid it behind a node that was no longer above it.\n node.level = level;\n node.parent = parent;\n\n } else {\n\n node = new OneRowNode<T>(rowId, data, this._currentIndex);\n node.level = level;\n node.parent = parent;\n node.detailRendererComponent = this.detailRendererComponent;\n\n this._originalRowNodes.set(rowId, node);\n\n if (this.masterDetail) {\n\n this.subscribeToDetailChanges(node);\n }\n }\n\n const childrenExist = children && children.length >= 0;\n\n // Coerced, because `childrenExist` is `children && children.length >= 0`\n // — which is `null` for a row with no children field, not `false`. These\n // are declared `boolean`, and assigning null made every consumer compare\n // truthiness instead of the value.\n node.group = this.masterDetail ? false : !!childrenExist;\n node.leaf = this.masterDetail ? true : !node.group;\n node.leafGroup = this.masterDetail ? false : (node.group && !childrenExist);\n node.expandable = this.masterDetail ? true : (node.group && !node.leafGroup);\n\n const defaultExpanded = node.expandable && (level < this.groupDefaultExpanded || this.groupDefaultExpanded === -1);\n\n node.setExpanded(expandedIds.has(rowId) ? true : collapsedIds.has(rowId) ? false : defaultExpanded);\n node.setSelected(selectedIds.has(rowId));\n node.setCellStates(this.cellService.generateCellStates(node));\n\n if (this.masterDetail && this._apiType === 'master') {\n\n this._getDetailRowData({ data, node: node, successCallback: (detailRowData) => node.setDetailRowData(detailRowData) });\n }\n\n this._currentIndex++;\n this._rowNodes.push(node);\n\n nodes.push(node);\n\n node.children = this.treeData && childrenExist ? this.buildRowNodes(children || [], node, level + 1, validRowIds, expandedIds, collapsedIds, selectedIds, visitedData) : [];\n }\n\n return nodes;\n }\n\n /**\n * Filter Feature\n */\n private applyFilters(): void {\n\n const filters = this._activeFilters;\n\n const quick = this._quickFilterValue?.toLowerCase() ?? '';\n\n // The fields the grid actually shows. Without them the quick filter falls\n // back to every property on the row, which lets a user match on data that\n // has no column and never appears on screen.\n const fields = this.quickFilterFields();\n\n this._rowNodes.forEach(node => filterTreeNode(node, filters, quick, fields));\n\n this.refreshVisibleNodes();\n }\n\n /**\n * Which fields the quick filter searches: every column that has one.\n *\n * Empty while the columns are still being registered, in which case the\n * helper falls back to searching the row — the same behaviour as before, and\n * the only sensible answer when the grid does not yet know its columns.\n */\n private quickFilterFields(): string[] {\n\n return this.columnService\n .getColumnState()\n .columns\n .map(column => column.field as string)\n .filter((field): field is string => !!field && field !== '_oneRowNumber');\n }\n\n /**\n * Update Row Nodes Display\n */\n private refreshVisibleNodes(dispatch: boolean = true): void {\n\n if (this._destroyed) return;\n\n const visibleNodes: OneRowNode[] = [];\n\n let rowNumber = 1;\n\n const visibilityCache = new Map<string, boolean>();\n\n for (const node of this._rowNodes) {\n\n const parentVisible = node.parent ? visibilityCache.get(node.parent.rowId) : true;\n\n const isVisible = node.visible && parentVisible && (!node.parent || node.parent.expanded);\n\n visibilityCache.set(node.rowId, isVisible);\n\n if (isVisible) {\n\n node.cellStates['_oneRowNumber'] = { type: 'text', value: rowNumber++ };\n\n node.cellStates = { ...node.cellStates };\n\n visibleNodes.push(node);\n\n } else {\n\n node.cellStates['_oneRowNumber'] = { type: 'none', value: null };\n }\n }\n\n this._visibleRowNodes = [...visibleNodes];\n\n if (dispatch) this.eventService.dispatchEvent('rowDataChanged', { nodes: visibleNodes });\n }\n\n /**\n * Replace the rows anchored to one edge of the grid.\n *\n * Pinned rows are deliberately kept out of `rowNodes` and\n * `_originalRowNodes`: they are not data. Sorting, filtering, selection,\n * expansion, pagination and the visible row count all ignore them, which is\n * the whole point of a summary row. They render with the same column\n * definitions, so renderers and value getters work as they do everywhere\n * else.\n */\n public setPinnedRowData(side: OnePinnedRowSide, rowData: T[]): void {\n\n if (this._destroyed) return;\n\n for (const node of this._pinnedRowNodes[side]) node.destroy();\n\n this._pinnedRowNodes[side] = (rowData ?? []).map((data, index) => {\n\n // Ids are namespaced by side and position. They never collide with a data\n // row's id, and they are stable across rebuilds, which keeps the rendered\n // `data-cell-id` attributes stable too.\n const node = new OneRowNode<T>(`one-pinned-${side}-${index}`, data, index);\n\n node.level = 0;\n node.leaf = true;\n node.visible = true;\n node.setCellStates(this.cellService.generateCellStates(node));\n\n return node;\n });\n\n this.eventService.dispatchEvent('pinnedRowDataChanged', {\n side,\n nodes: this._pinnedRowNodes[side],\n });\n }\n\n /** The rows anchored to one edge. Read-only; change them with `setPinnedRowData`. */\n public getPinnedRowNodes(side: OnePinnedRowSide): readonly OneRowNode<T>[] {\n\n return this._pinnedRowNodes[side];\n }\n\n /**\n * Row reordering\n * --------------------------------------------------------------------------\n *\n * `_originalRowNodes` is the source of truth for row order: its insertion\n * order is what `applySorting` falls back to when the sort model empties, and\n * what a rebuild walks. `_rowNodes` is only the current display order. A move\n * that touched one and not the other would either be undone by the next sort\n * change or invisible until one happened, so both are rewritten together.\n */\n\n /**\n * Whether the displayed order is the data order, and so whether a manual move\n * would survive.\n *\n * @returns the reason reordering is unavailable, or `null` when it is fine.\n */\n public getRowDragSuppressedReason(): OneRowDragSuppressedReason | null {\n\n if (this.treeData) return 'treeData';\n\n if (this._sortModel.length > 0) return 'sorted';\n\n if (isFilterActive(this._activeFilters, this._quickFilterValue ?? '')) return 'filtered';\n\n return null;\n }\n\n /** Convenience inverse of {@link getRowDragSuppressedReason}. */\n public canReorderRows(): boolean {\n\n return this.getRowDragSuppressedReason() === null;\n }\n\n /**\n * Move a row from one position to another.\n *\n * Indices are positions in the grid's row order, the same order\n * `getAllRowNodes()` returns. `targetIndex` is where the row ends up *after*\n * it has been lifted out of `sourceIndex` — dragging row 0 to the bottom of a\n * 5-row grid is `moveRow(0, 4)`, not `moveRow(0, 5)`.\n *\n * @returns `true` if the rows moved. `false` when the move was rejected —\n * out-of-range indices, a no-op, or an order the grid does not own\n * (see {@link getRowDragSuppressedReason}) — so a caller can tell a\n * refused move from an applied one.\n */\n public moveRow(sourceIndex: number, targetIndex: number): boolean {\n\n if (this._destroyed) return false;\n\n if (!this.canReorderRows()) return false;\n\n const order = [...this._originalRowNodes.values()];\n\n if (!Number.isInteger(sourceIndex) || !Number.isInteger(targetIndex)) return false;\n\n if (sourceIndex < 0 || sourceIndex >= order.length) return false;\n\n if (targetIndex < 0 || targetIndex >= order.length) return false;\n\n if (sourceIndex === targetIndex) return false;\n\n const [moved] = order.splice(sourceIndex, 1);\n\n order.splice(targetIndex, 0, moved);\n\n // Rebuilt rather than mutated: a Map preserves insertion order, and there\n // is no way to reposition a key within one.\n this._originalRowNodes = new Map(order.map(node => [node.rowId, node]));\n\n this._rowNodes = order;\n\n this.reindexRows();\n\n this.eventService.dispatchEvent('rowOrderChanged', { nodes: this._visibleRowNodes as OneRowNode<T>[], node: moved, fromIndex: sourceIndex, toIndex: targetIndex });\n\n return true;\n }\n\n /**\n * Move a row identified by id. Convenient when the caller holds a node rather\n * than a position — the index it was built with goes stale after any move.\n */\n public moveRowById(rowId: string, targetIndex: number): boolean {\n\n const sourceIndex = [...this._originalRowNodes.values()].findIndex(node => node.rowId === rowId);\n\n return sourceIndex === -1 ? false : this.moveRow(sourceIndex, targetIndex);\n }\n\n /**\n * Re-stamp `rowIndex` from the current order.\n *\n * Row index is denormalised onto every node, and half the grid reads it —\n * cell params, the range selection, the detail lookup. Leaving it stale after\n * a move puts every row below the drop point one out.\n */\n private reindexRows(): void {\n\n this._rowNodes.forEach((node, index) => node.setRowIndex(index));\n\n // Silent: row numbers and the visible list have to be rebuilt, but the\n // `rowDataChanged` that normally follows defers a frame and re-seeds detail\n // rows. A keyboard drag fires one of these per arrow key, and `moveRow`\n // announces itself through `rowOrderChanged` instead.\n this.refreshVisibleNodes(false);\n }\n\n public getVisibleRowNodes(): OneRowNode<T>[] {\n\n return this._visibleRowNodes;\n }\n\n /**\n * Sorting Model Feature\n */\n public onSortChanged(sortModel: OneSortModel<T>[]) {\n\n if (this._destroyed) return;\n\n this._sortModel = sortModel;\n\n this.applySorting();\n\n this.eventService.dispatchEvent('sortChanged', { nodes: this._rowNodes, sortModel: this._sortModel });\n }\n\n private applySorting(): void {\n\n if (this._sortModel.length === 0) {\n\n this._rowNodes = [...this._originalRowNodes.values()];\n\n return;\n }\n\n const comparator = (a: OneRowNode<T>, b: OneRowNode<T>): number => {\n\n for (const sortItem of this._sortModel) {\n\n const { colId, sort } = sortItem;\n const valA = getFieldValue(a.data, colId as string);\n const valB = getFieldValue(b.data, colId as string);\n const comparisonResult = this.compareValues(valA, valB, sort);\n\n if (comparisonResult !== 0) {\n\n return comparisonResult;\n }\n }\n return 0;\n };\n\n if (!this.treeData) {\n\n this._rowNodes = [...this._originalRowNodes.values()].sort(comparator);\n\n return;\n }\n\n // A tree sorts siblings within their parent, never across it — a flat\n // sort of the whole list interleaved parents with other parents' children\n // and scrambled the hierarchy. Sorting the sibling arrays and re-walking\n // depth-first keeps every parent immediately above its own children,\n // which `refreshVisibleNodes` also depends on for its visibility cache.\n // Group rows carry their aggregates in `data`, so sorting a grouped grid\n // on an aggregated column orders the groups by their aggregate.\n const flattened: OneRowNode<T>[] = [];\n\n const walk = (siblings: OneRowNode<T>[]): OneRowNode<T>[] => {\n\n const sorted = [...siblings].sort(comparator);\n\n for (const node of sorted) {\n\n flattened.push(node);\n\n if (node.children?.length) {\n\n node.children = walk(node.children as OneRowNode<T>[]);\n }\n }\n\n return sorted;\n };\n\n walk([...this._originalRowNodes.values()].filter(node => !node.parent));\n\n this._rowNodes = flattened;\n }\n\n private compareValues(valA: any, valB: any, sortDirection: 'asc' | 'desc'): number {\n\n // `undefined` has to be treated as empty alongside `null`: getFieldValue\n // returns undefined for a missing field or an unresolved dotted path, and\n // comparing undefined with < / > yields false both ways, which made such\n // rows settle in whatever order the sort happened to encounter them.\n const aEmpty = valA === null || valA === undefined;\n const bEmpty = valB === null || valB === undefined;\n\n if (aEmpty && bEmpty) return 0;\n if (aEmpty) return sortDirection === 'asc' ? 1 : -1;\n if (bEmpty) return sortDirection === 'asc' ? -1 : 1;\n\n if (typeof valA === 'string' && typeof valB === 'string') {\n\n const comparison = valA.localeCompare(valB, undefined, { numeric: true });\n return sortDirection === 'asc' ? comparison : -comparison;\n }\n\n if (valA < valB) return sortDirection === 'asc' ? -1 : 1;\n if (valA > valB) return sortDirection === 'asc' ? 1 : -1;\n return 0;\n }\n\n /**\n * Row Selection Feature (Optimized)\n */\n public selectAll(): void {\n\n const rowIds: string[] = [];\n\n this._originalRowNodes.forEach(node => {\n\n node.setSelected(true);\n\n node.cellStates = { ...node.cellStates };\n\n rowIds.push(node.rowId);\n });\n\n this.selectionService.selectAll(rowIds);\n\n this.eventService.dispatchEvent('selectionChanged', { allNodesNotSelected: false, allNodesSelected: true, selected: true, node: null });\n }\n\n /**\n * Deselect all nodes (optimized)\n */\n public deselectAll(): void {\n\n this._originalRowNodes.forEach(node => {\n\n node.setSelected(false);\n\n node.cellStates = { ...node.cellStates };\n });\n\n this.selectionService.deselectAll();\n\n if (this.selectionService.getSelectionMode() === 'multiple') {\n\n this.eventService.dispatchEvent('selectionChanged', {\n allNodesNotSelected: true,\n allNodesSelected: false,\n selected: false,\n node: null\n });\n }\n }\n\n /**\n * Select or deselect one row, honouring the grid's selection mode.\n *\n * The mode rule used to live in the checkbox component, which meant the only\n * way to select a row was to click that checkbox — anything else reaching for\n * `toggleSelection` got multi-select behaviour on a single-select grid. It\n * lives here so every path into selection obeys the same rule.\n *\n * @returns `false` when the grid has no selection mode, so a caller can tell\n * a refused request from an applied one.\n */\n public toggleRowSelection(rowId: string, selected: boolean): boolean {\n\n if (this._destroyed || !this._rowSelection) return false;\n\n const node = this.getRowNodeById(rowId);\n\n if (!node) return false;\n\n // Single select is \"this row and no other\", which means clearing first.\n if (this._rowSelection === 'single') this.deselectAll();\n\n this.toggleSelection(rowId, selected);\n\n node.cellStates = { ...node.cellStates };\n\n return true;\n }\n\n /**\n * Select every row between two, inclusive, in display order.\n *\n * What a shift-extended keyboard selection needs. Multi-select only — a\n * single-select grid has no meaningful range.\n */\n public selectRowRange(fromRowId: string, toRowId: string): boolean {\n\n if (this._destroyed || this._rowSelection !== 'multiple') return false;\n\n const order = this._visibleRowNodes.length ? this._visibleRowNodes : this._rowNodes;\n\n const from = order.findIndex(node => node.rowId === fromRowId);\n const to = order.findIndex(node => node.rowId === toRowId);\n\n if (from === -1 || to === -1) return false;\n\n const ids = order\n .slice(Math.min(from, to), Math.max(from, to) + 1)\n .map(node => node.rowId);\n\n this.setSelectedByIds(ids, true);\n\n return true;\n }\n\n public toggleSelection(rowId: string, selected: boolean): void {\n\n const node = this.getRowNodeById(rowId);\n\n if (node) {\n\n node.setSelected(selected);\n\n this.selectionService.toggleSelection(rowId, selected);\n\n this.eventService.dispatchEvent('selectionChanged', { node, data: node.data, selected });\n }\n }\n\n public setSelectedById(rowId: string) {\n\n const node = this.getRowNodeById(rowId);\n\n if (node) {\n\n if (this.selectionService.getSelectionMode() === 'single') {\n\n this._rowNodes.forEach(rowNode => rowNode.setSelected(rowNode.rowId === node.rowId));\n\n this._originalRowNodes.forEach(rowNode => rowNode.setSelected(rowNode.rowId === node.rowId));\n\n } else {\n\n node.setSelected(true);\n }\n\n this.selectionService.toggleSelection(rowId, true);\n\n this.eventService.dispatchEvent('selectionChanged', { node, selected: true });\n }\n }\n\n public setSelectedByIds(rowIds: string[], selected: boolean = true) {\n\n rowIds.forEach(rowId => {\n\n const node = this._originalRowNodes.get(rowId);\n\n if (node) {\n\n node.setSelected(selected);\n\n node.cellStates = { ...node.cellStates };\n\n this.selectionService.toggleSelection(rowId, selected);\n }\n });\n\n this.eventService.dispatchEvent('selectionChanged', { node: null });\n }\n\n /**\n * Get & Set Functions\n */\n public getAllRowNodes(): OneRowNode<T>[] {\n\n return this._rowNodes?.length > 0 ? [...this._rowNodes] : [];\n }\n\n public getRowDataSelected(): T[] {\n\n return this._rowNodes.filter(node => node.selected).map(node => ({ ...node.data }));\n }\n\n public getSelectedRowNodes(): OneRowNode<T>[] {\n\n const nodes = this._rowNodes.filter(node => node.selected);\n\n return nodes && nodes.length > 0 ? [...nodes] : [];\n }\n\n /**\n * Column filters\n */\n public getFilterModel(): OneFilterModel[] {\n\n return this._activeFilters;\n }\n\n public setFilterModel(model: OneFilterModel[]): void {\n\n if (this._destroyed) return;\n\n this._activeFilters = model;\n\n this.applyFilters();\n }\n\n public filterActive(field: string): boolean {\n\n return this._activeFilters.some(f => f.field === field && f.conditions.length > 0);\n }\n\n /**\n * Quick filter\n */\n public setQuickFilter(value: string): void {\n\n if (this._destroyed) return;\n\n this._quickFilterValue = (value || '').toLowerCase();\n\n this.applyFilters();\n }\n\n /**\n * Run the column validators over one row.\n *\n * Rules run in order and stop at the first failure, so a field appears at\n * most once. Fields that passed are absent rather than mapped to `null`.\n *\n * The row type comes from the grid's own `T` — this used to declare its own\n * `<T>`, which shadowed the class parameter and let an `OneGridApi<Employee>`\n * happily validate an unrelated shape against employee columns.\n */\n public validateRow(row: T, columns: OneColumnDef<T>[]): OneRowValidationErrors<T> {\n\n const errors: OneRowValidationErrors<T> = {};\n\n for (const column of columns) {\n\n // A column can only contribute an error if it has both rules and a field\n // to key them under.\n if (!column.field || !column.validationRules?.length) continue;\n\n for (const rule of column.validationRules) {\n\n const error = rule(row[column.field], row);\n\n if (error) {\n\n errors[column.field] = error;\n\n break; // first failure per column wins\n }\n }\n }\n\n return errors;\n }\n\n /**\n * Run the column validators over a whole dataset.\n *\n * Delegates to `validateRow` so the two can never disagree about what counts\n * as invalid — they previously carried separate copies of the same loop.\n */\n public validateAllRows(rowData: T[], columns: OneColumnDef<T>[]): OneValidationResult<T> {\n\n const allErrors = rowData.map(row => this.validateRow(row, columns));\n\n const hasErrors = allErrors.some(errors => Object.keys(errors).length > 0);\n\n return { errors: allErrors, valid: !hasErrors, invalid: hasErrors };\n }\n\n /**\n * Traverse every node, depth-first, once each.\n *\n * `rowNodes` is already the flattened tree — `buildRowNodes` pushes every\n * node into it as it descends — so walking it is the whole traversal. The\n * previous implementation walked that flat list *and* recursed into\n * `children`, visiting every nested node twice and every depth-3 node three\n * times. `index` is the node's position in the flattened order, matching\n * `node.rowIndex`, rather than its position among its siblings.\n */\n public forEachNode(callback: (node: OneRowNode<T>, index: number) => void) {\n\n this._rowNodes.forEach((node, index) => callback(node, index));\n }\n\n /** Traverse only leaf nodes, once each, in flattened order. */\n public forEachLeafNode(callback: (node: OneRowNode<T>, index: number) => void) {\n\n let leafIndex = 0;\n\n for (const node of this._rowNodes) {\n\n if (node.leaf) callback(node, leafIndex++);\n }\n }\n\n public getRowNodeById(rowId: string): OneRowNode<T> {\n\n return this._originalRowNodes.get(rowId);\n }\n\n /**\n * Expand/collapse a node\n */\n public setTreeDataChildrenField(field: string) {\n\n this.treeDataChildrenField = field;\n }\n\n public setGroupDefaultExpanded(defaultExpanded: number) {\n\n this.groupDefaultExpanded = defaultExpanded;\n }\n\n /**\n * Expansion state lives in two places, and they answer different questions.\n *\n * `OneGridExpansionService` records only *deliberate* changes — a click, or\n * one of the methods below. It is an override layer: `buildRowNodes` consults\n * it first and falls back to `groupDefaultExpanded` for every row the user\n * has not touched. That is what lets a later `groupDefaultExpanded` change\n * take effect, and what lets a collapse survive a rebuild.\n *\n * `node.expanded` is the resolved truth for a row, defaults included. Public\n * reads report that; the override sets stay internal.\n *\n * The invariant the setters below maintain: `expanded` is only ever true for\n * a node that can expand.\n */\n public toggleExpandAll(expanded: boolean) {\n\n this.forEachNode(node => {\n\n if (!node.expandable) return;\n\n node.setExpanded(expanded);\n\n this.expansionService.toggleExpanded(node.rowId, expanded)\n });\n\n this.refreshVisibleNodes();\n }\n\n public setExpandedById(rowId: string, expanded: boolean) {\n\n const node = this._originalRowNodes.get(rowId);\n\n if (node?.expandable) {\n\n node.setExpanded(expanded);\n\n this.expansionService.toggleExpanded(rowId, expanded);\n }\n\n this.refreshVisibleNodes();\n }\n\n public setExpandedByIds(rowIds: string[], expanded: boolean) {\n\n if (rowIds && rowIds.length > 0) {\n\n for (let rowId of rowIds) {\n\n const node = this._originalRowNodes.get(rowId);\n\n if (node?.expandable) {\n\n node.setExpanded(expanded);\n\n this.expansionService.toggleExpanded(rowId, expanded);\n }\n }\n\n this.refreshVisibleNodes();\n }\n }\n\n /**\n * Every currently expanded row, in tree order.\n *\n * Derived from the nodes rather than read off the override record, so rows\n * opened by `groupDefaultExpanded` are included — previously this returned\n * only rows someone had explicitly toggled, and came back empty on first load\n * while the first level was visibly open.\n */\n public getExpandedByIds(): string[] {\n\n return this._rowNodes\n\n .filter(node => node.expandable && node.expanded)\n\n .map(node => node.rowId);\n }\n\n /**\n * Master Detail Feature\n */\n public setDetailRowData(node: OneRowNode<T>, detailData: any[]) {\n\n if (this._destroyed) return;\n\n const rowNode = this.getRowNodeById(node.rowId);\n\n if (rowNode) {\n\n rowNode.setDetailRowData(detailData);\n }\n }\n\n public setGetDetailRowData(getDetailRowData: (params: OneGetDetailRowDataParams) => void) {\n\n this._getDetailRowData = getDetailRowData;\n }\n\n /**\n * Columns State\n */\n public getColumnState(): ColumnChangedEvent {\n\n return this.columnService.getColumnState();\n }\n\n public setColumnDefs(columnDefs: OneColumnDef<T>[]): void {\n\n if (this._destroyed) return;\n\n this.columnService.setColumnDefs(columnDefs);\n\n const columnState = this.columnService.getColumnState();\n\n this.cellService.applyColumnDefs(columnState.columns, this._context);\n\n // Cell state is derived from the columns, so replacing them wholesale\n // stales every node built before this ran. Tree and grouping mode hit\n // this on every load: the group column registers from a deferred\n // setColumnDefs, after the host has typically already loaded rows —\n // hosts used to have to defer setRowData themselves to dodge it.\n this.regenerateCellStates();\n\n this.eventService.dispatchEvent('columnChanged', columnState);\n }\n\n public updateColumn(id: string, changes: Partial<OneColumnDef<T>>): void {\n\n const before = this.visibleColumnFields();\n\n this.columnService.updateColumnDef(id, changes);\n\n const columnState = this.columnService.getColumnState();\n\n this.cellService.applyColumnDefs(columnState.columns, this._context);\n\n // Only when the set of visible columns changed (a hide, a show): a cell\n // state can appear or disappear then. Width patches — this method runs\n // per mousemove during a resize — skip the O(rows × columns) pass.\n if (this.visibleColumnFields() !== before) this.regenerateCellStates();\n\n this.eventService.dispatchEvent('columnChanged', columnState);\n }\n\n /** The visible fields as one comparable key. */\n private visibleColumnFields(): string {\n\n return this.columnService.getColumnState().columns?.map(column => column.field).join('|') ?? '';\n }\n\n /** Recompute every node's cell states against the current columns. */\n private regenerateCellStates(): void {\n\n const refresh = (node: OneRowNode) => node.setCellStates(this.cellService.generateCellStates(node));\n\n this._rowNodes.forEach(refresh);\n this._pinnedRowNodes.top.forEach(refresh);\n this._pinnedRowNodes.bottom.forEach(refresh);\n }\n\n public reorderColumnDefs(fromIndex: number, toIndex: number): void {\n\n this.columnService.reorderColumnDefs(fromIndex, toIndex);\n\n const columnState = this.columnService.getColumnState();\n\n this.eventService.dispatchEvent('columnChanged', columnState);\n }\n\n // ---------------------------------------------------------------------------\n // Row grouping\n // ---------------------------------------------------------------------------\n\n private _rowGroupFields: string[] = [];\n private _aggColumns: OneAggColumn<T>[] = [];\n\n /** The fields the rows are grouped by, in nesting order. Empty when off. */\n public get rowGroupFields(): readonly string[] {\n\n return this._rowGroupFields;\n }\n\n /**\n * Group the rows by these fields, in nesting order — or ungroup by passing\n * an empty array.\n *\n * `OneGridComponent` calls this once for the column definitions that\n * declare `rowGroup`; hosts call it to regroup afterwards. Either way the\n * grid re-plumbs itself around the new grouping — tree mode, the auto group\n * column, the visibility of the grouped-by columns — and folds the rows it\n * already holds again, so nothing has to be rebound and no grid has to be\n * torn down and re-created to group by a different column.\n *\n * `aggregations` defaults to the `aggFunc` columns currently registered, so\n * `setRowGrouping(['country'])` keeps the totals the column definitions\n * already describe.\n */\n public setRowGrouping(groupFields: string[], aggregations?: OneAggColumn<T>[]): void {\n\n if (this._destroyed) return;\n\n const previous = this._rowGroupFields;\n\n // Empty fields buy nothing and a repeated one would nest a level under\n // itself, where every child group holds the whole parent.\n const next = (groupFields ?? [])\n .filter(field => !!field)\n .filter((field, index, fields) => fields.indexOf(field) === index);\n\n // Grouping *is* the tree. A host that brought its own tree data, or a\n // master/detail grid, already has a hierarchy, and folding a second one\n // over it would throw the first away.\n if (next.length && (this._hostTreeData || this.masterDetail)) {\n\n console.warn('[one-grid] setRowGrouping does not apply to tree data or master/detail grids — they carry their own hierarchy. Nothing was changed.');\n\n return;\n }\n\n const unchanged = next.length === previous.length && next.every((field, index) => field === previous[index]);\n\n if (unchanged && !aggregations) return;\n\n this._rowGroupFields = next;\n this._aggColumns = aggregations ?? aggColumns<T>(this.columnService.getAllColumnDefs() as OneColumnDef<T>[]);\n\n // The row model's half of the switch: grouped rows carry their children\n // under the grouping helper's own field, and the tree pipeline walks them\n // from there. Ungrouping puts both back — which is safe because the guard\n // above means tree mode can only have come from grouping.\n this.treeData = next.length > 0;\n this.treeDataChildrenField = next.length ? ONE_GROUP_CHILDREN_FIELD : null;\n\n // Everything grouping implies outside the row model — the auto group\n // column, which of the host's columns are hidden, the grid type the body\n // renders — belongs to the component that owns the template. It re-plumbs\n // on this event, synchronously, so the rebuild below already sees the\n // columns the new grouping needs.\n this.eventService.dispatchEvent('rowGroupingChanged', { groupFields: next, previousGroupFields: previous });\n\n // Nothing to fold before the first load: `setRowData` will do it.\n if (this._rowNodes.length) this.rebuildRows(this._sourceRows, false);\n }\n\n // ---------------------------------------------------------------------------\n // Undo / redo of cell edits\n // ---------------------------------------------------------------------------\n\n private _undoLimit = 0;\n private _undoStack: { rowId: string; field: string; oldValue: any; newValue: any }[] = [];\n private _redoStack: { rowId: string; field: string; oldValue: any; newValue: any }[] = [];\n\n /**\n * Start recording committed cell edits for undo/redo. Called by\n * `OneGridComponent` from `[undoRedoCellEditing]`; the stack keeps the last\n * `limit` edits. Programmatic `setDataValue` writes are not recorded — only\n * commits, the ones that raise `cellValueChanged` without a source.\n */\n public enableUndoRedoCellEditing(limit: number = 10): void {\n\n if (this._undoLimit > 0) return;\n\n this._undoLimit = Math.max(Math.floor(limit), 1);\n\n this.eventService.addEventListener('cellValueChanged', (event: CellValueChangedEvent<T>) => {\n\n if (event.source) return;\n\n this._undoStack.push({ rowId: event.node.rowId, field: event.field, oldValue: event.oldValue, newValue: event.newValue });\n\n if (this._undoStack.length > this._undoLimit) this._undoStack.shift();\n\n // A new edit forks history; what was undone can no longer be redone.\n this._redoStack = [];\n });\n }\n\n /** Revert the most recent committed edit. Returns whether one was undone. */\n public undoCellEditing(): boolean {\n\n return this.replayEdit(this._undoStack, this._redoStack, 'undo');\n }\n\n /** Re-apply the most recently undone edit. Returns whether one was redone. */\n public redoCellEditing(): boolean {\n\n return this.replayEdit(this._redoStack, this._undoStack, 'redo');\n }\n\n public getCurrentUndoSize(): number {\n\n return this._undoStack.length;\n }\n\n public getCurrentRedoSize(): number {\n\n return this._redoStack.length;\n }\n\n private replayEdit(\n from: { rowId: string; field: string; oldValue: any; newValue: any }[],\n to: { rowId: string; field: string; oldValue: any; newValue: any }[],\n source: 'undo' | 'redo',\n ): boolean {\n\n if (this._destroyed) return false;\n\n const edit = from.pop();\n\n if (!edit) return false;\n\n const node = this.getRowNodeById(edit.rowId);\n\n // The row can be gone — a setRowData replaced the data under the stack.\n // The edit is dropped rather than replayed onto nothing.\n if (!node) return false;\n\n const value = source === 'undo' ? edit.oldValue : edit.newValue;\n const previous = source === 'undo' ? edit.newValue : edit.oldValue;\n\n (node.data as Record<string, unknown>)[edit.field] = value;\n\n this.updateCellStates(node);\n\n to.push(edit);\n\n const column = this.columnService.getColumnState().columns?.find(col => col.field === edit.field) ?? null;\n\n this.eventService.dispatchEvent('cellValueChanged', {\n node,\n data: node.data,\n column: column as OneColumnDef<T>,\n field: edit.field,\n oldValue: previous,\n newValue: value,\n source,\n });\n\n return true;\n }\n\n // ---------------------------------------------------------------------------\n // Client-side pagination\n // ---------------------------------------------------------------------------\n\n private _clientPagination = false;\n private _pageSize = 25;\n private _currentPage = 1;\n\n /** The paging state, when the grid pages its own rows. */\n public get paginationState(): Readonly<{ enabled: boolean; pageSize: number; currentPage: number }> {\n\n return { enabled: this._clientPagination, pageSize: this._pageSize, currentPage: this._currentPage };\n }\n\n /**\n * Turn grid-owned paging on or off. Called by `OneGridComponent` from its\n * `clientSidePagination` input; the display slice is what changes — the\n * full dataset stays behind the API (selection, filters and sorting keep\n * operating on all of it).\n */\n public setClientSidePagination(enabled: boolean, pageSize?: number): void {\n\n this._clientPagination = enabled;\n\n if (pageSize && pageSize > 0) this._pageSize = pageSize;\n\n this._currentPage = 1;\n }\n\n /** Change the page size and return to the first page. */\n public setPageSize(pageSize: number): void {\n\n if (this._destroyed || !(pageSize > 0)) return;\n\n this._pageSize = Math.floor(pageSize);\n this._currentPage = 1;\n\n this.applyFilters();\n }\n\n /** Move to a page (1-based). Clamped to at least 1; the top end clamps when the slice is taken. */\n public setCurrentPage(page: number): void {\n\n if (this._destroyed) return;\n\n const target = Math.max(Math.floor(page), 1);\n\n if (target === this._currentPage) return;\n\n this._currentPage = target;\n\n this.applyFilters();\n }\n\n /**\n * The slice of rows the current page shows — a passthrough while paging is\n * off. The body routes its render list through here, after reporting the\n * full count, so `rowCountChanged` keeps meaning \"rows after filtering\"\n * whether or not the grid pages.\n */\n public pageNodes(nodes: readonly OneRowNode<T>[]): OneRowNode<T>[] {\n\n if (!this._clientPagination) return (nodes ?? []) as OneRowNode<T>[];\n\n const lastPage = Math.max(Math.ceil((nodes?.length ?? 0) / this._pageSize), 1);\n\n // A shrinking dataset (a filter, a delete) can strand the page past the\n // end; clamping here shows the last page instead of an empty one.\n if (this._currentPage > lastPage) this._currentPage = lastPage;\n\n const start = (this._currentPage - 1) * this._pageSize;\n\n return (nodes ?? []).slice(start, start + this._pageSize) as OneRowNode<T>[];\n }\n\n /**\n * Size the flex columns into the given width.\n *\n * Called by the grid body with its own viewport width — on first render, on\n * container resize and after column changes — so `columnDef.flex` works\n * without the host doing anything. Also callable directly with any width.\n * A no-op when no visible column declares `flex` or nothing would change.\n */\n public applyFlexWidths(availableWidth: number): void {\n\n if (this._destroyed) return;\n\n if (!this.columnService.applyFlexWidths(availableWidth)) return;\n\n const columnState = this.columnService.getColumnState();\n\n this.cellService.applyColumnDefs(columnState.columns, this._context);\n\n this.eventService.dispatchEvent('columnChanged', columnState);\n }\n\n /**\n * The current grid as CSV: visible columns in display order, visible rows\n * in current sort order, values through the same getter/formatter pipeline\n * the cells render with. Pinned rows and detail grids are not data and are\n * not included.\n */\n public getDataAsCsv(options: OneCsvExportOptions = {}): string {\n\n const nodes = options.onlySelected ? this.getSelectedRowNodes() : this._visibleRowNodes;\n\n return buildCsv(nodes as OneRowNode<T>[], this.columnService.getColumnState().columns as OneColumnDef<T>[], this._context, options);\n }\n\n /** Build the CSV and hand it to the browser as a download. */\n public exportDataAsCsv(options: OneCsvExportOptions = {}): void {\n\n if (typeof document === 'undefined') return;\n\n const blob = new Blob([this.getDataAsCsv(options)], { type: 'text/csv;charset=utf-8;' });\n\n const link = document.createElement('a');\n\n link.href = URL.createObjectURL(blob);\n link.download = options.fileName ?? 'export.csv';\n link.click();\n\n URL.revokeObjectURL(link.href);\n }\n\n /**\n * Show or hide one column. A hidden column keeps its order, width and pin,\n * so showing it again restores it exactly.\n */\n public setColumnVisible(id: string, visible: boolean): void {\n\n this.updateColumn(id, { hide: !visible });\n }\n\n /**\n * Persistable layout state: one JSON-safe entry per column — hidden ones\n * included — in display order. Feed it back through `applyColumnState`.\n */\n public getColumnStateSnapshot(): OneColumnStateEntry[] {\n\n return this.columnService.getColumnStateSnapshot();\n }\n\n /**\n * Restore a snapshot from `getColumnStateSnapshot`: order, width, pin and\n * visibility. Ids the grid no longer has are skipped, so a stale snapshot\n * degrades to a partial restore rather than an error.\n */\n public applyColumnState(entries: OneColumnStateEntry[]): void {\n\n if (this._destroyed) return;\n\n this.columnService.applyColumnState(entries);\n\n const columnState = this.columnService.getColumnState();\n\n this.cellService.applyColumnDefs(columnState.columns, this._context);\n\n // A restore can show columns that were hidden when the rows were built,\n // and their cells have no state yet.\n this.regenerateCellStates();\n\n this.eventService.dispatchEvent('columnChanged', columnState);\n }\n\n /**\n * Update checkbox selection features\n */\n public setNodeAndChildrenSelected(node: OneRowNode, selected: boolean) {\n\n const rowIds = new Set<string>();\n\n const collect = (n: OneRowNode) => {\n\n rowIds.add(n.rowId);\n\n if (n.children && n.children.length) {\n\n n.children.forEach(child => collect(child));\n }\n };\n\n collect(node);\n\n this.setSelectedByIds(Array.from(rowIds), selected);\n }\n\n /**\n * @deprecated Identical to `updateCellStates`. Kept as an alias so existing\n * callers keep working; prefer `updateCellStates`, which says what it does.\n */\n public updateNodeStates(node: OneRowNode) {\n\n this.updateCellStates(node);\n }\n\n public updateCellState(node: OneRowNode, column: OneColumnDef): void {\n\n const rowNode = this.getRowNodeById(node.rowId);\n\n if (rowNode) {\n\n rowNode.cellStates[column.field] = this.cellService.generateCellState(rowNode, column);\n }\n }\n\n /**\n * Recompute every cell of one row and repaint it.\n *\n * The repaint is the point: this is what a caller reaches for after mutating\n * a row in place, and it used to regenerate the state and stop there. The\n * body renders with OnPush, so nothing marked it dirty and the new state sat\n * unread until some unrelated event happened to trigger change detection —\n * which is why callers ended up nudging the grid with a synthetic DOM event.\n */\n public updateCellStates(node: OneRowNode): void {\n\n if (this._destroyed) return;\n\n const rowNode = this.getRowNodeById(node.rowId);\n\n if (!rowNode) return;\n\n rowNode.cellStates = this.cellService.generateCellStates(rowNode);\n\n this.eventService.dispatchEvent('cellStateChanged', { data: rowNode.data, node: rowNode });\n }\n\n /**\n * Handler that Reacts to Detail Changes\n */\n /**\n * Keep a master row's reserved height in step with its detail rows.\n *\n * Two listeners used to be registered here and thrown away: an empty\n * `rowDataChanged` handler whose unsubscribe was never kept, and an\n * `expandedChanged` handler whose body was entirely commented out. Both are\n * gone — a listener with no behaviour is a leak with no upside.\n */\n private subscribeToDetailChanges(node: OneRowNode): void {\n\n const unsubscribeDetail = node.on('detailRowDataChanged', ({ node }) => {\n\n if (this._apiType === 'master') {\n\n this.resolveDetailRowHeight(node);\n }\n });\n\n this.registerNodeCleanup(node.rowId, [unsubscribeDetail]);\n }\n\n private registerNodeCleanup(rowId: string, unsubs: Array<() => void>): void {\n\n // Merge with any existing cleanups for this rowId\n const existing = this._nodeCleanupMap.get(rowId) ?? [];\n\n this._nodeCleanupMap.set(rowId, [...existing, ...unsubs]);\n }\n\n private cleanupNode(rowId: string): void {\n\n const cleanups = this._nodeCleanupMap.get(rowId);\n\n cleanups?.forEach(fn => fn());\n\n this._nodeCleanupMap.delete(rowId);\n }\n\n /**\n * Drop nodes that are no longer in the data, releasing what they hold.\n *\n * This existed but was never called: `setRowData` and `updateRowData` each\n * deleted straight out of `_originalRowNodes`, so a removed node kept its\n * listeners and its entry in `_nodeCleanupMap` for the lifetime of the grid.\n * Both now come through here, which unsubscribes and clears the node first.\n */\n private pruneRemovedNodes(validRowIds: Set<string>): void {\n\n for (const [rowId, node] of this._originalRowNodes) {\n\n if (!validRowIds.has(rowId)) {\n\n this.cleanupNode(rowId); // unsubscribe listeners\n\n node.destroy(); // clear node's own listener map\n\n this._originalRowNodes.delete(rowId);\n }\n }\n }\n\n /**\n * Height a master row must reserve for its detail grid:\n * rowHeight x clamp(rows, minRows, maxRows) + headerHeight.\n */\n private resolveDetailRowHeight(node: OneRowNode): void {\n\n const heightOptions = this.detailCellRendererParams?.detailGridOptions?.detailRowHeightOptions;\n\n // Reachable whenever masterDetail is on but detailCellRendererParams is\n // incomplete; without the guard this threw from inside an event listener.\n if (!heightOptions) return;\n\n const minRows = heightOptions.minRows;\n const maxRows = heightOptions.maxRows;\n\n const minHeight = (this.rowHeight * minRows) + this.headerRowHeight;\n const maxHeight = (this.rowHeight * maxRows) + this.headerRowHeight;\n\n const rows = node.detailRowData && node.detailRowData.length ? node.detailRowData.length : 0;\n\n node.detailRowHeight = rows <= minRows ? minHeight : rows >= maxRows ? maxHeight : (this.rowHeight * rows) + this.headerRowHeight;\n }\n\n /**\n * Release everything the grid holds. Called by `OneGridComponent.ngOnDestroy`.\n *\n * The services are deliberately *not* nulled out any more. They are injected,\n * Angular owns their lifetime, and nulling them only guaranteed a\n * `TypeError` for any callback that arrived after teardown — a detail-row\n * fetch resolving late, or the body's deferred update. `_destroyed` makes\n * those calls no-ops instead, which is what a torn-down object should do.\n */\n public destroy(): void {\n\n if (this._destroyed) return;\n\n this._destroyed = true;\n\n // Unsubscribe every per-node listener before dropping the nodes.\n for (const rowId of Array.from(this._nodeCleanupMap.keys())) {\n\n this.cleanupNode(rowId);\n }\n\n // `destroy` drops the tree links and the listeners; the API no longer has\n // to reach in and unpick each node itself.\n this._originalRowNodes.forEach(node => node.destroy());\n this._rowNodes.forEach(node => node.destroy());\n\n for (const side of ['top', 'bottom'] as OnePinnedRowSide[]) {\n\n this._pinnedRowNodes[side].forEach(node => node.destroy());\n this._pinnedRowNodes[side] = [];\n }\n\n this._rowNodes = [];\n this._visibleRowNodes = [];\n this._originalRowNodes.clear();\n this._nodeCleanupMap.clear();\n this._currentIndex = 0;\n\n // Release the back-reference the cell service holds, so a torn-down api is\n // not kept alive by the service that outlives this call.\n this.cellService.setGridApi(null);\n\n this.selectionService.deselectAll();\n this.expansionService.clear();\n\n this._activeFilters = [];\n this._quickFilterValue = null;\n this._sortModel = [];\n this._context = null;\n\n this.masterDetail = false;\n this.treeData = false;\n this.treeDataChildrenField = null;\n this.groupDefaultExpanded = 0;\n this.detailCellRendererParams = null;\n this.detailRendererComponent = null;\n this._getDetailRowData = null;\n }\n\n /** Whether `destroy` has run. Late callbacks check this before doing work. */\n public get destroyed(): boolean {\n\n return this._destroyed;\n }\n}\n","import { Injectable, NgZone, OnDestroy, inject } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { OneRowDragEvent, OneRowDragState } from '../models/one-row-drag.model';\nimport { OneRowNode } from '../instants/one-row-node.class';\n\n/** What the body has to lend the service to run a drag. */\nexport interface OneRowDragContext<T = any> {\n\n /** The scrolling element the rows live in. */\n viewport: HTMLElement;\n\n /** Fixed row height. The whole index calculation rests on rows being uniform. */\n itemSize: number;\n\n /** Current display order. Read fresh on every move — a drag mutates it. */\n nodes: () => OneRowNode<T>[];\n\n /** Apply the move. Returns false if the grid refused it. */\n move: (fromIndex: number, toIndex: number) => boolean;\n}\n\n/** Pointer distance before a press becomes a drag. */\nconst DRAG_THRESHOLD_PX = 4;\n\n/** How close to an edge auto-scroll kicks in, and how fast it goes. */\nconst EDGE_ZONE_PX = 36;\nconst EDGE_SPEED_PX = 12;\n\n/**\n * Owns one row-drag gesture at a time.\n *\n * Built on pointer events rather than HTML5 drag-and-drop or the CDK's\n * drag-drop:\n *\n * - HTML5 DnD does not fire for touch at all, and its drag image cannot be\n * styled to match the grid.\n * - `cdkDropList` assumes every item it manages is in the DOM. Inside a virtual\n * scroll viewport rows unmount as they leave the buffer, so the list it\n * thinks it is sorting is only ever the visible window.\n * - Pointer events cover mouse, touch and pen in one path, and pointer capture\n * keeps the gesture alive when the finger leaves the row it started on.\n *\n * Because rows are a fixed `itemSize`, the drop target is arithmetic on the\n * pointer's Y rather than a hit test against row elements — which is also why\n * it stays correct for rows that are scrolled out and not rendered.\n */\n@Injectable()\nexport class OneGridRowDragService<T = any> implements OnDestroy {\n\n private readonly zone = inject(NgZone);\n\n /** Live drag, for the body to render the handle state and the indicator. */\n readonly state$ = new BehaviorSubject<OneRowDragState | null>(null);\n\n /** Screen-reader narration for the keyboard path. */\n readonly announcement$ = new BehaviorSubject<string>('');\n\n private context: OneRowDragContext<T> | null = null;\n\n private pointerId: number | null = null;\n private handle: HTMLElement | null = null;\n private startY = 0;\n private armed = false;\n private lastClientY = 0;\n private scrollFrame: number | null = null;\n\n /** A move already applied during this drag, so a cancel can undo it. */\n private appliedFrom: number | null = null;\n\n private onMove?: (event: OneRowDragEvent<T>) => void;\n private onEnd?: (event: OneRowDragEvent<T> | null) => void;\n\n attach(context: OneRowDragContext<T>): void {\n\n this.context = context;\n }\n\n get state(): OneRowDragState | null {\n\n return this.state$.value;\n }\n\n get dragging(): boolean {\n\n return this.state$.value !== null;\n }\n\n // -------------------------------------------------------------------------\n // Pointer\n // -------------------------------------------------------------------------\n\n /**\n * Begin a pointer drag. Nothing visible happens until the pointer has moved\n * {@link DRAG_THRESHOLD_PX}, so a click on the handle — which is also the\n * keyboard affordance — is not swallowed by a zero-distance drag.\n */\n startPointerDrag(\n event: PointerEvent,\n node: OneRowNode<T>,\n handlers: { onEnd?: (event: OneRowDragEvent<T> | null) => void } = {},\n ): void {\n\n if (!this.context || this.dragging || this.pointerId !== null) return;\n\n // Secondary buttons open context menus; they are not a drag.\n if (event.button !== 0) return;\n\n const index = this.indexOf(node);\n\n if (index === -1) return;\n\n this.pointerId = event.pointerId;\n this.handle = event.target as HTMLElement;\n this.startY = event.clientY;\n this.lastClientY = event.clientY;\n this.armed = false;\n this.appliedFrom = index;\n this.onEnd = handlers.onEnd;\n\n this.handle.setPointerCapture?.(event.pointerId);\n\n // Outside Angular: pointermove fires at the display's refresh rate and\n // every one of them would otherwise run change detection over the grid.\n // The few that change the drop target re-enter through `publish`.\n this.zone.runOutsideAngular(() => {\n document.addEventListener('pointermove', this.handlePointerMove, { passive: false });\n document.addEventListener('pointerup', this.handlePointerUp);\n document.addEventListener('pointercancel', this.handlePointerCancel);\n document.addEventListener('keydown', this.handlePointerKeydown);\n });\n }\n\n private handlePointerMove = (event: PointerEvent): void => {\n\n if (this.pointerId === null || event.pointerId !== this.pointerId) return;\n\n if (!this.armed) {\n\n if (Math.abs(event.clientY - this.startY) < DRAG_THRESHOLD_PX) return;\n\n this.armed = true;\n\n this.publish({ rowId: this.nodeAt(this.appliedFrom!)?.rowId ?? '', fromIndex: this.appliedFrom!, insertAt: this.appliedFrom!, source: 'pointer' });\n }\n\n // Held so the auto-scroll loop can recompute the target as the viewport\n // moves under a stationary finger.\n this.lastClientY = event.clientY;\n\n // Touch scrolling would otherwise pan the viewport out from under us.\n event.preventDefault();\n\n this.updateFromPointer();\n this.updateAutoScroll();\n };\n\n private handlePointerUp = (event: PointerEvent): void => {\n\n if (this.pointerId === null || event.pointerId !== this.pointerId) return;\n\n const dragged = this.armed;\n\n this.teardownPointer();\n\n if (!dragged) {\n\n this.reset();\n\n return;\n }\n\n this.commit('pointer');\n };\n\n private handlePointerCancel = (): void => {\n\n this.teardownPointer();\n\n this.cancel();\n };\n\n /** Escape aborts a pointer drag, the same as it does a keyboard one. */\n private handlePointerKeydown = (event: KeyboardEvent): void => {\n\n if (event.key !== 'Escape') return;\n\n event.preventDefault();\n\n this.teardownPointer();\n\n this.cancel();\n };\n\n /**\n * Turn the pointer's Y into an insertion boundary.\n *\n * Boundaries, not rows: the value is where the row would be *inserted*, so\n * 0 is above the first row and `length` is below the last. Rounding rather\n * than flooring puts the split at the middle of each row, which is what\n * makes the indicator flip when you cross the halfway point.\n */\n private updateFromPointer(): void {\n\n const current = this.state$.value;\n\n if (!this.context || !current) return;\n\n const rect = this.context.viewport.getBoundingClientRect();\n const offset = this.lastClientY - rect.top + this.context.viewport.scrollTop;\n\n const insertAt = this.clamp(Math.round(offset / this.context.itemSize), 0, this.context.nodes().length);\n\n if (insertAt === current.insertAt) return;\n\n this.publish({ ...current, insertAt });\n }\n\n /**\n * Scroll when the pointer sits near an edge, so rows outside the viewport\n * are reachable without letting go. Runs on rAF while the pointer is parked\n * in the zone, and re-derives the target each frame because the content\n * moves while the pointer does not.\n */\n private updateAutoScroll(): void {\n\n if (!this.context) return;\n\n const rect = this.context.viewport.getBoundingClientRect();\n\n const distanceToTop = this.lastClientY - rect.top;\n const distanceToBottom = rect.bottom - this.lastClientY;\n\n let delta = 0;\n\n if (distanceToTop < EDGE_ZONE_PX) delta = -EDGE_SPEED_PX;\n else if (distanceToBottom < EDGE_ZONE_PX) delta = EDGE_SPEED_PX;\n\n if (delta === 0) {\n\n this.stopAutoScroll();\n\n return;\n }\n\n if (this.scrollFrame !== null) return;\n\n const step = (): void => {\n\n if (!this.context || !this.dragging) {\n\n this.stopAutoScroll();\n\n return;\n }\n\n const viewport = this.context.viewport;\n const before = viewport.scrollTop;\n\n viewport.scrollTop = before + delta;\n\n // Hit the end — nothing more to reveal, so stop burning frames.\n if (viewport.scrollTop === before) {\n\n this.stopAutoScroll();\n\n return;\n }\n\n this.updateFromPointer();\n\n this.scrollFrame = requestAnimationFrame(step);\n };\n\n this.scrollFrame = requestAnimationFrame(step);\n }\n\n private stopAutoScroll(): void {\n\n if (this.scrollFrame === null) return;\n\n cancelAnimationFrame(this.scrollFrame);\n\n this.scrollFrame = null;\n }\n\n private teardownPointer(): void {\n\n this.stopAutoScroll();\n\n if (this.handle && this.pointerId !== null) {\n\n this.handle.releasePointerCapture?.(this.pointerId);\n }\n\n document.removeEventListener('pointermove', this.handlePointerMove);\n document.removeEventListener('pointerup', this.handlePointerUp);\n document.removeEventListener('pointercancel', this.handlePointerCancel);\n document.removeEventListener('keydown', this.handlePointerKeydown);\n\n this.pointerId = null;\n this.handle = null;\n this.armed = false;\n }\n\n // -------------------------------------------------------------------------\n // Keyboard\n //\n // WCAG 2.5.7 Dragging Movements: anything achievable by dragging needs a\n // single-pointer, non-dragging alternative. Arrow-key moves are that, and\n // they are also simply how a keyboard user reorders a list.\n // -------------------------------------------------------------------------\n\n /** Space/Enter on the handle: pick the row up, or put it down. */\n toggleKeyboardDrag(node: OneRowNode<T>, handlers: { onEnd?: (event: OneRowDragEvent<T> | null) => void } = {}): void {\n\n if (!this.context) return;\n\n if (this.state$.value?.source === 'keyboard') {\n\n this.commit('keyboard');\n\n return;\n }\n\n if (this.dragging) return;\n\n const index = this.indexOf(node);\n\n if (index === -1) return;\n\n this.appliedFrom = index;\n this.onEnd = handlers.onEnd;\n\n this.publish({ rowId: node.rowId, fromIndex: index, insertAt: index, source: 'keyboard' });\n\n this.announce(`${this.describe(node, index)} grabbed. Use the arrow keys to move it, space to drop, escape to cancel.`);\n }\n\n /**\n * Arrow keys move the row a position at a time, applying as they go.\n *\n * Applied rather than previewed because the row has to be seen to move: a\n * keyboard user gets no drag image, and a preview line alone tells someone\n * relying on a screen reader nothing about where the row now sits. Escape\n * still restores the original position.\n */\n moveKeyboard(delta: number): boolean {\n\n const current = this.state$.value;\n\n if (!this.context || current?.source !== 'keyboard') return false;\n\n const nodes = this.context.nodes();\n const from = current.insertAt;\n const to = this.clamp(from + delta, 0, nodes.length - 1);\n\n if (to === from) {\n\n this.announce(to === 0 ? 'Already at the top.' : 'Already at the bottom.');\n\n return true;\n }\n\n if (!this.context.move(from, to)) return true;\n\n this.publish({ ...current, insertAt: to });\n\n const node = this.nodeAt(to);\n\n this.announce(node ? `Moved to position ${to + 1} of ${nodes.length}.` : '');\n\n return true;\n }\n\n // -------------------------------------------------------------------------\n // Commit / cancel\n // -------------------------------------------------------------------------\n\n private commit(source: 'pointer' | 'keyboard'): void {\n\n const current = this.state$.value;\n\n if (!this.context || !current) {\n\n this.reset();\n\n return;\n }\n\n const nodes = this.context.nodes();\n\n // Pointer drags apply once, at the end. A boundary index becomes a row\n // index by dropping one when the row travelled downwards, since lifting\n // it out first shifts everything below it up.\n if (source === 'pointer') {\n\n const from = current.fromIndex;\n const to = this.clamp(current.insertAt > from ? current.insertAt - 1 : current.insertAt, 0, nodes.length - 1);\n\n const node = this.nodeAt(from);\n\n if (node && to !== from && this.context.move(from, to)) {\n\n this.finish({ node, fromIndex: from, toIndex: to, source });\n\n return;\n }\n\n this.reset();\n\n return;\n }\n\n // Keyboard moves were applied as they happened; this only confirms.\n const node = this.nodeAt(current.insertAt);\n\n const moved = node && current.insertAt !== current.fromIndex;\n\n this.announce(moved ? `Dropped at position ${current.insertAt + 1} of ${nodes.length}.` : 'Cancelled. Row returned to its original position.');\n\n if (moved) {\n\n this.finish({ node: node!, fromIndex: current.fromIndex, toIndex: current.insertAt, source });\n\n return;\n }\n\n this.reset();\n }\n\n /** Abort, restoring anything a keyboard drag already applied. */\n cancel(): void {\n\n const current = this.state$.value;\n\n if (current?.source === 'keyboard' && this.context && current.insertAt !== current.fromIndex) {\n\n this.context.move(current.insertAt, current.fromIndex);\n\n this.announce('Cancelled. Row returned to its original position.');\n\n } else if (current) {\n\n this.announce('Cancelled.');\n }\n\n this.reset();\n }\n\n private finish(event: OneRowDragEvent<T>): void {\n\n const done = this.onEnd;\n\n this.reset();\n\n this.zone.run(() => done?.(event));\n }\n\n private reset(): void {\n\n this.stopAutoScroll();\n\n this.appliedFrom = null;\n this.onEnd = undefined;\n\n if (this.state$.value !== null) {\n\n this.zone.run(() => this.state$.next(null));\n }\n }\n\n // -------------------------------------------------------------------------\n // Helpers\n // -------------------------------------------------------------------------\n\n private publish(state: OneRowDragState): void {\n\n this.zone.run(() => this.state$.next(state));\n }\n\n private announce(message: string): void {\n\n this.zone.run(() => this.announcement$.next(message));\n }\n\n private describe(node: OneRowNode<T>, index: number): string {\n\n return `Row ${index + 1} of ${this.context?.nodes().length ?? 0},`;\n }\n\n private indexOf(node: OneRowNode<T>): number {\n\n return this.context?.nodes().findIndex(candidate => candidate.rowId === node.rowId) ?? -1;\n }\n\n private nodeAt(index: number): OneRowNode<T> | null {\n\n return this.context?.nodes()[index] ?? null;\n }\n\n private clamp(value: number, min: number, max: number): number {\n\n return Math.min(Math.max(value, min), max);\n }\n\n ngOnDestroy(): void {\n\n this.teardownPointer();\n\n this.state$.next(null);\n this.state$.complete();\n this.announcement$.complete();\n\n this.context = null;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { TreeNode } from '../models/one-tree-data.model';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OneGridTreeDataService {\n\n create<T>(tree: TreeNode<T>[], parentId: string | null, newNode: TreeNode<T>): TreeNode<T>[] {\n \n if (!parentId) {\n\n return [newNode, ...tree];\n }\n \n return tree.map(node => {\n\n if (node.id === parentId) {\n\n return { ...node, children: [newNode, ...(node.children || [])] };\n }\n \n if (node.children) {\n\n return { ...node, children: this.create(node.children, parentId, newNode) };\n }\n \n return node;\n });\n }\n \n update<T>(tree: TreeNode<T>[], nodeId: string, updatedData: Partial<T>): TreeNode<T>[] {\n \n return tree.map(node => {\n\n if (node.id === nodeId) {\n\n return { ...node, ...updatedData };\n }\n \n if (node.children) {\n\n return { ...node, children: this.update(node.children, nodeId, updatedData) };\n }\n \n return node;\n });\n }\n\n delete<T>(tree: TreeNode<T>[], nodeId: string): TreeNode<T>[] {\n\n return tree.map(node => {\n\n if (node.children && node.children.length > 0) {\n\n return { ...node, children: this.delete(node.children, nodeId) };\n }\n\n return node;\n\n }).filter(node => node.id !== nodeId);\n }\n\n \n find<T = any>(treeData: TreeNode<T>[], nodeId: string): TreeNode<T> | null {\n \n for (const node of treeData) {\n\n if (node.id === nodeId) {\n\n return node;\n }\n \n if (node.children) {\n\n const found = this.find(node.children, nodeId);\n\n if (found) return found;\n }\n }\n \n return null;\n }\n}\n","export const OnePageSizeOption = [25, 50, 100, 250];","import type { OneGridApi } from \"../instants/one-grid-api.class\";\nimport type { OneRowNode } from \"../instants/one-row-node.class\";\n\nexport interface OneGetRowHeightParams<T = any> {\n node?: OneRowNode<T>;\n api?: OneGridApi<T>;\n context?: any;\n}\n\nexport type OneGetRowHeight<T = any> = (params: OneGetRowHeightParams<T>) => number | null | undefined;\n\nexport function resolveRowHeight<T>(params: OneGetRowHeightParams<T>, getRowHeight: OneGetRowHeight, rowHeight: number = 26): number {\n\n if (getRowHeight) {\n\n const result = getRowHeight(params);\n\n // fallback behavior like AG Grid\n if (result == null) {\n\n return rowHeight;\n }\n\n // guard against invalid values\n return Math.max(1, result);\n }\n\n return rowHeight;\n}\n\nexport type OneDetailRowHeightOption = {\n minRows: number;\n maxRows: number;\n}\n\n\n/**\n * Handle One Row Node Event\n */\n\n// events.ts - Strongly typed event map\nexport interface OneRowNodeEventMap<T> {\n\n rowDataChanged: {\n node: OneRowNode<T>;\n data: T;\n previousData: T;\n };\n\n detailRowDataChanged: {\n node: OneRowNode<T>;\n detailRowData: any[];\n previousDetailRowData: any[] | null;\n };\n\n expandedChanged: {\n node: OneRowNode<T>;\n expanded: boolean;\n };\n}\n\n// `childrenChanged` used to be declared here and raised by `setDetailRowData`\n// with `node.children` — which is always `[]` for a master row, because detail\n// rows are not children. Nothing in the library or any consumer could listen\n// for it usefully, so the event and its emit are both gone rather than left as\n// a documented lie. Subscribe to `detailRowDataChanged` for detail rows.\n\nexport type OneRowNodeListener<T, K extends keyof OneRowNodeEventMap<T>> = (event: OneRowNodeEventMap<T>[K]) => void;","import { Provider } from '@angular/core';\nimport {\n LUCIDE_ICONS,\n LucideIconProvider,\n ArrowDownUp,\n ArrowDownZA,\n ArrowUpAZ,\n ChevronFirst,\n ChevronLast,\n ChevronLeft,\n ChevronRight,\n GripVertical,\n} from 'lucide-angular';\n\n/**\n * The Lucide icons the grid draws, and only those.\n *\n * Every component that renders a `<lucide-icon>` picks this set itself, so the\n * icons travel with the component. That matters now the components are\n * standalone: a consumer importing `OneGridComponent` directly never touches\n * `OneGridModule`, and previously got a runtime error — \"The 'chevron-first'\n * icon has not been provided by any available icon providers\" — the moment the\n * pagination bar rendered.\n *\n * Eight icons rather than `LucideAngularModule.pick(icons)`, which registered\n * the entire Lucide set. Nothing else in the grid uses one, and the rest were\n * dead weight in every consumer's bundle.\n */\nexport const ONE_GRID_ICONS = {\n ArrowDownUp,\n ArrowDownZA,\n ArrowUpAZ,\n ChevronFirst,\n ChevronLast,\n ChevronLeft,\n ChevronRight,\n GripVertical,\n} as const;\n\n/**\n * Providers that register {@link ONE_GRID_ICONS} for one standalone component.\n *\n * `LucideAngularModule.pick()` cannot be used here: it returns a\n * `ModuleWithProviders`, and a standalone component's `imports` only accepts\n * components, directives, pipes and NgModule classes. This is the same\n * registration `pick` performs, expressed as providers so it can sit on the\n * component instead.\n */\nexport const ONE_GRID_ICON_PROVIDERS: Provider[] = [\n { provide: LUCIDE_ICONS, multi: true, useValue: new LucideIconProvider(ONE_GRID_ICONS) },\n];\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneRowNode } from '../instants/one-row-node.class';\nimport { OneCheckboxState, RowSelectionMode } from '../models/one-event-types.model';\n\n@Pipe({\n standalone: true,\n name: 'headerCheckboxChecked'\n})\nexport class HeaderCheckboxCheckedPipe implements PipeTransform {\n\n transform(rowNodes: OneRowNode[], selectionMode: RowSelectionMode, state: OneCheckboxState): boolean {\n\n return rowNodes?.length > 0 && selectionMode === 'multiple' && state === 'checked';\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneRowNode } from '../instants/one-row-node.class';\nimport { RowSelectionMode } from '../models/one-event-types.model';\n\n@Pipe({\n standalone: true,\n name: 'headerCheckboxDisabled'\n})\nexport class HeaderCheckboxDisabledPipe implements PipeTransform {\n\n transform(rowNodes: OneRowNode[], selectionMode: RowSelectionMode, allowedEdit: boolean): boolean {\n\n return rowNodes?.length === 0 || selectionMode !== 'multiple' || !allowedEdit;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneRowNode } from '../instants/one-row-node.class';\nimport { OneCheckboxState, RowSelectionMode } from '../models/one-event-types.model';\n\n@Pipe({\n standalone: true,\n name: 'headerCheckboxIndeterminate'\n})\nexport class HeaderCheckboxIndeterminatePipe implements PipeTransform {\n\n transform(rowNodes: OneRowNode[], selectionMode: RowSelectionMode, state: OneCheckboxState): unknown {\n\n return rowNodes?.length > 0 && selectionMode === 'multiple' && state === 'indeterminate';\n }\n}\n","import { Component, Input, OnDestroy, OnInit } from '@angular/core';\nimport { OneGridSelectionService } from '../../core/services/one-grid-selection.service';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridApi } from '../../core/instants/one-grid-api.class';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport {\n OneCheckboxState, RowDataChangedEvent,\n RowSelectionMode,\n SelectionChangedEvent,\n} from '../../core/models/one-event-types.model'\nimport { HeaderCheckboxCheckedPipe } from '../../core/pipes/header-checkbox-checked.pipe';\nimport { HeaderCheckboxDisabledPipe } from '../../core/pipes/header-checkbox-disabled.pipe';\nimport { HeaderCheckboxIndeterminatePipe } from '../../core/pipes/header-checkbox-indeterminate.pipe';\n\n@Component({\n standalone: true,\n imports: [HeaderCheckboxCheckedPipe, HeaderCheckboxDisabledPipe, HeaderCheckboxIndeterminatePipe],\n selector: 'one-grid-checkbox-header',\n templateUrl: './one-grid-checkbox-header.component.html',\n styleUrl: './one-grid-checkbox-header.component.scss',\n})\nexport class OneGridCheckboxHeaderComponent<T> implements OnInit, OnDestroy {\n\n @Input() api!: OneGridApi<T>;\n @Input() allowedEdit: boolean = false;\n\n /** Unsubscribe callbacks for the two grid listeners below. */\n private readonly teardown: Array<() => void> = [];\n\n public state: OneCheckboxState = 'unchecked';\n public rowNodes: OneRowNode<T>[] = [];\n public selectionMode: RowSelectionMode;\n\n constructor(\n private eventService: OneGridEventService,\n private selectionService: OneGridSelectionService\n ) { }\n\n ngOnInit(): void {\n\n this.selectionMode = this.api.rowSelection;\n\n /**\n * Listen Row Node Selection Changed Event\n */\n this.teardown.push(this.eventService.addEventListener('selectionChanged', (payload: SelectionChangedEvent<T>) => {\n\n this.rowNodes = this.api.getAllRowNodes();\n\n const rowIds = this.rowNodes && this.rowNodes.length > 0 ? this.rowNodes.map((node: OneRowNode<T>) => node.rowId) : [];\n\n this.state = this.selectionService.getSelectAllState(rowIds);\n }));\n\n /**\n * Listen Row Data Changed Event\n */\n this.teardown.push(this.eventService.addEventListener('rowDataChanged', (payload: RowDataChangedEvent<T>) => {\n\n this.rowNodes = this.api.getAllRowNodes();\n\n const rowIds: string[] = this.rowNodes && this.rowNodes.length > 0 ? this.rowNodes.map((node: OneRowNode<T>) => node.rowId) : [];\n\n this.state = this.selectionService.getSelectAllState(rowIds);\n }));\n }\n\n ngOnDestroy(): void {\n\n // Both listeners were registered and never released. The component-scoped\n // event service happened to clean up after them; relying on that left the\n // component's own lifecycle incomplete.\n this.teardown.forEach(unsubscribe => unsubscribe());\n\n this.teardown.length = 0;\n }\n\n /**\n * Toggle Selection Action\n */\n toggleSelectionAll(event: any): void {\n\n if (this.selectionMode === 'single') return;\n\n const checked: boolean = event.target.checked;\n\n if (this.rowNodes && this.rowNodes.length > 0) {\n\n if (checked) {\n\n this.api.selectAll();\n\n } else {\n\n this.api.deselectAll();\n }\n }\n }\n}\n","<div class=\"one-grid-checkbox\">\n <input\n [id]=\"api.id\"\n [type]=\"'checkbox'\"\n [class.disabled]=\"rowNodes | headerCheckboxDisabled:selectionMode:allowedEdit\"\n [checked]=\"rowNodes | headerCheckboxChecked:selectionMode:state\"\n [indeterminate]=\"rowNodes | headerCheckboxIndeterminate:selectionMode:state\"\n (change)=\"toggleSelectionAll($event)\" />\n</div>","import { AfterViewInit, Component, ElementRef, EventEmitter, HostListener, Input, OnInit, Output, QueryList, ViewChildren } from '@angular/core';\nimport { OneColumnDef } from '../../core/models/one-column-def-types.model';\n\n/** What a default header menu entry does when chosen. */\nexport type OneHeaderMenuAction =\n | 'sortAsc'\n | 'sortDesc'\n | 'clearSort'\n | 'pinLeft'\n | 'pinRight'\n | 'unpin'\n | 'hide';\n\ninterface HeaderMenuEntry {\n action: OneHeaderMenuAction;\n label: string;\n}\n\n/**\n * The grid's default column menu, opened by the header's ⋮ button when the\n * grid sets `[headerMenu]=\"true\"`.\n *\n * Entries follow the column: sorting only on a sortable column and only the\n * transitions that make sense from the current state, pinning without the\n * side it is already on, hiding never for the last visible column. The menu\n * only reports the chosen action — the header executes it against the API,\n * for the same reason the cell option menu does not mutate rows itself.\n *\n * Keyboard behaviour is the menu pattern the cell option menu established:\n * focus moves in on open, arrows rove, Escape and outside clicks close.\n */\n@Component({\n selector: 'one-grid-header-menu',\n standalone: true,\n templateUrl: './one-grid-header-menu.component.html',\n})\nexport class OneGridHeaderMenuComponent implements OnInit, AfterViewInit {\n\n @Input() column: OneColumnDef = null;\n /** The column's current sort, so the menu offers only the other states. */\n @Input() sortState: 'asc' | 'desc' | null = null;\n /** False when this is the last visible column, which must stay visible. */\n @Input() canHide: boolean = true;\n\n @Output() menuAction = new EventEmitter<OneHeaderMenuAction>();\n @Output() menuClose = new EventEmitter<void>();\n\n @ViewChildren('item') private items?: QueryList<ElementRef<HTMLButtonElement>>;\n\n protected entries: HeaderMenuEntry[] = [];\n protected activeIndex = 0;\n\n protected get menuLabel(): string {\n\n return `Column menu for ${this.column?.headerName ?? this.column?.field ?? 'this column'}`;\n }\n\n constructor(private elementRef: ElementRef) {}\n\n /**\n * Built once on open rather than in a getter: the entries feed the roving\n * tabindex, and a list that re-derives mid-interaction would move focus.\n */\n ngOnInit(): void {\n\n const entries: HeaderMenuEntry[] = [];\n const column = this.column;\n\n if (column?._resolvedSortable && column.field) {\n\n if (this.sortState !== 'asc') entries.push({ action: 'sortAsc', label: 'Sort ascending' });\n if (this.sortState !== 'desc') entries.push({ action: 'sortDesc', label: 'Sort descending' });\n if (this.sortState) entries.push({ action: 'clearSort', label: 'Clear sort' });\n }\n\n if (column?.pinned !== 'left') entries.push({ action: 'pinLeft', label: 'Pin left' });\n if (column?.pinned !== 'right') entries.push({ action: 'pinRight', label: 'Pin right' });\n if (column?.pinned) entries.push({ action: 'unpin', label: 'Unpin' });\n\n if (this.canHide) entries.push({ action: 'hide', label: 'Hide column' });\n\n this.entries = entries;\n }\n\n ngAfterViewInit(): void {\n\n this.focusItem(0);\n }\n\n protected onEntrySelected(entry: HeaderMenuEntry): void {\n\n this.menuAction.emit(entry.action);\n this.menuClose.emit();\n }\n\n protected onItemKeydown(event: KeyboardEvent, index: number, entry: HeaderMenuEntry): void {\n\n switch (event.key) {\n\n case 'ArrowDown':\n event.preventDefault();\n this.focusItem((index + 1) % this.entries.length);\n return;\n\n case 'ArrowUp':\n event.preventDefault();\n this.focusItem((index - 1 + this.entries.length) % this.entries.length);\n return;\n\n case 'Home':\n event.preventDefault();\n this.focusItem(0);\n return;\n\n case 'End':\n event.preventDefault();\n this.focusItem(this.entries.length - 1);\n return;\n\n case 'Enter':\n case ' ':\n event.preventDefault();\n this.onEntrySelected(entry);\n return;\n\n default:\n return;\n }\n }\n\n private focusItem(index: number): void {\n\n if (!this.entries.length) return;\n\n this.activeIndex = index;\n\n this.items?.get(index)?.nativeElement?.focus();\n }\n\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: MouseEvent) {\n\n if (!this.elementRef.nativeElement.contains(event.target as HTMLElement)) {\n\n this.menuClose.emit();\n }\n }\n\n @HostListener('document:keydown.escape')\n onEscape() {\n\n this.menuClose.emit();\n }\n\n @HostListener('document:scroll')\n onScroll() {\n\n this.menuClose.emit();\n }\n}\n","<div class=\"one-header-menu\" role=\"menu\" [attr.aria-label]=\"menuLabel\">\n @for (entry of entries; let index = $index; track entry.action) {\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"one-header-menu-item\"\n #item\n [tabindex]=\"index === activeIndex ? 0 : -1\"\n (click)=\"onEntrySelected(entry)\"\n (keydown)=\"onItemKeydown($event, index, entry)\">\n <span>{{ entry.label }}</span>\n </button>\n }\n</div>\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneSortModel } from '../models/one-grid-types.model';\n\n@Pipe({\n standalone: true,\n name: 'columnSortState'\n})\nexport class ColumnSortStatePipe implements PipeTransform {\n\n // `readonly`, because this is fed straight from `api.sortModel`, which is\n // now a readonly view rather than the mutable array it used to hand out.\n transform(field: string, sortModel: readonly OneSortModel[]): 'asc' | 'desc' | null {\n\n if (!sortModel || !field) return null;\n\n return sortModel.find(s => s.colId === field)?.sort ?? null;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Maps the grid's sort state onto the values `aria-sort` accepts.\n *\n * The attribute takes `ascending` / `descending` / `none`, not the `asc` /\n * `desc` the sort model uses. `none` is only correct on a column that *can* be\n * sorted — on one that cannot, the attribute is omitted entirely, because\n * \"not sorted\" and \"not sortable\" are different statements.\n */\n@Pipe({\n standalone: true,\n name: 'ariaSort',\n})\nexport class AriaSortPipe implements PipeTransform {\n\n transform(sort: 'asc' | 'desc' | null, sortable: boolean | undefined): string | null {\n\n if (!sortable) return null;\n\n if (sort === 'asc') return 'ascending';\n\n if (sort === 'desc') return 'descending';\n\n return 'none';\n }\n}\n","import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core';\nimport { OneColumnDef, OneGroupColumnDef } from '../../core/models/one-column-def-types.model';\nimport { Subject, Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { OneGridApi } from '../../core/instants/one-grid-api.class';\nimport { OneSortModel } from '../../core/models/one-grid-types.model';\nimport { ColumnChangedEvent } from '../../core/models/one-event-types.model';\nimport { OneFilterModel } from '../../core/models/one-filter.model';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport { resolveColumnWidth } from '../../helpers/one-column-def.helper';\nimport { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport { LucideAngularModule } from 'lucide-angular';\nimport { ONE_GRID_ICON_PROVIDERS } from '../../core/icons/one-grid-icons';\nimport { OneGridCheckboxHeaderComponent } from '../one-grid-checkbox-header/one-grid-checkbox-header.component';\nimport { OneGridHeaderMenuComponent, OneHeaderMenuAction } from '../one-grid-header-menu/one-grid-header-menu.component';\nimport { ColumnSortStatePipe } from '../../core/pipes/column-sort-state.pipe';\nimport { AriaSortPipe } from '../../core/pipes/aria-sort.pipe';\n\n@Component({\n standalone: true,\n imports: [\n NgClass,\n NgStyle,\n NgTemplateOutlet,\n LucideAngularModule,\n OneGridCheckboxHeaderComponent,\n OneGridHeaderMenuComponent,\n ColumnSortStatePipe,\n AriaSortPipe,\n ],\n selector: 'one-grid-header',\n // The host sits between role=\"grid\" and the rows it must own; a generic\n // element there breaks the ownership chain, so it leaves the a11y tree.\n host: { 'role': 'presentation' },\n providers: [ONE_GRID_ICON_PROVIDERS],\n templateUrl: './one-grid-header.component.html',\n styleUrl: './one-grid-header.component.scss'\n})\nexport class OneGridHeaderComponent<T> implements OnInit, AfterViewInit, OnDestroy {\n\n @ViewChild('headerViewport', { static: true }) private headerViewport?: ElementRef<HTMLElement>;\n\n /**\n * Horizontal offset of the body, mirrored here so the header tracks it.\n *\n * Applied to the viewport's `scrollLeft` rather than as a transform on the\n * row: sticky positioning needs a real scrollport above it. The group row,\n * which is a sibling of that viewport, still reads this for its transform.\n */\n @Input()\n set scrollLeft(value: number) {\n\n this._scrollLeft = value ?? 0;\n\n this.applyScrollLeft();\n }\n\n get scrollLeft(): number {\n\n return this._scrollLeft;\n }\n\n private _scrollLeft = 0;\n @Input() allowedEdit: boolean = false;\n @Input() enableGroupColumnDefs: boolean = false;\n @Input() api!: OneGridApi<T>;\n\n protected groupColumnDefs: OneGroupColumnDef[] = [];\n protected columnDefs: OneColumnDef<T>[] = [];\n\n private sortModel: OneSortModel<T>[] = [];\n private subscriptions = new Subscription();\n private draggedIndex: number | null = null;\n /** Where the drag started, for reporting the completed move as one event. */\n private dragSourceIndex: number | null = null;\n\n // Track resize state\n private resizing = false;\n private resizeColumnIndex: number | null = null;\n private startX = 0;\n private startWidth = 0;\n\n constructor(\n private eventService: OneGridEventService,\n private cdr: ChangeDetectorRef,\n private elementRef: ElementRef,\n ) {}\n\n /**\n * Render a filter input under each column whose `filterable` resolves true.\n *\n * The inputs build a contains-filter per column and hand it to\n * `api.setFilterModel`, debounced. Fields without a filter input are left\n * alone: a programmatic filter on a non-filterable column survives typing\n * here, while the filterable fields belong to the row — last writer wins.\n */\n @Input() filterRow: boolean = false;\n\n /** Current filter text per field. */\n protected filterTexts: Record<string, string> = {};\n\n private filterInput$ = new Subject<void>();\n\n /** Debounce for the filter row, in ms. */\n private static readonly FILTER_DEBOUNCE = 200;\n\n protected onFilterInput(col: OneColumnDef<T>, event: Event): void {\n\n this.filterTexts[col.field as string] = (event.target as HTMLInputElement).value;\n\n this.filterInput$.next();\n }\n\n private applyFilterRow(): void {\n\n const managed = new Set(\n this.columnDefs\n .filter(column => column._resolvedFilterable && column.field)\n .map(column => column.field as string),\n );\n\n const preserved = this.api.getFilterModel().filter(entry => !managed.has(entry.field));\n\n const own: OneFilterModel[] = Object.entries(this.filterTexts)\n .filter(([field, text]) => managed.has(field) && text.trim() !== '')\n .map(([field, text]) => ({\n field,\n logicOperator: 'AND' as const,\n conditions: [{ operator: 'contains' as const, value: text.trim() }],\n }));\n\n this.api.setFilterModel([...preserved, ...own]);\n }\n\n ngOnInit(): void {\n\n this.subscriptions.add(\n this.filterInput$\n .pipe(debounceTime(OneGridHeaderComponent.FILTER_DEBOUNCE))\n .subscribe(() => this.applyFilterRow()),\n );\n\n // Listen Column Changed Event\n this.subscriptions.add(this.eventService.addEventListener('columnChanged', (payload: ColumnChangedEvent) => {\n\n const { groups, columns } = payload;\n\n if (groups) {\n\n this.groupColumnDefs = groups as OneGroupColumnDef[];\n }\n\n if (columns) {\n\n this.columnDefs = columns as OneColumnDef[];\n }\n\n // this.cdr.markForCheck();\n }));\n }\n\n ngAfterViewInit(): void {\n\n // The input setter can run before the view exists, so whatever arrived\n // first is applied once here.\n this.applyScrollLeft();\n }\n\n private applyScrollLeft(): void {\n\n if (this.headerViewport) {\n\n this.headerViewport.nativeElement.scrollLeft = this._scrollLeft;\n }\n }\n\n /**\n * Minimum a column can be resized to, by pointer or keyboard.\n *\n * Exposed to the template for `aria-valuemin`, so what the resizer announces\n * and what it enforces cannot drift apart.\n */\n protected readonly MIN_COLUMN_WIDTH = 50;\n\n /**\n * The header's ⋮ button was a div with an empty handler — it rendered,\n * looked interactive, and did nothing at all. Making it keyboard-reachable\n * without giving it a purpose would only have added a dead tab stop per\n * column, so it now reports the press the same way every row action does and\n * the host decides what a column menu means.\n */\n @Output() headerMenuClick = new EventEmitter<OneColumnDef<T>>();\n\n /**\n * Render the grid's default column menu behind the ⋮ button.\n *\n * Opt-in: hosts that bound `(headerMenuClick)` to open their own menu keep\n * exactly the behaviour they had — the intent still emits either way.\n */\n @Input() headerMenu: boolean = false;\n\n /** The column whose default menu is open, or null. */\n protected openMenuColumn: OneColumnDef<T> | null = null;\n\n /** Distance from the header's right edge to the open column's, in px. */\n protected menuOffsetRight = 0;\n\n onHeaderMenuOptionClick(columnDef: OneColumnDef<T>, event?: MouseEvent) {\n\n this.headerMenuClick.emit(columnDef);\n\n if (!this.headerMenu) return;\n\n if (this.openMenuColumn?.id === columnDef.id) {\n\n this.openMenuColumn = null;\n\n return;\n }\n\n // Right-aligned under the opening column. Measured because the menu\n // cannot render inside the column — every box in the header clips — so\n // it sits outside and has to be told where the column is.\n const columnElement = (event?.target as HTMLElement)?.closest('.one-grid-header-column');\n const hostElement = this.elementRef.nativeElement as HTMLElement;\n\n this.menuOffsetRight = columnElement\n ? Math.max(hostElement.getBoundingClientRect().right - columnElement.getBoundingClientRect().right, 0)\n : 0;\n\n this.openMenuColumn = columnDef;\n }\n\n /** The open column's current sort, so the menu offers the other states. */\n protected menuSortState(col: OneColumnDef<T>): 'asc' | 'desc' | null {\n\n return this.api.sortModel.find(entry => entry.colId === col.field)?.sort ?? null;\n }\n\n protected onHeaderMenuAction(action: OneHeaderMenuAction, col: OneColumnDef<T>): void {\n\n switch (action) {\n\n case 'sortAsc':\n case 'sortDesc': {\n\n // Mirrors a sort-button click: a single-column model. The header's own\n // cycle state follows, so the sort button keeps cycling from here.\n this.sortModel = [{ colId: col.field as keyof T, sort: action === 'sortAsc' ? 'asc' : 'desc' }];\n this.api.onSortChanged(this.sortModel);\n return;\n }\n\n case 'clearSort':\n this.sortModel = [];\n this.api.onSortChanged(this.sortModel);\n return;\n\n case 'pinLeft':\n this.api.updateColumn(col.id, { pinned: 'left' });\n return;\n\n case 'pinRight':\n this.api.updateColumn(col.id, { pinned: 'right' });\n return;\n\n case 'unpin':\n this.api.updateColumn(col.id, { pinned: undefined });\n return;\n\n case 'hide':\n this.api.setColumnVisible(col.id, false);\n return;\n }\n }\n\n protected closeHeaderMenu(): void {\n\n this.openMenuColumn = null;\n }\n\n /**\n * Resize from the keyboard.\n *\n * The pointer path is a drag, and WCAG 2.5.7 requires a single-pointer\n * alternative that is not one. Arrows step, shift steps coarser, and\n * Home/End go to the column's own bounds.\n */\n protected onResizeKeydown(event: KeyboardEvent, columnIndex: number): void {\n\n const column = this.columnDefs[columnIndex];\n\n if (!column) return;\n\n const step = event.shiftKey ? 50 : 10;\n const current = column.width ?? resolveColumnWidth(column);\n\n let width: number;\n\n switch (event.key) {\n\n case 'ArrowLeft': width = current - step; break;\n case 'ArrowRight': width = current + step; break;\n case 'Home': width = column.minWidth ?? this.MIN_COLUMN_WIDTH; break;\n case 'End': width = column.maxWidth ?? current + step; break;\n default: return;\n }\n\n event.preventDefault();\n\n const min = Math.max(column.minWidth ?? 0, this.MIN_COLUMN_WIDTH);\n const max = column.maxWidth ?? Number.POSITIVE_INFINITY;\n\n const newWidth = Math.min(Math.max(width, min), max);\n\n // Home at the minimum, End at the maximum: already clamped there, nothing\n // changed, nothing to announce.\n if (newWidth === current) return;\n\n // A hand-resized column stops flexing — otherwise the next reflow would\n // overwrite the width the user just chose.\n this.api.updateColumn(column.id, { width: newWidth, flex: undefined });\n\n this.eventService.dispatchEvent('columnResized', { columnId: column.id, newWidth });\n }\n\n onHeaderMenuSortClick(colId: keyof T) {\n\n const currentSort = this.sortModel.find(sort => sort.colId === colId)?.sort ?? null;\n\n const nextSort = this.cycleSort(currentSort);\n\n this.sortModel = nextSort ? [{ colId, sort: nextSort }] : [];\n\n this.api.onSortChanged(this.sortModel);\n }\n\n // Cycle Sorting Model\n private cycleSort(current: 'asc' | 'desc' | null): 'asc' | 'desc' | null {\n\n switch (current) {\n\n case null: return 'asc';\n\n case 'asc': return 'desc';\n\n case 'desc': return null;\n\n default: return null;\n }\n }\n\n onResizeStart(event: MouseEvent, columnIndex: number): void {\n\n // Prevent text selection and default behavior\n event.preventDefault();\n event.stopPropagation();\n\n // Store initial values\n this.resizing = true;\n this.resizeColumnIndex = columnIndex;\n this.startX = event.clientX;\n\n // Measure what is on screen rather than trusting `col.width`, which is\n // optional: a column sized purely by minWidth had `undefined` here, and\n // `Math.max(50, undefined + deltaX)` is NaN — the column collapsed on the\n // first mouse move and could not be recovered.\n const columnElement = (event.target as HTMLElement)?.closest<HTMLElement>('.one-grid-header-column');\n\n this.startWidth = columnElement?.offsetWidth || resolveColumnWidth(this.columnDefs[columnIndex]);\n\n // Add document-level listeners for drag and release\n document.addEventListener('mousemove', this.onResizeMove);\n document.addEventListener('mouseup', this.onResizeEnd);\n\n // Add a class to body to maintain cursor during drag\n document.body.style.cursor = 'col-resize';\n }\n\n // Arrow function to preserve 'this' context\n private onResizeMove = (event: MouseEvent): void => {\n\n if (!this.resizing || this.resizeColumnIndex === null) return;\n\n // Calculate how far the mouse has moved\n const deltaX = event.clientX - this.startX;\n\n // Calculate new width (with minimum of 50px)\n const newWidth = Math.max(this.MIN_COLUMN_WIDTH, this.startWidth + deltaX);\n\n // Update the column width. A hand-resized column stops flexing, or the\n // next reflow would overwrite the width the user is dragging out.\n this.api.updateColumn(this.columnDefs[this.resizeColumnIndex].id, { width: newWidth, flex: undefined });\n }\n\n private onResizeEnd = (): void => {\n\n // One event per completed gesture, not one per mousemove — and none at all\n // for a click on the handle that never moved.\n if (this.resizeColumnIndex !== null) {\n\n const column = this.columnDefs[this.resizeColumnIndex];\n const newWidth = column?.width ?? this.startWidth;\n\n if (column && newWidth !== this.startWidth) {\n\n this.eventService.dispatchEvent('columnResized', { columnId: column.id, newWidth });\n }\n }\n\n // Clean up\n this.resizing = false;\n this.resizeColumnIndex = null;\n document.body.style.cursor = '';\n\n // Remove document listeners\n document.removeEventListener('mousemove', this.onResizeMove);\n document.removeEventListener('mouseup', this.onResizeEnd);\n }\n\n // Track the dragged column index\n onDragColumnStart(event: DragEvent, index: number): void {\n\n this.draggedIndex = index;\n this.dragSourceIndex = index;\n\n // Optional: Set drag image/effect\n if (event.dataTransfer) {\n\n event.dataTransfer.effectAllowed = 'move';\n }\n }\n\n onDragColumnOver(event: DragEvent, targetIndex: number): void {\n\n event.preventDefault();\n\n // Skip if dragging over itself or no drag in progress\n if (this.draggedIndex === null || this.draggedIndex === targetIndex) {\n\n return;\n }\n\n // IMMEDIATELY reorder columns\n this.api.reorderColumnDefs(this.draggedIndex, targetIndex);\n\n // Update draggedIndex to the new position\n this.draggedIndex = targetIndex;\n }\n\n onDragColumnEnd(event: DragEvent): void {\n\n this.finishColumnDrag();\n }\n\n onDropColumn(event: DragEvent): void {\n\n event.preventDefault();\n\n this.finishColumnDrag();\n }\n\n /**\n * The reorder itself already happened, step by step, during dragover — this\n * only reports the completed move. Both `drop` and `dragend` funnel here and\n * both can fire for one gesture; nulling the indexes makes the second call a\n * no-op, so one gesture reports once.\n */\n private finishColumnDrag(): void {\n\n if (this.draggedIndex !== null && this.dragSourceIndex !== null && this.draggedIndex !== this.dragSourceIndex) {\n\n const column = this.columnDefs[this.draggedIndex];\n\n if (column) {\n\n this.eventService.dispatchEvent('columnMoved', { columnId: column.id, toIndex: this.draggedIndex });\n }\n }\n\n this.draggedIndex = null;\n this.dragSourceIndex = null;\n }\n\n ngOnDestroy(): void {\n\n // This completed an unused Subject and left the real subscription running.\n // It survived only because OneGridEventService is component-scoped and\n // tears its own listeners down — the header was relying on that by accident.\n this.subscriptions.unsubscribe();\n\n // A resize in flight owns two listeners on `document`. Without this they\n // outlive the component, and their closures keep it alive with them.\n if (this.resizing) {\n\n this.onResizeEnd();\n }\n }\n}\n","<div class=\"one-grid-header\" role=\"rowgroup\">\n @if (enableGroupColumnDefs) {\n <div class=\"one-group-header-row\" role=\"presentation\" [style.transform]=\"'translateX(-' + scrollLeft + 'px)'\">\n <ng-container *ngTemplateOutlet=\"groupColumns; context: { groups: groupColumnDefs }\"></ng-container>\n </div>\n }\n <!-- The column row is scrolled rather than translated. `position: sticky`\n resolves against the nearest scrollport, and a transformed ancestor is\n not one — pinned headers could never hold their place inside it. The\n group row above keeps its transform: groups span contiguous columns,\n which pinning reorders, so the two features do not combine. -->\n <div #headerViewport class=\"one-grid-header-viewport\" role=\"presentation\">\n <div class=\"one-header-row\" role=\"row\" aria-rowindex=\"1\">\n <ng-container *ngTemplateOutlet=\"headerColumns; context: { columns: columnDefs }\"></ng-container>\n </div>\n\n <!-- Filter Row (grid opt-in). Lives inside the header viewport so it\n scrolls with the columns and its pinned cells stick the same way. -->\n @if (filterRow) {\n <div class=\"one-filter-row\" role=\"row\" aria-rowindex=\"2\">\n @for (col of columnDefs; track col.id) {\n <div class=\"one-filter-cell\"\n role=\"gridcell\"\n [attr.aria-colindex]=\"$index + 1\"\n [class.one-column-pinned-left]=\"col.pinned === 'left'\"\n [class.one-column-pinned-right]=\"col.pinned === 'right'\"\n [class.one-column-pinned-edge]=\"col._pinnedEdge\"\n [style.left.px]=\"col.pinned === 'left' ? col._pinnedOffset : null\"\n [style.right.px]=\"col.pinned === 'right' ? col._pinnedOffset : null\"\n [style.width.px]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\">\n @if (col._resolvedFilterable && col.field) {\n <input class=\"one-filter-input\"\n type=\"text\"\n [attr.aria-label]=\"'Filter ' + (col.headerName || col.field)\"\n [value]=\"filterTexts[col.field] ?? ''\"\n (input)=\"onFilterInput(col, $event)\" />\n }\n </div>\n }\n </div>\n }\n </div>\n</div>\n\n<!-- The default column menu (grid opt-in). A sibling of the header block\n because everything inside it clips with overflow: hidden; the host\n positions it just below, right-aligned to the opening column. -->\n@if (headerMenu && openMenuColumn) {\n <one-grid-header-menu\n [style.right.px]=\"menuOffsetRight\"\n [column]=\"openMenuColumn\"\n [sortState]=\"menuSortState(openMenuColumn)\"\n [canHide]=\"columnDefs.length > 1\"\n (menuAction)=\"onHeaderMenuAction($event, openMenuColumn)\"\n (menuClose)=\"closeHeaderMenu()\" />\n}\n\n<!-- Group Header Cell Template -->\n<ng-template #groupColumns let-groups=\"groups\">\n @for(group of groups; track group.id) {\n <div class=\"one-group-header-cell\"\n [style.width.px]=\"group.width\"\n [ngClass]=\"group._resolvedGroupClass\"\n [ngStyle]=\"group._resolvedGroupStyle\">\n <div class=\"one-group-header-cell-text\">\n {{ group.headerName }}\n </div>\n </div>\n }\n</ng-template>\n\n<!-- Header Cell Template -->\n<ng-template #headerColumns let-columns=\"columns\">\n @for (col of columns; let colIndex = $index; track col.id) {\n <div class=\"one-grid-header-column\"\n role=\"columnheader\"\n [attr.aria-colindex]=\"colIndex + 1\"\n [attr.aria-sort]=\"col.field | columnSortState:api.sortModel | ariaSort:col._resolvedSortable\"\n [attr.data-index]=\"colIndex\"\n [class.one-column-pinned-left]=\"col.pinned === 'left'\"\n [class.one-column-pinned-right]=\"col.pinned === 'right'\"\n [class.one-column-pinned-edge]=\"col._pinnedEdge\"\n [class.one-column-pinned-edge]=\"col._pinnedEdge\"\n [style.left.px]=\"col.pinned === 'left' ? col._pinnedOffset : null\"\n [style.right.px]=\"col.pinned === 'right' ? col._pinnedOffset : null\"\n [style.width.px]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\"\n [draggable]=\"col._resolvedDragable\"\n (dragstart)=\"onDragColumnStart($event, colIndex)\"\n (dragover)=\"onDragColumnOver($event, colIndex)\"\n (dragend)=\"onDragColumnEnd($event)\"\n (drop)=\"onDropColumn($event)\">\n <div class=\"one-grid-header-cell\"\n [ngClass]=\"col._resolvedHeaderClass\"\n [ngStyle]=\"col._resolvedHeaderStyle\"\n >\n <span class=\"one-grid-header-cell-group\">\n @if (col?.headerCheckboxSelection) {\n <one-grid-checkbox-header\n [api]=\"api\"\n [allowedEdit]=\"allowedEdit\"\n />\n }\n\n {{ col?.headerName ?? '' }}\n </span>\n\n <!-- Og Resize Handler -->\n @if (col._resolvedResizable) {\n <!-- `separator` is the ARIA window-splitter pattern, which is\n what a column resizer is. Focusable and arrow-operable\n because WCAG 2.5.7 requires everything achievable by\n dragging to have a non-dragging alternative. -->\n <div\n class=\"og-resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + (col.headerName || col.field)\"\n [attr.aria-valuenow]=\"col.width\"\n [attr.aria-valuemin]=\"col.minWidth || MIN_COLUMN_WIDTH\"\n [attr.aria-valuemax]=\"col.maxWidth || null\"\n (mousedown)=\"onResizeStart($event, colIndex)\"\n (keydown)=\"onResizeKeydown($event, colIndex)\">\n <i class=\"bi bi-grip-vertical\"></i>\n </div>\n }\n\n <div class=\"one-grid-header-cell-group\">\n\n <!-- Sort Menu Button -->\n @if (col._resolvedSortable) {\n <!-- A button, not a div with a click handler: sorting was\n pointer-only. The current state is not repeated here —\n it is on the columnheader's `aria-sort`, and saying it\n twice makes a screen reader read it twice. -->\n <button\n type=\"button\"\n class=\"one-grid-header-menu-button\"\n [attr.aria-label]=\"'Sort by ' + (col.headerName || col.field)\"\n [title]=\"'Sort by ' + (col.headerName || col.field)\"\n (click)=\"onHeaderMenuSortClick(col.field)\">\n\n @if ((col.field | columnSortState:api.sortModel) === 'asc') {\n <lucide-icon name=\"arrow-up-a-z\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n }\n @else if ((col.field | columnSortState:api.sortModel) === 'desc') {\n <lucide-icon name=\"arrow-down-z-a\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n }\n @else {\n <lucide-icon name=\"arrow-down-up\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n }\n </button>\n }\n\n <!-- Og Option Menu Button -->\n @if (col && !col._resolvedSuppressHeaderMenuButton) {\n <button\n type=\"button\"\n class=\"one-grid-header-menu-button\"\n [attr.aria-label]=\"'Options for ' + (col.headerName || col.field)\"\n [attr.aria-haspopup]=\"headerMenu ? 'menu' : null\"\n [attr.aria-expanded]=\"headerMenu ? openMenuColumn?.id === col.id : null\"\n [title]=\"'Options for ' + (col.headerName || col.field)\"\n (click)=\"onHeaderMenuOptionClick(col, $event)\">\n <i class=\"bi bi-three-dots-vertical\"></i>\n </button>\n }\n </div>\n </div>\n </div>\n }\n</ng-template>\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneCellStates, OneColumnDef } from '../models/one-column-def-types.model';\nimport { OneRowNode } from '../instants/one-row-node.class';\n\n@Pipe({\n name: 'cellEditable',\n standalone: true\n})\nexport class CellEditablePipe implements PipeTransform {\n transform(\n cellStates: OneCellStates,\n column: OneColumnDef,\n node: OneRowNode,\n editable: (column: OneColumnDef, node: OneRowNode) => boolean,\n updatable: (column: OneColumnDef, node: OneRowNode) => boolean,\n allowedEdit: boolean\n ): boolean {\n if (cellStates) {\n return (\n editable(column, node) &&\n updatable(column, node) &&\n allowedEdit &&\n !(\n column?.cellRendererParams?.validateSelectedRowOnly && !node?.selected\n ) &&\n ((node?.leaf &&\n !(node?.group && node?.leafGroup) &&\n !column?.autoGroupField) ||\n (!node?.leaf &&\n (node?.group || node?.leafGroup) &&\n column?.autoGroupField &&\n column?.editableLevels?.includes(node.level)))\n )\n }\n\n return false\n }\n}\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridSelectionService } from '../../core/services/one-grid-selection.service';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport { OneGridApi } from '../../core/instants/one-grid-api.class';\nimport { OneGridRowActionEvent } from '../../core/models/one-grid-types.model';\n\n@Component({\n standalone: true,\n selector: 'one-grid-checkbox',\n templateUrl: './one-grid-checkbox.component.html',\n styleUrl: './one-grid-checkbox.component.scss'\n})\nexport class OneGridCheckboxComponent<T> {\n\n @Input() node: OneRowNode<T>;\n @Input() allowedEdit: boolean = false;\n @Input() api!: OneGridApi<T>;\n @Output() onRowSelection = new EventEmitter<OneGridRowActionEvent<T>>();\n\n constructor(\n private selectionService: OneGridSelectionService,\n private eventService: OneGridEventService\n ) {}\n\n onToggleSelection(event: any) {\n\n const isChecked = event.target.checked;\n const { rowId, rowIndex, data } = this.node;\n\n // The mode rule (single clears the rest, multiple toggles) lives on the api\n // now, so pressing Space on a focused row and clicking this checkbox cannot\n // drift apart. It dispatches `selectionChanged` itself.\n this.api.toggleRowSelection(rowId, isChecked);\n\n this.onRowSelection.emit({ rowIndex, selected: isChecked, data, node: this.node });\n }\n}\n","\n<div class=\"one-grid-checkbox\">\n <input type=\"checkbox\"\n [name]=\"node.rowId\"\n [class.disabled]=\"!(allowedEdit)\"\n [checked]=\"node.selected\"\n (change)=\"onToggleSelection($event)\"/>\n</div>","import { Component, EventEmitter, Input, Output, Type } from '@angular/core';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { ExpansionChangedEvent } from '../../core/models/one-event-types.model';\nimport { OneDetailCellRendererParams } from '../../core/models/one-master-detail.model';\nimport { OneCellRendererComponent } from '../../core/models/one-tree-data.model';\n\n@Component({\n standalone: true,\n selector: 'one-grid-cell-group-renderer',\n templateUrl: './one-grid-cell-group-renderer.component.html',\n styleUrl: './one-grid-cell-group-renderer.component.scss'\n})\nexport class OneGridCellGroupRendererComponent<T> {\n\n @Input() node: OneRowNode<T>;\n @Input() masterDetail: boolean = false;\n @Input() detailCellRendererParams: OneDetailCellRendererParams;\n @Input() detailRendererComponent: Type<OneCellRendererComponent>;\n @Output() expansionChanged = new EventEmitter<ExpansionChangedEvent<T>>();\n\n /**\n * Presentational only: report the click and let the body, which holds the\n * API, perform the toggle. The click is stopped from bubbling so it is not\n * also read as a cell click by the cell underneath.\n */\n invokeChangedClick(event: MouseEvent) {\n\n event.stopPropagation();\n\n this.expansionChanged.emit({ rowIndex: this.node.rowIndex, data: this.node.data, node: this.node });\n }\n}\n","@if (node.expandable) {\n <span class=\"cell-group-renderer\" [style.padding-left.px]=\"6\">\n @if (node.children?.length > 0 || masterDetail) {\n <!-- A real button, not a div with a click handler: this is a\n disclosure control, so it needs to be focusable, operable with\n Enter and Space, and to expose its state via aria-expanded.\n mousedown is stopped so pressing the expander does not also\n begin a cell range selection on the cell underneath. -->\n <button\n type=\"button\"\n class=\"expansion-button\"\n [attr.aria-expanded]=\"node.expanded\"\n [attr.aria-label]=\"node.expanded ? 'Collapse row' : 'Expand row'\"\n (mousedown)=\"$event.stopPropagation()\"\n (dblclick)=\"$event.stopPropagation()\"\n (click)=\"invokeChangedClick($event)\">\n <i [class.node-expanded]=\"node.expanded\" class=\"bi bi-chevron-right expansion-icon\"></i>\n </button>\n }\n </span>\n}\n","import { AfterViewInit, Component, ElementRef, EventEmitter, HostListener, Input, Output, QueryList, ViewChild, ViewChildren } from '@angular/core';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneColumnDef } from '../../core/models/one-column-def-types.model';\nimport { CellOptionMenuSelectedEvent, OneCellOptionMenu } from '../../core/models/one-event-types.model';\n\n@Component({\n selector: 'one-grid-cell-option-menu',\n standalone: true,\n templateUrl: './one-grid-cell-option-menu.component.html',\n styleUrl: './one-grid-cell-option-menu.component.scss',\n})\nexport class OneGridCellOptionMenuComponent implements AfterViewInit {\n\n @Input() column: OneColumnDef = null;\n @Input() node: OneRowNode = null;\n @Input() options: OneCellOptionMenu[] = [];\n @Output() cellOptionMenuSelect = new EventEmitter<CellOptionMenuSelectedEvent>();\n @Output() cellOptionMenuClose = new EventEmitter<void>();\n\n @ViewChildren('item') private items?: QueryList<ElementRef<HTMLButtonElement>>;\n\n /**\n * Roving tabindex: one item is tabbable and the arrows move which. Standard\n * for a menu — a list of separately tabbable buttons makes a keyboard user\n * tab through every option to get past the menu.\n */\n protected activeIndex = 0;\n\n protected get menuLabel(): string {\n\n return `Options for ${this.column?.headerName ?? this.column?.field ?? 'this cell'}`;\n }\n\n constructor(private elementRef: ElementRef) {}\n\n /**\n * Move focus into the menu once it exists.\n *\n * Opening a menu and leaving focus on the trigger strands a keyboard user:\n * the menu is on screen and nothing they press reaches it.\n */\n ngAfterViewInit(): void {\n\n this.focusItem(0);\n }\n\n protected onItemKeydown(event: KeyboardEvent, index: number, option: OneCellOptionMenu): void {\n\n switch (event.key) {\n\n case 'ArrowDown':\n event.preventDefault();\n this.focusItem((index + 1) % this.options.length);\n return;\n\n case 'ArrowUp':\n event.preventDefault();\n this.focusItem((index - 1 + this.options.length) % this.options.length);\n return;\n\n case 'Home':\n event.preventDefault();\n this.focusItem(0);\n return;\n\n case 'End':\n event.preventDefault();\n this.focusItem(this.options.length - 1);\n return;\n\n case 'Enter':\n case ' ':\n // A <button> already activates on both, but only once the default runs.\n // Handling it here keeps the menu's behaviour independent of that.\n event.preventDefault();\n this.onOptionSelected(option);\n return;\n\n default:\n return;\n }\n }\n\n private focusItem(index: number): void {\n\n if (!this.options?.length) return;\n\n this.activeIndex = index;\n\n this.items?.get(index)?.nativeElement?.focus();\n }\n\n // Click outside\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: MouseEvent) {\n\n const target = event.target as HTMLElement;\n\n if (!this.elementRef.nativeElement.contains(target)) {\n\n this.close();\n }\n }\n\n // Escape key\n @HostListener('document:keydown.escape')\n onEscape() {\n\n this.close();\n }\n\n // Scroll closes menu (prevents misalignment)\n @HostListener('document:scroll')\n onScroll() {\n\n this.close();\n }\n\n // Option selected\n onOptionSelected(option: any) {\n\n this.cellOptionMenuSelect.emit({\n column: this.column,\n node: this.node,\n option: option\n });\n this.close();\n }\n\n // Single close method\n private close() {\n\n this.node.cellOptions[this.column.field] = false;\n this.cellOptionMenuClose.emit();\n }\n}\n","<!-- A menu, so it is announced as one and operable from the keyboard: the items\n were `<div (click)>` with no role, which meant the menu could be opened by\n mouse and then not used at all without one. -->\n<div class=\"cell-option-menu\" role=\"menu\" #menuEl [attr.aria-label]=\"menuLabel\">\n @for (opt of options; let index = $index; track opt.value) {\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"cell-option-menu-item\"\n #item\n [tabindex]=\"index === activeIndex ? 0 : -1\"\n (click)=\"onOptionSelected(opt)\"\n (keydown)=\"onItemKeydown($event, index, opt)\">\n <span>{{ opt.text }}</span>\n </button>\n }\n</div>\n","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridRowActionEvent, OneGridType } from '../../core/models/one-grid-types.model';\nimport { OneCellRendererParams, OneColumnDef } from '../../core/models/one-column-def-types.model';\nimport { OneGridCellService } from '../../core/services/one-grid-cell.service';\nimport { NgClass } from '@angular/common';\n\n@Component({\n standalone: true,\n imports: [NgClass],\n selector: 'one-grid-row-action',\n templateUrl: './one-grid-row-action.component.html',\n styleUrl: './one-grid-row-action.component.scss'\n})\nexport class OneGridRowActionComponent<T> implements OnInit {\n\n /**\n * Get Node & Cell Renderer From Parent Component\n */\n @Input({ required: true }) column: OneColumnDef<T>;\n @Input({ required: true }) node: OneRowNode<T>;\n @Input({ required: true }) allowedEdit: boolean = false;\n @Input({ required: false }) masterDetail: boolean = false;\n @Input({ required: false }) masterNode: OneRowNode<T> = null;\n @Input({ required: false }) cellRendererParams: OneCellRendererParams<T>;\n @Input({ required: false }) gridType: OneGridType = null;\n @Input({ required: false }) context: any = null;\n\n /**\n * Bind Event to Parent Component\n */\n @Output() onRowGotoDetail = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowAddNew = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowView = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLocation = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDocument = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowCopy = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDelete = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowGotoList = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowEdit = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowPrint = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowHistory = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowOption = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLanguage = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowCellOption = new EventEmitter<OneGridRowActionEvent<T>>();\n\n protected detailActiveExcludeLevels: Set<number>;\n protected gotoDetailExcludeLevels: Set<number>;\n protected addNewExcludeLevels: Set<number>;\n protected gotoListExcludeLevels: Set<number>;\n\n /**\n * Accessible names for the action buttons.\n *\n * Every one of them is an icon with no text, and none carried a label — a\n * screen reader announced \"button\" and nothing more, fourteen times per row.\n * These are also the `title`, so the icons are identifiable by pointer too.\n */\n protected readonly labels = {\n gotoDetail: 'Open detail',\n addNew: 'Add new row',\n view: 'View row',\n location: 'Show location',\n document: 'Open document',\n copy: 'Copy row',\n delete: 'Delete row',\n gotoList: 'Open list',\n edit: 'Edit row',\n print: 'Print row',\n history: 'View history',\n option: 'Row options',\n language: 'Change language',\n cellOption: 'Cell options',\n } as const;\n\n constructor(private readonly cellService: OneGridCellService) {}\n\n /**\n * Whether this column's action buttons are hidden for this row.\n *\n * The templates read `column?.hideActionButton` directly, which is truthy for\n * any function — so a predicate asking to hide the buttons showed them, and\n * one asking to show them showed them too. Resolved here instead, with the\n * same params every other row-scoped predicate gets.\n */\n protected get hideActionButton(): boolean {\n\n return this.cellService.hideActionButtonFn(this.column as OneColumnDef, this.node as OneRowNode);\n }\n\n /**\n * Whether this column's action buttons are disabled for this row.\n *\n * `disable` used to be resolved by `CellDisableResolverPipe`, which built its\n * own params — a different set from every other row-scoped predicate. It goes\n * through the shared builder now, so `disable` sees exactly what `editable`\n * and `hideActionButton` see.\n */\n protected get actionDisabled(): boolean {\n\n return this.cellService.disableFn(this.column as OneColumnDef, this.node as OneRowNode) || !this.allowedEdit;\n }\n\n ngOnInit(): void {\n\n this.detailActiveExcludeLevels = new Set(this.column.cellRendererParams?.detailActiveExcludeLevels ?? [])\n this.gotoDetailExcludeLevels = new Set(this.column.cellRendererParams?.gotoDetailExcludeLevels ?? [])\n this.addNewExcludeLevels = new Set(this.column.cellRendererParams?.addNewExcludeLevels ?? []);\n this.gotoListExcludeLevels = new Set(this.column.cellRendererParams?.gotoListExcludeLevels ?? []);\n }\n\n /**\n * Trigger Invoke Click Event\n */\n invokeRowToggleDetailActiveExpand(node: OneRowNode): void {\n\n node.detailActive = !node.detailActive;\n }\n\n invokeRowActionGotoDetail(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowGotoDetail.emit(data);\n }\n\n invokeRowActionAddNew(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowAddNew.emit(data);\n }\n\n invokeRowActionView(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowView.emit(data);\n }\n\n invokeRowActionLocation(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowLocation.emit(data);\n }\n\n invokeRowActionDocument(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowDocument.emit(data);\n }\n\n invokeRowActionCopy(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowCopy.emit(data);\n }\n\n invokeRowActionDelete(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowDelete.emit(data);\n }\n\n invokeRowActionGotoList(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowGotoList.emit(data);\n }\n\n invokeRowActionEdit(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowEdit.emit(data);\n }\n\n invokeRowActionPrint(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowPrint.emit(data);\n }\n\n invokeRowActionHistory(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowHistory.emit(data);\n }\n\n invokeRowActionOption(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowOption.emit(data);\n }\n\n invokeRowActionLanguage(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowLanguage.emit(data);\n }\n\n invokeRowActionCellOption(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let data: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n data = { ...data, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onRowCellOption.emit(data);\n }\n}\n","@if ((cellRendererParams && node?.leaf && !column?.autoGroupField && !(node.group && node.leafGroup)) || (column?.rowActionLevels?.includes(node.level) && column?.autoGroupField)) {\n <div class=\"btn-action-container\">\n\n <!-- Expansion Button Status -->\n @if ((cellRendererParams?.detailActiveButtonStatus == 1 && !(detailActiveExcludeLevels?.has(node.level)))) {\n <!-- A button, not an <a> with a click handler: it has no href, so\n it was neither focusable nor operable from the keyboard. -->\n <button\n type=\"button\"\n class=\"btn-action btn-action-plain me-2\"\n [attr.aria-expanded]=\"node.detailActive\"\n [attr.aria-label]=\"node.detailActive ? 'Collapse row' : 'Expand row'\"\n [title]=\"node.detailActive ? 'Collapse' : 'Expand'\"\n (click)=\"invokeRowToggleDetailActiveExpand(node)\">\n\n <i class=\"bi\" [ngClass]=\"{ 'bi-chevron-down': node.detailActive, 'bi-chevron-right': !node.detailActive }\"></i>\n </button>\n }\n\n <!-- Goto Detail Button Status -->\n @if ((cellRendererParams?.gotoDetailButtonStatus == 1 && !(gotoDetailExcludeLevels?.has(node.level))) && (!hideActionButton || allowedEdit)) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [attr.aria-label]=\"labels.gotoDetail\"\n [title]=\"labels.gotoDetail\"\n (click)=\"invokeRowActionGotoDetail(node, column)\">\n\n <i class=\"bi bi-list-task\"></i>\n </button>\n }\n\n <!-- Add New Button Status -->\n @if ((cellRendererParams?.addNewButtonStatus == 1 && !(addNewExcludeLevels?.has(node.level))) && (!hideActionButton || allowedEdit)) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.addNew\"\n [title]=\"labels.addNew\"\n (click)=\"invokeRowActionAddNew(node, column)\">\n\n <i class=\"bi bi-plus\"></i>\n </button>\n }\n\n <!-- View Button Status -->\n @if (cellRendererParams?.viewButtonStatus == 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [attr.aria-label]=\"labels.view\"\n [title]=\"labels.view\"\n (click)=\"invokeRowActionView(node, column)\">\n\n <i class=\"bi bi-eye\"></i>\n </button>\n }\n @if (cellRendererParams?.locationButtonStatus == 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [attr.aria-label]=\"labels.location\"\n [title]=\"labels.location\"\n (click)=\"invokeRowActionLocation(node, column)\">\n\n <i class=\"bi bi-geo-alt\"></i>\n </button>\n }\n\n <!-- Document Button Status -->\n @if (cellRendererParams?.documentButtonStatus == 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [attr.aria-label]=\"labels.document\"\n [title]=\"labels.document\"\n (click)=\"invokeRowActionDocument(node, column)\">\n\n <i class=\"bi bi-file-earmark-text\"></i>\n </button>\n }\n\n <!-- Copy Button Status -->\n @if (cellRendererParams?.copyButtonStatus == 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [attr.aria-label]=\"labels.copy\"\n [title]=\"labels.copy\"\n (click)=\"invokeRowActionCopy(node, column)\">\n\n <i class=\"bi bi-files\"></i>\n </button>\n }\n\n\n <!-- Delete Button Status -->\n @if (cellRendererParams?.deleteButtonStatus == 1 && (!hideActionButton || allowedEdit)) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-danger\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.delete\"\n [title]=\"labels.delete\"\n (click)=\"invokeRowActionDelete(node, column)\">\n\n <i class=\"bi bi-trash3\"></i>\n </button>\n }\n\n <!-- Goto List Button Status -->\n @if ((cellRendererParams?.gotoListButtonStatus === 1 && !(gotoListExcludeLevels?.has(node.level))) && (!hideActionButton || allowedEdit)) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-success\"\n [attr.aria-label]=\"labels.gotoList\"\n [title]=\"labels.gotoList\"\n (click)=\"invokeRowActionGotoList(node, column)\">\n\n <i class=\"bi bi-list-ul\"></i>\n </button>\n }\n\n <!-- Edit Button Status -->\n @if (cellRendererParams?.editButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.edit\"\n [title]=\"labels.edit\"\n (click)=\"invokeRowActionEdit(node, column)\">\n\n <i class=\"bi bi-pencil\"></i>\n </button>\n }\n\n <!-- Print Button Status -->\n @if (cellRendererParams?.printButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.print\"\n [title]=\"labels.print\"\n (click)=\"invokeRowActionPrint(node, column)\">\n\n <i class=\"bi bi-printer\"></i>\n </button>\n }\n\n <!-- History Button Status -->\n @if (cellRendererParams?.historyButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.history\"\n [title]=\"labels.history\"\n (click)=\"invokeRowActionHistory(node, column)\">\n\n <i class=\"bi bi-clock-history\"></i>\n </button>\n }\n\n <!-- Option Button Status -->\n @if (cellRendererParams?.optionButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.option\"\n [title]=\"labels.option\"\n (click)=\"invokeRowActionOption(node, column)\">\n\n <i class=\"bi bi-three-dots-vertical\"></i>\n </button>\n }\n\n <!-- Language Button Status -->\n @if (cellRendererParams?.languageButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.language\"\n [title]=\"labels.language\"\n (click)=\"invokeRowActionLanguage(node, column)\">\n\n <i class=\"bi bi-translate\"></i>\n </button>\n }\n\n <!-- Cell Option Button Status (Context Menu) -->\n @if (cellRendererParams?.cellOptionButtonStatus === 1) {\n <button\n type=\"button\"\n class=\"btn-action btn-action-primary border-0 text-body\"\n [style.background]=\"'transparent'\"\n [class.disabled]=\"actionDisabled\"\n [disabled]=\"actionDisabled\"\n [attr.aria-label]=\"labels.cellOption\"\n [title]=\"labels.cellOption\"\n (click)=\"invokeRowActionCellOption(node, column)\">\n\n <i class=\"bi bi-three-dots-vertical\"></i>\n </button>\n }\n </div>\n}","import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridRowDragService } from '../../core/services/one-grid-row-drag.service';\nimport { OneRowDragEvent, OneRowDragSuppressedReason } from '../../core/models/one-row-drag.model';\nimport { LucideAngularModule } from 'lucide-angular';\nimport { ONE_GRID_ICON_PROVIDERS } from '../../core/icons/one-grid-icons';\n\n/** Why the handle is disabled, in words a user can act on. */\nconst SUPPRESSED_TEXT: Record<OneRowDragSuppressedReason, string> = {\n sorted: 'Rows cannot be reordered while a sort is applied. Clear the sort to reorder.',\n filtered: 'Rows cannot be reordered while a filter is applied. Clear the filter to reorder.',\n treeData: 'Rows cannot be reordered in a tree grid.',\n};\n\n/**\n * The grab handle for one row.\n *\n * A real `<button>`, not a styled div: it has to be focusable and operable from\n * the keyboard, because WCAG 2.5.7 requires everything achievable by dragging\n * to have a non-dragging alternative. Space picks the row up, the arrows move\n * it, space drops it and escape puts it back.\n *\n * When reordering is unavailable the handle is disabled and says why, rather\n * than disappearing — a control that vanishes when the user sorts looks like a\n * bug, and one that silently does nothing is worse.\n */\n@Component({\n standalone: true,\n imports: [LucideAngularModule],\n selector: 'one-grid-row-drag-handle',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [ONE_GRID_ICON_PROVIDERS],\n templateUrl: './one-grid-row-drag-handle.component.html',\n styleUrl: './one-grid-row-drag-handle.component.scss',\n})\nexport class OneGridRowDragHandleComponent<T> {\n\n @Input({ required: true }) node!: OneRowNode<T>;\n\n /** Non-null when the grid's order is not its own; see the model docs. */\n @Input() suppressedReason: OneRowDragSuppressedReason | null = null;\n\n @Output() dragEnd = new EventEmitter<OneRowDragEvent<T>>();\n\n constructor(private readonly dragService: OneGridRowDragService<T>) {}\n\n protected get disabled(): boolean {\n\n return this.suppressedReason !== null;\n }\n\n protected get label(): string {\n\n if (this.suppressedReason) return SUPPRESSED_TEXT[this.suppressedReason];\n\n return this.grabbed\n ? 'Moving row. Arrow keys to move, space to drop, escape to cancel.'\n : 'Drag to reorder row, or press space to move it with the arrow keys.';\n }\n\n /** True while this specific row is the one being moved. */\n protected get grabbed(): boolean {\n\n return this.dragService.state?.rowId === this.node.rowId;\n }\n\n protected onPointerDown(event: PointerEvent): void {\n\n if (this.disabled) return;\n\n // The body starts a cell range selection on mousedown; the handle is not\n // part of that, and a press here must not also select.\n event.stopPropagation();\n\n this.dragService.startPointerDrag(event, this.node, { onEnd: (result) => this.emit(result) });\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n\n if (this.disabled) return;\n\n switch (event.key) {\n\n case ' ':\n case 'Enter':\n event.preventDefault();\n this.dragService.toggleKeyboardDrag(this.node, { onEnd: (result) => this.emit(result) });\n return;\n\n case 'ArrowUp':\n if (!this.grabbed) return;\n event.preventDefault();\n this.dragService.moveKeyboard(-1);\n return;\n\n case 'ArrowDown':\n if (!this.grabbed) return;\n event.preventDefault();\n this.dragService.moveKeyboard(1);\n return;\n\n case 'Escape':\n if (!this.grabbed) return;\n event.preventDefault();\n this.dragService.cancel();\n return;\n\n default:\n return;\n }\n }\n\n /**\n * A row that is picked up and dropped where it started produces no event.\n * Blur while grabbed would otherwise strand the row mid-move, so it cancels.\n */\n protected onBlur(): void {\n\n if (this.grabbed && this.dragService.state?.source === 'keyboard') {\n\n this.dragService.cancel();\n }\n }\n\n private emit(result: OneRowDragEvent<T> | null): void {\n\n if (result) this.dragEnd.emit(result);\n }\n}\n","<button\n type=\"button\"\n class=\"one-row-drag-handle\"\n [class.one-row-drag-handle-grabbed]=\"grabbed\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"label\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\"\n [attr.aria-pressed]=\"disabled ? null : grabbed\"\n [title]=\"label\"\n (pointerdown)=\"onPointerDown($event)\"\n (keydown)=\"onKeyDown($event)\"\n (blur)=\"onBlur()\"\n (click)=\"$event.stopPropagation()\"\n (dblclick)=\"$event.stopPropagation()\">\n <lucide-icon name=\"grip-vertical\" [size]=\"14\" [strokeWidth]=\"2\"></lucide-icon>\n</button>\n","import { Directive, ElementRef, HostListener, Input } from '@angular/core';\nimport { OneCellValidationType } from '../models/one-column-def-types.model';\n\n@Directive({\n standalone: true,\n selector: '[oneCellInputValidator]'\n})\nexport class OneCellInputValidatorDirective {\n\n @Input() validationType?: OneCellValidationType;\n @Input() regex?: string = '';\n\n private readonly MAX_CODE_LENGTH: number = 36;\n private readonly KHMER_CHARACTER_RANGE = /[\\u1780-\\u17FF]/;\n\n constructor(private el: ElementRef<HTMLInputElement>) {}\n\n @HostListener('keypress', ['$event'])\n onKeyPress(event: KeyboardEvent) {\n\n let isValid = false;\n const char = event.key;\n const inputElement = this.el.nativeElement;\n\n switch (this.validationType) {\n\n case 'disabled':\n event.preventDefault();\n return;\n\n case 'integer':\n isValid = /^\\d+$/.test(char);\n break;\n\n case 'code':\n isValid = /[a-zA-Z\\d]/.test(char);\n if (isValid) {\n event.preventDefault();\n if (inputElement.value.length < this.MAX_CODE_LENGTH) {\n inputElement.value += char.toUpperCase();\n }\n }\n return;\n\n case 'title':\n isValid = /^[a-zA-Z\\s\\d]+$/.test(char) || this.KHMER_CHARACTER_RANGE.test(char);\n break;\n\n case 'number':\n isValid = /^[0-9.]$/.test(char) && !(char === '.' && inputElement.value.includes('.'));\n break;\n\n case 'regex':\n isValid = this.regex ? new RegExp(this.regex).test(char) : false;\n break;\n\n default:\n isValid = true;\n }\n\n if (!isValid) {\n event.preventDefault();\n }\n }\n\n @HostListener('keydown', ['$event'])\n onKeyDown(event: KeyboardEvent) {\n\n if (this.validationType === 'disabled') {\n\n event.preventDefault();\n }\n }\n}","import { ComponentRef, Directive, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, Type, ViewContainerRef } from '@angular/core';\nimport { OneCellRendererParams } from '../models/one-column-def-types.model';\nimport { OneCellRendererComponent } from '../models/one-tree-data.model';\nimport { getFieldValue } from '../../helpers/one-cell.helper';\n\n@Directive({\n standalone: true,\n selector: '[oneCellRendererComponent]'\n})\nexport class OneCellRendererComponentDirective implements OnInit, OnChanges, OnDestroy {\n\n @Input({ required: true }) cellRendererComponent!: Type<OneCellRendererComponent>;\n @Input({ required: true }) params: OneCellRendererParams;\n\n private compRef?: ComponentRef<OneCellRendererComponent>;\n private initialized = false;\n\n constructor(private vcr: ViewContainerRef) {}\n\n ngOnInit(): void {\n\n this.initialized = true;\n\n this.createOrUpdateComponent(true);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n\n if (!this.initialized) return;\n\n const componentChanged = changes['cellRendererComponent'];\n \n const paramsChanged = changes['params'];\n\n if (componentChanged) {\n\n this.destroyComponent();\n\n this.createOrUpdateComponent(true);\n\n } else if (paramsChanged) {\n\n this.updateComponentInputs();\n }\n }\n\n private createOrUpdateComponent(forceCreate = false): void {\n\n if (!this.cellRendererComponent) return;\n\n if (forceCreate || !this.compRef) {\n this.vcr.clear();\n this.compRef = this.vcr.createComponent(this.cellRendererComponent);\n }\n\n this.updateComponentInputs();\n }\n\n private updateComponentInputs(): void {\n\n if (!this.compRef?.instance) return;\n\n const instance = this.compRef.instance as OneCellRendererComponent;\n\n if (typeof instance.oneInit === 'function') {\n\n // The body supplies `value` already, and it honours the column's\n // valueGetter. Only derive it here when nothing did — this used to\n // overwrite unconditionally with the raw field, so a column with both a\n // valueGetter and a component renderer showed the underlying field\n // instead of the value every other part of the grid displays.\n const newParams = { ...this.params };\n\n if (newParams.value === undefined) {\n\n newParams.value = getFieldValue(this.params.data, this.params?.columnDef?.field) ?? null;\n }\n\n instance.oneInit(newParams);\n\n } else {\n\n Object.assign(instance, this.params);\n }\n\n // Optional: call change detector if needed\n // if (this.compRef.changeDetectorRef) {\n\n // this.compRef.changeDetectorRef.detectChanges();\n // }\n }\n\n private destroyComponent(): void {\n\n if (this.compRef) {\n\n this.compRef.destroy();\n\n this.compRef = undefined;\n }\n }\n\n ngOnDestroy(): void {\n\n this.destroyComponent();\n }\n}","import { Directive, ElementRef, HostListener, OnDestroy, Renderer2 } from '@angular/core';\n\n/**\n * Reveals a truncated cell in full while the pointer rests on it.\n *\n * Presentation lives in the stylesheet, under `.one-cell-text-expanded`. It\n * used to be applied as inline styles here, one of which was\n * `background: var(--ins-card-bg)` — a token from the application this library\n * was extracted from, which no consumer defines. The expanded cell therefore\n * had a transparent background and its text overlapped the next column. The\n * inline rules also set `z-index` on a statically positioned element, where it\n * does nothing.\n *\n * Overflow is measured on hover rather than after every view check. The old\n * version measured on init and on every text change, and reading `scrollWidth`\n * forces a synchronous layout — several hundred of them per render for a\n * normal viewport, to answer a question only the hovered cell ever asks.\n */\n@Directive({\n standalone: true,\n selector: '[oneCellTextExpand]'\n})\nexport class OneCellTextExpandDirective implements OnDestroy {\n\n private static readonly EXPANDED_CLASS = 'one-cell-text-expanded';\n private static readonly HOVER_DELAY_MS = 800;\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n\n constructor(private cell: ElementRef<HTMLElement>, private renderer: Renderer2) {}\n\n @HostListener('mouseenter')\n onMouseEnter(): void {\n\n const element = this.cell.nativeElement;\n\n // Measured here, so the layout read happens once for the cell being\n // hovered instead of for every cell on screen.\n if (element.scrollWidth <= element.clientWidth) return;\n\n this.timer = setTimeout(() => this.expand(), OneCellTextExpandDirective.HOVER_DELAY_MS);\n }\n\n @HostListener('mouseleave')\n onMouseLeave(): void {\n\n this.collapse();\n }\n\n ngOnDestroy(): void {\n\n this.collapse();\n }\n\n private expand(): void {\n\n this.renderer.addClass(this.cell.nativeElement, OneCellTextExpandDirective.EXPANDED_CLASS);\n }\n\n private collapse(): void {\n\n clearTimeout(this.timer);\n\n this.timer = undefined;\n\n this.renderer.removeClass(this.cell.nativeElement, OneCellTextExpandDirective.EXPANDED_CLASS);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneCellRendererParams } from '../models/one-column-def-types.model';\n\n@Pipe({\n standalone: true,\n name: 'cellActionButtonEnable'\n})\nexport class CellActionButtonEnablePipe<T> implements PipeTransform {\n\n transform(params: OneCellRendererParams<T> | null): boolean {\n\n if (!params) {\n \n return false;\n }\n\n const statusValues = Object.values(params);\n\n return statusValues.some(status => status === 1);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { getCellError } from '../../helpers/one-validation.helper';\nimport { OneCellStates, OneColumnDef } from '../models/one-column-def-types.model';\nimport { OneRowNode } from '../instants/one-row-node.class';\n\n@Pipe({\n standalone: true,\n name: 'cellInvalid'\n})\nexport class CellInvalidPipe<T> implements PipeTransform {\n\n transform(cellStates: OneCellStates, value: any, column: OneColumnDef<T>, node: OneRowNode<T>, allowedEdit: boolean, submitted: boolean): boolean {\n\n if (!column.validationRules?.length) {\n\n return false;\n }\n\n return getCellError(column, node, value, node.data) !== null && !(node.editing[column.field]) && !(column?.cellRendererParams?.validateSelectedRowOnly && !node?.selected) && allowedEdit && submitted;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { getCellKey } from '../../helpers/one-cell.helper';\n\n@Pipe({\n standalone: true,\n name: 'cellKey'\n})\nexport class CellKeyPipe implements PipeTransform {\n\n transform(rowId?: string | null, field?: string | null): string {\n\n if (!rowId || !field) {\n\n return '';\n }\n\n return getCellKey(rowId, field);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneRowNode } from '../instants/one-row-node.class';\n\n@Pipe({\n standalone: true,\n name: 'cellLevelPadding'\n})\nexport class CellLevelPaddingPipe implements PipeTransform {\n\n transform(level: number, factor: number): number {\n\n level += 1;\n \n return level * factor;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { getCellKey } from '../../helpers/one-cell.helper';\n\n@Pipe({\n standalone: true,\n name: 'cellSelected'\n})\nexport class CellSelectedPipe implements PipeTransform {\n\n transform(selectedCells: Set<string>, rowId: string, field: string): boolean {\n\n if (!selectedCells) return false;\n\n return selectedCells.has(getCellKey(rowId, field));\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { OneCellStates } from '../models/one-column-def-types.model';\n\n@Pipe({\n standalone: true,\n name: 'cellStateRenderer'\n})\nexport class CellStateRendererPipe implements PipeTransform {\n\n transform(cellStates: OneCellStates | null | undefined, field: string): string {\n\n const value = cellStates?.[field]?.value;\n\n if (value === null || value === undefined) {\n\n return null;\n }\n \n if (typeof value === 'string' && value.trim() === '') {\n\n return null;\n }\n\n return value;\n }\n}\n","import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output, QueryList, TemplateRef, Type, ViewChild, ViewChildren } from '@angular/core';\nimport { CellSelection, OneCellPresentationParams, OneCellRendererParams, OneColumnDef } from '../../core/models/one-column-def-types.model';\nimport { OneCellRendererComponent } from '../../core/models/one-tree-data.model';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridApi } from '../../core/instants/one-grid-api.class';\nimport { Subject, Subscription } from 'rxjs';\nimport { filter, take } from 'rxjs/operators';\nimport { OneGridGetRowIdParams, OneGridReadyEvent, OneGridRowActionEvent, OneGridType } from '../../core/models/one-grid-types.model';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport { CellOptionMenuSelectedEvent, ColumnChangedEvent, ExpansionChangedEvent, PinnedRowDataChangedEvent, RowDataChangedEvent, RowOrderChangedEvent, SelectionChangedEvent, SortChangedEvent } from '../../core/models/one-event-types.model';\nimport { OneDetailCellRendererParams } from '../../core/models/one-master-detail.model';\nimport { CellEditablePipe } from '../../core/pipes/cell-editable.pipe';\nimport { getCellKey, getFieldValue } from '../../helpers/one-cell.helper';\nimport { OneGridCellService } from '../../core/services/one-grid-cell.service';\nimport { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';\nimport { OgColumnService } from '../../core/services/og-column.service';\nimport { resolveColumnWidth } from '../../helpers/one-column-def.helper';\nimport { OneGridRowDragService } from '../../core/services/one-grid-row-drag.service';\nimport { OneRowDragEvent, OneRowDragState, OneRowDragSuppressedReason } from '../../core/models/one-row-drag.model';\nimport { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport { OneGridCheckboxComponent } from '../one-grid-checkbox/one-grid-checkbox.component';\nimport { OneGridCellGroupRendererComponent } from '../one-grid-cell-group-renderer/one-grid-cell-group-renderer.component';\nimport { OneGridCellOptionMenuComponent } from '../one-grid-cell-option-menu/one-grid-cell-option-menu.component';\nimport { OneGridRowActionComponent } from '../one-grid-row-action/one-grid-row-action.component';\nimport { OneGridRowDragHandleComponent } from '../one-grid-row-drag-handle/one-grid-row-drag-handle.component';\nimport { OneCellInputValidatorDirective } from '../../core/directives/one-cell-input-validator.directive';\nimport { OneCellRendererComponentDirective } from '../../core/directives/one-cell-renderer-component.directive';\nimport { OneCellTextExpandDirective } from '../../core/directives/one-cell-text-expand.directive';\nimport { CellActionButtonEnablePipe } from '../../core/pipes/cell-action-button-enable.pipe';\nimport { CellInvalidPipe } from '../../core/pipes/cell-invalid.pipe';\nimport { CellKeyPipe } from '../../core/pipes/cell-key.pipe';\nimport { CellLevelPaddingPipe } from '../../core/pipes/cell-level-padding.pipe';\nimport { CellSelectedPipe } from '../../core/pipes/cell-selected.pipe';\nimport { CellStateRendererPipe } from '../../core/pipes/cell-state-renderer.pipe';\n\n@Component({\n standalone: true,\n imports: [\n NgClass,\n NgStyle,\n NgTemplateOutlet,\n ScrollingModule,\n OneGridCheckboxComponent,\n OneGridCellGroupRendererComponent,\n OneGridCellOptionMenuComponent,\n OneGridRowActionComponent,\n OneGridRowDragHandleComponent,\n OneCellInputValidatorDirective,\n OneCellRendererComponentDirective,\n OneCellTextExpandDirective,\n CellActionButtonEnablePipe,\n CellEditablePipe,\n CellInvalidPipe,\n CellKeyPipe,\n CellLevelPaddingPipe,\n CellSelectedPipe,\n CellStateRendererPipe,\n ],\n selector: 'one-grid-body',\n // The host sits between role=\"grid\" and the rows it must own; a generic\n // element there breaks the ownership chain, so it leaves the a11y tree.\n host: { 'role': 'presentation' },\n templateUrl: './one-grid-body.component.html',\n styleUrl: './one-grid-body.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class OneGridBodyComponent<T> implements OnInit, AfterViewInit, OnDestroy {\n\n /**\n * Core Properties\n */\n @ViewChild('bodyRef', { static: true }) bodyRef!: ElementRef<HTMLElement>;\n @Input({ required: true }) rowData: T[] = [];\n @Input() rowNumber: boolean;\n @Input() api!: OneGridApi<T>;\n @Input() pagination: boolean = false;\n @Input() allowedEdit: boolean = true;\n @Input() enableGroupColumnDefs: boolean = false;\n @Input() submitted: boolean = false;\n\n /**\n * `'fullRow'`: a double-click opens every editable cell of the row, Enter or\n * focus leaving the row commits them together, Escape closes them all\n * without committing. Default: one cell at a time.\n */\n @Input() editType: 'fullRow' | null = null;\n @Input() context: any = null;\n @Input() getRowId: (params: OneGridGetRowIdParams<T>) => string;\n @Input({ required: true }) gridCopy$!: Subject<ClipboardEvent>;\n\n /**\n * Pinned rows are bound only so the component re-renders when they change;\n * the nodes themselves come from the API, which owns them.\n */\n @Input() pinnedTopRowData: T[] = [];\n @Input() pinnedBottomRowData: T[] = [];\n\n /**\n * The pinned row containers sit outside the scroll viewport, so they have to\n * be told the horizontal offset — the same arrangement the header uses.\n */\n @ViewChildren('pinnedViewport') private pinnedViewports?: QueryList<ElementRef<HTMLElement>>;\n\n protected pinnedTopNodes: OneRowNode<T>[] = [];\n protected pinnedBottomNodes: OneRowNode<T>[] = [];\n @ViewChild(CdkVirtualScrollViewport) viewport!: CdkVirtualScrollViewport;\n\n protected columnDefs: OneColumnDef<T>[] = [];\n protected cellRenderer: boolean = false;\n\n /**\n * Master Detail Properties\n */\n @Input() gridType: OneGridType = 'simple';\n @Input() masterDetail: boolean = false;\n @Input() masterNode: OneRowNode<T> = null;\n // @Input() detailRowHeight: number = null;\n // @Input() detailRowAutoHeight: boolean = false;\n @Input() detailRowMaxHeight: number = null;\n @Input() detailCellRendererParams: OneDetailCellRendererParams;\n @Input() detailGridTemplate: TemplateRef<unknown> = null;\n @Input() detailRendererComponent: Type<OneCellRendererComponent>;\n\n /**\n * Tree Data Properties\n */\n @Input() treeData: boolean = false;\n @Input() treeDataChildrenField: string;\n @Input() autoGroupColumnDef: OneColumnDef<T>;\n @Input() groupDefaultExpanded: number = -1; // It's work with master detail also\n\n /**\n * Passing Row Action Events to Parent\n */\n @Output() onRowGotoDetail = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowAddNew = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowView = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowCopy = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLocation = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDocument = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDelete = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowGotoList = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowEdit = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowPrint = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowHistory = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowOption = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLanguage = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowCellOption = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowSelection = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onShiftDoubleClick = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() rowCountChanged = new EventEmitter<number>();\n\n @Output() expansionChanged = new EventEmitter<ExpansionChangedEvent<T>>();\n @Output() bodyScroll = new EventEmitter<number>();\n @Output() cellOptionSelect = new EventEmitter<any>();\n @Output() rowDragEnd = new EventEmitter<OneRowDragEvent<T>>();\n\n /**\n * Selection Range Variables\n */\n protected rowWidth: number = 0;\n protected nodes: OneRowNode<T>[] = [];\n\n /**\n * Row drag state, mirrored from the service so the template can read it\n * synchronously. `null` whenever no drag is in flight.\n */\n protected dragState: OneRowDragState | null = null;\n protected dragAnnouncement = '';\n protected rowDragSuppressed: OneRowDragSuppressedReason | null = null;\n protected selectedCells = new Set<string>();\n private isMouseDown = false;\n private startCell: CellSelection = null;\n private lastScrollLeft = 0;\n private cellEditablePipe = new CellEditablePipe();\n private subscriptions = new Subscription();\n\n protected cellRendererParams: OneCellRendererParams = {\n gotoDetailButtonStatus: 1,\n addNewButtonStatus: 1,\n viewButtonStatus: 1,\n locationButtonStatus: 1,\n documentButtonStatus: 1,\n copyButtonStatus: 1,\n deleteButtonStatus: 1,\n gotoListButtonStatus: 1,\n optionButtonStatus: 1,\n languageButtonStatus: 1,\n editButtonStatus: 1,\n printButtonStatus: 1,\n historyButtonStatus: 1,\n }\n\n /**\n * Virtual Scroll Properties\n */\n protected itemSize: number = 30;\n protected minBufferPx: number = 200;\n protected maxBufferPx: number = 400;\n\n constructor(\n protected colService: OgColumnService,\n protected cellService: OneGridCellService,\n private eventService: OneGridEventService,\n protected rowDragService: OneGridRowDragService<T>,\n private cdr: ChangeDetectorRef\n ) { }\n\n ngOnInit(): void {\n\n /**\n * Listen Grid Copy Event\n */\n this.subscriptions.add(this.gridCopy$.subscribe((event: ClipboardEvent) => {\n\n this.onGridCopy(event);\n }));\n\n /**\n * Row drag\n *\n * The service owns the gesture; the body only renders it and lends it the\n * viewport, the row height and a way to apply a move. The suppression\n * reason is re-read on every event that could change the order, so the\n * handle disables itself the moment a sort or filter is applied.\n */\n this.subscriptions.add(this.rowDragService.state$.subscribe((state) => {\n\n this.dragState = state;\n\n this.updateDropIndicator();\n\n this.cdr.markForCheck();\n }));\n\n this.subscriptions.add(this.rowDragService.announcement$.subscribe((message) => {\n\n this.dragAnnouncement = message;\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Column Changed Event\n */\n this.subscriptions.add(this.eventService.addEventListener('columnChanged', (payload: ColumnChangedEvent) => {\n\n this.columnDefs = [...payload.columns] as OneColumnDef[];\n\n // Params carry the columnDef, so a column change invalidates them all.\n this.rendererParamsCache.clear();\n\n this.cellRenderer = this.columnDefs.some(col => col.cellRendererComponent);\n\n this.rowWidth = this.columnDefs.reduce((sum, col) => sum + resolveColumnWidth(col), 0);\n\n // A column change can alter the width left for flex columns (a hide, a\n // resize, new defs). Re-flexing only dispatches when a width actually\n // changes, so this cannot ping-pong.\n this.applyFlexWidths();\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Row Data Changed Event\n */\n this.subscriptions.add(this.eventService.addEventListener('rowDataChanged', ({ nodes: allNodes }: RowDataChangedEvent<T>) => {\n\n // The full post-filter count, reported before the page slice is taken,\n // so the host's paging totals see everything.\n this.rowCountChanged.emit(allNodes?.length ?? 0);\n\n // New rows, new renderer params — and removed rows leave no stale\n // cache entries behind.\n this.rendererParamsCache.clear();\n\n const nodes = this.api.pageNodes(allNodes);\n\n setTimeout(() => {\n\n this.viewport?.checkViewportSize();\n\n this.setVirtualScroll(nodes?.length);\n\n if (this.masterDetail) {\n\n this.nodes = nodes.map((node: OneRowNode) => {\n\n if (node.leaf && this.detailRendererComponent) {\n\n node.detailRendererComponent = this.detailRendererComponent;\n }\n\n // Detail rows can still be in flight when a row is expanded, and\n // spreading null throws. Nothing to re-seed until they arrive.\n if (node.expanded && node.detailRowData) {\n\n this.api.setDetailRowData(node, [...node.detailRowData]);\n }\n\n return node;\n });\n\n } else {\n\n this.nodes = nodes as OneRowNode<T>[];\n }\n\n this.refreshRowDragSuppressed();\n\n this.cdr.markForCheck();\n });\n }));\n\n\n /**\n * Listen Pinned Row Data Changed Event\n */\n this.subscriptions.add(this.eventService.addEventListener('pinnedRowDataChanged', ({ side, nodes }: PinnedRowDataChangedEvent<T>) => {\n\n this.rendererParamsCache.clear();\n\n if (side === 'top') {\n\n this.pinnedTopNodes = nodes as OneRowNode<T>[];\n\n } else {\n\n this.pinnedBottomNodes = nodes as OneRowNode<T>[];\n }\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Sort Changed Event\n */\n this.subscriptions.add(this.eventService.addEventListener('sortChanged', ({ nodes }: SortChangedEvent) => {\n\n this.nodes = this.api.pageNodes(nodes as OneRowNode<T>[]);\n\n // Sorting takes ownership of the order away from the user, so the handles\n // have to disable in the same frame the rows re-sort.\n this.refreshRowDragSuppressed();\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Row Order Changed Event\n *\n * Deliberately not folded into `rowDataChanged`: that path defers a frame\n * and re-seeds detail rows, which is right for a data load and far too much\n * for a move. A reorder is the same nodes in a different order.\n */\n this.subscriptions.add(this.eventService.addEventListener('rowOrderChanged', ({ nodes }: RowOrderChangedEvent<T>) => {\n\n this.nodes = this.api.pageNodes([...nodes] as OneRowNode<T>[]);\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Cell State Changed Event\n *\n * The body renders OnPush, so regenerating a row's cell state is invisible\n * until something marks the body dirty. This is that something.\n */\n this.subscriptions.add(this.eventService.addEventListener('cellStateChanged', () => {\n\n this.cdr.markForCheck();\n }));\n\n /**\n * Listen Selection Changed Event\n */\n this.subscriptions.add(this.eventService.addEventListener('selectionChanged', (payload: SelectionChangedEvent<T>) => {\n\n if (payload) {\n\n this.cdr.markForCheck();\n }\n }));\n }\n\n onGridReady(params: OneGridReadyEvent) {\n\n params.api.setRowData(this.masterNode?.detailRowData ?? []);\n }\n\n onBodyScroll(event: Event) {\n\n const scrollLeft = (event.target as HTMLElement).scrollLeft;\n\n if (scrollLeft !== this.lastScrollLeft) {\n\n this.lastScrollLeft = scrollLeft;\n\n this.syncPinnedRows(scrollLeft);\n\n this.bodyScroll.emit(scrollLeft);\n\n // The indicator is clipped to the row content, which moves sideways too.\n if (this.dragState) {\n\n this.updateDropIndicator();\n\n this.cdr.markForCheck();\n }\n\n return;\n }\n\n // Vertical: the drop indicator is anchored to the body, not the content, so\n // it has to be repositioned as the rows move beneath it — which they do on\n // their own during auto-scroll, with the pointer standing still.\n if (this.dragState) {\n\n this.updateDropIndicator();\n\n this.cdr.markForCheck();\n }\n }\n\n /**\n * Keep the pinned rows in step with the body's horizontal position.\n *\n * Assigned rather than transformed, for the same reason as the header: sticky\n * positioning for pinned *columns* has to resolve against a real scrollport,\n * and a transformed ancestor is not one. Pinned rows and pinned columns\n * therefore compose — a frozen corner cell stays frozen on both axes.\n */\n private syncPinnedRows(scrollLeft: number): void {\n\n this.pinnedViewports?.forEach(viewport => (viewport.nativeElement.scrollLeft = scrollLeft));\n }\n\n /**\n * Track Rendering Row Node By Row ID\n */\n trackByRowId(index: number, node: OneRowNode<T>): string {\n\n return node.rowId;\n }\n\n /**\n * Cell Selection Range Feature\n */\n startSelection(rowId: string, field: string) {\n\n this.isMouseDown = true;\n this.startCell = { rowId, field };\n this.selectedCells.clear();\n this.selectedCells = new Set(this.selectedCells).add(getCellKey(rowId, field));\n }\n\n extendSelection(rowId: string, field: string) {\n\n if (!this.isMouseDown || !this.startCell) return;\n\n const rows = this.nodes; // already sorted\n const startRowIndex = rows.findIndex(r => r.rowId === this.startCell!.rowId);\n const endRowIndex = rows.findIndex(r => r.rowId === rowId);\n\n if (startRowIndex === -1 || endRowIndex === -1) return;\n\n const colStartIndex = this.columnDefs.findIndex(c => c.field === this.startCell!.field);\n const colEndIndex = this.columnDefs.findIndex(c => c.field === field);\n\n if (colStartIndex === -1 || colEndIndex === -1) return;\n\n const rowStart = Math.min(startRowIndex, endRowIndex);\n const rowEnd = Math.max(startRowIndex, endRowIndex);\n const colStart = Math.min(colStartIndex, colEndIndex);\n const colEnd = Math.max(colStartIndex, colEndIndex);\n\n const next = new Set<string>();\n\n for (let r = rowStart; r <= rowEnd; r++) {\n for (let c = colStart; c <= colEnd; c++) {\n next.add(getCellKey(rows[r].rowId, this.columnDefs[c].field));\n }\n }\n\n this.selectedCells = next;\n }\n\n\n endSelection() {\n\n this.isMouseDown = false;\n this.startCell = null;\n }\n\n /**\n * Clear Cells Selected\n */\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: MouseEvent): void {\n\n if (this.bodyRef?.nativeElement) {\n\n const clickedInside = this.bodyRef.nativeElement.contains(event.target as Node);\n\n if (!clickedInside) {\n\n this.selectedCells.clear();\n }\n }\n }\n\n /**\n * Selection Range Event Hold Mouse Click\n */\n @HostListener('document:mouseup')\n onGlobalMouseUp() {\n\n this.endSelection();\n }\n\n /**\n * Listen Copy Clipboard Event\n */\n onGridCopy(event: ClipboardEvent) {\n\n event.preventDefault();\n\n if (this.selectedCells.size > 0) {\n\n const text = this.buildClipboardText();\n\n event.clipboardData?.setData('text/plain', text);\n\n this.selectedCells.forEach(cellId => {\n\n const cellElement = document.querySelector(`[data-cell-id=\"${cellId}\"]`);\n\n if (cellElement) {\n\n cellElement.classList.add('one-cell-copied');\n\n setTimeout(() => cellElement.classList.remove('one-cell-copied'), 400);\n }\n });\n }\n }\n\n copyToClipboard(value: string) {\n\n if (navigator.clipboard?.writeText) {\n\n navigator.clipboard.writeText(value);\n\n } else {\n\n // Fallback (Safari / older browsers)\n const textarea = document.createElement('textarea');\n textarea.value = value;\n textarea.style.position = 'fixed';\n textarea.style.opacity = '0';\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n }\n }\n\n /**\n * Build Copy Cell Text to Clipboard\n */\n private buildClipboardText(): string {\n\n if (!this.selectedCells.size) return '';\n\n // Parse selected cells\n const selected = Array.from(this.selectedCells).map(key => {\n\n const [rowId, field] = key.split('--');\n return { rowId, field };\n });\n\n // Resolve visual row indexes from displayedRows\n const rowIndexes = selected\n .map(s => this.nodes.findIndex(r => r.rowId === s.rowId))\n .filter(i => i !== -1);\n\n const colIndexes = selected\n .map(s => this.columnDefs.findIndex(c => c.field === s.field))\n .filter(i => i !== -1);\n\n if (!rowIndexes.length || !colIndexes.length) return '';\n\n const rowStart = Math.min(...rowIndexes);\n const rowEnd = Math.max(...rowIndexes);\n const colStart = Math.min(...colIndexes);\n const colEnd = Math.max(...colIndexes);\n\n const selectedFields = this.columnDefs\n .slice(colStart, colEnd + 1)\n .map(c => c.field);\n\n const clipboardLines: string[] = [];\n\n for (let r = rowStart; r <= rowEnd; r++) {\n\n const row = this.nodes[r];\n const line = selectedFields\n .map(field => {\n\n const key = `${row.rowId}--${field}`;\n\n if (!this.selectedCells.has(key)) {\n\n return '';\n }\n const value = getFieldValue(row.data, field);\n\n return value ?? '';\n\n }).join('\\t');\n\n clipboardLines.push(line);\n }\n\n return clipboardLines.join('\\n');\n }\n\n /**\n * Binding Events Row Action to Parent\n */\n invokeRowActionGotoDetail(event: OneGridRowActionEvent<T>) {\n\n this.onRowGotoDetail.emit(event);\n }\n\n invokeRowActionAddNew(event: OneGridRowActionEvent<T>) {\n\n this.onRowAddNew.emit(event);\n }\n\n invokeRowActionView(event: OneGridRowActionEvent<T>) {\n\n this.onRowView.emit(event);\n }\n\n invokeRowActionLocation(event: OneGridRowActionEvent<T>) {\n\n this.onRowLocation.emit(event);\n }\n\n invokeRowActionDocument(event: OneGridRowActionEvent<T>) {\n\n this.onRowDocument.emit(event);\n }\n\n invokeRowActionCopy(event: OneGridRowActionEvent<T>) {\n\n this.onRowCopy.emit(event);\n }\n\n invokeRowActionDelete(event: OneGridRowActionEvent<T>) {\n\n this.onRowDelete.emit(event);\n }\n\n invokeRowActionGotoList(event: OneGridRowActionEvent<T>) {\n\n this.onRowGotoList.emit(event);\n }\n\n invokeRowActionEdit(event: OneGridRowActionEvent<T>) {\n\n this.onRowEdit.emit(event);\n }\n\n invokeRowActionPrint(event: OneGridRowActionEvent<T>) {\n\n this.onRowPrint.emit(event);\n }\n\n invokeRowActionHistory(event: OneGridRowActionEvent<T>) {\n\n this.onRowHistory.emit(event);\n }\n\n invokeRowActionOption(event: OneGridRowActionEvent<T>) {\n\n this.onRowOption.emit(event);\n }\n\n invokeRowActionLanguage(event: OneGridRowActionEvent<T>) {\n\n this.onRowLanguage.emit(event);\n }\n\n /**\n * Open the cell option menu, and tell the host it was asked for.\n *\n * The opening is the part that was missing. Everything else existed — the\n * trigger button behind `cellRendererParams.cellOptionButtonStatus`, the menu\n * component, the `cellOptionMenu` column property, the selection event wired\n * through to the grid's output — but nothing ever set the flag the template\n * renders on, so the button did nothing at all.\n *\n * Done here rather than in the row-action component because this is the\n * component whose template renders the menu, and so the one that has to be\n * marked for check.\n */\n invokeRowActionCellOption(event: OneGridRowActionEvent<T>) {\n\n const field = event.column?.field as string;\n\n // Nothing to open when the column declared no options; the event still\n // goes to the host, which may be driving something of its own.\n if (field && event.node && event.column?.cellOptionMenu?.length) {\n\n event.node.cellOptions[field] = true;\n\n this.cdr.markForCheck();\n }\n\n this.onRowCellOption.emit(event);\n }\n\n /**\n * The menu closed itself — on select, on Escape, or on a click outside. It\n * has already cleared its own flag; this is what repaints without it.\n */\n cellOptionMenuClosed(): void {\n\n this.cdr.markForCheck();\n }\n\n invokeRowActionSelection(event: OneGridRowActionEvent<T>) {\n\n this.onRowSelection.emit(event);\n }\n\n /**\n * Toggle a group / master row, then report the result.\n *\n * The group renderer is presentational: it says \"the expander was clicked\"\n * and nothing more. Performing the state change belongs here, where the API\n * is available. Previously this method only re-emitted, so the expander\n * rendered, animated on hover and did nothing at all — every consumer had to\n * discover for itself that `expansionChanged` was a request rather than the\n * notification its past-tense name promises.\n *\n * The event is re-emitted *after* the toggle, so `event.node.expanded` is the\n * new state, which is what a past-tense event should carry.\n */\n invokeExpansionChangedClick(event: ExpansionChangedEvent): void {\n\n const node = this.api.getRowNodeById(event.node.rowId) ?? event.node;\n\n this.api.setExpandedById(node.rowId, !node.expanded);\n\n this.expansionChanged.emit({ ...event, node, api: this.api });\n }\n\n cellOptionMenuSelected(event: CellOptionMenuSelectedEvent) {\n\n this.cellOptionSelect.emit(event);\n }\n\n /**\n * Special Events\n */\n private invokeShiftDoubleClick(node:OneRowNode, column: OneColumnDef): void {\n\n let event: OneGridRowActionEvent = { node, column, data: node.data, rowIndex: node.rowIndex, gridType: null };\n\n if (this.masterDetail) {\n\n event = { ...event, gridType: this.gridType, masterNode: this.masterNode };\n }\n\n this.onShiftDoubleClick.emit(event);\n }\n\n /**\n * Cell Edit Feature\n */\n startEdit(event: MouseEvent, node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n const target = event.target as HTMLElement;\n\n if (target.tagName.toLowerCase() === 'i') {\n\n return;\n }\n\n if (event.shiftKey) {\n\n this.invokeShiftDoubleClick(node, column);\n return;\n }\n\n if (!this.cellEditablePipe.transform(node.cellStates, column, node, this.cellService.editableFn, this.cellService.updatableFn, this.allowedEdit)) {\n\n this.selectedCells.clear();\n\n const cellKey = getCellKey(node.rowId, column.field);\n\n this.selectedCells.add(cellKey);\n\n return;\n }\n\n let rowNode: OneRowNode = this.api.getRowNodeById(node.rowId);\n\n if (rowNode) {\n\n if (this.editType === 'fullRow') {\n\n // The whole row edits together, so every cell that would accept its\n // own double-click opens now. The clicked one still takes focus below.\n for (const col of this.columnDefs) {\n\n if (!col.field) continue;\n\n if (this.cellEditablePipe.transform(rowNode.cellStates, col, rowNode, this.cellService.editableFn, this.cellService.updatableFn, this.allowedEdit)) {\n\n rowNode.editing[col.field] = true;\n }\n }\n\n } else {\n\n rowNode.editing[column.field] = true;\n }\n\n setTimeout(() => {\n\n const input = document.querySelector<HTMLInputElement | HTMLSelectElement>(`[data-cell-id=\"${ getCellKey(node.rowId, column.field) }\"] input, [data-cell-id=\"${ getCellKey(node.rowId, column.field) }\"] select`);\n\n if (input) {\n\n input.focus();\n\n const value = input.value;\n\n // A select reports type 'select-one', so only a text input gets its\n // caret placed.\n if (value && [\"text\"].includes(input.type) && 'setSelectionRange' in input) {\n\n input.setSelectionRange(value.length, value.length);\n }\n }\n }, 10);\n }\n }\n\n /**\n * Save Cell Edit Mode\n */\n stopEdit(node: OneRowNode<T>, column: OneColumnDef<T>, event: any) {\n\n if (this.editType === 'fullRow') {\n\n this.stopRowEditFromEvent(node, event);\n\n return;\n }\n\n let rowNode: OneRowNode = this.api.getRowNodeById(node.rowId);\n\n // The editing guard makes a second commit for one edit a no-op: a select\n // commits on (change), which closes the editor, and the (blur) that can\n // follow must not commit again.\n if (rowNode && rowNode.editing[column.field]) {\n\n event.preventDefault();\n event.stopPropagation();\n\n const value = event.target.value ?? '';\n const oldValue = rowNode.data[column.field];\n\n this.setCellValueByRowId(node.rowId, column, value);\n\n this.finishEdit(rowNode, column, oldValue);\n }\n }\n\n /**\n * Save a `select` editor's choice.\n *\n * Separate from `stopEdit` because the value is not the element's string:\n * the chosen index maps back into `selectOptions`, so the committed value\n * keeps whatever type the option declared.\n */\n stopEditSelect(node: OneRowNode<T>, column: OneColumnDef<T>, event: any) {\n\n if (this.editType === 'fullRow') {\n\n // (change) is not a commit in full-row mode — the choice sits in the\n // select until the row commits and reads every editor at once. Only a\n // blur that actually leaves the row closes it.\n if (event.type === 'blur') this.stopRowEditFromEvent(node, event);\n\n return;\n }\n\n let rowNode: OneRowNode = this.api.getRowNodeById(node.rowId);\n\n if (rowNode && rowNode.editing[column.field]) {\n\n event.stopPropagation();\n\n const options = column?.cellRendererParams?.selectOptions ?? [];\n const option = options[(event.target as HTMLSelectElement).selectedIndex];\n\n if (!option) return;\n\n const oldValue = rowNode.data[column.field];\n\n rowNode.data[column.field] = option.value;\n\n this.finishEdit(rowNode, column, oldValue);\n }\n }\n\n /** Close the editor and announce the commit. Shared by both editor kinds. */\n private finishEdit(rowNode: OneRowNode, column: OneColumnDef<T>, oldValue: any) {\n\n const newValue = rowNode.data[column.field];\n\n rowNode.cellStates = this.cellService.generateCellStates(rowNode);\n rowNode.editing[column.field] = false;\n\n this.eventService.dispatchEvent('cellStateChanged', {\n data: rowNode.data,\n node: rowNode,\n column: column\n });\n\n // Compared after normalisation ('' -> null, number coercion), so a blur\n // that leaves the value as it was does not announce an edit.\n if (newValue !== oldValue) {\n\n this.eventService.dispatchEvent('cellValueChanged', {\n node: rowNode,\n data: rowNode.data,\n column: column,\n field: column.field,\n oldValue,\n newValue,\n });\n }\n }\n\n /**\n * Cancel Cell Edit Mode\n */\n cancelEdit(node: OneRowNode<T>, column: OneColumnDef<T>) {\n\n let rowNode: OneRowNode = this.api.getRowNodeById(node.rowId);\n\n if (rowNode) {\n\n if (this.editType === 'fullRow') {\n\n // Escape abandons the whole row: every editor closes, nothing commits.\n Object.keys(rowNode.editing).forEach(field => rowNode.editing[field] = false);\n\n return;\n }\n\n rowNode.editing[column.field] = false;\n }\n }\n\n /**\n * Full-row commit, routed from any one editor's Enter or blur.\n *\n * A blur that lands on another editor in the same row is the user tabbing\n * between fields, not leaving the row — the editors stay open and their\n * typed values stay in the DOM until the row commits.\n */\n private stopRowEditFromEvent(node: OneRowNode<T>, event: any) {\n\n if (event.type === 'blur') {\n\n const next = (event as FocusEvent).relatedTarget as HTMLElement | null;\n\n if (next?.matches?.('input.one-cell-input, select.one-cell-input')\n && next.closest?.(`[data-cell-id^=\"${node.rowId}--\"]`)) {\n\n return;\n }\n }\n\n event.preventDefault?.();\n event.stopPropagation?.();\n\n this.stopRowEdit(node);\n }\n\n /** Commit every open editor of one row, reading each from the DOM. */\n private stopRowEdit(node: OneRowNode<T>) {\n\n const rowNode: OneRowNode = this.api.getRowNodeById(node.rowId);\n\n if (!rowNode) return;\n\n for (const column of this.columnDefs) {\n\n const field = column.field as string;\n\n if (!field || !rowNode.editing[field]) continue;\n\n const key = getCellKey(rowNode.rowId, field);\n const editor = document.querySelector<HTMLInputElement | HTMLSelectElement>(\n `[data-cell-id=\"${key}\"] input, [data-cell-id=\"${key}\"] select`);\n\n const oldValue = rowNode.data[field];\n\n if (editor?.tagName === 'SELECT') {\n\n const options = column.cellRendererParams?.selectOptions ?? [];\n const option = options[(editor as HTMLSelectElement).selectedIndex];\n\n if (option) rowNode.data[field] = option.value;\n\n } else if (editor) {\n\n const raw = editor.value ?? '';\n\n rowNode.data[field] = raw === ''\n ? null\n : column.cellRendererParams?.inputType === 'number' ? Number(raw) : raw;\n }\n\n // finishEdit closes the editor, refreshes the cell state and raises\n // cellValueChanged when the value moved — one event per changed cell,\n // the same contract as single-cell editing.\n this.finishEdit(rowNode, column, oldValue);\n }\n }\n\n /**\n * Set Cell Value\n */\n setCellValueByRowId(rowId: string, column: OneColumnDef, value: any) {\n\n const node = this.api.getRowNodeById(rowId);\n\n if (node && column.field) {\n\n if (column?.cellRendererParams?.inputType !== 'number') {\n\n node.data[column.field] = value === '' ? null : value;\n\n } else {\n\n node.data[column.field] = value === '' ? null : Number(value);\n }\n }\n }\n\n /**\n * Virtual Scroll Properties\n *\n * The buffer scales with the row count so small grids render in one pass, but\n * it is capped: `itemSize * items * 1.5` is 1.5x the *total* content height,\n * and CdkFixedSizeVirtualScroll expands its rendered range until the buffer is\n * satisfied. Uncapped, that makes the viewport materialise every row and\n * virtual scrolling stops doing anything at all (100k rows locked the tab).\n * MAX_BUFFER_PX keeps roughly twenty rows of overscan either side instead.\n */\n private readonly MAX_BUFFER_PX: number = 600;\n\n setVirtualScroll(items: number = 0): void {\n\n this.minBufferPx = Math.min(this.itemSize * items * 1.5, this.MAX_BUFFER_PX);\n\n this.maxBufferPx = this.minBufferPx * 2;\n }\n\n /**\n * Unsubscribe All Subscriptions\n */\n /**\n * Hand the drag service what it needs to run a gesture.\n *\n * Deferred to here because the viewport element does not exist until the view\n * is up, and `nodes` is passed as a getter rather than a value — a drag\n * mutates the order underneath it, so a snapshot taken at attach time would\n * go stale on the first move.\n */\n ngAfterViewInit(): void {\n\n const element = this.viewport?.elementRef?.nativeElement;\n\n if (!element) return;\n\n this.rowDragService.attach({\n viewport: element,\n itemSize: this.itemSize,\n nodes: () => this.nodes,\n move: (fromIndex: number, toIndex: number) => {\n\n const moved = this.api.moveRow(fromIndex, toIndex);\n\n if (moved) this.cdr.markForCheck();\n\n return moved;\n },\n });\n\n this.refreshRowDragSuppressed();\n\n // The CDK inserts its own content wrapper between the viewport and the\n // rows. It has no template of ours to annotate, and left generic it breaks\n // the `grid > row` ownership the roles depend on.\n const wrapper = element.querySelector('.cdk-virtual-scroll-content-wrapper');\n\n wrapper?.setAttribute('role', 'presentation');\n\n // Flex columns size against this viewport, now and whenever it resizes.\n // applyFlexWidths is a no-op without flex columns and dispatches only on a\n // real change, so grids that never use flex pay nothing here.\n this.applyFlexWidths();\n\n if (typeof ResizeObserver !== 'undefined') {\n\n this.flexResizeObserver = new ResizeObserver(() => this.applyFlexWidths());\n this.flexResizeObserver.observe(element);\n }\n }\n\n private flexResizeObserver?: ResizeObserver;\n\n private applyFlexWidths(): void {\n\n const width = this.viewport?.elementRef?.nativeElement?.clientWidth ?? 0;\n\n if (width > 0) this.api.applyFlexWidths(width);\n }\n\n /**\n * The params every per-cell callback receives.\n *\n * Built here rather than inline in the template so the whole documented\n * shape is passed — `value`, `field`, `rowIndex`, `api` and `context` were\n * all declared on `OneCellRendererParams` and none of them were being sent,\n * so a `cellClass` reading `params.value` silently got `undefined`.\n */\n protected cellParams(node: OneRowNode<T>, column: OneColumnDef<T>): OneCellPresentationParams<T> {\n\n return this.cellService.cellParams(column, node) as OneCellPresentationParams<T>;\n }\n\n /**\n * Params for a component cell renderer.\n *\n * The cell params, plus whatever the column declared in\n * `cellRendererParams` — a field that exists precisely so a renderer can be\n * configured per column, and that nothing had ever forwarded to it. Column\n * config goes first so the grid's own fields win a name collision.\n */\n /**\n * Cached per cell, keyed on the identities that mean \"this cell changed\":\n * its cellStates object (replaced on every edit and state refresh) and its\n * data object. Building a fresh object per call — which a template method\n * does per change-detection pass — made the renderer directive see \"params\n * changed\" every pass and re-run the component's oneInit each time. A\n * renderer whose oneInit touched grid state (a custom tree expander is the\n * classic case) then re-triggered change detection and looped forever.\n */\n private rendererParamsCache = new Map<string, { states: unknown; data: unknown; params: OneCellRendererParams<T> }>();\n\n protected rendererParams(node: OneRowNode<T>, column: OneColumnDef<T>): OneCellRendererParams<T> {\n\n const key = getCellKey(node.rowId, (column.field as string) ?? column.id ?? '');\n const cached = this.rendererParamsCache.get(key);\n\n if (cached && cached.states === node.cellStates && cached.data === node.data) return cached.params;\n\n const params = { ...(column?.cellRendererParams ?? {}), ...this.cellParams(node, column) };\n\n this.rendererParamsCache.set(key, { states: node.cellStates, data: node.data, params });\n\n return params;\n }\n\n /**\n * `aria-rowindex` is 1-based over the whole grid, not over what is rendered.\n *\n * That is the point of it: the body virtualises, so the DOM holds a sliding\n * window of rows and the index is how a screen reader knows where the window\n * sits. Row 1 is the header, then any pinned-top rows, then the data.\n */\n protected dataRowAriaIndex(node: OneRowNode<T>): number {\n\n return 2 + this.pinnedTopNodes.length + node.rowIndex;\n }\n\n /** Pinned rows bracket the data: top ones follow the header, bottom ones end the grid. */\n protected pinnedRowAriaIndex(node: OneRowNode<T>, side: 'top' | 'bottom'): number {\n\n const index = (side === 'top' ? this.pinnedTopNodes : this.pinnedBottomNodes).indexOf(node);\n\n return side === 'top'\n ? 2 + index\n : 2 + this.pinnedTopNodes.length + this.nodes.length + index;\n }\n\n /**\n * Whether rows can be selected at all.\n *\n * `aria-selected=\"false\"` on every row of a grid nobody can select announces\n * a selection affordance that does not exist, so the attribute is omitted\n * rather than set false.\n */\n protected get rowSelectionEnabled(): boolean {\n\n return !!this.api?.rowSelection;\n }\n\n // ---------------------------------------------------------------------------\n // Cell navigation\n //\n // The WAI-ARIA grid pattern: the whole grid is one tab stop, and the arrows\n // move a focused cell within it. Before this the only tab stop was the scroll\n // viewport, so a keyboard user could scroll the rows and reach nothing in\n // them — and a screen reader had no cursor to read a cell from.\n //\n // Focus is real DOM focus on a roving tabindex rather than\n // `aria-activedescendant`, because the rows are virtualised: the element a\n // descendant id pointed at would keep being destroyed underneath it.\n // ---------------------------------------------------------------------------\n\n /** The cell holding the grid's tab stop. Null until something is focused. */\n protected activeCell: { rowId: string; field: string } | null = null;\n\n protected isActiveCell(node: OneRowNode<T>, column: OneColumnDef<T>): boolean {\n\n if (this.activeCell) {\n\n return this.activeCell.rowId === node.rowId && this.activeCell.field === column.field;\n }\n\n // Nothing focused yet, so the first cell holds the tab stop. Without this\n // fallback a grid nobody has clicked has *no* tabbable cell, and a keyboard\n // user cannot get into it at all — the roving tabindex has to start\n // somewhere.\n return node === this.nodes[0] && column === this.navigableColumns()[0];\n }\n\n /**\n * Adopt whatever the user focused, however they got there — click, tab, or\n * the arrow keys below. Keeping this in one place is what stops the roving\n * tabindex drifting away from the element that actually has focus.\n */\n protected onCellFocus(node: OneRowNode<T>, column: OneColumnDef<T>): void {\n\n if (this.isActiveCell(node, column)) return;\n\n this.activeCell = { rowId: node.rowId, field: column.field as string };\n\n this.cdr.markForCheck();\n }\n\n protected onGridKeydown(event: KeyboardEvent): void {\n\n // Undo/redo of committed edits, anywhere in the grid except inside an\n // open editor — a text input's Ctrl+Z is the browser's, and it operates\n // on the uncommitted text.\n if ((event.ctrlKey || event.metaKey) && ['z', 'y'].includes(event.key.toLowerCase())) {\n\n const tag = (event.target as HTMLElement)?.tagName?.toLowerCase();\n\n if (tag === 'input' || tag === 'select' || tag === 'textarea') return;\n\n event.preventDefault();\n\n const redo = event.key.toLowerCase() === 'y' || event.shiftKey;\n const applied = redo ? this.api.redoCellEditing() : this.api.undoCellEditing();\n\n if (applied) this.cdr.markForCheck();\n\n return;\n }\n\n const columns = this.navigableColumns();\n\n if (!this.nodes.length || !columns.length) return;\n\n // Navigate only when a cell itself holds focus. Anything focusable *inside*\n // a cell owns its own keys — a text editor's caret, the row drag handle's\n // reorder keys, the option menu's arrows — and all of them bubble to here.\n // Checking the target rather than blocklisting tag names is what keeps this\n // correct as more controls are added to cells.\n const target = event.target as HTMLElement | null;\n\n if (!target?.matches?.('[role=\"gridcell\"]')) return;\n\n const current = this.activeCellPosition(columns);\n\n let row = current.row;\n let col = current.col;\n\n switch (event.key) {\n\n case 'ArrowDown': row += 1; break;\n case 'ArrowUp': row -= 1; break;\n case 'ArrowRight': col += 1; break;\n case 'ArrowLeft': col -= 1; break;\n\n // Selection. Space is the grid pattern's toggle, and it has to be caught\n // here or the browser scrolls the page with it.\n case ' ': {\n const node = this.nodes[current.row];\n if (node) {\n event.preventDefault();\n this.toggleRowSelection(node);\n }\n return;\n }\n\n case 'a':\n case 'A':\n if (!event.ctrlKey && !event.metaKey) return;\n event.preventDefault();\n this.api.selectAll();\n this.cdr.markForCheck();\n return;\n\n case 'Home':\n col = 0;\n if (event.ctrlKey || event.metaKey) row = 0;\n break;\n\n case 'End':\n col = columns.length - 1;\n if (event.ctrlKey || event.metaKey) row = this.nodes.length - 1;\n break;\n\n // A page is what the viewport can show, which is the only definition that\n // matches what the user sees move.\n case 'PageDown': row += this.rowsPerPage(); break;\n case 'PageUp': row -= this.rowsPerPage(); break;\n\n case 'Enter':\n case 'F2': {\n const node = this.nodes[current.row];\n const column = columns[current.col];\n if (node && column) {\n event.preventDefault();\n this.startEdit({ target: event.target } as unknown as MouseEvent, node, column);\n }\n return;\n }\n\n default: return;\n }\n\n event.preventDefault();\n\n const targetRow = Math.min(Math.max(row, 0), this.nodes.length - 1);\n\n this.focusCell(targetRow, Math.min(Math.max(col, 0), columns.length - 1));\n\n // Shift with a vertical move extends the selection, anchored where the\n // extension began — the same gesture a file list uses.\n if (event.shiftKey && targetRow !== current.row) {\n\n this.extendSelectionTo(current.row, targetRow);\n }\n }\n\n /** The row a shift-extended selection is measured from. */\n private selectionAnchorRowId: string | null = null;\n\n private toggleRowSelection(node: OneRowNode<T>): void {\n\n if (!this.api.toggleRowSelection(node.rowId, !node.selected)) return;\n\n // Where a subsequent shift-extension counts from.\n this.selectionAnchorRowId = node.rowId;\n\n this.cdr.markForCheck();\n }\n\n private extendSelectionTo(fromRow: number, toRow: number): void {\n\n const target = this.nodes[toRow];\n\n if (!target) return;\n\n // With nothing selected yet the row the extension started on becomes the\n // anchor, so shift+arrow selects both ends rather than only the far one.\n const anchor = this.selectionAnchorRowId ?? this.nodes[fromRow]?.rowId;\n\n if (!anchor) return;\n\n this.selectionAnchorRowId = anchor;\n\n this.api.selectRowRange(anchor, target.rowId);\n\n this.cdr.markForCheck();\n }\n\n /**\n * Columns a cell cursor can land on.\n *\n * A column with no field renders no cell state and is keyed by field, so it\n * cannot be addressed — an action-only column is a legitimate example.\n */\n private navigableColumns(): OneColumnDef<T>[] {\n\n return this.columnDefs.filter(column => !!column?.field);\n }\n\n private activeCellPosition(columns: OneColumnDef<T>[]): { row: number; col: number } {\n\n if (!this.activeCell) return { row: 0, col: 0 };\n\n const row = this.nodes.findIndex(node => node.rowId === this.activeCell!.rowId);\n const col = columns.findIndex(column => column.field === this.activeCell!.field);\n\n return { row: row < 0 ? 0 : row, col: col < 0 ? 0 : col };\n }\n\n private rowsPerPage(): number {\n\n const height = this.viewport?.elementRef?.nativeElement?.clientHeight ?? 0;\n\n return Math.max(1, Math.floor(height / this.itemSize));\n }\n\n /**\n * Move the cursor, scrolling the row into view first when it is outside the\n * rendered window.\n *\n * The scroll is the reason focusing is deferred: a virtualised row that is\n * not on screen has no element to focus until the viewport has rendered it.\n */\n private focusCell(rowIndex: number, colIndex: number): void {\n\n const node = this.nodes[rowIndex];\n const column = this.navigableColumns()[colIndex];\n\n if (!node || !column) return;\n\n this.activeCell = { rowId: node.rowId, field: column.field as string };\n\n this.cdr.markForCheck();\n\n const range = this.viewport?.getRenderedRange();\n const rendered = range && rowIndex >= range.start && rowIndex < range.end;\n\n if (rendered) {\n\n setTimeout(() => this.focusCellElement(node, column));\n\n return;\n }\n\n this.viewport?.scrollToIndex(rowIndex);\n\n // Scrolling is not enough: the CDK renders on its own schedule, so the row\n // has no element to focus until it has. Waiting for the rendered range to\n // actually contain the row is the only reliable signal — a fixed delay\n // races the viewport and silently drops focus when it loses.\n this.subscriptions.add(\n this.viewport?.renderedRangeStream\n .pipe(\n filter(next => rowIndex >= next.start && rowIndex < next.end),\n take(1),\n )\n .subscribe(() => setTimeout(() => this.focusCellElement(node, column))),\n );\n }\n\n private focusCellElement(node: OneRowNode<T>, column: OneColumnDef<T>): void {\n\n const key = getCellKey(node.rowId, column.field as string);\n\n this.bodyRef?.nativeElement?.querySelector<HTMLElement>(`[data-cell-id=\"${key}\"]`)?.focus();\n }\n\n /** Is this the row currently being moved? */\n protected isRowDragging(node: OneRowNode<T>): boolean {\n\n return this.dragState?.rowId === node.rowId;\n }\n\n /**\n * Where to paint the drop indicator, in pixels from the top of the body.\n *\n * `insertAt` is a boundary, so the line sits at row-height times the number\n * of rows above it — in content space. The indicator is a sibling of the\n * viewport rather than a child, because anything inside it either scrolls\n * away with the transformed content wrapper or ignores the scroll entirely,\n * so the viewport's own scroll offset and its position within the body are\n * both subtracted back out here.\n *\n * A field rather than a getter: it is read from the template on every change\n * detection pass, and it only actually moves when the drag state or the\n * scroll position does.\n */\n protected dropIndicatorTop: number | null = null;\n\n /**\n * How wide the line is drawn. Rows are `width: fit-content`, so they are\n * often narrower than the viewport — a full-bleed line would hang past the\n * last column into empty space and read as part of the frame rather than the\n * rows. This is the visible extent of the row content, which also shrinks\n * correctly as the grid is scrolled sideways.\n */\n protected dropIndicatorWidth = 0;\n\n private updateDropIndicator(): void {\n\n const state = this.dragState;\n const element = this.viewport?.elementRef?.nativeElement;\n\n if (state?.source !== 'pointer' || !element) {\n\n this.dropIndicatorTop = null;\n\n return;\n }\n\n this.dropIndicatorTop = (state.insertAt * this.itemSize) - element.scrollTop + element.offsetTop;\n\n this.dropIndicatorWidth = Math.max(Math.min(this.rowWidth - element.scrollLeft, element.clientWidth), 0);\n }\n\n protected onRowDragEnd(event: OneRowDragEvent<T>): void {\n\n this.rowDragEnd.emit(event);\n }\n\n private refreshRowDragSuppressed(): void {\n\n const reason = this.api?.getRowDragSuppressedReason?.() ?? null;\n\n if (reason === this.rowDragSuppressed) return;\n\n this.rowDragSuppressed = reason;\n\n this.cdr.markForCheck();\n }\n\n ngOnDestroy(): void {\n\n this.flexResizeObserver?.disconnect();\n\n this.subscriptions.unsubscribe();\n }\n}\n","<div #bodyRef class=\"one-grid-body\" role=\"presentation\">\n\n <!-- Pinned rows live outside the scroll viewport so they never scroll\n vertically, and mirror its scrollLeft so the columns stay aligned. -->\n @if (pinnedTopNodes.length) {\n <div #pinnedViewport class=\"one-pinned-rows one-pinned-rows-top\" role=\"rowgroup\">\n <ng-container [ngTemplateOutlet]=\"pinnedRows\" [ngTemplateOutletContext]=\"{ nodes: pinnedTopNodes, side: 'top' }\"></ng-container>\n </div>\n }\n\n <!-- tabindex makes the scroll container reachable, so a keyboard user can\n scroll the rows with the arrow keys, Page Up/Down and Home/End. Without\n it the body is scrollable by pointer only (WCAG 2.1.1). -->\n <cdk-virtual-scroll-viewport\n class=\"one-grid-body-viewport\"\n role=\"rowgroup\"\n [attr.tabindex]=\"nodes?.length ? null : 0\"\n (keydown)=\"onGridKeydown($event)\"\n [itemSize]=\"itemSize\"\n [minBufferPx]=\"minBufferPx\"\n [maxBufferPx]=\"maxBufferPx\"\n (scroll)=\"onBodyScroll($event)\">\n\n <ng-container *cdkVirtualFor=\"let node of nodes; trackBy: trackByRowId;\">\n \n <div class=\"one-row\"\n role=\"row\"\n [attr.aria-rowindex]=\"dataRowAriaIndex(node)\"\n [attr.aria-selected]=\"rowSelectionEnabled ? node.selected : null\"\n [attr.data-row-id]=\"node.rowId\"\n [class.one-row-selected]=\"node.selected\"\n [class.one-row-dragging]=\"isRowDragging(node)\">\n @for (col of columnDefs; track col.field;) {\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{ node, rowIndex: node.rowIndex, column: col, colIndex: $index }\"></ng-container>\n }\n </div>\n\n <!-- Custom Detail Component -->\n @if(node.leaf && node.detailActive && node?.detailRendererComponent) {\n <ng-container\n oneCellRendererComponent\n [cellRendererComponent]=\"node?.detailRendererComponent\"\n [params]=\"{ data: node.data, rowIndex: node.rowIndex, node: node, context: context }\">\n </ng-container>\n }\n\n <!-- Master Detail Grid (template provided by the parent one-grid to avoid a compile-time import cycle) -->\n @if (masterDetail && node.expanded && node?.detailRowData) {\n <div class=\"one-row-detail-container\" [attr.data-row-id]=\"node.rowId + '-detail'\">\n <ng-container\n [ngTemplateOutlet]=\"detailGridTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: node, node: node }\">\n </ng-container>\n </div>\n }\n </ng-container>\n @if (!nodes?.length) {\n <div style=\"width: max-content; border-top: 1px solid transparent;\">\n <div [style.width.px]=\"rowWidth\"></div>\n </div>\n }\n </cdk-virtual-scroll-viewport>\n\n <!-- Drop indicator.\n A line at the insertion point rather than a gap opened between rows:\n the viewport is virtualised at a fixed itemSize, so shifting rows apart\n would desynchronise the scroller from its own geometry. It is also the\n clearer signal — the row lands exactly where the line is.\n Positioned against the body, with the viewport's scroll subtracted, so\n it stays put while the content moves under it during auto-scroll. -->\n @if (dropIndicatorTop !== null) {\n <div class=\"one-row-drop-indicator\" aria-hidden=\"true\"\n [style.top.px]=\"dropIndicatorTop\"\n [style.width.px]=\"dropIndicatorWidth\"></div>\n }\n\n <!-- Keyboard reordering has no drag image to watch, so it narrates instead.\n Assertive because the message is the only feedback that the row moved. -->\n <div class=\"one-grid-visually-hidden\" role=\"status\" aria-live=\"assertive\" aria-atomic=\"true\">{{ dragAnnouncement }}</div>\n @if (!nodes?.length) {\n <span class=\"one-grid-empty-message\" style=\"position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);\">No Rows to Show</span>\n }\n\n @if (pinnedBottomNodes.length) {\n <div #pinnedViewport class=\"one-pinned-rows one-pinned-rows-bottom\" role=\"rowgroup\">\n <ng-container [ngTemplateOutlet]=\"pinnedRows\" [ngTemplateOutletContext]=\"{ nodes: pinnedBottomNodes, side: 'bottom' }\"></ng-container>\n </div>\n }\n</div>\n\n<!-- Pinned rows are display-only: they render exactly what a data cell renders,\n but carry none of its interactions. A totals row should not open an editor\n on double-click or start a range selection on drag. -->\n<ng-template #pinnedRows let-nodes=\"nodes\" let-side=\"side\">\n @for (node of nodes; track node.rowId) {\n <div class=\"one-row one-row-pinned\"\n role=\"row\"\n [attr.aria-rowindex]=\"pinnedRowAriaIndex(node, side)\"\n [attr.data-row-id]=\"node.rowId\">\n @for (column of columnDefs; track column.field) {\n <div\n class=\"one-column\"\n role=\"gridcell\"\n [attr.aria-colindex]=\"$index + 1\"\n [attr.data-cell-id]=\"node.rowId | cellKey:column.field\"\n [class.one-column-pinned-left]=\"column.pinned === 'left'\"\n [class.one-column-pinned-right]=\"column.pinned === 'right'\"\n [class.one-column-pinned-edge]=\"column._pinnedEdge\"\n [style.left.px]=\"column.pinned === 'left' ? column._pinnedOffset : null\"\n [style.right.px]=\"column.pinned === 'right' ? column._pinnedOffset : null\"\n [style.width.px]=\"column?.width\"\n [style.min-width.px]=\"column?.minWidth\"\n [style.max-width.px]=\"column?.maxWidth\">\n\n @if (column?.cellRendererComponent) {\n <ng-container\n oneCellRendererComponent\n [cellRendererComponent]=\"column?.cellRendererComponent\"\n [params]=\"rendererParams(node, column)\">\n </ng-container>\n }\n @else if (column?.cellRenderer) {\n <div\n [ngStyle]=\"{ width: column.width + 'px', position: 'relative' }\"\n [innerHTML]=\"node.cellStates | cellStateRenderer:column.field\">\n </div>\n }\n @else {\n <div class=\"one-cell\"\n [class.align-content-left]=\"column?.alignContent === 'left'\"\n [class.align-content-center]=\"column?.alignContent === 'center'\"\n [class.align-content-right]=\"column?.alignContent === 'right'\"\n [ngClass]=\"colService.resolveCellClass(column, cellParams(node, column))\"\n [ngStyle]=\"colService.resolveCellStyle(column, cellParams(node, column))\">\n <div class=\"one-cell-text\">{{ (node.cellStates | cellStateRenderer:column.field) }}</div>\n </div>\n }\n </div>\n }\n </div>\n }\n</ng-template>\n\n<!-- Master Column Template -->\n<ng-template #cellTemplate let-node=\"node\" let-rowIndex=\"rowIndex\" let-column=\"column\" let-colIndex=\"colIndex\">\n <div\n class=\"one-column\"\n role=\"gridcell\"\n [attr.aria-colindex]=\"colIndex + 1\"\n [attr.tabindex]=\"isActiveCell(node, column) ? 0 : -1\"\n [class.one-cell-active]=\"isActiveCell(node, column)\"\n (focus)=\"onCellFocus(node, column)\"\n [attr.data-cell-id]=\"node.rowId | cellKey:column.field\"\n [class.one-column-pinned-left]=\"column.pinned === 'left'\"\n [class.one-column-pinned-right]=\"column.pinned === 'right'\"\n [class.one-column-pinned-edge]=\"column._pinnedEdge\"\n [style.left.px]=\"column.pinned === 'left' ? column._pinnedOffset : null\"\n [style.right.px]=\"column.pinned === 'right' ? column._pinnedOffset : null\"\n [style.width.px]=\"column?.width\"\n [style.min-width.px]=\"column?.minWidth\"\n [style.max-width.px]=\"column?.maxWidth\"\n [class.one-column-border-top]=\"masterDetail && nodes?.length > 0 && nodes[node.rowIndex - 1]?.expanded\"\n [class.one-cell-selected]=\"selectedCells | cellSelected:node.rowId:column.field\"\n [class.one-cell-invalid]=\"node.cellStates | cellInvalid:node.data[column.field]:column:node:allowedEdit:submitted\"\n (dblclick)=\"startEdit($event, node, column)\"\n (mousedown)=\"startSelection(node.rowId, column.field)\"\n (mouseenter)=\"extendSelection(node.rowId, column.field)\"\n (mouseup)=\"endSelection()\">\n\n <!-- One Grid Cell Option -->\n @if (node.cellOptions[column.field]) {\n <one-grid-cell-option-menu\n #contextOptionMenuRef\n [node]=\"node\"\n [column]=\"column\"\n [options]=\"column.cellOptionMenu\"\n (cellOptionMenuSelect)=\"cellOptionMenuSelected($event)\"\n (cellOptionMenuClose)=\"cellOptionMenuClosed()\"/>\n }\n\n <!-- Grid Cell Template -->\n @if(column?.cellRendererComponent) {\n <ng-container\n oneCellRendererComponent\n [cellRendererComponent]=\"column?.cellRendererComponent\"\n [params]=\"rendererParams(node, column)\">\n </ng-container>\n }\n @else if (node.editing[column.field]) {\n @if (column?.cellRendererParams?.inputType === 'select') {\n <!-- Cell Editing Select. Commits on change — picking an option\n is the whole edit — with blur as the keyboard fallback. -->\n <select class=\"one-cell-input\"\n name=\"{{ node.rowId + '' + column.field }}\"\n (change)=\"stopEditSelect(node, column, $event)\"\n (blur)=\"stopEditSelect(node, column, $event)\"\n (keydown.esc)=\"cancelEdit(node, column)\">\n @for (option of column?.cellRendererParams?.selectOptions ?? []; track $index) {\n <option [selected]=\"option.value === node.data[column.field]\">{{ option.label }}</option>\n }\n </select>\n }\n @else {\n <!-- Cell Editing Input -->\n <input class=\"one-cell-input\"\n name=\"{{ node.rowId + '' + column.field }}\"\n oneCellInputValidator\n [validationType]=\"column?.cellRendererParams?.inputType === 'number' ? 'number' : 'none'\"\n [placeholder]=\"column?.cellRendererParams?.placeholder\"\n [type]=\"column?.cellRendererParams?.inputType === 'number' ? 'text' : column?.cellRendererParams?.inputType\"\n [value]=\"node?.data[column?.field]\"\n [maxLength]=\"250\"\n (blur)=\"stopEdit(node, column, $event)\"\n (keydown.enter)=\"stopEdit(node, column, $event)\"\n (keydown.esc)=\"cancelEdit(node, column)\"\n />\n }\n }\n @else if (column?.cellRenderer) {\n <div\n [ngStyle]=\"{ width: column.width + 'px' , position: 'relative' }\"\n [innerHTML]=\"node.cellStates | cellStateRenderer:column.field\"\n [class.editable-active]=\"node.cellStates | cellEditable:column:node:cellService.editableFn:cellService.updatableFn:allowedEdit\">\n </div>\n }\n @else {\n <div class=\"one-cell\"\n [class.align-content-left]=\"column?.alignContent === 'left'\"\n [class.align-content-center]=\"column?.alignContent === 'center'\"\n [class.align-content-right]=\"column?.alignContent === 'right'\"\n [ngClass]=\"colService.resolveCellClass(column, cellParams(node, column))\"\n [ngStyle]=\"colService.resolveCellStyle(column, cellParams(node, column))\"\n [style.padding-left.px]=\"column.autoGroupField && node.level | cellLevelPadding:24\"\n [class.one-cell-allowed-edit-active]=\"node.cellStates | cellEditable:column:node:cellService.editableFn:cellService.updatableFn:allowedEdit\">\n\n <!-- Row Drag Handle -->\n @if (cellService.rowDragFn(column, node)) {\n <one-grid-row-drag-handle\n [node]=\"node\"\n [suppressedReason]=\"rowDragSuppressed\"\n (dragEnd)=\"onRowDragEnd($event)\"\n />\n }\n\n <!-- Cell Checkbox Selection -->\n @if (column?.checkboxSelection) {\n <one-grid-checkbox\n [node]=\"node\"\n [allowedEdit]=\"allowedEdit\"\n [api]=\"api\"\n (onRowSelection)=\"invokeRowActionSelection($event)\"\n />\n }\n\n <!-- Expand & Collapse Icon -->\n @if (((node?.group || detailRendererComponent) && column?.autoGroupField) || (masterDetail && node?.expandable && gridType === 'master' && column?.masterGroupField)) {\n <one-grid-cell-group-renderer\n [node]=\"node\"\n [masterDetail]=\"masterDetail\"\n [detailCellRendererParams]=\"detailCellRendererParams\"\n [detailRendererComponent]=\"detailRendererComponent\"\n (expansionChanged)=\"invokeExpansionChangedClick($event)\"\n />\n }\n\n @if(column?.cellRendererComponent) {\n <ng-container\n oneCellRendererComponent\n [cellRendererComponent]=\"column?.cellRendererComponent\"\n [params]=\"rendererParams(node, column)\">\n </ng-container>\n }\n @else {\n <!-- Cell Value OR Placeholder -->\n <div oneCellTextExpand class=\"one-cell-text\" [class.one-cell-placeholder]=\"node.cellStates[column.field]?.type === 'placeholder'\">\n {{ (node.cellStates | cellStateRenderer:column.field) }}\n </div>\n }\n\n <!-- Cell Action Buttons -->\n @if (column.cellRendererParams | cellActionButtonEnable) {\n <one-grid-row-action\n [ngStyle]=\"{ marginLeft: 'auto' }\"\n [column]=\"column\"\n [node]=\"node\"\n [allowedEdit]=\"allowedEdit\"\n [masterNode]=\"masterNode\"\n [masterDetail]=\"masterDetail\"\n [gridType]=\"gridType\"\n [context]=\"context\"\n [cellRendererParams]=\"column?.cellRendererParams\"\n (onRowGotoDetail)=\"invokeRowActionGotoDetail($event)\"\n (onRowAddNew)=\"invokeRowActionAddNew($event)\"\n (onRowView)=\"invokeRowActionView($event)\"\n (onRowLocation)=\"invokeRowActionLocation($event)\"\n (onRowDocument)=\"invokeRowActionDocument($event)\"\n (onRowCopy)=\"invokeRowActionCopy($event)\"\n (onRowDelete)=\"invokeRowActionDelete($event)\"\n (onRowGotoList)=\"invokeRowActionGotoList($event)\"\n (onRowEdit)=\"invokeRowActionEdit($event)\"\n (onRowPrint)=\"invokeRowActionPrint($event)\"\n (onRowHistory)=\"invokeRowActionHistory($event)\"\n (onRowOption)=\"invokeRowActionOption($event)\"\n (onRowLanguage)=\"invokeRowActionLanguage($event)\"\n (onRowCellOption)=\"invokeRowActionCellOption($event)\"\n />\n }\n </div>\n }\n </div>\n</ng-template>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { OnePaginationParams } from '../../core/models/one-pagination-types.model';\nimport { OnePageSizeOption } from '../../core/models/constants/one-pagination.constant';\nimport { LucideAngularModule } from 'lucide-angular';\nimport { ONE_GRID_ICON_PROVIDERS } from '../../core/icons/one-grid-icons';\n\n@Component({\n standalone: true,\n imports: [LucideAngularModule],\n selector: 'one-grid-pagination',\n providers: [ONE_GRID_ICON_PROVIDERS],\n templateUrl: './one-grid-pagination.component.html',\n styleUrl: './one-grid-pagination.component.scss'\n})\nexport class OneGridPaginationComponent {\n\n @Input() paginate: OnePaginationParams = {\n total: 0,\n currentPage: 1,\n lastPage: 1,\n perPage: 25,\n firstRowIndex: 1,\n lastRowIndex: 1,\n };\n\n @Output() goToFirst = new EventEmitter();\n @Output() goToPrevious = new EventEmitter();\n @Output() goToNext = new EventEmitter();\n @Output() goToLast = new EventEmitter();\n @Output() pageSizeChange = new EventEmitter();\n\n /**\n * The page size the bar shows.\n *\n * Derived from the input rather than held locally. The bar is a display of\n * the host's paging state — it does not own it — and a local copy meant a\n * host that supplied `perPage: 50` still saw \"25 rows\" selected.\n */\n public get pageSize(): number {\n\n return this.paginate?.perPage ?? OnePageSizeOption[0];\n }\n\n /**\n * The size options offered.\n *\n * Also derived. These used to be copied out of the input in\n * `ngAfterViewInit` — after the view had already been checked with the\n * defaults — so any grid supplying its own options threw `NG0100` in dev\n * mode, and later changes to the list were ignored entirely.\n */\n public get pageSizeOptions(): number[] {\n\n return this.paginate?.pageSizeOptions?.length ? this.paginate.pageSizeOptions : OnePageSizeOption;\n }\n\n /** Whether there is a page before the current one. */\n public get hasPrevious(): boolean {\n\n return this.pageCount > 1 && (this.paginate?.currentPage ?? 1) > 1;\n }\n\n /** Whether there is a page after the current one. */\n public get hasNext(): boolean {\n\n return this.pageCount > 1 && (this.paginate?.currentPage ?? 1) < (this.paginate?.lastPage ?? 1);\n }\n\n private get pageCount(): number {\n\n return this.paginate?.lastPage ?? 1;\n }\n\n goToFirstPage() {\n\n if (!this.hasPrevious) return;\n\n this.goToFirst.emit(this.paginate?.currentPage);\n }\n\n goToPreviousPage() {\n\n if (!this.hasPrevious) return;\n\n this.goToPrevious.emit(this.paginate?.currentPage);\n }\n\n goToNextPage() {\n\n if (!this.hasNext) return;\n\n this.goToNext.emit(this.paginate?.currentPage);\n }\n\n goToLastPage() {\n\n if (!this.hasNext) return;\n\n this.goToLast.emit(this.paginate?.currentPage);\n }\n\n onPageSizeChange(event: Event) {\n\n const select = event.target as HTMLSelectElement;\n\n const newSize = Number(select.value);\n\n if (newSize !== this.pageSize) {\n\n this.pageSizeChange.emit(newSize);\n }\n }\n}\n","<!-- A navigation landmark, so the bar is reachable as one thing rather than as\n four unlabelled icon buttons floating under the grid. -->\n<div class=\"one-grid-pagination\" role=\"navigation\" aria-label=\"Pagination\">\n <div class=\"one-pagination-row\">\n @if (paginate?.firstRowIndex > 0 && paginate?.lastRowIndex > 0 && paginate?.total > 0) {\n <div class=\"one-pagination-columns-group\">\n <div class=\"one-pagination-column\">\n <span>{{ paginate?.firstRowIndex }}</span>\n <span>-</span>\n <span>{{ paginate?.lastRowIndex }}</span>\n <span>/</span> \n <span>{{ paginate?.total }}</span>\n </div>\n </div>\n }\n <div class=\"one-pagination-columns-group\">\n <div class=\"one-pagination-column\">\n <!-- `type=\"button\"` so the bar cannot submit a surrounding form,\n a real `disabled` rather than a class that only stops the\n mouse, and a name on every icon-only control. -->\n <button\n type=\"button\"\n class=\"one-pagination-btn\"\n aria-label=\"First page\"\n title=\"First page\"\n [disabled]=\"!hasPrevious\"\n [class.disabled]=\"!hasPrevious\"\n (click)=\"goToFirstPage()\">\n <lucide-icon name=\"chevron-first\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n </button>\n <button\n type=\"button\"\n class=\"one-pagination-btn\"\n aria-label=\"Previous page\"\n title=\"Previous page\"\n [disabled]=\"!hasPrevious\"\n [class.disabled]=\"!hasPrevious\"\n (click)=\"goToPreviousPage()\">\n <lucide-icon name=\"chevron-left\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n </button>\n </div>\n <!-- Announced as a live region: the numbers are the only feedback a\n screen reader gets that the page actually changed. -->\n <div class=\"one-pagination-column\" role=\"status\" aria-live=\"polite\">\n <span class=\"one-grid-visually-hidden\">Page </span>{{ paginate?.currentPage }}<span>/</span>{{ paginate?.lastPage }} \n </div>\n <div class=\"one-pagination-column\">\n <button\n type=\"button\"\n class=\"one-pagination-btn\"\n aria-label=\"Next page\"\n title=\"Next page\"\n [disabled]=\"!hasNext\"\n [class.disabled]=\"!hasNext\"\n (click)=\"goToNextPage()\">\n <lucide-icon name=\"chevron-right\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n </button>\n <button\n type=\"button\"\n class=\"one-pagination-btn\"\n aria-label=\"Last page\"\n title=\"Last page\"\n [disabled]=\"!hasNext\"\n [class.disabled]=\"!hasNext\"\n (click)=\"goToLastPage()\">\n <lucide-icon name=\"chevron-last\" [size]=\"16\" [strokeWidth]=\"2\"></lucide-icon>\n </button>\n </div>\n <div class=\"one-pagination-columns-group\">\n <div class=\"one-pagination-column\">\n <!-- `[selected]` per option, not `[value]` on the select:\n with options rendered by `@for`, the select's value is\n set before they exist and does not stick. -->\n <select name=\"row-per-page\" aria-label=\"Rows per page\" (change)=\"onPageSizeChange($event)\">\n @for (size of pageSizeOptions; track size) {\n <option [value]=\"size\" [selected]=\"size === pageSize\">{{ size }} rows</option>\n }\n </select>\n </div>\n </div>\n </div>\n </div>\n</div>\n","import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, Type, ViewChild } from '@angular/core';\nimport { OneColumnDef, OneGroupColumnDef } from '../../core/models/one-column-def-types.model';\nimport { OneGridApi } from '../../core/instants/one-grid-api.class';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { OneGridReadyEvent, OneGridRowActionEvent, OneGridType } from '../../core/models/one-grid-types.model';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport { OnePaginationParams } from '../../core/models/one-pagination-types.model';\nimport { OneGridSelectionService } from '../../core/services/one-grid-selection.service';\nimport { CellOptionMenuSelectedEvent, CellValueChangedEvent, ColumnMovedEvent, ColumnResizedEvent, ExpansionChangedEvent, RowGroupingChangedEvent, RowSelectionMode, SelectionChangedEvent, SortChangedEvent } from '../../core/models/one-event-types.model';\nimport { Subject, Subscription } from 'rxjs';\nimport { OneGridExpansionService } from '../../core/services/one-grid-expansion.service';\nimport { OneDetailCellRendererParams } from '../../core/models/one-master-detail.model';\nimport { OneGridRowService } from '../../core/services/one-grid-row.service';\nimport { OneGridCellService } from '../../core/services/one-grid-cell.service';\nimport { OgColumnService } from '../../core/services/og-column.service';\nimport _ from 'lodash';\nimport { OneCellRendererComponent } from '../../core/models/one-tree-data.model';\nimport { OneGridRowDragService } from '../../core/services/one-grid-row-drag.service';\nimport { OneRowDragEvent } from '../../core/models/one-row-drag.model';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { aggColumns, ONE_GROUP_CHILDREN_FIELD, ONE_GROUP_VALUE_FIELD, rowGroupFields } from '../../helpers/one-row-grouping.helper';\nimport { OneGridHeaderComponent } from '../one-grid-header/one-grid-header.component';\nimport { OneGridBodyComponent } from '../one-grid-body/one-grid-body.component';\nimport { OneGridPaginationComponent } from '../one-grid-pagination/one-grid-pagination.component';\n\n@Component({\n standalone: true,\n imports: [\n NgTemplateOutlet,\n OneGridHeaderComponent,\n OneGridBodyComponent,\n OneGridPaginationComponent,\n ],\n selector: 'one-grid',\n templateUrl: './one-grid.component.html',\n styleUrl: './one-grid.component.scss',\n providers: [\n OneGridEventService,\n OneGridApi,\n OgColumnService,\n OneGridSelectionService,\n OneGridExpansionService,\n OneGridRowService,\n OneGridCellService,\n OneGridRowDragService\n ],\n})\nexport class OneGridComponent<T> implements OnInit, OnChanges, AfterViewInit, OnDestroy {\n\n /**\n * Get General Data from Parent\n */\n @ViewChild('ogRef', { static: true }) ogRef!: ElementRef;\n @Input() rowNumber: boolean = false;\n @Input() allowedEdit: boolean = true;\n @Input() submitted: boolean = false;\n @Input() context: any = null;\n @Input() rowData: T[] = [];\n @Input() rowSelection: RowSelectionMode = null;\n\n /**\n * The grid's accessible name.\n *\n * A `role=\"grid\"` with no name is announced as an unlabelled grid, which\n * tells a screen-reader user nothing about what they have landed in. Set it\n * to whatever the grid is showing — \"Employees\", \"Order lines\".\n */\n @Input() gridLabel: string = 'Data grid';\n\n @Input() enableGroupColumnDefs: boolean = false;\n @Input() groupColumnDefs: OneGroupColumnDef[] = [];\n\n @Input() defaultColumnDef: OneColumnDef<T> = {};\n @Input() columnDefs: OneColumnDef<T>[] = [];\n\n /**\n * Rows anchored above the scrolling area — a header summary, or an entry line.\n * They keep column alignment and scroll sideways with the body, but are not\n * data: sorting, filtering, selection and the row count all pass them by.\n */\n @Input() pinnedTopRowData: T[] = [];\n\n /** Rows anchored below the scrolling area, typically a totals row. */\n @Input() pinnedBottomRowData: T[] = [];\n\n // RXJS Properties\n protected gridCopy$ = new Subject<ClipboardEvent>();\n\n /**\n * Master Detail Feature\n */\n @Input() gridType: OneGridType = 'master';\n @Input() masterDetail: boolean = false;\n @Input() masterNode: OneRowNode = null;\n @Input() detailCellRendererParams: OneDetailCellRendererParams;\n @Input() detailRendererComponent: Type<OneCellRendererComponent>;\n\n /**\n * Tree Data Feature\n */\n @Input() treeData: boolean = false;\n @Input() treeDataChildrenField: string = null;\n @Input() autoGroupColumnDef: OneColumnDef;\n @Input() groupDefaultExpanded: number = 0;\n\n /**\n * Bind Row Action Events & Data to Parent\n */\n /**\n * A row finished moving. Fires once per completed reorder — not while the\n * pointer is in flight — and only when the position actually changed.\n */\n @Output() rowDragEnd = new EventEmitter<OneRowDragEvent<T>>();\n\n /**\n * The header's ⋮ button was pressed for this column.\n *\n * The grid has no column menu of its own — this reports the intent so the\n * host can show whatever a column menu means in its app. Set\n * `columnDef.suppressHeaderMenuButton` to hide the button entirely.\n */\n @Output() headerMenuClick = new EventEmitter<OneColumnDef<T>>();\n\n /**\n * Render the grid's own column menu behind the header ⋮ button: sort, pin,\n * hide. Opt-in — a host that built its menu on `(headerMenuClick)` keeps\n * exactly what it had, and the intent still emits either way.\n */\n @Input() headerMenu: boolean = false;\n\n /**\n * Render a filter input under every column whose `filterable` resolves\n * true. The inputs feed `api.setFilterModel` with contains-conditions,\n * debounced; filters on fields without an input are left untouched.\n */\n @Input() filterRow: boolean = false;\n\n /**\n * Record committed cell edits so `api.undoCellEditing` /\n * `api.redoCellEditing` (and Ctrl+Z / Ctrl+Y in the grid) can walk them.\n * Programmatic `setDataValue` writes are not recorded.\n */\n @Input() undoRedoCellEditing: boolean = false;\n\n /** How many edits the undo stack keeps. */\n @Input() undoRedoCellEditingLimit: number = 10;\n\n /**\n * `'fullRow'` opens every editable cell of the row on a double-click and\n * commits them together — Enter anywhere in the row, or focus leaving the\n * row. Escape closes the whole row without committing. Default: cells edit\n * one at a time.\n */\n @Input() editType: 'fullRow' | null = null;\n\n @Output() onGridReady = new EventEmitter<OneGridReadyEvent<T>>();\n @Output() onRowGotoDetail = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowAddNew = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowView = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLocation = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDocument = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowCopy = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowDelete = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowGotoList = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowEdit = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowPrint = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowHistory = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowOption = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowLanguage = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onRowSelection = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() onShiftDoubleClick = new EventEmitter<OneGridRowActionEvent<T>>();\n @Output() rowCountChanged = new EventEmitter<number>();\n\n @Output() selectionChanged = new EventEmitter<SelectionChangedEvent<T>>();\n @Output() expansionChanged = new EventEmitter<ExpansionChangedEvent<T>>();\n\n /**\n * The sort model changed — a header click or `api.onSortChanged`. Carries\n * the re-sorted nodes and the model that produced them; `api.sortModel`\n * stays readable between emissions.\n */\n @Output() sortChanged = new EventEmitter<SortChangedEvent<T>>();\n\n /**\n * An inline edit was committed with a value different from the one it\n * started with. Programmatic `node.setDataValue` does not emit here — the\n * caller already holds both values.\n */\n @Output() cellValueChanged = new EventEmitter<CellValueChangedEvent<T>>();\n\n /** A header drag finished somewhere other than where it started. */\n @Output() columnMoved = new EventEmitter<ColumnMovedEvent>();\n\n /** A resize gesture finished — one event per gesture, not per pixel. */\n @Output() columnResized = new EventEmitter<ColumnResizedEvent>();\n\n // For context menu option\n @Output() cellOptionSelect = new EventEmitter<CellOptionMenuSelectedEvent>();\n @Output() onRowCellOption = new EventEmitter<OneGridRowActionEvent<T>>();\n\n /**\n * Bind One Grid Pagination Feature\n */\n @Input() pagination: boolean = false;\n @Input() paginate: OnePaginationParams;\n\n /**\n * Let the grid page its own rows. The bar renders, the grid slices the\n * filtered rows to the current page, and the navigation buttons work\n * without the host handling anything — `[paginate]` is ignored in this\n * mode (the grid owns those numbers) except for `pageSizeOptions`. The\n * navigation outputs still emit, as notifications rather than intents.\n * Selection, filtering and sorting keep operating on the whole dataset.\n */\n @Input() clientSidePagination: boolean = false;\n\n /** Rows per page for `clientSidePagination`. */\n @Input() pageSize: number = 25;\n\n @Output() goToFirst = new EventEmitter();\n @Output() goToPrevious = new EventEmitter();\n @Output() goToNext = new EventEmitter();\n @Output() goToLast = new EventEmitter();\n @Output() pageSizeChange = new EventEmitter<number>();\n\n /** The paging numbers the bar shows when the grid pages its own rows. */\n protected internalPaginate: OnePaginationParams = {\n total: 0, currentPage: 1, lastPage: 1, perPage: 25, firstRowIndex: 0, lastRowIndex: 0,\n };\n\n /**\n * Recompute the bar's numbers from the filtered row count and the API's\n * paging state. Deferred a tick for the same reason the aria counts are:\n * the count arrives while the first change detection pass is still running.\n */\n private refreshClientPagination(total: number): void {\n\n const { pageSize, currentPage } = this.api.paginationState;\n\n const lastPage = Math.max(Math.ceil(total / pageSize), 1);\n const page = Math.min(currentPage, lastPage);\n\n setTimeout(() => {\n\n this.internalPaginate = {\n total,\n currentPage: page,\n lastPage,\n perPage: pageSize,\n firstRowIndex: total === 0 ? 0 : (page - 1) * pageSize + 1,\n lastRowIndex: Math.min(page * pageSize, total),\n pageSizeOptions: this.paginate?.pageSizeOptions,\n };\n\n this.cdr.markForCheck();\n });\n }\n\n /**\n * One Grid Properties\n */\n protected bodyScrollLeft: number = 0;\n private _oneRowNumberColumnDef: OneColumnDef = null;\n private subscriptions = new Subscription();\n\n /**\n * Row grouping, as the grid sees it.\n *\n * The three `_host*` fields hold what was bound before grouping touched\n * anything, because grouping is reversible: turn it off and the columns,\n * the group column and the grid type all have to go back to what the host\n * asked for. `_appliedGroupFields` is the grouping the registered columns\n * currently reflect — the row model's copy lives in `api.rowGroupFields`.\n */\n private _hostColumnDefs: OneColumnDef<T>[] = [];\n private _hostAutoGroupColumnDef: OneColumnDef = null;\n private _hostGridType: OneGridType = 'master';\n private _hostTreeData: boolean = false;\n private _appliedGroupFields: readonly string[] = [];\n\n constructor(\n protected api: OneGridApi,\n protected eventService: OneGridEventService,\n private elementRef: ElementRef,\n private cdr: ChangeDetectorRef,\n ) { }\n\n ngOnChanges(changes: SimpleChanges): void {\n\n if (changes['masterNode'] && changes['masterNode'].isFirstChange) {\n\n if (this.masterDetail && this.masterNode.expanded && this.gridType === 'detail') {\n\n setTimeout(() => this.api.setRowData([...this.masterNode.detailRowData]));\n }\n }\n\n if (changes[\"rowData\"] && !changes[\"rowData\"]?.firstChange) {\n\n this.treeData || this.masterDetail ? this.api.updateRowData(this.rowData) : this.api.setRowData(this.rowData);\n }\n\n // Only later changes. The first one arrives before ngOnInit has run\n // api.init, so the column definitions are not registered yet and the body\n // has not subscribed — the initial load happens in ngAfterViewInit instead.\n if (changes[\"pinnedTopRowData\"] && !changes[\"pinnedTopRowData\"].firstChange) {\n\n this.api.setPinnedRowData('top', this.pinnedTopRowData);\n }\n\n if (changes[\"pinnedBottomRowData\"] && !changes[\"pinnedBottomRowData\"].firstChange) {\n\n this.api.setPinnedRowData('bottom', this.pinnedBottomRowData);\n }\n }\n\n ngOnInit(): void {\n\n /**\n * Init Row Number Column Def\n */\n if (this.rowNumber) {\n\n this._oneRowNumberColumnDef = {\n groupId: this.columnDefs[0]?.groupId ?? null,\n field: '_oneRowNumber',\n headerName: 'Nº',\n resizable: true,\n headerStyle: {\n textAlign: 'center',\n display: 'flex',\n justifyContent: 'center',\n alignItem: 'center'\n },\n alignContent: 'right',\n cellClass: 'fw-bold',\n width: 60,\n minWidth: 40,\n maxWidth: 200\n }\n }\n\n /**\n * Row grouping: column defs declaring `rowGroup` turn the grid into a\n * tree over synthetic group rows. Configured before `api.init` because\n * everything downstream — the treeData flag the API captures, the group\n * column the tree block below prepends — has to see the tree shape.\n *\n * What the host declared is kept as it was given: regrouping at runtime\n * re-derives the registered columns from it, so a column hidden because\n * it was grouped comes back when it stops being, and one the host hid\n * itself stays hidden.\n */\n this._hostColumnDefs = this.columnDefs ?? [];\n this._hostAutoGroupColumnDef = this.autoGroupColumnDef;\n this._hostGridType = this.gridType;\n this._hostTreeData = this.treeData;\n\n const rowGroupColumnFields = this.treeData || this.masterDetail\n ? []\n : rowGroupFields(this.columnDefs);\n\n if (rowGroupColumnFields.length) {\n\n this._appliedGroupFields = rowGroupColumnFields;\n\n this.treeData = true;\n this.treeDataChildrenField = ONE_GROUP_CHILDREN_FIELD;\n this.autoGroupColumnDef = this.buildAutoGroupColumnDef();\n this.columnDefs = this.groupedColumnDefs(rowGroupColumnFields);\n }\n\n /**\n * Initialize One Grid API\n */\n this.api.init({\n gridType: this.gridType,\n columnDefs: this.columnDefs,\n defaultColumnDef: this.defaultColumnDef,\n groupColumnDefs: this.groupColumnDefs,\n context: this.context,\n rowSelection: this.rowSelection,\n masterDetail: this.masterDetail,\n detailCellRendererParams: this.detailCellRendererParams,\n detailRendererComponent: this.detailRendererComponent,\n // The host's own tree data, not the tree grouping builds: `setRowGrouping`\n // turns that on below, and the API has to be able to tell whose tree it\n // is before it may replace one.\n treeData: this._hostTreeData,\n });\n\n if (rowGroupColumnFields.length) {\n\n this.api.setRowGrouping(rowGroupColumnFields, aggColumns(this.columnDefs));\n }\n\n // Regrouping at runtime. `api.setRowGrouping` owns the row model half of\n // the switch; this is the other half — the columns the grid registers and\n // the shape the body renders. Subscribed after the initial call above,\n // which `ngOnInit` has already applied.\n this.subscriptions.add(this.eventService.addEventListener('rowGroupingChanged', (payload: RowGroupingChangedEvent) => {\n\n this.applyRowGroupingColumns(payload.groupFields);\n }));\n\n if (this.undoRedoCellEditing) {\n\n this.api.enableUndoRedoCellEditing(this.undoRedoCellEditingLimit);\n }\n\n if (this.clientSidePagination) {\n\n this.api.setClientSidePagination(true, this.paginate?.perPage ?? this.pageSize);\n }\n\n /**\n * Setup Master Detail Configuration\n */\n if (this.masterDetail) {\n\n this.api.setGroupDefaultExpanded(this.groupDefaultExpanded);\n this.api.setGetDetailRowData(this.detailCellRendererParams?.getDetailRowData ?? null);\n\n if (this.rowNumber) {\n\n const columnDefs = _.concat(this._oneRowNumberColumnDef, this.columnDefs);\n\n setTimeout(() => this.api.setColumnDefs(columnDefs));\n }\n }\n\n /**\n * Setup Tree Data Configuration\n */\n if (this.treeData) {\n\n this.gridType = 'tree';\n\n this.api.setTreeDataChildrenField(this.treeDataChildrenField);\n this.api.setGroupDefaultExpanded(this.groupDefaultExpanded);\n\n setTimeout(() => this.api.setColumnDefs(this.columnStack()));\n }\n\n // Listen Selection Changed Event\n // Columns can be replaced at runtime through `api.setColumnDefs`, and\n // `aria-colcount` has to follow.\n this.subscriptions.add(this.eventService.addEventListener('columnChanged', () => {\n\n this.ariaColCount = this.api?.getColumnState()?.columns?.length ?? -1;\n }));\n\n this.subscriptions.add(this.eventService.addEventListener('selectionChanged', (payload: SelectionChangedEvent<T>) => {\n\n this.selectionChanged.emit(payload);\n }));\n\n // The internal events a host can act on, surfaced as outputs. Same\n // forwarding pattern as selectionChanged above.\n this.subscriptions.add(this.eventService.addEventListener('sortChanged', (payload: SortChangedEvent<T>) => {\n\n this.sortChanged.emit(payload);\n }));\n\n this.subscriptions.add(this.eventService.addEventListener('cellValueChanged', (payload: CellValueChangedEvent<T>) => {\n\n this.cellValueChanged.emit(payload);\n }));\n\n this.subscriptions.add(this.eventService.addEventListener('columnMoved', (payload: ColumnMovedEvent) => {\n\n this.columnMoved.emit(payload);\n }));\n\n this.subscriptions.add(this.eventService.addEventListener('columnResized', (payload: ColumnResizedEvent) => {\n\n this.columnResized.emit(payload);\n }));\n }\n\n /**\n * The group column: host-tuned through `autoGroupColumnDef`, but its field\n * is always the synthetic label — that is where a group row carries its\n * display value — and it always carries the marker the tree machinery keys\n * on, which is what puts the expander on this column.\n */\n private buildAutoGroupColumnDef(): OneColumnDef {\n\n return {\n headerName: 'Group',\n minWidth: 200,\n ...this._hostAutoGroupColumnDef,\n field: ONE_GROUP_VALUE_FIELD,\n autoGroupField: true,\n };\n }\n\n /**\n * The host's columns with the grouped-by ones hidden.\n *\n * A grouped-by column's value is on the group row; showing the flat column\n * too repeats it down every leaf. Hidden, not removed — the host can bring\n * one back with `api.setColumnVisible`, and ungrouping restores whatever\n * visibility the host itself declared.\n */\n private groupedColumnDefs(groupFields: readonly string[]): OneColumnDef<T>[] {\n\n return this._hostColumnDefs.map(column =>\n column.field && groupFields.includes(column.field) ? { ...column, hide: true } : column);\n }\n\n /** The columns the grid registers: row numbers, the group column, the host's. */\n private columnStack(): OneColumnDef<T>[] {\n\n return _.compact([\n this.rowNumber ? this._oneRowNumberColumnDef : null,\n this.treeData ? this.autoGroupColumnDef : null,\n ...this.columnDefs,\n ]) as OneColumnDef<T>[];\n }\n\n /**\n * Re-plumb everything grouping owns outside the row model: tree mode, the\n * children field, the group column, and which of the host's columns are\n * hidden because their value now shows on a group row.\n *\n * Driven by `rowGroupingChanged`, so a host regroups through one call —\n * `api.setRowGrouping(['country', 'city'])` — instead of re-creating the\n * grid. Grouping and host tree data are mutually exclusive, which the API\n * enforces, so this only ever switches a tree that grouping itself built.\n */\n private applyRowGroupingColumns(groupFields: readonly string[]): void {\n\n const unchanged = groupFields.length === this._appliedGroupFields.length\n && groupFields.every((field, index) => field === this._appliedGroupFields[index]);\n\n if (unchanged) return;\n\n const grouping = groupFields.length > 0;\n\n this._appliedGroupFields = [...groupFields];\n\n this.treeData = grouping;\n this.treeDataChildrenField = grouping ? ONE_GROUP_CHILDREN_FIELD : null;\n this.gridType = grouping ? 'tree' : this._hostGridType;\n this.autoGroupColumnDef = grouping ? this.buildAutoGroupColumnDef() : this._hostAutoGroupColumnDef;\n this.columnDefs = this.groupedColumnDefs(groupFields);\n\n this.api.setGroupDefaultExpanded(this.groupDefaultExpanded);\n this.api.setColumnDefs(this.columnStack());\n\n // The grid type, the tree flag and the group column are all rendered\n // through bindings, and this runs from an event rather than from a\n // template callback.\n this.cdr.markForCheck();\n }\n\n ngAfterViewInit(): void {\n\n // The header follows the body through (bodyScroll) -> [scrollLeft]. A second\n // subscription used to live here that queried '.one-grid-header-column' — a\n // header *cell*, not the viewport — and assigned scrollLeft to it, which\n // does nothing. It has been removed rather than repaired: the binding path\n // is the one that works, and it now drives the pinned columns too.\n\n // Pinned rows, now that the columns are registered and the body is\n // listening. Unlike rowData these are not loaded through (onGridReady) —\n // binding them is the whole contract — so the grid loads them itself.\n if (this.pinnedTopRowData?.length) {\n\n this.api.setPinnedRowData('top', this.pinnedTopRowData);\n }\n\n if (this.pinnedBottomRowData?.length) {\n\n this.api.setPinnedRowData('bottom', this.pinnedBottomRowData);\n }\n\n /**\n * Emit Grid Ready Event\n */\n this.onGridReady.emit({ api: this.api });\n }\n\n /**\n * Handle Body Scroll Event\n */\n onBodyScroll(scrollLeft: number) {\n\n this.bodyScrollLeft = scrollLeft;\n }\n\n /**\n * Handle Ready Event of a nested Master Detail Grid\n */\n onDetailGridReady(params: OneGridReadyEvent) {\n\n params.api.setRowData(this.masterNode?.detailRowData ?? []);\n }\n\n /**\n * Passing copy event to grid body\n */\n onGridCopy(event: ClipboardEvent) {\n\n this.gridCopy$.next(event);\n }\n\n /**\n * Bind Row Action Events to Parent Component\n */\n invokeRowActionGotoDetail(event: OneGridRowActionEvent<T>) {\n\n this.onRowGotoDetail.emit(event);\n }\n\n invokeRowActionAddNew(event: OneGridRowActionEvent<T>) {\n\n this.onRowAddNew.emit(event);\n }\n\n invokeRowActionView(event: OneGridRowActionEvent<T>) {\n\n this.onRowView.emit(event);\n }\n\n invokeRowActionLocation(event: OneGridRowActionEvent<T>) {\n\n this.onRowLocation.emit(event);\n }\n\n invokeRowActionDocument(event: OneGridRowActionEvent<T>) {\n\n this.onRowDocument.emit(event);\n }\n\n invokeRowActionCopy(event: OneGridRowActionEvent<T>) {\n\n this.onRowCopy.emit(event);\n }\n\n invokeRowActionDelete(event: OneGridRowActionEvent<T>) {\n\n this.onRowDelete.emit(event);\n }\n\n invokeRowActionGotoList(event: OneGridRowActionEvent<T>) {\n\n this.onRowGotoList.emit(event);\n }\n\n invokeRowActionEdit(event: OneGridRowActionEvent<T>) {\n\n this.onRowEdit.emit(event);\n }\n\n invokeRowActionPrint(event: OneGridRowActionEvent<T>) {\n\n this.onRowPrint.emit(event);\n }\n\n invokeRowActionHistory(event: OneGridRowActionEvent<T>) {\n\n this.onRowHistory.emit(event);\n }\n\n invokeRowActionOption(event: OneGridRowActionEvent<T>) {\n\n this.onRowOption.emit(event);\n }\n\n invokeRowActionLanguage(event: OneGridRowActionEvent<T>) {\n\n this.onRowLanguage.emit(event);\n }\n\n invokeRowActionCellOption(event: OneGridRowActionEvent<T>) {\n\n this.onRowCellOption.emit(event);\n }\n\n invokeRowActionSelection(event: OneGridRowActionEvent<T>) {\n\n this.onRowSelection.emit(event);\n }\n\n invokeShiftDoubleClick(event: OneGridRowActionEvent<T>) {\n\n this.onShiftDoubleClick.emit(event);\n }\n\n /**\n * Totals for `aria-rowcount` / `aria-colcount`.\n *\n * Held as fields rather than computed in the template: they are read on every\n * change detection pass and only actually change when the data or the columns\n * do. `-1` is the ARIA value for \"unknown\", which is the honest answer before\n * the first row arrives.\n */\n protected ariaRowCount = -1;\n protected ariaColCount = -1;\n\n invokeRowCountChanged(length: number) {\n\n this.refreshAriaCounts(length);\n\n if (this.clientSidePagination) this.refreshClientPagination(length);\n\n this.rowCountChanged.emit(length);\n }\n\n /**\n * Recompute the totals a screen reader is told about.\n *\n * `aria-rowcount` counts every row the grid represents, not the handful the\n * virtual scroller currently has in the DOM — the header row, the pinned rows\n * either side, and all the data rows.\n */\n private refreshAriaCounts(dataRows: number): void {\n\n const pinned = (this.pinnedTopRowData?.length ?? 0) + (this.pinnedBottomRowData?.length ?? 0);\n\n const rows = 1 + pinned + dataRows;\n const cols = this.api?.getColumnState()?.columns?.length ?? -1;\n\n if (rows === this.ariaRowCount && cols === this.ariaColCount) return;\n\n // Deferred a tick. The body emits its row count while the first change\n // detection pass is still running, after this component's own attributes\n // were checked — assigning here directly is the textbook NG0100. The body\n // defers its node list for the same reason.\n setTimeout(() => {\n\n this.ariaRowCount = rows;\n this.ariaColCount = cols;\n\n this.cdr.markForCheck();\n });\n }\n\n cellOptionMenuSelected(event: CellOptionMenuSelectedEvent) {\n\n this.cellOptionSelect.emit(event);\n }\n\n /**\n * Bing Pagination Events to Parent Component\n */\n invokeGoToFirst() {\n\n if (this.clientSidePagination) this.api.setCurrentPage(1);\n\n this.goToFirst.emit();\n }\n\n invokeGoToPrevious() {\n\n if (this.clientSidePagination) this.api.setCurrentPage(this.api.paginationState.currentPage - 1);\n\n this.goToPrevious.emit();\n }\n\n invokeGoToNext() {\n\n if (this.clientSidePagination) this.api.setCurrentPage(this.api.paginationState.currentPage + 1);\n\n this.goToNext.emit();\n }\n\n invokeGoToLast() {\n\n if (this.clientSidePagination) this.api.setCurrentPage(this.internalPaginate.lastPage ?? 1);\n\n this.goToLast.emit();\n }\n\n invokePageSizeChange(pageSize: number) {\n\n if (this.clientSidePagination) this.api.setPageSize(pageSize);\n\n this.pageSizeChange.emit(pageSize);\n }\n\n invokeRowDragEnd(event: OneRowDragEvent<T>) {\n\n this.rowDragEnd.emit(event);\n }\n\n invokeExpansionChangedClick(event: ExpansionChangedEvent<T>) {\n\n this.expansionChanged.emit(event);\n }\n\n /**\n * Handle Unsubscribe All Event Listenders\n */\n ngOnDestroy(): void {\n\n this.rowData = [];\n\n this.api.destroy();\n\n this.subscriptions.unsubscribe();\n }\n}\n","<!-- No tabindex here. The tab stop belongs on the body viewport, which is the\n element that actually scrolls; a focusable wrapper around a scrollable\n child is reachable but cannot be scrolled with the keyboard. The copy\n handler is unaffected: a copy event fired at the focused viewport bubbles\n up to here. -->\n<!-- role=\"grid\" is what turns this from a pile of divs into something a screen\n reader can navigate. The counts are the *total* — `aria-rowcount` includes\n the header row and any pinned rows, and both stay correct while the body is\n virtualised and most rows are not in the DOM, which is exactly what these\n attributes exist to communicate. -->\n<div #ogRef\n class=\"one-grid\"\n role=\"grid\"\n [attr.aria-label]=\"gridLabel\"\n [attr.aria-rowcount]=\"ariaRowCount\"\n [attr.aria-colcount]=\"ariaColCount\"\n [attr.aria-multiselectable]=\"rowSelection === 'multiple' ? true : null\"\n (copy)=\"onGridCopy($event)\">\n \n <!-- Headers -->\n <one-grid-header\n [api]=\"api\"\n [enableGroupColumnDefs]=\"enableGroupColumnDefs\"\n [allowedEdit]=\"allowedEdit\"\n [scrollLeft]=\"bodyScrollLeft\"\n [headerMenu]=\"headerMenu\"\n [filterRow]=\"filterRow\"\n (headerMenuClick)=\"headerMenuClick.emit($event)\"\n />\n\n <!-- Body -->\n <one-grid-body\n [gridCopy$]=\"gridCopy$\"\n [rowData]=\"rowData\"\n [pinnedTopRowData]=\"pinnedTopRowData\"\n [pinnedBottomRowData]=\"pinnedBottomRowData\"\n [api]=\"api\"\n [rowNumber]=\"rowNumber\"\n [pagination]=\"pagination\"\n [allowedEdit]=\"allowedEdit\"\n [editType]=\"editType\"\n [submitted]=\"submitted\"\n [context]=\"context\"\n [treeData]=\"treeData\"\n [gridType]=\"gridType\"\n [masterDetail]=\"masterDetail\"\n [masterNode]=\"masterNode\"\n [detailCellRendererParams]=\"detailCellRendererParams\"\n [detailRendererComponent]=\"detailRendererComponent\"\n [detailGridTemplate]=\"detailGridTpl\"\n [treeDataChildrenField]=\"treeDataChildrenField\"\n [autoGroupColumnDef]=\"autoGroupColumnDef\"\n [groupDefaultExpanded]=\"groupDefaultExpanded\"\n (rowDragEnd)=\"invokeRowDragEnd($event)\"\n (expansionChanged)=\"invokeExpansionChangedClick($event)\"\n (onRowGotoDetail)=\"invokeRowActionGotoDetail($event)\"\n (onRowAddNew)=\"invokeRowActionAddNew($event)\"\n (onRowView)=\"invokeRowActionView($event)\"\n (onRowLocation)=\"invokeRowActionLocation($event)\"\n (onRowDocument)=\"invokeRowActionDocument($event)\"\n (onRowCopy)=\"invokeRowActionCopy($event)\"\n (onRowDelete)=\"invokeRowActionDelete($event)\"\n (onRowGotoList)=\"invokeRowActionGotoList($event)\"\n (onRowEdit)=\"invokeRowActionEdit($event)\"\n (onRowPrint)=\"invokeRowActionPrint($event)\"\n (onRowHistory)=\"invokeRowActionHistory($event)\"\n (onRowOption)=\"invokeRowActionOption($event)\"\n (onRowLanguage)=\"invokeRowActionLanguage($event)\"\n (onRowCellOption)=\"invokeRowActionCellOption($event)\"\n (onRowSelection)=\"invokeRowActionSelection($event)\"\n (onShiftDoubleClick)=\"invokeShiftDoubleClick($event)\"\n (rowCountChanged)=\"invokeRowCountChanged($event)\"\n (cellOptionSelect)=\"cellOptionMenuSelected($event)\"\n (bodyScroll)=\"onBodyScroll($event)\"\n />\n \n <!-- Pagination -->\n @if (pagination || clientSidePagination) {\n <one-grid-pagination\n [paginate]=\"clientSidePagination ? internalPaginate : paginate\"\n (goToFirst)=\"invokeGoToFirst()\"\n (goToLast)=\"invokeGoToLast()\"\n (goToPrevious)=\"invokeGoToPrevious()\"\n (goToNext)=\"invokeGoToNext()\"\n (pageSizeChange)=\"invokePageSizeChange($event)\"\n />\n }\n\n <!-- Master Detail Grid template, rendered inside one-grid-body via ngTemplateOutlet.\n Declared here (self-reference) so one-grid-body's template does not need to\n import one-grid, which would create an unsupported compile-time cycle. -->\n <ng-template #detailGridTpl let-node=\"node\">\n <one-grid\n [style.height.px]=\"node.detailRowHeight\"\n [gridType]=\"'detail'\"\n [masterNode]=\"node\"\n [masterDetail]=\"masterDetail\"\n [defaultColumnDef]=\"detailCellRendererParams.detailGridOptions.defaultColumnDef\"\n [columnDefs]=\"detailCellRendererParams.detailGridOptions.columnDefs\"\n [rowData]=\"node?.detailRowData\"\n [rowNumber]=\"detailCellRendererParams.detailGridOptions?.rowNumber\"\n [allowedEdit]=\"allowedEdit\"\n [submitted]=\"submitted\"\n [context]=\"context\"\n (expansionChanged)=\"invokeExpansionChangedClick($event)\"\n (onRowGotoDetail)=\"invokeRowActionGotoDetail($event)\"\n (onRowAddNew)=\"invokeRowActionAddNew($event)\"\n (onRowView)=\"invokeRowActionView($event)\"\n (onRowLocation)=\"invokeRowActionLocation($event)\"\n (onRowDocument)=\"invokeRowActionDocument($event)\"\n (onRowCopy)=\"invokeRowActionCopy($event)\"\n (onRowDelete)=\"invokeRowActionDelete($event)\"\n (onRowGotoList)=\"invokeRowActionGotoList($event)\"\n (onRowEdit)=\"invokeRowActionEdit($event)\"\n (onRowPrint)=\"invokeRowActionPrint($event)\"\n (onRowHistory)=\"invokeRowActionHistory($event)\"\n (onRowOption)=\"invokeRowActionOption($event)\"\n (onRowLanguage)=\"invokeRowActionLanguage($event)\"\n (onRowCellOption)=\"invokeRowActionCellOption($event)\"\n (onGridReady)=\"onDetailGridReady($event)\"\n />\n </ng-template>\n</div>","import { Component } from '@angular/core';\nimport { OneCellRendererComponent } from '../../core/models/one-tree-data.model';\nimport { OneCellRendererParams } from '../../core/models/one-column-def-types.model';\nimport { NgClass } from '@angular/common';\n\n@Component({\n standalone: true,\n imports: [NgClass],\n selector: 'one-grid-status',\n templateUrl: './one-grid-status.component.html',\n styleUrl: './one-grid-status.component.scss',\n})\nexport class OneGridStatusComponent implements OneCellRendererComponent {\n\n protected params!: OneCellRendererParams;\n protected value = '';\n protected label = 0;\n protected type: 'enableStatus' | 'activeStatus' | 'operationActiveStatus' | null = null;\n\n oneInit(params: OneCellRendererParams): void {\n\n this.params = params;\n this.label = params?.value ?? 0;\n\n this.type = this.getType(params.columnDef.field);\n this.value = this.getLabel(this.type, this.label);\n }\n\n refresh(params: OneCellRendererParams): boolean {\n\n return false;\n }\n\n private getType(field: string): 'enableStatus' | 'activeStatus' | 'operationActiveStatus' | null {\n\n return field === 'enableStatus' || field === 'activeStatus' || field === 'operationActiveStatus' ? field : null;\n }\n\n private getLabel(type: 'enableStatus' | 'activeStatus' | 'operationActiveStatus' | null, status: number): string {\n\n if (!type) return 'N/A';\n\n const labels = { enableStatus: ['Disabled', 'Enabled'], activeStatus: ['Inactive', 'Active'], operationActiveStatus: ['Inactive', 'Active'] } as const;\n\n return labels[type][status === 1 ? 1 : 0];\n }\n}\n","<span class=\"one-cell-status\"\n [style.width.px]=\"params.columnDef?.width\"\n [style.min-width.px]=\"params.columnDef?.minWidth\"\n [style.max-width.px]=\"params.columnDef?.maxWidth\"\n >\n <span class=\"one-cell-status-body\" [ngClass]=\"label === 1 ? 'one-success-bg' : 'one-warning-bg'\">\n {{ value }}\n </span>\n</span>\n","import { Component, Input } from '@angular/core';\nimport { CellStateChangedEvent } from '../../core/models/one-event-types.model';\nimport { OneCellRendererParams, OneColumnDef } from '../../core/models/one-column-def-types.model';\nimport { OneGridCellService } from '../../core/services/one-grid-cell.service';\nimport { OneGridEventService } from '../../core/services/one-grid-event.service';\nimport { OneRowNode } from '../../core/instants/one-row-node.class';\nimport { getCellField } from '../../helpers/one-cell.helper';\nimport { CellEditablePipe } from '../../core/pipes/cell-editable.pipe';\nimport { DecimalPipe } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { OneCellInputValidatorDirective } from '../../core/directives/one-cell-input-validator.directive';\n\n@Component({\n standalone: true,\n imports: [DecimalPipe, FormsModule, OneCellInputValidatorDirective],\n selector: 'app-one-grid-cell-currency',\n templateUrl: './one-grid-cell-currency.component.html',\n styleUrl: './one-grid-cell-currency.component.scss'\n})\nexport class OneGridCellCurrencyComponent {\n \n value: string = '';\n result: any;\n params!: OneCellRendererParams;\n @Input() allowedEdit: boolean = false;\n\n getCellField = getCellField;\n private unsubscribe?: () => void;\n private cellEditablePipe = new CellEditablePipe();\n\n constructor(\n private cellService: OneGridCellService,\n private eventService: OneGridEventService\n ) { }\n\n oneInit(params: OneCellRendererParams): void {\n\n this.params = params;\n this.value = params.data[params.columnDef.field];\n this.result = this.value;\n this.allowedEdit = params.context.componentParent.allowedEdit || false;\n\n this.unsubscribe = this.eventService.addEventListener('cellStateChanged', (payload: CellStateChangedEvent<any>) => {\n if (this.params.node.rowId === payload.node.rowId) {\n\n this.result = this.cellService.generateCellState(this.params.node, this.params.columnDef).value;\n }\n });\n }\n\n refresh(params: OneCellRendererParams): boolean {\n // Update params and values when grid data refreshes\n this.params = params;\n this.value = params.data[params.columnDef.field];\n this.result = this.value;\n this.allowedEdit = params.context.componentParent.allowedEdit || false;\n\n return true;\n }\n\n get isEditable(): boolean {\n if (!this.params.node || !this.params.columnDef) return false;\n\n return this.cellEditablePipe.transform(\n this.params.node.cellStates,\n this.params.columnDef,\n this.params.node,\n this.cellService.editableFn,\n this.cellService.updatableFn,\n this.allowedEdit\n );\n }\n\n startEdit(node: OneRowNode<any>, column: OneColumnDef<any>) {\n\n if (!this.isEditable) {\n return;\n }\n\n if (node) {\n\n node.editing[column.field] = true;\n\n setTimeout(() => {\n\n const input = document.querySelector<HTMLInputElement>(`[data-cell-id=\"${getCellField(node.rowIndex, column.field)}\"] input`);\n\n if (input) {\n\n input.focus();\n\n const value = input.value;\n\n if (value && [\"text\"].includes(input.type)) {\n\n input.setSelectionRange(value.length, value.length);\n }\n }\n }, 10);\n }\n }\n\n stopEdit(node: OneRowNode<any>, column: OneColumnDef<any>, event: any) {\n\n if (node) {\n\n node.data[column.field] = event.target.value === '' ? null : event.target.value;\n\n node.cellStates = this.cellService.generateCellStates(node);\n\n node.editing[column.field] = false;\n\n this.eventService.dispatchEvent('cellStateChanged', {\n data: { ...node.data },\n node: node,\n column: column\n });\n }\n }\n\n cancelEdit(node: OneRowNode<any>, column: OneColumnDef<any>) {\n\n if (node) {\n\n node.editing[column.field] = false;\n }\n }\n\n ngOnDestroy(): void {\n\n this.unsubscribe?.();\n }\n}\n","<div class=\"cell-wrapper\"\n [class.editable]=\"isEditable\"\n [attr.data-cell-id]=\"getCellField(params.node?.rowIndex, params.columnDef?.field)\"\n [style.min-width.px]=\"params.columnDef?.minWidth\"\n [style.max-width.px]=\"params.columnDef?.maxWidth\">\n\n @if (params.node?.editing?.[params.columnDef?.field]) {\n <input class=\"one-cell-input\"\n name=\"{{ params.node?.rowIndex }}_{{ params.columnDef?.field }}\"\n oneCellInputValidator\n validationType=\"number\"\n [placeholder]=\"params.columnDef?.cellRendererParams?.placeholder || ''\"\n type=\"text\"\n [(ngModel)]=\"value\"\n [maxLength]=\"250\"\n (blur)=\"stopEdit(params.node, params.columnDef, $event)\"\n (keydown.enter)=\"stopEdit(params.node, params.columnDef, $event)\"\n (keydown.esc)=\"cancelEdit(params.node, params.columnDef)\" />\n }\n @else {\n <div class=\"d-flex justify-content-between px-2 pt-1\"\n [class.one-cell-allowed-edit-active]=\"isEditable\"\n (dblclick)=\"startEdit(params.node, params.columnDef)\">\n <span class=\"currency-code\" style=\"font-weight: bold;\">{{ this.params?.data?.currency?.currencyCode || 'USD' }}</span>\n <span class=\"amount-value\">\n {{ result | number:(this.params?.field === 'amount' ? '1.3-3' : '1.2-2') }}\n </span>\n </div>\n }\n</div>\n","import { NgModule } from '@angular/core';\nimport { OneGridComponent } from './components/one-grid/one-grid.component';\nimport { OneGridStatusComponent } from './components/one-grid-status/one-grid-status.component';\nimport { OneGridCellCurrencyComponent } from './components/one-grid-cell-currency/one-grid-cell-currency.component';\n\n/**\n * Compatibility shim.\n *\n * Every component, directive and pipe in the library is standalone, so this\n * module declares nothing — it exists so `imports: [OneGridModule]` keeps\n * working for anyone already on it. New code can import `OneGridComponent`\n * directly instead.\n *\n * Icons no longer need registering here: each component that draws one\n * provides the eight the grid uses, so they travel with the component whichever\n * way it is imported.\n */\n@NgModule({\n imports: [\n OneGridComponent,\n OneGridStatusComponent,\n OneGridCellCurrencyComponent,\n ],\n exports: [\n OneGridComponent,\n OneGridStatusComponent,\n OneGridCellCurrencyComponent,\n ],\n})\nexport class OneGridModule { }\n","/*\n * Public API Surface of one-grid\n */\n\nexport * from './lib/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uuidv4","i1.OgColumnService","i2.OneGridRowService","i3.OneGridCellService","i4.OneGridEventService","i5.OneGridSelectionService","i6.OneGridExpansionService","i1.OneGridEventService","i2.OneGridSelectionService","i1.OneGridSelectionService","i2.OneGridEventService","i1.OneGridCellService","i1.OneGridRowDragService","i2.OneGridCellService","i3.OneGridEventService","i4.OneGridRowDragService","i1","_","i1.OneGridApi"],"mappings":";;;;;;;;;;;;;;AAGA;AACO,MAAM,wBAAwB,GAAG;AAExC;;;;;;;;AAQG;AACG,SAAU,kBAAkB,CAAI,MAAuB,EAAA;AAEzD,IAAA,MAAM,GAAG,GAAG,MAAM,EAAE,QAAQ,IAAI,CAAC;IACjC,MAAM,GAAG,GAAG,MAAM,EAAE,QAAQ,I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