@nebula.js/stardust 2.5.0 → 2.6.1

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v2.5.0
2
+ * @nebula.js/stardust v2.6.1
3
3
  * Copyright (c) 2022 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -11023,7 +11023,7 @@
11023
11023
  return [appSelections, navState];
11024
11024
  }
11025
11025
 
11026
- const NEBULA_VERSION_HASH = "daf8" ;
11026
+ const NEBULA_VERSION_HASH = "375a" ;
11027
11027
  let counter = 0;
11028
11028
  const NebulaApp = react.exports.forwardRef((_ref, ref) => {
11029
11029
  let {
@@ -11083,7 +11083,7 @@
11083
11083
  const appRef = React.createRef();
11084
11084
  const element = document.createElement('div');
11085
11085
  element.style.display = 'none';
11086
- element.setAttribute('data-nebulajs-version', "2.5.0" );
11086
+ element.setAttribute('data-nebulajs-version', "2.6.1" );
11087
11087
  element.setAttribute('data-app-id', app.id);
11088
11088
  document.body.appendChild(element);
11089
11089
  ReactDOM.render( /*#__PURE__*/React.createElement(NebulaApp, {
@@ -11182,6 +11182,109 @@
11182
11182
  }, function () {});
11183
11183
  }
11184
11184
 
11185
+ var styles$r = function styles(theme) {
11186
+ return {
11187
+ /* Styles applied to the root element. */
11188
+ root: {
11189
+ userSelect: 'none',
11190
+ width: '1em',
11191
+ height: '1em',
11192
+ display: 'inline-block',
11193
+ fill: 'currentColor',
11194
+ flexShrink: 0,
11195
+ fontSize: theme.typography.pxToRem(24),
11196
+ transition: theme.transitions.create('fill', {
11197
+ duration: theme.transitions.duration.shorter
11198
+ })
11199
+ },
11200
+
11201
+ /* Styles applied to the root element if `color="primary"`. */
11202
+ colorPrimary: {
11203
+ color: theme.palette.primary.main
11204
+ },
11205
+
11206
+ /* Styles applied to the root element if `color="secondary"`. */
11207
+ colorSecondary: {
11208
+ color: theme.palette.secondary.main
11209
+ },
11210
+
11211
+ /* Styles applied to the root element if `color="action"`. */
11212
+ colorAction: {
11213
+ color: theme.palette.action.active
11214
+ },
11215
+
11216
+ /* Styles applied to the root element if `color="error"`. */
11217
+ colorError: {
11218
+ color: theme.palette.error.main
11219
+ },
11220
+
11221
+ /* Styles applied to the root element if `color="disabled"`. */
11222
+ colorDisabled: {
11223
+ color: theme.palette.action.disabled
11224
+ },
11225
+
11226
+ /* Styles applied to the root element if `fontSize="inherit"`. */
11227
+ fontSizeInherit: {
11228
+ fontSize: 'inherit'
11229
+ },
11230
+
11231
+ /* Styles applied to the root element if `fontSize="small"`. */
11232
+ fontSizeSmall: {
11233
+ fontSize: theme.typography.pxToRem(20)
11234
+ },
11235
+
11236
+ /* Styles applied to the root element if `fontSize="large"`. */
11237
+ fontSizeLarge: {
11238
+ fontSize: theme.typography.pxToRem(35)
11239
+ }
11240
+ };
11241
+ };
11242
+ var SvgIcon$1 = /*#__PURE__*/react.exports.forwardRef(function SvgIcon(props, ref) {
11243
+ var children = props.children,
11244
+ classes = props.classes,
11245
+ className = props.className,
11246
+ _props$color = props.color,
11247
+ color = _props$color === void 0 ? 'inherit' : _props$color,
11248
+ _props$component = props.component,
11249
+ Component = _props$component === void 0 ? 'svg' : _props$component,
11250
+ _props$fontSize = props.fontSize,
11251
+ fontSize = _props$fontSize === void 0 ? 'medium' : _props$fontSize,
11252
+ htmlColor = props.htmlColor,
11253
+ titleAccess = props.titleAccess,
11254
+ _props$viewBox = props.viewBox,
11255
+ viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox,
11256
+ other = _objectWithoutProperties(props, ["children", "classes", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]);
11257
+
11258
+ return /*#__PURE__*/react.exports.createElement(Component, _extends$4({
11259
+ className: clsx(classes.root, className, color !== 'inherit' && classes["color".concat(capitalize(color))], fontSize !== 'default' && fontSize !== 'medium' && classes["fontSize".concat(capitalize(fontSize))]),
11260
+ focusable: "false",
11261
+ viewBox: viewBox,
11262
+ color: htmlColor,
11263
+ "aria-hidden": titleAccess ? undefined : true,
11264
+ role: titleAccess ? 'img' : undefined,
11265
+ ref: ref
11266
+ }, other), children, titleAccess ? /*#__PURE__*/react.exports.createElement("title", null, titleAccess) : null);
11267
+ });
11268
+ SvgIcon$1.muiName = 'SvgIcon';
11269
+ var SvgIcon$2 = withStyles(styles$r, {
11270
+ name: 'MuiSvgIcon'
11271
+ })(SvgIcon$1);
11272
+
11273
+ /**
11274
+ * Private module reserved for @material-ui/x packages.
11275
+ */
11276
+
11277
+ function createSvgIcon(path, displayName) {
11278
+ var Component = function Component(props, ref) {
11279
+ return /*#__PURE__*/React.createElement(SvgIcon$2, _extends$4({
11280
+ ref: ref
11281
+ }, props), path);
11282
+ };
11283
+
11284
+ Component.muiName = SvgIcon$2.muiName;
11285
+ return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));
11286
+ }
11287
+
11185
11288
  // Corresponds to 10 frames at 60 Hz.
11186
11289
  // A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
11187
11290
  function debounce(func) {
@@ -11233,6 +11336,30 @@
11233
11336
  }
11234
11337
  }
11235
11338
 
11339
+ /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
11340
+ function useControlled(_ref) {
11341
+ var controlled = _ref.controlled,
11342
+ defaultProp = _ref.default;
11343
+ _ref.name;
11344
+ _ref.state;
11345
+
11346
+ var _React$useRef = react.exports.useRef(controlled !== undefined),
11347
+ isControlled = _React$useRef.current;
11348
+
11349
+ var _React$useState = react.exports.useState(defaultProp),
11350
+ valueState = _React$useState[0],
11351
+ setValue = _React$useState[1];
11352
+
11353
+ var value = isControlled ? controlled : valueState;
11354
+
11355
+ var setValueIfUncontrolled = react.exports.useCallback(function (newValue) {
11356
+ if (!isControlled) {
11357
+ setValue(newValue);
11358
+ }
11359
+ }, []);
11360
+ return [value, setValueIfUncontrolled];
11361
+ }
11362
+
11236
11363
  var useEnhancedEffect$6 = typeof window !== 'undefined' ? react.exports.useLayoutEffect : react.exports.useEffect;
11237
11364
  /**
11238
11365
  * https://github.com/facebook/react/issues/14099#issuecomment-440013892
@@ -12205,7 +12332,7 @@
12205
12332
  };
12206
12333
  }
12207
12334
 
12208
- var styles$n = function styles(theme) {
12335
+ var styles$q = function styles(theme) {
12209
12336
  var elevations = {};
12210
12337
  theme.shadows.forEach(function (shadow, index) {
12211
12338
  elevations["elevation".concat(index)] = {
@@ -12249,7 +12376,7 @@
12249
12376
  ref: ref
12250
12377
  }, other));
12251
12378
  });
12252
- var Paper$1 = withStyles(styles$n, {
12379
+ var Paper$1 = withStyles(styles$q, {
12253
12380
  name: 'MuiPaper'
12254
12381
  })(Paper);
12255
12382
 
@@ -12325,7 +12452,7 @@
12325
12452
 
12326
12453
  var DURATION = 550;
12327
12454
  var DELAY_RIPPLE = 80;
12328
- var styles$m = function styles(theme) {
12455
+ var styles$p = function styles(theme) {
12329
12456
  return {
12330
12457
  /* Styles applied to the root element. */
12331
12458
  root: {
@@ -12605,12 +12732,12 @@
12605
12732
  exit: true
12606
12733
  }, ripples));
12607
12734
  });
