ywana-core8 0.0.349 → 0.0.352
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 +41 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +70 -56
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +41 -12
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +41 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/menu.css +62 -57
- package/src/html/menu.js +8 -4
- 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/dist/index.umd.js
CHANGED
@@ -667,18 +667,23 @@
|
|
667
667
|
var icon = props.icon,
|
668
668
|
label = props.label,
|
669
669
|
meta = props.meta,
|
670
|
+
_props$disabled = props.disabled,
|
671
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
670
672
|
onSelect = props.onSelect;
|
671
673
|
|
672
674
|
var _useContext = React.useContext(MenuContext),
|
673
675
|
setOpen = _useContext[1];
|
674
676
|
|
675
677
|
function select() {
|
676
|
-
if (
|
677
|
-
|
678
|
+
if (!disabled) {
|
679
|
+
if (onSelect) onSelect();
|
680
|
+
setOpen(false);
|
681
|
+
}
|
678
682
|
}
|
679
683
|
|
684
|
+
var style = disabled ? "disabled" : "";
|
680
685
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
681
|
-
className: "menu-item",
|
686
|
+
className: "menu-item " + style,
|
682
687
|
onClick: select
|
683
688
|
}, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
684
689
|
icon: icon
|
@@ -2989,16 +2994,20 @@
|
|
2989
2994
|
setDialog = _useState8[1];
|
2990
2995
|
|
2991
2996
|
var _useState9 = React.useState(),
|
2992
|
-
|
2993
|
-
|
2997
|
+
promptDialog = _useState9[0],
|
2998
|
+
setPromptDialog = _useState9[1];
|
2994
2999
|
|
2995
3000
|
var _useState10 = React.useState(),
|
2996
|
-
|
2997
|
-
|
3001
|
+
preview = _useState10[0],
|
3002
|
+
setPreview = _useState10[1];
|
2998
3003
|
|
2999
3004
|
var _useState11 = React.useState(),
|
3000
|
-
|
3001
|
-
|
3005
|
+
breadcrumb = _useState11[0],
|
3006
|
+
setBreadcrumb = _useState11[1];
|
3007
|
+
|
3008
|
+
var _useState12 = React.useState(),
|
3009
|
+
focused = _useState12[0],
|
3010
|
+
setFocused = _useState12[1];
|
3002
3011
|
|
3003
3012
|
var value = {
|
3004
3013
|
lang: lang,
|
@@ -3051,6 +3060,13 @@
|
|
3051
3060
|
prompt: function prompt(message) {
|
3052
3061
|
return window.prompt(message);
|
3053
3062
|
},
|
3063
|
+
promptDialog: promptDialog,
|
3064
|
+
openPromptDialog: function openPromptDialog(dialog) {
|
3065
|
+
setPromptDialog(dialog);
|
3066
|
+
},
|
3067
|
+
closePromptDialog: function closePromptDialog() {
|
3068
|
+
setPromptDialog(null);
|
3069
|
+
},
|
3054
3070
|
notify: function notify(_ref2) {
|
3055
3071
|
var title = _ref2.title,
|
3056
3072
|
body = _ref2.body,
|
@@ -3105,7 +3121,7 @@
|
|
3105
3121
|
init: init
|
3106
3122
|
}, children, /*#__PURE__*/React__default["default"].createElement(Page, {
|
3107
3123
|
id: "EMPTY"
|
3108
|
-
}, "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)));
|
3109
3125
|
};
|
3110
3126
|
|
3111
3127
|
var SiteNotifications = function SiteNotifications() {
|
@@ -3257,6 +3273,15 @@
|
|
3257
3273
|
var context = React.useContext(SiteContext);
|
3258
3274
|
return context.dialog ? context.dialog : '';
|
3259
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
|
+
};
|
3260
3285
|
/**
|
3261
3286
|
* Site Preview
|
3262
3287
|
*/
|
@@ -3300,7 +3325,11 @@
|
|
3300
3325
|
eventPropagation = _props$eventPropagati === void 0 ? false : _props$eventPropagati;
|
3301
3326
|
|
3302
3327
|
function close() {
|
3303
|
-
|
3328
|
+
if (className === "prompt") {
|
3329
|
+
site.closePromptDialog();
|
3330
|
+
} else {
|
3331
|
+
site.closeDialog();
|
3332
|
+
}
|
3304
3333
|
}
|
3305
3334
|
|
3306
3335
|
function prevent(e) {
|
@@ -3311,7 +3340,7 @@
|
|
3311
3340
|
}
|
3312
3341
|
|
3313
3342
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
3314
|
-
className: "overlay"
|
3343
|
+
className: "overlay " + className
|
3315
3344
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
3316
3345
|
className: "dialog " + className,
|
3317
3346
|
onClick: close
|