@capillarytech/blaze-ui 0.1.6-alpha.51 → 0.1.6-alpha.53
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/CapUnifiedSelect/CapUnifiedSelect.js +28 -14
- package/CapUnifiedSelect/styles.js +117 -50
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { useState, useEffect, useMemo, useCallback, memo } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { TreeSelect, Input, Button } from 'antd-v5';
|
|
5
|
+
import { TreeSelect, Input, Button, Checkbox } from 'antd-v5';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import * as styledVars from '../styled/variables';
|
|
8
8
|
import { CapLabel, CapTooltipWithInfo, CapRow, CapIcon } from '../';
|
|
@@ -191,9 +191,11 @@ const CapUnifiedSelect = ({
|
|
|
191
191
|
/>
|
|
192
192
|
)}
|
|
193
193
|
</HeaderWrapper>
|
|
194
|
+
{bylineText &&
|
|
194
195
|
<div className="cap-unified-select-header-byline-text">
|
|
195
|
-
|
|
196
|
+
<CapLabel className={classnames(disabled ? 'disabled' : '', 'cap-unified-select-header-byline-text')}>{bylineText}</CapLabel>
|
|
196
197
|
</div>
|
|
198
|
+
}
|
|
197
199
|
</>
|
|
198
200
|
);
|
|
199
201
|
}, [headerLabel, tooltip, bylineText, disabled]);
|
|
@@ -228,17 +230,29 @@ const CapUnifiedSelect = ({
|
|
|
228
230
|
<CapLabel type="label14" className={classnames("cap-unified-select-upload-label")}>Upload</CapLabel>
|
|
229
231
|
</CapRow>
|
|
230
232
|
)}
|
|
231
|
-
{isMulti && currentItems.length > 0 && (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
233
|
+
{isMulti && currentItems.length > 0 && (() => {
|
|
234
|
+
const totalAvailable = leafValues.length;
|
|
235
|
+
const selectedInScope = Array.isArray(tempValue)
|
|
236
|
+
? tempValue.filter(val => leafValues.includes(val)).length
|
|
237
|
+
: 0;
|
|
238
|
+
return (
|
|
239
|
+
<CapRow
|
|
240
|
+
className={classnames("cap-unified-select-select-all-container")}
|
|
241
|
+
align="middle"
|
|
242
|
+
>
|
|
243
|
+
<Checkbox
|
|
244
|
+
className={classnames("cap-unified-select-select-all-checkbox")}
|
|
245
|
+
checked={totalAvailable > 0 && selectedInScope === totalAvailable}
|
|
246
|
+
indeterminate={selectedInScope > 0 && selectedInScope < totalAvailable}
|
|
247
|
+
onChange={e => {
|
|
248
|
+
setTempValue(e.target.checked ? leafValues : []);
|
|
249
|
+
}}
|
|
250
|
+
>
|
|
251
|
+
<CapLabel type="label14" className={classnames("cap-unified-select-select-all-label")}>Select all</CapLabel>
|
|
252
|
+
</Checkbox>
|
|
253
|
+
</CapRow>
|
|
254
|
+
);
|
|
255
|
+
})()}
|
|
242
256
|
|
|
243
257
|
{currentItems.length === 0 ? <NoResult noResultCustomText={noResultCustomText} className={classnames(className, "cap-unified-select-no-result")} showUpload={showUpload} options={options}/> : menu}
|
|
244
258
|
|
|
@@ -279,7 +293,7 @@ const CapUnifiedSelect = ({
|
|
|
279
293
|
type={type}
|
|
280
294
|
treeData={filteredTree}
|
|
281
295
|
value={customPopupRender ? tempValue : value}
|
|
282
|
-
onChange={
|
|
296
|
+
onChange={onChange}
|
|
283
297
|
placeholder={placeholder}
|
|
284
298
|
showSearch={false}
|
|
285
299
|
maxTagCount={0}
|
|
@@ -96,11 +96,75 @@ export const StyledInfoIcon = styled.span`
|
|
|
96
96
|
export const selectStyles = css`
|
|
97
97
|
&.cap-unified-select-container {
|
|
98
98
|
text-align: justify;
|
|
99
|
-
.ant-btn-variant-solid:not(:disabled):not(.ant-btn-disabled):hover{
|
|
100
|
-
background-color: #42b040;
|
|
101
|
-
}
|
|
102
99
|
.ant-tree-select-dropdown{
|
|
103
100
|
padding: 0px;
|
|
101
|
+
.ant-select-tree{
|
|
102
|
+
.ant-select-tree-node-content-wrapper{
|
|
103
|
+
background-color: transparent;
|
|
104
|
+
}
|
|
105
|
+
.ant-select-tree-node-content-wrapper:hover {
|
|
106
|
+
background-color: transparent;
|
|
107
|
+
}
|
|
108
|
+
.ant-select-tree-treenode{
|
|
109
|
+
line-height: 40px;
|
|
110
|
+
margin-bottom: 0px;
|
|
111
|
+
.ant-select-tree-checkbox .ant-select-tree-checkbox-inner{
|
|
112
|
+
height: 18px;
|
|
113
|
+
width: 18px;
|
|
114
|
+
border: 2px solid #B3BAC5;
|
|
115
|
+
border-radius: 4px;
|
|
116
|
+
}
|
|
117
|
+
&:hover{
|
|
118
|
+
background-color: #FFFBE6;
|
|
119
|
+
}
|
|
120
|
+
&:not(.ant-select-tree-treenode-disabled) .ant-select-tree-node-content-wrapper:hover{
|
|
121
|
+
background-color: none;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
.ant-select-tree-node-content-wrapper{
|
|
125
|
+
border-radius: 0px;
|
|
126
|
+
padding-left: 3px;
|
|
127
|
+
}
|
|
128
|
+
.ant-select-tree-indent{
|
|
129
|
+
margin-left: 11px;
|
|
130
|
+
}
|
|
131
|
+
.ant-select-tree-switcher:not(.ant-select-tree-switcher-noop):hover:before{
|
|
132
|
+
background-color: transparent;
|
|
133
|
+
}
|
|
134
|
+
.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{
|
|
135
|
+
background-color: #42B040;
|
|
136
|
+
border: 2px solid #42B040 !important;
|
|
137
|
+
&:hover{
|
|
138
|
+
background-color: #42B040;
|
|
139
|
+
border: 2px solid #42B040 !important;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
.ant-select-tree-switcher .ant-select-tree-switcher-icon{
|
|
143
|
+
font-size: 12px;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
.ant-checkbox-wrapper:not(.ant-checkbox-wrapper-disabled):hover .ant-checkbox-checked:not(.ant-checkbox-disabled) .ant-checkbox-inner{
|
|
148
|
+
background-color: #42B040;
|
|
149
|
+
border: 2px solid #42B040 !important;
|
|
150
|
+
}
|
|
151
|
+
.ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate
|
|
152
|
+
.ant-select-tree-checkbox-inner {
|
|
153
|
+
background-color: #42b040 !important;
|
|
154
|
+
border-color: #42b040 !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.ant-select-tree-checkbox.ant-select-tree-checkbox-indeterminate
|
|
158
|
+
.ant-select-tree-checkbox-inner::after {
|
|
159
|
+
content: "";
|
|
160
|
+
position: absolute;
|
|
161
|
+
top: 50%;
|
|
162
|
+
left: 50%;
|
|
163
|
+
width: 10px;
|
|
164
|
+
height: 2px;
|
|
165
|
+
background-color: #fff;
|
|
166
|
+
transform: translate(-50%, -50%);
|
|
167
|
+
border-radius: 1px;
|
|
104
168
|
}
|
|
105
169
|
.cap-unified-tree-select-s{
|
|
106
170
|
height: 40px;
|
|
@@ -124,7 +188,7 @@ export const selectStyles = css`
|
|
|
124
188
|
align-items: center;
|
|
125
189
|
border-bottom: 1px solid #f0f0f0;
|
|
126
190
|
height: 40px;
|
|
127
|
-
padding-left:
|
|
191
|
+
padding-left: 16px;
|
|
128
192
|
|
|
129
193
|
.cap-unified-select-upload-label{
|
|
130
194
|
margin-left: 12px;
|
|
@@ -132,15 +196,51 @@ export const selectStyles = css`
|
|
|
132
196
|
}
|
|
133
197
|
}
|
|
134
198
|
.cap-unified-select-select-all-container{
|
|
135
|
-
padding: 9px
|
|
199
|
+
padding: 9px 15px;
|
|
136
200
|
cursor: pointer;
|
|
137
201
|
display: flex;
|
|
138
202
|
align-items: center;
|
|
139
203
|
border-bottom: 1px solid #f0f0f0;
|
|
140
204
|
height: 40px;
|
|
205
|
+
.cap-unified-select-select-all-checkbox{
|
|
206
|
+
display: contents !important;
|
|
207
|
+
.ant-checkbox-inner{
|
|
208
|
+
height: 18px;
|
|
209
|
+
width: 18px;
|
|
210
|
+
border: 2px solid #B3BAC5;
|
|
211
|
+
border-radius: 4px;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
.ant-checkbox-indeterminate .ant-checkbox-inner {
|
|
215
|
+
background-color: #42b040 !important;
|
|
216
|
+
border-color: #42b040 !important;
|
|
217
|
+
}
|
|
218
|
+
.ant-checkbox-indeterminate .ant-checkbox-inner::after {
|
|
219
|
+
content: "";
|
|
220
|
+
position: absolute;
|
|
221
|
+
top: 50%;
|
|
222
|
+
left: 50%;
|
|
223
|
+
width: 10px;
|
|
224
|
+
height: 2px;
|
|
225
|
+
background-color: #fff;
|
|
226
|
+
transform: translate(-50%, -50%);
|
|
227
|
+
border-radius: 1px;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
.ant-select-outlined:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector {
|
|
231
|
+
border-color: #7A869A !important;
|
|
232
|
+
}
|
|
233
|
+
.ant-select.ant-select-focused.ant-select-outlined:not(.ant-select-disabled) .ant-select-selector {
|
|
234
|
+
border-color: #7A869A !important;
|
|
235
|
+
box-shadow: none;
|
|
236
|
+
outline: 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.ant-btn-variant-solid:not(:disabled):not(.ant-btn-disabled):hover{
|
|
240
|
+
background-color: #42b040;
|
|
141
241
|
}
|
|
142
242
|
.ant-select-dropdown{
|
|
143
|
-
margin-top: -
|
|
243
|
+
margin-top: -8px !important;
|
|
144
244
|
border-radius: 4px;
|
|
145
245
|
box-shadow: 0px 4px 8px -2px #091E4240, 0px 0px 1px 0px #091E424F;
|
|
146
246
|
max-height: 368px;
|
|
@@ -162,23 +262,12 @@ export const selectStyles = css`
|
|
|
162
262
|
font-family: ${styledVars.FONT_FAMILY};
|
|
163
263
|
font-weight: 400;
|
|
164
264
|
font-size: 12px;
|
|
165
|
-
margin-top: -
|
|
265
|
+
margin-top: -5px;
|
|
166
266
|
letter-spacing: 0px;
|
|
167
267
|
color: #97A0AF;
|
|
168
268
|
}
|
|
169
269
|
.ant-input-affix-wrapper .ant-input-prefix{
|
|
170
|
-
left:
|
|
171
|
-
}
|
|
172
|
-
.ant-select-tree {
|
|
173
|
-
.ant-select-tree-node-content-wrapper{
|
|
174
|
-
background-color: transparent;
|
|
175
|
-
}
|
|
176
|
-
.ant-select-tree-node-content-wrapper:hover {
|
|
177
|
-
background-color: transparent;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
.ant-select-tree .ant-select-tree-switcher:not(.ant-select-tree-switcher-noop):hover:before{
|
|
181
|
-
background-color: transparent;
|
|
270
|
+
left: 12px;
|
|
182
271
|
}
|
|
183
272
|
.ant-select-selection-item{
|
|
184
273
|
background: transparent;
|
|
@@ -192,38 +281,13 @@ export const selectStyles = css`
|
|
|
192
281
|
.cap-unified-tree-select .ant-select-selector:focus{
|
|
193
282
|
border: 1px solid #7A869A;
|
|
194
283
|
}
|
|
195
|
-
|
|
196
|
-
height: 18px;
|
|
197
|
-
width: 18px;
|
|
198
|
-
border-color: #B3BAC5;
|
|
199
|
-
border-radius: 2px;
|
|
200
|
-
}
|
|
284
|
+
|
|
201
285
|
.cap-unified-tree-select .select-popup-container .ant-select-tree-switcher-noop,
|
|
202
286
|
.cap-unified-tree-select .multiSelect-popup-container .ant-select-tree-switcher-noop {
|
|
203
287
|
display: none;
|
|
204
288
|
}
|
|
205
289
|
.cap-unified-tree-select .multiSelect-popup-container .ant-select-tree-treenode{
|
|
206
|
-
padding-left:
|
|
207
|
-
}
|
|
208
|
-
.ant-tree-select-dropdown .ant-select-tree .ant-select-tree-treenode{
|
|
209
|
-
line-height: 40px;
|
|
210
|
-
margin-bottom: 0px;
|
|
211
|
-
.ant-select-tree-checkbox .ant-select-tree-checkbox-inner{
|
|
212
|
-
height: 18px;
|
|
213
|
-
width: 18px;
|
|
214
|
-
border: 2px solid #B3BAC5;
|
|
215
|
-
}
|
|
216
|
-
&:hover{
|
|
217
|
-
background-color: #FFFBE6;
|
|
218
|
-
border-radius: 4px;
|
|
219
|
-
}
|
|
220
|
-
&:not(.ant-select-tree-treenode-disabled) .ant-select-tree-node-content-wrapper:hover{
|
|
221
|
-
background-color: none;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
.ant-tree-select-dropdown .ant-select-tree .ant-select-tree-node-content-wrapper{
|
|
225
|
-
border-radius: 0px;
|
|
226
|
-
padding-left: 12px;
|
|
290
|
+
padding-left: 4px;
|
|
227
291
|
}
|
|
228
292
|
.ant-select-tree-treenode.ant-select-tree-treenode-selected{
|
|
229
293
|
background-color: #E9F0FE;
|
|
@@ -306,18 +370,18 @@ export const selectStyles = css`
|
|
|
306
370
|
border: none;
|
|
307
371
|
box-shadow: none;
|
|
308
372
|
border-radius: 0;
|
|
373
|
+
border-bottom: 1px solid transparent;
|
|
374
|
+
transition: border-color 0.2s ease;
|
|
309
375
|
}
|
|
310
376
|
|
|
311
377
|
.ant-input-affix-wrapper:hover {
|
|
312
|
-
border:
|
|
378
|
+
border-bottom: 1px solid #7A869A !important;
|
|
313
379
|
box-shadow: none;
|
|
314
|
-
border-bottom: 1px solid #EBECF0;
|
|
315
380
|
}
|
|
316
381
|
|
|
317
382
|
.ant-input-affix-wrapper:focus-within {
|
|
318
|
-
border:
|
|
383
|
+
border-bottom: 1px solid #091E42 !important;
|
|
319
384
|
box-shadow: none;
|
|
320
|
-
border-bottom: 1px solid #091E42;
|
|
321
385
|
outline: none;
|
|
322
386
|
}
|
|
323
387
|
|
|
@@ -326,5 +390,8 @@ export const selectStyles = css`
|
|
|
326
390
|
box-shadow: none !important;
|
|
327
391
|
}
|
|
328
392
|
}
|
|
393
|
+
.cap-tooltip-with-info-icon{
|
|
394
|
+
margin-top: 2px;
|
|
395
|
+
}
|
|
329
396
|
}
|
|
330
397
|
`;
|
package/package.json
CHANGED