12608
- var TouchRipple$1 = withStyles(styles$m, {
12735
+ var TouchRipple$1 = withStyles(styles$p, {
12609
12736
  flip: false,
12610
12737
  name: 'MuiTouchRipple'
12611
12738
  })( /*#__PURE__*/react.exports.memo(TouchRipple));
12612
12739
 
12613
- var styles$l = {
12740
+ var styles$o = {
12614
12741
  /* Styles applied to the root element. */
12615
12742
  root: {
12616
12743
  display: 'inline-flex',
@@ -12914,11 +13041,11 @@
12914
13041
  center: centerRipple
12915
13042
  }, TouchRippleProps)) : null);
12916
13043
  });
12917
- var ButtonBase$1 = withStyles(styles$l, {
13044
+ var ButtonBase$1 = withStyles(styles$o, {
12918
13045
  name: 'MuiButtonBase'
12919
13046
  })(ButtonBase);
12920
13047
 
12921
- var styles$k = function styles(theme) {
13048
+ var styles$n = function styles(theme) {
12922
13049
  return {
12923
13050
  /* Styles applied to the root element. */
12924
13051
  root: {
@@ -13043,13 +13170,13 @@
13043
13170
  className: classes.label
13044
13171
  }, children));
13045
13172
  });
13046
- var IconButton$1 = withStyles(styles$k, {
13173
+ var IconButton$1 = withStyles(styles$n, {
13047
13174
  name: 'MuiIconButton'
13048
13175
  })(IconButton);
13049
13176
 
13050
13177
  var RADIUS_STANDARD = 10;
13051
13178
  var RADIUS_DOT = 4;
13052
- var styles$j = function styles(theme) {
13179
+ var styles$m = function styles(theme) {
13053
13180
  return {
13054
13181
  /* Styles applied to the root element. */
13055
13182
  root: {
@@ -13341,7 +13468,7 @@
13341
13468
  className: clsx(classes.badge, classes["".concat(anchorOrigin.horizontal).concat(capitalize(anchorOrigin.vertical), "}")], classes["anchorOrigin".concat(capitalize(anchorOrigin.vertical)).concat(capitalize(anchorOrigin.horizontal)).concat(capitalize(overlap))], color !== 'default' && classes["color".concat(capitalize(color))], invisible && classes.invisible, variant === 'dot' && classes.dot)
13342
13469
  }, displayValue));
13343
13470
  });
13344
- var Badge$1 = withStyles(styles$j, {
13471
+ var Badge$1 = withStyles(styles$m, {
13345
13472
  name: 'MuiBadge'
13346
13473
  })(Badge);
13347
13474
 
@@ -13355,7 +13482,7 @@
13355
13482
  });
13356
13483
  var Box$1 = Box;
13357
13484
 
13358
- var styles$i = function styles(theme) {
13485
+ var styles$l = function styles(theme) {
13359
13486
  return {
13360
13487
  /* Styles applied to the root element. */
13361
13488
  root: {
@@ -13527,11 +13654,11 @@
13527
13654
  ref: ref
13528
13655
  }, other));
13529
13656
  });
13530
- var Typography$1 = withStyles(styles$i, {
13657
+ var Typography$1 = withStyles(styles$l, {
13531
13658
  name: 'MuiTypography'
13532
13659
  })(Typography);
13533
13660
 
13534
- var styles$h = function styles(theme) {
13661
+ var styles$k = function styles(theme) {
13535
13662
  return {
13536
13663
  /* Styles applied to the root element. */
13537
13664
  root: _extends$4({}, theme.typography.button, {
@@ -13856,7 +13983,7 @@
13856
13983
  className: classes.label
13857
13984
  }, startIcon, children, endIcon));
13858
13985
  });
13859
- var Button$1 = withStyles(styles$h, {
13986
+ var Button$1 = withStyles(styles$k, {
13860
13987
  name: 'MuiButton'
13861
13988
  })(Button);
13862
13989
 
@@ -13866,13 +13993,265 @@
13866
13993
 
13867
13994
  var FormControlContext = react.exports.createContext();
13868
13995
 
13869
- function useFormControl() {
13996
+ function useFormControl$1() {
13870
13997
  return react.exports.useContext(FormControlContext);
13871
13998
  }
13872
13999
  var FormControlContext$1 = FormControlContext;
13873
14000
 
14001
+ function useFormControl() {
14002
+ return react.exports.useContext(FormControlContext$1);
14003
+ }
14004
+
14005
+ var styles$j = {
14006
+ root: {
14007
+ padding: 9
14008
+ },
14009
+ checked: {},
14010
+ disabled: {},
14011
+ input: {
14012
+ cursor: 'inherit',
14013
+ position: 'absolute',
14014
+ opacity: 0,
14015
+ width: '100%',
14016
+ height: '100%',
14017
+ top: 0,
14018
+ left: 0,
14019
+ margin: 0,
14020
+ padding: 0,
14021
+ zIndex: 1
14022
+ }
14023
+ };
14024
+ /**
14025
+ * @ignore - internal component.
14026
+ */
14027
+
14028
+ var SwitchBase = /*#__PURE__*/react.exports.forwardRef(function SwitchBase(props, ref) {
14029
+ var autoFocus = props.autoFocus,
14030
+ checkedProp = props.checked,
14031
+ checkedIcon = props.checkedIcon,
14032
+ classes = props.classes,
14033
+ className = props.className,
14034
+ defaultChecked = props.defaultChecked,
14035
+ disabledProp = props.disabled,
14036
+ icon = props.icon,
14037
+ id = props.id,
14038
+ inputProps = props.inputProps,
14039
+ inputRef = props.inputRef,
14040
+ name = props.name,
14041
+ onBlur = props.onBlur,
14042
+ onChange = props.onChange,
14043
+ onFocus = props.onFocus,
14044
+ readOnly = props.readOnly,
14045
+ required = props.required,
14046
+ tabIndex = props.tabIndex,
14047
+ type = props.type,
14048
+ value = props.value,
14049
+ other = _objectWithoutProperties(props, ["autoFocus", "checked", "checkedIcon", "classes", "className", "defaultChecked", "disabled", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"]);
14050
+
14051
+ var _useControlled = useControlled({
14052
+ controlled: checkedProp,
14053
+ default: Boolean(defaultChecked),
14054
+ name: 'SwitchBase',
14055
+ state: 'checked'
14056
+ }),
14057
+ _useControlled2 = _slicedToArray(_useControlled, 2),
14058
+ checked = _useControlled2[0],
14059
+ setCheckedState = _useControlled2[1];
14060
+
14061
+ var muiFormControl = useFormControl();
14062
+
14063
+ var handleFocus = function handleFocus(event) {
14064
+ if (onFocus) {
14065
+ onFocus(event);
14066
+ }
14067
+
14068
+ if (muiFormControl && muiFormControl.onFocus) {
14069
+ muiFormControl.onFocus(event);
14070
+ }
14071
+ };
14072
+
14073
+ var handleBlur = function handleBlur(event) {
14074
+ if (onBlur) {
14075
+ onBlur(event);
14076
+ }
14077
+
14078
+ if (muiFormControl && muiFormControl.onBlur) {
14079
+ muiFormControl.onBlur(event);
14080
+ }
14081
+ };
14082
+
14083
+ var handleInputChange = function handleInputChange(event) {
14084
+ var newChecked = event.target.checked;
14085
+ setCheckedState(newChecked);
14086
+
14087
+ if (onChange) {
14088
+ // TODO v5: remove the second argument.
14089
+ onChange(event, newChecked);
14090
+ }
14091
+ };
14092
+
14093
+ var disabled = disabledProp;
14094
+
14095
+ if (muiFormControl) {
14096
+ if (typeof disabled === 'undefined') {
14097
+ disabled = muiFormControl.disabled;
14098
+ }
14099
+ }
14100
+
14101
+ var hasLabelFor = type === 'checkbox' || type === 'radio';
14102
+ return /*#__PURE__*/react.exports.createElement(IconButton$1, _extends$4({
14103
+ component: "span",
14104
+ className: clsx(classes.root, className, checked && classes.checked, disabled && classes.disabled),
14105
+ disabled: disabled,
14106
+ tabIndex: null,
14107
+ role: undefined,
14108
+ onFocus: handleFocus,
14109
+ onBlur: handleBlur,
14110
+ ref: ref
14111
+ }, other), /*#__PURE__*/react.exports.createElement("input", _extends$4({
14112
+ autoFocus: autoFocus,
14113
+ checked: checkedProp,
14114
+ defaultChecked: defaultChecked,
14115
+ className: classes.input,
14116
+ disabled: disabled,
14117
+ id: hasLabelFor && id,
14118
+ name: name,
14119
+ onChange: handleInputChange,
14120
+ readOnly: readOnly,
14121
+ ref: inputRef,
14122
+ required: required,
14123
+ tabIndex: tabIndex,
14124
+ type: type,
14125
+ value: value
14126
+ }, inputProps)), checked ? checkedIcon : icon);
14127
+ }); // NB: If changed, please update Checkbox, Switch and Radio
14128
+ var SwitchBase$1 = withStyles(styles$j, {
14129
+ name: 'PrivateSwitchBase'
14130
+ })(SwitchBase);
14131
+
14132
+ /**
14133
+ * @ignore - internal component.
14134
+ */
14135
+
14136
+ var CheckBoxOutlineBlankIcon = createSvgIcon( /*#__PURE__*/react.exports.createElement("path", {
14137
+ d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
14138
+ }));
14139
+
14140
+ /**
14141
+ * @ignore - internal component.
14142
+ */
14143
+
14144
+ var CheckBoxIcon = createSvgIcon( /*#__PURE__*/react.exports.createElement("path", {
14145
+ d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
14146
+ }));
14147
+
14148
+ /**
14149
+ * @ignore - internal component.
14150
+ */
14151
+
14152
+ var IndeterminateCheckBoxIcon = createSvgIcon( /*#__PURE__*/react.exports.createElement("path", {
14153
+ d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
14154
+ }));
14155
+
14156
+ var styles$i = function styles(theme) {
14157
+ return {
14158
+ /* Styles applied to the root element. */
14159
+ root: {
14160
+ color: theme.palette.text.secondary
14161
+ },
14162
+
14163
+ /* Pseudo-class applied to the root element if `checked={true}`. */
14164
+ checked: {},
14165
+
14166
+ /* Pseudo-class applied to the root element if `disabled={true}`. */
14167
+ disabled: {},
14168
+
14169
+ /* Pseudo-class applied to the root element if `indeterminate={true}`. */
14170
+ indeterminate: {},
14171
+
14172
+ /* Styles applied to the root element if `color="primary"`. */
14173
+ colorPrimary: {
14174
+ '&$checked': {
14175
+ color: theme.palette.primary.main,
14176
+ '&:hover': {
14177
+ backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity),
14178
+ // Reset on touch devices, it doesn't add specificity
14179
+ '@media (hover: none)': {
14180
+ backgroundColor: 'transparent'
14181
+ }
14182
+ }
14183
+ },
14184
+ '&$disabled': {
14185
+ color: theme.palette.action.disabled
14186
+ }
14187
+ },
14188
+
14189
+ /* Styles applied to the root element if `color="secondary"`. */
14190
+ colorSecondary: {
14191
+ '&$checked': {
14192
+ color: theme.palette.secondary.main,
14193
+ '&:hover': {
14194
+ backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity),
14195
+ // Reset on touch devices, it doesn't add specificity
14196
+ '@media (hover: none)': {
14197
+ backgroundColor: 'transparent'
14198
+ }
14199
+ }
14200
+ },
14201
+ '&$disabled': {
14202
+ color: theme.palette.action.disabled
14203
+ }
14204
+ }
14205
+ };
14206
+ };
14207
+ var defaultCheckedIcon = /*#__PURE__*/react.exports.createElement(CheckBoxIcon, null);
14208
+ var defaultIcon = /*#__PURE__*/react.exports.createElement(CheckBoxOutlineBlankIcon, null);
14209
+ var defaultIndeterminateIcon = /*#__PURE__*/react.exports.createElement(IndeterminateCheckBoxIcon, null);
14210
+ var Checkbox = /*#__PURE__*/react.exports.forwardRef(function Checkbox(props, ref) {
14211
+ var _props$checkedIcon = props.checkedIcon,
14212
+ checkedIcon = _props$checkedIcon === void 0 ? defaultCheckedIcon : _props$checkedIcon,
14213
+ classes = props.classes,
14214
+ _props$color = props.color,
14215
+ color = _props$color === void 0 ? 'secondary' : _props$color,
14216
+ _props$icon = props.icon,
14217
+ iconProp = _props$icon === void 0 ? defaultIcon : _props$icon,
14218
+ _props$indeterminate = props.indeterminate,
14219
+ indeterminate = _props$indeterminate === void 0 ? false : _props$indeterminate,
14220
+ _props$indeterminateI = props.indeterminateIcon,
14221
+ indeterminateIconProp = _props$indeterminateI === void 0 ? defaultIndeterminateIcon : _props$indeterminateI,
14222
+ inputProps = props.inputProps,
14223
+ _props$size = props.size,
14224
+ size = _props$size === void 0 ? 'medium' : _props$size,
14225
+ other = _objectWithoutProperties(props, ["checkedIcon", "classes", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size"]);
14226
+
14227
+ var icon = indeterminate ? indeterminateIconProp : iconProp;
14228
+ var indeterminateIcon = indeterminate ? indeterminateIconProp : checkedIcon;
14229
+ return /*#__PURE__*/react.exports.createElement(SwitchBase$1, _extends$4({
14230
+ type: "checkbox",
14231
+ classes: {
14232
+ root: clsx(classes.root, classes["color".concat(capitalize(color))], indeterminate && classes.indeterminate),
14233
+ checked: classes.checked,
14234
+ disabled: classes.disabled
14235
+ },
14236
+ color: color,
14237
+ inputProps: _extends$4({
14238
+ 'data-indeterminate': indeterminate
14239
+ }, inputProps),
14240
+ icon: /*#__PURE__*/react.exports.cloneElement(icon, {
14241
+ fontSize: icon.props.fontSize === undefined && size === "small" ? size : icon.props.fontSize
14242
+ }),
14243
+ checkedIcon: /*#__PURE__*/react.exports.cloneElement(indeterminateIcon, {
14244
+ fontSize: indeterminateIcon.props.fontSize === undefined && size === "small" ? size : indeterminateIcon.props.fontSize
14245
+ }),
14246
+ ref: ref
14247
+ }, other));
14248
+ });
14249
+ var Checkbox$1 = withStyles(styles$i, {
14250
+ name: 'MuiCheckbox'
14251
+ })(Checkbox);
14252
+
13874
14253
  var SIZE = 44;
13875
- var styles$g = function styles(theme) {
14254
+ var styles$h = function styles(theme) {
13876
14255
  return {
13877
14256
  /* Styles applied to the root element. */
13878
14257
  root: {
@@ -14032,7 +14411,7 @@
14032
14411
  strokeWidth: thickness
14033
14412
  })));
14034
14413
  });
14035
- var CircularProgress$1 = withStyles(styles$g, {
14414
+ var CircularProgress$1 = withStyles(styles$h, {
14036
14415
  name: 'MuiCircularProgress',
14037
14416
  flip: false
14038
14417
  })(CircularProgress);
@@ -14517,7 +14896,7 @@
14517
14896
  }));
14518
14897
  }
14519
14898
 
14520
- var styles$f = {
14899
+ var styles$g = {
14521
14900
  /* Styles applied to the root element. */
14522
14901
  root: {
14523
14902
  zIndex: -1,
@@ -14549,7 +14928,7 @@
14549
14928
  "aria-hidden": true,
14550
14929
  ref: ref
14551
14930
  }, other, {
14552
- style: _extends$4({}, styles$f.root, invisible ? styles$f.invisible : {}, other.style)
14931
+ style: _extends$4({}, styles$g.root, invisible ? styles$g.invisible : {}, other.style)
14553
14932
  })) : null;
14554
14933
  });
14555
14934
  var SimpleBackdrop$1 = SimpleBackdrop;
@@ -14566,7 +14945,7 @@
14566
14945
 
14567
14946
 
14568
14947
  var defaultManager = new ModalManager();
14569
- var styles$e = function styles(theme) {
14948
+ var styles$f = function styles(theme) {
14570
14949
  return {
14571
14950
  /* Styles applied to the root element. */
14572
14951
  root: {
@@ -14767,7 +15146,7 @@
14767
15146
  }
14768
15147
  };
14769
15148
 
14770
- var inlineStyle = styles$e(theme || {
15149
+ var inlineStyle = styles$f(theme || {
14771
15150
  zIndex: zIndex$1
14772
15151
  });
14773
15152
  var childProps = {};
@@ -14806,7 +15185,7 @@
14806
15185
  });
14807
15186
  var Modal$1 = Modal;
14808
15187
 
14809
- var styles$d = function styles(theme) {
15188
+ var styles$e = function styles(theme) {
14810
15189
  return {
14811
15190
  /* Styles applied to the root element. */
14812
15191
  root: {
@@ -14880,7 +15259,7 @@
14880
15259
  ref: ref
14881
15260
  }, other));
14882
15261
  });
14883
- var Divider$1 = withStyles(styles$d, {
15262
+ var Divider$1 = withStyles(styles$e, {
14884
15263
  name: 'MuiDivider'
14885
15264
  })(Divider);
14886
15265
 
@@ -14906,7 +15285,7 @@
14906
15285
  }
14907
15286
 
14908
15287
  var useEnhancedEffect$3 = typeof window !== 'undefined' ? react.exports.useLayoutEffect : react.exports.useEffect;
14909
- var styles$c = {
15288
+ var styles$d = {
14910
15289
  /* Styles applied to the shadow textarea element. */
14911
15290
  shadow: {
14912
15291
  // Visibility needed to hide the extra text area on iPads
@@ -15048,7 +15427,7 @@
15048
15427
  readOnly: true,
15049
15428
  ref: shadowRef,
15050
15429
  tabIndex: -1,
15051
- style: _extends$4({}, styles$c.shadow, style)
15430
+ style: _extends$4({}, styles$d.shadow, style)
15052
15431
  }));
15053
15432
  });
15054
15433
  var TextareaAutosize$1 = TextareaAutosize;
@@ -15074,7 +15453,7 @@
15074
15453
  return obj && (hasValue(obj.value) && obj.value !== '' || SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '');
15075
15454
  } // Determine if an Input is adorned on start.
15076
15455
 
15077
- var styles$b = function styles(theme) {
15456
+ var styles$c = function styles(theme) {
15078
15457
  var light = theme.palette.type === 'light';
15079
15458
  var placeholder = {
15080
15459
  color: 'currentColor',
@@ -15310,7 +15689,7 @@
15310
15689
  focused = _React$useState[0],
15311
15690
  setFocused = _React$useState[1];
15312
15691
 
15313
- var muiFormControl = useFormControl();
15692
+ var muiFormControl = useFormControl$1();
15314
15693
 
15315
15694
  var fcs = formControlState({
15316
15695
  props: props,
@@ -15506,10 +15885,110 @@
15506
15885
  startAdornment: startAdornment
15507
15886
  })) : null);
15508
15887
  });
