@nebula.js/stardust 4.5.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
2
+ * @nebula.js/stardust v4.6.0
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -708,26 +708,26 @@ var runtime = {exports: {}};
708
708
  }
709
709
  })(runtime);
710
710
 
711
- function ownKeys(e, r) {
712
- var t = Object.keys(e);
711
+ function ownKeys(object, enumerableOnly) {
712
+ var keys = Object.keys(object);
713
713
  if (Object.getOwnPropertySymbols) {
714
- var o = Object.getOwnPropertySymbols(e);
715
- r && (o = o.filter(function (r) {
716
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
717
- })), t.push.apply(t, o);
718
- }
719
- return t;
720
- }
721
- function _objectSpread2(e) {
722
- for (var r = 1; r < arguments.length; r++) {
723
- var t = null != arguments[r] ? arguments[r] : {};
724
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
725
- _defineProperty(e, r, t[r]);
726
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
727
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
714
+ var symbols = Object.getOwnPropertySymbols(object);
715
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
716
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
717
+ })), keys.push.apply(keys, symbols);
718
+ }
719
+ return keys;
720
+ }
721
+ function _objectSpread2(target) {
722
+ for (var i = 1; i < arguments.length; i++) {
723
+ var source = null != arguments[i] ? arguments[i] : {};
724
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
725
+ _defineProperty(target, key, source[key]);
726
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
727
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
728
728
  });
729
729
  }
730
- return e;
730
+ return target;
731
731
  }
