dtable-ui-component 6.0.110-tru.2 → 6.0.110-wer.1
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/lib/DTableCustomizeSelect/index.css +30 -59
- package/lib/DTableCustomizeSelect/index.js +11 -10
- package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +109 -0
- package/lib/DTableCustomizeSelect/select-option-group/index.css +130 -0
- package/lib/DTableCustomizeSelect/select-option-group/index.js +252 -0
- package/lib/DTableCustomizeSelect/select-option-group/option.js +48 -0
- package/lib/DTableCustomizeSelect/select-option-group/search-input.js +135 -0
- package/lib/DTableCustomizeSelect/util.js +12 -0
- package/lib/DTableSelect/index.js +146 -42
- package/lib/DTableSelect/select-dropdown-indicator/index.css +12 -0
- package/lib/DTableSelect/select-dropdown-indicator/index.js +20 -0
- package/lib/DTableSelect/select-style.js +134 -0
- package/lib/DTableSelect/user-select.css +3 -50
- package/lib/assets/icons/close.svg +1 -0
- package/package.json +1 -1
- package/lib/DTableSelect/utils.js +0 -244
|
@@ -1,117 +1,88 @@
|
|
|
1
|
-
.
|
|
1
|
+
.seatable-customize-select {
|
|
2
2
|
position: relative;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.dtable-select.custom-select {
|
|
6
3
|
display: flex;
|
|
7
4
|
padding: 0 16px;
|
|
8
|
-
border-radius:
|
|
5
|
+
border-radius: 4px;
|
|
9
6
|
align-items: center;
|
|
10
7
|
justify-content: space-between;
|
|
11
8
|
max-width: 900px;
|
|
12
9
|
user-select: none;
|
|
13
|
-
-webkit-user-select: none;
|
|
14
|
-
-moz-user-select: none;
|
|
15
|
-
-o-user-select: none;
|
|
16
|
-
-ms-user-select: none;
|
|
17
10
|
text-align: left;
|
|
11
|
+
line-height: 1.5;
|
|
12
|
+
background-image: none;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
color: var(--bs-body-color);
|
|
15
|
+
border: 1px solid rgba(0, 40, 100, 0.12);
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
.
|
|
21
|
-
.
|
|
22
|
-
border-color: #
|
|
23
|
-
box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25);
|
|
18
|
+
.seatable-customize-select:focus,
|
|
19
|
+
.seatable-customize-select.focus {
|
|
20
|
+
border-color: #3E84F7 !important;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
.
|
|
27
|
-
.
|
|
28
|
-
.
|
|
23
|
+
.seatable-customize-select.disabled:focus,
|
|
24
|
+
.seatable-customize-select.focus.disabled,
|
|
25
|
+
.seatable-customize-select.disabled:hover {
|
|
29
26
|
border-color: rgba(0, 40, 100, 0.12) !important;
|
|
30
27
|
box-shadow: unset;
|
|
31
28
|
cursor: default;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
.
|
|
31
|
+
.seatable-customize-select:hover {
|
|
35
32
|
cursor: pointer;
|
|
36
|
-
border-color:
|
|
33
|
+
border-color: var(--bs-border-color);
|
|
37
34
|
}
|
|
38
35
|
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
color:
|
|
43
|
-
transition: all 0.1s;
|
|
36
|
+
.seatable-customize-select .seatable-multicolor-icon-down {
|
|
37
|
+
width: 12px;
|
|
38
|
+
height: 12px;
|
|
39
|
+
color: var(--bs-icon-color);
|
|
44
40
|
}
|
|
45
41
|
|
|
46
|
-
.
|
|
42
|
+
.seatable-customize-select .selected-option {
|
|
47
43
|
display: flex;
|
|
48
44
|
flex: 1;
|
|
49
45
|
overflow: hidden;
|
|
50
46
|
flex-wrap: nowrap;
|
|
51
47
|
align-items: center;
|
|
52
48
|
justify-content: space-between;
|
|
53
|
-
background:
|
|
49
|
+
background: inherit;
|
|
54
50
|
}
|
|
55
51
|
|
|
56
|
-
.
|
|
57
|
-
.
|
|
52
|
+
.seatable-customize-select.dtable-ui-collaborator-selector .seatable-option-group .seatable-option-group-content,
|
|
53
|
+
.seatable-customize-select.selector-group .seatable-option-group .seatable-option-group-content {
|
|
58
54
|
padding: 10px;
|
|
59
55
|
}
|
|
60
56
|
|
|
61
|
-
.
|
|
57
|
+
.seatable-customize-select.dtable-ui-collaborator-selector .seatable-option-group .seatable-option-group-content {
|
|
62
58
|
padding: 10px 0;
|
|
63
59
|
}
|
|
64
60
|
|
|
65
|
-
.
|
|
61
|
+
.seatable-customize-select.dtable-ui-collaborator-selector .option {
|
|
66
62
|
padding: 5px 0 5px 10px !important;
|
|
67
63
|
line-height: 20px;
|
|
68
64
|
}
|
|
69
65
|
|
|
70
|
-
.
|
|
66
|
+
.seatable-customize-select.selector-group .option {
|
|
71
67
|
height: 30px;
|
|
72
68
|
display: flex;
|
|
73
69
|
align-items: center;
|
|
74
70
|
}
|
|
75
71
|
|
|
76
|
-
.
|
|
72
|
+
.seatable-customize-select.selector-group .select-group-option {
|
|
77
73
|
justify-content: space-between;
|
|
78
74
|
}
|
|
79
75
|
|
|
80
|
-
.
|
|
76
|
+
.seatable-customize-select.selector-group .selected-option .selected-group {
|
|
81
77
|
padding: 0 2px;
|
|
82
78
|
background: #eceff4;
|
|
83
79
|
border-radius: 3px;
|
|
84
80
|
}
|
|
85
81
|
|
|
86
|
-
.dtable-select .selected-option-show {
|
|
87
|
-
overflow: hidden;
|
|
88
|
-
text-overflow: ellipsis;
|
|
89
|
-
white-space: nowrap;
|
|
90
|
-
}
|
|
91
82
|
|
|
92
|
-
.
|
|
83
|
+
.seatable-customize-select .select-placeholder {
|
|
93
84
|
line-height: 1;
|
|
94
85
|
font-size: 14px;
|
|
95
86
|
white-space: nowrap;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
.option-group .option-group-selector-multiple-select .option-group-search,
|
|
99
|
-
.option-group .option-group-selector-single-select .option-group-search {
|
|
100
|
-
padding: 0 0 8px 0 !important;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.option-group-selector-multiple-select .form-control,
|
|
104
|
-
.option-group-selector-single-select .form-control {
|
|
105
|
-
border: none;
|
|
106
|
-
border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
|
|
107
|
-
border-radius: 4px 4px 0 0;
|
|
108
|
-
padding: .375rem .5rem !important;
|
|
109
|
-
height: 32px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.option-group-selector-multiple-select .form-control:focus,
|
|
113
|
-
.option-group-selector-single-select .form-control:focus {
|
|
114
|
-
border-color: transparent !important;
|
|
115
|
-
border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
|
|
116
|
-
box-shadow: none !important;
|
|
87
|
+
color: #868E96;
|
|
117
88
|
}
|
|
@@ -7,9 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _SelectOptionGroup = _interopRequireDefault(require("../SelectOptionGroup"));
|
|
11
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _selectOptionGroup = _interopRequireDefault(require("./select-option-group"));
|
|
12
12
|
var _ModalPortal = _interopRequireDefault(require("../ModalPortal"));
|
|
13
|
+
var _util = require("./util");
|
|
13
14
|
require("./index.css");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
class DTableCustomizeSelect extends _react.Component {
|
|
@@ -23,8 +24,8 @@ class DTableCustomizeSelect extends _react.Component {
|
|
|
23
24
|
*/
|
|
24
25
|
if (this.state.isShowSelectOptions) event.stopPropagation();
|
|
25
26
|
let eventClassName = event.target.className;
|
|
26
|
-
if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'option-group-search') return;
|
|
27
|
-
// Prevent closing by pressing the
|
|
27
|
+
if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'seatable-option-group-search') return;
|
|
28
|
+
// Prevent closing by pressing the space bar in the search input
|
|
28
29
|
if (event.target.value === '') return;
|
|
29
30
|
this.setState({
|
|
30
31
|
isShowSelectOptions: !this.state.isShowSelectOptions
|
|
@@ -83,7 +84,7 @@ class DTableCustomizeSelect extends _react.Component {
|
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
render() {
|
|
86
|
-
|
|
87
|
+
const {
|
|
87
88
|
className,
|
|
88
89
|
value,
|
|
89
90
|
options,
|
|
@@ -93,17 +94,19 @@ class DTableCustomizeSelect extends _react.Component {
|
|
|
93
94
|
noOptionsPlaceholder,
|
|
94
95
|
isLocked,
|
|
95
96
|
isInModal,
|
|
96
|
-
addOptionAble,
|
|
97
97
|
component
|
|
98
98
|
} = this.props;
|
|
99
99
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
100
|
+
tabIndex: "0",
|
|
101
|
+
role: "button",
|
|
100
102
|
ref: node => this.selector = node,
|
|
101
|
-
className: (0, _classnames.default)('
|
|
103
|
+
className: (0, _classnames.default)('seatable-customize-select custom-select', {
|
|
102
104
|
'focus': this.state.isShowSelectOptions
|
|
103
105
|
}, {
|
|
104
106
|
'disabled': isLocked
|
|
105
107
|
}, className),
|
|
106
108
|
onClick: this.onSelectToggle,
|
|
109
|
+
onKeyDown: _util.onKeyDown,
|
|
107
110
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
108
111
|
className: "selected-option",
|
|
109
112
|
children: [value && value.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
@@ -115,9 +118,8 @@ class DTableCustomizeSelect extends _react.Component {
|
|
|
115
118
|
}), !isLocked && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
116
119
|
className: "dtable-font dtable-icon-down3"
|
|
117
120
|
})]
|
|
118
|
-
}), this.state.isShowSelectOptions && !isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
121
|
+
}), this.state.isShowSelectOptions && !isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_selectOptionGroup.default, {
|
|
119
122
|
value: value,
|
|
120
|
-
addOptionAble: addOptionAble,
|
|
121
123
|
component: component,
|
|
122
124
|
isShowSelected: this.props.isShowSelected,
|
|
123
125
|
top: this.getSelectedOptionTop(),
|
|
@@ -131,10 +133,9 @@ class DTableCustomizeSelect extends _react.Component {
|
|
|
131
133
|
getFilterOptions: this.getFilterOptions,
|
|
132
134
|
supportMultipleSelect: this.props.supportMultipleSelect
|
|
133
135
|
}), this.state.isShowSelectOptions && isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalPortal.default, {
|
|
134
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
136
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_selectOptionGroup.default, {
|
|
135
137
|
className: className,
|
|
136
138
|
value: value,
|
|
137
|
-
addOptionAble: addOptionAble,
|
|
138
139
|
component: component,
|
|
139
140
|
isShowSelected: this.props.isShowSelected,
|
|
140
141
|
position: this.selector.getBoundingClientRect(),
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const KeyCodes = {
|
|
8
|
+
Backspace: 8,
|
|
9
|
+
Tab: 9,
|
|
10
|
+
Enter: 13,
|
|
11
|
+
Shift: 16,
|
|
12
|
+
Ctrl: 17,
|
|
13
|
+
Alt: 18,
|
|
14
|
+
PauseBreak: 19,
|
|
15
|
+
CapsLock: 20,
|
|
16
|
+
Escape: 27,
|
|
17
|
+
Esc: 27,
|
|
18
|
+
Space: 32,
|
|
19
|
+
PageUp: 33,
|
|
20
|
+
PageDown: 34,
|
|
21
|
+
End: 35,
|
|
22
|
+
Home: 36,
|
|
23
|
+
LeftArrow: 37,
|
|
24
|
+
UpArrow: 38,
|
|
25
|
+
RightArrow: 39,
|
|
26
|
+
DownArrow: 40,
|
|
27
|
+
Insert: 45,
|
|
28
|
+
Delete: 46,
|
|
29
|
+
0: 48,
|
|
30
|
+
1: 49,
|
|
31
|
+
2: 50,
|
|
32
|
+
3: 51,
|
|
33
|
+
4: 52,
|
|
34
|
+
5: 53,
|
|
35
|
+
6: 54,
|
|
36
|
+
7: 55,
|
|
37
|
+
8: 56,
|
|
38
|
+
9: 57,
|
|
39
|
+
a: 65,
|
|
40
|
+
b: 66,
|
|
41
|
+
c: 67,
|
|
42
|
+
d: 68,
|
|
43
|
+
e: 69,
|
|
44
|
+
f: 70,
|
|
45
|
+
g: 71,
|
|
46
|
+
h: 72,
|
|
47
|
+
i: 73,
|
|
48
|
+
j: 74,
|
|
49
|
+
k: 75,
|
|
50
|
+
l: 76,
|
|
51
|
+
m: 77,
|
|
52
|
+
n: 78,
|
|
53
|
+
o: 79,
|
|
54
|
+
p: 80,
|
|
55
|
+
q: 81,
|
|
56
|
+
r: 82,
|
|
57
|
+
s: 83,
|
|
58
|
+
t: 84,
|
|
59
|
+
u: 85,
|
|
60
|
+
v: 86,
|
|
61
|
+
w: 87,
|
|
62
|
+
x: 88,
|
|
63
|
+
y: 89,
|
|
64
|
+
z: 90,
|
|
65
|
+
LeftWindowKey: 91,
|
|
66
|
+
RightWindowKey: 92,
|
|
67
|
+
SelectKey: 93,
|
|
68
|
+
NumPad0: 96,
|
|
69
|
+
NumPad1: 97,
|
|
70
|
+
NumPad2: 98,
|
|
71
|
+
NumPad3: 99,
|
|
72
|
+
NumPad4: 100,
|
|
73
|
+
NumPad5: 101,
|
|
74
|
+
NumPad6: 102,
|
|
75
|
+
NumPad7: 103,
|
|
76
|
+
NumPad8: 104,
|
|
77
|
+
NumPad9: 105,
|
|
78
|
+
Multiply: 106,
|
|
79
|
+
Add: 107,
|
|
80
|
+
Subtract: 109,
|
|
81
|
+
DecimalPoint: 110,
|
|
82
|
+
Divide: 111,
|
|
83
|
+
F1: 112,
|
|
84
|
+
F2: 113,
|
|
85
|
+
F3: 114,
|
|
86
|
+
F4: 115,
|
|
87
|
+
F5: 116,
|
|
88
|
+
F6: 117,
|
|
89
|
+
F7: 118,
|
|
90
|
+
F8: 119,
|
|
91
|
+
F9: 120,
|
|
92
|
+
F10: 121,
|
|
93
|
+
F12: 123,
|
|
94
|
+
NumLock: 144,
|
|
95
|
+
ScrollLock: 145,
|
|
96
|
+
SemiColon: 186,
|
|
97
|
+
EqualSign: 187,
|
|
98
|
+
Comma: 188,
|
|
99
|
+
Dash: 189,
|
|
100
|
+
Period: 190,
|
|
101
|
+
ForwardSlash: 191,
|
|
102
|
+
GraveAccent: 192,
|
|
103
|
+
OpenBracket: 219,
|
|
104
|
+
BackSlash: 220,
|
|
105
|
+
CloseBracket: 221,
|
|
106
|
+
SingleQuote: 222,
|
|
107
|
+
ChineseInputMethod: 229
|
|
108
|
+
};
|
|
109
|
+
var _default = exports.default = KeyCodes;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
.seatable-option-group {
|
|
2
|
+
position: absolute;
|
|
3
|
+
left: 0;
|
|
4
|
+
min-height: 60px;
|
|
5
|
+
max-height: 300px;
|
|
6
|
+
min-width: 100%;
|
|
7
|
+
max-width: 15rem;
|
|
8
|
+
box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.1);
|
|
9
|
+
background: var(--bs-popover-bg);
|
|
10
|
+
border: 1px solid rgba(0, 40, 100, 0.12);
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
z-index: 10001;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.seatable-option-group .seatable-option-group-search {
|
|
16
|
+
width: 100%;
|
|
17
|
+
padding: 6px 10px;
|
|
18
|
+
min-width: 170px;
|
|
19
|
+
position: relative;
|
|
20
|
+
padding: 0;
|
|
21
|
+
height: 32px;
|
|
22
|
+
border-bottom: 1px solid var(--bs-border-color);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.seatable-option-group .seatable-option-group-search .form-control {
|
|
26
|
+
height: 31px;
|
|
27
|
+
border: none;
|
|
28
|
+
padding: .375rem 1rem;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.seatable-option-group .seatable-option-group-search .form-control:focus {
|
|
33
|
+
outline: none;
|
|
34
|
+
box-shadow: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.seatable-option-group .seatable-option-group-search .input-icon-addon {
|
|
38
|
+
z-index: 1;
|
|
39
|
+
pointer-events: auto;
|
|
40
|
+
min-width: 2.5rem !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.seatable-option-group .seatable-option-group-search .input-icon-addon svg {
|
|
44
|
+
color: #999;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.seatable-option-group .none-search-result {
|
|
49
|
+
height: 100px;
|
|
50
|
+
width: 100%;
|
|
51
|
+
padding: 10px;
|
|
52
|
+
color: var(--bs-body-secondary-color);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.seatable-option-group .seatable-option-group-content {
|
|
56
|
+
max-height: 252px;
|
|
57
|
+
overflow-y: auto;
|
|
58
|
+
padding: 8px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.seatable-select-option {
|
|
62
|
+
position: relative;
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: space-between;
|
|
65
|
+
align-items: center;
|
|
66
|
+
width: 100%;
|
|
67
|
+
line-height: 24px;
|
|
68
|
+
padding: 0.25rem 10px;
|
|
69
|
+
clear: both;
|
|
70
|
+
font-weight: 400;
|
|
71
|
+
text-align: inherit;
|
|
72
|
+
background-color: transparent;
|
|
73
|
+
border: 0;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
text-overflow: ellipsis;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
border-radius: 4px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.seatable-select-option.seatable-select-option-active {
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* .seatable-select-option .seatable-multicolor-icon-tick {
|
|
86
|
+
right: 10px;
|
|
87
|
+
position: absolute;
|
|
88
|
+
color: inherit;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.seatable-select-option:not(.seatable-select-option-active):hover .header-icon .seatable-multicolor-icon {
|
|
92
|
+
fill: #aaa;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.seatable-select-option:not(.seatable-select-option-active):hover .header-icon .sf2-icon-tick {
|
|
96
|
+
color: #aaa;
|
|
97
|
+
} */
|
|
98
|
+
|
|
99
|
+
.seatable-select-option .select-option-name .single-select-option {
|
|
100
|
+
margin: 0 0 0 12px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.seatable-select-option .select-option-name .multiple-select-option {
|
|
104
|
+
margin: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.seatable-option-group-selector-single-select .select-option-name,
|
|
108
|
+
.seatable-option-group-selector-multiple-select .multiple-option-name {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: space-between;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.seatable-option-group-selector-multiple-select .multiple-check-icon {
|
|
115
|
+
display: inline-flex;
|
|
116
|
+
width: 20px;
|
|
117
|
+
text-align: center;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.seatable-option-group-selector-multiple-select .multiple-check-icon .dtable-icon-check-mark {
|
|
121
|
+
font-size: 12px;
|
|
122
|
+
color: #798d99;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.seatable-option-group-selector-single-select .seatable-select-option:hover,
|
|
126
|
+
.seatable-option-group-selector-single-select .seatable-select-option.seatable-select-option-active,
|
|
127
|
+
.seatable-option-group-selector-multiple-select .seatable-select-option:hover,
|
|
128
|
+
.seatable-option-group-selector-multiple-select .seatable-select-option.seatable-select-option-active {
|
|
129
|
+
background-color: #f5f5f5;
|
|
130
|
+
}
|