@nebula.js/stardust 4.5.0-alpha.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/esm/dev.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v4.5.0-alpha.0
2
+ * @nebula.js/stardust v4.6.0
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -3950,7 +3950,11 @@ function deprecatedPropType(validator, reason) {
3950
3950
  }
3951
3951
 
3952
3952
  function isMuiElement(element, muiNames) {
3953
- return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;
3953
+ var _muiName, _element$type;
3954
+ return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName
3955
+ // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
3956
+ // eslint-disable-next-line no-underscore-dangle
3957
+ (_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;
3954
3958
  }
3955
3959
 
3956
3960
  function ownerDocument(node) {
@@ -3989,6 +3993,13 @@ function setRef(ref, value) {
3989
3993
  }
3990
3994
  }
3991
3995
 
3996
+ /**
3997
+ * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
3998
+ * This is useful for effects that are only needed for client-side rendering but not for SSR.
3999
+ *
4000
+ * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
4001
+ * and confirm it doesn't apply to your use-case.
4002
+ */
3992
4003
  const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
3993
4004
  var useEnhancedEffect$1 = useEnhancedEffect;
3994
4005
 
@@ -4053,7 +4064,8 @@ function useControlled({
4053
4064
  }
4054
4065
 
4055
4066
  /**
4056
- * https://github.com/facebook/react/issues/14099#issuecomment-440013892
4067
+ * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
4068
+ * See RFC in https://github.com/reactjs/rfcs/pull/220
4057
4069
  */
4058
4070
 
4059
4071
  function useEventCallback(fn) {
@@ -5658,7 +5670,7 @@ function StyledEngineProvider(props) {
5658
5670
  }
5659
5671
 
5660
5672
  /**
5661
- * @mui/styled-engine v5.14.6
5673
+ * @mui/styled-engine v5.14.13
5662
5674
  *
5663
5675
  * @license MIT
5664
5676
  * This source code is licensed under the MIT license found in the
@@ -6283,10 +6295,20 @@ const width = style$1({
6283
6295
  const maxWidth = props => {
6284
6296
  if (props.maxWidth !== undefined && props.maxWidth !== null) {
6285
6297
  const styleFromPropValue = propValue => {
6286
- var _props$theme;
6298
+ var _props$theme, _props$theme2;
6287
6299
  const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || values[propValue];
6300
+ if (!breakpoint) {
6301
+ return {
6302
+ maxWidth: sizingTransform(propValue)
6303
+ };
6304
+ }
6305
+ if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {
6306
+ return {
6307
+ maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
6308
+ };
6309
+ }
6288
6310
  return {
6289
- maxWidth: breakpoint || sizingTransform(propValue)
6311
+ maxWidth: breakpoint
6290
6312
  };
6291
6313
  };
6292
6314
  return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
@@ -6822,40 +6844,48 @@ const getStyleOverrides = (name, theme) => {
6822
6844
  }
6823
6845
  return null;
6824
6846
  };
6847
+ const transformVariants = variants => {
6848
+ const variantsStyles = {};
6849
+ if (variants) {
6850
+ variants.forEach(definition => {
6851
+ const key = propsToClassKey(definition.props);
6852
+ variantsStyles[key] = definition.style;
6853
+ });
6854
+ }
6855
+ return variantsStyles;
6856
+ };
6825
6857
  const getVariantStyles = (name, theme) => {
6826
6858
  let variants = [];
6827
6859
  if (theme && theme.components && theme.components[name] && theme.components[name].variants) {
6828
6860
  variants = theme.components[name].variants;
6829
6861
  }
6830
- const variantsStyles = {};
6831
- variants.forEach(definition => {
6832
- const key = propsToClassKey(definition.props);
6833
- variantsStyles[key] = definition.style;
6834
- });
6835
- return variantsStyles;
6862
+ return transformVariants(variants);
6836
6863
  };
6837
- const variantsResolver = (props, styles, theme, name) => {
6838
- var _theme$components;
6864
+ const variantsResolver = (props, styles, variants) => {
6839
6865
  const {
6840
6866
  ownerState = {}
6841
6867
  } = props;
6842
6868
  const variantsStyles = [];
6843
- const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[name]) == null ? void 0 : _theme$components.variants;
6844
- if (themeVariants) {
6845
- themeVariants.forEach(themeVariant => {
6869
+ if (variants) {
6870
+ variants.forEach(variant => {
6846
6871
  let isMatch = true;
6847
- Object.keys(themeVariant.props).forEach(key => {
6848
- if (ownerState[key] !== themeVariant.props[key] && props[key] !== themeVariant.props[key]) {
6872
+ Object.keys(variant.props).forEach(key => {
6873
+ if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
6849
6874
  isMatch = false;
6850
6875
  }
6851
6876
  });
6852
6877
  if (isMatch) {
6853
- variantsStyles.push(styles[propsToClassKey(themeVariant.props)]);
6878
+ variantsStyles.push(styles[propsToClassKey(variant.props)]);
6854
6879
  }
6855
6880
  });
6856
6881
  }
6857
6882
  return variantsStyles;
6858
6883
  };
6884
+ const themeVariantsResolver = (props, styles, theme, name) => {
6885
+ var _theme$components;
6886
+ const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[name]) == null ? void 0 : _theme$components.variants;
6887
+ return variantsResolver(props, styles, themeVariants);
6888
+ };
6859
6889
 
6860
6890
  // Update /system/styled/#api in case if this changes
6861
6891
  function shouldForwardProp(prop) {
@@ -6881,6 +6911,29 @@ function defaultOverridesResolver(slot) {
6881
6911
  }
6882
6912
  return (props, styles) => styles[slot];
6883
6913
  }
6914
+ const muiStyledFunctionResolver = ({
6915
+ styledArg,
6916
+ props,
6917
+ defaultTheme,
6918
+ themeId
6919
+ }) => {
6920
+ const resolvedStyles = styledArg(_extends$2({}, props, {
6921
+ theme: resolveTheme(_extends$2({}, props, {
6922
+ defaultTheme,
6923
+ themeId
6924
+ }))
6925
+ }));
6926
+ let optionalVariants;
6927
+ if (resolvedStyles && resolvedStyles.variants) {
6928
+ optionalVariants = resolvedStyles.variants;
6929
+ delete resolvedStyles.variants;
6930
+ }
6931
+ if (optionalVariants) {
6932
+ const variantsStyles = variantsResolver(props, transformVariants(optionalVariants), optionalVariants);
6933
+ return [resolvedStyles, ...variantsStyles];
6934
+ }
6935
+ return resolvedStyles;
6936
+ };
6884
6937
  function createStyled(input = {}) {
6885
6938
  const {
6886
6939
  themeId,
@@ -6940,16 +6993,61 @@ function createStyled(input = {}) {
6940
6993
  // On the server Emotion doesn't use React.forwardRef for creating components, so the created
6941
6994
  // component stays as a function. This condition makes sure that we do not interpolate functions
6942
6995
  // which are basically components used as a selectors.
6943
- return typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg ? props => {
6944
- return stylesArg(_extends$2({}, props, {
6945
- theme: resolveTheme(_extends$2({}, props, {
6946
- defaultTheme,
6947
- themeId
6948
- }))
6949
- }));
6950
- } : stylesArg;
6996
+ if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg) {
6997
+ return props => muiStyledFunctionResolver({
6998
+ styledArg: stylesArg,
6999
+ props,
7000
+ defaultTheme,
7001
+ themeId
7002
+ });
7003
+ }
7004
+ if (isPlainObject(stylesArg)) {
7005
+ let transformedStylesArg = stylesArg;
7006
+ let styledArgVariants;
7007
+ if (stylesArg && stylesArg.variants) {
7008
+ styledArgVariants = stylesArg.variants;
7009
+ delete transformedStylesArg.variants;
7010
+ transformedStylesArg = props => {
7011
+ let result = stylesArg;
7012
+ const variantStyles = variantsResolver(props, transformVariants(styledArgVariants), styledArgVariants);
7013
+ variantStyles.forEach(variantStyle => {
7014
+ result = deepmerge(result, variantStyle);
7015
+ });
7016
+ return result;
7017
+ };
7018
+ }
7019
+ return transformedStylesArg;
7020
+ }
7021
+ return stylesArg;
6951
7022
  }) : [];
6952
7023
  let transformedStyleArg = styleArg;
7024
+ if (isPlainObject(styleArg)) {
7025
+ let styledArgVariants;
7026
+ if (styleArg && styleArg.variants) {
7027
+ styledArgVariants = styleArg.variants;
7028
+ delete transformedStyleArg.variants;
7029
+ transformedStyleArg = props => {
7030
+ let result = styleArg;
7031
+ const variantStyles = variantsResolver(props, transformVariants(styledArgVariants), styledArgVariants);
7032
+ variantStyles.forEach(variantStyle => {
7033
+ result = deepmerge(result, variantStyle);
7034
+ });
7035
+ return result;
7036
+ };
7037
+ }
7038
+ } else if (typeof styleArg === 'function' &&
7039
+ // On the server Emotion doesn't use React.forwardRef for creating components, so the created
7040
+ // component stays as a function. This condition makes sure that we do not interpolate functions
7041
+ // which are basically components used as a selectors.
7042
+ styleArg.__emotion_real !== styleArg) {
7043
+ // If the type is function, we need to define the default theme.
7044
+ transformedStyleArg = props => muiStyledFunctionResolver({
7045
+ styledArg: styleArg,
7046
+ props,
7047
+ defaultTheme,
7048
+ themeId
7049
+ });
7050
+ }
6953
7051
  if (componentName && overridesResolver) {
6954
7052
  expressionsWithDefaultTheme.push(props => {
6955
7053
  const theme = resolveTheme(_extends$2({}, props, {
@@ -6975,7 +7073,7 @@ function createStyled(input = {}) {
6975
7073
  defaultTheme,
6976
7074
  themeId
6977
7075
  }));
6978
- return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
7076
+ return themeVariantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
6979
7077
  });
6980
7078
  }
6981
7079
  if (!skipSx) {
@@ -6987,18 +7085,6 @@ function createStyled(input = {}) {
6987
7085
  // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.
6988
7086
  transformedStyleArg = [...styleArg, ...placeholders];
6989
7087
  transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
6990
- } else if (typeof styleArg === 'function' &&
6991
- // On the server Emotion doesn't use React.forwardRef for creating components, so the created
6992
- // component stays as a function. This condition makes sure that we do not interpolate functions
6993
- // which are basically components used as a selectors.
6994
- styleArg.__emotion_real !== styleArg) {
6995
- // If the type is function, we need to define the default theme.
6996
- transformedStyleArg = props => styleArg(_extends$2({}, props, {
6997
- theme: resolveTheme(_extends$2({}, props, {
6998
- defaultTheme,
6999
- themeId
7000
- }))
7001
- }));
7002
7088
  }
7003
7089
  const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
7004
7090
  if (tag.muiName) {
@@ -8206,7 +8292,9 @@ const light = {
8206
8292
  text: {
8207
8293
  primary: colors.grey25,
8208
8294
  secondary: 'rgba(0, 0, 0, 0.55)',
8209
- disabled: 'rgba(0, 0, 0, 0.3)'
8295
+ disabled: 'rgba(0, 0, 0, 0.3)',
8296
+ light: colors.grey100,
8297
+ dark: colors.grey0
8210
8298
  },
8211
8299
  action: {
8212
8300
  active: '#545454',
@@ -8240,9 +8328,13 @@ const light = {
8240
8328
  main: colors.green,
8241
8329
  alternative: '#E4E4E4',
8242
8330
  excluded: '#BEBEBE',
8331
+ selectedExcluded: '#BEBEBE',
8332
+ possible: colors.grey100,
8243
8333
  mainContrastText: colors.grey100,
8244
8334
  alternativeContrastText: colors.grey25,
8245
- excludedContrastText: colors.grey25
8335
+ excludedContrastText: colors.grey25,
8336
+ selectedExcludedContrastText: colors.grey100,
8337
+ possibleContrastText: colors.grey0
8246
8338
  },
8247
8339
  btn: {
8248
8340
  normal: 'rgba(255, 255, 255, 0.6)',
@@ -8270,7 +8362,9 @@ const dark = {
8270
8362
  text: {
8271
8363
  primary: colors.grey100,
8272
8364
  secondary: 'rgba(255, 255, 255, 0.6)',
8273
- disabled: 'rgba(255, 255, 255, 0.3)'
8365
+ disabled: 'rgba(255, 255, 255, 0.3)',
8366
+ light: colors.grey100,
8367
+ dark: colors.grey0
8274
8368
  },
8275
8369
  action: {
8276
8370
  // active: 'rgba(0, 0, 0, 0.55)',
@@ -8301,9 +8395,13 @@ const dark = {
8301
8395
  main: colors.green,
8302
8396
  alternative: colors.grey20,
8303
8397
  excluded: colors.grey10,
8398
+ selectedExcluded: colors.grey10,
8399
+ possible: colors.grey80,
8304
8400
  mainContrastText: colors.grey100,
8305
8401
  alternativeContrastText: colors.grey100,
8306
- excludedContrastText: colors.grey100
8402
+ excludedContrastText: colors.grey100,
8403
+ selectedExcludedContrastText: colors.grey100,
8404
+ possibleContrastText: colors.grey0
8307
8405
  },
8308
8406
  btn: {
8309
8407
  normal: 'rgba(255, 255, 255, 0.15)',
@@ -8451,7 +8549,7 @@ function create$3(definition) {
8451
8549
  return cache[key];
8452
8550
  }
8453
8551
 
8454
- const NEBULA_VERSION_HASH = "d1ff" ;
8552
+ const NEBULA_VERSION_HASH = "ba42" ;
8455
8553
  ClassNameGenerator$1.configure(componentName => {
8456
8554
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
8457
8555
  });
@@ -8712,7 +8810,7 @@ function boot(_ref2) {
8712
8810
  const appRef = React__default.createRef();
8713
8811
  const element = document.createElement('div');
8714
8812
  element.style.display = 'none';
8715
- element.setAttribute('data-nebulajs-version', "4.5.0-alpha.0" );
8813
+ element.setAttribute('data-nebulajs-version', "4.6.0" );
8716
8814
  element.setAttribute('data-app-id', app.id);
8717
8815
  document.body.appendChild(element);
8718
8816
  if (context) {
@@ -8837,10 +8935,6 @@ function useSessionModel(definition, app) {
8837
8935
  const [modelStore] = useModelStore();
8838
8936
  const [rpcRequestSessionModelStore] = useRpcRequestSessionModelStore();
8839
8937
  const [model, setModel] = useState$1();
8840
- let rpcShared;
8841
- if (key) {
8842
- rpcShared = rpcRequestSessionModelStore.get(key);
8843
- }
8844
8938
  for (var _len = arguments.length, deps = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
8845
8939
  deps[_key - 2] = arguments[_key];
8846
8940
  }
@@ -8850,9 +8944,9 @@ function useSessionModel(definition, app) {
8850
8944
  }
8851
8945
  // Create new session object
8852
8946
  const create = async () => {
8947
+ let rpcShared = rpcRequestSessionModelStore.get(key);
8853
8948
  if (!rpcShared) {
8854
- const rpc = app.createSessionObject(definition);
8855
- rpcShared = rpc;
8949
+ rpcShared = app.createSessionObject(definition);
8856
8950
  rpcRequestSessionModelStore.set(key, rpcShared);
8857
8951
  }
8858
8952
  const newModel = await rpcShared;
@@ -9916,6 +10010,9 @@ const frequencyTextNone = '-';
9916
10010
  const barPadPx = 4;
9917
10011
  const barBorderWidthPx = 1;
9918
10012
  const barWithCheckboxLeftPadPx = 29;
10013
+ const GRID_ROW_HEIGHT = 32;
10014
+ const LIST_ROW_HEIGHT = 29;
10015
+ const DENSE_ROW_HEIGHT = 20; // same for both list and grid in dense mode
9919
10016
 
9920
10017
  const joinClassNames = namesArray => namesArray.filter(c => !!c).join(' ').trim();
9921
10018
  const getBarWidth = _ref => {
@@ -9962,17 +10059,30 @@ const getMaxFreqWidth = _ref2 => {
9962
10059
  };
9963
10060
  const getSelectedStyle = _ref3 => {
9964
10061
  let {
9965
- theme
10062
+ theme,
10063
+ styles,
10064
+ selectedState
9966
10065
  } = _ref3;
10066
+ const selectionStyles = styles.selections;
10067
+ const backgroundColor = selectionStyles[selectedState];
10068
+ const contrastTextColor = selectionStyles["".concat(selectedState, "Contrast")];
9967
10069
  return {
9968
- background: theme.palette.selected.main,
9969
- color: theme.palette.selected.mainContrastText,
10070
+ background: backgroundColor,
10071
+ color: contrastTextColor,
9970
10072
  '&:focus': {
9971
10073
  boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder),
9972
10074
  outline: 'none'
9973
10075
  },
9974
10076
  '& $cell': {
9975
10077
  paddingRight: 0
10078
+ },
10079
+ // Override default label text style for selection states
10080
+ // when contrasting text is needed.
10081
+ ["& .".concat(rowColClasses.labelText)]: {
10082
+ color: contrastTextColor
10083
+ },
10084
+ ["& .".concat(rowColClasses.icon)]: {
10085
+ color: contrastTextColor
9976
10086
  }
9977
10087
  };
9978
10088
  };
@@ -9985,9 +10095,8 @@ const ellipsis = {
9985
10095
  const iconWidth = 24; // tick and lock icon width in px
9986
10096
 
9987
10097
  const RowColRoot = styled$1('div', {
9988
- shouldForwardProp: prop => !['checkboxes', 'isGridMode', 'isGridCol', 'dense', 'direction', 'sizes', 'frequencyMode', 'freqHitsValue'].includes(prop)
10098
+ shouldForwardProp: prop => !['checkboxes', 'isGridMode', 'isGridCol', 'dense', 'direction', 'sizes', 'frequencyMode', 'freqHitsValue', 'layout', 'styles'].includes(prop)
9989
10099
  })(_ref4 => {
9990
- var _theme$listBox$conten, _theme$listBox, _theme$listBox$conten2, _theme$listBox2, _theme$listBox3, _theme$listBox4;
9991
10100
  let {
9992
10101
  theme,
9993
10102
  checkboxes,
@@ -9997,8 +10106,21 @@ const RowColRoot = styled$1('div', {
9997
10106
  direction,
9998
10107
  sizes,
9999
10108
  frequencyMode,
10000
- freqHitsValue
10109
+ freqHitsValue,
10110
+ styles
10001
10111
  } = _ref4;
10112
+ const rowFontColor = styles.content.color;
10113
+ const rowBackgroundColor = styles.content.backgroundColor;
10114
+ const selectStyle = getSelectedStyle({
10115
+ theme,
10116
+ styles,
10117
+ selectedState: 'selected'
10118
+ });
10119
+ const excludedSelectStyle = getSelectedStyle({
10120
+ theme,
10121
+ styles,
10122
+ selectedState: 'excluded'
10123
+ });
10002
10124
  return {
10003
10125
  '&:focus': {
10004
10126
  boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder, " !important")
@@ -10016,7 +10138,8 @@ const RowColRoot = styled$1('div', {
10016
10138
  },
10017
10139
  ["& .".concat(rowColClasses.row)]: {
10018
10140
  flexWrap: 'nowrap',
10019
- color: (_theme$listBox$conten = (_theme$listBox = theme.listBox) === null || _theme$listBox === void 0 || (_theme$listBox = _theme$listBox.content) === null || _theme$listBox === void 0 ? void 0 : _theme$listBox.color) !== null && _theme$listBox$conten !== void 0 ? _theme$listBox$conten : theme.palette.text.primary
10141
+ color: rowFontColor,
10142
+ backgroundColor: rowBackgroundColor
10020
10143
  },
10021
10144
  ["& .".concat(rowColClasses.rowBorderBottom)]: {
10022
10145
  borderBottom: isGridCol ? 'none' : "1px solid ".concat(theme.palette.divider),
@@ -10025,10 +10148,11 @@ const RowColRoot = styled$1('div', {
10025
10148
  ["& .".concat(rowColClasses.column)]: {
10026
10149
  flexWrap: 'nowrap',
10027
10150
  borderRight: "1px solid ".concat(theme.palette.divider),
10028
- color: (_theme$listBox$conten2 = (_theme$listBox2 = theme.listBox) === null || _theme$listBox2 === void 0 || (_theme$listBox2 = _theme$listBox2.content) === null || _theme$listBox2 === void 0 ? void 0 : _theme$listBox2.color) !== null && _theme$listBox$conten2 !== void 0 ? _theme$listBox$conten2 : theme.palette.text.primary
10151
+ color: rowFontColor
10029
10152
  },
10030
10153
  // The interior wrapper for all field content.
10031
10154
  ["& .".concat(rowColClasses.cell)]: {
10155
+ zIndex: 2,
10032
10156
  display: 'flex',
10033
10157
  alignItems: 'center',
10034
10158
  flexGrow: 1,
@@ -10045,8 +10169,9 @@ const RowColRoot = styled$1('div', {
10045
10169
  userSelect: 'none',
10046
10170
  paddingRight: '1px'
10047
10171
  }, ellipsis), {}, {
10048
- fontSize: (_theme$listBox3 = theme.listBox) === null || _theme$listBox3 === void 0 || (_theme$listBox3 = _theme$listBox3.content) === null || _theme$listBox3 === void 0 ? void 0 : _theme$listBox3.fontSize,
10049
- fontFamily: (_theme$listBox4 = theme.listBox) === null || _theme$listBox4 === void 0 || (_theme$listBox4 = _theme$listBox4.content) === null || _theme$listBox4 === void 0 ? void 0 : _theme$listBox4.fontFamily
10172
+ fontSize: styles.content.fontSize,
10173
+ fontFamily: styles.content.fontFamily,
10174
+ color: rowFontColor
10050
10175
  }),
10051
10176
  ["& .".concat(rowColClasses.labelDense)]: {
10052
10177
  fontSize: 12
@@ -10080,32 +10205,32 @@ const RowColRoot = styled$1('div', {
10080
10205
  justifyContent: 'center',
10081
10206
  width: iconWidth,
10082
10207
  minWidth: iconWidth,
10083
- maxWidth: iconWidth
10208
+ maxWidth: iconWidth,
10209
+ color: rowFontColor
10084
10210
  },
10085
- // Selection styles (S=Selected, XS=ExcludedSelected, A=Available, X=Excluded).
10086
- ["& .".concat(rowColClasses.S)]: _objectSpread2(_objectSpread2({}, getSelectedStyle({
10087
- theme
10088
- })), {}, {
10211
+ // Selection styles (S=Selected, XS=ExcludedSelected, A=Alternative, X=Excluded).
10212
+ ["& .".concat(rowColClasses.S)]: _objectSpread2(_objectSpread2({}, selectStyle), {}, {
10089
10213
  border: isGridMode ? 'none' : undefined
10090
10214
  }),
10091
10215
  ["& .".concat(rowColClasses.XS)]: _objectSpread2(_objectSpread2({}, getSelectedStyle({
10092
- theme
10216
+ theme,
10217
+ styles,
10218
+ selectedState: 'selectedExcluded'
10093
10219
  })), {}, {
10094
- background: theme.palette.selected.excluded,
10095
- color: theme.palette.selected.excludedContrastText,
10096
10220
  border: isGridMode ? 'none' : undefined
10097
10221
  }),
10098
- ["& .".concat(rowColClasses.A)]: {
10099
- background: theme.palette.selected.alternative,
10100
- color: theme.palette.selected.alternativeContrastText,
10222
+ ["& .".concat(rowColClasses.A)]: _objectSpread2(_objectSpread2({}, getSelectedStyle({
10223
+ theme,
10224
+ styles,
10225
+ selectedState: 'alternative'
10226
+ })), {}, {
10101
10227
  border: isGridMode ? 'none' : undefined
10102
- },
10103
- ["& .".concat(rowColClasses.X)]: {
10104
- background: theme.palette.selected.excluded,
10105
- color: theme.palette.selected.excludedContrastText,
10228
+ }),
10229
+ ["& .".concat(rowColClasses.X)]: _objectSpread2(_objectSpread2({}, excludedSelectStyle), {}, {
10106
10230
  border: isGridMode ? 'none' : undefined
10107
- },
10231
+ }),
10108
10232
  ["& .".concat(rowColClasses.frequencyCount)]: _objectSpread2(_objectSpread2({
10233
+ zIndex: 3,
10109
10234
  justifyContent: 'flex-end'
10110
10235
  }, ellipsis), {}, {
10111
10236
  flex: "0 0 ".concat(getFreqFlexBasis({
@@ -10133,7 +10258,7 @@ const RowColRoot = styled$1('div', {
10133
10258
  ["& .".concat(rowColClasses.bar)]: {
10134
10259
  height: dense ? '16px' : '20px',
10135
10260
  position: 'absolute',
10136
- zIndex: '-1',
10261
+ zIndex: 1,
10137
10262
  alignSelf: 'center',
10138
10263
  left: barPadPx,
10139
10264
  width: "calc(100% - ".concat(barPadPx * 2, "px)"),
@@ -10148,7 +10273,6 @@ const RowColRoot = styled$1('div', {
10148
10273
  }
10149
10274
  },
10150
10275
  ["& .".concat(rowColClasses.barSelected)]: {
10151
- zIndex: '0',
10152
10276
  '& .bar-filled': {
10153
10277
  opacity: '30%',
10154
10278
  background: theme.palette.background.lighter
@@ -10160,8 +10284,9 @@ const RowColRoot = styled$1('div', {
10160
10284
  },
10161
10285
  ["& .".concat(rowColClasses.barSelectedWithCheckbox)]: {
10162
10286
  '& .bar-filled': {
10163
- background: '#BFE5D0',
10164
- borderColor: '#BFE5D0'
10287
+ opacity: '30%',
10288
+ background: selectStyle.background || '#BFE5D0',
10289
+ borderColor: selectStyle.background || '#BFE5D0'
10165
10290
  }
10166
10291
  },
10167
10292
  ["& .".concat(rowColClasses.excludedTextWithCheckbox)]: {
@@ -10184,9 +10309,12 @@ const classes$b = {
10184
10309
  checkbox: "".concat(PREFIX$b, "-checkbox"),
10185
10310
  dense: "".concat(PREFIX$b, "-dense")
10186
10311
  };
10187
- const StyledCheckbox = styled$1(Checkbox)(_ref => {
10312
+ const StyledCheckbox = styled$1(Checkbox, {
10313
+ shouldForwardProp: p => p !== 'styles'
10314
+ })(_ref => {
10188
10315
  let {
10189
- theme
10316
+ theme,
10317
+ styles
10190
10318
  } = _ref;
10191
10319
  return {
10192
10320
  ["& .".concat(classes$b.cbIcon)]: {
@@ -10202,7 +10330,7 @@ const StyledCheckbox = styled$1(Checkbox)(_ref => {
10202
10330
  },
10203
10331
  ["& .".concat(classes$b.cbIconChecked)]: {
10204
10332
  borderRadius,
10205
- backgroundColor: theme.palette.selected.main,
10333
+ backgroundColor: styles.selections.selected,
10206
10334
  backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',
10207
10335
  '&:before': {
10208
10336
  display: 'block',
@@ -10251,6 +10379,7 @@ function ListboxCheckbox(_ref2) {
10251
10379
  label,
10252
10380
  dense,
10253
10381
  excluded,
10382
+ styles,
10254
10383
  showGray = true,
10255
10384
  dataN
10256
10385
  } = _ref2;
@@ -10268,7 +10397,8 @@ function ListboxCheckbox(_ref2) {
10268
10397
  icon: getIcon(classes$b, showGray, excluded),
10269
10398
  checkedIcon: /*#__PURE__*/React__default.createElement("span", {
10270
10399
  className: classes$b.cbIconChecked
10271
- })
10400
+ }),
10401
+ styles: styles
10272
10402
  });