732
732
  function _defineProperty(obj, key, value) {
733
733
  key = _toPropertyKey(key);
@@ -5670,7 +5670,7 @@ function StyledEngineProvider(props) {
5670
5670
  }
5671
5671
 
5672
5672
  /**
5673
- * @mui/styled-engine v5.14.11
5673
+ * @mui/styled-engine v5.14.13
5674
5674
  *
5675
5675
  * @license MIT
5676
5676
  * This source code is licensed under the MIT license found in the
@@ -6844,40 +6844,48 @@ const getStyleOverrides = (name, theme) => {
6844
6844
  }
6845
6845
  return null;
6846
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
+ };
6847
6857
  const getVariantStyles = (name, theme) => {
6848
6858
  let variants = [];
6849
6859
  if (theme && theme.components && theme.components[name] && theme.components[name].variants) {
6850
6860
  variants = theme.components[name].variants;
6851
6861
  }
6852
- const variantsStyles = {};
6853
- variants.forEach(definition => {
6854
- const key = propsToClassKey(definition.props);
6855
- variantsStyles[key] = definition.style;
6856
- });
6857
- return variantsStyles;
6862
+ return transformVariants(variants);
6858
6863
  };
6859
- const variantsResolver = (props, styles, theme, name) => {
6860
- var _theme$components;
6864
+ const variantsResolver = (props, styles, variants) => {
6861
6865
  const {
6862
6866
  ownerState = {}
6863
6867
  } = props;
6864
6868
  const variantsStyles = [];
6865
- const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[name]) == null ? void 0 : _theme$components.variants;
6866
- if (themeVariants) {
6867
- themeVariants.forEach(themeVariant => {
6869
+ if (variants) {
6870
+ variants.forEach(variant => {
6868
6871
  let isMatch = true;
6869
- Object.keys(themeVariant.props).forEach(key => {
6870
- 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]) {
6871
6874
  isMatch = false;
6872
6875
  }
6873
6876
  });
6874
6877
  if (isMatch) {
6875
- variantsStyles.push(styles[propsToClassKey(themeVariant.props)]);
6878
+ variantsStyles.push(styles[propsToClassKey(variant.props)]);
6876
6879
  }
6877
6880
  });
6878
6881
  }
6879
6882
  return variantsStyles;
6880
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
+ };
6881
6889
 
6882
6890
  // Update /system/styled/#api in case if this changes
6883
6891
  function shouldForwardProp(prop) {
@@ -6903,6 +6911,29 @@ function defaultOverridesResolver(slot) {
6903
6911
  }
6904
6912
  return (props, styles) => styles[slot];
6905
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
+ };
6906
6937
  function createStyled(input = {}) {
6907
6938
  const {
6908
6939
  themeId,
@@ -6962,16 +6993,61 @@ function createStyled(input = {}) {
6962
6993
  // On the server Emotion doesn't use React.forwardRef for creating components, so the created
6963
6994
  // component stays as a function. This condition makes sure that we do not interpolate functions
6964
6995
  // which are basically components used as a selectors.
6965
- return typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg ? props => {
6966
- return stylesArg(_extends$2({}, props, {
6967
- theme: resolveTheme(_extends$2({}, props, {
6968
- defaultTheme,
6969
- themeId
6970
- }))
6971
- }));
6972
- } : 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;
6973
7022
  }) : [];
6974
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
+ }
6975
7051
  if (componentName && overridesResolver) {
6976
7052
  expressionsWithDefaultTheme.push(props => {
6977
7053
  const theme = resolveTheme(_extends$2({}, props, {
@@ -6997,7 +7073,7 @@ function createStyled(input = {}) {
6997
7073
  defaultTheme,
6998
7074
  themeId
6999
7075
  }));
7000
- return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
7076
+ return themeVariantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
7001
7077
  });
7002
7078
  }
7003
7079
  if (!skipSx) {
@@ -7009,18 +7085,6 @@ function createStyled(input = {}) {
7009
7085
  // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.
7010
7086
  transformedStyleArg = [...styleArg, ...placeholders];
7011
7087
  transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
7012
- } else if (typeof styleArg === 'function' &&
7013
- // On the server Emotion doesn't use React.forwardRef for creating components, so the created
7014
- // component stays as a function. This condition makes sure that we do not interpolate functions
7015
- // which are basically components used as a selectors.
7016
- styleArg.__emotion_real !== styleArg) {
7017
- // If the type is function, we need to define the default theme.
7018
- transformedStyleArg = props => styleArg(_extends$2({}, props, {
7019
- theme: resolveTheme(_extends$2({}, props, {
7020
- defaultTheme,
7021
- themeId
7022
- }))
7023
- }));
7024
7088
  }
7025
7089
  const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
7026
7090
  if (tag.muiName) {
@@ -8228,7 +8292,9 @@ const light = {
8228
8292
  text: {
8229
8293
  primary: colors.grey25,
8230
8294
  secondary: 'rgba(0, 0, 0, 0.55)',
8231
- disabled: 'rgba(0, 0, 0, 0.3)'
8295
+ disabled: 'rgba(0, 0, 0, 0.3)',
8296
+ light: colors.grey100,
8297
+ dark: colors.grey0
8232
8298
  },
8233
8299
  action: {
8234
8300
  active: '#545454',
@@ -8262,9 +8328,13 @@ const light = {
8262
8328
  main: colors.green,
8263
8329
  alternative: '#E4E4E4',
8264
8330
  excluded: '#BEBEBE',
8331
+ selectedExcluded: '#BEBEBE',
8332
+ possible: colors.grey100,
8265
8333
  mainContrastText: colors.grey100,
8266
8334
  alternativeContrastText: colors.grey25,
8267
- excludedContrastText: colors.grey25
8335
+ excludedContrastText: colors.grey25,
8336
+ selectedExcludedContrastText: colors.grey100,
8337
+ possibleContrastText: colors.grey0
8268
8338
  },
8269
8339
  btn: {
8270
8340
  normal: 'rgba(255, 255, 255, 0.6)',
@@ -8292,7 +8362,9 @@ const dark = {
8292
8362
  text: {
8293
8363
  primary: colors.grey100,
8294
8364
  secondary: 'rgba(255, 255, 255, 0.6)',
8295
- disabled: 'rgba(255, 255, 255, 0.3)'
8365
+ disabled: 'rgba(255, 255, 255, 0.3)',
8366
+ light: colors.grey100,
8367
+ dark: colors.grey0
8296
8368
  },
8297
8369
  action: {
8298
8370
  // active: 'rgba(0, 0, 0, 0.55)',
@@ -8323,9 +8395,13 @@ const dark = {
8323
8395
  main: colors.green,
8324
8396
  alternative: colors.grey20,
8325
8397
  excluded: colors.grey10,
8398
+ selectedExcluded: colors.grey10,
8399
+ possible: colors.grey80,
8326
8400
  mainContrastText: colors.grey100,
8327
8401
  alternativeContrastText: colors.grey100,
8328
- excludedContrastText: colors.grey100
8402
+ excludedContrastText: colors.grey100,
8403
+ selectedExcludedContrastText: colors.grey100,
8404
+ possibleContrastText: colors.grey0
8329
8405
  },
8330
8406
  btn: {
8331
8407
  normal: 'rgba(255, 255, 255, 0.15)',
@@ -8473,7 +8549,7 @@ function create$3(definition) {
8473
8549
  return cache[key];
8474
8550
  }
8475
8551
 
8476
- const NEBULA_VERSION_HASH = "7c03" ;
8552
+ const NEBULA_VERSION_HASH = "ba42" ;
8477
8553
  ClassNameGenerator$1.configure(componentName => {
8478
8554
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
8479
8555
  });
@@ -8734,7 +8810,7 @@ function boot(_ref2) {
8734
8810
  const appRef = React__default.createRef();
8735
8811
  const element = document.createElement('div');
8736
8812
  element.style.display = 'none';
8737
- element.setAttribute('data-nebulajs-version', "4.5.0" );
8813
+ element.setAttribute('data-nebulajs-version', "4.6.0" );
8738
8814
  element.setAttribute('data-app-id', app.id);
8739
8815
  document.body.appendChild(element);
8740
8816
  if (context) {
@@ -8859,10 +8935,6 @@ function useSessionModel(definition, app) {
8859
8935
  const [modelStore] = useModelStore();
8860
8936
  const [rpcRequestSessionModelStore] = useRpcRequestSessionModelStore();
8861
8937
  const [model, setModel] = useState$1();
8862
- let rpcShared;
8863
- if (key) {
8864
- rpcShared = rpcRequestSessionModelStore.get(key);
8865
- }
8866
8938
  for (var _len = arguments.length, deps = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
8867
8939
  deps[_key - 2] = arguments[_key];
8868
8940
  }
@@ -8872,9 +8944,9 @@ function useSessionModel(definition, app) {
8872
8944
  }
8873
8945
  // Create new session object
8874
8946
  const create = async () => {
8947
+ let rpcShared = rpcRequestSessionModelStore.get(key);
8875
8948
  if (!rpcShared) {
8876
- const rpc = app.createSessionObject(definition);
8877
- rpcShared = rpc;
8949
+ rpcShared = app.createSessionObject(definition);
8878
8950
  rpcRequestSessionModelStore.set(key, rpcShared);
8879
8951
  }
8880
8952
  const newModel = await rpcShared;
@@ -9987,17 +10059,30 @@ const getMaxFreqWidth = _ref2 => {
9987
10059
  };
9988
10060
  const getSelectedStyle = _ref3 => {
9989
10061
  let {
9990
- theme
10062
+ theme,
10063
+ styles,
10064
+ selectedState
9991
10065
  } = _ref3;
10066
+ const selectionStyles = styles.selections;
10067
+ const backgroundColor = selectionStyles[selectedState];
10068
+ const contrastTextColor = selectionStyles["".concat(selectedState, "Contrast")];
9992
10069
  return {
9993
- background: theme.palette.selected.main,
9994
- color: theme.palette.selected.mainContrastText,
10070
+ background: backgroundColor,
10071
+ color: contrastTextColor,
9995
10072
  '&:focus': {
9996
10073
  boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder),
9997
10074
  outline: 'none'
9998
10075
  },
9999
10076
  '& $cell': {
10000
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
10001
10086
  }
10002
10087
  };
10003
10088
  };
@@ -10010,9 +10095,8 @@ const ellipsis = {
10010
10095
  const iconWidth = 24; // tick and lock icon width in px
10011
10096
 
10012
10097
  const RowColRoot = styled$1('div', {
10013
- 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)
10014
10099
  })(_ref4 => {
10015
- var _theme$listBox$conten, _theme$listBox, _theme$listBox$conten2, _theme$listBox2, _theme$listBox3, _theme$listBox4;
10016
10100
  let {
10017
10101
  theme,
10018
10102
  checkboxes,
@@ -10022,8 +10106,21 @@ const RowColRoot = styled$1('div', {
10022
10106
  direction,
10023
10107
  sizes,
10024
10108
  frequencyMode,
10025
- freqHitsValue
10109
+ freqHitsValue,
10110
+ styles
10026
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
+ });
10027
10124
  return {
10028
10125
  '&:focus': {
10029
10126
  boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder, " !important")
@@ -10041,7 +10138,8 @@ const RowColRoot = styled$1('div', {
10041
10138
  },
10042
10139
  ["& .".concat(rowColClasses.row)]: {
10043
10140
  flexWrap: 'nowrap',
10044
- 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
10045
10143
  },
10046
10144
  ["& .".concat(rowColClasses.rowBorderBottom)]: {
10047
10145
  borderBottom: isGridCol ? 'none' : "1px solid ".concat(theme.palette.divider),
@@ -10050,10 +10148,11 @@ const RowColRoot = styled$1('div', {
10050
10148
  ["& .".concat(rowColClasses.column)]: {
10051
10149
  flexWrap: 'nowrap',
10052
10150
  borderRight: "1px solid ".concat(theme.palette.divider),
10053
- 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
10054
10152
  },
10055
10153
  // The interior wrapper for all field content.
10056
10154
  ["& .".concat(rowColClasses.cell)]: {
10155
+ zIndex: 2,
10057
10156
  display: 'flex',
10058
10157
  alignItems: 'center',
10059
10158
  flexGrow: 1,
@@ -10070,8 +10169,9 @@ const RowColRoot = styled$1('div', {
10070
10169
  userSelect: 'none',
10071
10170
  paddingRight: '1px'
10072
10171
  }, ellipsis), {}, {
10073
- 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,
10074
- 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
10075
10175
  }),
10076
10176
  ["& .".concat(rowColClasses.labelDense)]: {
10077
10177
  fontSize: 12
@@ -10105,32 +10205,32 @@ const RowColRoot = styled$1('div', {
10105
10205
  justifyContent: 'center',
10106
10206
  width: iconWidth,
10107
10207
  minWidth: iconWidth,
10108
- maxWidth: iconWidth
10208
+ maxWidth: iconWidth,
10209
+ color: rowFontColor
10109
10210
  },
10110
- // Selection styles (S=Selected, XS=ExcludedSelected, A=Available, X=Excluded).
10111
- ["& .".concat(rowColClasses.S)]: _objectSpread2(_objectSpread2({}, getSelectedStyle({
10112
- theme
10113
- })), {}, {
10211
+ // Selection styles (S=Selected, XS=ExcludedSelected, A=Alternative, X=Excluded).
10212
+ ["& .".concat(rowColClasses.S)]: _objectSpread2(_objectSpread2({}, selectStyle), {}, {
10114
10213
  border: isGridMode ? 'none' : undefined
10115
10214
  }),
10116
10215
  ["& .".concat(rowColClasses.XS)]: _objectSpread2(_objectSpread2({}, getSelectedStyle({
10117
- theme
10216
+ theme,
10217
+ styles,
10218
+ selectedState: 'selectedExcluded'
10118
10219
  })), {}, {
10119
- background: theme.palette.selected.excluded,
10120
- color: theme.palette.selected.excludedContrastText,
10121
10220
  border: isGridMode ? 'none' : undefined
10122
10221
  }),
10123
- ["& .".concat(rowColClasses.A)]: {
10124
- background: theme.palette.selected.alternative,
10125
- color: theme.palette.selected.alternativeContrastText,
10222
+ ["& .".concat(rowColClasses.A)]: _objectSpread2(_objectSpread2({}, getSelectedStyle({
10223
+ theme,
10224
+ styles,
10225
+ selectedState: 'alternative'
10226
+ })), {}, {
10126
10227
  border: isGridMode ? 'none' : undefined
10127
- },
10128
- ["& .".concat(rowColClasses.X)]: {
10129
- background: theme.palette.selected.excluded,
10130
- color: theme.palette.selected.excludedContrastText,
10228
+ }),
10229
+ ["& .".concat(rowColClasses.X)]: _objectSpread2(_objectSpread2({}, excludedSelectStyle), {}, {
10131
10230
  border: isGridMode ? 'none' : undefined
10132
- },
10231
+ }),
10133
10232
  ["& .".concat(rowColClasses.frequencyCount)]: _objectSpread2(_objectSpread2({
10233
+ zIndex: 3,
10134
10234
  justifyContent: 'flex-end'
10135
10235
  }, ellipsis), {}, {
10136
10236
  flex: "0 0 ".concat(getFreqFlexBasis({
@@ -10158,7 +10258,7 @@ const RowColRoot = styled$1('div', {
10158
10258
  ["& .".concat(rowColClasses.bar)]: {
10159
10259
  height: dense ? '16px' : '20px',
10160
10260
  position: 'absolute',
10161
- zIndex: '-1',
10261
+ zIndex: 1,
10162
10262
  alignSelf: 'center',
10163
10263
  left: barPadPx,
10164
10264
  width: "calc(100% - ".concat(barPadPx * 2, "px)"),
@@ -10173,7 +10273,6 @@ const RowColRoot = styled$1('div', {
10173
10273
  }
10174
10274
  },
10175
10275
  ["& .".concat(rowColClasses.barSelected)]: {
10176
- zIndex: '0',
10177
10276
  '& .bar-filled': {
10178
10277
  opacity: '30%',
10179
10278
  background: theme.palette.background.lighter
@@ -10185,8 +10284,9 @@ const RowColRoot = styled$1('div', {
10185
10284
  },
10186
10285
  ["& .".concat(rowColClasses.barSelectedWithCheckbox)]: {
10187
10286
  '& .bar-filled': {
10188
- background: '#BFE5D0',
10189
- borderColor: '#BFE5D0'
10287
+ opacity: '30%',
10288
+ background: selectStyle.background || '#BFE5D0',
10289
+ borderColor: selectStyle.background || '#BFE5D0'
10190
10290
  }
10191
10291
  },
10192
10292
  ["& .".concat(rowColClasses.excludedTextWithCheckbox)]: {
@@ -10209,9 +10309,12 @@ const classes$b = {
10209
10309
  checkbox: "".concat(PREFIX$b, "-checkbox"),
10210
10310
  dense: "".concat(PREFIX$b, "-dense")
10211
10311
  };
10212
- const StyledCheckbox = styled$1(Checkbox)(_ref => {
10312
+ const StyledCheckbox = styled$1(Checkbox, {
10313
+ shouldForwardProp: p => p !== 'styles'
10314
+ })(_ref => {
10213
10315
  let {
10214
- theme
10316
+ theme,
10317
+ styles
10215
10318
  } = _ref;
10216
10319
  return {
10217
10320
  ["& .".concat(classes$b.cbIcon)]: {
@@ -10227,7 +10330,7 @@ const StyledCheckbox = styled$1(Checkbox)(_ref => {
10227
10330
  },
10228
10331
  ["& .".concat(classes$b.cbIconChecked)]: {
10229
10332
  borderRadius,
10230
- backgroundColor: theme.palette.selected.main,
10333
+ backgroundColor: styles.selections.selected,
10231
10334
  backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',
10232
10335
  '&:before': {
10233
10336
  display: 'block',
@@ -10276,6 +10379,7 @@ function ListboxCheckbox(_ref2) {
10276
10379
  label,
10277
10380
  dense,
10278
10381
  excluded,
10382
+ styles,
10279
10383
  showGray = true,
10280
10384
  dataN
10281
10385
  } = _ref2;
@@ -10293,7 +10397,8 @@ function ListboxCheckbox(_ref2) {
10293
10397
  icon: getIcon(classes$b, showGray, excluded),
10294
10398
  checkedIcon: /*#__PURE__*/React__default.createElement("span", {
10295
10399
  className: classes$b.cbIconChecked
10296
- })
10400
+ }),
10401
+ styles: styles
10297
10402
  });
