cx 24.0.2 → 24.2.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.
Files changed (62) hide show
  1. package/dist/data.js +15 -26
  2. package/dist/manifest.js +525 -522
  3. package/dist/ui.js +1 -1
  4. package/dist/widgets.js +162 -77
  5. package/locale/de-de.js +6 -1
  6. package/locale/en-us.js +5 -1
  7. package/locale/es-es.js +6 -1
  8. package/locale/fr-fr.js +7 -2
  9. package/locale/nl-nl.js +4 -5
  10. package/locale/pt-pt.js +12 -1
  11. package/locale/sr-latn-ba.js +6 -2
  12. package/package.json +1 -1
  13. package/src/charts/ColorMap.js +4 -6
  14. package/src/charts/axis/Axis.d.ts +96 -96
  15. package/src/charts/axis/Axis.js +252 -252
  16. package/src/data/Expression.js +212 -212
  17. package/src/data/Expression.spec.js +174 -174
  18. package/src/data/StringTemplate.spec.js +105 -105
  19. package/src/data/StructuredSelector.d.ts +1 -1
  20. package/src/data/ops/updateTree.js +1 -1
  21. package/src/data/ops/updateTree.spec.js +16 -14
  22. package/src/ui/Controller.d.ts +182 -182
  23. package/src/ui/Culture.d.ts +0 -3
  24. package/src/ui/DataProxy.d.ts +1 -0
  25. package/src/ui/DataProxy.js +2 -2
  26. package/src/ui/FocusManager.js +171 -171
  27. package/src/ui/Format.js +87 -87
  28. package/src/ui/Instance.d.ts +72 -72
  29. package/src/ui/Localization.js +0 -2
  30. package/src/ui/Rescope.js +2 -2
  31. package/src/ui/Text.js +2 -4
  32. package/src/ui/adapter/DataAdapter.js +7 -12
  33. package/src/ui/adapter/GroupAdapter.d.ts +22 -3
  34. package/src/ui/adapter/TreeAdapter.d.ts +23 -3
  35. package/src/ui/keyboardShortcuts.js +4 -5
  36. package/src/ui/selection/KeySelection.d.ts +1 -1
  37. package/src/ui/selection/PropertySelection.d.ts +1 -1
  38. package/src/ui/selection/PropertySelection.js +2 -4
  39. package/src/ui/selection/Selection.d.ts +1 -1
  40. package/src/widgets/form/ColorField.js +14 -9
  41. package/src/widgets/form/ColorPicker.scss +275 -275
  42. package/src/widgets/form/ColorPicker.variables.scss +22 -22
  43. package/src/widgets/form/DateTimeField.d.ts +86 -86
  44. package/src/widgets/form/DateTimeField.js +573 -572
  45. package/src/widgets/form/Field.js +24 -9
  46. package/src/widgets/form/FieldIcon.js +42 -0
  47. package/src/widgets/form/Label.js +88 -88
  48. package/src/widgets/form/LookupField.d.ts +173 -174
  49. package/src/widgets/form/LookupField.js +1130 -1131
  50. package/src/widgets/form/MonthField.d.ts +37 -38
  51. package/src/widgets/form/MonthField.js +16 -15
  52. package/src/widgets/form/NumberField.d.ts +2 -2
  53. package/src/widgets/form/NumberField.js +13 -13
  54. package/src/widgets/form/Select.d.ts +31 -35
  55. package/src/widgets/form/Select.js +7 -12
  56. package/src/widgets/form/TextArea.js +10 -6
  57. package/src/widgets/form/TextField.d.ts +2 -2
  58. package/src/widgets/form/TextField.js +17 -14
  59. package/src/widgets/form/UploadButton.d.ts +34 -34
  60. package/src/widgets/form/index.js +1 -2
  61. package/src/widgets/grid/Grid.d.ts +5 -2
  62. package/src/widgets/overlay/Dropdown.d.ts +1 -0
package/dist/ui.js CHANGED
@@ -2895,7 +2895,7 @@ var subscribers$1,
2895
2895
  eventBan = 0;
2896
2896
  function executeKeyboardShortcuts(e) {
2897
2897
  if (Date.now() < eventBan) return;
2898
- //Avoid duplicate executions as event.stopPropagation() for React events does not stop native events
2898
+ // Avoid duplicate executions as event.stopPropagation() for React events does not stop native events
2899
2899
  eventBan = Date.now() + 5;
2900
2900
  subscribers$1 && subscribers$1.notify(e);
2901
2901
  }
package/dist/widgets.js CHANGED
@@ -6410,6 +6410,55 @@ Label.prototype.baseClass = "label";
6410
6410
  Label.prototype.tag = "label";
6411
6411
  Label.prototype.asterisk = false;
6412
6412
 
