@capillarytech/blaze-ui 0.1.6-alpha.3 → 0.1.6-alpha.32
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/components/CapInput/CapInput.js +60 -0
- package/components/CapInput/Number.js +39 -0
- package/components/CapInput/Search.js +34 -0
- package/components/CapInput/TextArea.js +41 -0
- package/components/CapInput/index.js +13 -0
- package/components/CapInput/messages.js +24 -0
- package/components/CapInput/styles.js +8 -0
- package/components/CapSkeleton/CapSkeleton.js +24 -0
- package/components/CapSkeleton/index.js +7 -0
- package/components/CapSpin/CapSpin.js +30 -0
- package/components/CapSpin/index.js +7 -0
- package/components/CapTable/CapTable.js +118 -0
- package/components/CapTable/index.js +7 -0
- package/components/CapTable/loadable.js +18 -0
- package/components/CapTable/styles.js +23 -0
- package/components/CapTestSelect/CapTestSelect.js +36 -0
- package/components/CapTestSelect/index.js +7 -0
- package/components/CapUnifiedSelect/CapUnifiedSelect.js +359 -0
- package/components/CapUnifiedSelect/index.js +7 -0
- package/components/CapUnifiedSelect/messages.js +27 -0
- package/components/CapUnifiedSelect/styles.js +36 -0
- package/components/LocaleHoc/index.js +42 -0
- package/components/index.js +33 -0
- package/components/styled/index.js +14 -0
- package/components/styled/variables.js +70 -0
- package/{translations → components/translations}/en.js +37 -35
- package/dist/components/CapSkeleton/CapSkeleton.js +29 -0
- package/dist/components/CapSkeleton/index.js +13 -0
- package/dist/components/CapSpin/CapSpin.js +35 -0
- package/dist/components/CapSpin/index.js +13 -0
- package/dist/{CapTable → components/CapTable}/loadable.js +4 -4
- package/dist/components/CapTestSelect/CapTestSelect.js +40 -0
- package/dist/components/CapTestSelect/index.js +13 -0
- package/dist/components/CapUnifiedSelect/CapUnifiedSelect.js +406 -0
- package/dist/components/CapUnifiedSelect/index.js +13 -0
- package/dist/components/CapUnifiedSelect/messages.js +29 -0
- package/dist/components/CapUnifiedSelect/styles.js +39 -0
- package/dist/{index.js → components/index.js} +27 -0
- package/dist/esm/{CapRow/CapRow.js → components/CapSkeleton/CapSkeleton.js} +12 -12
- package/dist/esm/components/CapSkeleton/index.js +1 -0
- package/dist/esm/components/CapSpin/CapSpin.js +28 -0
- package/dist/esm/components/CapSpin/index.js +1 -0
- package/dist/esm/components/CapTable/loadable.js +12 -0
- package/dist/esm/components/CapTestSelect/CapTestSelect.js +34 -0
- package/dist/esm/components/CapTestSelect/index.js +1 -0
- package/dist/esm/components/CapUnifiedSelect/CapUnifiedSelect.js +398 -0
- package/dist/esm/components/CapUnifiedSelect/index.js +1 -0
- package/dist/esm/components/CapUnifiedSelect/styles.js +31 -0
- package/dist/esm/{index.js → components/index.js} +5 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/withStyles.js +23 -0
- package/dist/utils/index.js +13 -0
- package/dist/utils/withStyles.js +29 -0
- package/package.json +6 -10
- package/utils/index.js +7 -0
- package/utils/withStyles.js +15 -0
- package/CapHeading/CapHeading.js +0 -71
- package/CapHeading/index.js +0 -1
- package/CapHeading/styles.js +0 -125
- package/CapInfoNote/CapInfoNote.js +0 -54
- package/CapInfoNote/index.js +0 -1
- package/CapInfoNote/styles.js +0 -63
- package/CapInput/CapInput.js +0 -67
- package/CapInput/Number.js +0 -38
- package/CapInput/Search.js +0 -32
- package/CapInput/TextArea.js +0 -45
- package/CapInput/index.js +0 -10
- package/CapInput/loadable.js +0 -9
- package/CapInput/messages.js +0 -27
- package/CapInput/styles.js +0 -81
- package/CapLabel/CapLabel.js +0 -106
- package/CapLabel/index.js +0 -1
- package/CapLabel/styles.js +0 -221
- package/CapRow/CapRow.js +0 -22
- package/CapRow/index.js +0 -1
- package/CapRow/styles.js +0 -9
- package/CapTable/CapTable.js +0 -146
- package/CapTable/index.js +0 -3
- package/CapTable/loadable.js +0 -13
- package/CapTable/styles.js +0 -134
- package/CapTooltip/CapTooltip.js +0 -36
- package/CapTooltip/index.js +0 -1
- package/CapTooltip/styles.js +0 -42
- package/CapUnifiedSelect/CapUnifiedSelect.js +0 -121
- package/CapUnifiedSelect/index.js +0 -4
- package/CapUnifiedSelect/loadable.js +0 -3
- package/CapUnifiedSelect/messages.js +0 -24
- package/CapUnifiedSelect/styles.js +0 -223
- package/LocaleHoc/index.js +0 -38
- package/dist/235.index.js +0 -2
- package/dist/235.index.js.LICENSE.txt +0 -29
- package/dist/603.index.js +0 -1
- package/dist/esm/CapHeading/CapHeading.js +0 -41
- package/dist/esm/CapHeading/index.js +0 -1
- package/dist/esm/CapHeading/styles.js +0 -123
- package/dist/esm/CapInfoNote/CapInfoNote.js +0 -62
- package/dist/esm/CapInfoNote/index.js +0 -1
- package/dist/esm/CapInfoNote/styles.js +0 -6
- package/dist/esm/CapInput/loadable.js +0 -9
- package/dist/esm/CapLabel/CapLabel.js +0 -50
- package/dist/esm/CapLabel/index.js +0 -1
- package/dist/esm/CapLabel/styles.js +0 -219
- package/dist/esm/CapRow/index.js +0 -1
- package/dist/esm/CapRow/styles.js +0 -5
- package/dist/esm/CapTable/loadable.js +0 -12
- package/dist/esm/CapTooltip/CapTooltip.js +0 -34
- package/dist/esm/CapTooltip/index.js +0 -1
- package/dist/esm/CapTooltip/styles.js +0 -6
- package/dist/esm/CapUnifiedSelect/CapUnifiedSelect.js +0 -101
- package/dist/esm/CapUnifiedSelect/index.js +0 -3
- package/dist/esm/CapUnifiedSelect/loadable.js +0 -4
- package/dist/esm/CapUnifiedSelect/styles.js +0 -15
- package/dist/index.js.LICENSE.txt +0 -7
- package/index.js +0 -10
- package/styled/index.js +0 -6
- package/styled/variables.js +0 -89
- /package/dist/{CapInput → components/CapInput}/CapInput.js +0 -0
- /package/dist/{CapInput → components/CapInput}/Number.js +0 -0
- /package/dist/{CapInput → components/CapInput}/Search.js +0 -0
- /package/dist/{CapInput → components/CapInput}/TextArea.js +0 -0
- /package/dist/{CapInput → components/CapInput}/index.js +0 -0
- /package/dist/{CapInput → components/CapInput}/messages.js +0 -0
- /package/dist/{CapInput → components/CapInput}/styles.js +0 -0
- /package/dist/{CapTable → components/CapTable}/CapTable.js +0 -0
- /package/dist/{CapTable → components/CapTable}/index.js +0 -0
- /package/dist/{CapTable → components/CapTable}/styles.js +0 -0
- /package/dist/{LocaleHoc → components/LocaleHoc}/index.js +0 -0
- /package/dist/{styled → components/styled}/index.js +0 -0
- /package/dist/{styled → components/styled}/variables.js +0 -0
- /package/dist/{translations → components/translations}/en.js +0 -0
- /package/dist/esm/{CapInput → components/CapInput}/CapInput.js +0 -0
- /package/dist/esm/{CapInput → components/CapInput}/Number.js +0 -0
- /package/dist/esm/{CapInput → components/CapInput}/Search.js +0 -0
- /package/dist/esm/{CapInput → components/CapInput}/TextArea.js +0 -0
- /package/dist/esm/{CapInput → components/CapInput}/index.js +0 -0
- /package/dist/esm/{CapInput → components/CapInput}/messages.js +0 -0
- /package/dist/esm/{CapInput → components/CapInput}/styles.js +0 -0
- /package/dist/esm/{CapTable → components/CapTable}/CapTable.js +0 -0
- /package/dist/esm/{CapTable → components/CapTable}/index.js +0 -0
- /package/dist/esm/{CapTable → components/CapTable}/styles.js +0 -0
- /package/dist/esm/{CapUnifiedSelect → components/CapUnifiedSelect}/messages.js +0 -0
- /package/dist/esm/{LocaleHoc → components/LocaleHoc}/index.js +0 -0
- /package/dist/esm/{styled → components/styled}/index.js +0 -0
- /package/dist/esm/{styled → components/styled}/variables.js +0 -0
- /package/dist/esm/{translations → components/translations}/en.js +0 -0
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// CapUnifiedSelect component using Ant Design v5 Select and TreeSelect directly
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { Select, TreeSelect } from 'antd';
|
|
5
|
-
import { SelectWrapper, HeaderWrapper, StyledInfoIcon } from './styles';
|
|
6
|
-
import CapLabel from '../CapLabel';
|
|
7
|
-
import CapTooltip from '../CapTooltip';
|
|
8
|
-
|
|
9
|
-
function CapUnifiedSelect({
|
|
10
|
-
type,
|
|
11
|
-
options = [],
|
|
12
|
-
treeData,
|
|
13
|
-
value,
|
|
14
|
-
onChange,
|
|
15
|
-
placeholder = 'Select an option',
|
|
16
|
-
className,
|
|
17
|
-
style,
|
|
18
|
-
allowClear = false,
|
|
19
|
-
showSearch = false,
|
|
20
|
-
label,
|
|
21
|
-
tooltip,
|
|
22
|
-
disabled = false,
|
|
23
|
-
}) {
|
|
24
|
-
const selectVirtualizationProps = {
|
|
25
|
-
listHeight: 256,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const treeSelectVirtualizationProps = {
|
|
29
|
-
listHeight: 256,
|
|
30
|
-
listItemHeight: 32,
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const renderHeader = () => {
|
|
34
|
-
if (!label && !tooltip) return null;
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<HeaderWrapper className={disabled ? 'disabled' : ''}>
|
|
38
|
-
{label && (
|
|
39
|
-
<CapLabel type="label16" className={disabled ? 'disabled' : ''}>
|
|
40
|
-
{label}
|
|
41
|
-
</CapLabel>
|
|
42
|
-
)}
|
|
43
|
-
{tooltip && (
|
|
44
|
-
<CapTooltip title={tooltip}>
|
|
45
|
-
<StyledInfoIcon className={disabled ? 'disabled' : ''} />
|
|
46
|
-
</CapTooltip>
|
|
47
|
-
)}
|
|
48
|
-
</HeaderWrapper>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const renderDropdown = () => {
|
|
53
|
-
if (type === 'treeSelect' || type === 'multiTreeSelect') {
|
|
54
|
-
return (
|
|
55
|
-
<TreeSelect
|
|
56
|
-
treeData={treeData || options}
|
|
57
|
-
value={value}
|
|
58
|
-
onChange={onChange}
|
|
59
|
-
placeholder={placeholder}
|
|
60
|
-
className={className}
|
|
61
|
-
style={style}
|
|
62
|
-
allowClear={allowClear}
|
|
63
|
-
showSearch={showSearch}
|
|
64
|
-
multiple={type === 'multiTreeSelect' ? true : false}
|
|
65
|
-
virtual
|
|
66
|
-
treeDefaultExpandAll
|
|
67
|
-
disabled={disabled}
|
|
68
|
-
{...treeSelectVirtualizationProps}
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<Select
|
|
75
|
-
value={value}
|
|
76
|
-
onChange={onChange}
|
|
77
|
-
placeholder={placeholder}
|
|
78
|
-
className={className}
|
|
79
|
-
style={style}
|
|
80
|
-
allowClear={allowClear}
|
|
81
|
-
showSearch={showSearch}
|
|
82
|
-
options={options}
|
|
83
|
-
mode={type === 'multiSelect' ? 'multiple' : undefined}
|
|
84
|
-
virtual
|
|
85
|
-
disabled={disabled}
|
|
86
|
-
{...selectVirtualizationProps}
|
|
87
|
-
/>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
return (
|
|
92
|
-
<SelectWrapper>
|
|
93
|
-
{renderHeader()}
|
|
94
|
-
{renderDropdown()}
|
|
95
|
-
</SelectWrapper>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
CapUnifiedSelect.propTypes = {
|
|
100
|
-
type: PropTypes.oneOf(['select', 'multiSelect', 'treeSelect', 'multiTreeSelect']),
|
|
101
|
-
options: PropTypes.array,
|
|
102
|
-
treeData: PropTypes.array,
|
|
103
|
-
value: PropTypes.any,
|
|
104
|
-
onChange: PropTypes.func,
|
|
105
|
-
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
106
|
-
className: PropTypes.string,
|
|
107
|
-
style: PropTypes.object,
|
|
108
|
-
allowClear: PropTypes.bool,
|
|
109
|
-
showSearch: PropTypes.bool,
|
|
110
|
-
label: PropTypes.string,
|
|
111
|
-
tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
112
|
-
disabled: PropTypes.bool,
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
CapUnifiedSelect.defaultProps = {
|
|
116
|
-
type: 'select',
|
|
117
|
-
allowClear: false,
|
|
118
|
-
showSearch: false,
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export default CapUnifiedSelect;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineMessages } from 'react-intl';
|
|
2
|
-
|
|
3
|
-
export default defineMessages({
|
|
4
|
-
selectPlaceholder: {
|
|
5
|
-
id: 'cap.unified.select.placeholder',
|
|
6
|
-
defaultMessage: 'Select an option',
|
|
7
|
-
},
|
|
8
|
-
searchPlaceholder: {
|
|
9
|
-
id: 'cap.unified.select.search.placeholder',
|
|
10
|
-
defaultMessage: 'Search...',
|
|
11
|
-
},
|
|
12
|
-
noData: {
|
|
13
|
-
id: 'cap.unified.select.no.data',
|
|
14
|
-
defaultMessage: 'No data',
|
|
15
|
-
},
|
|
16
|
-
loading: {
|
|
17
|
-
id: 'cap.unified.select.loading',
|
|
18
|
-
defaultMessage: 'Loading...',
|
|
19
|
-
},
|
|
20
|
-
selected: {
|
|
21
|
-
id: 'cap.unified.select.selected',
|
|
22
|
-
defaultMessage: '{count} items selected',
|
|
23
|
-
},
|
|
24
|
-
});
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
import * as styledVars from '../styled/variables';
|
|
3
|
-
|
|
4
|
-
export const SelectWrapper = styled.div`
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
gap: 8px;
|
|
8
|
-
width: 100%;
|
|
9
|
-
|
|
10
|
-
&.disabled {
|
|
11
|
-
cursor: not-allowed;
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
export const HeaderWrapper = styled.div`
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
gap: 4px;
|
|
19
|
-
|
|
20
|
-
&.disabled {
|
|
21
|
-
opacity: 0.5;
|
|
22
|
-
cursor: not-allowed;
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export const StyledInfoIcon = styled.span`
|
|
29
|
-
color: ${styledVars.CAP_G2};
|
|
30
|
-
font-size: 16px;
|
|
31
|
-
cursor: help;
|
|
32
|
-
|
|
33
|
-
&:hover {
|
|
34
|
-
color: ${styledVars.CAP_G1};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&.disabled {
|
|
38
|
-
cursor: not-allowed;
|
|
39
|
-
&:hover {
|
|
40
|
-
color: ${styledVars.CAP_G2};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
|
|
45
|
-
export const selectStyles = css`
|
|
46
|
-
&.cap-unified-select {
|
|
47
|
-
width: 100%;
|
|
48
|
-
font-family: ${styledVars.FONT_FAMILY};
|
|
49
|
-
|
|
50
|
-
.ant-select-selector {
|
|
51
|
-
border-radius: ${styledVars.RADIUS_04};
|
|
52
|
-
transition: ${styledVars.TRANSITION_ALL};
|
|
53
|
-
padding: 0 12px;
|
|
54
|
-
min-height: 32px;
|
|
55
|
-
display: flex;
|
|
56
|
-
align-items: center;
|
|
57
|
-
|
|
58
|
-
&:hover {
|
|
59
|
-
border-color: ${styledVars.CAP_G11};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* Right slot content styles */
|
|
64
|
-
.cap-unified-select-right-slot {
|
|
65
|
-
display: flex;
|
|
66
|
-
align-items: center;
|
|
67
|
-
gap: 8px;
|
|
68
|
-
margin-left: 8px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&.ant-select-focused {
|
|
72
|
-
.ant-select-selector {
|
|
73
|
-
border-color: ${styledVars.CAP_G01} !important;
|
|
74
|
-
box-shadow: none !important;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/* Error state */
|
|
79
|
-
&.ant-select-status-error {
|
|
80
|
-
.ant-select-selector {
|
|
81
|
-
border-color: ${styledVars.CAP_RED};
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/* Disabled state */
|
|
86
|
-
&.ant-select-disabled {
|
|
87
|
-
.ant-select-selector {
|
|
88
|
-
background-color: ${styledVars.CAP_G08};
|
|
89
|
-
cursor: not-allowed;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* Dropdown styles */
|
|
94
|
-
.ant-select-dropdown {
|
|
95
|
-
padding: 4px;
|
|
96
|
-
border-radius: ${styledVars.RADIUS_04};
|
|
97
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
98
|
-
|
|
99
|
-
.ant-select-item {
|
|
100
|
-
border-radius: ${styledVars.RADIUS_04};
|
|
101
|
-
padding: 8px 12px;
|
|
102
|
-
transition: ${styledVars.TRANSITION_ALL};
|
|
103
|
-
|
|
104
|
-
&-option-selected {
|
|
105
|
-
background-color: ${styledVars.CAP_PRIMARY.light};
|
|
106
|
-
color: ${styledVars.CAP_PRIMARY.base};
|
|
107
|
-
font-weight: 500;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&-option-active {
|
|
111
|
-
background-color: ${styledVars.CAP_G08};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/* Search input styles */
|
|
116
|
-
.ant-select-search {
|
|
117
|
-
padding: 8px;
|
|
118
|
-
|
|
119
|
-
input {
|
|
120
|
-
border-radius: ${styledVars.RADIUS_04};
|
|
121
|
-
transition: ${styledVars.TRANSITION_ALL};
|
|
122
|
-
|
|
123
|
-
&:focus {
|
|
124
|
-
border-color: ${styledVars.CAP_G01};
|
|
125
|
-
box-shadow: none;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/* Multiple selection styles */
|
|
132
|
-
&.ant-select-multiple {
|
|
133
|
-
.ant-select-selection-item {
|
|
134
|
-
background-color: ${styledVars.CAP_PRIMARY.light};
|
|
135
|
-
border-color: ${styledVars.CAP_PRIMARY.light};
|
|
136
|
-
border-radius: ${styledVars.RADIUS_04};
|
|
137
|
-
color: ${styledVars.CAP_PRIMARY.base};
|
|
138
|
-
margin: 2px 4px 2px 0;
|
|
139
|
-
padding: 0 8px;
|
|
140
|
-
height: 24px;
|
|
141
|
-
line-height: 22px;
|
|
142
|
-
|
|
143
|
-
&-remove {
|
|
144
|
-
color: ${styledVars.CAP_PRIMARY.base};
|
|
145
|
-
|
|
146
|
-
&:hover {
|
|
147
|
-
color: ${styledVars.CAP_PRIMARY.hover};
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.ant-select-selection-overflow {
|
|
153
|
-
flex-wrap: wrap;
|
|
154
|
-
gap: 4px;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/* Tree select styles */
|
|
159
|
-
.ant-select-tree {
|
|
160
|
-
padding: 4px 0;
|
|
161
|
-
|
|
162
|
-
.ant-select-tree-node-content-wrapper {
|
|
163
|
-
padding: 4px 8px;
|
|
164
|
-
border-radius: ${styledVars.RADIUS_04};
|
|
165
|
-
transition: ${styledVars.TRANSITION_ALL};
|
|
166
|
-
|
|
167
|
-
&:hover {
|
|
168
|
-
background-color: ${styledVars.CAP_G08};
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
&.ant-select-tree-node-selected {
|
|
172
|
-
background-color: ${styledVars.CAP_PRIMARY.light};
|
|
173
|
-
color: ${styledVars.CAP_PRIMARY.base};
|
|
174
|
-
font-weight: 500;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.ant-select-tree-switcher {
|
|
179
|
-
width: 24px;
|
|
180
|
-
height: 24px;
|
|
181
|
-
line-height: 24px;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.ant-select-tree-checkbox {
|
|
185
|
-
margin: 4px 8px 4px 0;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/* Size variations */
|
|
190
|
-
&.ant-select-lg {
|
|
191
|
-
.ant-select-selector {
|
|
192
|
-
height: 40px;
|
|
193
|
-
padding: 0 16px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.ant-select-selection-item {
|
|
197
|
-
height: 28px;
|
|
198
|
-
line-height: 26px;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
&.ant-select-sm {
|
|
203
|
-
.ant-select-selector {
|
|
204
|
-
height: 24px;
|
|
205
|
-
padding: 0 8px;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.ant-select-selection-item {
|
|
209
|
-
height: 20px;
|
|
210
|
-
line-height: 18px;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/* Loading state */
|
|
215
|
-
&.ant-select-loading {
|
|
216
|
-
.ant-select-arrow {
|
|
217
|
-
.anticon-loading {
|
|
218
|
-
color: ${styledVars.CAP_PRIMARY.base};
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
`;
|
package/LocaleHoc/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl';
|
|
3
|
-
import enTranslation from '../translations/en';
|
|
4
|
-
|
|
5
|
-
const prefix = `blaze.components`;
|
|
6
|
-
|
|
7
|
-
const LocaleHoc = (WrapperComponent, customProps) => {
|
|
8
|
-
const Wrapper = (props) => {
|
|
9
|
-
const componentName = customProps.key;
|
|
10
|
-
const translatedDefaults = enTranslation[componentName];
|
|
11
|
-
const { intl } = props;
|
|
12
|
-
|
|
13
|
-
const translatedProps = useMemo(() => {
|
|
14
|
-
if(!translatedDefaults) return {};
|
|
15
|
-
return Object.keys(translatedDefaults).reduce((acc, key) => {
|
|
16
|
-
const id = `${prefix}.${componentName}.${key}`
|
|
17
|
-
const defaultMessage = translatedDefaults[key]
|
|
18
|
-
try{
|
|
19
|
-
acc[key] = intl.formatMessage({ id, defaultMessage });
|
|
20
|
-
}catch(err){
|
|
21
|
-
acc[key] = defaultMessage;
|
|
22
|
-
}
|
|
23
|
-
return acc;
|
|
24
|
-
}, {});
|
|
25
|
-
}, [translatedDefaults, intl]);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<WrapperComponent
|
|
29
|
-
{...translatedProps}
|
|
30
|
-
{...props}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return injectIntl(Wrapper);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default LocaleHoc;
|