@kep-platform/basic-component 0.0.64 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ import React from 'react';
9
9
  import styled from 'styled-components';
10
10
  import { Button } from "../Button";
11
11
  import { Select } from "../Select";
12
- var StyledRCPagination = styled(RCPagination)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n list-style: none;\n display: flex;\n justify-content: ", ";\n align-items: center;\n & > * {\n margin: 0 var(--kep-platform-margin-xxs);\n }\n & .rc-pagination-item {\n cursor: pointer;\n padding: var(--kep-platform-padding-xxs) var(--kep-platform-padding-xs);\n border: 1px solid transparent;\n border-radius: var(--kep-platform-border-radius-sm);\n & a {\n color: var(--kep-platform-color-text);\n }\n &:hover {\n background-color: var(--kep-platform-color-bg-hover);\n }\n &.rc-pagination-item-active {\n border: 1px solid var(--kep-platform-color-primary);\n a {\n color: var(--kep-platform-color-primary);\n }\n }\n }\n & .rc-pagination-prev {\n }\n & .rc-pagination-disabled {\n }\n\n & .rc-pagination-next {\n }\n\n & .rc-pagintaion-options {\n }\n\n & .rc-pagination-jump-next {\n }\n & .rc-pagination-options-quick-jumper {\n & input {\n margin: 0 var(--kep-platform-margin-xs);\n border-radius: var(--kep-platform-border-radius-sm);\n border: 1px solid var(--kep-platform-color-border);\n padding: var(--kep-platform-padding-xxs) var(--kep-platform-padding-xs);\n &:active,\n &:focus {\n border-color: var(--kep-platform-color-primary);\n }\n }\n }\n"])), function (props) {
12
+ var StyledRCPagination = styled(RCPagination)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n list-style: none;\n display: flex;\n justify-content: ", ";\n align-items: center;\n & > * {\n margin: 0 var(--kep-platform-margin-xxs);\n }\n & .rc-pagination-item {\n font-size: 14px;\n cursor: pointer;\n padding: 0 var(--kep-platform-padding-xs);\n border: 1px solid transparent;\n border-radius: var(--kep-platform-border-radius-sm);\n & a {\n color: var(--kep-platform-color-text);\n }\n &:hover {\n background-color: var(--kep-platform-color-bg-hover);\n }\n &.rc-pagination-item-active {\n border: 1px solid var(--kep-platform-color-primary);\n a {\n color: var(--kep-platform-color-primary);\n }\n }\n }\n & .rc-pagination-prev {\n }\n & .rc-pagination-disabled {\n }\n\n & .rc-pagination-next {\n }\n\n & .rc-pagintaion-options {\n }\n\n & .rc-pagination-jump-next {\n }\n & .rc-pagination-options-quick-jumper {\n & input {\n margin: 0 var(--kep-platform-margin-xs);\n border-radius: var(--kep-platform-border-radius-sm);\n border: 1px solid var(--kep-platform-color-border);\n padding: 0 var(--kep-platform-padding-xxs);\n &:active,\n &:focus {\n border-color: var(--kep-platform-color-primary);\n }\n }\n }\n"])), function (props) {
13
13
  return props.justifyContent;
14
14
  });
