ywana-core8 0.0.858 → 0.0.860
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 +3 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +11 -3
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +3 -20
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +3 -20
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/textfield.js +2 -8
- package/src/site/site.js +2 -13
- package/src/site/view.css +11 -3
package/dist/index.cjs
CHANGED
@@ -1272,7 +1272,7 @@ var Content = /*#__PURE__*/function () {
|
|
1272
1272
|
* Text Field
|
1273
1273
|
*/
|
1274
1274
|
var TextField = function TextField(props) {
|
1275
|
-
|
1275
|
+
React.useContext(SiteContext);
|
1276
1276
|
var id = props.id,
|
1277
1277
|
_props$type = props.type,
|
1278
1278
|
type = _props$type === void 0 ? 'text' : _props$type,
|
@@ -1289,6 +1289,7 @@ var TextField = function TextField(props) {
|
|
1289
1289
|
onChange = props.onChange,
|
1290
1290
|
onEnter = props.onEnter,
|
1291
1291
|
onClick = props.onClick,
|
1292
|
+
onFocus = props.onFocus,
|
1292
1293
|
onBlur = props.onBlur;
|
1293
1294
|
function onKeyPress(event) {
|
1294
1295
|
var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
|
@@ -1303,13 +1304,7 @@ var TextField = function TextField(props) {
|
|
1303
1304
|
if (onChange) onChange(id, value);
|
1304
1305
|
}
|
1305
1306
|
function focus() {
|
1306
|
-
if (
|
1307
|
-
site.changeFocus({
|
1308
|
-
lose: function lose() {
|
1309
|
-
// DO NOTHING
|
1310
|
-
}
|
1311
|
-
});
|
1312
|
-
}
|
1307
|
+
if (onFocus) onFocus();
|
1313
1308
|
}
|
1314
1309
|
function blur() {
|
1315
1310
|
if (onBlur) onBlur();
|
@@ -3698,23 +3693,11 @@ var SiteProvider = function SiteProvider(_ref) {
|
|
3698
3693
|
var _useState12 = React.useState(),
|
3699
3694
|
breadcrumb = _useState12[0],
|
3700
3695
|
setBreadcrumb = _useState12[1];
|
3701
|
-
var _useState13 = React.useState(),
|
3702
|
-
focused = _useState13[0],
|
3703
|
-
setFocused = _useState13[1];
|
3704
3696
|
var value = {
|
3705
3697
|
lang: lang,
|
3706
3698
|
setLang: setLang,
|
3707
3699
|
dictionary: dictionary,
|
3708
3700
|
setDictionary: setDictionary,
|
3709
|
-
focused: focused,
|
3710
|
-
changeFocus: function changeFocus(next) {
|
3711
|
-
if (focused) focused.lose();
|
3712
|
-
setFocused(next);
|
3713
|
-
},
|
3714
|
-
clearFocus: function clearFocus() {
|
3715
|
-
if (focused) focused.lose();
|
3716
|
-
setFocused(null);
|
3717
|
-
},
|
3718
3701
|
sideNav: sideNav,
|
3719
3702
|
setSideNav: setSideNav,
|
3720
3703
|
showNav: showNav,
|