15509
- var InputBase$1 = withStyles(styles$b, {
15888
+ var InputBase$1 = withStyles(styles$c, {
15510
15889
  name: 'MuiInputBase'
15511
15890
  })(InputBase);
15512
15891
 
15892
+ var styles$b = function styles(theme) {
15893
+ return {
15894
+ /* Styles applied to the root element. */
15895
+ root: {
15896
+ display: 'inline-flex',
15897
+ alignItems: 'center',
15898
+ cursor: 'pointer',
15899
+ // For correct alignment with the text.
15900
+ verticalAlign: 'middle',
15901
+ WebkitTapHighlightColor: 'transparent',
15902
+ marginLeft: -11,
15903
+ marginRight: 16,
15904
+ // used for row presentation of radio/checkbox
15905
+ '&$disabled': {
15906
+ cursor: 'default'
15907
+ }
15908
+ },
15909
+
15910
+ /* Styles applied to the root element if `labelPlacement="start"`. */
15911
+ labelPlacementStart: {
15912
+ flexDirection: 'row-reverse',
15913
+ marginLeft: 16,
15914
+ // used for row presentation of radio/checkbox
15915
+ marginRight: -11
15916
+ },
15917
+
15918
+ /* Styles applied to the root element if `labelPlacement="top"`. */
15919
+ labelPlacementTop: {
15920
+ flexDirection: 'column-reverse',
15921
+ marginLeft: 16
15922
+ },
15923
+
15924
+ /* Styles applied to the root element if `labelPlacement="bottom"`. */
15925
+ labelPlacementBottom: {
15926
+ flexDirection: 'column',
15927
+ marginLeft: 16
15928
+ },
15929
+
15930
+ /* Pseudo-class applied to the root element if `disabled={true}`. */
15931
+ disabled: {},
15932
+
15933
+ /* Styles applied to the label's Typography component. */
15934
+ label: {
15935
+ '&$disabled': {
15936
+ color: theme.palette.text.disabled
15937
+ }
15938
+ }
15939
+ };
15940
+ };
15941
+ /**
15942
+ * Drop in replacement of the `Radio`, `Switch` and `Checkbox` component.
15943
+ * Use this component if you want to display an extra label.
15944
+ */
15945
+
15946
+ var FormControlLabel = /*#__PURE__*/react.exports.forwardRef(function FormControlLabel(props, ref) {
15947
+ props.checked;
15948
+ var classes = props.classes,
15949
+ className = props.className,
15950
+ control = props.control,
15951
+ disabledProp = props.disabled;
15952
+ props.inputRef;
15953
+ var label = props.label,
15954
+ _props$labelPlacement = props.labelPlacement,
15955
+ labelPlacement = _props$labelPlacement === void 0 ? 'end' : _props$labelPlacement;
15956
+ props.name;
15957
+ props.onChange;
15958
+ props.value;
15959
+ var other = _objectWithoutProperties(props, ["checked", "classes", "className", "control", "disabled", "inputRef", "label", "labelPlacement", "name", "onChange", "value"]);
15960
+
15961
+ var muiFormControl = useFormControl();
15962
+ var disabled = disabledProp;
15963
+
15964
+ if (typeof disabled === 'undefined' && typeof control.props.disabled !== 'undefined') {
15965
+ disabled = control.props.disabled;
15966
+ }
15967
+
15968
+ if (typeof disabled === 'undefined' && muiFormControl) {
15969
+ disabled = muiFormControl.disabled;
15970
+ }
15971
+
15972
+ var controlProps = {
15973
+ disabled: disabled
15974
+ };
15975
+ ['checked', 'name', 'onChange', 'value', 'inputRef'].forEach(function (key) {
15976
+ if (typeof control.props[key] === 'undefined' && typeof props[key] !== 'undefined') {
15977
+ controlProps[key] = props[key];
15978
+ }
15979
+ });
15980
+ return /*#__PURE__*/react.exports.createElement("label", _extends$4({
15981
+ className: clsx(classes.root, className, labelPlacement !== 'end' && classes["labelPlacement".concat(capitalize(labelPlacement))], disabled && classes.disabled),
15982
+ ref: ref
15983
+ }, other), /*#__PURE__*/react.exports.cloneElement(control, controlProps), /*#__PURE__*/react.exports.createElement(Typography$1, {
15984
+ component: "span",
15985
+ className: clsx(classes.label, disabled && classes.disabled)
15986
+ }, label));
15987
+ });
15988
+ var FormControlLabel$1 = withStyles(styles$b, {
15989
+ name: 'MuiFormControlLabel'
15990
+ })(FormControlLabel);
15991
+
15513
15992
  var SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
15514
15993
  var GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
15515
15994
 
@@ -16064,7 +16543,7 @@
16064
16543
  variantProp = props.variant,
16065
16544
  other = _objectWithoutProperties(props, ["children", "classes", "className", "component", "disablePointerEvents", "disableTypography", "position", "variant"]);
16066
16545
 
16067
- var muiFormControl = useFormControl() || {};
16546
+ var muiFormControl = useFormControl$1() || {};
16068
16547
  var variant = variantProp;
16069
16548
 
16070
16549
  if (variantProp && muiFormControl.variant) ;
@@ -18468,6 +18947,7 @@
18468
18947
  selections,
18469
18948
  pages = [],
18470
18949
  rangeSelect = true,
18950
+ checkboxes = false,
18471
18951
  doc = document
18472
18952
  } = _ref;
18473
18953
  const [instantPages, setInstantPages] = react.exports.useState(pages);
@@ -18506,6 +18986,14 @@
18506
18986
  });
