diff --git a/apis/nucleus/src/components/listbox/components/ListBoxRowColumn/ListBoxRowColumn.jsx b/apis/nucleus/src/components/listbox/components/ListBoxRowColumn/ListBoxRowColumn.jsx index a2a6d0a7b..fd14d7e45 100644 --- a/apis/nucleus/src/components/listbox/components/ListBoxRowColumn/ListBoxRowColumn.jsx +++ b/apis/nucleus/src/components/listbox/components/ListBoxRowColumn/ListBoxRowColumn.jsx @@ -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 }), diff --git a/apis/nucleus/src/components/listbox/components/ListBoxRowColumn/components/ListBoxRoot.jsx b/apis/nucleus/src/components/listbox/components/ListBoxRowColumn/components/ListBoxRoot.jsx index 3496b4567..12ed07093 100644 --- a/apis/nucleus/src/components/listbox/components/ListBoxRowColumn/components/ListBoxRoot.jsx +++ b/apis/nucleus/src/components/listbox/components/ListBoxRowColumn/components/ListBoxRoot.jsx @@ -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, }, diff --git a/test/rendering/listbox/__fixtures__/locked_states.js b/test/rendering/listbox/__fixtures__/locked_states.js new file mode 100644 index 000000000..d2c6c2dd6 --- /dev/null +++ b/test/rendering/listbox/__fixtures__/locked_states.js @@ -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; diff --git a/test/rendering/listbox/__fixtures__/not_locked_states.js b/test/rendering/listbox/__fixtures__/not_locked_states.js new file mode 100644 index 000000000..187ca2c70 --- /dev/null +++ b/test/rendering/listbox/__fixtures__/not_locked_states.js @@ -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; diff --git a/test/rendering/listbox/listbox.spec.js-snapshots/locked-states-js-linux.png b/test/rendering/listbox/listbox.spec.js-snapshots/locked-states-js-linux.png new file mode 100644 index 000000000..176f60321 Binary files /dev/null and b/test/rendering/listbox/listbox.spec.js-snapshots/locked-states-js-linux.png differ diff --git a/test/rendering/listbox/listbox.spec.js-snapshots/not-locked-states-js-linux.png b/test/rendering/listbox/listbox.spec.js-snapshots/not-locked-states-js-linux.png new file mode 100644 index 000000000..b657d233b Binary files /dev/null and b/test/rendering/listbox/listbox.spec.js-snapshots/not-locked-states-js-linux.png differ