mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2026-05-26 22:00:24 -04:00
fix: use same text color for excluded and selectedExcluded (#1147)
* fix: use same text color for excluded and selectedExcluded * test: add rendering tests * fix: lock icon on locked excluded
This commit is contained in:
@@ -95,7 +95,7 @@ function RowColumn({ index, rowIndex, columnIndex, style, data }) {
|
||||
const handleKeyDownCallback = useCallback(getFieldKeyboardNavigation({ ...actions, focusListItems }), [actions]);
|
||||
|
||||
const cell = useMemo(() => getCellFromPages({ pages, cellIndex }), [pages, cellIndex]);
|
||||
const isSelected = cell?.qState === 'S' || cell?.qState === 'XS' || cell?.qState === 'L';
|
||||
const isSelected = cell?.qState === 'S' || cell?.qState === 'XS' || cell?.qState === 'L' || cell?.qState === 'XL';
|
||||
|
||||
const classArr = useMemo(
|
||||
() => getValueStateClasses({ column, histogram, checkboxes, cell, showGray }),
|
||||
|
||||
@@ -126,7 +126,7 @@ const RowColRoot = styled('div', {
|
||||
[`& .${classes.XS}`]: {
|
||||
...getSelectedStyle({ theme }),
|
||||
background: theme.palette.selected.excluded,
|
||||
color: theme.palette.selected.mainContrastText,
|
||||
color: theme.palette.selected.excludedContrastText,
|
||||
border: isGridMode ? 'none' : undefined,
|
||||
},
|
||||
|
||||
|
||||
79
test/rendering/listbox/__fixtures__/locked_states.js
Normal file
79
test/rendering/listbox/__fixtures__/locked_states.js
Normal file
@@ -0,0 +1,79 @@
|
||||
const fixture = {
|
||||
getLayout: () => ({
|
||||
title: 'Field title',
|
||||
qInfo: {
|
||||
qId: 'qId',
|
||||
},
|
||||
visualization: 'listbox',
|
||||
qListObject: {
|
||||
qDimensionInfo: {
|
||||
qLocked: true,
|
||||
},
|
||||
qSize: {
|
||||
qcy: 5,
|
||||
},
|
||||
qInitialDataFetch: [{ qLeft: 0, qWidth: 0, qTop: 0, qHeight: 0 }],
|
||||
},
|
||||
qSelectionInfo: {
|
||||
qInSelections: false,
|
||||
},
|
||||
layoutOptions: {
|
||||
layoutOrder: 'row',
|
||||
},
|
||||
}),
|
||||
getListObjectData: () => [
|
||||
{
|
||||
qMatrix: [
|
||||
[
|
||||
{
|
||||
qText: 'Locked',
|
||||
qNum: 'NaN',
|
||||
qElemNumber: 0,
|
||||
qState: 'L',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
qText: 'Alternative',
|
||||
qNum: 'NaN',
|
||||
qElemNumber: 1,
|
||||
qState: 'A',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
qText: 'Optional',
|
||||
qNum: 'NaN',
|
||||
qElemNumber: 2,
|
||||
qState: 'O',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
qText: 'Locked Excluded',
|
||||
qNum: 'NaN',
|
||||
qElemNumber: 3,
|
||||
qState: 'XL',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
qText: 'Excluded',
|
||||
qNum: 'NaN',
|
||||
qElemNumber: 4,
|
||||
qState: 'X',
|
||||
},
|
||||
],
|
||||
],
|
||||
qTails: [],
|
||||
qArea: {
|
||||
qLeft: 0,
|
||||
qTop: 0,
|
||||
qWidth: 1,
|
||||
qHeight: 5,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default fixture;
|
||||
79
test/rendering/listbox/__fixtures__/not_locked_states.js
Normal file
79
test/rendering/listbox/__fixtures__/not_locked_states.js
Normal file
@@ -0,0 +1,79 @@
|
||||
const fixture = {
|
||||
getLayout: () => ({
|
||||
title: 'Field title',
|
||||
qInfo: {
|
||||
qId: 'qId',
|
||||
},
|
||||
visualization: 'listbox',
|
||||
qListObject: {
|
||||
qDimensionInfo: {
|
||||
qLocked: false,
|
||||
},
|
||||
qSize: {
|
||||
qcy: 5,
|
||||
},
|
||||
qInitialDataFetch: [{ qLeft: 0, qWidth: 0, qTop: 0, qHeight: 0 }],
|
||||
},
|
||||
qSelectionInfo: {
|
||||
qInSelections: false,
|
||||
},
|
||||
layoutOptions: {
|
||||
layoutOrder: 'row',
|
||||
},
|
||||
}),
|
||||
getListObjectData: () => [
|
||||
{
|
||||
qMatrix: [
|
||||
[
|
||||
{
|
||||
qText: 'Selected',
|
||||
qNum: 'NaN',
|
||||
qElemNumber: 0,
|
||||
qState: 'S',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
qText: 'Alternative',
|
||||
qNum: 'NaN',
|
||||
qElemNumber: 1,
|
||||
qState: 'A',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
qText: 'Optional',
|
||||
qNum: 'NaN',
|
||||
qElemNumber: 2,
|
||||
qState: 'O',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
qText: 'Selected Excluded',
|
||||
qNum: 'NaN',
|
||||
qElemNumber: 3,
|
||||
qState: 'XS',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
qText: 'Excluded',
|
||||
qNum: 'NaN',
|
||||
qElemNumber: 4,
|
||||
qState: 'X',
|
||||
},
|
||||
],
|
||||
],
|
||||
qTails: [],
|
||||
qArea: {
|
||||
qLeft: 0,
|
||||
qTop: 0,
|
||||
qWidth: 1,
|
||||
qHeight: 5,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default fixture;
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Reference in New Issue
Block a user