18507
18987
  };
18508
18988
 
18989
+ const onClick = react.exports.useCallback(event => {
18990
+ if (selectingValues) {
18991
+ return;
18992
+ }
18993
+
18994
+ const elemNumber = +event.currentTarget.getAttribute('data-n');
18995
+ setPreSelected([elemNumber]);
18996
+ }, [selectingValues]);
18509
18997
  const onMouseDown = react.exports.useCallback(event => {
18510
18998
  if (selectingValues) {
18511
18999
  return;
@@ -18567,7 +19055,7 @@
18567
19055
  setSelected(alreadySelected);
18568
19056
  }, [pages]);
18569
19057
  react.exports.useEffect(() => {
18570
- if (selectingValues || !pages || !mouseDown) {
19058
+ if (selectingValues || !pages || !checkboxes && !mouseDown) {
18571
19059
  return;
18572
19060
  } // Render pre-selections before they have been selected in Engine.
18573
19061
 
@@ -18575,15 +19063,28 @@
18575
19063
  const newPages = applySelectionsOnPages(pages, preSelected);
18576
19064
  setInstantPages(newPages);
18577
19065
  }, [preSelected]);
18578
- const rangeSelectEvents = rangeSelect ? {
18579
- onMouseUp,
18580
- onMouseEnter
18581
- } : {};
19066
+ const interactionEvents = {};
19067
+
19068
+ if (checkboxes) {
19069
+ Object.assign(interactionEvents, {
19070
+ onClick
19071
+ });
19072
+ } else if (rangeSelect) {
19073
+ Object.assign(interactionEvents, {
19074
+ onMouseUp,
19075
+ onMouseDown,
19076
+ onMouseEnter
19077
+ });
19078
+ } else {
19079
+ Object.assign(interactionEvents, {
19080
+ onMouseUp,
19081
+ onMouseDown
19082
+ });
19083
+ }
19084
+
18582
19085
  return {
18583
19086
  instantPages,
18584
- interactionEvents: _objectSpread2({
18585
- onMouseDown
18586
- }, rangeSelectEvents)
19087
+ interactionEvents
18587
19088
  };
18588
19089
  }
18589
19090
 
@@ -18598,187 +19099,196 @@
18598
19099
 
18599
19100
  var Tick = (props => SvgIcon(tick(props)));
18600
19101
 
19102
+ const CheckboxChecked = "url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath" + " fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 " + "1.003 0 00-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0012 5z' fill='%23fff'/%3E%3C/svg%3E\")";
19103
+
18601
19104
  const useStyles$b = makeStyles$1(theme => ({
18602
- row: {
18603
- flexWrap: 'nowrap',
18604
- borderBottom: "1px solid ".concat(theme.palette.divider),
18605
- '&:focus': {
18606
- boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusOutline),
18607
- outline: 'none'
18608
- }
18609
- },
18610
- cell: {
18611
- padding: '8px',
18612
- '& span': {
18613
- whiteSpace: 'nowrap',
18614
- fontSize: '12px',
18615
- lineHeight: '16px',
18616
- userSelect: 'none'
18617
- },
18618
- overflow: 'hidden',
18619
- textOverflow: 'ellipsis'
19105
+ cbIcon: {
19106
+ borderRadius: 3,
19107
+ width: 16,
19108
+ height: 16,
19109
+ boxShadow: 'inset 0 0 0 1px rgba(16,22,26,.2), inset 0 -1px 0 rgba(16,22,26,.1)',
19110
+ backgroundColor: '#f5f8fa',
19111
+ backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))'
18620
19112
  },
18621
- icon: {
18622
- padding: theme.spacing(1)
18623
- },
18624
- S: {
18625
- background: theme.palette.selected.main,
18626
- color: theme.palette.selected.mainContrastText,
18627
- '&:focus': {
18628
- boxShadow: "inset 0 0 0 2px rgba(0, 0, 0, 0.3)",
18629
- outline: 'none'
19113
+ cbIconChecked: {
19114
+ borderRadius: 3,
19115
+ backgroundColor: theme.palette.selected.main,
19116
+ backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',
19117
+ '&:before': {
19118
+ display: 'block',
19119
+ width: 16,
19120
+ height: 16,
19121
+ backgroundImage: CheckboxChecked,
19122
+ content: '""'
18630
19123
  }
18631
19124
  },
18632
- A: {
18633
- background: theme.palette.selected.alternative,
18634
- color: theme.palette.selected.alternativeContrastText
18635
- },
18636
- X: {
18637
- background: theme.palette.selected.excluded,
18638
- color: theme.palette.selected.excludedContrastText
19125
+ checkbox: {
19126
+ margin: 0,
19127
+ '&:hover': {
19128
+ backgroundColor: 'inherit !important'
19129
+ }
18639
19130
  },
18640
- highlighted: {
18641
- backgroundColor: '#FFC72A'
19131
+ dense: {
19132
+ padding: '4px 8px'
18642
19133
  }
18643
19134
  }));
18644
- function Row(_ref) {
19135
+ function ListboxCheckbox(_ref) {
18645
19136
  let {
18646
- index,
18647
- style,
18648
- data
19137
+ checked,
19138
+ label,
19139
+ dense
18649
19140
  } = _ref;
18650
- const classes = useStyles$b();
18651
- const classArr = [classes.row];
18652
- let label = '';
18653
- const {
18654
- onMouseDown,
18655
- onMouseUp,
18656
- onMouseEnter,
18657
- pages
18658
- } = data;
18659
- let cell;
18660
-
18661
- if (pages) {
18662
- const page = pages.filter(p => p.qArea.qTop <= index && index < p.qArea.qTop + p.qArea.qHeight)[0];
18663
-
18664
- if (page) {
18665
- const area = page.qArea;
18666
-
18667
- if (index >= area.qTop && index < area.qTop + area.qHeight) {
18668
- [cell] = page.qMatrix[index - area.qTop];
18669
- }
18670
- }
18671
- }
19141
+ const styles = useStyles$b();
19142
+ return /*#__PURE__*/React.createElement(Checkbox$1, {
19143
+ edge: "start",
19144
+ checked: checked,
19145
+ tabIndex: -1,
19146
+ disableRipple: true,
19147
+ className: [styles.checkbox, dense && styles.dense].filter(Boolean).join(' '),
19148
+ inputProps: {
19149
+ 'aria-labelledby': label
19150
+ },
19151
+ name: label,
19152
+ icon: /*#__PURE__*/React.createElement("span", {
19153
+ className: styles.cbIcon
19154
+ }),
19155
+ checkedIcon: /*#__PURE__*/React.createElement("span", {
19156
+ className: styles.cbIconChecked
19157
+ })
19158
+ });
19159
+ }
18672
19160
 
18673
- let locked = false;
18674
- let selected = false;
19161
+ /**
19162
+ * @typedef {object} Range
19163
+ * @property {number} qCharPos The (absolute) index where the highlighted range starts.
19164
+ * @property {number} qCharCount The length of the sub-string (starting from qChartPos) that should be highlighted.
19165
+ */
18675
19166
 
18676
- if (cell) {
18677
- label = cell.qText;
18678
- locked = cell.qState === 'L' || cell.qState === 'XL';
18679
- selected = cell.qState === 'S' || cell.qState === 'XS';
19167
+ /**
19168
+ * @typedef {object} Segment
19169
+ * @property {string} segment The sub-string/segment cut out from the original label.
19170
+ * @property {boolean} highlighted A flag which tells whether the segment should be highlighted or not.
19171
+ */
18680
19172
 
18681
- if (cell.qState === 'S' || cell.qState === 'L') {
18682
- classArr.push(classes.S);
18683
- } else if (cell.qState === 'A') {
18684
- classArr.push(classes.A);
18685
- } else if (cell.qState === 'X' || cell.qState === 'XS' || cell.qState === 'XL') {
18686
- classArr.push(classes.X);
18687
- }
18688
- } // Handle search highlights
19173
+ /**
19174
+ * @param {string} label The label we want to create segments out of.
19175
+ * @param {Range} range The indexes which define how to create the segments.
19176
+ * @param {number=} [startIndex] An optional index which tells where we want to start the first segment from
19177
+ * (only relevant for creating the first unhighlighted segment of a string/sub-string).
19178
+ * @returns {Segment[]} An array of segments.
19179
+ */
19180
+ function getSegmentsFromRange(label, range) {
19181
+ let startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
19182
+ const {
19183
+ qCharPos,
19184
+ qCharCount
19185
+ } = range;
19186
+ const segments = [];
18689
19187
 
19188
+ if (qCharPos > startIndex) {
19189
+ // Create a non-highlighted section before the highighted section.
19190
+ segments.push([label.slice(startIndex, qCharPos), false]);
19191
+ } // Highlighted segment.
18690
19192
 
18691
- const ranges = cell && cell.qHighlightRanges && cell.qHighlightRanges.qRanges.sort((a, b) => a.qCharPos - b.qCharPos) || [];
18692
- const labels = ranges.reduce((acc, curr, ix) => {
18693
- // First non highlighted segment
18694
- if (curr.qCharPos > 0 && ix === 0) {
18695
- acc.push([label.slice(0, curr.qCharPos)]);
18696
- } // Previous non highlighted segment
18697
19193
 
19194
+ segments.push([label.slice(qCharPos, qCharPos + qCharCount), true]);
19195
+ return segments;
19196
+ }
19197
+ /**
19198
+ * @param {string} label The label we want to create segments out of.
19199
+ * @param {Range[]} ranges The ranges defining indices for cutting the string into segments.
19200
+ * @returns {Segment[]} An array of segments, covering the entire string label.
19201
+ */
18698
19202
 
18699
- const prev = ranges[ix - 1];
18700
19203
 
18701
- if (prev) {
18702
- acc.push([label.slice(prev.qCharPos + prev.qCharPos + 1, curr.qCharPos)]);
18703
- } // Highlighted segment
19204
+ function getSegmentsFromRanges(label, ranges) {
19205
+ if (!ranges.length) {
19206
+ return [];
19207
+ }
18704
19208
 
19209
+ const labels = ranges.reduce((acc, curr, ix) => {
19210
+ const startIndex = ix === 0 ? 0 : ranges[ix - 1].qCharPos + ranges[ix - 1].qCharCount;
19211
+ acc.push(...getSegmentsFromRange(label, curr, startIndex)); // Last non highlighted segment
18705
19212
 
18706
- acc.push([label.slice(curr.qCharPos, curr.qCharPos + curr.qCharCount), classes.highlighted]); // Last non highlighted segment
19213
+ const isLastRange = ix === ranges.length - 1;
19214
+ const endIndex = ranges[ix].qCharPos + ranges[ix].qCharCount;
18707
19215
 
18708
- if (ix === ranges.length - 1 && curr.qCharPos + curr.qCharCount < label.length) {
18709
- acc.push([label.slice(curr.qCharPos + curr.qCharCount)]);
19216
+ if (isLastRange && endIndex < label.length) {
19217
+ acc.push([label.slice(endIndex), false]);
18710
19218
  }
18711
19219
 
18712
19220
  return acc;
18713
19221
  }, []);
18714
- return /*#__PURE__*/React.createElement(Grid$1, {
18715
- container: true,
18716
- spacing: 0,
18717
- className: classArr.join(' ').trim(),
18718
- style: style,
18719
- onMouseDown: onMouseDown,
18720
- onMouseUp: onMouseUp,
18721
- onMouseEnter: onMouseEnter,
18722
- role: "row",
18723
- tabIndex: 0,
18724
- "data-n": cell && cell.qElemNumber
18725
- }, /*#__PURE__*/React.createElement(Grid$1, {
18726
- item: true,
18727
- style: {
18728
- minWidth: 0,
18729
- flexGrow: 1
18730
- },
18731
- className: classes.cell,
18732
- title: "".concat(label)
18733
- }, ranges.length === 0 ? /*#__PURE__*/React.createElement(Typography$1, {
18734
- component: "span",
18735
- noWrap: true,
18736
- color: "inherit"
18737
- }, "".concat(label)) : labels.map((_ref2, ix) => {
18738
- let [l, highlighted] = _ref2;
18739
- return (
18740
- /*#__PURE__*/
18741
- // eslint-disable-next-line react/no-array-index-key
18742
- React.createElement(Typography$1, {
18743
- component: "span",
18744
- key: ix,
18745
- className: highlighted,
18746
- noWrap: true
18747
- }, l)
18748
- );
18749
- })), /*#__PURE__*/React.createElement(Grid$1, {
18750
- item: true,
18751
- className: classes.icon
18752
- }, locked && /*#__PURE__*/React.createElement(Lock, {
18753
- size: "small"
18754
- }), selected && /*#__PURE__*/React.createElement(Tick, {
18755
- size: "small"
18756
- })));
19222
+ return labels;
18757
19223
  }
18758
19224
 
19225
+ const ellipsis = {
19226
+ width: '100%',
19227
+ overflow: 'hidden',
19228
+ textOverflow: 'ellipsis'
19229
+ };
18759
19230
  const useStyles$a = makeStyles$1(theme => ({
19231
+ row: {
19232
+ flexWrap: 'nowrap',
19233
+ borderBottom: "1px solid ".concat(theme.palette.divider),
19234
+ color: theme.palette.text.primary,
19235
+ '&:focus': {
19236
+ boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusOutline),
19237
+ outline: 'none'
19238
+ }
19239
+ },
18760
19240
  column: {
18761
19241
  flexWrap: 'nowrap',
18762
19242
  borderRight: "1px solid ".concat(theme.palette.divider),
19243
+ color: theme.palette.text.primary,
18763
19244
  '&:focus': {
18764
19245
  boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusOutline),
18765
19246
  outline: 'none'
18766
19247
  }
18767
19248
  },
19249
+ // The interior wrapper for all field content.
18768
19250
  cell: {
18769
- padding: '8px',
18770
- '& span': {
18771
- whiteSpace: 'nowrap',
18772
- fontSize: '12px',
18773
- lineHeight: '16px',
18774
- userSelect: 'none'
18775
- },
18776
- overflow: 'hidden',
18777
- textOverflow: 'ellipsis'
19251
+ display: 'flex',
19252
+ alignItems: 'center',
19253
+ minWidth: 0,
19254
+ flexGrow: 1,
19255
+ // Note that this padding is overridden when using checkboxes.
19256
+ paddingLeft: '12px',
19257
+ paddingRight: '12px'
19258
+ },
19259
+ // The leaf node, containing the label text.
19260
+ labelText: _objectSpread2({
19261
+ flexBasis: 'max-content',
19262
+ lineHeight: '16px',
19263
+ userSelect: 'none',
19264
+ whiteSpace: 'pre'
19265
+ }, ellipsis),
19266
+ labelDense: {
19267
+ fontSize: 12
19268
+ },
19269
+ // Highlight is added to labelText spans, which are created as siblings to original labelText,
19270
+ // when a search string is matched.
19271
+ highlighted: {
19272
+ overflow: 'visible',
19273
+ width: '100%',
19274
+ '& > span': {
19275
+ width: '100%',
19276
+ backgroundColor: '#FFC72A'
19277
+ }
19278
+ },
19279
+ // Checkbox and label container.
19280
+ checkboxLabel: {
19281
+ margin: 0,
19282
+ width: '100%',
19283
+ // For checkboxes the first child is the checkbox container, second is the label container.
19284
+ '& > span:nth-child(2)': _objectSpread2({}, ellipsis)
18778
19285
  },
19286
+ // The icons container holding tick and lock, shown inside fields.
18779
19287
  icon: {
19288
+ display: 'flex',
18780
19289
  padding: theme.spacing(1)
18781
19290
  },
19291
+ // Selection styles (S=Selected, A=Available, X=Excluded).
18782
19292
  S: {
18783
19293
  background: theme.palette.selected.main,
18784
19294
  color: theme.palette.selected.mainContrastText,
@@ -18794,128 +19304,206 @@
18794
19304
  X: {
18795
19305
  background: theme.palette.selected.excluded,
18796
19306
  color: theme.palette.selected.excludedContrastText
18797
- },
18798
- highlighted: {
18799
- backgroundColor: '#FFC72A'
18800
19307
  }
18801
19308
  }));
18802
- function Column(_ref) {
19309
+ function RowColumn(_ref) {
18803
19310
  let {
18804
19311
  index,
18805
19312
  style,
18806
- data
19313
+ data,
19314
+ column = false
18807
19315
  } = _ref;
18808
- const classes = useStyles$a();
18809
- const classArr = [classes.column];
18810
- let label = '';
18811
19316
  const {
19317
+ onClick,
18812
19318
  onMouseDown,
18813
19319
  onMouseUp,
18814
19320
  onMouseEnter,
18815
- pages
19321
+ pages,
19322
+ isLocked,
19323
+ checkboxes = false,
19324
+ dense = false
18816
19325
  } = data;
18817
- let cell;
19326
+ const [isSelected, setSelected] = react.exports.useState(false);
19327
+ const [cell, setCell] = react.exports.useState();
19328
+ const classes = useStyles$a();
19329
+ const [classArr, setClassArr] = react.exports.useState([]);
19330
+ react.exports.useEffect(() => {
19331
+ if (!pages) {
19332
+ return;
19333
+ }
18818
19334
 
18819
- if (pages) {
19335
+ let c;
18820
19336
  const page = pages.filter(p => p.qArea.qTop <= index && index < p.qArea.qTop + p.qArea.qHeight)[0];
18821
19337
 
18822
19338
  if (page) {
18823
19339
  const area = page.qArea;
18824
19340
 
18825
19341
  if (index >= area.qTop && index < area.qTop + area.qHeight) {
18826
- [cell] = page.qMatrix[index - area.qTop];
19342
+ [c] = page.qMatrix[index - area.qTop];
18827
19343
  }
18828
19344
  }
18829
- }
18830
-
18831
- let locked = false;
18832
- let selected = false;
18833
19345
 
18834
- if (cell) {
18835
- label = cell.qText;
18836
- locked = cell.qState === 'L' || cell.qState === 'XL';
18837
- selected = cell.qState === 'S' || cell.qState === 'XS';
18838
-
18839
- if (cell.qState === 'S' || cell.qState === 'L') {
18840
- classArr.push(classes.S);
18841
- } else if (cell.qState === 'A') {
18842
- classArr.push(classes.A);
18843
- } else if (cell.qState === 'X' || cell.qState === 'XS' || cell.qState === 'XL') {
18844
- classArr.push(classes.X);
19346
+ setCell(c);
19347
+ }, [pages]);
19348
+ react.exports.useEffect(() => {
19349
+ if (!cell) {
19350
+ return;
18845
19351
  }
18846
- } // Handle search highlights
18847
19352
 
19353
+ const selected = cell.qState === 'S' || cell.qState === 'XS' || cell.qState === 'L';
19354
+ setSelected(selected);
19355
+ const clazzArr = [column ? classes.column : classes.row];
18848
19356
 
18849
- const ranges = cell && cell.qHighlightRanges && cell.qHighlightRanges.qRanges.sort((a, b) => a.qCharPos - b.qCharPos) || [];
18850
- const labels = ranges.reduce((acc, curr, ix) => {
18851
- // First non highlighted segment
18852
- if (curr.qCharPos > 0 && ix === 0) {
18853
- acc.push([label.slice(0, curr.qCharPos)]);
18854
- } // Previous non highlighted segment
19357
+ if (!checkboxes) {
19358
+ if (cell.qState === 'S' || cell.qState === 'L') {
19359
+ clazzArr.push(classes.S);
19360
+ } else if (cell.qState === 'A') {
19361
+ clazzArr.push(classes.A);
19362
+ } else if (cell.qState === 'X' || cell.qState === 'XS' || cell.qState === 'XL') {
19363
+ clazzArr.push(classes.X);
19364
+ }
19365
+ }
18855
19366
 
19367
+ setClassArr(clazzArr);
19368
+ }, [cell && cell.qState]);
18856
19369
 
18857
- const prev = ranges[ix - 1];
19370
+ const getValueField = _ref2 => {
19371
+ let {
19372
+ lbl,
19373
+ ix,
19374
+ color,
19375
+ highlighted = false
19376
+ } = _ref2;
19377
+ return /*#__PURE__*/React.createElement(Typography$1, {
19378
+ component: "span",
19379
+ variant: "body2",
19380
+ key: ix,
19381
+ className: [classes.labelText, highlighted && classes.highlighted, dense && classes.labelDense].filter(c => !!c).join(' ').trim(),
19382
+ color: color
19383
+ }, /*#__PURE__*/React.createElement("span", {
19384
+ style: {
19385
+ whiteSpace: 'pre'
19386
+ }
19387
+ }, lbl));
19388
+ };
18858
19389
 
18859
- if (prev) {
18860
- acc.push([label.slice(prev.qCharPos + prev.qCharPos + 1, curr.qCharPos)]);
18861
- } // Highlighted segment
19390
+ const getCheckboxField = _ref3 => {
19391
+ let {
19392
+ lbl,
19393
+ color,
19394
+ qElemNumber
19395
+ } = _ref3;
19396
+ const cb = /*#__PURE__*/React.createElement(ListboxCheckbox, {
19397
+ label: lbl,
19398
+ checked: isSelected,
19399
+ dense: dense
19400
+ });
19401
+ const labelTag = typeof lbl === 'string' ? getValueField({
19402
+ lbl,
19403
+ color,
19404
+ highlighted: false
19405
+ }) : lbl;
19406
+ return /*#__PURE__*/React.createElement(FormControlLabel$1, {
19407
+ color: color,
19408
+ control: cb,
19409
+ className: classes.checkboxLabel,
19410
+ label: labelTag,
19411
+ key: qElemNumber
19412
+ });
19413
+ };
18862
19414
 
19415
+ const label = cell ? cell.qText : ''; // Search highlights. Split up labelText span into several and add the highlighted class to matching sub-strings.
18863
19416
 
18864
- acc.push([label.slice(curr.qCharPos, curr.qCharPos + curr.qCharCount), classes.highlighted]); // Last non highlighted segment
19417
+ const ranges = cell && cell.qHighlightRanges && cell.qHighlightRanges.qRanges.sort((a, b) => a.qCharPos - b.qCharPos) || [];
19418
+ const labels = getSegmentsFromRanges(label, ranges);
19419
+ const getField = checkboxes ? getCheckboxField : getValueField;
18865
19420
 
18866
- if (ix === ranges.length - 1 && curr.qCharPos + curr.qCharCount < label.length) {
18867
- acc.push([label.slice(curr.qCharPos + curr.qCharCount)]);
18868
- }
19421
+ const getFieldWithRanges = _ref4 => {
19422
+ let {
19423
+ lbls
19424
+ } = _ref4;
19425
+ const labelsWithRanges = lbls.map((_ref5, ix) => {
19426
+ let [lbl, highlighted] = _ref5;
19427
+ return getValueField({
19428
+ ix,
19429
+ highlighted,
19430
+ lbl
19431
+ });
19432
+ });
19433
+ return checkboxes ? getCheckboxField({
19434
+ lbl: labelsWithRanges
19435
+ }) : labelsWithRanges;
19436
+ };
18869
19437
 
18870
- return acc;
18871
- }, []);
19438
+ const iconStyles = {
19439
+ alignItems: 'center',
19440
+ display: 'flex'
19441
+ };
19442
+ const showLock = isSelected && isLocked;
19443
+ const showTick = !checkboxes && isSelected && !isLocked;
19444
+ const cellStyle = {
19445
+ display: 'flex',
19446
+ alignItems: 'center',
19447
+ minWidth: 0,
19448
+ flexGrow: 1,
19449
+ padding: checkboxes ? 0 : undefined
19450
+ };
18872
19451
  return /*#__PURE__*/React.createElement(Grid$1, {
18873
19452
  container: true,
18874
19453
  spacing: 0,
18875
- className: classArr.join(' ').trim(),
19454
+ className: ['value', ...classArr].join(' ').trim(),
18876
19455
  style: style,
18877
- alignItems: "center",
19456
+ onClick: onClick,
18878
19457
  onMouseDown: onMouseDown,
18879
19458
  onMouseUp: onMouseUp,
18880
19459
  onMouseEnter: onMouseEnter,
18881
- role: "row",
19460
+ role: column ? 'column' : 'row',
18882
19461
  tabIndex: 0,
18883
19462
  "data-n": cell && cell.qElemNumber
18884
19463
  }, /*#__PURE__*/React.createElement(Grid$1, {
18885
19464
  item: true,
18886
- style: {
18887
- minWidth: 0,
18888
- flexGrow: 1
18889
- },
19465
+ style: cellStyle,
18890
19466
  className: classes.cell,
18891
19467
  title: "".concat(label)
18892
- }, ranges.length === 0 ? /*#__PURE__*/React.createElement(Typography$1, {
18893
- component: "span",
18894
- noWrap: true,
18895
- color: "inherit"
18896
- }, "".concat(label)) : labels.map((_ref2, ix) => {
18897
- let [l, highlighted] = _ref2;
18898
- return (
18899
- /*#__PURE__*/
18900
- // eslint-disable-next-line react/no-array-index-key
18901
- React.createElement(Typography$1, {
18902
- component: "span",
18903
- key: ix,
18904
- className: highlighted,
18905
- noWrap: true
18906
- }, l)
18907
- );
18908
- })), /*#__PURE__*/React.createElement(Grid$1, {
19468
+ }, ranges.length === 0 ? getField({
19469
+ lbl: label,
19470
+ color: 'inherit'
19471
+ }) : getFieldWithRanges({
19472
+ lbls: labels
19473
+ })), (showLock || showTick) && /*#__PURE__*/React.createElement(Grid$1, {
18909
19474
  item: true,
18910
19475
  className: classes.icon
18911
- }, locked && /*#__PURE__*/React.createElement(Lock, {
19476
+ }, showLock && /*#__PURE__*/React.createElement(Lock, {
19477
+ style: iconStyles,
18912
19478
  size: "small"
18913
- }), selected && /*#__PURE__*/React.createElement(Tick, {
19479
+ }), showTick && /*#__PURE__*/React.createElement(Tick, {
19480
+ style: iconStyles,
18914
19481
  size: "small"
18915
19482
  })));
18916
19483
  }
18917
19484
 
18918
- function ListBox(_ref) {
19485
+ function getSizeInfo(_ref) {
19486
+ let {
19487
+ isVertical,
19488
+ checkboxes,
19489
+ dense,
19490
+ height
19491
+ } = _ref;
19492
+ let sizeVertical = checkboxes ? 40 : 33;
19493
+
19494
+ if (dense) {
19495
+ sizeVertical = 24;
19496
+ }
19497
+
19498
+ const itemSize = isVertical ? sizeVertical : 200;
19499
+ const listHeight = height || 8 * itemSize;
19500
+ return {
19501
+ itemSize,
19502
+ listHeight
19503
+ };
19504
+ }
19505
+
19506
+ function ListBox(_ref2) {
18919
19507
  let {
18920
19508
  model,
18921
19509
  selections,
@@ -18924,8 +19512,10 @@
18924
19512
  width,
18925
19513
  listLayout = 'vertical',
18926
19514
  rangeSelect = true,
18927
- update = undefined
18928
- } = _ref;
19515
+ checkboxes = false,
19516
+ update = undefined,
19517
+ dense = false
19518
+ } = _ref2;
18929
19519
  const [layout] = useLayout$1(model);
18930
19520
  const [pages, setPages] = react.exports.useState(null);
18931
19521
  const [isLoadingData, setIsLoadingData] = react.exports.useState(false);
@@ -18937,6 +19527,7 @@
18937
19527
  selections,
18938
19528
  pages,
18939
19529
  rangeSelect,
19530
+ checkboxes,
18940
19531
  doc: document
18941
19532
  });
18942
19533
  const loaderRef = react.exports.useRef(null);
@@ -19028,8 +19619,16 @@
19028
19619
 
19029
19620
  const isVertical = listLayout !== 'horizontal';
19030
19621
  const count = layout.qListObject.qSize.qcy;
19031
- const ITEM_SIZE = isVertical ? 33 : 200;
19032
- const listHeight = height || 8 * ITEM_SIZE;
19622
+ const {
19623
+ itemSize,
19624
+ listHeight
19625
+ } = getSizeInfo({
19626
+ isVertical,
19627
+ checkboxes,
19628
+ dense,
19629
+ height
19630
+ });
19631
+ const isLocked = layout && layout.qListObject.qDimensionInfo.qLocked;
19033
19632
  return /*#__PURE__*/React.createElement(InfiniteLoader, {
19034
19633
  isItemLoaded: isItemLoaded,
19035
19634
  itemCount: count,
@@ -19037,11 +19636,11 @@
19037
19636
  threshold: 0,
19038
19637
  minimumBatchSize: 100,
19039
19638
  ref: loaderRef
19040
- }, _ref2 => {
19639
+ }, _ref3 => {
19041
19640
  let {
19042
19641
  onItemsRendered,
19043
19642
  ref
19044
- } = _ref2;
19643
+ } = _ref3;
19045
19644
  local.current.listRef = ref;
19046
19645
  return /*#__PURE__*/React.createElement(FixedSizeList, {
19047
19646
  direction: direction,
@@ -19052,13 +19651,18 @@
19052
19651
  width: width,
19053
19652
  itemCount: count,
19054
19653
  layout: listLayout,
19055
- itemData: _objectSpread2(_objectSpread2({}, interactionEvents), {}, {
19654
+ itemData: _objectSpread2(_objectSpread2({
19655
+ isLocked,
19656
+ column: !isVertical,
19056
19657
  pages
19658
+ }, isLocked ? {} : interactionEvents), {}, {
19659
+ checkboxes,
19660
+ dense
19057
19661
  }),
19058
- itemSize: ITEM_SIZE,
19662
+ itemSize: itemSize,
19059
19663
  onItemsRendered: onItemsRendered,
19060
19664
  ref: ref
19061
- }, isVertical ? Row : Column);
19665
+ }, RowColumn);
19062
19666
  });
19063
19667
  }
19064
19668
 
@@ -19633,13 +20237,22 @@
19633
20237
  borderRadius: 0,
19634
20238
  borderColor: "".concat(theme.palette.divider, " transparent")
19635
20239
  }
20240
+ },
20241
+ dense: {
20242
+ fontSize: 12,
20243
+ paddingLeft: theme.spacing(1),
20244
+ '& input': {
20245
+ paddingTop: '5px',
20246
+ paddingBottom: '5px'
20247
+ }
19636
20248
  }
19637
20249
  }));
19638
20250
  const TREE_PATH = '/qListObjectDef';
19639
20251
  function ListBoxSearch(_ref) {
19640
20252
  let {
19641
20253
  model,
19642
- autoFocus = true
20254
+ autoFocus = true,
20255
+ dense = false
19643
20256
  } = _ref;
19644
20257
  const {
19645
20258
  translator
@@ -19668,8 +20281,10 @@
19668
20281
  return /*#__PURE__*/React.createElement(OutlinedInput$1, {
19669
20282
  startAdornment: /*#__PURE__*/React.createElement(InputAdornment$1, {
19670
20283
  position: "start"
19671
- }, /*#__PURE__*/React.createElement(Search, null)),
19672
- className: [classes.root].join(' '),
20284
+ }, /*#__PURE__*/React.createElement(Search, {
20285
+ size: dense ? 'small' : 'normal'
20286
+ })),
20287
+ className: ['search', classes.root, dense && classes.dense].filter(Boolean).join(' '),
19673
20288
  autoFocus: autoFocus,
19674
20289
  margin: "dense",
19675
20290
  fullWidth: true,
@@ -21282,10 +21897,12 @@
21282
21897
  search = true,
21283
21898
  toolbar = true,
21284
21899
  rangeSelect = true,
21900
+ checkboxes = false,
21285
21901
  properties = {},
21286
21902
  sessionModel = undefined,
21287
21903
  selectionsApi = undefined,
21288
- update = undefined
21904
+ update = undefined,
21905
+ dense = false
21289
21906
  } = options;
21290
21907
 
21291
21908
  const listdef = _objectSpread2({
@@ -21436,7 +22053,8 @@
21436
22053
  item: true
21437
22054
  }, /*#__PURE__*/React.createElement(ListBoxSearch, {
21438
22055
  model: model,
21439
- autoFocus: false
22056
+ autoFocus: false,
22057
+ dense: dense
21440
22058
  })) : '', /*#__PURE__*/React.createElement(Grid$1, {
21441
22059
  item: true,
21442
22060
  xs: true
@@ -21453,9 +22071,11 @@
21453
22071
  direction: direction,
21454
22072
  listLayout: listLayout,
21455
22073
  rangeSelect: rangeSelect,
22074
+ checkboxes: checkboxes,
21456
22075
  height: height,
21457
22076
  width: width,
21458
- update: update
22077
+ update: update,
22078
+ dense: dense
21459
22079
  });
21460
22080
  })));