10273
10403
  }
10274
10404
 
@@ -10320,7 +10450,6 @@ function ListBoxRadioButton(_ref2) {
10320
10450
  function ValueField(_ref) {
10321
10451
  let {
10322
10452
  label,
10323
- color,
10324
10453
  dense,
10325
10454
  showGray = true,
10326
10455
  checkboxes,
@@ -10334,7 +10463,6 @@ function ValueField(_ref) {
10334
10463
  cell,
10335
10464
  checkboxes
10336
10465
  }) && rowColClasses.excludedTextWithCheckbox]),
10337
- color: color,
10338
10466
  align: valueTextAlign,
10339
10467
  dir: "auto"
10340
10468
  }, /*#__PURE__*/React__default.createElement("span", null, label));
@@ -10368,7 +10496,6 @@ function CheckboxField(_ref) {
10368
10496
  let {
10369
10497
  onChange,
10370
10498
  label,
10371
- color,
10372
10499
  qElemNumber,
10373
10500
  isSelected,
10374
10501
  dense,
@@ -10377,7 +10504,8 @@ function CheckboxField(_ref) {
10377
10504
  showGray,
10378
10505
  isSingleSelect,
10379
10506
  checkboxes,
10380
- valueTextAlign
10507
+ valueTextAlign,
10508
+ styles
10381
10509
  } = _ref;
10382
10510
  const cb = /*#__PURE__*/React__default.createElement(ListboxCheckbox, {
10383
10511
  onChange: onChange,
@@ -10387,7 +10515,8 @@ function CheckboxField(_ref) {
10387
10515
  excluded: isExcluded(cell),
10388
10516
  isGridCol: isGridCol,
10389
10517
  showGray: showGray,
10390
- dataN: qElemNumber
10518
+ dataN: qElemNumber,
10519
+ styles: styles
10391
10520
  });
10392
10521
  const rb = /*#__PURE__*/React__default.createElement(ListBoxRadioButton, {
10393
10522
  onChange: onChange,
@@ -10397,12 +10526,10 @@ function CheckboxField(_ref) {
10397
10526
  dataN: qElemNumber
10398
10527
  });
10399
10528
  return /*#__PURE__*/React__default.createElement(FormControlLabel, {
10400
- color: color,
10401
10529
  control: isSingleSelect ? rb : cb,
10402
10530
  className: rowColClasses.checkboxLabel,
10403
10531
  label: /*#__PURE__*/React__default.createElement(LabelTag, {
10404
10532
  label: label,
10405
- color: color,
10406
10533
  dense: dense,
10407
10534
  showGray: showGray,
10408
10535
  checkboxes: checkboxes,
@@ -10441,13 +10568,13 @@ function FieldWithRanges(_ref3) {
10441
10568
  checkboxes,
10442
10569
  dense,
10443
10570
  showGray,
10444
- color,
10445
10571
  qElemNumber,
10446
10572
  isSelected,
10447
10573
  cell,
10448
10574
  isGridCol,
10449
10575
  isSingleSelect,
10450
- valueTextAlign
10576
+ valueTextAlign,
10577
+ styles
10451
10578
  } = _ref3;
10452
10579
  const LWR = /*#__PURE__*/React__default.createElement(LabelsWithRanges, {
10453
10580
  labels: labels,
@@ -10458,7 +10585,6 @@ function FieldWithRanges(_ref3) {
10458
10585
  return checkboxes ? /*#__PURE__*/React__default.createElement(CheckboxField, {
10459
10586
  onChange: onChange,
10460
10587
  label: LWR,
10461
- color: color,
10462
10588
  qElemNumber: qElemNumber,
10463
10589
  isSelected: isSelected,
10464
10590
  dense: dense,
@@ -10467,7 +10593,8 @@ function FieldWithRanges(_ref3) {
10467
10593
  showGray: showGray,
10468
10594
  isSingleSelect: isSingleSelect,
10469
10595
  checkboxes: checkboxes,
10470
- valueTextAlign: valueTextAlign
10596
+ valueTextAlign: valueTextAlign,
10597
+ styles: styles
10471
10598
  }) : LWR;
10472
10599
  }
10473
10600
 
@@ -10475,7 +10602,6 @@ function Field(_ref) {
10475
10602
  let {
10476
10603
  onChange,
10477
10604
  label,
10478
- color,
10479
10605
  qElemNumber,
10480
10606
  isSelected,
10481
10607
  dense,
@@ -10484,12 +10610,12 @@ function Field(_ref) {
10484
10610
  showGray,
10485
10611
  isSingleSelect,
10486
10612
  checkboxes,
10487
- valueTextAlign
10613
+ valueTextAlign,
10614
+ styles
10488
10615
  } = _ref;
10489
10616
  return checkboxes ? /*#__PURE__*/React__default.createElement(CheckboxField, {
10490
10617
  onChange: onChange,
10491
10618
  label: label,
10492
- color: color,
10493
10619
  qElemNumber: qElemNumber,
10494
10620
  isSelected: isSelected,
10495
10621
  dense: dense,
@@ -10498,10 +10624,10 @@ function Field(_ref) {
10498
10624
  showGray: showGray,
10499
10625
  isSingleSelect: isSingleSelect,
10500
10626
  checkboxes: checkboxes,
10501
- valueTextAlign: valueTextAlign
10627
+ valueTextAlign: valueTextAlign,
10628
+ styles: styles
10502
10629
  }) : /*#__PURE__*/React__default.createElement(ValueField, {
10503
10630
  label: label,
10504
- color: color,
10505
10631
  dense: dense,
10506
10632
  showGray: true,
10507
10633
  checkboxes: checkboxes,
@@ -10757,13 +10883,13 @@ const KEYS = Object.freeze({
10757
10883
  const getElementIndex = currentTarget => +currentTarget.getAttribute('data-n');
10758
10884
  const focusSearch = container => {
10759
10885
  const searchField = container === null || container === void 0 ? void 0 : container.querySelector('.search input');
10760
- searchField === null || searchField === void 0 ? void 0 : searchField.focus();
10886
+ searchField === null || searchField === void 0 || searchField.focus();
10761
10887
  return searchField;
10762
10888
  };
10763
10889
  const focusRow = container => {
10764
10890
  const row = container === null || container === void 0 ? void 0 : container.querySelector('.value.last-focused, .value.selector, .value');
10765
- row === null || row === void 0 ? void 0 : row.setAttribute('tabIndex', 0);
10766
- row === null || row === void 0 ? void 0 : row.focus();
10891
+ row === null || row === void 0 || row.setAttribute('tabIndex', 0);
10892
+ row === null || row === void 0 || row.focus();
10767
10893
  return row;
10768
10894
  };
10769
10895
 
@@ -10945,18 +11071,18 @@ function getRowsKeyboardNavigation(_ref) {
10945
11071
  case KEYS.HOME:
10946
11072
  focusListItems.setFirst(true);
10947
11073
  if (ctrlKey) {
10948
- setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('overflowStart');
11074
+ setScrollPosition === null || setScrollPosition === void 0 || setScrollPosition('overflowStart');
10949
11075
  break;
10950
11076
  }
10951
- setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('start');
11077
+ setScrollPosition === null || setScrollPosition === void 0 || setScrollPosition('start');
10952
11078
  break;
10953
11079
  case KEYS.END:
10954
11080
  focusListItems.setLast(true);
10955
11081
  if (ctrlKey) {
10956
- setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('overflowEnd');
11082
+ setScrollPosition === null || setScrollPosition === void 0 || setScrollPosition('overflowEnd');
10957
11083
  break;
10958
11084
  }
10959
- setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('end');
11085
+ setScrollPosition === null || setScrollPosition === void 0 || setScrollPosition('end');
10960
11086
  break;
10961
11087
  case KEYS.A:
10962
11088
  if (ctrlKey || metaKey) {
@@ -11051,7 +11177,9 @@ function RowColumn(_ref) {
11051
11177
  sizes,
11052
11178
  translator,
11053
11179
  showSearch,
11054
- isModal
11180
+ isModal,
11181
+ contentFontStyle,
11182
+ styles
11055
11183
  } = data;
11056
11184
  const {
11057
11185
  dense = false,
@@ -11062,7 +11190,7 @@ function RowColumn(_ref) {
11062
11190
  itemPadding
11063
11191
  } = sizes;
11064
11192
  let cellIndex;
11065
- let styles;
11193
+ let styleOverrides;
11066
11194
  const count = {
11067
11195
  max: null,
11068
11196
  currentIndex: null
@@ -11078,7 +11206,7 @@ function RowColumn(_ref) {
11078
11206
  count.currentIndex = columnIndex;
11079
11207
  }
11080
11208
  const padding = 0;
11081
- styles = _objectSpread2(_objectSpread2({}, style), {}, {
11209
+ styleOverrides = _objectSpread2(_objectSpread2({}, style), {}, {
11082
11210
  left: padding + (columnIndex === 0 ? style.left : Number(style.left) + columnIndex * padding),
11083
11211
  // right: columnIndex === columnCount ? style.right : Number(style.right) + columnIndex * padding,
11084
11212
  top: rowIndex === 0 ? style.top : Number(style.top) + rowIndex * padding
@@ -11087,7 +11215,7 @@ function RowColumn(_ref) {
11087
11215
  cellIndex = index;
11088
11216
  count.max = listCount;
11089
11217
  count.currentIndex = index;
11090
- styles = _objectSpread2({}, style);
11218
+ styleOverrides = _objectSpread2({}, style);
11091
11219
  }
11092
11220
  cellIndex += dataOffset;
11093
11221
  const [rowRef, setRowRef] = useState$1(null);
@@ -11177,7 +11305,8 @@ function RowColumn(_ref) {
11177
11305
  return /*#__PURE__*/React__default.createElement(RowColRoot$1, {
11178
11306
  className: rowColClasses.barContainer,
11179
11307
  checkboxes: checkboxes,
11180
- style: styles,
11308
+ style: styleOverrides,
11309
+ styles: styles,
11181
11310
  isGridCol: isGridCol,
11182
11311
  isGridMode: dataLayout === 'grid',
11183
11312
  dense: dense,
@@ -11185,6 +11314,7 @@ function RowColumn(_ref) {
11185
11314
  sizes: sizes,
11186
11315
  frequencyMode: deducedFrequencyMode,
11187
11316
  freqHitsValue: freqHitsValue,
11317
+ contentFontStyle: contentFontStyle,
11188
11318
  "data-testid": "listbox.item"
11189
11319
  }, /*#__PURE__*/React__default.createElement(ItemGrid, {
11190
11320
  role: "row",
@@ -11231,18 +11361,16 @@ function RowColumn(_ref) {
11231
11361
  checkboxes: checkboxes,
11232
11362
  dense: dense,
11233
11363
  showGray: showGray,
11234
- color: "inherit" // TODO: Check this
11235
- ,
11236
11364
  qElemNumber: cell.qElemNumber,
11237
11365
  isSelected: isSelected,
11238
11366
  cell: cell,
11239
11367
  isGridCol: isGridCol,
11240
11368
  isSingleSelect: isSingleSelect,
11241
- valueTextAlign: valueTextAlign
11369
+ valueTextAlign: valueTextAlign,
11370
+ styles: styles
11242
11371
  }) : /*#__PURE__*/React__default.createElement(Field$1, {
11243
11372
  onChange: onChange,
11244
11373
  label: label,
11245
- color: "inherit",
11246
11374
  qElemNumber: cell.qElemNumber,
11247
11375
  isSelected: isSelected,
11248
11376
  dense: dense,
@@ -11251,7 +11379,8 @@ function RowColumn(_ref) {
11251
11379
  showGray: showGray,
11252
11380
  isSingleSelect: isSingleSelect,
11253
11381
  checkboxes: checkboxes,
11254
- valueTextAlign: valueTextAlign
11382
+ valueTextAlign: valueTextAlign,
11383
+ styles: styles
11255
11384
  })), freqIsAllowed && /*#__PURE__*/React__default.createElement(Frequency, {
11256
11385
  cell: cell,
11257
11386
  checkboxes: checkboxes,
@@ -12831,7 +12960,8 @@ function getListBoxComponents(_ref) {
12831
12960
  freqIsAllowed,
12832
12961
  translator,
12833
12962
  showSearch,
12834
- isModal
12963
+ isModal,
12964
+ styles
12835
12965
  } = _ref;
12836
12966
  const {
12837
12967
  layoutOptions = {}
@@ -12885,7 +13015,8 @@ function getListBoxComponents(_ref) {
12885
13015
  direction,
12886
13016
  translator,
12887
13017
  showSearch,
12888
- isModal
13018
+ isModal,
13019
+ styles
12889
13020
  });
12890
13021
  const List = _ref2 => {
12891
13022
  let {
@@ -13016,6 +13147,7 @@ function calculateColumnMode(_ref) {
13016
13147
  } else {
13017
13148
  rowCount = Math.min(listCount, maxRows, autoRowCount);
13018
13149
  }
13150
+ rowCount = Math.max(rowCount, 1);
13019
13151
  const columnCount = Math.ceil(listCount / rowCount);
13020
13152
  const columnWidth = Math.max(columnAutoWidth, containerWidth / columnCount, itemMinWidth);
13021
13153
  return {
@@ -13042,6 +13174,7 @@ function calculateRowMode(_ref) {
13042
13174
  } else {
13043
13175
  columnCount = Math.min(listCount, maxColumns, autoColumnCount);
13044
13176
  }
13177
+ columnCount = Math.max(columnCount, 1);
13045
13178
  const columnWidth = innerWidth / columnCount;
13046
13179
  const rowCount = Math.ceil(listCount / columnCount);
13047
13180
  return {
@@ -13081,7 +13214,6 @@ function getMeasureText(layoutOrNumber) {
13081
13214
  }
13082
13215
 
13083
13216
  function useListSizes(_ref) {
13084
- var _theme$listBox;
13085
13217
  let {
13086
13218
  layout,
13087
13219
  width,
@@ -13090,7 +13222,7 @@ function useListSizes(_ref) {
13090
13222
  count,
13091
13223
  freqIsAllowed,
13092
13224
  checkboxes,
13093
- theme
13225
+ styles
13094
13226
  } = _ref;
13095
13227
  const {
13096
13228
  layoutOptions = {}
@@ -13105,7 +13237,7 @@ function useListSizes(_ref) {
13105
13237
  const {
13106
13238
  fontSize = '12px',
13107
13239
  fontFamily = 'Source sans pro'
13108
- } = (theme === null || theme === void 0 || (_theme$listBox = theme.listBox) === null || _theme$listBox === void 0 ? void 0 : _theme$listBox.content) || {};
13240
+ } = (styles === null || styles === void 0 ? void 0 : styles.content) || {};
13109
13241
  const font = "".concat(fontSize, " ").concat(fontFamily); // font format as supported by HTML canvas
13110
13242
  const textWidth = useTextWidth({
13111
13243
  text: getMeasureText(layout),
@@ -13137,9 +13269,8 @@ function useListSizes(_ref) {
13137
13269
  let rowCount;
13138
13270
  const isGridMode = dataLayout === 'grid';
13139
13271
  const itemPadding = 4;
13140
- const denseItemHeight = 20;
13141
- const normalItemHeight = isGridMode ? 32 : 29;
13142
- let itemHeight = dense ? denseItemHeight : normalItemHeight;
13272
+ const normalItemHeight = isGridMode ? GRID_ROW_HEIGHT : LIST_ROW_HEIGHT;
13273
+ let itemHeight = dense ? DENSE_ROW_HEIGHT : normalItemHeight;
13143
13274
  if (isGridMode) {
13144
13275
  // Emulate a margin between items using padding, since the list library
13145
13276
  // needs an explicit row height and cannot handle margins.
@@ -13777,7 +13908,6 @@ function ListBox(_ref) {
13777
13908
  model,
13778
13909
  app,
13779
13910
  constraints,
13780
- theme,
13781
13911
  layout,
13782
13912
  selections,
13783
13913
  selectionState,
@@ -13804,7 +13934,8 @@ function ListBox(_ref) {
13804
13934
  renderedCallback,
13805
13935
  onCtrlF,
13806
13936
  showSearch,
13807
- isModal
13937
+ isModal,
13938
+ styles
13808
13939
  } = _ref;
13809
13940
  const {
13810
13941
  translator: translatorDynamic
@@ -13867,7 +13998,7 @@ function ListBox(_ref) {
13867
13998
  const cardinal = layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo.qCardinal;
13868
13999
  if (itemsLoader !== null && itemsLoader !== void 0 && itemsLoader.pages.length && !awaitingFrequencyMax || cardinal === 0) {
13869
14000
  // All necessary data fetching done - signal rendering done!
13870
- renderedCallback === null || renderedCallback === void 0 ? void 0 : renderedCallback();
14001
+ renderedCallback === null || renderedCallback === void 0 || renderedCallback();
13871
14002
  }
13872
14003
  const isItemLoaded = useCallback(index => {
13873
14004
  if (!(pages !== null && pages !== void 0 && pages.length) || !local.current.validPages) {
@@ -13960,7 +14091,7 @@ function ListBox(_ref) {
13960
14091
  count,
13961
14092
  freqIsAllowed,
13962
14093
  checkboxes,
13963
- theme
14094
+ styles
13964
14095
  });
13965
14096
  if (sizes.columnWidth) {
13966
14097
  // In grid mode, where we have a dynamic item width, get a second opinion on showing/hiding frequency.
@@ -14075,7 +14206,8 @@ function ListBox(_ref) {
14075
14206
  freqIsAllowed,
14076
14207
  translator: translatorDynamic,
14077
14208
  showSearch,
14078
- isModal
14209
+ isModal,
14210
+ styles
14079
14211
  });
14080
14212
  const {
14081
14213
  columnWidth,
@@ -14451,7 +14583,7 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
14451
14583
  }), /*#__PURE__*/React__default.createElement(MenuList, {
14452
14584
  id: "moreMenuList"
14453
14585
  }, actions.map((item, ix) =>
14454
- /*#__PURE__*/
14586
+
14455
14587
  // eslint-disable-next-line react/no-array-index-key
14456
14588
  React__default.createElement(MoreItem, {
14457
14589
  key: ix,
@@ -14620,7 +14752,7 @@ function ActionsToolbar(_ref3) {
14620
14752
  actionsRefMock = null,
14621
14753
  // for testing
14622
14754
  direction = 'ltr',
14623
- autoConfirm
14755
+ autoConfirm = false
14624
14756
  } = _ref3;
14625
14757
  const defaultSelectionActions = useDefaultSelectionActions(selections);
14626
14758
  const {
@@ -14667,14 +14799,7 @@ function ActionsToolbar(_ref3) {
14667
14799
  focusHandler.on('focus_toolbar_last', focusLast);
14668
14800
  }, []);
14669
14801
  if (autoConfirm) {
14670
- const canConfirm = selections.show;
14671
- if (canConfirm) {
14672
- const confirm = defaultSelectionActions.find(o => o.key === 'confirm') || {
14673
- action: () => {}
14674
- };
14675
- confirm.action();
14676
- }
14677
- return null;
14802
+ return undefined;
14678
14803
  }
14679
14804
  let moreEnabled = more$1.enabled;
14680
14805
  let moreActions = more$1.actions;
@@ -14751,13 +14876,15 @@ function ActionsToolbar(_ref3) {
14751
14876
  transformOrigin: popoverTransformOrigin,
14752
14877
  hideBackdrop: true,
14753
14878
  style: popoverStyle,
14754
- PaperProps: {
14755
- id: 'njs-action-toolbar-popover',
14756
- 'data-testid': 'njs-action-toolbar-popover',
14757
- className: ActionToolbarElement.className,
14758
- style: {
14759
- pointerEvents: 'auto',
14760
- padding: theme.spacing(0.5, 0.25)
14879
+ slotProps: {
14880
+ paper: {
14881
+ id: 'njs-action-toolbar-popover',
14882
+ 'data-testid': 'njs-action-toolbar-popover',
14883
+ className: ActionToolbarElement.className,
14884
+ style: {
14885
+ pointerEvents: 'auto',
14886
+ padding: theme.spacing(0.5, 0.25)
14887
+ }
14761
14888
  }
14762
14889
  }
14763
14890
  }, Actions) : show && Actions;
@@ -14775,22 +14902,24 @@ var SearchIcon = (props => SvgIcon$2(search(props)));
14775
14902
 
14776
14903
  const TREE_PATH = '/qListObjectDef';
14777
14904
  const WILDCARD = '**';
14778
- const StyledInputAdornment = styled$1(InputAdornment)(_ref => {
14779
- var _theme$listBox;
14905
+ const StyledInputAdornment = styled$1(InputAdornment, {
14906
+ shouldForwardProp: p => p !== 'styles'
14907
+ })(_ref => {
14780
14908
  let {
14781
- theme
14909
+ styles
14782
14910
  } = _ref;
14783
14911
  return {
14784
- color: (_theme$listBox = theme.listBox) === null || _theme$listBox === void 0 || (_theme$listBox = _theme$listBox.content) === null || _theme$listBox === void 0 ? void 0 : _theme$listBox.color
14912
+ color: styles.content.color
14785
14913
  };
14786
14914
  });
14787
- const StyledOutlinedInput = styled$1(OutlinedInput)(_ref2 => {
14788
- var _theme$listBox2;
14915
+ const StyledOutlinedInput = styled$1(OutlinedInput, {
14916
+ shouldForwardProp: p => p !== 'styles'
14917
+ })(_ref2 => {
14789
14918
  let {
14790
- theme
14919
+ styles
14791
14920
  } = _ref2;
14792
14921
  return {
14793
- color: (_theme$listBox2 = theme.listBox) === null || _theme$listBox2 === void 0 || (_theme$listBox2 = _theme$listBox2.content) === null || _theme$listBox2 === void 0 ? void 0 : _theme$listBox2.color,
14922
+ color: styles.content.color,
14794
14923
  display: 'flex'
14795
14924
  };
14796
14925
  });
@@ -14806,7 +14935,8 @@ function ListBoxSearch(_ref3) {
14806
14935
  wildCardSearch = false,
14807
14936
  searchEnabled,
14808
14937
  direction,
14809
- hide
14938
+ hide,
14939
+ styles
14810
14940
  } = _ref3;
14811
14941
  const {
14812
14942
  translator
@@ -14888,7 +15018,7 @@ function ListBoxSearch(_ref3) {
14888
15018
  function focusRow(container) {
14889
15019
  const row = (container === null || container === void 0 ? void 0 : container.querySelector('.last-focused')) || (container === null || container === void 0 ? void 0 : container.querySelector('[role="row"]:first-child'));
14890
15020
  row.setAttribute('tabIndex', 0);
14891
- row === null || row === void 0 ? void 0 : row.focus();
15021
+ row === null || row === void 0 || row.focus();
14892
15022
  }
14893
15023
  const onKeyDown = async e => {
14894
15024
  const {
@@ -14914,7 +15044,7 @@ function ListBoxSearch(_ref3) {
14914
15044
  focusRow(container);
14915
15045
 
14916
15046
  // Clean up.
14917
- container === null || container === void 0 ? void 0 : container.querySelectorAll('.last-focused').forEach(elm => {
15047
+ container === null || container === void 0 || container.querySelectorAll('.last-focused').forEach(elm => {
14918
15048
  elm.classList.remove('last-focused');
14919
15049
  });
14920
15050
  }
@@ -14943,8 +15073,10 @@ function ListBoxSearch(_ref3) {
14943
15073
  return null;
14944
15074
  }
14945
15075
  return /*#__PURE__*/React__default.createElement(StyledOutlinedInput, {
15076
+ styles: styles,
14946
15077
  startAdornment: /*#__PURE__*/React__default.createElement(StyledInputAdornment, {
14947
- position: "start"
15078
+ position: "start",
15079
+ styles: styles
14948
15080
  }, /*#__PURE__*/React__default.createElement(SearchIcon, {
14949
15081
  size: dense ? 'small' : 'normal'
14950
15082
  })),
@@ -15223,12 +15355,12 @@ const getClickOutFuncs = _ref3 => {
15223
15355
  activateClickOut() {
15224
15356
  var _options$onSelectionA;
15225
15357
  document.addEventListener('mousedown', handler);
15226
- options === null || options === void 0 || (_options$onSelectionA = options.onSelectionActivated) === null || _options$onSelectionA === void 0 ? void 0 : _options$onSelectionA.call(options);
15358
+ options === null || options === void 0 || (_options$onSelectionA = options.onSelectionActivated) === null || _options$onSelectionA === void 0 || _options$onSelectionA.call(options);
15227
15359
  },
15228
15360
  deactivateClickOut() {
15229
15361
  var _options$onSelectionD;
15230
15362
  document.removeEventListener('mousedown', handler);
15231
- options === null || options === void 0 || (_options$onSelectionD = options.onSelectionDeactivated) === null || _options$onSelectionD === void 0 ? void 0 : _options$onSelectionD.call(options);
15363
+ options === null || options === void 0 || (_options$onSelectionD = options.onSelectionDeactivated) === null || _options$onSelectionD === void 0 || _options$onSelectionD.call(options);
15232
15364
  }
15233
15365
  };
15234
15366
  };
@@ -15353,7 +15485,7 @@ function selectionState() {
15353
15485
  if (selected && !additive) {
15354
15486
  state.itemStates[elementNumber] = false;
15355
15487
  } else if (!selected) {
15356
- selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.push(elementNumber);
15488
+ selectedValues === null || selectedValues === void 0 || selectedValues.push(elementNumber);
15357
15489
  state.itemStates[elementNumber] = true;
15358
15490
  }
15359
15491
  },
@@ -15407,6 +15539,104 @@ function hasSelections(layout) {
15407
15539
  return totalCounts > 0;
15408
15540
  }
15409
15541
 
15542
+ const LIGHT = '#FFF';
15543
+ const DARK = '#000';
15544
+ function getContrastingColor(backgroundColor) {
15545
+ let desiredTextColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
15546
+ let dark = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DARK;
15547
+ let light = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : LIGHT;
15548
+ const CONTRAST_THRESHOLD = 3.0;
15549
+ let contrastingColor;
15550
+ if (desiredTextColor && getContrastRatio(desiredTextColor, backgroundColor) > CONTRAST_THRESHOLD) {
15551
+ contrastingColor = desiredTextColor;
15552
+ } else {
15553
+ contrastingColor = getContrastRatio(light, backgroundColor) > CONTRAST_THRESHOLD ? light : dark;
15554
+ }
15555
+ return contrastingColor;
15556
+ }
15557
+ const SUPPORTED_COMPONENTS = ['theme', 'selections'];
15558
+ function getOverridesAsObject() {
15559
+ let components = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
15560
+ // Currently supporting components "theme" and "selections".
15561
+ const overrides = {};
15562
+ components.forEach(c => {
15563
+ const k = c === null || c === void 0 ? void 0 : c.key;
15564
+ if (SUPPORTED_COMPONENTS.includes(k)) {
15565
+ overrides[k] = c;
15566
+ }
15567
+ });
15568
+ return overrides;
15569
+ }
15570
+ function getSelectionColors(theme, getListboxStyle, overrides) {
15571
+ var _overrides$theme, _theme$palette, _overrides$theme$cont, _overrides$theme2, _overrides$selections, _selectionColors$sele, _theme$palette2, _selectionColors$alte, _theme$palette3, _selectionColors$excl, _theme$palette4, _selectionColors$sele2, _theme$palette5, _selectionColors$poss, _theme$palette6, _theme$palette7, _theme$palette8, _theme$palette9, _theme$palette10, _theme$palette11;
15572
+ const desiredTextColor = ((_overrides$theme = overrides.theme) === null || _overrides$theme === void 0 || (_overrides$theme = _overrides$theme.content) === null || _overrides$theme === void 0 || (_overrides$theme = _overrides$theme.fontColor) === null || _overrides$theme === void 0 ? void 0 : _overrides$theme.color) || getListboxStyle('content', 'color') || ((_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.text.primary);
15573
+ const useContrastTextColor = (_overrides$theme$cont = (_overrides$theme2 = overrides.theme) === null || _overrides$theme2 === void 0 || (_overrides$theme2 = _overrides$theme2.content) === null || _overrides$theme2 === void 0 ? void 0 : _overrides$theme2.useContrastColor) !== null && _overrides$theme$cont !== void 0 ? _overrides$theme$cont : true;
15574
+
15575
+ // Background colors
15576
+ const selectionColors = ((_overrides$selections = overrides.selections) === null || _overrides$selections === void 0 ? void 0 : _overrides$selections.colors) || {};
15577
+ const selected = ((_selectionColors$sele = selectionColors.selected) === null || _selectionColors$sele === void 0 ? void 0 : _selectionColors$sele.color) || ((_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.selected.main) || '#009845';
15578
+ const alternative = ((_selectionColors$alte = selectionColors.alternative) === null || _selectionColors$alte === void 0 ? void 0 : _selectionColors$alte.color) || ((_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.selected.alternative) || '#E4E4E4';
15579
+ const excluded = ((_selectionColors$excl = selectionColors.excluded) === null || _selectionColors$excl === void 0 ? void 0 : _selectionColors$excl.color) || ((_theme$palette4 = theme.palette) === null || _theme$palette4 === void 0 ? void 0 : _theme$palette4.selected.excluded) || '#A9A9A9';
15580
+ const selectedExcluded = ((_selectionColors$sele2 = selectionColors.selectedExcluded) === null || _selectionColors$sele2 === void 0 ? void 0 : _selectionColors$sele2.color) || ((_theme$palette5 = theme.palette) === null || _theme$palette5 === void 0 ? void 0 : _theme$palette5.selected.selectedExcluded) || '#A9A9A9';
15581
+ const possible = ((_selectionColors$poss = selectionColors.possible) === null || _selectionColors$poss === void 0 ? void 0 : _selectionColors$poss.color) || getListboxStyle('', 'backgroundColor') || ((_theme$palette6 = theme.palette) === null || _theme$palette6 === void 0 ? void 0 : _theme$palette6.selected.possible) || '#FFFFFF';
15582
+
15583
+ // Font colors
15584
+ let selectedContrast = desiredTextColor || ((_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.selected.main);
15585
+ let alternativeContrast = desiredTextColor || ((_theme$palette8 = theme.palette) === null || _theme$palette8 === void 0 ? void 0 : _theme$palette8.selected.alternativeContrastText);
15586
+ let excludedContrast = desiredTextColor || ((_theme$palette9 = theme.palette) === null || _theme$palette9 === void 0 ? void 0 : _theme$palette9.selected.excludedContrastText);
15587
+ let selectedExcludedContrast = desiredTextColor || ((_theme$palette10 = theme.palette) === null || _theme$palette10 === void 0 ? void 0 : _theme$palette10.selected.selectedExcludedContrastText);
15588
+ let possibleContrast = desiredTextColor || ((_theme$palette11 = theme.palette) === null || _theme$palette11 === void 0 ? void 0 : _theme$palette11.selected.possibleContrastText);
15589
+ if (useContrastTextColor) {
15590
+ // Override preferred text color if it does not contrast enough with the background color.
15591
+ selectedContrast = getContrastingColor(selected, desiredTextColor);
15592
+ alternativeContrast = getContrastingColor(alternative, desiredTextColor);
15593
+ excludedContrast = getContrastingColor(excluded, desiredTextColor);
15594
+ selectedExcludedContrast = getContrastingColor(selectedExcluded, desiredTextColor);
15595
+ possibleContrast = getContrastingColor(possible, desiredTextColor);
15596
+ }
15597
+ return {
15598
+ selected,
15599
+ alternative,
15600
+ excluded,
15601
+ selectedExcluded,
15602
+ possible,
15603
+ selectedContrast,
15604
+ alternativeContrast,
15605
+ excludedContrast,
15606
+ selectedExcludedContrast,
15607
+ possibleContrast
15608
+ };
15609
+ }
15610
+ function getStyles(_ref) {
15611
+ var _themeOverrides$heade, _themeOverrides$heade2, _themeOverrides$conte;
15612
+ let {
15613
+ themeApi,
15614
+ theme,
15615
+ components = [],
15616
+ checkboxes = false
15617
+ } = _ref;
15618
+ const overrides = getOverridesAsObject(components);
15619
+ const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
15620
+ const selections = getSelectionColors(theme, getListboxStyle, overrides);
15621
+ const themeOverrides = overrides.theme || {};
15622
+ return {
15623
+ backgroundColor: getListboxStyle('', 'backgroundColor') || theme.palette.background.default,
15624
+ header: {
15625
+ color: ((_themeOverrides$heade = themeOverrides.header) === null || _themeOverrides$heade === void 0 || (_themeOverrides$heade = _themeOverrides$heade.fontColor) === null || _themeOverrides$heade === void 0 ? void 0 : _themeOverrides$heade.color) || getListboxStyle('title.main', 'color'),
15626
+ fontSize: ((_themeOverrides$heade2 = themeOverrides.header) === null || _themeOverrides$heade2 === void 0 ? void 0 : _themeOverrides$heade2.fontSize) || getListboxStyle('title.main', 'fontSize'),
15627
+ fontFamily: getListboxStyle('title.main', 'fontFamily'),
15628
+ fontWeight: getListboxStyle('title.main', 'fontWeight') || 'bold'
15629
+ },
15630
+ content: {
15631
+ backgroundColor: checkboxes ? undefined : selections.possible,
15632
+ color: selections.possibleContrast || getListboxStyle('content', 'color'),
15633
+ fontSize: ((_themeOverrides$conte = themeOverrides.content) === null || _themeOverrides$conte === void 0 ? void 0 : _themeOverrides$conte.fontSize) || getListboxStyle('content', 'fontSize'),
15634
+ fontFamily: getListboxStyle('content', 'fontFamily')
15635
+ },
15636
+ selections
15637
+ };
15638
+ }
15639
+
15410
15640
  function ListBoxPopover(_ref) {
15411
15641
  let {
15412
15642
  alignTo,
@@ -15423,7 +15653,9 @@ function ListBoxPopover(_ref) {
15423
15653
  app,
15424
15654
  fieldName,
15425
15655
  stateName = '$',
15426
- autoFocus
15656
+ autoFocus,
15657
+ components,
15658
+ checkboxes: checkboxesOption
15427
15659
  } = _ref;
15428
15660
  const isMasterDim = Boolean(fieldName === null || fieldName === void 0 ? void 0 : fieldName.qLibraryId);
15429
15661
  const open = show && Boolean(alignTo.current);
@@ -15462,13 +15694,23 @@ function ListBoxPopover(_ref) {
15462
15694
  model.unlock('/qListObjectDef');
15463
15695
  }, [model]);
15464
15696
  const {
15465
- translator
15697
+ translator,
15698
+ themeApi
15466
15699
  } = useContext(InstanceContext);
15467
15700
  const moreAlignTo = useRef();
15468
15701
  const containerRef = useRef();
15469
15702
  const [selections] = useObjectSelections(app, model, containerRef);
15470
15703
  const [layout] = useLayout$1(model);
15471
15704
  const [selectionState$1] = useState$1(() => selectionState());
15705
+ const {
15706
+ checkboxes = checkboxesOption
15707
+ } = layout || {};
15708
+ const styles = getStyles({
15709
+ themeApi,
15710
+ theme,
15711
+ components,
15712
+ checkboxes
15713
+ });
15472
15714
  useEffect$1(() => {
15473
15715
  if (selections && open) {
15474
15716
  if (!selections.isModal(model)) {
@@ -15493,7 +15735,7 @@ function ListBoxPopover(_ref) {
15493
15735
  });
15494
15736
  const onCtrlF = () => {
15495
15737
  const input = searchContainerRef.current.querySelector('input');
15496
- input === null || input === void 0 ? void 0 : input.focus();
15738
+ input === null || input === void 0 || input.focus();
15497
15739
  };
15498
15740
  const hasSelections$1 = hasSelections(layout);
15499
15741
  return /*#__PURE__*/React__default.createElement(Popover, {
@@ -15565,6 +15807,7 @@ function ListBoxPopover(_ref) {
15565
15807
  item: true,
15566
15808
  ref: searchContainerRef
15567
15809
  }, /*#__PURE__*/React__default.createElement(ListBoxSearch, {
15810
+ styles: styles,
15568
15811
  visible: true,
15569
15812
  model: model,
15570
15813
  listCount: listCount,
@@ -15583,7 +15826,7 @@ function ListBoxPopover(_ref) {
15583
15826
  direction: "ltr",
15584
15827
  onSetListCount: c => setListCount(c),
15585
15828
  onCtrlF: onCtrlF,
15586
- theme: theme
15829
+ styles: styles
15587
15830
  }))));
15588
15831
  }
15589
15832
 
@@ -15867,7 +16110,7 @@ function MultiState(_ref2) {
15867
16110
  variant: "contained",
15868
16111
  fullWidth: true
15869
16112
  }, clearAllStates)), field.states.map((s, ix) =>
15870
- /*#__PURE__*/
16113
+
15871
16114
  // eslint-disable-next-line react/no-array-index-key
15872
16115
  React__default.createElement(ListItem, {
15873
16116
  key: ix,
@@ -16045,7 +16288,7 @@ function More(_ref2) {
16045
16288
  }, /*#__PURE__*/React__default.createElement(List, {
16046
16289
  dense: true
16047
16290
  }, items.map((s, ix) =>
16048
- /*#__PURE__*/
16291
+
16049
16292
  // eslint-disable-next-line react/no-array-index-key
16050
16293
  React__default.createElement(ListItem, {
16051
16294
  key: ix,
@@ -16746,12 +16989,12 @@ const drillDown = props => _objectSpread2(_objectSpread2({}, props), {}, {
16746
16989
  var DrillDownIcon = (props => SvgIcon$2(drillDown(props)));
16747
16990
 
16748
16991
  function removeInnnerTabStops(container) {
16749
- container === null || container === void 0 ? void 0 : container.querySelectorAll('[tabIndex="0"]').forEach(elm => {
16992
+ container === null || container === void 0 || container.querySelectorAll('[tabIndex="0"]').forEach(elm => {
16750
16993
  elm.setAttribute('tabIndex', -1);
16751
16994
  });
16752
16995
  }
16753
16996
  function removeLastFocused(container) {
16754
- container === null || container === void 0 ? void 0 : container.querySelectorAll('.last-focused').forEach(elm => {
16997
+ container === null || container === void 0 || container.querySelectorAll('.last-focused').forEach(elm => {
16755
16998
  elm.classList.remove('last-focused');
16756
16999
  });
16757
17000
  }
@@ -16799,13 +17042,13 @@ function useTempKeyboard(_ref) {
16799
17042
  const firstRowElement = c === null || c === void 0 ? void 0 : c.querySelector('.value.selector, .value');
16800
17043
  const confirmButton = c === null || c === void 0 ? void 0 : c.querySelector('.actions-toolbar-default-actions .actions-toolbar-confirm');
16801
17044
  const elementToFocus = searchField || lastSelectedRow || firstRowElement || confirmButton;
16802
- elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.setAttribute('tabIndex', 0);
16803
- elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
17045
+ elementToFocus === null || elementToFocus === void 0 || elementToFocus.setAttribute('tabIndex', 0);
17046
+ elementToFocus === null || elementToFocus === void 0 || elementToFocus.focus();
16804
17047
  },
16805
17048
  focusSelection() {
16806
17049
  const confirmButton = document.querySelector('.actions-toolbar-default-actions .actions-toolbar-confirm');
16807
- confirmButton === null || confirmButton === void 0 ? void 0 : confirmButton.setAttribute('tabIndex', 0);
16808
- confirmButton === null || confirmButton === void 0 ? void 0 : confirmButton.focus();
17050
+ confirmButton === null || confirmButton === void 0 || confirmButton.setAttribute('tabIndex', 0);
17051
+ confirmButton === null || confirmButton === void 0 || confirmButton.focus();
16809
17052
  }
16810
17053
  };
16811
17054
  return keyboard;
@@ -16847,7 +17090,7 @@ function getListboxContainerKeyboardNavigation(_ref) {
16847
17090
  keyboard.blur();
16848
17091
  const c = currentTarget.closest('.listbox-container');
16849
17092
  c.setAttribute('tabIndex', -1);
16850
- c === null || c === void 0 ? void 0 : c.focus();
17093
+ c === null || c === void 0 || c.focus();
16851
17094
  }
16852
17095
  };
16853
17096
  const handleKeyDown = event => {
@@ -16962,26 +17205,6 @@ function getListboxContainerKeyboardNavigation(_ref) {
16962
17205
  };
16963
17206
  }
16964
17207
 
16965
- const addListboxTheme = themeApi => {
16966
- const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
16967
- return {
16968
- backgroundColor: getListboxStyle('', 'backgroundColor'),
16969
- title: {
16970
- main: {
16971
- color: getListboxStyle('title.main', 'color'),
16972
- fontSize: getListboxStyle('title.main', 'fontSize'),
16973
- fontFamily: getListboxStyle('title.main', 'fontFamily'),
16974
- fontWeight: getListboxStyle('title.main', 'fontWeight')
16975
- }
16976
- },
16977
- content: {
16978
- color: getListboxStyle('content', 'color'),
16979
- fontSize: getListboxStyle('content', 'fontSize'),
16980
- fontFamily: getListboxStyle('content', 'fontFamily')
16981
- }
16982
- };
16983
- };
16984
-
16985
17208
  function showToolbarDetached(_ref) {
16986
17209
  var _titleRef$current$cli, _titleRef$current, _titleRef$current2, _titleRef$current3;
16987
17210
  let {
@@ -17010,11 +17233,9 @@ function getListboxActionProps(_ref) {
17010
17233
  isLocked,
17011
17234
  listboxSelectionToolbarItems,
17012
17235
  selections,
17013
- keyboard,
17014
- autoConfirm
17236
+ keyboard
17015
17237
  } = _ref;
17016
17238
  return {
17017
- autoConfirm,
17018
17239
  show: showToolbar && !isDetached,
17019
17240
  popover: {
17020
17241
  show: showToolbar && isDetached,
@@ -17035,10 +17256,10 @@ function getListboxActionProps(_ref) {
17035
17256
  show: showToolbar,
17036
17257
  api: selections,
17037
17258
  onConfirm: () => {
17038
- keyboard === null || keyboard === void 0 ? void 0 : keyboard.focus();
17259
+ keyboard === null || keyboard === void 0 || keyboard.focus();
17039
17260
  },
17040
17261
  onCancel: () => {
17041
- keyboard === null || keyboard === void 0 ? void 0 : keyboard.focus();
17262
+ keyboard === null || keyboard === void 0 || keyboard.focus();
17042
17263
  }
17043
17264
  }
17044
17265
  };
@@ -17076,16 +17297,16 @@ const classes$4 = {
17076
17297
  listboxWrapper: "".concat(PREFIX$4, "-listboxWrapper")
17077
17298
  };
17078
17299
  const StyledGrid$3 = styled$1(Grid, {
17079
- shouldForwardProp: p => !['containerPadding', 'isGridMode'].includes(p)
17300
+ shouldForwardProp: p => !['containerPadding', 'isGridMode', 'styles'].includes(p)
17080
17301
  })(_ref => {
17081
- var _theme$listBox$backgr, _theme$listBox;
17082
17302
  let {
17083
17303
  theme,
17084
17304
  containerPadding,
17085
- isGridMode
17305
+ isGridMode,
17306
+ styles
17086
17307
  } = _ref;
17087
17308
  return {
17088
- backgroundColor: (_theme$listBox$backgr = (_theme$listBox = theme.listBox) === null || _theme$listBox === void 0 ? void 0 : _theme$listBox.backgroundColor) !== null && _theme$listBox$backgr !== void 0 ? _theme$listBox$backgr : theme.palette.background.default,
17309
+ background: styles.backgroundColor,
17089
17310
  ["& .".concat(classes$4.listBoxHeader)]: {
17090
17311
  alignSelf: 'center',
17091
17312
  display: 'flex'
@@ -17111,15 +17332,14 @@ const StyledGrid$3 = styled$1(Grid, {
17111
17332
  };
17112
17333
  });
17113
17334
  const Title = styled$1(Typography)(_ref2 => {
17114
- var _theme$listBox2, _theme$listBox3, _theme$listBox4, _theme$listBox5;
17115
17335
  let {
17116
- theme
17336
+ styles
17117
17337
  } = _ref2;
17118
17338
  return {
17119
- color: (_theme$listBox2 = theme.listBox) === null || _theme$listBox2 === void 0 || (_theme$listBox2 = _theme$listBox2.title) === null || _theme$listBox2 === void 0 || (_theme$listBox2 = _theme$listBox2.main) === null || _theme$listBox2 === void 0 ? void 0 : _theme$listBox2.color,
17120
- fontSize: (_theme$listBox3 = theme.listBox) === null || _theme$listBox3 === void 0 || (_theme$listBox3 = _theme$listBox3.title) === null || _theme$listBox3 === void 0 || (_theme$listBox3 = _theme$listBox3.main) === null || _theme$listBox3 === void 0 ? void 0 : _theme$listBox3.fontSize,
17121
- fontFamily: (_theme$listBox4 = theme.listBox) === null || _theme$listBox4 === void 0 || (_theme$listBox4 = _theme$listBox4.title) === null || _theme$listBox4 === void 0 || (_theme$listBox4 = _theme$listBox4.main) === null || _theme$listBox4 === void 0 ? void 0 : _theme$listBox4.fontFamily,
17122
- fontWeight: ((_theme$listBox5 = theme.listBox) === null || _theme$listBox5 === void 0 || (_theme$listBox5 = _theme$listBox5.title) === null || _theme$listBox5 === void 0 || (_theme$listBox5 = _theme$listBox5.main) === null || _theme$listBox5 === void 0 ? void 0 : _theme$listBox5.fontWeight) || 'bold'
17339
+ color: styles.header.color,
17340
+ fontSize: styles.header.fontSize,
17341
+ fontFamily: styles.header.fontFamily,
17342
+ fontWeight: styles.header.fontWeight
17123
17343
  };
17124
17344
  });
17125
17345
  const isModal = _ref3 => {
@@ -17140,7 +17360,7 @@ function ListBoxInline(_ref4) {
17140
17360
  app,
17141
17361
  direction,
17142
17362
  frequencyMode,
17143
- checkboxes,
17363
+ checkboxes: checkboxesOption,
17144
17364
  search = true,
17145
17365
  focusSearch = false,
17146
17366
  rangeSelect = true,
@@ -17155,7 +17375,8 @@ function ListBoxInline(_ref4) {
17155
17375
  scrollState = undefined,
17156
17376
  renderedCallback,
17157
17377
  toolbar = true,
17158
- isPopover = false
17378
+ isPopover = false,
17379
+ components
17159
17380
  } = options;
17160
17381
 
17161
17382
  // Hook that will trigger update when used in useEffects.
@@ -17179,7 +17400,15 @@ function ListBoxInline(_ref4) {
17179
17400
  themeApi,
17180
17401
  constraints
17181
17402
  } = useContext(InstanceContext);
17182
- theme.listBox = addListboxTheme(themeApi);
17403
+ const {
17404
+ checkboxes = checkboxesOption
17405
+ } = layout || {};
17406
+ const styles = getStyles({
17407
+ themeApi,
17408
+ theme,
17409
+ components,
17410
+ checkboxes
17411
+ });
17183
17412
  const isDirectQuery = isDirectQueryEnabled({
17184
17413
  appLayout: app === null || app === void 0 ? void 0 : app.layout
17185
17414
  });
@@ -17320,10 +17549,6 @@ function ListBoxInline(_ref4) {
17320
17549
  const showSearchToggle = search === 'toggle' && showSearch;
17321
17550
  const searchVisible = (search === true || showSearchToggle) && !selectDisabled() && searchEnabled !== false;
17322
17551
  const dense = (_layoutOptions$dense = layoutOptions.dense) !== null && _layoutOptions$dense !== void 0 ? _layoutOptions$dense : false;
17323
- const searchHeight = dense ? 27 : 40;
17324
- const extraheight = dense ? 39 : 49;
17325
- const searchAddHeight = searchVisible ? searchHeight : 0;
17326
- const minHeight = showToolbarWithTitle ? 49 + searchAddHeight + extraheight : 0;
17327
17552
  const headerHeight = 32;
17328
17553
  const onShowSearch = () => {
17329
17554
  const newValue = !showSearch;
@@ -17334,17 +17559,18 @@ function ListBoxInline(_ref4) {
17334
17559
  onShowSearch();
17335
17560
  } else {
17336
17561
  const input = searchContainer.current.querySelector('input');
17337
- input === null || input === void 0 ? void 0 : input.focus();
17562
+ input === null || input === void 0 || input.focus();
17338
17563
  }
17339
17564
  };
17340
- const getActionToolbarProps = isDetached => getListboxActionProps({
17565
+ const getActionToolbarProps = isDetached => _objectSpread2(_objectSpread2({}, getListboxActionProps({
17341
17566
  isDetached: isPopover ? false : isDetached,
17342
17567
  showToolbar,
17343
17568
  containerRef,
17344
17569
  isLocked,
17345
17570
  listboxSelectionToolbarItems,
17346
17571
  selections,
17347
- keyboard,
17572
+ keyboard
17573
+ })), {}, {
17348
17574
  autoConfirm
17349
17575
  });
17350
17576
  const shouldAutoFocus = searchVisible && search === 'toggle';
@@ -17392,7 +17618,7 @@ function ListBoxInline(_ref4) {
17392
17618
  }
17393
17619
  }));
17394
17620
  if (isInvalid) {
17395
- renderedCallback === null || renderedCallback === void 0 ? void 0 : renderedCallback();
17621
+ renderedCallback === null || renderedCallback === void 0 || renderedCallback();
17396
17622
  }
17397
17623
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showDetachedToolbarOnly && /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$5({
17398
17624
  direction: direction
@@ -17403,9 +17629,9 @@ function ListBoxInline(_ref4) {
17403
17629
  direction: "column",
17404
17630
  gap: 0,
17405
17631
  containerPadding: containerPadding,
17632
+ styles: styles,
17406
17633
  style: {
17407
17634
  height: '100%',
17408
- minHeight: "".concat(minHeight, "px"),
17409
17635
  flexFlow: 'column nowrap'
17410
17636
  },
17411
17637
  onKeyDown: handleKeyDown,
@@ -17449,7 +17675,8 @@ function ListBoxInline(_ref4) {
17449
17675
  variant: "h6",
17450
17676
  noWrap: true,
17451
17677
  ref: titleRef,
17452
- title: layout.title
17678
+ title: layout.title,
17679
+ styles: styles
17453
17680
  }, layout.title)), /*#__PURE__*/React__default.createElement(Grid, {
17454
17681
  item: true
17455
17682
  }, /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$5({
@@ -17460,7 +17687,7 @@ function ListBoxInline(_ref4) {
17460
17687
  direction: "column",
17461
17688
  style: {
17462
17689
  height: '100%',
17463
- minHeight: '50px'
17690
+ minHeight: DENSE_ROW_HEIGHT + SCROLL_BAR_WIDTH
17464
17691
  },
17465
17692
  role: "region",
17466
17693
  "aria-label": translator.get('Listbox.ResultFilterLabel')
@@ -17479,7 +17706,8 @@ function ListBoxInline(_ref4) {
17479
17706
  wildCardSearch: wildCardSearch,
17480
17707
  searchEnabled: searchEnabled,
17481
17708
  direction: direction,
17482
- hide: showSearchIcon && onShowSearch
17709
+ hide: showSearchIcon && onShowSearch,
17710
+ styles: styles
17483
17711
  })), /*#__PURE__*/React__default.createElement(Grid, {
17484
17712
  item: true,
17485
17713
  xs: true,
@@ -17494,7 +17722,6 @@ function ListBoxInline(_ref4) {
17494
17722
  return /*#__PURE__*/React__default.createElement(ListBox, {
17495
17723
  model: model,
17496
17724
  app: app,
17497
- theme: theme,
17498
17725
  constraints: constraints,
17499
17726
  layout: layout,
17500
17727
  selections: selections,
@@ -17527,7 +17754,8 @@ function ListBoxInline(_ref4) {
17527
17754
  },
17528
17755
  renderedCallback: renderedCallback,
17529
17756
  onCtrlF: onCtrlF,
17530
- isModal: isModalMode
17757
+ isModal: isModalMode,
17758
+ styles: styles
17531
17759
  });
17532
17760
  })))));
17533
17761
  }
@@ -17675,7 +17903,7 @@ const listdef = {
17675
17903
  */
17676
17904
  wildCardSearch: false,
17677
17905
  /**
17678
- * Automatically confirm selections without showing the selections toolbar.
17906
+ * Automatically confirm selections when clicking outside a listbox, without showing the selections toolbar.
17679
17907
  * @type {boolean=}
17680
17908
  * @default
17681
17909
  */
@@ -18084,7 +18312,8 @@ function ListBoxPopoverWrapper(_ref) {
18084
18312
  close: handleCloseShowState,
18085
18313
  fieldName: fieldIdentifier,
18086
18314
  stateName: stateName,
18087
- autoFocus: options.autoFocus
18315
+ autoFocus: options.autoFocus,
18316
+ components: options.components
18088
18317
  });
18089
18318
  }
18090
18319
 
@@ -25989,6 +26218,37 @@ const DEFAULT_SNAPSHOT_CONFIG = /** @lends SnapshotConfiguration */{
25989
26218
  }
25990
26219
  };
25991
26220
 
26221
+ /**
26222
+ * @interface Component
26223
+ * @property {string} key The key of the component. Currently supporting components "theme" and "selections".
26224
+ * @example
26225
+ * const n = embed(app);
26226
+ * const inst = await n.field('field_name');
26227
+ * inst.mount(document.querySelector('.listbox'), {
26228
+ * components: [{
26229
+ * key: 'theme',
26230
+ * header: {
26231
+ * fontColor: { color: '#f00' },
26232
+ * fontSize: 23,
26233
+ * },
26234
+ * content: {
26235
+ * fontSize: 16,
26236
+ * useContrastColor: false,
26237
+ * }
26238
+ * },{
26239
+ * key: 'selections',
26240
+ * colors: {
26241
+ * selected: { color: '#0f0' },
26242
+ * alternative: { color: '#ededed' },
26243
+ * excluded: { color: '#ccc' },
26244
+ * selectedExcluded: { color: '#bbb' },
26245
+ * possible: { color: '#fefefe' },
26246
+ * possible: { color: '#fefefe' },
26247
+ * }
26248
+ * }]
26249
+ * });
26250
+ */
26251
+
25992
26252
  /**
25993
26253
  * @interface Configuration
25994
26254
  * @property {LoadType=} load Fallback load function for missing types
@@ -26411,6 +26671,7 @@ function nuked() {
26411
26671
  * @param {boolean=} [options.checkboxes=false] Show values as checkboxes instead of as fields (not applicable for existing objects)
26412
26672
  * @param {boolean=} [options.dense=false] Reduces padding and text size (not applicable for existing objects)
26413
26673
  * @param {string=} [options.stateName="$"] Sets the state to make selections in (not applicable for existing objects)
26674
+ * @param {Component[]} [options.components] Override individual components' styling, otherwise set by the theme or the default style.
26414
26675
  * @param {object=} [options.properties={}] Properties object to extend default properties with
26415
26676
  * @returns {Promise<void>} A promise that resolves when the data is fetched.
26416
26677
  *