@kep-platform/basic-component 0.0.25 → 0.0.27
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/BoxShadowBox/BoxShadowBox.d.ts +3 -1
- package/dist/BoxShadowBox/BoxShadowBox.js +5 -1
- package/dist/Columns/Columns.d.ts +9 -4
- package/dist/Columns/Columns.js +5 -2
- package/dist/Input/Input.d.ts +6 -0
- package/dist/Input/Input.js +21 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Input/index.js +1 -0
- package/dist/List/List.d.ts +11 -1
- package/dist/List/List.js +47 -9
- package/dist/Menu/Menu.js +4 -0
- package/dist/PopupBox/PopupBox.d.ts +1 -1
- package/dist/PopupBox/PopupBox.js +3 -14
- package/dist/Select/Select.d.ts +14 -1
- package/dist/Select/Select.js +13 -4
- package/dist/Spin/Spin.js +6 -2
- package/dist/Table/Table.js +16 -6
- package/dist/Tree/Tree.js +10 -2
- package/dist/Tree/TreeNode.js +5 -0
- package/package.json +3 -3
@@ -4,5 +4,7 @@ export type BoxShadowBoxProps = {
|
|
4
4
|
offsetLeft?: string;
|
5
5
|
height: string;
|
6
6
|
};
|
7
|
-
declare const BoxShadowBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
7
|
+
declare const BoxShadowBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
8
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
9
|
+
}, BoxShadowBoxProps>> & string;
|
8
10
|
export default BoxShadowBox;
|
@@ -1,5 +1,9 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
var BoxShadowBox = styled
|
2
|
+
var BoxShadowBox = styled('div').withConfig({
|
3
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
4
|
+
return !['offsetLeft'].includes(prop);
|
5
|
+
}
|
6
|
+
}).withConfig({
|
3
7
|
displayName: "BoxShadowBox",
|
4
8
|
componentId: "basic-component-347b__sc-18cvhyx-0"
|
5
9
|
})(["z-index:", ";width:", ";box-shadow:var(--kep-platform-box-shadow-inset);background-color:transparent;position:absolute;top:0;left:", ";height:", ";transition:opacity 0.5s;"], function (props) {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React, { HtmlHTMLAttributes } from 'react';
|
2
|
+
import { ListItemProps } from '../List/List';
|
2
3
|
export declare const DefaultColumnWidth = 200;
|
3
4
|
export type ColumnsProps = {
|
4
5
|
columns: ColumnType[];
|
@@ -8,9 +9,12 @@ export type ColumnsProps = {
|
|
8
9
|
leftBase?: number;
|
9
10
|
columnsKey?: string;
|
10
11
|
} & HtmlHTMLAttributes<HTMLUListElement>;
|
11
|
-
export declare const Column: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<
|
12
|
-
|
13
|
-
|
12
|
+
export declare const Column: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<{
|
13
|
+
key: React.Key;
|
14
|
+
title?: React.ReactNode;
|
15
|
+
index?: number | undefined;
|
16
|
+
itemRender?: ListItemRender | undefined;
|
17
|
+
} & Omit<React.HtmlHTMLAttributes<HTMLLIElement>, "title">, Omit<ColumnType, "render" | "dataIndex"> & {
|
14
18
|
key: React.Key;
|
15
19
|
title?: React.ReactNode;
|
16
20
|
index?: number | undefined;
|
@@ -18,8 +22,9 @@ export declare const Column: import("styled-components/dist/types").IStyledCompo
|
|
18
22
|
} & Omit<React.HtmlHTMLAttributes<HTMLLIElement>, "title"> & {
|
19
23
|
isFlex: boolean;
|
20
24
|
bordered?: boolean | undefined;
|
25
|
+
focused?: boolean | undefined;
|
21
26
|
} & {
|
22
27
|
left?: string | undefined;
|
23
28
|
right?: string | undefined;
|
24
|
-
}>> & string
|
29
|
+
}>> & string & Omit<React.FC<ListItemProps>, keyof React.Component<any, {}, any>>;
|
25
30
|
export default function Columns({ columns, rowData, rowIndex, isFlex, leftBase, columnsKey, ...columnsRestProps }: ColumnsProps): React.JSX.Element;
|
package/dist/Columns/Columns.js
CHANGED
@@ -10,7 +10,7 @@ export var DefaultColumnWidth = 200;
|
|
10
10
|
//如果是flex模式的话,就不使用宽度来控制,而是直接交给flex布局
|
11
11
|
var ColumnList = styled(List).withConfig({
|
12
12
|
shouldForwardProp: function shouldForwardProp(prop) {
|
13
|
-
return !['widthSum', 'isFlex'].includes(prop);
|
13
|
+
return !['widthSum', 'bordered', 'isFlex', 'rowIndex'].includes(prop);
|
14
14
|
}
|
15
15
|
}).withConfig({
|
16
16
|
displayName: "ColumnList",
|
@@ -24,7 +24,7 @@ var ColumnList = styled(List).withConfig({
|
|
24
24
|
});
|
25
25
|
export var Column = styled(ListItem).withConfig({
|
26
26
|
shouldForwardProp: function shouldForwardProp(prop) {
|
27
|
-
return !['width', 'isFlex', '
|
27
|
+
return !['width', 'isFlex', 'bordered', 'hideInTable', 'filter', 'sorter', 'rowIndex', 'focused'].includes(prop);
|
28
28
|
}
|
29
29
|
}).withConfig({
|
30
30
|
displayName: "Column",
|
@@ -52,6 +52,9 @@ export var Column = styled(ListItem).withConfig({
|
|
52
52
|
if (props.fixed === 'right' && !props.isFlex) {
|
53
53
|
return css(["right:", ";z-index:var(--kep-platform-z-index-fixed) - 1;"], props.right);
|
54
54
|
}
|
55
|
+
if (props.focused) {
|
56
|
+
return css(["z-index:20 !important;"]);
|
57
|
+
}
|
55
58
|
});
|
56
59
|
var displayColumnsCache = {};
|
57
60
|
export default function Columns(_ref) {
|
@@ -0,0 +1,21 @@
|
|
1
|
+
var _excluded = ["value", "onChange"];
|
2
|
+
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); }
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
|
+
import React from 'react';
|
6
|
+
import styled from 'styled-components';
|
7
|
+
var StyledInput = styled.input.withConfig({
|
8
|
+
displayName: "StyledInput",
|
9
|
+
componentId: "basic-component-347b__sc-ojuww7-0"
|
10
|
+
})(["outline:none;box-shadow:none;border:1px solid var(--kep-platform-color-border);border-radius:var(--kep-platform-border-radius-sm);&:hover{border-color:var(--kep-platform-color-primary);}"]);
|
11
|
+
export default function Input(props) {
|
12
|
+
var value = props.value,
|
13
|
+
_onChange = props.onChange,
|
14
|
+
rest = _objectWithoutProperties(props, _excluded);
|
15
|
+
return /*#__PURE__*/React.createElement(StyledInput, _extends({}, rest, {
|
16
|
+
value: value,
|
17
|
+
onChange: function onChange(e) {
|
18
|
+
_onChange === null || _onChange === void 0 || _onChange(e.target.value);
|
19
|
+
}
|
20
|
+
}));
|
21
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as Input, type InputProps } from './Input';
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as Input } from "./Input";
|
package/dist/List/List.d.ts
CHANGED
@@ -14,6 +14,16 @@ export type ListItemProps = {
|
|
14
14
|
index?: number;
|
15
15
|
itemRender?: ListItemRender;
|
16
16
|
} & Omit<HtmlHTMLAttributes<HTMLLIElement>, 'title'>;
|
17
|
-
export declare const
|
17
|
+
export declare const StyledLi: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
18
|
+
ref?: ((instance: HTMLLIElement | null) => void) | React.RefObject<HTMLLIElement> | null | undefined;
|
19
|
+
}, {
|
20
|
+
key: Key;
|
21
|
+
title?: ReactNode;
|
22
|
+
index?: number | undefined;
|
23
|
+
itemRender?: ListItemRender | undefined;
|
24
|
+
} & Omit<React.HtmlHTMLAttributes<HTMLLIElement>, "title"> & {
|
25
|
+
focused: boolean;
|
26
|
+
}>> & string;
|
27
|
+
export declare const ListItem: React.FC<ListItemProps>;
|
18
28
|
declare const List: React.FC<ListProps>;
|
19
29
|
export default List;
|
package/dist/List/List.js
CHANGED
@@ -1,10 +1,18 @@
|
|
1
|
-
var _excluded = ["
|
2
|
-
_excluded2 = ["
|
1
|
+
var _excluded = ["onClick"],
|
2
|
+
_excluded2 = ["items", "direction", "itemRender", "children"],
|
3
|
+
_excluded3 = ["key", "title"];
|
3
4
|
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); }
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
9
|
+
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; } }
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
4
11
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
5
12
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
6
|
-
import
|
7
|
-
import
|
13
|
+
import { useClickOutsize } from '@kep-platform/hooks';
|
14
|
+
import React, { useCallback, useRef, useState } from 'react';
|
15
|
+
import styled, { css } from 'styled-components';
|
8
16
|
|
9
17
|
//因为UL自带有title属性
|
10
18
|
|
@@ -14,10 +22,40 @@ var StyledUL = styled.ul.withConfig({
|
|
14
22
|
})(["display:flex;flex-direction:", ";"], function (props) {
|
15
23
|
return props.direction || 'row';
|
16
24
|
});
|
17
|
-
export var
|
18
|
-
|
25
|
+
export var StyledLi = styled('li').withConfig({
|
26
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
27
|
+
return !['focused'].includes(prop);
|
28
|
+
}
|
29
|
+
}).withConfig({
|
30
|
+
displayName: "StyledLi",
|
19
31
|
componentId: "basic-component-347b__sc-1ombcxm-1"
|
20
|
-
})(["flex:0 0 auto;"])
|
32
|
+
})(["flex:0 0 auto;", ""], function (props) {
|
33
|
+
if (props.focused) {
|
34
|
+
return css(["z-index:20 !important;"]);
|
35
|
+
}
|
36
|
+
});
|
37
|
+
export var ListItem = function ListItem(props) {
|
38
|
+
var onClick = props.onClick,
|
39
|
+
rest = _objectWithoutProperties(props, _excluded);
|
40
|
+
var ref = useRef(null);
|
41
|
+
var _useState = useState(false),
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
43
|
+
focused = _useState2[0],
|
44
|
+
setFocused = _useState2[1];
|
45
|
+
var onClickHandler = useCallback(function (e) {
|
46
|
+
onClick === null || onClick === void 0 || onClick(e);
|
47
|
+
setFocused(true);
|
48
|
+
}, [onClick, setFocused]);
|
49
|
+
useClickOutsize('click', ref, function () {
|
50
|
+
setFocused(false);
|
51
|
+
});
|
52
|
+
return /*#__PURE__*/React.createElement(StyledLi, _extends({}, rest, {
|
53
|
+
title: "li",
|
54
|
+
focused: focused,
|
55
|
+
onClick: onClickHandler,
|
56
|
+
ref: ref
|
57
|
+
}));
|
58
|
+
};
|
21
59
|
|
22
60
|
/* 理论上来说所有list相关的数据结构都应该交给List组件来完成,但是List组件只处理List结构不处理任何其他样式问题 */
|
23
61
|
var List = function List(_ref) {
|
@@ -26,13 +64,13 @@ var List = function List(_ref) {
|
|
26
64
|
direction = _ref$direction === void 0 ? 'row' : _ref$direction,
|
27
65
|
itemRender = _ref.itemRender,
|
28
66
|
children = _ref.children,
|
29
|
-
rest = _objectWithoutProperties(_ref,
|
67
|
+
rest = _objectWithoutProperties(_ref, _excluded2);
|
30
68
|
return /*#__PURE__*/React.createElement(StyledUL, _extends({
|
31
69
|
direction: direction
|
32
70
|
}, rest), items && Array.isArray(items) ? items.map(function (item, index) {
|
33
71
|
var key = item.key,
|
34
72
|
title = item.title,
|
35
|
-
rest = _objectWithoutProperties(item,
|
73
|
+
rest = _objectWithoutProperties(item, _excluded3);
|
36
74
|
return /*#__PURE__*/React.createElement(ListItem, _extends({
|
37
75
|
key: key
|
38
76
|
}, rest), itemRender ? itemRender(item, index) : title);
|
package/dist/Menu/Menu.js
CHANGED
@@ -17,6 +17,10 @@ var MenuList = styled(List).withConfig({
|
|
17
17
|
componentId: "basic-component-347b__sc-d665dh-0"
|
18
18
|
})([""]);
|
19
19
|
var MenuListItem = styled(ListItem).withConfig({
|
20
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
21
|
+
return !['active'].includes(prop);
|
22
|
+
}
|
23
|
+
}).withConfig({
|
20
24
|
displayName: "MenuListItem",
|
21
25
|
componentId: "basic-component-347b__sc-d665dh-1"
|
22
26
|
})(["background-color:var(--kep-platform-color-bg-base);border-radius:var(--kep-platform-border-radius-sm);margin:var(--kep-platform-margin-xxxs);padding:0 var(--kep-platform-padding-xs);height:var(--kep-platform-menu-item-height);line-height:var(--kep-platform-menu-item-line-height);color:var(--kep-platform-color-text) !important;&:hover{background-color:var(--kep-platform-color-bg-hover);}", ""], function (props) {
|
@@ -17,5 +17,5 @@ export declare function Popup(props: {
|
|
17
17
|
trigger?: TriggerType;
|
18
18
|
content?: ReactNode;
|
19
19
|
onVisibleChange?: (visible: boolean) => void;
|
20
|
-
}): React.
|
20
|
+
}): React.JSX.Element | undefined;
|
21
21
|
export default PopupBox;
|
@@ -6,7 +6,6 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
7
7
|
import { useClickOutsize } from '@kep-platform/hooks';
|
8
8
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
9
|
-
import { createRoot } from 'react-dom/client';
|
10
9
|
import styled, { css } from 'styled-components';
|
11
10
|
var PopupBox = styled('div').withConfig({
|
12
11
|
shouldForwardProp: function shouldForwardProp(prop) {
|
@@ -18,8 +17,6 @@ var PopupBox = styled('div').withConfig({
|
|
18
17
|
})(["background-color:var(--kep-platform-color-bg-base);padding:var(--kep-platform-padding-xs);border-radius:var(--kep-platform-border-radius-sm);position:fixed;box-shadow:var(--kep-platform-box-shadow);z-index:999;", ";"], function (props) {
|
19
18
|
if (props.visible) return css(["left:", "px;top:", "px;"], props.left || -999, props.top || -999);else return css(["left:-9999px;top:-9999px;"]);
|
20
19
|
});
|
21
|
-
var dom;
|
22
|
-
var root;
|
23
20
|
export function Popup(props) {
|
24
21
|
var children = props.children,
|
25
22
|
_props$trigger = props.trigger,
|
@@ -73,21 +70,13 @@ export function Popup(props) {
|
|
73
70
|
useEffect(function () {
|
74
71
|
if (typeof outerVisible === 'boolean') setVisible(outerVisible);
|
75
72
|
}, [outerVisible]);
|
76
|
-
|
77
|
-
|
78
|
-
dom = document.createElement('div');
|
79
|
-
document.body.appendChild(dom);
|
80
|
-
root = createRoot(dom);
|
81
|
-
}
|
82
|
-
root.render( /*#__PURE__*/React.createElement(PopupBox, {
|
73
|
+
if ( /*#__PURE__*/React.isValidElement(children)) {
|
74
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PopupBox, {
|
83
75
|
left: pos.left,
|
84
76
|
top: pos.top,
|
85
77
|
visible: visible,
|
86
78
|
ref: popupBox
|
87
|
-
}, content));
|
88
|
-
}, [visible, content]);
|
89
|
-
if ( /*#__PURE__*/React.isValidElement(children)) {
|
90
|
-
return /*#__PURE__*/React.cloneElement(children, mergeProps);
|
79
|
+
}, content), /*#__PURE__*/React.cloneElement(children, mergeProps));
|
91
80
|
} else console.warn('PopupMenu需要一个触发元素!');
|
92
81
|
}
|
93
82
|
export default PopupBox;
|
package/dist/Select/Select.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
|
+
import { ListItemProps } from '../List/List';
|
2
3
|
export type SelectOption = {
|
3
4
|
label: ReactNode;
|
4
5
|
value: string;
|
@@ -10,4 +11,16 @@ export type SelectProps = {
|
|
10
11
|
onChange?: (value: string) => void;
|
11
12
|
children?: ReactNode;
|
12
13
|
};
|
13
|
-
|
14
|
+
type SelectListItemProps = ListItemProps & {
|
15
|
+
active?: boolean;
|
16
|
+
};
|
17
|
+
declare function Select(props: SelectProps): React.JSX.Element;
|
18
|
+
declare namespace Select {
|
19
|
+
var Option: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<{
|
20
|
+
key: React.Key;
|
21
|
+
title?: React.ReactNode;
|
22
|
+
index?: number | undefined;
|
23
|
+
itemRender?: ListItemRender | undefined;
|
24
|
+
} & Omit<React.HtmlHTMLAttributes<HTMLLIElement>, "title">, SelectListItemProps>> & string & Omit<React.FC<ListItemProps>, keyof React.Component<any, {}, any>>;
|
25
|
+
}
|
26
|
+
export default Select;
|
package/dist/Select/Select.js
CHANGED
@@ -21,7 +21,11 @@ var SelectInput = styled.input.withConfig({
|
|
21
21
|
componentId: "basic-component-347b__sc-z3izsh-2"
|
22
22
|
})(["border-width:0;"]);
|
23
23
|
var fadeIn = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
|
24
|
-
var SelectPannel = styled
|
24
|
+
var SelectPannel = styled('div').withConfig({
|
25
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
26
|
+
return !['visible'].includes(prop);
|
27
|
+
}
|
28
|
+
}).withConfig({
|
25
29
|
displayName: "SelectPannel",
|
26
30
|
componentId: "basic-component-347b__sc-z3izsh-3"
|
27
31
|
})(["position:absolute;left:0;top:40px;width:100%;box-shadow:var(--kep-platform-box-shadow);border-radius:var(--kep-platform-border-radius);z-index:var(--kep-platform-z-index-popup-base);", ""], function (props) {
|
@@ -36,6 +40,10 @@ var SelectList = styled(List).withConfig({
|
|
36
40
|
componentId: "basic-component-347b__sc-z3izsh-4"
|
37
41
|
})([""]);
|
38
42
|
var SelectListItem = styled(ListItem).withConfig({
|
43
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
44
|
+
return !['active'].includes(prop);
|
45
|
+
}
|
46
|
+
}).withConfig({
|
39
47
|
displayName: "SelectListItem",
|
40
48
|
componentId: "basic-component-347b__sc-z3izsh-5"
|
41
49
|
})(["background-color:var(--kep-platform-color-bg-base);border-radius:var(--kep-platform-border-radius-sm);margin:var(--kep-platform-margin-xxxs);padding:0 var(--kep-platform-padding-xs);height:var(--kep-platform-menu-item-height);line-height:var(--kep-platform-menu-item-line-height);&:hover{background-color:var(--kep-platform-color-bg-hover);}", ""], function (props) {
|
@@ -83,7 +91,7 @@ export default function Select(props) {
|
|
83
91
|
});
|
84
92
|
var selectItems = useMemo(function () {
|
85
93
|
if (options) {
|
86
|
-
return options
|
94
|
+
return options.map(function (option) {
|
87
95
|
return /*#__PURE__*/React.createElement(SelectListItem, {
|
88
96
|
key: option.value,
|
89
97
|
active: option.value === mergeValue,
|
@@ -93,7 +101,7 @@ export default function Select(props) {
|
|
93
101
|
});
|
94
102
|
} else {
|
95
103
|
return React.Children.map(children, function (child) {
|
96
|
-
return /*#__PURE__*/React.createElement(SelectListItem, {
|
104
|
+
if ( /*#__PURE__*/React.isValidElement(child)) return /*#__PURE__*/React.createElement(SelectListItem, {
|
97
105
|
key: child.props.value,
|
98
106
|
"data-key": child.props.value,
|
99
107
|
active: child.props.value === mergeValue,
|
@@ -118,4 +126,5 @@ export default function Select(props) {
|
|
118
126
|
}, /*#__PURE__*/React.createElement(SelectList, {
|
119
127
|
direction: "column"
|
120
128
|
}, selectItems)));
|
121
|
-
}
|
129
|
+
}
|
130
|
+
Select.Option = SelectListItem;
|
package/dist/Spin/Spin.js
CHANGED
@@ -5,10 +5,14 @@ var SpinContainer = styled.div.withConfig({
|
|
5
5
|
displayName: "SpinContainer",
|
6
6
|
componentId: "basic-component-347b__sc-1s1g2fa-0"
|
7
7
|
})(["position:relative;"]);
|
8
|
-
var SpinMark = styled
|
8
|
+
var SpinMark = styled('div').withConfig({
|
9
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
10
|
+
return !['spinning'].includes(prop);
|
11
|
+
}
|
12
|
+
}).withConfig({
|
9
13
|
displayName: "SpinMark",
|
10
14
|
componentId: "basic-component-347b__sc-1s1g2fa-1"
|
11
|
-
})(["position:absolute;inset:0 0 0 0;background-color:rgba(255,255,255,0.
|
15
|
+
})(["position:absolute;inset:0 0 0 0;background-color:rgba(255,255,255,0.706);display:flex;justify-content:center;align-items:center;color:var(--kep-platform-color-primary);"]);
|
12
16
|
export default function Spin(props) {
|
13
17
|
return /*#__PURE__*/React.createElement(SpinContainer, null, props.children, /*#__PURE__*/React.createElement(SpinMark, {
|
14
18
|
spinning: props.spinning,
|
package/dist/Table/Table.js
CHANGED
@@ -27,6 +27,7 @@ import { BoxShadowBox } from "../BoxShadowBox";
|
|
27
27
|
import { Column, Columns } from "../Columns";
|
28
28
|
import { DefaultColumnWidth } from "../Columns/Columns";
|
29
29
|
import { Col, Row } from "../Grid";
|
30
|
+
import { Input } from "../Input";
|
30
31
|
import { List, ListItem } from "../List";
|
31
32
|
import { Pagination } from "../Pagination";
|
32
33
|
import { Popup } from "../PopupBox";
|
@@ -52,6 +53,10 @@ var TableBody = styled(List).withConfig({
|
|
52
53
|
componentId: "basic-component-347b__sc-12r61fm-4"
|
53
54
|
})([""]);
|
54
55
|
var TableBodyRow = styled(ListItem).withConfig({
|
56
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
57
|
+
return !['isActive'].includes(prop);
|
58
|
+
}
|
59
|
+
}).withConfig({
|
55
60
|
displayName: "TableBodyRow",
|
56
61
|
componentId: "basic-component-347b__sc-12r61fm-5"
|
57
62
|
})(["& ", "{", "}"], Column, function (props) {
|
@@ -73,6 +78,10 @@ var SortIconList = styled(List).withConfig({
|
|
73
78
|
componentId: "basic-component-347b__sc-12r61fm-7"
|
74
79
|
})([""]);
|
75
80
|
var SortIconListItem = styled(ListItem).withConfig({
|
81
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
82
|
+
return !['active'].includes(prop);
|
83
|
+
}
|
84
|
+
}).withConfig({
|
76
85
|
displayName: "SortIconListItem",
|
77
86
|
componentId: "basic-component-347b__sc-12r61fm-8"
|
78
87
|
})(["height:10px;line-height:10px;font-size:10px;cursor:pointer;user-select:none;color:", ";"], function (props) {
|
@@ -99,8 +108,10 @@ var SortIconGroup = function SortIconGroup(_ref) {
|
|
99
108
|
onClick: onSortIconGroupClickHandler,
|
100
109
|
hidden: hidden
|
101
110
|
}, /*#__PURE__*/React.createElement(SortIconListItem, {
|
111
|
+
key: "asc",
|
102
112
|
active: sorter === 'asc'
|
103
113
|
}, /*#__PURE__*/React.createElement(CaretUpOutlined, null)), /*#__PURE__*/React.createElement(SortIconListItem, {
|
114
|
+
key: "desc",
|
104
115
|
active: sorter === 'desc'
|
105
116
|
}, /*#__PURE__*/React.createElement(CaretDownOutlined, null)));
|
106
117
|
};
|
@@ -111,7 +122,7 @@ var ColumnTitle = styled.div.withConfig({
|
|
111
122
|
var FilterValue = styled.span.withConfig({
|
112
123
|
displayName: "FilterValue",
|
113
124
|
componentId: "basic-component-347b__sc-12r61fm-10"
|
114
|
-
})(["color:var(--kep-platform-color-primary);cursor:pointer;"]);
|
125
|
+
})(["color:var(--kep-platform-color-primary);cursor:pointer;padding:var(--kep-platform-padding-xxs);border-radius:var(--kep-platform-border-radius-sm);&:hover{background-color:var(--kep-platform-color-bg-active);}"]);
|
115
126
|
var ColumnTitleController = function ColumnTitleController(_ref2) {
|
116
127
|
var onSorterChange = _ref2.onSorterChange,
|
117
128
|
title = _ref2.title,
|
@@ -130,10 +141,10 @@ var ColumnTitleController = function ColumnTitleController(_ref2) {
|
|
130
141
|
onSorterChange: onSorterChange,
|
131
142
|
hidden: !hasSorter
|
132
143
|
}), hasFilter && /*#__PURE__*/React.createElement(Popup, {
|
133
|
-
content: /*#__PURE__*/React.createElement(
|
134
|
-
value: filterValue,
|
135
|
-
onChange: function onChange(
|
136
|
-
onFilterValueChange === null || onFilterValueChange === void 0 || onFilterValueChange(
|
144
|
+
content: /*#__PURE__*/React.createElement(Input, {
|
145
|
+
value: filterValue || '',
|
146
|
+
onChange: function onChange(value) {
|
147
|
+
onFilterValueChange === null || onFilterValueChange === void 0 || onFilterValueChange(value);
|
137
148
|
}
|
138
149
|
})
|
139
150
|
}, filter)));
|
@@ -348,7 +359,6 @@ export default function Table(_ref3) {
|
|
348
359
|
formatedDataSource = filterTableRows(formatedDataSource, filterValues);
|
349
360
|
return formatedDataSource;
|
350
361
|
}, [sorterController, dataSource, formatedColumns, pagination, filterValues]);
|
351
|
-
console.log(filterValues);
|
352
362
|
return /*#__PURE__*/React.createElement(TableContainer, null, (title || actions) && /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
353
363
|
span: 8
|
354
364
|
}, /*#__PURE__*/React.createElement(TableTitle, null, title)), /*#__PURE__*/React.createElement(Col, {
|
package/dist/Tree/Tree.js
CHANGED
@@ -10,7 +10,11 @@ import { DefaultColumnWidth } from "../Columns/Columns";
|
|
10
10
|
import { List } from "../List";
|
11
11
|
import { MainArea, MainProperty } from "./MainProperties";
|
12
12
|
import { TreeNodeController, nodeTypeMap } from "./TreeNode";
|
13
|
-
var TreeContainer = styled
|
13
|
+
var TreeContainer = styled('div').withConfig({
|
14
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
15
|
+
return !['bordered'].includes(prop);
|
16
|
+
}
|
17
|
+
}).withConfig({
|
14
18
|
displayName: "TreeContainer",
|
15
19
|
componentId: "basic-component-347b__sc-n4lkq9-0"
|
16
20
|
})(["position:relative;overflow-x:auto;border:1px solid var(--kep-platform-color-border-secondary);border-width:", ";"], function (props) {
|
@@ -20,7 +24,11 @@ var TreeBody = styled(List).withConfig({
|
|
20
24
|
displayName: "TreeBody",
|
21
25
|
componentId: "basic-component-347b__sc-n4lkq9-1"
|
22
26
|
})([""]);
|
23
|
-
var TreeHeader = styled
|
27
|
+
var TreeHeader = styled('div').withConfig({
|
28
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
29
|
+
return !['width', 'isFlex'].includes(prop);
|
30
|
+
}
|
31
|
+
}).withConfig({
|
24
32
|
displayName: "TreeHeader",
|
25
33
|
componentId: "basic-component-347b__sc-n4lkq9-2"
|
26
34
|
})(["", " background-color:var(--kep-platform-header-bg);& ", ",& ", "{background-color:var(--kep-platform-header-bg);font-weight:600;position:sticky;}"], function (props) {
|
package/dist/Tree/TreeNode.js
CHANGED
@@ -14,6 +14,10 @@ import { ListItem } from "../List";
|
|
14
14
|
import { Menu } from "../Menu";
|
15
15
|
import { MainArea, MainProperty } from "./MainProperties";
|
16
16
|
var ExpandedIcon = styled(CaretRightOutlined).withConfig({
|
17
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
18
|
+
return !['expanded'].includes(prop);
|
19
|
+
}
|
20
|
+
}).withConfig({
|
17
21
|
displayName: "ExpandedIcon",
|
18
22
|
componentId: "basic-component-347b__sc-tzoomn-0"
|
19
23
|
})(["transition:transform 0.5s;display:block;user-select:none;", ";font-size:var(--kep-platform-font-size-sm);&:hover{color:var(--kep-platform-color-primary);}"], function (props) {
|
@@ -204,6 +208,7 @@ export var TreeNodeController = function TreeNodeController(_ref) {
|
|
204
208
|
})
|
205
209
|
});
|
206
210
|
return /*#__PURE__*/React.createElement(React.Fragment, null, node.nodeType !== nodeTypeMap.virtual && /*#__PURE__*/React.createElement(TreeNode, {
|
211
|
+
key: node[fieldNames.key],
|
207
212
|
selected: selectedKeys.includes(node[fieldNames.key]),
|
208
213
|
width: width,
|
209
214
|
onClick: onClickNodeHandler,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@kep-platform/basic-component",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.27",
|
4
4
|
"description": "A react library developed with dumi",
|
5
5
|
"module": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -74,10 +74,10 @@
|
|
74
74
|
"react-dom": "^18.0.0",
|
75
75
|
"stylelint": "^14.9.1"
|
76
76
|
},
|
77
|
-
"gitHead": "
|
77
|
+
"gitHead": "e15c151ba5b1e41e42047a5b438620cf13c9c1bc",
|
78
78
|
"dependencies": {
|
79
79
|
"@ant-design/icons": "^5.3.7",
|
80
|
-
"@kep-platform/hooks": "^0.0.
|
80
|
+
"@kep-platform/hooks": "^0.0.27",
|
81
81
|
"color": "^4.2.3",
|
82
82
|
"rc-pagination": "^4.1.0",
|
83
83
|
"styled-components": "^6.1.11"
|