21461
22081
  }
@@ -25689,9 +26309,11 @@
25689
26309
  * @example
25690
26310
  * // configure embed to disallow active interactions when rendering
25691
26311
  * embed(app, {
25692
- * constraints: {
25693
- * active: true, // do not allow interactions
25694
- * }
26312
+ * context: {
26313
+ * constraints: {
26314
+ * active: true, // do not allow interactions
26315
+ * }
26316
+ * }
25695
26317
  * }).render({ element, id: 'sdfsdf' });
25696
26318
  *
25697
26319
  * @example
@@ -28753,8 +29375,11 @@
28753
29375
  * @param {string=} options.title Custom title, defaults to fieldname
28754
29376
  * @param {string=} [options.direction=ltr] Direction setting ltr|rtl.
28755
29377
  * @param {string=} [options.listLayout=vertical] Layout direction vertical|horizontal
28756
- * @param {boolean=} [options.search=true] To show the search bar
28757
- * @param {boolean=} [options.toolbar=true] To show the toolbar
29378
+ * @param {boolean=} [options.search=true] Show the search bar
29379
+ * @param {boolean=} [options.toolbar=true] Show the toolbar
29380
+ * @param {boolean=} [options.checkboxes=false] Show values as checkboxes instead of as fields
29381
+ * @param {boolean=} [options.rangeSelect=true] Enable range selection
29382
+ * @param {boolean=} [options.dense=false] Reduces padding and text size
28758
29383
  * @param {boolean=} [options.stateName="$"] Sets the state to make selections in
28759
29384
  * @param {object=} [options.properties={}] Properties object to extend default properties with
28760
29385
  * @param {object} [options.sessionModel] Use a custom sessionModel.
@@ -28848,7 +29473,9 @@
28848
29473
  * // create an alternate config with dark theme
28849
29474
  * // and inherit the config from the previous
28850
29475
  * const d = m.createConfiguration({
28851
- * theme: 'dark'
29476
+ * context: {
29477
+ * theme: 'dark'
29478
+ * }
28852
29479
  * });
28853
29480
  *
28854
29481
  * m(app).render({ type: 'mekko' }); // will render the object with default theme