@chaoswise/ui 2.6.4 → 2.6.5

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.
@@ -23,6 +23,7 @@ import useConfigContext from '../useConfigContext';
23
23
  import classnames from 'classnames';
24
24
  import CollapsedBtn from "./CollapsedBtn";
25
25
  import { eventManager } from '../utils';
26
+ import { omit } from "lodash-es";
26
27
  import './index.less';
27
28
 
28
29
  /**
@@ -61,6 +62,7 @@ function AbreastLayout(_ref) {
61
62
  var isLeft = type === 'rightNavigation' || type === 'rightOperationArea';
62
63
  var isRight = type === 'leftNavigation' || type === 'leftOperationArea';
63
64
  var finalCollapsed = rest.collapsed !== undefined ? rest.collapsed : collapsed;
65
+ var omitRest = type === "rightOperationArea" || type === "leftOperationArea" ? omit(rest, ['minWidth', 'maxWidth']) : rest;
64
66
  var onCollapse = function onCollapse() {
65
67
  setCollapsed(function (pre) {
66
68
  return !pre;
@@ -94,7 +96,7 @@ function AbreastLayout(_ref) {
94
96
  })), /*#__PURE__*/React.createElement(Resizable, _extends({
95
97
  boundsByDirection: type === 'rightNavigation',
96
98
  bounds: "parent"
97
- }, rest, {
99
+ }, omitRest, {
98
100
  className: classnames({
99
101
  'cw-abreast-layout-sider': true,
100
102
  'cw-abreast-layout-left-navigation': isRight,
@@ -1,6 +1,8 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  import "@chaoswise/ui/lib/AbreastLayout/index.less";
3
3
  import _AbreastLayout from "@chaoswise/ui/lib/AbreastLayout";
4
+ var _excluded = ["md", "style", "className", "siderWidth"];
5
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
6
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
8
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -12,6 +14,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
12
14
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
15
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
16
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
17
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
18
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
15
19
  import React, { useRef, useEffect, useState } from 'react';
16
20
  import { marked } from 'marked';
17
21
  import PropTypes from 'prop-types';
@@ -30,7 +34,8 @@ var Documentation = function Documentation(_ref) {
30
34
  _ref$className = _ref.className,
31
35
  className = _ref$className === void 0 ? '' : _ref$className,
32
36
  _ref$siderWidth = _ref.siderWidth,
33
- siderWidth = _ref$siderWidth === void 0 ? 184 : _ref$siderWidth;
37
+ siderWidth = _ref$siderWidth === void 0 ? 184 : _ref$siderWidth,
38
+ rest = _objectWithoutProperties(_ref, _excluded);
34
39
  var markdownContainer = useRef(null);
35
40
  var timer = useRef(null);
36
41
  var tocify = useRef(null);
@@ -108,13 +113,15 @@ var Documentation = function Documentation(_ref) {
108
113
  width: '100%',
109
114
  height: '100%'
110
115
  }, style)
111
- }, /*#__PURE__*/React.createElement(_AbreastLayout, {
116
+ }, /*#__PURE__*/React.createElement(_AbreastLayout, _extends({
112
117
  SiderWidth: items.length ? siderWidth : 0,
113
118
  Siderbar: /*#__PURE__*/React.createElement("div", {
114
- className: "cw-documentation-sider"
119
+ className: classNames("cw-documentation-sider", {
120
+ "cw-documentation-nosider": siderWidth === 0
121
+ })
115
122
  }, tocify.current && tocify.current.render(items, markdownContainer.current, scrollToAnchor)),
116
123
  type: "rightOperationArea"
117
- }, /*#__PURE__*/React.createElement("div", {
124
+ }, rest), /*#__PURE__*/React.createElement("div", {
118
125
  ref: markdownContainer,
119
126
  className: "cw-documentation-container"
120
127
  })));
@@ -4,6 +4,10 @@
4
4
  height: 100%;
5
5
  overflow: auto;
6
6
  padding-left: 4px;
7
+ &.cw-documentation-nosider{
8
+ display: none;
9
+ padding-left: 0;
10
+ }
7
11
  }
8
12
  .cw-abreast-layout-content{
9
13
  overflow: hidden;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaoswise/ui",
3
- "version": "2.6.4",
3
+ "version": "2.6.5",
4
4
  "description": "公共UI库",
5
5
  "keywords": [
6
6
  "ui",
@@ -147,6 +147,5 @@
147
147
  "publishConfig": {
148
148
  "access": "public"
149
149
  },
150
- "license": "MIT",
151
- "gitHead": "a3ae4f5a2ca5bf1dd7570ada3b781dac5284c61c"
150
+ "license": "MIT"
152
151
  }