ywana-core8 0.0.370 → 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.
- package/dist/index.cjs +17 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +17 -12
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +17 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/textfield.js +12 -14
- package/src/site/site.js +4 -0
- package/src/site/site.test.js +1 -1
package/dist/index.umd.js
CHANGED
@@ -931,7 +931,8 @@
|
|
931
931
|
canClear = _props$canClear === void 0 ? true : _props$canClear,
|
932
932
|
onChange = props.onChange,
|
933
933
|
onEnter = props.onEnter,
|
934
|
-
onClick = props.onClick
|
934
|
+
onClick = props.onClick,
|
935
|
+
onBlur = props.onBlur;
|
935
936
|
|
936
937
|
function onKeyPress(event) {
|
937
938
|
var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
|
@@ -957,13 +958,8 @@
|
|
957
958
|
}
|
958
959
|
}
|
959
960
|
|
960
|
-
function
|
961
|
-
if (
|
962
|
-
site.changeFocus({
|
963
|
-
lose: function lose() {// DO NOTHING
|
964
|
-
}
|
965
|
-
});
|
966
|
-
}
|
961
|
+
function blur() {
|
962
|
+
if (onBlur) onBlur();
|
967
963
|
}
|
968
964
|
|
969
965
|
function clear() {
|
@@ -986,7 +982,7 @@
|
|
986
982
|
onChange: change,
|
987
983
|
onKeyDown: onKeyPress,
|
988
984
|
onFocus: focus,
|
989
|
-
onBlur:
|
985
|
+
onBlur: blur,
|
990
986
|
readOnly: readOnly
|
991
987
|
}), canClear && value && value.length > 0 ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
992
988
|
icon: "close",
|
@@ -1029,7 +1025,6 @@
|
|
1029
1025
|
event.stopPropagation();
|
1030
1026
|
event.preventDefault();
|
1031
1027
|
var value = event.target.value;
|
1032
|
-
console.log(value);
|
1033
1028
|
if (onChange) onChange(id, value);
|
1034
1029
|
}
|
1035
1030
|
|
@@ -1061,7 +1056,7 @@
|
|
1061
1056
|
onKeyDown: onKeyPress,
|
1062
1057
|
onFocus: focus,
|
1063
1058
|
readOnly: readOnly
|
1064
|
-
}),
|
1059
|
+
}), canClear && value && value.length > 0 ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
1065
1060
|
icon: "close",
|
1066
1061
|
clickable: true,
|
1067
1062
|
size: "small",
|
@@ -1136,6 +1131,11 @@
|
|
1136
1131
|
setOpen(false);
|
1137
1132
|
}
|
1138
1133
|
|
1134
|
+
function blur() {
|
1135
|
+
console.log("BLUR DD");
|
1136
|
+
site.clearFocus();
|
1137
|
+
}
|
1138
|
+
|
1139
1139
|
function renderOptions() {
|
1140
1140
|
var canShow = open == true && Array.isArray(options);
|
1141
1141
|
|
@@ -1151,7 +1151,7 @@
|
|
1151
1151
|
}, option.label);
|
1152
1152
|
});
|
1153
1153
|
return /*#__PURE__*/React__default["default"].createElement("menu", null, /*#__PURE__*/React__default["default"].createElement("ul", {
|
1154
|
-
|
1154
|
+
onMouseDown: select
|
1155
1155
|
}, lis));
|
1156
1156
|
} else {
|
1157
1157
|
return null;
|
@@ -1164,6 +1164,7 @@
|
|
1164
1164
|
onClick: toggle,
|
1165
1165
|
value: label,
|
1166
1166
|
onChange: change,
|
1167
|
+
onBlur: blur,
|
1167
1168
|
readOnly: !predictive
|
1168
1169
|
})), !readOnly ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
1169
1170
|
icon: "expand_more",
|
@@ -3035,6 +3036,10 @@
|
|
3035
3036
|
if (focused) focused.lose();
|
3036
3037
|
setFocused(next);
|
3037
3038
|
},
|
3039
|
+
clearFocus: function clearFocus() {
|
3040
|
+
if (focused) focused.lose();
|
3041
|
+
setFocused(null);
|
3042
|
+
},
|
3038
3043
|
sideNav: sideNav,
|
3039
3044
|
setSideNav: setSideNav,
|
3040
3045
|
showNav: showNav,
|