ywana-core8 0.0.263 → 0.0.264

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.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('material-design-icons-iconfont/dist/material-design-icons.css'), require('react'), require('react-switch'), require('moment'), require('moment-range'), require('react-notifications'), require('react-notifications/lib/notifications.css'), require('deep-equal'), require('resumablejs')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'material-design-icons-iconfont/dist/material-design-icons.css', 'react', 'react-switch', 'moment', 'moment-range', 'react-notifications', 'react-notifications/lib/notifications.css', 'deep-equal', 'resumablejs'], factory) :
4
- (global = global || self, factory(global.ywanaCore8 = {}, null, global.react, global.reactSwitch, global.moment, global.momentRange, global.reactNotifications, null, global.deepEqual, global.resumablejs));
5
- })(this, (function (exports, materialDesignIcons_css, React, RSwitch, moment, momentRange, reactNotifications, notifications_css, equal, ResumableJS) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('material-design-icons-iconfont/dist/material-design-icons.css'), require('react'), require('react-switch'), require('moment'), require('moment-range'), require('react-notifications/lib/notifications.css'), require('deep-equal'), require('resumablejs')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'material-design-icons-iconfont/dist/material-design-icons.css', 'react', 'react-switch', 'moment', 'moment-range', 'react-notifications/lib/notifications.css', 'deep-equal', 'resumablejs'], factory) :
4
+ (global = global || self, factory(global.ywanaCore8 = {}, null, global.react, global.reactSwitch, global.moment, global.momentRange, null, global.deepEqual, global.resumablejs));
5
+ })(this, (function (exports, materialDesignIcons_css, React, RSwitch, moment, momentRange, notifications_css, equal, ResumableJS) {
6
6
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
7
 
8
8
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
@@ -2793,10 +2793,7 @@
2793
2793
  confirm: function confirm(message) {
2794
2794
  return window.confirm(message);
2795
2795
  },
2796
- notify: function notify(_ref2) {
2797
- var title = _ref2.title,
2798
- body = _ref2.body;
2799
- reactNotifications.NotificationManager.info(body, title);
2796
+ notify: function notify(_ref2) {//NotificationManager.info(body, title)
2800
2797
  }
2801
2798
  };
2802
2799
  return /*#__PURE__*/React__default["default"].createElement(SiteContext.Provider, {
@@ -2836,7 +2833,7 @@
2836
2833
  };
2837
2834
 
2838
2835
  var SiteNotifications = function SiteNotifications() {
2839
- return /*#__PURE__*/React__default["default"].createElement(reactNotifications.NotificationContainer, null);
2836
+ return /*#__PURE__*/React__default["default"].createElement("div", null);
2840
2837
  };
2841
2838
  /**
2842
2839
  * Site Header
@@ -2880,11 +2877,18 @@
2880
2877
  var children = _ref5.children,
2881
2878
  min = _ref5.min;
2882
2879
  var context = React.useContext(SiteContext);
2883
- var showNav = context.showNav;
2880
+ var sideNav = context.sideNav,
2881
+ setSideNav = context.setSideNav,
2882
+ showNav = context.showNav;
2884
2883
  React.useEffect(function () {
2885
2884
  if (min) context.setSideNav('min');
2886
2885
  }, []);
2887
2886
 
2887
+ function toggle() {
2888
+ var next = sideNav === 'max' ? 'min' : 'max';
2889
+ setSideNav(next);
2890
+ }
2891
+
2888
2892
  var _goto = function _goto(id) {
2889
2893
  context.setShowNav(false);
2890
2894
  context["goto"](id);
@@ -2904,16 +2908,25 @@
2904
2908
  });
2905
2909
  return sections;
2906
2910
  }, {}) : {};
2911
+ var style = sideNav === 'max' ? 'max' : 'min';
2912
+ var toggleIcon = sideNav === 'max' ? 'chevron_left' : 'chevron_right';
2907
2913
  return /*#__PURE__*/React__default["default"].createElement("menu", {
2908
- className: "min " + (showNav ? 'show' : '')
2914
+ className: style + " " + (showNav ? 'show' : '')
2909
2915
  }, /*#__PURE__*/React__default["default"].createElement("main", null, Object.keys(sections).map(function (title) {
2910
2916
  return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
2911
2917
  key: title
2912
2918
  }, sections[title].map(function (_ref6) {
2913
2919
  var id = _ref6.id,
2914
2920
  _ref6$icon = _ref6.icon,
2915
- icon = _ref6$icon === void 0 ? 'info' : _ref6$icon;
2916
- return /*#__PURE__*/React__default["default"].createElement(Icon, {
2921
+ icon = _ref6$icon === void 0 ? 'info' : _ref6$icon,
2922
+ title = _ref6.title;
2923
+ return /*#__PURE__*/React__default["default"].createElement("div", {
2924
+ className: "site-menu-item",
2925
+ key: id,
2926
+ onClick: function onClick() {
2927
+ return _goto(id);
2928
+ }
2929
+ }, /*#__PURE__*/React__default["default"].createElement(Icon, {
2917
2930
  key: id,
2918
2931
  icon: icon,
2919
2932
  clickable: true,
@@ -2921,10 +2934,14 @@
2921
2934
  action: function action() {
2922
2935
  return _goto(id);
2923
2936
  }
2924
- });
2937
+ }), sideNav === 'max' ? /*#__PURE__*/React__default["default"].createElement("label", null, title) : null);
2925
2938
  }), /*#__PURE__*/React__default["default"].createElement("div", {
2926
2939
  className: "section-divider"
2927
2940
  }));
2941
+ })), /*#__PURE__*/React__default["default"].createElement("footer", null, /*#__PURE__*/React__default["default"].createElement(Icon, {
2942
+ icon: toggleIcon,
2943
+ clickable: true,
2944
+ action: toggle
2928
2945
  })));
2929
2946
  };
2930
2947
  /**
@@ -3379,8 +3396,6 @@
3379
3396
  if (isHidden) {
3380
3397
  return null;
3381
3398
  } else {
3382
- console.log("FieldEditor: ", label, value1);
3383
-
3384
3399
  switch (type) {
3385
3400
  case TYPES.ENTITY:
3386
3401
  return /*#__PURE__*/React__default["default"].createElement(EntityEditor, {