angular / angular/components

[CdkTable] expose _insertRow to derived classes

Abierto
#14,199 3 comentarios 4 reacciones 0 asignados Ver en GitHub
area: cdk/table feature P3
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

#### Bug, feature request, or proposal: proposal

#### What is the expected behavior?
`_insertRow` is visible to inheriting classes

#### What is the current behavior?
`_insertRow` is private

#### What is the use-case or motivation for changing an existing behavior?
In `_insertRow` the context is created (`RowContext`).
The row context is very useful as a metadata storage for the row, storing information about the row that helps when we want to create features that require state.

For example, flagging if the row is currently being edited, which cell is edited. If the row is being dragged or not etc...

This is also true for a specific cell, metadata for it can be saved on the row context.

#### Is there anything else we should know?
Because `_insertRow` calls `_renderRow`, which is also private, it will require exposing `_renderRow` as well, which is dont think is such a bad thing.

But, if we want to avoid that, maybe it will be better to expose a new protected method, `_createRowContext(data: T): RowContext ` that people can extend

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza leyendo los métodos _insertRow y _renderRow de CdkTable y cómo se crea RowContext. Determina si las clases derivadas deberían acceder a los métodos existentes o a un punto de entrada protegido para la creación del contexto; se considera terminado cuando la API elegida admite metadatos de fila para las clases derivadas sin dejar el comportamiento ambiguo.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.