@antscorp/antsomi-ui 1.3.5-beta.683 → 1.3.5-beta.684
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/es/components/molecules/MatchAnySelect/styled.d.ts +1 -10
- package/es/components/molecules/Tree/Tree.d.ts +26 -2
- package/es/components/molecules/Tree/Tree.js +26 -1
- package/es/components/molecules/Tree/index.d.ts +1 -0
- package/es/components/molecules/Tree/index.js +1 -0
- package/es/components/molecules/Tree/styled.d.ts +16 -0
- package/es/components/molecules/Tree/styled.js +24 -0
- package/es/components/molecules/Tree/utils.d.ts +10 -0
- package/es/components/molecules/Tree/utils.js +17 -0
- package/es/constants/theme.js +12 -10
- package/package.json +1 -1
|
@@ -7,16 +7,7 @@ export declare const GroupSelectButton: import("styled-components").StyledCompon
|
|
|
7
7
|
Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
|
|
8
8
|
}, any, {}, never>;
|
|
9
9
|
export declare const ActionButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
10
|
-
export declare const StyledTree: import("styled-components").StyledComponent<
|
|
11
|
-
children?: import("react").ReactNode;
|
|
12
|
-
} & import("react").RefAttributes<import("rc-tree").default<import("rc-tree/lib/interface").DataNode>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
13
|
-
TreeNode: import("react").FC<import("rc-tree").TreeNodeProps<import("rc-tree/lib/interface").DataNode>>;
|
|
14
|
-
DirectoryTree: (<T_1 extends import("rc-tree").BasicDataNode | import("rc-tree/lib/interface").DataNode = import("rc-tree/lib/interface").DataNode>(props: import("antd/es/tree").DirectoryTreeProps<T_1> & {
|
|
15
|
-
children?: import("react").ReactNode;
|
|
16
|
-
} & import("react").RefAttributes<import("rc-tree").default<import("rc-tree/lib/interface").DataNode>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
17
|
-
displayName?: string | undefined;
|
|
18
|
-
};
|
|
19
|
-
}, any, {}, never>;
|
|
10
|
+
export declare const StyledTree: import("styled-components").StyledComponent<import("react").ComponentType<any> | keyof import("react").JSX.IntrinsicElements, any, any, any>;
|
|
20
11
|
export declare const TextArea: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef>>, any, {}, never>;
|
|
21
12
|
export declare const ExtraValueLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
13
|
export declare const ItemStatus: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="hoist-non-react-statics" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Tree as AntdTree } from 'antd';
|
|
4
|
+
import type { TreeProps, TreeDataNode } from 'antd';
|
|
5
|
+
export declare const Tree: string & import("styled-components").StyledComponentBase<(<T extends import("rc-tree").BasicDataNode | TreeDataNode = TreeDataNode>(props: TreeProps<T> & {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
} & React.RefAttributes<import("rc-tree").default<TreeDataNode>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
8
|
+
TreeNode: React.FC<import("rc-tree").TreeNodeProps<TreeDataNode>>;
|
|
9
|
+
DirectoryTree: (<T_1 extends import("rc-tree").BasicDataNode | TreeDataNode = TreeDataNode>(props: import("antd/es/tree").DirectoryTreeProps<T_1> & {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
} & React.RefAttributes<import("rc-tree").default<TreeDataNode>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
12
|
+
displayName?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
}, any, any, never> & import("hoist-non-react-statics").NonReactStatics<(<T extends import("rc-tree").BasicDataNode | TreeDataNode = TreeDataNode>(props: TreeProps<T> & {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
} & React.RefAttributes<import("rc-tree").default<TreeDataNode>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
17
|
+
TreeNode: React.FC<import("rc-tree").TreeNodeProps<TreeDataNode>>;
|
|
18
|
+
DirectoryTree: (<T_1 extends import("rc-tree").BasicDataNode | TreeDataNode = TreeDataNode>(props: import("antd/es/tree").DirectoryTreeProps<T_1> & {
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
} & React.RefAttributes<import("rc-tree").default<TreeDataNode>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
21
|
+
displayName?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
}, {}> & {
|
|
24
|
+
DirectoryTree: typeof AntdTree.DirectoryTree;
|
|
25
|
+
};
|
|
26
|
+
export type { TreeProps, TreeDataNode };
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
// styled
|
|
14
|
+
import { StyledTree, StyledTreeDirectory } from './styled';
|
|
15
|
+
// icon
|
|
16
|
+
import { ExpandMoreIcon } from '../../icons';
|
|
17
|
+
const StandardTree = props => {
|
|
18
|
+
const { switcherIcon = React.createElement(ExpandMoreIcon, null) } = props, restProps = __rest(props, ["switcherIcon"]);
|
|
19
|
+
return React.createElement(StyledTree, Object.assign({ switcherIcon: switcherIcon }, restProps));
|
|
20
|
+
};
|
|
21
|
+
export const Tree = StandardTree;
|
|
22
|
+
const DirectoryTree = props => {
|
|
23
|
+
const { switcherIcon = React.createElement(ExpandMoreIcon, null) } = props, restProps = __rest(props, ["switcherIcon"]);
|
|
24
|
+
return React.createElement(StyledTreeDirectory, Object.assign({ switcherIcon: switcherIcon }, restProps));
|
|
25
|
+
};
|
|
26
|
+
Tree.DirectoryTree = DirectoryTree;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledTree: import("styled-components").StyledComponent<(<T extends import("rc-tree").BasicDataNode | import("antd").TreeDataNode = import("antd").TreeDataNode>(props: import("antd").TreeProps<T> & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
} & import("react").RefAttributes<import("rc-tree").default<import("antd").TreeDataNode>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
5
|
+
TreeNode: import("react").FC<import("rc-tree").TreeNodeProps<import("antd").TreeDataNode>>;
|
|
6
|
+
DirectoryTree: (<T_1 extends import("rc-tree").BasicDataNode | import("antd").TreeDataNode = import("antd").TreeDataNode>(props: import("antd/es/tree").DirectoryTreeProps<T_1> & {
|
|
7
|
+
children?: import("react").ReactNode;
|
|
8
|
+
} & import("react").RefAttributes<import("rc-tree").default<import("antd").TreeDataNode>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
9
|
+
displayName?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
}, any, any, never>;
|
|
12
|
+
export declare const StyledTreeDirectory: import("styled-components").StyledComponent<(<T extends import("rc-tree").BasicDataNode | import("antd").TreeDataNode = import("antd").TreeDataNode>(props: import("antd/es/tree").DirectoryTreeProps<T> & {
|
|
13
|
+
children?: import("react").ReactNode;
|
|
14
|
+
} & import("react").RefAttributes<import("rc-tree").default<import("antd").TreeDataNode>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
15
|
+
displayName?: string | undefined;
|
|
16
|
+
}, any, any, never>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Tree } from 'antd';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const StyledTree = styled(Tree) `
|
|
4
|
+
.antsomi-tree-treenode {
|
|
5
|
+
.antsomi-tree-switcher {
|
|
6
|
+
display: flex;
|
|
7
|
+
order: 10;
|
|
8
|
+
&_close {
|
|
9
|
+
transform: rotate(-90deg);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
export const StyledTreeDirectory = styled(Tree.DirectoryTree) `
|
|
15
|
+
.antsomi-tree-treenode {
|
|
16
|
+
.antsomi-tree-switcher {
|
|
17
|
+
display: flex;
|
|
18
|
+
order: 10;
|
|
19
|
+
&_close {
|
|
20
|
+
transform: rotate(-90deg);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TreeDataNode } from 'antd';
|
|
2
|
+
/**
|
|
3
|
+
* Recursively updates the tree data by replacing the children of a node with a given key.
|
|
4
|
+
*
|
|
5
|
+
* @param {TreeDataNode[]} list - The list of tree nodes to update.
|
|
6
|
+
* @param {React.Key} key - The key of the node to update.
|
|
7
|
+
* @param {TreeDataNode[]} children - The new children to assign to the node.
|
|
8
|
+
* @return {TreeDataNode[]} The updated list of tree nodes.
|
|
9
|
+
*/
|
|
10
|
+
export declare const updateTreeData: (list: TreeDataNode[], key: React.Key, children: TreeDataNode[]) => TreeDataNode[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively updates the tree data by replacing the children of a node with a given key.
|
|
3
|
+
*
|
|
4
|
+
* @param {TreeDataNode[]} list - The list of tree nodes to update.
|
|
5
|
+
* @param {React.Key} key - The key of the node to update.
|
|
6
|
+
* @param {TreeDataNode[]} children - The new children to assign to the node.
|
|
7
|
+
* @return {TreeDataNode[]} The updated list of tree nodes.
|
|
8
|
+
*/
|
|
9
|
+
export const updateTreeData = (list, key, children) => list.map(node => {
|
|
10
|
+
if (node.key === key) {
|
|
11
|
+
return Object.assign(Object.assign({}, node), { children });
|
|
12
|
+
}
|
|
13
|
+
if (node.children) {
|
|
14
|
+
return Object.assign(Object.assign({}, node), { children: updateTreeData(node.children, key, children) });
|
|
15
|
+
}
|
|
16
|
+
return node;
|
|
17
|
+
});
|
package/es/constants/theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
1
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
2
2
|
// Types
|
|
3
3
|
import { theme } from 'antd';
|
|
4
4
|
// Variables
|
|
@@ -186,6 +186,8 @@ THEME.components = {
|
|
|
186
186
|
// titleHeight: 12,
|
|
187
187
|
paddingXS: 20,
|
|
188
188
|
marginXXS: 0,
|
|
189
|
+
directoryNodeSelectedBg: 'transparent',
|
|
190
|
+
directoryNodeSelectedColor: (_x = THEME.token) === null || _x === void 0 ? void 0 : _x.colorText,
|
|
189
191
|
},
|
|
190
192
|
Modal: {
|
|
191
193
|
titleFontSize: 16,
|
|
@@ -197,7 +199,7 @@ THEME.components = {
|
|
|
197
199
|
paddingMD: 0,
|
|
198
200
|
},
|
|
199
201
|
Tabs: {
|
|
200
|
-
itemColor: (
|
|
202
|
+
itemColor: (_y = THEME.token) === null || _y === void 0 ? void 0 : _y.bw8,
|
|
201
203
|
horizontalItemPadding: '17px 30px',
|
|
202
204
|
horizontalItemGutter: 0,
|
|
203
205
|
lineWidthBold: 3,
|
|
@@ -209,7 +211,7 @@ THEME.components = {
|
|
|
209
211
|
lineHeight: 1.143,
|
|
210
212
|
lineHeightLG: 1.143,
|
|
211
213
|
lineHeightSM: 1.143,
|
|
212
|
-
itemHoverColor: (
|
|
214
|
+
itemHoverColor: (_z = THEME.token) === null || _z === void 0 ? void 0 : _z.colorPrimary,
|
|
213
215
|
},
|
|
214
216
|
Collapse: {
|
|
215
217
|
headerBg: '#FFF',
|
|
@@ -217,13 +219,13 @@ THEME.components = {
|
|
|
217
219
|
headerPadding: '15px 10px',
|
|
218
220
|
},
|
|
219
221
|
Switch: {
|
|
220
|
-
colorTextQuaternary: (
|
|
221
|
-
colorTextTertiary: (
|
|
222
|
+
colorTextQuaternary: (_0 = THEME.token) === null || _0 === void 0 ? void 0 : _0.bw0,
|
|
223
|
+
colorTextTertiary: (_1 = THEME.token) === null || _1 === void 0 ? void 0 : _1.bw0,
|
|
222
224
|
handleSize: 8,
|
|
223
225
|
handleSizeSM: 7,
|
|
224
226
|
trackMinWidth: 27,
|
|
225
227
|
trackHeight: 16,
|
|
226
|
-
handleBg: (
|
|
228
|
+
handleBg: (_2 = THEME.token) === null || _2 === void 0 ? void 0 : _2.colorPrimary,
|
|
227
229
|
},
|
|
228
230
|
Popover: {
|
|
229
231
|
borderRadiusLG: 10,
|
|
@@ -235,11 +237,11 @@ THEME.components = {
|
|
|
235
237
|
paddingXXS: 8,
|
|
236
238
|
controlItemBgHover: '#F2F9FF',
|
|
237
239
|
controlItemBgActive: '#DEEFFE',
|
|
238
|
-
colorPrimary: (
|
|
240
|
+
colorPrimary: (_3 = THEME.token) === null || _3 === void 0 ? void 0 : _3.colorText,
|
|
239
241
|
controlItemBgActiveHover: '#DEEFFE',
|
|
240
242
|
},
|
|
241
243
|
Tooltip: {
|
|
242
|
-
colorBgSpotlight: (
|
|
244
|
+
colorBgSpotlight: (_4 = THEME.token) === null || _4 === void 0 ? void 0 : _4.bw8,
|
|
243
245
|
fontSize: 11,
|
|
244
246
|
},
|
|
245
247
|
Menu: {
|
|
@@ -249,8 +251,8 @@ THEME.components = {
|
|
|
249
251
|
itemMarginBlock: 5,
|
|
250
252
|
itemBorderRadius: 5,
|
|
251
253
|
subMenuItemBg: 'transparent',
|
|
252
|
-
itemDisabledColor: (
|
|
253
|
-
itemActiveBg: (
|
|
254
|
+
itemDisabledColor: (_5 = THEME.token) === null || _5 === void 0 ? void 0 : _5.colorTextDisabled,
|
|
255
|
+
itemActiveBg: (_6 = THEME.token) === null || _6 === void 0 ? void 0 : _6.blue1_1,
|
|
254
256
|
},
|
|
255
257
|
Form: {
|
|
256
258
|
itemMarginBottom: 15,
|