MCPcopy Index your code
hub / github.com/plotly/dash / convertElement

Function convertElement

components/dash-table/src/dash-table/derived/style/index.ts:66–103  ·  view source on GitHub ↗
(style: GenericStyle)

Source from the content-addressed store, hash-verified

64type GenericStyle = Style & Partial<{if: GenericIf}>;
65
66function convertElement(style: GenericStyle): IConvertedStyle {
67 let ast: QuerySyntaxTree;
68
69 return {
70 checksColumn: () =>
71 !R.isNil(style.if) &&
72 (!R.isNil(style.if.column_id) ||
73 !R.isNil(style.if.column_type) ||
74 !R.isNil(style.if.column_editable)),
75 checksFilter: () =>
76 !R.isNil(style.if) && !R.isNil(style.if.filter_query),
77 checksDataRow: () => !R.isNil(style.if) && !R.isNil(style.if.row_index),
78 checksHeaderRow: () =>
79 !R.isNil(style.if) && !R.isNil(style.if.header_index),
80 checksState: () => !R.isNil(style.if?.state),
81 checksStateActive: () => style.if?.state === 'active',
82 checksStateSelected: () => style.if?.state === 'selected',
83 matchesActive: (active: boolean) =>
84 ifColumnStateActive(style.if, active),
85 matchesColumn: (column: IColumn | undefined) =>
86 !style.if ||
87 (!R.isNil(column) &&
88 ifColumnId(style.if, column && column.id) &&
89 ifColumnType(style.if, column && column.type) &&
90 ifEditable(style.if, column && column.editable)),
91 matchesFilter: (datum: Datum) =>
92 !style.if ||
93 style.if.filter_query === undefined ||
94 (ast = ast || new QuerySyntaxTree(style.if.filter_query)).evaluate(
95 datum
96 ),
97 matchesDataRow: (index: number) => ifRowIndex(style.if, index),
98 matchesHeaderRow: (index: number) => ifHeaderIndex(style.if, index),
99 matchesSelected: (selected: boolean) =>
100 ifColumnStateSelected(style.if, selected),
101 style: convertStyle(style)
102 };
103}
104
105function convertStyle(style: Style): CSSProperties {
106 // eslint-disable-next-line @typescript-eslint/ban-ts-comment

Callers 1

index.tsFile · 0.85

Calls 8

ifColumnStateActiveFunction · 0.90
ifColumnIdFunction · 0.90
ifColumnTypeFunction · 0.90
ifEditableFunction · 0.90
ifRowIndexFunction · 0.90
ifHeaderIndexFunction · 0.90
ifColumnStateSelectedFunction · 0.90
convertStyleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…