15
15
  var Pagination = function Pagination(_ref) {
@@ -20,10 +20,14 @@ var Pagination = function Pagination(_ref) {
20
20
  justifyContent: justifyContent
21
21
  }, rest, {
22
22
  nextIcon: function nextIcon() {
23
- return /*#__PURE__*/React.createElement(Button, null, "\u4E0B\u4E00\u9875");
23
+ return /*#__PURE__*/React.createElement(Button, {
24
+ size: "small"
25
+ }, "\u4E0B\u4E00\u9875");
24
26
  },
25
27
  prevIcon: function prevIcon() {
26
- return /*#__PURE__*/React.createElement(Button, null, "\u4E0A\u4E00\u9875");
28
+ return /*#__PURE__*/React.createElement(Button, {
29
+ size: "small"
30
+ }, "\u4E0A\u4E00\u9875");
27
31
  },
28
32
  jumpNextIcon: function jumpNextIcon() {
29
33
  return /*#__PURE__*/React.createElement("span", {
@@ -17,5 +17,5 @@ export declare function Popup(props: {
17
17
  trigger?: TriggerType;
18
18
  content?: ReactNode;
19
19
  onVisibleChange?: (visible: boolean) => void;
20
- }): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
20
+ }): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
21
21
  export default PopupBox;
@@ -11,7 +11,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
11
11
  import styled, { css, keyframes } from 'styled-components';
12
12
  import { List, ListItem } from "../List";
13
13
  var SelectContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 200px;\n position: relative;\n"])));
14
- var SelectTrigger = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n height: 40px;\n line-height: calc(40px - 2 * var(--kep-platform-padding-xxs));\n border: 1px solid var(--kep-platform-color-border);\n border-radius: var(--kep-platform-border-radius);\n padding: var(--kep-platform-padding-xxs) var(--kep-platform-padding-xs);\n"])));
14
+ var SelectTrigger = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n height: 32px;\n font-size: 14px;\n line-height: calc(32px - 2 * var(--kep-platform-padding-xxs));\n border: 1px solid var(--kep-platform-color-border);\n border-radius: var(--kep-platform-border-radius);\n padding: 0 var(--kep-platform-padding-xs);\n"])));
15
15
  var SelectInput = styled.input(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-width: 0;\n"])));
16
16
  var fadeIn = keyframes(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n"])));
17
17
  var SelectPannel = styled('div').withConfig({
@@ -30,7 +30,7 @@ var SelectListItem = styled(ListItem).withConfig({
30
30
  shouldForwardProp: function shouldForwardProp(prop) {
31
31
  return !['active'].includes(prop);
32
32
  }
33
- })(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n background-color: var(--kep-platform-color-bg-base);\n border-radius: var(--kep-platform-border-radius-sm);\n margin: var(--kep-platform-margin-xxxs);\n padding: 0 var(--kep-platform-padding-xs);\n height: var(--kep-platform-menu-item-height);\n line-height: var(--kep-platform-menu-item-line-height);\n &:hover {\n background-color: var(--kep-platform-color-bg-hover);\n }\n ", "\n"])), function (props) {
33
+ })(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n background-color: var(--kep-platform-color-bg-base);\n border-radius: var(--kep-platform-border-radius-sm);\n margin: var(--kep-platform-margin-xxxs);\n padding: 0 var(--kep-platform-padding-xs);\n font-size: 14px;\n height: var(--kep-platform-menu-item-height-sm);\n line-height: var(--kep-platform-menu-item-line-height-sm);\n &:hover {\n background-color: var(--kep-platform-color-bg-hover);\n }\n ", "\n"])), function (props) {
34
34
  if (props.active) {
35
35
  return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background-color: var(--kep-platform-color-bg-active) !important;\n color: var(--kep-platform-color-text-active) !important;\n "])));
36
36
  }
@@ -19,6 +19,7 @@ export type TableProps = {
19
19
  empty?: ReactNode;
20
20
  rowSelection?: RowSelection;
21
21
  multiple?: boolean;
22
+ tableContentRef?: React.RefObject<HTMLDivElement>;
22
23
  };
23
- export default function Table({ columns, dataSource, rowKey, scroll, onChange, headerRender, pagination: outerPagination, empty, rowSelection, multiple, }: TableProps): React.JSX.Element;
24
+ export default function Table({ columns, dataSource, rowKey, scroll, onChange, headerRender, pagination: outerPagination, empty, rowSelection, multiple, tableContentRef, }: TableProps): React.JSX.Element;
24
25
  export {};
@@ -164,7 +164,8 @@ export default function Table(_ref3) {
164
164
  _ref3$empty = _ref3.empty,
165
165
  empty = _ref3$empty === void 0 ? /*#__PURE__*/React.createElement(React.Fragment, null) : _ref3$empty,
166
166
  rowSelection = _ref3.rowSelection,
167
- multiple = _ref3.multiple;
167
+ multiple = _ref3.multiple,
168
+ tableContentRef = _ref3.tableContentRef;
168
169
  var _useState = useState(null),
169
170
  _useState2 = _slicedToArray(_useState, 2),
170
171
  sorterController = _useState2[0],
@@ -356,7 +357,8 @@ export default function Table(_ref3) {
356
357
  }
357
358
  },
358
359
  scroll: scroll,
359
- isFlex: isFlex
360
+ isFlex: isFlex,
361
+ ref: tableContentRef
360
362
  }, !isFlex && /*#__PURE__*/React.createElement(BoxShadowBox, {
361
363
  ref: boxShadowBox,
362
364
  width: "10px",
@@ -414,7 +416,7 @@ export default function Table(_ref3) {
414
416
  columns: formatedColumns,
415
417
  isFlex: isFlex
416
418
  }));else return undefined;
417
- })) : empty), pagination !== false && ((pagination === null || pagination === void 0 ? void 0 : pagination.total) || dataSource.length) !== 0 && /*#__PURE__*/React.createElement(Pagination, _extends({}, pagination, {
419
+ })) : empty), /*#__PURE__*/React.createElement("br", null), pagination !== false && ((pagination === null || pagination === void 0 ? void 0 : pagination.total) || dataSource.length) !== 0 && /*#__PURE__*/React.createElement(Pagination, _extends({}, pagination, {
418
420
  total: (pagination === null || pagination === void 0 ? void 0 : pagination.total) || dataSource.length,
419
421
  justifyContent: "right",
420
422
  onChange: function onChange(current, pageSize) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kep-platform/basic-component",
3
- "version": "0.0.64",
3
+ "version": "0.2.0",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@ant-design/icons": "^5.3.7",
50
- "@kep-platform/hooks": "^0.0.64",
50
+ "@kep-platform/hooks": "^0.2.0",
51
51
  "color": "^4.2.3",
52
52
  "rc-pagination": "^4.1.0"
53
53
  },
@@ -87,5 +87,5 @@
87
87
  "authors": [
88
88
  "less-step-jss 1599925910@qq.com"
89
89
  ],
90
- "gitHead": "d4c2c36b1c71bd4a464aa96976f51f4e9eca87ec"
90
+ "gitHead": "54a6f029d61a1bd43f18e5d9021193c18307cb4b"
91
91
  }