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.cjs
CHANGED
@@ -936,7 +936,8 @@ var TextField = function TextField(props) {
|
|
936
936
|
canClear = _props$canClear === void 0 ? true : _props$canClear,
|
937
937
|
onChange = props.onChange,
|
938
938
|
onEnter = props.onEnter,
|
939
|
-
onClick = props.onClick
|
939
|
+
onClick = props.onClick,
|
940
|
+
onBlur = props.onBlur;
|
940
941
|
|
941
942
|
function onKeyPress(event) {
|
942
943
|
var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
|
@@ -962,13 +963,8 @@ var TextField = function TextField(props) {
|
|
962
963
|
}
|
963
964
|
}
|
964
965
|
|
965
|
-
function
|
966
|
-
if (
|
967
|
-
site.changeFocus({
|
968
|
-
lose: function lose() {// DO NOTHING
|
969
|
-
}
|
970
|
-
});
|
971
|
-
}
|
966
|
+
function blur() {
|
967
|
+
if (onBlur) onBlur();
|
972
968
|
}
|
973
969
|
|
974
970
|
function clear() {
|
@@ -991,7 +987,7 @@ var TextField = function TextField(props) {
|
|
991
987
|
onChange: change,
|
992
988
|
onKeyDown: onKeyPress,
|
993
989
|
onFocus: focus,
|
994
|
-
onBlur:
|
990
|
+
onBlur: blur,
|
995
991
|
readOnly: readOnly
|
996
992
|
}), canClear && value && value.length > 0 ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
997
993
|
icon: "close",
|
@@ -1034,7 +1030,6 @@ var TextArea = function TextArea(props) {
|
|
1034
1030
|
event.stopPropagation();
|
1035
1031
|
event.preventDefault();
|
1036
1032
|
var value = event.target.value;
|
1037
|
-
console.log(value);
|
1038
1033
|
if (onChange) onChange(id, value);
|
1039
1034
|
}
|
1040
1035
|
|
@@ -1066,7 +1061,7 @@ var TextArea = function TextArea(props) {
|
|
1066
1061
|
onKeyDown: onKeyPress,
|
1067
1062
|
onFocus: focus,
|
1068
1063
|
readOnly: readOnly
|
1069
|
-
}),
|
1064
|
+
}), canClear && value && value.length > 0 ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
1070
1065
|
icon: "close",
|
1071
1066
|
clickable: true,
|
1072
1067
|
size: "small",
|
@@ -1141,6 +1136,11 @@ var DropDown = function DropDown(props) {
|
|
1141
1136
|
setOpen(false);
|
1142
1137
|
}
|
1143
1138
|
|
1139
|
+
function blur() {
|
1140
|
+
console.log("BLUR DD");
|
1141
|
+
site.clearFocus();
|
1142
|
+
}
|
1143
|
+
|
1144
1144
|
function renderOptions() {
|
1145
1145
|
var canShow = open == true && Array.isArray(options);
|
1146
1146
|
|
@@ -1156,7 +1156,7 @@ var DropDown = function DropDown(props) {
|
|
1156
1156
|
}, option.label);
|
1157
1157
|
});
|
1158
1158
|
return /*#__PURE__*/React__default["default"].createElement("menu", null, /*#__PURE__*/React__default["default"].createElement("ul", {
|
1159
|
-
|
1159
|
+
onMouseDown: select
|
1160
1160
|
}, lis));
|
1161
1161
|
} else {
|
1162
1162
|
return null;
|
@@ -1169,6 +1169,7 @@ var DropDown = function DropDown(props) {
|
|
1169
1169
|
onClick: toggle,
|
1170
1170
|
value: label,
|
1171
1171
|
onChange: change,
|
1172
|
+
onBlur: blur,
|
1172
1173
|
readOnly: !predictive
|
1173
1174
|
})), !readOnly ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
1174
1175
|
icon: "expand_more",
|
@@ -3040,6 +3041,10 @@ var SiteProvider = function SiteProvider(_ref) {
|
|
3040
3041
|
if (focused) focused.lose();
|
3041
3042
|
setFocused(next);
|
3042
3043
|
},
|
3044
|
+
clearFocus: function clearFocus() {
|
3045
|
+
if (focused) focused.lose();
|
3046
|
+
setFocused(null);
|
3047
|
+
},
|
3043
3048
|
sideNav: sideNav,
|
3044
3049
|
setSideNav: setSideNav,
|
3045
3050
|
showNav: showNav,
|