@lemon-fe/kits 1.0.0-120 → 1.0.0-121

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.
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import type { ReactNode, CSSProperties } from 'react';
2
+ import React from 'react';
3
3
  interface Tab {
4
4
  title?: ReactNode;
5
5
  key: string;
@@ -35,8 +35,8 @@ declare function Layout(props: Props): JSX.Element;
35
35
  declare namespace Layout {
36
36
  var Tabs: typeof LayoutTabs;
37
37
  var Content: (props: {
38
- children?: React.ReactNode;
39
- left?: React.ReactNode;
38
+ children?: ReactNode;
39
+ left?: ReactNode;
40
40
  tab?: string | undefined;
41
41
  forceRender?: boolean | undefined;
42
42
  } & Pick<Props, "onCollapse">) => JSX.Element;
@@ -46,4 +46,5 @@ declare function LayoutTabs(props: {
46
46
  tabs?: Tab[];
47
47
  activeKey?: string;
48
48
  onTabClick?: (activeKey: string, e: React.KeyboardEvent | React.MouseEvent) => void;
49
+ hideTabBar?: boolean;
49
50
  } & Omit<Props, 'body'>): JSX.Element;
@@ -1,4 +1,4 @@
1
- var _excluded = ["tabs", "children", "className", "activeKey", "onTabClick"];
1
+ var _excluded = ["tabs", "children", "className", "activeKey", "onTabClick", "hideTabBar"];
2
2
 
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
@@ -20,12 +20,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
20
20
 
21
21
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
22
 
23
+ import { mapChildren, prefixClassName } from "../utils";
24
+ import { Spin, Tabs } from 'antd';
25
+ import { Resizable } from 'react-resizable';
23
26
  import React, { useState } from 'react';
24
27
  import classNames from 'classnames';
25
- import { Spin, Tabs } from 'antd';
26
28
  import { get } from 'lodash';
27
- import { Resizable } from 'react-resizable';
28
- import { mapChildren, prefixClassName } from "../utils";
29
29
  var prefix = prefixClassName('layout');
30
30
 
31
31
  function Sider(props) {
@@ -190,14 +190,18 @@ function LayoutTabs(props) {
190
190
  className = props.className,
191
191
  activeKey = props.activeKey,
192
192
  onTabClick = props.onTabClick,
193
+ hideTabBar = props.hideTabBar,
193
194
  restProps = _objectWithoutProperties(props, _excluded);
194
195
 
195
196
  return /*#__PURE__*/React.createElement(Layout, _extends({
196
- className: classNames(className, prefix('tabs-wrapper')),
197
+ className: classNames(className, prefix('tabs-wrapper'), _defineProperty({}, prefix('tabs-hide-tab-bar'), hideTabBar)),
197
198
  body: /*#__PURE__*/React.createElement(Tabs, {
198
199
  activeKey: activeKey,
199
200
  onTabClick: onTabClick,
200
201
  className: prefix('tabs'),
202
+ renderTabBar: hideTabBar ? function () {
203
+ return null;
204
+ } : undefined,
201
205
  items: mapChildren(children, function (node, index) {
202
206
  var _get, _get2;
203
207
 
@@ -124,4 +124,21 @@
124
124
  justify-content: center;
125
125
  background-color: rgba(255, 255, 255, 0.5);
126
126
  }
127
+
128
+ &-main > & {
129
+ flex: 1;
130
+ }
131
+
132
+ .@{prefixCls}-section + &&-tabs-wrapper {
133
+ margin-top: (-@space-v + 5px);
134
+ }
135
+
136
+ .@{prefixCls}-section + &:not(&-tabs-wrapper),
137
+ .@{prefixCls}-section + &&-tabs-hide-tab-bar {
138
+ margin-top: -@space-v;
139
+ }
140
+
141
+ & + .@{prefixCls}-section {
142
+ padding-top: 0;
143
+ }
127
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.0.0-120",
3
+ "version": "1.0.0-121",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",