dtable-ui-component 5.1.1 → 5.1.2-alpha2
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.
|
@@ -4,33 +4,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.toPercentage = exports.rgbaToHex = exports.isLightColor = exports.hexToRgba = exports.getInitialHexVal = void 0;
|
|
7
|
+
const defaultColor = '#ffffff';
|
|
7
8
|
const hexRegex = /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/i;
|
|
8
9
|
const rgbaRegex = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(0|1|0?\.\d+))?\s*\)$/i;
|
|
9
10
|
const hexToRgba = color => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
try {
|
|
12
|
+
if (rgbaRegex.test(color)) return color;
|
|
13
|
+
let r;
|
|
14
|
+
let g;
|
|
15
|
+
let b;
|
|
16
|
+
let a = 1;
|
|
17
|
+
const hex = color.replace(/^#/, '');
|
|
18
|
+
if (hex.length === 6 || hex.length === 8) {
|
|
19
|
+
r = parseInt(hex.slice(0, 2), 16);
|
|
20
|
+
g = parseInt(hex.slice(2, 4), 16);
|
|
21
|
+
b = parseInt(hex.slice(4, 6), 16);
|
|
22
|
+
a = hex.length === 8 ? Math.round(parseInt(hex.slice(6, 8), 16) / 255 * 100) / 100 : 1;
|
|
23
|
+
} else if (hex.length === 3) {
|
|
24
|
+
r = parseInt(hex[0] + hex[0], 16);
|
|
25
|
+
g = parseInt(hex[1] + hex[1], 16);
|
|
26
|
+
b = parseInt(hex[2] + hex[2], 16);
|
|
27
|
+
} else {
|
|
28
|
+
throw new Error('Invalid HEX color.');
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
r,
|
|
32
|
+
g,
|
|
33
|
+
b,
|
|
34
|
+
a
|
|
35
|
+
};
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error(error.message);
|
|
38
|
+
return hexToRgba(defaultColor);
|
|
27
39
|
}
|
|
28
|
-
return {
|
|
29
|
-
r,
|
|
30
|
-
g,
|
|
31
|
-
b,
|
|
32
|
-
a
|
|
33
|
-
};
|
|
34
40
|
};
|
|
35
41
|
exports.hexToRgba = hexToRgba;
|
|
36
42
|
const rgbaToHex = function (color) {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.user-select .select-module-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.user-select .select-module.select-module-avatar {
|
|
7
|
+
height: 24px;
|
|
8
|
+
width: 24px;
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.user-select .true__value-container .select-module-container {
|
|
13
|
+
display: block;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.user-select .true__value-container .select-module.select-module-avatar {
|
|
17
|
+
height: 16px;
|
|
18
|
+
width: 16px;
|
|
19
|
+
border-radius: 50%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.user-select .true__value-container .true__multi-value__label {
|
|
23
|
+
padding: 0px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.user-select .true__value-container .true__multi-value__label .select-module.select-module-avatar {
|
|
27
|
+
transform: translateY(-2px);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.user-select .true__value-container .select-module.select-module-name {
|
|
31
|
+
font-size: 13px;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
flex: 1 1;
|
|
36
|
+
line-height: 20px;
|
|
37
|
+
margin-left: 5px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.user-select .true__control.true__control--is-focused,
|
|
41
|
+
.user-select .true__control.true__control--is-focused:hover {
|
|
42
|
+
background-color: #ffffff;
|
|
43
|
+
border-color: #1991eb;
|
|
44
|
+
outline: 0;
|
|
45
|
+
box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25);
|
|
46
|
+
}
|
|
@@ -4,9 +4,76 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.Option = exports.MenuSelectStyle = exports.MenuList = exports.DropdownIndicator = exports.ClearIndicator = void 0;
|
|
7
|
+
exports.UserSelectStyle = exports.Option = exports.MenuSelectStyle = exports.MenuList = exports.DropdownIndicator = exports.ClearIndicator = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactSelect = require("react-select");
|
|
10
|
+
const UserSelectStyle = exports.UserSelectStyle = {
|
|
11
|
+
option: (provided, state) => {
|
|
12
|
+
const {
|
|
13
|
+
isDisabled,
|
|
14
|
+
isFocused
|
|
15
|
+
} = state;
|
|
16
|
+
return {
|
|
17
|
+
...provided,
|
|
18
|
+
cursor: isDisabled ? 'default' : 'pointer',
|
|
19
|
+
backgroundColor: isFocused ? '#f5f5f5' : '#fff'
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
control: provided => ({
|
|
23
|
+
...provided,
|
|
24
|
+
fontSize: '14px',
|
|
25
|
+
cursor: 'pointer',
|
|
26
|
+
lineHeight: '1.5'
|
|
27
|
+
}),
|
|
28
|
+
indicatorSeparator: () => ({
|
|
29
|
+
display: 'none'
|
|
30
|
+
}),
|
|
31
|
+
dropdownIndicator: () => ({
|
|
32
|
+
display: 'none'
|
|
33
|
+
}),
|
|
34
|
+
clearIndicator: () => ({
|
|
35
|
+
display: 'none'
|
|
36
|
+
}),
|
|
37
|
+
multiValue: provided => {
|
|
38
|
+
return {
|
|
39
|
+
...provided,
|
|
40
|
+
display: 'inline-flex',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
background: '#eaeaea',
|
|
43
|
+
borderRadius: '10px',
|
|
44
|
+
margin: '0 10px 0 0',
|
|
45
|
+
padding: '0 0 0 2px'
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
multiValueLabel: provided => {
|
|
49
|
+
return {
|
|
50
|
+
...provided,
|
|
51
|
+
padding: '0px'
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
multiValueRemove: provided => {
|
|
55
|
+
return {
|
|
56
|
+
...provided,
|
|
57
|
+
color: '#666',
|
|
58
|
+
':hover': {
|
|
59
|
+
backgroundColor: 'transparent',
|
|
60
|
+
color: '#555555'
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
singleValue: provided => {
|
|
65
|
+
return {
|
|
66
|
+
...provided,
|
|
67
|
+
display: 'inline-flex',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
background: '#eaeaea',
|
|
70
|
+
borderRadius: '10px',
|
|
71
|
+
margin: '0',
|
|
72
|
+
padding: '0 2px',
|
|
73
|
+
width: 'fit-content'
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
};
|
|
10
77
|
const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
11
78
|
option: (provided, state) => {
|
|
12
79
|
const {
|