ywana-core8 0.0.348 → 0.0.351
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 +36 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +8 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +36 -10
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +36 -10
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/site/dialog.css +8 -0
- package/src/site/dialog.js +7 -2
- package/src/site/site.js +15 -0
- package/src/site/site.test.js +33 -2
- package/src/widgets/login/LoginBox.js +2 -1
package/dist/index.cjs
CHANGED
@@ -2074,6 +2074,8 @@ var LoginBox = function LoginBox(_ref) {
|
|
2074
2074
|
userLabel = _ref$userLabel === void 0 ? "User" : _ref$userLabel,
|
2075
2075
|
_ref$passwordLabel = _ref.passwordLabel,
|
2076
2076
|
passwordLabel = _ref$passwordLabel === void 0 ? "Password" : _ref$passwordLabel,
|
2077
|
+
_ref$passwordValue = _ref.passwordValue,
|
2078
|
+
passwordValue = _ref$passwordValue === void 0 ? '' : _ref$passwordValue,
|
2077
2079
|
_ref$loginLabel = _ref.loginLabel,
|
2078
2080
|
loginLabel = _ref$loginLabel === void 0 ? "Log In" : _ref$loginLabel,
|
2079
2081
|
onOK = _ref.onOK,
|
@@ -2087,7 +2089,7 @@ var LoginBox = function LoginBox(_ref) {
|
|
2087
2089
|
user = _useState[0],
|
2088
2090
|
setUser = _useState[1];
|
2089
2091
|
|
2090
|
-
var _useState2 = React.useState(
|
2092
|
+
var _useState2 = React.useState(passwordValue),
|
2091
2093
|
password = _useState2[0],
|
2092
2094
|
setPassword = _useState2[1];
|
2093
2095
|
|
@@ -2992,16 +2994,20 @@ var SiteProvider = function SiteProvider(_ref) {
|
|
2992
2994
|
setDialog = _useState8[1];
|
2993
2995
|
|
2994
2996
|
var _useState9 = React.useState(),
|
2995
|
-
|
2996
|
-
|
2997
|
+
promptDialog = _useState9[0],
|
2998
|
+
setPromptDialog = _useState9[1];
|
2997
2999
|
|
2998
3000
|
var _useState10 = React.useState(),
|
2999
|
-
|
3000
|
-
|
3001
|
+
preview = _useState10[0],
|
3002
|
+
setPreview = _useState10[1];
|
3001
3003
|
|
3002
3004
|
var _useState11 = React.useState(),
|
3003
|
-
|
3004
|
-
|
3005
|
+
breadcrumb = _useState11[0],
|
3006
|
+
setBreadcrumb = _useState11[1];
|
3007
|
+
|
3008
|
+
var _useState12 = React.useState(),
|
3009
|
+
focused = _useState12[0],
|
3010
|
+
setFocused = _useState12[1];
|
3005
3011
|
|
3006
3012
|
var value = {
|
3007
3013
|
lang: lang,
|
@@ -3054,6 +3060,13 @@ var SiteProvider = function SiteProvider(_ref) {
|
|
3054
3060
|
prompt: function prompt(message) {
|
3055
3061
|
return window.prompt(message);
|
3056
3062
|
},
|
3063
|
+
promptDialog: promptDialog,
|
3064
|
+
openPromptDialog: function openPromptDialog(dialog) {
|
3065
|
+
setPromptDialog(dialog);
|
3066
|
+
},
|
3067
|
+
closePromptDialog: function closePromptDialog() {
|
3068
|
+
setPromptDialog(null);
|
3069
|
+
},
|
3057
3070
|
notify: function notify(_ref2) {
|
3058
3071
|
var title = _ref2.title,
|
3059
3072
|
body = _ref2.body,
|
@@ -3108,7 +3121,7 @@ var Site = function Site(_ref3) {
|
|
3108
3121
|
init: init
|
3109
3122
|
}, children, /*#__PURE__*/React__default["default"].createElement(Page, {
|
3110
3123
|
id: "EMPTY"
|
3111
|
-
}, "EMPTY")), /*#__PURE__*/React__default["default"].createElement(SiteAside, null), /*#__PURE__*/React__default["default"].createElement(SiteConsole, null), /*#__PURE__*/React__default["default"].createElement(SiteDialog, null), /*#__PURE__*/React__default["default"].createElement(SitePreview, null), /*#__PURE__*/React__default["default"].createElement(SiteNotifications, null)));
|
3124
|
+
}, "EMPTY")), /*#__PURE__*/React__default["default"].createElement(SiteAside, null), /*#__PURE__*/React__default["default"].createElement(SiteConsole, null), /*#__PURE__*/React__default["default"].createElement(SiteDialog, null), /*#__PURE__*/React__default["default"].createElement(SitePromptDialog, null), /*#__PURE__*/React__default["default"].createElement(SitePreview, null), /*#__PURE__*/React__default["default"].createElement(SiteNotifications, null)));
|
3112
3125
|
};
|
3113
3126
|
|
3114
3127
|
var SiteNotifications = function SiteNotifications() {
|
@@ -3260,6 +3273,15 @@ var SiteDialog = function SiteDialog() {
|
|
3260
3273
|
var context = React.useContext(SiteContext);
|
3261
3274
|
return context.dialog ? context.dialog : '';
|
3262
3275
|
};
|
3276
|
+
/**
|
3277
|
+
* Site Promtp Dialog
|
3278
|
+
*/
|
3279
|
+
|
3280
|
+
|
3281
|
+
var SitePromptDialog = function SitePromptDialog() {
|
3282
|
+
var context = React.useContext(SiteContext);
|
3283
|
+
return context.promptDialog ? context.promptDialog : '';
|
3284
|
+
};
|
3263
3285
|
/**
|
3264
3286
|
* Site Preview
|
3265
3287
|
*/
|
@@ -3303,7 +3325,11 @@ var Dialog = function Dialog(props) {
|
|
3303
3325
|
eventPropagation = _props$eventPropagati === void 0 ? false : _props$eventPropagati;
|
3304
3326
|
|
3305
3327
|
function close() {
|
3306
|
-
|
3328
|
+
if (className === "prompt") {
|
3329
|
+
site.closePromptDialog();
|
3330
|
+
} else {
|
3331
|
+
site.closeDialog();
|
3332
|
+
}
|
3307
3333
|
}
|
3308
3334
|
|
3309
3335
|
function prevent(e) {
|
@@ -3314,7 +3340,7 @@ var Dialog = function Dialog(props) {
|
|
3314
3340
|
}
|
3315
3341
|
|
3316
3342
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
3317
|
-
className: "overlay"
|
3343
|
+
className: "overlay " + className
|
3318
3344
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
3319
3345
|
className: "dialog " + className,
|
3320
3346
|
onClick: close
|