6413
+ var FieldIcon = /*#__PURE__*/ (function (_Widget) {
6414
+ _inheritsLoose(FieldIcon, _Widget);
6415
+ function FieldIcon() {
6416
+ return _Widget.apply(this, arguments) || this;
6417
+ }
6418
+ var _proto = FieldIcon.prototype;
6419
+ _proto.declareData = function declareData() {
6420
+ var _Widget$prototype$dec;
6421
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6422
+ args[_key] = arguments[_key];
6423
+ }
6424
+ (_Widget$prototype$dec = _Widget.prototype.declareData).call.apply(
6425
+ _Widget$prototype$dec,
6426
+ [this].concat(args, [
6427
+ {
6428
+ name: undefined,
6429
+ },
6430
+ ]),
6431
+ );
6432
+ };
6433
+ _proto.render = function render(context, instance, key) {
6434
+ var _this = this;
6435
+ var data = instance.data;
6436
+ if (!data.name) return null;
6437
+ var onClick, onMouseMove, onMouseLeave;
6438
+ if (this.onClick)
6439
+ onClick = function onClick(e) {
6440
+ instance.invoke("onClick", e, instance);
6441
+ };
6442
+ if (this.tooltip) {
6443
+ onMouseLeave = function onMouseLeave(e) {
6444
+ tooltipMouseLeave$1(e, instance, _this.tooltip);
6445
+ };
6446
+ onMouseMove = function onMouseMove(e) {
6447
+ tooltipMouseMove$1(e, instance, _this.tooltip);
6448
+ };
6449
+ }
6450
+ return Icon.render(data.name, {
6451
+ className: data.classNames,
6452
+ style: data.style,
6453
+ onClick: onClick,
6454
+ onMouseMove: onMouseMove,
6455
+ onMouseLeave: onMouseLeave,
6456
+ });
6457
+ };
6458
+ return FieldIcon;
6459
+ })(Widget);
6460
+ FieldIcon.prototype.styled = true;
6461
+
6413
6462
  var Field = /*#__PURE__*/ (function (_PureContainer) {
6414
6463
  _inheritsLoose(Field, _PureContainer);
6415
6464
  function Field() {
@@ -6451,6 +6500,11 @@ var Field = /*#__PURE__*/ (function (_PureContainer) {
6451
6500
  );
6452
6501
  };
6453
6502
  _proto.init = function init() {
6503
+ this.inputStyle = parseStyle(this.inputStyle);
6504
+ _PureContainer.prototype.init.call(this);
6505
+ };
6506
+ _proto.initComponents = function initComponents(context, instance) {
6507
+ var _PureContainer$protot2;
6454
6508
  if (this.validationMode == "tooltip" && isUndefined(this.errorTooltip)) {
6455
6509
  this.errorTooltip = _extends(
6456
6510
  {
@@ -6497,17 +6551,21 @@ var Field = /*#__PURE__*/ (function (_PureContainer) {
6497
6551
  else Object.assign(labelConfig, this.label);
6498
6552
  this.label = Label.create(labelConfig);
6499
6553
  }
6500
- this.inputStyle = parseStyle(this.inputStyle);
6501
- _PureContainer.prototype.init.call(this);
6502
- };
6503
- _proto.initComponents = function initComponents(context, instance) {
6504
- var _PureContainer$protot2;
6554
+ if (this.icon != null) {
6555
+ var iconConfig = {
6556
+ className: this.CSS.element(this.baseClass, "icon"),
6557
+ };
6558
+ if (isSelector(this.icon)) iconConfig.name = this.icon;
6559
+ else Object.assign(iconConfig, this.icon);
6560
+ this.icon = FieldIcon.create(iconConfig);
6561
+ }
6505
6562
  return (_PureContainer$protot2 = _PureContainer.prototype.initComponents).call.apply(
6506
6563
  _PureContainer$protot2,
6507
6564
  [this].concat(Array.prototype.slice.call(arguments), [
6508
6565
  {
6509
6566
  label: this.label,
6510
6567
  help: this.help,
6568
+ icon: this.icon,
6511
6569
  },
6512
6570
  ]),
6513
6571
  );
@@ -6694,6 +6752,9 @@ var Field = /*#__PURE__*/ (function (_PureContainer) {
6694
6752
  _proto.renderHelp = function renderHelp(context, instance, key) {
6695
6753
  if (instance.components.help) return getContent(instance.components.help.render(context, key));
6696
6754
  };
6755
+ _proto.renderIcon = function renderIcon(context, instance, key) {
6756
+ if (instance.components.icon) return getContent(instance.components.icon.render(context, key));
6757
+ };
6697
6758
  _proto.formatValue = function formatValue(context, _ref) {
6698
6759
  var data = _ref.data;
6699
6760
  return data.text || data.value;
@@ -6851,6 +6912,7 @@ var TextField = /*#__PURE__*/ (function (_Field) {
6851
6912
  data: instance.data,
6852
6913
  label: this.labelPlacement && getContent(this.renderLabel(context, instance, "label")),
6853
6914
  help: this.helpPlacement && getContent(this.renderHelp(context, instance, "help")),
6915
+ icon: this.renderIcon(context, instance, "icon"),
6854
6916
  },
6855
6917
  key,
6856
6918
  );
@@ -6899,23 +6961,22 @@ var Input$2 = /*#__PURE__*/ (function (_VDOM$Component) {
6899
6961
  instance = _this$props.instance,
6900
6962
  data = _this$props.data,
6901
6963
  label = _this$props.label,
6902
- help = _this$props.help;
6964
+ help = _this$props.help,
6965
+ iconVDOM = _this$props.icon;
6903
6966
  var widget = instance.widget,
6904
6967
  state = instance.state;
6905
6968
  var CSS = widget.CSS,
6906
6969
  baseClass = widget.baseClass,
6907
6970
  suppressErrorsUntilVisited = widget.suppressErrorsUntilVisited;
6908
6971
  var icon =
6909
- data.icon &&
6972
+ iconVDOM &&
6910
6973
  /*#__PURE__*/ jsx("div", {
6911
6974
  className: CSS.element(baseClass, "left-icon"),
6912
6975
  onMouseDown: preventDefault,
6913
6976
  onClick: function onClick(e) {
6914
- return _this2.onChange(e, "enter");
6977
+ return _this2.onChange(e.target.value, "enter");
6915
6978
  },
6916
- children: Icon.render(data.icon, {
6917
- className: CSS.element(baseClass, "icon"),
6918
- }),
6979
+ children: iconVDOM,
6919
6980
  });
6920
6981
  var insideButton;
6921
6982
  if (
@@ -6977,10 +7038,10 @@ var Input$2 = /*#__PURE__*/ (function (_VDOM$Component) {
6977
7038
  onMouseMove: this.onMouseMove.bind(this),
6978
7039
  onMouseLeave: this.onMouseLeave.bind(this),
6979
7040
  onInput: function onInput(e) {
6980
- return _this2.onChange(e, "input");
7041
+ return _this2.onChange(e.target.value, "input");
6981
7042
  },
6982
7043
  onChange: function onChange(e) {
6983
- return _this2.onChange(e, "change");
7044
+ return _this2.onChange(e.target.value, "change");
6984
7045
  },
6985
7046
  onKeyDown: this.onKeyDown.bind(this),
6986
7047
  onFocus: this.onFocus.bind(this),
@@ -7019,7 +7080,7 @@ var Input$2 = /*#__PURE__*/ (function (_VDOM$Component) {
7019
7080
  });
7020
7081
  this.props.instance.set("focused", false);
7021
7082
  }
7022
- this.onChange(e, "blur");
7083
+ this.onChange(e.target.value, "blur");
7023
7084
  };
7024
7085
  _proto2.onClearClick = function onClearClick(e) {
7025
7086
  this.props.instance.set("value", this.props.instance.widget.emptyValue, {
@@ -7040,6 +7101,7 @@ var Input$2 = /*#__PURE__*/ (function (_VDOM$Component) {
7040
7101
  autoFocus(this.input, this);
7041
7102
  };
7042
7103
  _proto2.componentWillUnmount = function componentWillUnmount() {
7104
+ if (this.input == getActiveElement()) this.onChange(this.input.value, "blur");
7043
7105
  tooltipParentWillUnmount$1(this.props.instance);
7044
7106
  };
7045
7107
  _proto2.onKeyDown = function onKeyDown(e) {
@@ -7047,7 +7109,7 @@ var Input$2 = /*#__PURE__*/ (function (_VDOM$Component) {
7047
7109
  if (instance.widget.handleKeyDown(e, instance) === false) return;
7048
7110
  switch (e.keyCode) {
7049
7111
  case KeyCode.enter:
7050
- this.onChange(e, "enter");
7112
+ this.onChange(e.target.value, "enter");
7051
7113
  break;
7052
7114
  case KeyCode.left:
7053
7115
  case KeyCode.right:
@@ -7057,12 +7119,12 @@ var Input$2 = /*#__PURE__*/ (function (_VDOM$Component) {
7057
7119
  };
7058
7120
  _proto2.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(props) {
7059
7121
  var data = props.data;
7060
- //the second check is required for debouncing, sometimes the value in the store lags after the input
7061
- //and update may be caused by some other property, i.e. visited
7122
+ // The second check is required for debouncing, sometimes the value in the store lags after the input
7123
+ // and update may be caused by some other property, i.e. visited
7062
7124
  if (data.value != this.input.value && data.value != this.props.data.value) this.input.value = data.value || "";
7063
7125
  tooltipParentWillReceiveProps$1.apply(void 0, [this.input].concat(getFieldTooltip(props.instance)));
7064
7126
  };
7065
- _proto2.onChange = function onChange(e, change) {
7127
+ _proto2.onChange = function onChange(textValue, change) {
7066
7128
  var _this$props3 = this.props,
7067
7129
  instance = _this$props3.instance,
7068
7130
  data = _this$props3.data;
@@ -7074,7 +7136,7 @@ var Input$2 = /*#__PURE__*/ (function (_VDOM$Component) {
7074
7136
  }
7075
7137
  var widget = instance.widget;
7076
7138
  if (widget.reactOn.indexOf(change) != -1) {
7077
- var text = this.trimmed(e.target.value);
7139
+ var text = this.trimmed(textValue);
7078
7140
  if (data.maxLength != null && text.length > data.maxLength) {
7079
7141
  text = text.substring(0, data.maxLength);
7080
7142
  this.input.value = text;
@@ -7604,6 +7666,7 @@ var Select = /*#__PURE__*/ (function (_Field) {
7604
7666
  },
7605
7667
  label: this.labelPlacement && getContent(this.renderLabel(context, instance, "label")),
7606
7668
  help: this.helpPlacement && getContent(this.renderHelp(context, instance, "help")),
7669
+ icon: this.renderIcon(context, instance, "icon"),
7607
7670
  children: this.renderChildren(context, instance),
7608
7671
  },
7609
7672
  key,
@@ -7655,19 +7718,18 @@ var SelectComponent = /*#__PURE__*/ (function (_VDOM$Component) {
7655
7718
  select = _this$props.select,
7656
7719
  instance = _this$props.instance,
7657
7720
  label = _this$props.label,
7658
- help = _this$props.help;
7721
+ help = _this$props.help,
7722
+ iconVDOM = _this$props.icon;
7659
7723
  var data = instance.data,
7660
7724
  widget = instance.widget,
7661
7725
  state = instance.state;
7662
7726
  var CSS = widget.CSS,
7663
7727
  baseClass = widget.baseClass;
7664
7728
  var icon =
7665
- data.icon &&
7729
+ iconVDOM &&
7666
7730
  /*#__PURE__*/ jsx("div", {
7667
7731
  className: CSS.element(baseClass, "left-icon"),
7668
- children: Icon.render(data.icon, {
7669
- className: CSS.element(baseClass, "icon"),
7670
- }),
7732
+ children: iconVDOM,
7671
7733
  });
7672
7734
  var insideButton,
7673
7735
  readOnly = data.disabled || data.readOnly;
@@ -7712,7 +7774,7 @@ var SelectComponent = /*#__PURE__*/ (function (_VDOM$Component) {
7712
7774
  data.classNames,
7713
7775
  CSS.state({
7714
7776
  visited: state.visited,
7715
- icon: data.icon,
7777
+ icon: !!iconVDOM,
7716
7778
  focus: this.state.focus,
7717
7779
  error: state.visited && data.error,
7718
7780
  empty: data.empty && !data.placeholder,
@@ -8597,6 +8659,7 @@ var LookupField = /*#__PURE__*/ (function (_Field) {
8597
8659
  label: this.labelPlacement && getContent(this.renderLabel(context, instance, "label")),
8598
8660
  help: this.helpPlacement && getContent(this.renderHelp(context, instance, "help")),
8599
8661
  forceUpdate: context.forceUpdate,
8662
+ icon: this.renderIcon(context, instance, "icon"),
8600
8663
  },
8601
8664
  key,
8602
8665
  );
@@ -9025,7 +9088,8 @@ var LookupComponent = /*#__PURE__*/ (function (_VDOM$Component) {
9025
9088
  var _this$props = this.props,
9026
9089
  instance = _this$props.instance,
9027
9090
  label = _this$props.label,
9028
- help = _this$props.help;
9091
+ help = _this$props.help,
9092
+ iconVDOM = _this$props.icon;
9029
9093
  var data = instance.data,
9030
9094
  widget = instance.widget,
9031
9095
  state = instance.state;
@@ -9033,7 +9097,7 @@ var LookupComponent = /*#__PURE__*/ (function (_VDOM$Component) {
9033
9097
  baseClass = widget.baseClass,
9034
9098
  suppressErrorsUntilVisited = widget.suppressErrorsUntilVisited;
9035
9099
  var icon =
9036
- data.icon &&
9100
+ iconVDOM &&
9037
9101
  /*#__PURE__*/ jsx(
9038
9102
  "div",
9039
9103
  {
@@ -9044,9 +9108,7 @@ var LookupComponent = /*#__PURE__*/ (function (_VDOM$Component) {
9044
9108
  e.stopPropagation();
9045
9109
  e.preventDefault();
9046
9110
  },
9047
- children: Icon.render(data.icon, {
9048
- className: CSS.element(baseClass, "icon"),
9049
- }),
9111
+ children: iconVDOM,
9050
9112
  },
9051
9113
  "icon",
9052
9114
  );
@@ -9157,7 +9219,7 @@ var LookupComponent = /*#__PURE__*/ (function (_VDOM$Component) {
9157
9219
  var states = {
9158
9220
  visited: state.visited,
9159
9221
  focus: this.state.focus || this.state.dropdownOpen,
9160
- icon: !!data.icon,
9222
+ icon: !!iconVDOM,
9161
9223
  empty: !data.placeholder && data.empty,
9162
9224
  error: data.error && (state.visited || !suppressErrorsUntilVisited || !data.empty),
9163
9225
  };
@@ -9776,6 +9838,7 @@ var NumberField = /*#__PURE__*/ (function (_Field) {
9776
9838
  instance: instance,
9777
9839
  label: this.labelPlacement && getContent(this.renderLabel(context, instance, "label")),
9778
9840
  help: this.helpPlacement && getContent(this.renderHelp(context, instance, "help")),
9841
+ icon: this.renderIcon(context, instance, "icon"),
9779
9842
  },
9780
9843
  key,
9781
9844
  );
@@ -9821,19 +9884,18 @@ var Input$1 = /*#__PURE__*/ (function (_VDOM$Component) {
9821
9884
  data = _this$props.data,
9822
9885
  instance = _this$props.instance,
9823
9886
  label = _this$props.label,
9824
- help = _this$props.help;
9887
+ help = _this$props.help,
9888
+ iconVDOM = _this$props.icon;
9825
9889
  var widget = instance.widget,
9826
9890
  state = instance.state;
9827
9891
  var CSS = widget.CSS,
9828
9892
  baseClass = widget.baseClass,
9829
9893
  suppressErrorsUntilVisited = widget.suppressErrorsUntilVisited;
9830
9894
  var icon =
9831
- data.icon &&
9895
+ iconVDOM &&
9832
9896
  /*#__PURE__*/ jsx("div", {
9833
9897
  className: CSS.element(baseClass, "left-icon"),
9834
- children: Icon.render(data.icon, {
9835
- className: CSS.element(baseClass, "icon"),
9836
- }),
9898
+ children: iconVDOM,
9837
9899
  });
9838
9900
  var insideButton;
9839
9901
  if (!data.readOnly && !data.disabled) {
@@ -9939,6 +10001,16 @@ var Input$1 = /*#__PURE__*/ (function (_VDOM$Component) {
9939
10001
  autoFocus(this.input, this);
9940
10002
  };
9941
10003
  _proto2.componentWillUnmount = function componentWillUnmount() {
10004
+ if (this.input == getActiveElement()) {
10005
+ this.onChange(
10006
+ {
10007
+ target: {
10008
+ value: this.input.value,
10009
+ },
10010
+ },
10011
+ "blur",
10012
+ );
10013
+ }
9942
10014
  tooltipParentWillUnmount$1(this.props.instance);
9943
10015
  };
9944
10016
  _proto2.getPreCursorDigits = function getPreCursorDigits(text, cursor, decimalSeparator) {
@@ -10082,12 +10154,12 @@ var Input$1 = /*#__PURE__*/ (function (_VDOM$Component) {
10082
10154
  var fmt = data.format;
10083
10155
  var decimalSeparator = this.getDecimalSeparator(fmt) || Format.value(1.1, "n;1")[1];
10084
10156
  var formatted = Format.value(value, fmt);
10085
- //re-parse to avoid differences between formatted value and value in the store
10157
+ // Re-parse to avoid differences between formatted value and value in the store
10086
10158
 
10087
10159
  value = widget.parseValue(formatted, instance) * data.scale + data.offset;
10088
10160
 
10089
- //allow users to type numbers like 100.0003 or -0.05 without interruptions
10090
- //if the last typed in character is zero or dot (decimal separator) skip processing it
10161
+ // Allow users to type numbers like 100.0003 or -0.05 without interruptions
10162
+ // If the last typed character is zero or dot (decimal separator), skip processing it
10091
10163
  if (
10092
10164
  change == "change" &&
10093
10165
  this.input.selectionStart == this.input.selectionEnd &&
@@ -10098,7 +10170,7 @@ var Input$1 = /*#__PURE__*/ (function (_VDOM$Component) {
10098
10170
  )
10099
10171
  return;
10100
10172
  if (change != "blur") {
10101
- //format, but keep the correct cursor position
10173
+ // Format, but keep the correct cursor position
10102
10174
  var preCursorText = this.getPreCursorDigits(this.input.value, this.input.selectionStart, decimalSeparator);
10103
10175
  this.input.value = formatted;
10104
10176
  this.updateCursorPosition(preCursorText);
@@ -10229,13 +10301,13 @@ var Input = /*#__PURE__*/ (function (_VDOM$Component) {
10229
10301
  data.inputAttrs,
10230
10302
  {
10231
10303
  onInput: function onInput(e) {
10232
- return _this2.onChange(e, "input");
10304
+ return _this2.onChange(e.target.value, "input");
10233
10305
  },
10234
10306
  onChange: function onChange(e) {
10235
- return _this2.onChange(e, "change");
10307
+ return _this2.onChange(e.target.value, "change");
10236
10308
  },
10237
10309
  onBlur: function onBlur(e) {
10238
- _this2.onChange(e, "blur");
10310
+ _this2.onChange(e.target.value, "blur");
10239
10311
  },
10240
10312
  onFocus: function onFocus(e) {
10241
10313
  return _this2.onFocus();
@@ -10259,6 +10331,9 @@ var Input = /*#__PURE__*/ (function (_VDOM$Component) {
10259
10331
  });
10260
10332
  };
10261
10333
  _proto2.componentWillUnmount = function componentWillUnmount() {
10334
+ if (this.input == getActiveElement()) {
10335
+ this.onChange(this.input.value, "blur");
10336
+ }
10262
10337
  tooltipParentWillUnmount$1(this.props.instance);
10263
10338
  };
10264
10339
  _proto2.componentDidMount = function componentDidMount() {
@@ -10288,7 +10363,7 @@ var Input = /*#__PURE__*/ (function (_VDOM$Component) {
10288
10363
  }
10289
10364
  tooltipParentWillReceiveProps$1.apply(void 0, [this.input].concat(getFieldTooltip(instance)));
10290
10365
  };
10291
- _proto2.onChange = function onChange(e, change) {
10366
+ _proto2.onChange = function onChange(inputValue, change) {
10292
10367
  var _this$props2 = this.props,
10293
10368
  instance = _this$props2.instance,
10294
10369
  data = _this$props2.data;
@@ -10304,11 +10379,11 @@ var Input = /*#__PURE__*/ (function (_VDOM$Component) {
10304
10379
  }
10305
10380
  if (data.required) {
10306
10381
  instance.setState({
10307
- empty: !e.target.value,
10382
+ empty: !inputValue,
10308
10383
  });
10309
10384
  }
10310
10385
  if (instance.widget.reactOn.indexOf(change) != -1) {
10311
- var value = e.target.value || widget.emptyValue;
10386
+ var value = inputValue || widget.emptyValue;
10312
10387
  instance.set("value", value);
10313
10388
  }
10314
10389
  };
@@ -11855,6 +11930,7 @@ var MonthField = /*#__PURE__*/ (function (_Field) {
11855
11930
  },
11856
11931
  label: this.labelPlacement && getContent(this.renderLabel(context, instance, "label")),
11857
11932
  help: this.helpPlacement && getContent(this.renderHelp(context, instance, "help")),
11933
+ icon: this.renderIcon(context, instance, "icon"),
11858
11934
  },
11859
11935
  key,
11860
11936
  );
@@ -11968,7 +12044,8 @@ var MonthInput = /*#__PURE__*/ (function (_VDOM$Component) {
11968
12044
  instance = _this$props.instance,
11969
12045
  label = _this$props.label,
11970
12046
  help = _this$props.help,
11971
- data = _this$props.data;
12047
+ data = _this$props.data,
12048
+ iconVDOM = _this$props.icon;
11972
12049
  var widget = instance.widget,
11973
12050
  state = instance.state;
11974
12051
  var CSS = widget.CSS,
@@ -12001,12 +12078,10 @@ var MonthInput = /*#__PURE__*/ (function (_VDOM$Component) {
12001
12078
  }),
12002
12079
  });
12003
12080
  }
12004
- if (data.icon) {
12081
+ if (iconVDOM) {
12005
12082
  icon = /*#__PURE__*/ jsx("div", {
12006
12083
  className: CSS.element(baseClass, "left-icon"),
12007
- children: Icon.render(data.icon, {
12008
- className: CSS.element(baseClass, "icon"),
12009
- }),
12084
+ children: iconVDOM,
12010
12085
  });
12011
12086
  }
12012
12087
  var dropdown = false;
@@ -12050,10 +12125,10 @@ var MonthInput = /*#__PURE__*/ (function (_VDOM$Component) {
12050
12125
  tabIndex: data.tabIndex,
12051
12126
  placeholder: data.placeholder,
12052
12127
  onInput: function onInput(e) {
12053
- return _this3.onChange(e, "input");
12128
+ return _this3.onChange(e.target.value, "input");
12054
12129
  },
12055
12130
  onChange: function onChange(e) {
12056
- return _this3.onChange(e, "change");
12131
+ return _this3.onChange(e.target.value, "change");
12057
12132
  },
12058
12133
  onKeyDown: function onKeyDown(e) {
12059
12134
  return _this3.onKeyDown(e);
@@ -12110,7 +12185,7 @@ var MonthInput = /*#__PURE__*/ (function (_VDOM$Component) {
12110
12185
  switch (e.keyCode) {
12111
12186
  case KeyCode.enter:
12112
12187
  e.stopPropagation();
12113
- this.onChange(e, "enter");
12188
+ this.onChange(e.target.value, "enter");
12114
12189
  break;
12115
12190
  case KeyCode.esc:
12116
12191
  if (this.state.dropdownOpen) {
@@ -12140,7 +12215,7 @@ var MonthInput = /*#__PURE__*/ (function (_VDOM$Component) {
12140
12215
  this.setState({
12141
12216
  focus: false,
12142
12217
  });
12143
- this.onChange(e, "blur");
12218
+ this.onChange(e.target.value, "blur");
12144
12219
  };
12145
12220
  _proto2.closeDropdown = function closeDropdown(e, callback) {
12146
12221
  var _this5 = this;
@@ -12196,13 +12271,16 @@ var MonthInput = /*#__PURE__*/ (function (_VDOM$Component) {
12196
12271
  autoFocus(this.input, this);
12197
12272
  };
12198
12273
  _proto2.componentWillUnmount = function componentWillUnmount() {
12274
+ if (this.input == getActiveElement()) {
12275
+ this.onChange(this.input.value, "blur");
12276
+ }
12199
12277
  tooltipParentWillUnmount$1(this.props.instance);
12200
12278
  };
12201
- _proto2.onChange = function onChange(e, eventType) {
12279
+ _proto2.onChange = function onChange(inputValue, eventType) {
12202
12280
  var instance = this.props.instance;
12203
12281
  var widget = instance.widget;
12204
12282
  if (widget.reactOn.indexOf(eventType) == -1) return;
12205
- var parts = e.target.value.split("-");
12283
+ var parts = inputValue.split("-");
12206
12284
  var date1 = widget.parseDate(parts[0]);
12207
12285
  var date2 = widget.parseDate(parts[1]) || date1;
12208
12286
  if ((date1 != null && isNaN(date1)) || (date2 != null && isNaN(date2))) {
@@ -12442,10 +12520,10 @@ var ColorInput = /*#__PURE__*/ (function (_VDOM$Component) {
12442
12520
  data.inputAttrs,
12443
12521
  {
12444
12522
  onInput: function onInput(e) {
12445
- return _this3.onChange(e, "input");
12523
+ return _this3.onChange(e.target.value, "input");
12446
12524
  },
12447
12525
  onChange: function onChange(e) {
12448
- return _this3.onChange(e, "change");
12526
+ return _this3.onChange(e.target.value, "change");
12449
12527
  },
12450
12528
  onKeyDown: function onKeyDown(e) {
12451
12529
  return _this3.onKeyDown(e);
@@ -12504,7 +12582,7 @@ var ColorInput = /*#__PURE__*/ (function (_VDOM$Component) {
12504
12582
  switch (e.keyCode) {
12505
12583
  case KeyCode.enter:
12506
12584
  e.stopPropagation();
12507
- this.onChange(e, "enter");
12585
+ this.onChange(e.target.value, "enter");
12508
12586
  break;
12509
12587
  case KeyCode.esc:
12510
12588
  if (this.state.dropdownOpen) {
@@ -12530,7 +12608,7 @@ var ColorInput = /*#__PURE__*/ (function (_VDOM$Component) {
12530
12608
  this.setState({
12531
12609
  focus: false,
12532
12610
  });
12533
- this.onChange(e, "blur");
12611
+ this.onChange(e.target.value, "blur");
12534
12612
  };
12535
12613
  _proto2.closeDropdown = function closeDropdown(e, callback) {
12536
12614
  var _this5 = this;
@@ -12578,6 +12656,9 @@ var ColorInput = /*#__PURE__*/ (function (_VDOM$Component) {
12578
12656
  if (this.props.instance.widget.autoFocus && !isTouchDevice()) this.input.focus();
12579
12657
  };
12580
12658
  _proto2.componentWillUnmount = function componentWillUnmount() {
12659
+ if (this.input == getActiveElement()) {
12660
+ this.onChange(this.input.value, "blur");
12661
+ }
12581
12662
  tooltipParentWillUnmount$1(this.props.instance);
12582
12663
  };
12583
12664
  _proto2.onClearClick = function onClearClick(e) {
@@ -12589,25 +12670,25 @@ var ColorInput = /*#__PURE__*/ (function (_VDOM$Component) {
12589
12670
  e.stopPropagation();
12590
12671
  e.preventDefault();
12591
12672
  };
12592
- _proto2.onChange = function onChange(e, eventType) {
12673
+ _proto2.onChange = function onChange(inputValue, eventType) {
12593
12674
  var _this$props2 = this.props,
12594
12675
  instance = _this$props2.instance,
12595
12676
  data = _this$props2.data;
12596
12677
  var widget = instance.widget;
12597
- if (eventType == "blur")
12678
+ if (eventType == "blur") {
12598
12679
  instance.setState({
12599
12680
  visited: true,
12600
12681
  });
12601
- var text = e.target.value;
12682
+ }
12602
12683
  var isValid;
12603
12684
  try {
12604
- parseColor(text);
12685
+ parseColor(inputValue);
12605
12686
  isValid = true;
12606
12687
  } catch (e) {
12607
12688
  isValid = false;
12608
12689
  }
12609
12690
  if (eventType == "blur" || eventType == "enter") {
12610
- var value = text || widget.emptyValue;
12691
+ var value = inputValue || widget.emptyValue;
12611
12692
  if (isValid && value !== data.value) instance.set("value", value);
12612
12693
  instance.setState({
12613
12694
  inputError: !isValid && "Invalid color entered.",
@@ -14343,6 +14424,7 @@ var DateTimeField = /*#__PURE__*/ (function (_Field) {
14343
14424
  },
14344
14425
  label: this.labelPlacement && getContent(this.renderLabel(context, instance, "label")),
14345
14426
  help: this.helpPlacement && getContent(this.renderHelp(context, instance, "help")),
14427
+ icon: getContent(this.renderIcon(context, instance, "icon")),
14346
14428
  },
14347
14429
  key,
14348
14430
  );
@@ -14482,7 +14564,8 @@ var DateTimeInput = /*#__PURE__*/ (function (_VDOM$Component) {
14482
14564
  var _this$props = this.props,
14483
14565
  instance = _this$props.instance,
14484
14566
  label = _this$props.label,
14485
- help = _this$props.help;
14567
+ help = _this$props.help,
14568
+ iconVDOM = _this$props.icon;
14486
14569
  var data = instance.data,
14487
14570
  widget = instance.widget,
14488
14571
  state = instance.state;
@@ -14516,12 +14599,10 @@ var DateTimeInput = /*#__PURE__*/ (function (_VDOM$Component) {
14516
14599
  }),
14517
14600
  });
14518
14601
  }
14519
- if (data.icon) {
14602
+ if (iconVDOM) {
14520
14603
  icon = /*#__PURE__*/ jsx("div", {
14521
14604
  className: CSS.element(baseClass, "left-icon"),
14522
- children: Icon.render(data.icon, {
14523
- className: CSS.element(baseClass, "icon"),
14524
- }),
14605
+ children: iconVDOM,
14525
14606
  });
14526
14607
  }
14527
14608
  var dropdown = false;
@@ -14570,10 +14651,10 @@ var DateTimeInput = /*#__PURE__*/ (function (_VDOM$Component) {
14570
14651
  data.inputAttrs,
14571
14652
  {
14572
14653
  onInput: function onInput(e) {
14573
- return _this3.onChange(e, "input");
14654
+ return _this3.onChange(e.target.value, "input");
14574
14655
  },
14575
14656
  onChange: function onChange(e) {
14576
- return _this3.onChange(e, "change");
14657
+ return _this3.onChange(e.target.value, "change");
14577
14658
  },
14578
14659
  onKeyDown: function onKeyDown(e) {
14579
14660
  return _this3.onKeyDown(e);
@@ -14635,7 +14716,7 @@ var DateTimeInput = /*#__PURE__*/ (function (_VDOM$Component) {
14635
14716
  if (instance.widget.handleKeyDown(e, instance) === false) return;
14636
14717
  switch (e.keyCode) {
14637
14718
  case KeyCode.enter:
14638
- this.onChange(e, "enter");
14719
+ this.onChange(e.target.value, "enter");
14639
14720
  break;
14640
14721
  case KeyCode.esc:
14641
14722
  if (this.state.dropdownOpen) {
@@ -14666,7 +14747,7 @@ var DateTimeInput = /*#__PURE__*/ (function (_VDOM$Component) {
14666
14747
  this.setState({
14667
14748
  focus: false,
14668
14749
  });
14669
- this.onChange(e, "blur");
14750
+ this.onChange(e.target.value, "blur");
14670
14751
  };
14671
14752
  _proto2.closeDropdown = function closeDropdown(e, callback) {
14672
14753
  var _this5 = this;
@@ -14722,9 +14803,12 @@ var DateTimeInput = /*#__PURE__*/ (function (_VDOM$Component) {
14722
14803
  autoFocus(this.input, this);
14723
14804
  };
14724
14805
  _proto2.componentWillUnmount = function componentWillUnmount() {
14806
+ if (this.input == getActiveElement()) {
14807
+ this.onChange(this.input.value, "blur");
14808
+ }
14725
14809
  tooltipParentWillUnmount$1(this.props.instance);
14726
14810
  };
14727
- _proto2.onChange = function onChange(e, eventType) {
14811
+ _proto2.onChange = function onChange(inputValue, eventType) {
14728
14812
  var _this$props2 = this.props,
14729
14813
  instance = _this$props2.instance,
14730
14814
  data = _this$props2.data;
@@ -14735,7 +14819,7 @@ var DateTimeInput = /*#__PURE__*/ (function (_VDOM$Component) {
14735
14819
  instance.setState({
14736
14820
  visited: true,
14737
14821
  });
14738
- this.setValue(e.target.value, data.value);
14822
+ this.setValue(inputValue, data.value);
14739
14823
  };
14740
14824
  _proto2.setValue = function setValue(text, baseValue) {
14741
14825
  var _this$props3 = this.props,
@@ -19157,6 +19241,7 @@ export {
19157
19241
  HighlightedSearchText,
19158
19242
  HtmlElement,
19159
19243
  Icon,
19244
+ Label,
19160
19245
  LabeledContainer,
19161
19246
  Link,
19162
19247
  LinkButton,
package/locale/de-de.js CHANGED
@@ -24,11 +24,14 @@ const calendarErrorMessages = {
24
24
  minValueErrorText: 'Wählen Sie {0:d} oder später.',
25
25
  minExclusiveErrorText: 'Wählen Sie ein Datum nach dem {0:d}.',
26
26
  };
27
+
27
28
  // Calendar
28
29
  Localization.localize(c, 'cx/widgets/Calendar', {
29
30
  ...calendarErrorMessages,
30
- todayButtonText: 'Heute'
31
+ todayButtonText: 'Heute',
32
+ startWithMonday: true
31
33
  });
34
+
32
35
  // MonthPicker
33
36
  Localization.localize(c, 'cx/widgets/MonthPicker', calendarErrorMessages);
34
37
 
@@ -37,8 +40,10 @@ const dateFieldErrorMessages = {
37
40
  ...calendarErrorMessages,
38
41
  inputErrorText: 'Ungültiges Datum eingegeben.'
39
42
  };
43
+
40
44
  // MonthField
41
45
  Localization.localize(c, 'cx/widgets/MonthField', dateFieldErrorMessages);
46
+
42
47
  // DateField
43
48
  Localization.localize(c, 'cx/widgets/DateField', dateFieldErrorMessages);
44
49