projects/m2-core/src/lib/core/utils/card.utils.ts
Methods |
|
| Static doForAll |
doForAll(rows: CardRow[], fn: (row: CardRow) => void, selfFirst)
|
|
Returns :
void
|
| Static doForTop |
doForTop(rows: CardRow[], fn: (row: CardRow) => void)
|
|
FIXME multiple aggregations/attribute values nested in Categories are skipped!
Returns :
void
|
| Static findCardItemIds |
findCardItemIds(rows: CardRow[], rootItemId?: number)
|
|
Returns :
Set<number>
|
| Static findCardRow |
findCardRow(rows: CardRow[], predicate: (row: CardRow) => void)
|
|
{CardRow} The first row that matches the predicate (recursively)
Returns :
CardRow
|
| Static findCardRows |
findCardRows(rows: CardRow[], predicate: (row: CardRow) => void)
|
|
Returns :
CardRow[]
|
| Static findDeclarationByPropertyId | |||||||||
findDeclarationByPropertyId(propertyId: number, declarationsToValues: DeclarationToValues[])
|
|||||||||
|
Parameters :
Returns :
PropertyDeclaration
|
| Static findFirstRowWithInput | ||||||
findFirstRowWithInput(rows: CardRow[])
|
||||||
|
Parameters :
Returns :
AttributeValueRow
|
| Static findItemRowsSets |
findItemRowsSets(rootRows: CardRow[], targetItemId: number, rootItemId?: number)
|
|
Find item's rows sets (recursively)
Returns :
[][]
|
| Static findNearestRowEntity |
findNearestRowEntity(rows: CardRow[], targetRow: CardRow, getEntityFn: (r: CardRow) => void)
|
Type parameters :
|
|
Only root rows are analyzed. Rows after are checked first, then - rows before.
Returns :
literal type
|
| Static getDesirableUnitId | ||||||
getDesirableUnitId(cardRow: CardRow)
|
||||||
|
refs #16119 By default we take unit in which the value was input. In case there is no value or its unit is not presented in the double encoded string - use the desirable one (from declaration, constraint column, application attribute, etc.). TODO refactoring: use polymorphism
Parameters :
Returns :
number
|
| Static reassignRowsIds |
reassignRowsIds(oldRows: CardRow[], newRows: CardRow[])
|
|
#21558 We preserve card row ids when possible to let previous card row components to be reused for better performance.
Returns :
void
|
| Static scrollTabIntoViewIfNeeded | |||||||||
scrollTabIntoViewIfNeeded(accordionComponent: Accordion, index: number)
|
|||||||||
|
Scroll into view
Parameters :
Returns :
void
|
| Static updateRowUnitIfNeeded | |||||||||
updateRowUnitIfNeeded(row: CardRow, request: UpdatePropertyValueRequest)
|
|||||||||
|
Parameters :
Returns :
void
|