10298
10403
  }
10299
10404
 
@@ -10345,7 +10450,6 @@ function ListBoxRadioButton(_ref2) {
10345
10450
  function ValueField(_ref) {
10346
10451
  let {
10347
10452
  label,
10348
- color,
10349
10453
  dense,
10350
10454
  showGray = true,
10351
10455
  checkboxes,
@@ -10359,7 +10463,6 @@ function ValueField(_ref) {
10359
10463
  cell,
10360
10464
  checkboxes
10361
10465
  }) && rowColClasses.excludedTextWithCheckbox]),
10362
- color: color,
10363
10466
  align: valueTextAlign,
10364
10467
  dir: "auto"
10365
10468
  }, /*#__PURE__*/React__default.createElement("span", null, label));
@@ -10393,7 +10496,6 @@ function CheckboxField(_ref) {
10393
10496
  let {
10394
10497
  onChange,
10395
10498
  label,
10396
- color,
10397
10499
  qElemNumber,
10398
10500
  isSelected,
10399
10501
  dense,
@@ -10402,7 +10504,8 @@ function CheckboxField(_ref) {
10402
10504
  showGray,
10403
10505
  isSingleSelect,
10404
10506
  checkboxes,
10405
- valueTextAlign
10507
+ valueTextAlign,
10508
+ styles
10406
10509
  } = _ref;
10407
10510
  const cb = /*#__PURE__*/React__default.createElement(ListboxCheckbox, {
10408
10511
  onChange: onChange,
@@ -10412,7 +10515,8 @@ function CheckboxField(_ref) {
10412
10515
  excluded: isExcluded(cell),
10413
10516
  isGridCol: isGridCol,
10414
10517
  showGray: showGray,
10415
- dataN: qElemNumber
10518
+ dataN: qElemNumber,
10519
+ styles: styles
10416
10520
  });
10417
10521
  const rb = /*#__PURE__*/React__default.createElement(ListBoxRadioButton, {
10418
10522
  onChange: onChange,
@@ -10422,12 +10526,10 @@ function CheckboxField(_ref) {
10422
10526
  dataN: qElemNumber
10423
10527
  });
10424
10528
  return /*#__PURE__*/React__default.createElement(FormControlLabel, {
10425
- color: color,
10426
10529
  control: isSingleSelect ? rb : cb,
10427
10530
  className: rowColClasses.checkboxLabel,
10428
10531
  label: /*#__PURE__*/React__default.createElement(LabelTag, {
10429
10532
  label: label,
10430
- color: color,
10431
10533
  dense: dense,
10432
10534
  showGray: showGray,
10433
10535
  checkboxes: checkboxes,
@@ -10466,13 +10568,13 @@ function FieldWithRanges(_ref3) {
10466
10568
  checkboxes,
10467
10569
  dense,
10468
10570
  showGray,
10469
- color,
10470
10571
  qElemNumber,
10471
10572
  isSelected,
10472
10573
  cell,
10473
10574
  isGridCol,
10474
10575
  isSingleSelect,
10475
- valueTextAlign
10576
+ valueTextAlign,
10577
+ styles
10476
10578
  } = _ref3;
10477
10579
  const LWR = /*#__PURE__*/React__default.createElement(LabelsWithRanges, {
10478
10580
  labels: labels,
@@ -10483,7 +10585,6 @@ function FieldWithRanges(_ref3) {
10483
10585
  return checkboxes ? /*#__PURE__*/React__default.createElement(CheckboxField, {
10484
10586
  onChange: onChange,
10485
10587
  label: LWR,
10486
- color: color,
10487
10588
  qElemNumber: qElemNumber,
10488
10589
  isSelected: isSelected,
10489
10590
  dense: dense,
@@ -10492,7 +10593,8 @@ function FieldWithRanges(_ref3) {
10492
10593
  showGray: showGray,
10493
10594
  isSingleSelect: isSingleSelect,
10494
10595
  checkboxes: checkboxes,
10495
- valueTextAlign: valueTextAlign
10596
+ valueTextAlign: valueTextAlign,
10597
+ styles: styles
10496
10598
  }) : LWR;
10497
10599
  }
10498
10600
 
@@ -10500,7 +10602,6 @@ function Field(_ref) {
10500
10602
  let {
10501
10603
  onChange,
10502
10604
  label,
10503
- color,
10504
10605
  qElemNumber,
10505
10606
  isSelected,
10506
10607
  dense,
@@ -10509,12 +10610,12 @@ function Field(_ref) {
10509
10610
  showGray,
10510
10611
  isSingleSelect,
10511
10612
  checkboxes,
10512
- valueTextAlign
10613
+ valueTextAlign,
10614
+ styles
10513
10615
  } = _ref;
10514
10616
  return checkboxes ? /*#__PURE__*/React__default.createElement(CheckboxField, {
10515
10617
  onChange: onChange,
10516
10618
  label: label,
10517
- color: color,
10518
10619
  qElemNumber: qElemNumber,
10519
10620
  isSelected: isSelected,
10520
10621
  dense: dense,
@@ -10523,10 +10624,10 @@ function Field(_ref) {
10523
10624
  showGray: showGray,
10524
10625
  isSingleSelect: isSingleSelect,
10525
10626
  checkboxes: checkboxes,
10526
- valueTextAlign: valueTextAlign
10627
+ valueTextAlign: valueTextAlign,
10628
+ styles: styles
10527
10629
  }) : /*#__PURE__*/React__default.createElement(ValueField, {
10528
10630
  label: label,
10529
- color: color,
10530
10631
  dense: dense,
10531
10632
  showGray: true,
10532
10633
  checkboxes: checkboxes,
@@ -11076,7 +11177,9 @@ function RowColumn(_ref) {
11076
11177
  sizes,
11077
11178
  translator,
11078
11179
  showSearch,
11079
- isModal
11180
+ isModal,
11181
+ contentFontStyle,
11182
+ styles
11080
11183
  } = data;
11081
11184
  const {
11082
11185
  dense = false,
@@ -11087,7 +11190,7 @@ function RowColumn(_ref) {
11087
11190
  itemPadding
11088
11191
  } = sizes;
11089
11192
  let cellIndex;
11090
- let styles;
11193
+ let styleOverrides;
11091
11194
  const count = {
11092
11195
  max: null,
11093
11196
  currentIndex: null
@@ -11103,7 +11206,7 @@ function RowColumn(_ref) {
11103
11206
  count.currentIndex = columnIndex;
11104
11207
  }
11105
11208
  const padding = 0;
11106
- styles = _objectSpread2(_objectSpread2({}, style), {}, {
11209
+ styleOverrides = _objectSpread2(_objectSpread2({}, style), {}, {
11107
11210
  left: padding + (columnIndex === 0 ? style.left : Number(style.left) + columnIndex * padding),
11108
11211
  // right: columnIndex === columnCount ? style.right : Number(style.right) + columnIndex * padding,
11109
11212
  top: rowIndex === 0 ? style.top : Number(style.top) + rowIndex * padding
@@ -11112,7 +11215,7 @@ function RowColumn(_ref) {
11112
11215
  cellIndex = index;
11113
11216
  count.max = listCount;
11114
11217
  count.currentIndex = index;
11115
- styles = _objectSpread2({}, style);
11218
+ styleOverrides = _objectSpread2({}, style);
11116
11219
  }
11117
11220
  cellIndex += dataOffset;
11118
11221
  const [rowRef, setRowRef] = useState$1(null);
@@ -11202,7 +11305,8 @@ function RowColumn(_ref) {
11202
11305
  return /*#__PURE__*/React__default.createElement(RowColRoot$1, {
11203
11306
  className: rowColClasses.barContainer,
11204
11307
  checkboxes: checkboxes,
11205
- style: styles,
11308
+ style: styleOverrides,
11309
+ styles: styles,
11206
11310
  isGridCol: isGridCol,
11207
11311
  isGridMode: dataLayout === 'grid',
11208
11312
  dense: dense,
@@ -11210,6 +11314,7 @@ function RowColumn(_ref) {
11210
11314
  sizes: sizes,
11211
11315
  frequencyMode: deducedFrequencyMode,
11212
11316
  freqHitsValue: freqHitsValue,
11317
+ contentFontStyle: contentFontStyle,
11213
11318
  "data-testid": "listbox.item"
11214
11319
  }, /*#__PURE__*/React__default.createElement(ItemGrid, {
11215
11320
  role: "row",
@@ -11256,18 +11361,16 @@ function RowColumn(_ref) {
11256
11361
  checkboxes: checkboxes,
11257
11362
  dense: dense,
11258
11363
  showGray: showGray,
11259
- color: "inherit" // TODO: Check this
11260
- ,
11261
11364
  qElemNumber: cell.qElemNumber,
11262
11365
  isSelected: isSelected,
11263
11366
  cell: cell,
11264
11367
  isGridCol: isGridCol,
11265
11368
  isSingleSelect: isSingleSelect,
11266
- valueTextAlign: valueTextAlign
11369
+ valueTextAlign: valueTextAlign,
11370
+ styles: styles
11267
11371
  }) : /*#__PURE__*/React__default.createElement(Field$1, {
11268
11372
  onChange: onChange,
11269
11373
  label: label,
11270
- color: "inherit",
11271
11374
  qElemNumber: cell.qElemNumber,
11272
11375
  isSelected: isSelected,
11273
11376
  dense: dense,
@@ -11276,7 +11379,8 @@ function RowColumn(_ref) {
11276
11379
  showGray: showGray,
11277
11380
  isSingleSelect: isSingleSelect,
11278
11381
  checkboxes: checkboxes,
11279
- valueTextAlign: valueTextAlign
11382
+ valueTextAlign: valueTextAlign,
11383
+ styles: styles
11280
11384
  })), freqIsAllowed && /*#__PURE__*/React__default.createElement(Frequency, {
11281
11385
  cell: cell,
11282
11386
  checkboxes: checkboxes,
@@ -12856,7 +12960,8 @@ function getListBoxComponents(_ref) {
12856
12960
  freqIsAllowed,
12857
12961
  translator,
12858
12962
  showSearch,
12859
- isModal
12963
+ isModal,
12964
+ styles
12860
12965
  } = _ref;
12861
12966
  const {
12862
12967
  layoutOptions = {}
@@ -12910,7 +13015,8 @@ function getListBoxComponents(_ref) {
12910
13015
  direction,
12911
13016
  translator,
12912
13017
  showSearch,
12913
- isModal
13018
+ isModal,
13019
+ styles
12914
13020
  });
12915
13021
  const List = _ref2 => {
12916
13022
  let {
@@ -13041,6 +13147,7 @@ function calculateColumnMode(_ref) {
13041
13147
  } else {
13042
13148
  rowCount = Math.min(listCount, maxRows, autoRowCount);
13043
13149
  }
13150
+ rowCount = Math.max(rowCount, 1);
13044
13151
  const columnCount = Math.ceil(listCount / rowCount);
13045
13152
  const columnWidth = Math.max(columnAutoWidth, containerWidth / columnCount, itemMinWidth);
13046
13153
  return {
@@ -13067,6 +13174,7 @@ function calculateRowMode(_ref) {
13067
13174
  } else {
13068
13175
  columnCount = Math.min(listCount, maxColumns, autoColumnCount);
13069
13176
  }
13177
+ columnCount = Math.max(columnCount, 1);
13070
13178
  const columnWidth = innerWidth / columnCount;
13071
13179
  const rowCount = Math.ceil(listCount / columnCount);
13072
13180
  return {
@@ -13106,7 +13214,6 @@ function getMeasureText(layoutOrNumber) {
13106
13214
  }
13107
13215
 
13108
13216
  function useListSizes(_ref) {
13109
- var _theme$listBox;
13110
13217
  let {
13111
13218
  layout,
13112
13219
  width,
@@ -13115,7 +13222,7 @@ function useListSizes(_ref) {
13115
13222
  count,
13116
13223
  freqIsAllowed,
13117
13224
  checkboxes,
13118
- theme
13225
+ styles
13119
13226
  } = _ref;
13120
13227
  const {
13121
13228
  layoutOptions = {}
@@ -13130,7 +13237,7 @@ function useListSizes(_ref) {
13130
13237
  const {
13131
13238
  fontSize = '12px',
13132
13239
  fontFamily = 'Source sans pro'
13133
- } = (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) || {};
13134
13241
  const font = "".concat(fontSize, " ").concat(fontFamily); // font format as supported by HTML canvas
13135
13242
  const textWidth = useTextWidth({
13136
13243
  text: getMeasureText(layout),
@@ -13801,7 +13908,6 @@ function ListBox(_ref) {
13801
13908
  model,
13802
13909
  app,
13803
13910
  constraints,
13804
- theme,
13805
13911
  layout,
13806
13912
  selections,
13807
13913
  selectionState,
@@ -13828,7 +13934,8 @@ function ListBox(_ref) {
13828
13934
  renderedCallback,
13829
13935
  onCtrlF,
13830
13936
  showSearch,
13831
- isModal
13937
+ isModal,
13938
+ styles
13832
13939
  } = _ref;
13833
13940
  const {
13834
13941
  translator: translatorDynamic
@@ -13984,7 +14091,7 @@ function ListBox(_ref) {
13984
14091
  count,
13985
14092
  freqIsAllowed,
13986
14093
  checkboxes,
13987
- theme
14094
+ styles
13988
14095
  });
13989
14096
  if (sizes.columnWidth) {
13990
14097
  // In grid mode, where we have a dynamic item width, get a second opinion on showing/hiding frequency.
@@ -14099,7 +14206,8 @@ function ListBox(_ref) {
14099
14206
  freqIsAllowed,
14100
14207
  translator: translatorDynamic,
14101
14208
  showSearch,
14102
- isModal
14209
+ isModal,
14210
+ styles
14103
14211
  });
14104
14212
  const {
14105
14213
  columnWidth,
@@ -14475,7 +14583,7 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
14475
14583
  }), /*#__PURE__*/React__default.createElement(MenuList, {
14476
14584
  id: "moreMenuList"
14477
14585
  }, actions.map((item, ix) =>
14478
- /*#__PURE__*/
14586
+
14479
14587
  // eslint-disable-next-line react/no-array-index-key
14480
14588
  React__default.createElement(MoreItem, {
14481
14589
  key: ix,
@@ -14794,22 +14902,24 @@ var SearchIcon = (props => SvgIcon$2(search(props)));
14794
14902
 
14795
14903
  const TREE_PATH = '/qListObjectDef';
14796
14904
  const WILDCARD = '**';
14797
- const StyledInputAdornment = styled$1(InputAdornment)(_ref => {
14798
- var _theme$listBox;
14905
+ const StyledInputAdornment = styled$1(InputAdornment, {
14906
+ shouldForwardProp: p => p !== 'styles'
14907
+ })(_ref => {
14799
14908
  let {
14800
- theme
14909
+ styles
14801
14910
  } = _ref;
14802
14911
  return {
14803
- 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
14804
14913
  };
14805
14914
  });
14806
- const StyledOutlinedInput = styled$1(OutlinedInput)(_ref2 => {
14807
- var _theme$listBox2;
14915
+ const StyledOutlinedInput = styled$1(OutlinedInput, {
14916
+ shouldForwardProp: p => p !== 'styles'
14917
+ })(_ref2 => {
14808
14918
  let {
14809
- theme
14919
+ styles
14810
14920
  } = _ref2;
14811
14921
  return {
14812
- 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,
14813
14923
  display: 'flex'
14814
14924
  };
14815
14925
  });
@@ -14825,7 +14935,8 @@ function ListBoxSearch(_ref3) {
14825
14935
  wildCardSearch = false,
14826
14936
  searchEnabled,
14827
14937
  direction,
14828
- hide
14938
+ hide,
14939
+ styles
14829
14940
  } = _ref3;
14830
14941
  const {
14831
14942
  translator
@@ -14962,8 +15073,10 @@ function ListBoxSearch(_ref3) {
14962
15073
  return null;
14963
15074
  }
14964
15075
  return /*#__PURE__*/React__default.createElement(StyledOutlinedInput, {
15076
+ styles: styles,
14965
15077
  startAdornment: /*#__PURE__*/React__default.createElement(StyledInputAdornment, {
14966
- position: "start"
15078
+ position: "start",
15079
+ styles: styles
14967
15080
  }, /*#__PURE__*/React__default.createElement(SearchIcon, {
14968
15081
  size: dense ? 'small' : 'normal'
14969
15082
  })),
@@ -15426,6 +15539,104 @@ function hasSelections(layout) {
15426
15539
  return totalCounts > 0;
15427
15540
  }
15428
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
+
15429
15640
  function ListBoxPopover(_ref) {
15430
15641
  let {
15431
15642
  alignTo,
@@ -15442,7 +15653,9 @@ function ListBoxPopover(_ref) {
15442
15653
  app,
15443
15654
  fieldName,
15444
15655
  stateName = '$',
15445
- autoFocus
15656
+ autoFocus,
15657
+ components,
15658
+ checkboxes: checkboxesOption
15446
15659
  } = _ref;
15447
15660
  const isMasterDim = Boolean(fieldName === null || fieldName === void 0 ? void 0 : fieldName.qLibraryId);
15448
15661
  const open = show && Boolean(alignTo.current);
@@ -15481,13 +15694,23 @@ function ListBoxPopover(_ref) {
15481
15694
  model.unlock('/qListObjectDef');
15482
15695
  }, [model]);
15483
15696
  const {
15484
- translator
15697
+ translator,
15698
+ themeApi
15485
15699
  } = useContext(InstanceContext);
15486
15700
  const moreAlignTo = useRef();
15487
15701
  const containerRef = useRef();
15488
15702
  const [selections] = useObjectSelections(app, model, containerRef);
15489
15703
  const [layout] = useLayout$1(model);
15490
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
+ });
15491
15714
  useEffect$1(() => {
15492
15715
  if (selections && open) {
15493
15716
  if (!selections.isModal(model)) {
@@ -15584,6 +15807,7 @@ function ListBoxPopover(_ref) {
15584
15807
  item: true,
15585
15808
  ref: searchContainerRef
15586
15809
  }, /*#__PURE__*/React__default.createElement(ListBoxSearch, {
15810
+ styles: styles,
15587
15811
  visible: true,
15588
15812
  model: model,
15589
15813
  listCount: listCount,
@@ -15602,7 +15826,7 @@ function ListBoxPopover(_ref) {
15602
15826
  direction: "ltr",
15603
15827
  onSetListCount: c => setListCount(c),
15604
15828
  onCtrlF: onCtrlF,
15605
- theme: theme
15829
+ styles: styles
15606
15830
  }))));
15607
15831
  }
15608
15832
 
@@ -15886,7 +16110,7 @@ function MultiState(_ref2) {
15886
16110
  variant: "contained",
15887
16111
  fullWidth: true
15888
16112
  }, clearAllStates)), field.states.map((s, ix) =>
15889
- /*#__PURE__*/
16113
+
15890
16114
  // eslint-disable-next-line react/no-array-index-key
15891
16115
  React__default.createElement(ListItem, {
15892
16116
  key: ix,
@@ -16064,7 +16288,7 @@ function More(_ref2) {
16064
16288
  }, /*#__PURE__*/React__default.createElement(List, {
16065
16289
  dense: true
16066
16290
  }, items.map((s, ix) =>
16067
- /*#__PURE__*/
16291
+
16068
16292
  // eslint-disable-next-line react/no-array-index-key
16069
16293
  React__default.createElement(ListItem, {
16070
16294
  key: ix,
@@ -16981,26 +17205,6 @@ function getListboxContainerKeyboardNavigation(_ref) {
16981
17205
  };
16982
17206
  }
16983
17207
 
16984
- const addListboxTheme = themeApi => {
16985
- const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
16986
- return {
16987
- backgroundColor: getListboxStyle('', 'backgroundColor'),
16988
- title: {
16989
- main: {
16990
- color: getListboxStyle('title.main', 'color'),
16991
- fontSize: getListboxStyle('title.main', 'fontSize'),
16992
- fontFamily: getListboxStyle('title.main', 'fontFamily'),
16993
- fontWeight: getListboxStyle('title.main', 'fontWeight')
16994
- }
16995
- },
16996
- content: {
16997
- color: getListboxStyle('content', 'color'),
16998
- fontSize: getListboxStyle('content', 'fontSize'),
16999
- fontFamily: getListboxStyle('content', 'fontFamily')
17000
- }
17001
- };
17002
- };
17003
-
17004
17208
  function showToolbarDetached(_ref) {
17005
17209
  var _titleRef$current$cli, _titleRef$current, _titleRef$current2, _titleRef$current3;
17006
17210
  let {
@@ -17093,16 +17297,16 @@ const classes$4 = {
17093
17297
  listboxWrapper: "".concat(PREFIX$4, "-listboxWrapper")
17094
17298
  };
17095
17299
  const StyledGrid$3 = styled$1(Grid, {
17096
- shouldForwardProp: p => !['containerPadding', 'isGridMode'].includes(p)
17300
+ shouldForwardProp: p => !['containerPadding', 'isGridMode', 'styles'].includes(p)
17097
17301
  })(_ref => {
17098
- var _theme$listBox$backgr, _theme$listBox;
17099
17302
  let {
17100
17303
  theme,
17101
17304
  containerPadding,
17102
- isGridMode
17305
+ isGridMode,
17306
+ styles
17103
17307
  } = _ref;
17104
17308
  return {
17105
- 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,
17106
17310
  ["& .".concat(classes$4.listBoxHeader)]: {
17107
17311
  alignSelf: 'center',
17108
17312
  display: 'flex'
@@ -17128,15 +17332,14 @@ const StyledGrid$3 = styled$1(Grid, {
17128
17332
  };
17129
17333
  });
17130
17334
  const Title = styled$1(Typography)(_ref2 => {
17131
- var _theme$listBox2, _theme$listBox3, _theme$listBox4, _theme$listBox5;
17132
17335
  let {
17133
- theme
17336
+ styles
17134
17337
  } = _ref2;
17135
17338
  return {
17136
- 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,
17137
- 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,
17138
- 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,
17139
- 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
17140
17343
  };
17141
17344
  });
17142
17345
  const isModal = _ref3 => {
@@ -17157,7 +17360,7 @@ function ListBoxInline(_ref4) {
17157
17360
  app,
17158
17361
  direction,
17159
17362
  frequencyMode,
17160
- checkboxes,
17363
+ checkboxes: checkboxesOption,
17161
17364
  search = true,
17162
17365
  focusSearch = false,
17163
17366
  rangeSelect = true,
@@ -17172,7 +17375,8 @@ function ListBoxInline(_ref4) {
17172
17375
  scrollState = undefined,
17173
17376
  renderedCallback,
17174
17377
  toolbar = true,
17175
- isPopover = false
17378
+ isPopover = false,
17379
+ components
17176
17380
  } = options;
17177
17381
 
17178
17382
  // Hook that will trigger update when used in useEffects.
@@ -17196,7 +17400,15 @@ function ListBoxInline(_ref4) {
17196
17400
  themeApi,
17197
17401
  constraints
17198
17402
  } = useContext(InstanceContext);
17199
- theme.listBox = addListboxTheme(themeApi);
17403
+ const {
17404
+ checkboxes = checkboxesOption
17405
+ } = layout || {};
17406
+ const styles = getStyles({
17407
+ themeApi,
17408
+ theme,
17409
+ components,
17410
+ checkboxes
17411
+ });
17200
17412
  const isDirectQuery = isDirectQueryEnabled({
17201
17413
  appLayout: app === null || app === void 0 ? void 0 : app.layout
17202
17414
  });
@@ -17417,6 +17629,7 @@ function ListBoxInline(_ref4) {
17417
17629
  direction: "column",
17418
17630
  gap: 0,
17419
17631
  containerPadding: containerPadding,
17632
+ styles: styles,
17420
17633
  style: {
17421
17634
  height: '100%',
17422
17635
  flexFlow: 'column nowrap'
@@ -17462,7 +17675,8 @@ function ListBoxInline(_ref4) {
17462
17675
  variant: "h6",
17463
17676
  noWrap: true,
17464
17677
  ref: titleRef,
17465
- title: layout.title
17678
+ title: layout.title,
17679
+ styles: styles
17466
17680
  }, layout.title)), /*#__PURE__*/React__default.createElement(Grid, {
17467
17681
  item: true
17468
17682
  }, /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$5({
@@ -17492,7 +17706,8 @@ function ListBoxInline(_ref4) {
17492
17706
  wildCardSearch: wildCardSearch,
17493
17707
  searchEnabled: searchEnabled,
17494
17708
  direction: direction,
17495
- hide: showSearchIcon && onShowSearch
17709
+ hide: showSearchIcon && onShowSearch,
17710
+ styles: styles
17496
17711
  })), /*#__PURE__*/React__default.createElement(Grid, {
17497
17712
  item: true,
17498
17713
  xs: true,
@@ -17507,7 +17722,6 @@ function ListBoxInline(_ref4) {
17507
17722
  return /*#__PURE__*/React__default.createElement(ListBox, {
17508
17723
  model: model,
17509
17724
  app: app,
17510
- theme: theme,
17511
17725
  constraints: constraints,
17512
17726
  layout: layout,
17513
17727
  selections: selections,
@@ -17540,7 +17754,8 @@ function ListBoxInline(_ref4) {
17540
17754
  },
17541
17755
  renderedCallback: renderedCallback,
17542
17756
  onCtrlF: onCtrlF,
17543
- isModal: isModalMode
17757
+ isModal: isModalMode,
17758
+ styles: styles
17544
17759
  });
17545
17760
  })))));
17546
17761
  }
@@ -18097,7 +18312,8 @@ function ListBoxPopoverWrapper(_ref) {
18097
18312
  close: handleCloseShowState,
18098
18313
  fieldName: fieldIdentifier,
18099
18314
  stateName: stateName,
18100
- autoFocus: options.autoFocus
18315
+ autoFocus: options.autoFocus,
18316
+ components: options.components
18101
18317
  });
18102
18318
  }
18103
18319
 
@@ -26002,6 +26218,37 @@ const DEFAULT_SNAPSHOT_CONFIG = /** @lends SnapshotConfiguration */{
26002
26218
  }
26003
26219
  };
26004
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
+
26005
26252
  /**
26006
26253
  * @interface Configuration
26007
26254
  * @property {LoadType=} load Fallback load function for missing types
@@ -26424,6 +26671,7 @@ function nuked() {
26424
26671
  * @param {boolean=} [options.checkboxes=false] Show values as checkboxes instead of as fields (not applicable for existing objects)
26425
26672
  * @param {boolean=} [options.dense=false] Reduces padding and text size (not applicable for existing objects)
26426
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.
26427
26675
  * @param {object=} [options.properties={}] Properties object to extend default properties with
26428
26676
  * @returns {Promise<void>} A promise that resolves when the data is fetched.
26429
26677
  *