@antscorp/antsomi-ui 1.3.7-beta.67 → 1.3.7-beta.69
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.
|
@@ -9,7 +9,7 @@ import Icon from '@antscorp/icons';
|
|
|
9
9
|
// Constants
|
|
10
10
|
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
11
11
|
// Styled
|
|
12
|
-
import { StyledTag, TagCloseBtn } from './styled';
|
|
12
|
+
import { StyledSelect, StyledTag, TagCloseBtn } from './styled';
|
|
13
13
|
const tagRender = (props) => {
|
|
14
14
|
const { label, closable, onClose } = props;
|
|
15
15
|
const onPreventMouseDown = (event) => {
|
|
@@ -22,7 +22,7 @@ const tagRender = (props) => {
|
|
|
22
22
|
};
|
|
23
23
|
const CustomSelect = props => {
|
|
24
24
|
const { label, labelProps, ...rest } = props;
|
|
25
|
-
return (_jsxs(Flex, { vertical: true, gap: 4, children: [typeof label === 'string' ? _jsx(Text, { ...labelProps, children: label }) : label, _jsx(
|
|
25
|
+
return (_jsxs(Flex, { vertical: true, gap: 4, children: [typeof label === 'string' ? _jsx(Text, { ...labelProps, children: label }) : label, _jsx(StyledSelect, { ...rest })] }));
|
|
26
26
|
};
|
|
27
27
|
const Select = CustomSelect;
|
|
28
28
|
Select.OptGroup = AntdSelect.OptGroup;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import { type SelectProps as AntdSelectProps } from 'antd';
|
|
3
|
+
export declare const StyledSelect: import("styled-components").StyledComponent<ComponentType<AntdSelectProps<any, import("rc-select/lib/Select").DefaultOptionType>>, any, {}, never>;
|
|
2
4
|
export declare const StyledTag: import("styled-components").StyledComponent<import("antd/lib").TagType & {
|
|
3
5
|
List: import("react").FC<import("../../atoms/Tag/Tag").TagListProps>;
|
|
4
6
|
}, any, {}, never>;
|
|
@@ -1,9 +1,55 @@
|
|
|
1
1
|
// Libraries
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { Select as AntdSelect } from 'antd';
|
|
3
4
|
// Components
|
|
4
5
|
import { Tag } from '../../atoms/Tag';
|
|
5
6
|
// Constants
|
|
6
7
|
import { THEME } from '../../../constants';
|
|
8
|
+
export const StyledSelect = styled(AntdSelect) `
|
|
9
|
+
&.antsomi-select-single {
|
|
10
|
+
min-height: 34px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&.antsomi-select-multiple .antsomi-select-selector {
|
|
14
|
+
min-height: 34px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&.antsomi-select-multiple:has(.antsomi-select-selection-overflow-item-rest) {
|
|
18
|
+
.antsomi-select-selection-overflow {
|
|
19
|
+
gap: 0;
|
|
20
|
+
flex-wrap: nowrap;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.antsomi-select-selection-overflow-item:not(.antsomi-select-selection-overflow-item-suffix) {
|
|
24
|
+
padding-right: 5px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.antsomi-select-selection-overflow-item-rest .antsomi-select-selection-item {
|
|
28
|
+
height: auto;
|
|
29
|
+
margin: 0;
|
|
30
|
+
padding: 3px 10px;
|
|
31
|
+
border: 0;
|
|
32
|
+
border-radius: 15px;
|
|
33
|
+
background: ${THEME.token?.blue2};
|
|
34
|
+
font-size: ${THEME.token?.fontSize}px;
|
|
35
|
+
line-height: 1.8;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.antsomi-select-selection-overflow-item-rest .antsomi-select-selection-item-content {
|
|
39
|
+
margin: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.antsomi-select-selection-overflow-item-suffix {
|
|
43
|
+
max-width: calc(100% - 80px);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.antsomi-select-selection-search,
|
|
47
|
+
.antsomi-select-selection-search-input {
|
|
48
|
+
min-width: 0;
|
|
49
|
+
max-width: 100%;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
7
53
|
export const StyledTag = styled(Tag) `
|
|
8
54
|
position: relative;
|
|
9
55
|
background-color: ${THEME.token?.blue2} !important;
|
|
@@ -14,6 +60,7 @@ export const StyledTag = styled(Tag) `
|
|
|
14
60
|
font-size: ${THEME.token?.fontSize}px !important;
|
|
15
61
|
|
|
16
62
|
.antsomi-tag-close-icon {
|
|
63
|
+
right: 6px !important;
|
|
17
64
|
opacity: 0;
|
|
18
65
|
transition: all 0.3s;
|
|
19
66
|
}
|
|
@@ -25,16 +72,13 @@ export const StyledTag = styled(Tag) `
|
|
|
25
72
|
}
|
|
26
73
|
`;
|
|
27
74
|
export const TagCloseBtn = styled.div `
|
|
28
|
-
position: absolute;
|
|
29
|
-
top: 3px;
|
|
30
|
-
right: 3px;
|
|
31
75
|
display: flex;
|
|
32
76
|
align-items: center;
|
|
33
77
|
justify-content: center;
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
78
|
+
width: 20px;
|
|
79
|
+
height: 20px;
|
|
36
80
|
border-radius: 100%;
|
|
37
|
-
border:
|
|
81
|
+
border: 2px solid ${p => (p.borderColor ? p.borderColor : '#cae5fe')};
|
|
38
82
|
background-color: #fff;
|
|
39
83
|
color: ${THEME.token?.colorPrimary};
|
|
40
84
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antscorp/antsomi-ui",
|
|
3
|
-
"version": "1.3.7-beta.
|
|
3
|
+
"version": "1.3.7-beta.69",
|
|
4
4
|
"description": "An enterprise-class UI design language and React UI library.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"dist/*",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"unpkg": "dist/index.js",
|
|
20
20
|
"types": "es/index.d.ts",
|
|
21
21
|
"scripts": {
|
|
22
|
-
"prepublishOnly": "yarn && yarn build:es",
|
|
23
22
|
"build:es": "npm run clean && npm run copy-files && npm run ts-compile",
|
|
24
23
|
"clean": "rimraf dist lib es",
|
|
25
24
|
"dev": "vite",
|
|
@@ -180,11 +179,12 @@
|
|
|
180
179
|
"@babel/preset-typescript": "^7.23.3",
|
|
181
180
|
"@commitlint/cli": "17.5.0",
|
|
182
181
|
"@commitlint/config-conventional": "17.4.4",
|
|
183
|
-
"@storybook/addon-docs": "
|
|
184
|
-
"@storybook/addon-links": "
|
|
185
|
-
"@storybook/addon-
|
|
186
|
-
"@storybook/addon-
|
|
187
|
-
"@storybook/
|
|
182
|
+
"@storybook/addon-docs": "10.5.10",
|
|
183
|
+
"@storybook/addon-links": "10.5.10",
|
|
184
|
+
"@storybook/addon-mcp": "0.7.0",
|
|
185
|
+
"@storybook/addon-styling-webpack": "3.0.2",
|
|
186
|
+
"@storybook/addon-webpack5-compiler-babel": "4.0.1",
|
|
187
|
+
"@storybook/react-webpack5": "10.5.10",
|
|
188
188
|
"@testing-library/dom": "^10.4.0",
|
|
189
189
|
"@testing-library/jest-dom": "^6.5.0",
|
|
190
190
|
"@testing-library/react": "^16.0.0",
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
"eslint-plugin-prettier": "^5.2.1",
|
|
236
236
|
"eslint-plugin-react": "^7.32.2",
|
|
237
237
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
238
|
-
"eslint-plugin-storybook": "
|
|
238
|
+
"eslint-plugin-storybook": "10.5.10",
|
|
239
239
|
"file-loader": "^6.2.0",
|
|
240
240
|
"googleapis": "^142.0.0",
|
|
241
241
|
"husky": "^8.0.3",
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
"react-router-dom": "5.1.0 || 6.14.2",
|
|
253
253
|
"sass": "^1.77.8",
|
|
254
254
|
"sass-loader": "^16.0.1",
|
|
255
|
-
"storybook": "
|
|
255
|
+
"storybook": "10.5.10",
|
|
256
256
|
"style-loader": "^4.0.0",
|
|
257
257
|
"styled-components": "^5.3.9",
|
|
258
258
|
"terser-webpack-plugin": "^5.3.10",
|