ywana-core8 0.0.368 → 0.0.371

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.
@@ -928,7 +928,8 @@ var TextField = function TextField(props) {
928
928
  canClear = _props$canClear === void 0 ? true : _props$canClear,
929
929
  onChange = props.onChange,
930
930
  onEnter = props.onEnter,
931
- onClick = props.onClick;
931
+ onClick = props.onClick,
932
+ onBlur = props.onBlur;
932
933
 
933
934
  function onKeyPress(event) {
934
935
  var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
@@ -954,13 +955,8 @@ var TextField = function TextField(props) {
954
955
  }
955
956
  }
956
957
 
957
- function focusOut() {
958
- if (site && site.changeFocus) {
959
- site.changeFocus({
960
- lose: function lose() {// DO NOTHING
961
- }
962
- });
963
- }
958
+ function blur() {
959
+ if (onBlur) onBlur();
964
960
  }
965
961
 
966
962
  function clear() {
@@ -983,7 +979,7 @@ var TextField = function TextField(props) {
983
979
  onChange: change,
984
980
  onKeyDown: onKeyPress,
985
981
  onFocus: focus,
986
- onBlur: focusOut,
982
+ onBlur: blur,
987
983
  readOnly: readOnly
988
984
  }), canClear && value && value.length > 0 ? /*#__PURE__*/React.createElement(Icon, {
989
985
  icon: "close",
@@ -1026,7 +1022,6 @@ var TextArea = function TextArea(props) {
1026
1022
  event.stopPropagation();
1027
1023
  event.preventDefault();
1028
1024
  var value = event.target.value;
1029
- console.log(value);
1030
1025
  if (onChange) onChange(id, value);
1031
1026
  }
1032
1027
 
@@ -1058,7 +1053,7 @@ var TextArea = function TextArea(props) {
1058
1053
  onKeyDown: onKeyPress,
1059
1054
  onFocus: focus,
1060
1055
  readOnly: readOnly
1061
- }), !readOnly && canClear && value && value.length > 0 ? /*#__PURE__*/React.createElement(Icon, {
1056
+ }), canClear && value && value.length > 0 ? /*#__PURE__*/React.createElement(Icon, {
1062
1057
  icon: "close",
1063
1058
  clickable: true,
1064
1059
  size: "small",
@@ -1124,7 +1119,6 @@ var DropDown = function DropDown(props) {
1124
1119
  }
1125
1120
 
1126
1121
  function select(event) {
1127
- console.log(event);
1128
1122
  var next = event.target.getAttribute("value");
1129
1123
  var option = options.find(function (option) {
1130
1124
  return option.value === next;
@@ -1134,6 +1128,11 @@ var DropDown = function DropDown(props) {
1134
1128
  setOpen(false);
1135
1129
  }
1136
1130
 
1131
+ function blur() {
1132
+ console.log("BLUR DD");
1133
+ site.clearFocus();
1134
+ }
1135
+
1137
1136
  function renderOptions() {
1138
1137
  var canShow = open == true && Array.isArray(options);
1139
1138
 
@@ -1149,7 +1148,7 @@ var DropDown = function DropDown(props) {
1149
1148
  }, option.label);
1150
1149
  });
1151
1150
  return /*#__PURE__*/React.createElement("menu", null, /*#__PURE__*/React.createElement("ul", {
1152
- onClick: select
1151
+ onMouseDown: select
1153
1152
  }, lis));
1154
1153
  } else {
1155
1154
  return null;
@@ -1159,8 +1158,10 @@ var DropDown = function DropDown(props) {
1159
1158
  return /*#__PURE__*/React.createElement("div", {
1160
1159
  className: "dropdown"
1161
1160
  }, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
1161
+ onClick: toggle,
1162
1162
  value: label,
1163
1163
  onChange: change,
1164
+ onBlur: blur,
1164
1165
  readOnly: !predictive
1165
1166
  })), !readOnly ? /*#__PURE__*/React.createElement(Icon, {
1166
1167
  icon: "expand_more",
@@ -3032,6 +3033,10 @@ var SiteProvider = function SiteProvider(_ref) {
3032
3033
  if (focused) focused.lose();
3033
3034
  setFocused(next);
3034
3035
  },
3036
+ clearFocus: function clearFocus() {
3037
+ if (focused) focused.lose();
3038
+ setFocused(null);
3039
+ },
3035
3040
  sideNav: sideNav,
3036
3041
  setSideNav: setSideNav,
3037
3042
  showNav: showNav,