dtable-ui-component 6.0.125 → 6.0.126-beta.s1
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/AsyncUserSelect/index.css +46 -14
- package/lib/AsyncUserSelect/index.js +22 -18
- package/lib/DTableCustomizeSearchInput/index.css +81 -0
- package/lib/DTableCustomizeSearchInput/index.js +141 -0
- package/lib/DTableCustomizeSelect/index.css +67 -43
- package/lib/DTableCustomizeSelect/index.js +18 -12
- package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +109 -0
- package/lib/DTableCustomizeSelect/select-option-group/index.css +134 -0
- package/lib/DTableCustomizeSelect/select-option-group/index.js +260 -0
- package/lib/DTableCustomizeSelect/select-option-group/option.js +48 -0
- package/lib/DTableCustomizeSelect/util.js +12 -0
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +2 -2
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
- package/lib/DTableGroupSelect/index.css +31 -5
- package/lib/DTableGroupSelect/index.js +2 -2
- package/lib/DTableGroupSelect/select-option-group.css +11 -15
- package/lib/DTableGroupSelect/select-option-group.js +11 -8
- package/lib/DTableSelect/dtable-select-label.css +4 -4
- package/lib/DTableSelect/dtable-select-label.js +1 -1
- package/lib/DTableSelect/index.js +3 -3
- package/lib/DTableSelect/select-dropdown-indicator/index.css +16 -0
- package/lib/DTableSelect/select-dropdown-indicator/index.js +26 -0
- package/lib/DTableSelect/select-style.js +133 -0
- package/lib/DTableSelect/user-select.css +7 -46
- package/lib/DTableSelect/utils.js +166 -77
- package/lib/SelectOptionGroup/index.css +50 -22
- package/lib/SelectOptionGroup/index.js +46 -7
- package/lib/assets/icons/close.svg +1 -0
- package/lib/assets/icons/down.svg +3 -0
- package/lib/index.js +7 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.processOptionsWithClear = exports.handleSelectChange = exports.createHandleChange = exports.Option = exports.MenuSelectStyle = exports.MenuList = exports.DropdownIndicator = exports.ClearIndicator = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -12,114 +12,153 @@ var _reactSelect = require("react-select");
|
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
const _excluded = ["innerProps"]; // DtableSelect is based on seatable-ui.css, so use the following content to override the default react-select style
|
|
14
14
|
const DEFAULT_CONTROL_STYLE = {
|
|
15
|
-
|
|
15
|
+
fontSize: '14px',
|
|
16
|
+
padding: '0 4px',
|
|
17
|
+
border: '1px solid var(--bs-border-color) !important',
|
|
18
|
+
boxShadow: 'none',
|
|
19
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
20
|
+
borderRadius: '4px',
|
|
21
|
+
outline: '0'
|
|
16
22
|
};
|
|
17
|
-
const
|
|
23
|
+
const DISABLED_CONTROL_STYLE = {
|
|
18
24
|
fontSize: '14px',
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
padding: '0 4px',
|
|
26
|
+
border: '1px solid rgba(0, 40, 100, 0.12)',
|
|
27
|
+
boxShadow: 'none',
|
|
28
|
+
backgroundColor: 'var(--bs-bg-color)',
|
|
29
|
+
borderRadius: '4px',
|
|
21
30
|
outline: '0',
|
|
22
|
-
|
|
31
|
+
cursor: 'default',
|
|
32
|
+
opacity: 0.65
|
|
33
|
+
};
|
|
34
|
+
const FOCUS_CONTROL_STYLE = {
|
|
35
|
+
fontSize: '14px',
|
|
36
|
+
padding: '0 4px',
|
|
37
|
+
border: '1px solid #3E84F7',
|
|
38
|
+
boxShadow: 'none',
|
|
39
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
40
|
+
borderRadius: '4px',
|
|
41
|
+
outline: '0'
|
|
23
42
|
};
|
|
24
|
-
const noneCallback = () => ({
|
|
25
|
-
display: 'none'
|
|
26
|
-
});
|
|
27
43
|
const controlCallback = (provided, state) => {
|
|
28
44
|
const {
|
|
29
45
|
isDisabled,
|
|
30
46
|
isFocused
|
|
31
47
|
} = state;
|
|
32
|
-
if (
|
|
33
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided),
|
|
34
|
-
'
|
|
48
|
+
if (isDisabled) {
|
|
49
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), DISABLED_CONTROL_STYLE), {}, {
|
|
50
|
+
':active': {
|
|
51
|
+
border: '1px solid #3E84F7'
|
|
52
|
+
},
|
|
53
|
+
'.header-icon': {
|
|
54
|
+
color: 'var(--bs-icon-secondary-color)',
|
|
55
|
+
padding: '0 0.5rem !important'
|
|
56
|
+
}
|
|
35
57
|
});
|
|
36
58
|
}
|
|
37
|
-
|
|
59
|
+
if (isFocused) {
|
|
60
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE);
|
|
61
|
+
}
|
|
62
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
38
63
|
fontSize: '14px',
|
|
39
64
|
lineHeight: '1.5',
|
|
40
65
|
cursor: 'pointer'
|
|
41
|
-
}, DEFAULT_CONTROL_STYLE)
|
|
42
|
-
'&:hover': (0, _objectSpread2.default)({}, DEFAULT_CONTROL_STYLE)
|
|
43
|
-
});
|
|
66
|
+
}, DEFAULT_CONTROL_STYLE);
|
|
44
67
|
};
|
|
45
|
-
const
|
|
68
|
+
const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
69
|
+
menu: base => {
|
|
70
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
71
|
+
padding: '8px',
|
|
72
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
73
|
+
border: '1px solid var(--bs-border-secondary-color)',
|
|
74
|
+
borderRadius: '4px',
|
|
75
|
+
boxShadow: '0px 6px 14px rgba(0, 0, 0, 0.1)',
|
|
76
|
+
marginTop: '4px',
|
|
77
|
+
marginBottom: 0
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
menuList: provided => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
81
|
+
padding: 0
|
|
82
|
+
}),
|
|
46
83
|
option: (provided, state) => {
|
|
47
84
|
const {
|
|
48
85
|
isDisabled,
|
|
49
86
|
isFocused
|
|
50
87
|
} = state;
|
|
51
88
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
89
|
+
color: 'var(--bs-body-color)',
|
|
90
|
+
borderRadius: '4px',
|
|
91
|
+
minHeight: '32px',
|
|
92
|
+
padding: '8px',
|
|
52
93
|
cursor: isDisabled ? 'default' : 'pointer',
|
|
53
|
-
backgroundColor: isFocused ? '
|
|
94
|
+
backgroundColor: isFocused ? 'var(--bs-hover-bg)' : 'var(--bs-popover-bg)',
|
|
95
|
+
overflow: 'hidden',
|
|
96
|
+
whiteSpace: 'nowrap',
|
|
97
|
+
textOverflow: 'ellipsis',
|
|
98
|
+
':hover': {
|
|
99
|
+
backgroundColor: 'rgba(0, 0, 0, 0.04)'
|
|
100
|
+
},
|
|
101
|
+
'.header-icon': {
|
|
102
|
+
color: 'var(--bs-icon-secondary-color)',
|
|
103
|
+
padding: '0 0.5rem !important'
|
|
104
|
+
}
|
|
54
105
|
});
|
|
55
106
|
},
|
|
56
107
|
control: controlCallback,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
108
|
+
menuPortal: base => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
109
|
+
zIndex: 9999,
|
|
110
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
111
|
+
color: 'var(--bs-body-color)',
|
|
112
|
+
borderColor: 'var(--bs-border-secondary-color)'
|
|
113
|
+
}),
|
|
114
|
+
singleValue: provided => {
|
|
61
115
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
62
|
-
|
|
63
|
-
alignItems: 'center',
|
|
64
|
-
background: '#eaeaea',
|
|
65
|
-
borderRadius: '10px',
|
|
66
|
-
margin: '0 10px 0 0',
|
|
67
|
-
padding: '0 0 0 2px'
|
|
116
|
+
color: 'var(--bs-body-color)'
|
|
68
117
|
});
|
|
69
118
|
},
|
|
70
|
-
|
|
119
|
+
multiValue: provided => {
|
|
71
120
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
72
|
-
|
|
121
|
+
color: 'var(--bs-body-color)'
|
|
73
122
|
});
|
|
74
123
|
},
|
|
75
|
-
multiValueRemove:
|
|
124
|
+
multiValueRemove: styles => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
|
125
|
+
'.dtable-font': {
|
|
126
|
+
color: 'var(--bs-icon-color)'
|
|
127
|
+
},
|
|
128
|
+
'.dtable-font:hover': {
|
|
129
|
+
backgroundColor: 'transparent',
|
|
130
|
+
color: 'var(--bs-icon-color)'
|
|
131
|
+
}
|
|
132
|
+
}),
|
|
133
|
+
input: styles => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
|
134
|
+
color: 'var(--bs-body-color)'
|
|
135
|
+
}),
|
|
136
|
+
placeholder: (provided, state) => {
|
|
137
|
+
const {
|
|
138
|
+
isDisabled
|
|
139
|
+
} = state;
|
|
76
140
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
77
|
-
color: '#
|
|
78
|
-
|
|
79
|
-
backgroundColor: 'transparent',
|
|
80
|
-
color: '#555555'
|
|
81
|
-
}
|
|
141
|
+
color: '#868E96',
|
|
142
|
+
opacity: isDisabled ? 0.65 : 1
|
|
82
143
|
});
|
|
83
144
|
},
|
|
84
|
-
|
|
85
|
-
return
|
|
86
|
-
display: '
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
margin: '0',
|
|
91
|
-
padding: '0 2px',
|
|
92
|
-
width: 'fit-content'
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
97
|
-
option: (provided, state) => {
|
|
145
|
+
indicatorSeparator: (styles, state) => {
|
|
146
|
+
return {
|
|
147
|
+
'display': 'none'
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
dropdownIndicator: (provided, state) => {
|
|
98
151
|
const {
|
|
99
|
-
isDisabled
|
|
100
|
-
isFocused
|
|
152
|
+
isDisabled
|
|
101
153
|
} = state;
|
|
102
154
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
':active': {
|
|
108
|
-
backgroundColor: '#f5f5f5'
|
|
109
|
-
},
|
|
110
|
-
'.header-icon .dtable-font': {
|
|
111
|
-
color: '#aaa'
|
|
112
|
-
},
|
|
113
|
-
'.header-icon .multicolor-icon': {
|
|
114
|
-
color: '#aaa'
|
|
155
|
+
paddingRight: '12px',
|
|
156
|
+
'.dtable-font': {
|
|
157
|
+
color: 'var(--bs-icon-color) !important',
|
|
158
|
+
opacity: isDisabled ? 0.65 : 1
|
|
115
159
|
}
|
|
116
160
|
});
|
|
117
|
-
}
|
|
118
|
-
control: controlCallback,
|
|
119
|
-
menuPortal: base => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
120
|
-
zIndex: 9999
|
|
121
|
-
}),
|
|
122
|
-
indicatorSeparator: noneCallback
|
|
161
|
+
}
|
|
123
162
|
};
|
|
124
163
|
const DropdownIndicator = props => {
|
|
125
164
|
return _reactSelect.components.DropdownIndicator && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.DropdownIndicator, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
@@ -127,7 +166,9 @@ const DropdownIndicator = props => {
|
|
|
127
166
|
className: "dtable-font dtable-icon-down3",
|
|
128
167
|
style: {
|
|
129
168
|
fontSize: '12px',
|
|
130
|
-
marginLeft: '-2px'
|
|
169
|
+
marginLeft: '-2px',
|
|
170
|
+
color: 'var(--bs-icon-color)',
|
|
171
|
+
paddingRight: 0
|
|
131
172
|
}
|
|
132
173
|
})
|
|
133
174
|
}));
|
|
@@ -150,7 +191,8 @@ const ClearIndicator = _ref => {
|
|
|
150
191
|
className: "dtable-font dtable-icon-fork-number",
|
|
151
192
|
style: {
|
|
152
193
|
fontSize: '12px',
|
|
153
|
-
marginRight: '-2px'
|
|
194
|
+
marginRight: '-2px',
|
|
195
|
+
color: 'var(--bs-icon-color)'
|
|
154
196
|
}
|
|
155
197
|
})
|
|
156
198
|
}));
|
|
@@ -165,9 +207,56 @@ const MenuList = props => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
|
165
207
|
});
|
|
166
208
|
exports.MenuList = MenuList;
|
|
167
209
|
const Option = props => {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
210
|
+
const {
|
|
211
|
+
isSelected,
|
|
212
|
+
label
|
|
213
|
+
} = props;
|
|
214
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
215
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
216
|
+
style: {
|
|
217
|
+
display: 'flex',
|
|
218
|
+
alignItems: 'center',
|
|
219
|
+
justifyContent: 'space-between',
|
|
220
|
+
width: '100%',
|
|
221
|
+
whiteSpace: 'pre-line'
|
|
222
|
+
},
|
|
223
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
224
|
+
children: label
|
|
225
|
+
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
226
|
+
className: "dtable-font dtable-icon-check",
|
|
227
|
+
style: {
|
|
228
|
+
fontSize: '14px',
|
|
229
|
+
color: 'var(--bs-icon-color)',
|
|
230
|
+
paddingLeft: '16px'
|
|
231
|
+
}
|
|
232
|
+
})]
|
|
233
|
+
})
|
|
234
|
+
}));
|
|
235
|
+
};
|
|
236
|
+
exports.Option = Option;
|
|
237
|
+
const processOptionsWithClear = (options, isClearable) => {
|
|
238
|
+
if (isClearable && options && options.length > 0) {
|
|
239
|
+
return [{
|
|
240
|
+
label: '--',
|
|
241
|
+
value: '__clear__'
|
|
242
|
+
}, ...options];
|
|
243
|
+
}
|
|
244
|
+
return options;
|
|
245
|
+
};
|
|
246
|
+
exports.processOptionsWithClear = processOptionsWithClear;
|
|
247
|
+
const handleSelectChange = (selectedOption, actionMeta, onChangeCallback) => {
|
|
248
|
+
if (selectedOption && selectedOption.value === '__clear__') {
|
|
249
|
+
onChangeCallback(null, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, actionMeta), {}, {
|
|
250
|
+
action: 'clear'
|
|
251
|
+
}));
|
|
252
|
+
} else {
|
|
253
|
+
onChangeCallback(selectedOption, actionMeta);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
exports.handleSelectChange = handleSelectChange;
|
|
257
|
+
const createHandleChange = onChange => {
|
|
258
|
+
return (selectedOption, actionMeta) => {
|
|
259
|
+
handleSelectChange(selectedOption, actionMeta, onChange);
|
|
260
|
+
};
|
|
172
261
|
};
|
|
173
|
-
exports.
|
|
262
|
+
exports.createHandleChange = createHandleChange;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
min-height: 60px;
|
|
7
7
|
min-width: 100%;
|
|
8
8
|
max-width: 15rem;
|
|
9
|
-
padding: 0
|
|
9
|
+
padding-top: 0;
|
|
10
10
|
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
11
11
|
background: #fff;
|
|
12
12
|
border: 1px solid rgba(0, 40, 100, 0.12);
|
|
@@ -17,17 +17,23 @@
|
|
|
17
17
|
.option-group .option-group-search {
|
|
18
18
|
width: 100%;
|
|
19
19
|
min-width: 170px;
|
|
20
|
-
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.option-group .option-group-content .label-space {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
align-items: center;
|
|
26
|
+
width: 100%;
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
.option-group-search .form-control {
|
|
24
|
-
height:
|
|
30
|
+
height: 32px;
|
|
31
|
+
border-radius: 4px;
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
.option-group .none-search-result {
|
|
28
35
|
height: 100px;
|
|
29
36
|
width: 100%;
|
|
30
|
-
padding: 10px;
|
|
31
37
|
color: #666666;
|
|
32
38
|
}
|
|
33
39
|
|
|
@@ -35,13 +41,18 @@
|
|
|
35
41
|
flex: 1;
|
|
36
42
|
max-height: 252px;
|
|
37
43
|
overflow-y: auto;
|
|
44
|
+
padding: 8px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.option-group .option-group-top {
|
|
48
|
+
padding-top: 8px !important;
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
.option {
|
|
41
52
|
display: block;
|
|
42
53
|
width: 100%;
|
|
43
54
|
line-height: 24px;
|
|
44
|
-
padding: 0.25rem
|
|
55
|
+
padding: 0.25rem 8px;
|
|
45
56
|
clear: both;
|
|
46
57
|
font-weight: 400;
|
|
47
58
|
text-align: inherit;
|
|
@@ -50,34 +61,38 @@
|
|
|
50
61
|
overflow: hidden;
|
|
51
62
|
text-overflow: ellipsis;
|
|
52
63
|
white-space: nowrap;
|
|
64
|
+
border-radius: 4px;
|
|
53
65
|
}
|
|
54
66
|
|
|
55
|
-
.option.option-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
.option-group .option-group-search .form-control {
|
|
68
|
+
border: none;
|
|
69
|
+
border-radius: 4px 4px 0 0;
|
|
70
|
+
padding: .375rem 0 .375rem 1rem;
|
|
71
|
+
height: 100%;
|
|
59
72
|
}
|
|
60
73
|
|
|
61
|
-
.option
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
color: #fff;
|
|
74
|
+
.option-group .option-group-search .form-control:focus {
|
|
75
|
+
border-color: transparent !important;
|
|
76
|
+
box-shadow: none !important;
|
|
65
77
|
}
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
.option
|
|
69
|
-
|
|
79
|
+
|
|
80
|
+
.option-group-content .label-check-icon {
|
|
81
|
+
margin-left: 16px;
|
|
70
82
|
}
|
|
71
83
|
|
|
72
|
-
.option
|
|
73
|
-
|
|
74
|
-
color:
|
|
84
|
+
.option-group-content .dtable-icon-check {
|
|
85
|
+
font-size: 14px !important;
|
|
86
|
+
color: var(--bs-icon-color);
|
|
75
87
|
}
|
|
76
88
|
|
|
77
|
-
.option
|
|
78
|
-
|
|
89
|
+
.option.option-active {
|
|
90
|
+
background-color: #f5f5f5;
|
|
91
|
+
color: #212529;
|
|
92
|
+
cursor: pointer;
|
|
79
93
|
}
|
|
80
94
|
|
|
95
|
+
|
|
81
96
|
.option .select-option-name .multiple-select-option {
|
|
82
97
|
margin: 0;
|
|
83
98
|
}
|
|
@@ -97,7 +112,7 @@
|
|
|
97
112
|
|
|
98
113
|
.option-group-dtable-ui-multiple-select-selector .multiple-check-icon .dtable-icon-check-mark {
|
|
99
114
|
font-size: 12px;
|
|
100
|
-
color:
|
|
115
|
+
color: var(--bs-icon-color);
|
|
101
116
|
}
|
|
102
117
|
|
|
103
118
|
.option-group-dtable-ui-single-select-selector .option:hover,
|
|
@@ -111,3 +126,16 @@
|
|
|
111
126
|
.option-group-selector-multiple-select .option.option-active .select-option-name {
|
|
112
127
|
color: #212529;
|
|
113
128
|
}
|
|
129
|
+
|
|
130
|
+
.option-group-selector-single-select .option .select-option-name .single-select-option {
|
|
131
|
+
margin: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.option-group-selector-single-select .form-control {
|
|
135
|
+
padding: .375rem .5rem !important;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.pre-fill-dialog .single-select-option,
|
|
139
|
+
.pre-fill-dialog .multiple-select-option {
|
|
140
|
+
padding: 0 !important;
|
|
141
|
+
}
|
|
@@ -132,10 +132,17 @@ class SelectOptionGroup extends _react.Component {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
|
+
this.isEqual = (obj1, obj2) => {
|
|
136
|
+
if (obj1 === obj2) return true;
|
|
137
|
+
if (!obj1 || !obj2) return false;
|
|
138
|
+
return JSON.stringify(obj1) === JSON.stringify(obj2);
|
|
139
|
+
};
|
|
135
140
|
this.renderOptGroup = searchVal => {
|
|
136
141
|
let {
|
|
137
142
|
noOptionsPlaceholder,
|
|
138
|
-
onSelectOption
|
|
143
|
+
onSelectOption,
|
|
144
|
+
value,
|
|
145
|
+
supportMultipleSelect
|
|
139
146
|
} = this.props;
|
|
140
147
|
this.filterOptions = this.props.getFilterOptions(searchVal);
|
|
141
148
|
if (this.filterOptions.length === 0) {
|
|
@@ -147,6 +154,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
147
154
|
return this.filterOptions.map((opt, i) => {
|
|
148
155
|
let key = opt.value.column ? opt.value.column.key : i;
|
|
149
156
|
let isActive = this.state.activeIndex === i;
|
|
157
|
+
let isSelected = value && typeof value === 'object' && !supportMultipleSelect ? this.isEqual(value.value, opt.value) : Array.isArray(value.value) ? value.value.includes(opt.value.column_key) : false;
|
|
150
158
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
|
|
151
159
|
index: i,
|
|
152
160
|
isActive: isActive,
|
|
@@ -155,10 +163,26 @@ class SelectOptionGroup extends _react.Component {
|
|
|
155
163
|
changeIndex: this.changeIndex,
|
|
156
164
|
supportMultipleSelect: this.props.supportMultipleSelect,
|
|
157
165
|
disableHover: this.state.disableHover,
|
|
158
|
-
children:
|
|
166
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
167
|
+
className: "label-space",
|
|
168
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
169
|
+
children: [" ", opt.label]
|
|
170
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
171
|
+
className: "label-check-icon",
|
|
172
|
+
children: [" ", isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
173
|
+
className: "dtable-font dtable-icon-check"
|
|
174
|
+
})]
|
|
175
|
+
})]
|
|
176
|
+
})
|
|
159
177
|
}, "".concat(key, "-").concat(i));
|
|
160
178
|
});
|
|
161
179
|
};
|
|
180
|
+
this.clearValue = () => {
|
|
181
|
+
this.setState({
|
|
182
|
+
searchVal: '',
|
|
183
|
+
activeIndex: -1
|
|
184
|
+
});
|
|
185
|
+
};
|
|
162
186
|
this.state = {
|
|
163
187
|
searchVal: '',
|
|
164
188
|
activeIndex: -1,
|
|
@@ -192,7 +216,8 @@ class SelectOptionGroup extends _react.Component {
|
|
|
192
216
|
position,
|
|
193
217
|
className,
|
|
194
218
|
addOptionAble,
|
|
195
|
-
component
|
|
219
|
+
component,
|
|
220
|
+
supportMultipleSelect
|
|
196
221
|
} = this.props;
|
|
197
222
|
const {
|
|
198
223
|
AddOption
|
|
@@ -232,20 +257,34 @@ class SelectOptionGroup extends _react.Component {
|
|
|
232
257
|
style: style,
|
|
233
258
|
onMouseDown: this.onMouseDown,
|
|
234
259
|
children: [isShowSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
235
|
-
className: "editor-list-delete
|
|
260
|
+
className: "editor-list-delete",
|
|
236
261
|
onClick: e => e.stopPropagation(),
|
|
237
262
|
children: value.label || ''
|
|
238
|
-
}), searchable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
263
|
+
}), searchable && this.props.options && this.props.options.length > 10 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
239
264
|
className: "option-group-search",
|
|
240
265
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
|
|
241
266
|
className: "option-search-control",
|
|
242
267
|
placeholder: searchPlaceholder,
|
|
243
268
|
onChange: this.onChangeSearch,
|
|
244
269
|
autoFocus: true,
|
|
245
|
-
ref: this.searchInputRef
|
|
270
|
+
ref: this.searchInputRef,
|
|
271
|
+
clearValue: this.clearValue,
|
|
272
|
+
isClearable: true,
|
|
273
|
+
components: {
|
|
274
|
+
ClearIndicator: props => {
|
|
275
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
276
|
+
className: (0, _classnames.default)('select-search-text-clear input-icon-addon seatable-icon dtable-font dtable-icon-x'),
|
|
277
|
+
onClick: e => {
|
|
278
|
+
e.stopPropagation();
|
|
279
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
280
|
+
props.clearValue();
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
246
285
|
})
|
|
247
286
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
248
|
-
className: "option-group-content",
|
|
287
|
+
className: "option-group-content ".concat(!searchable && !supportMultipleSelect ? 'option-group-top' : ''),
|
|
249
288
|
ref: ref => this.optionGroupContentRef = ref,
|
|
250
289
|
children: this.renderOptGroup(searchVal)
|
|
251
290
|
}), addOptionAble && AddOption]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1718937171668" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18368" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M489.6 444.8l294.4-294.4 67.2 67.2-294.4 294.4 294.4 294.4-67.2 67.2-294.4-294.4-272 272-67.2-67.2 272-272-272-272 67.2-67.2z" p-id="18369" fill="currentColor"></path></svg>
|
package/lib/index.js
CHANGED
|
@@ -124,6 +124,12 @@ Object.defineProperty(exports, "DTableCustomizeCollaboratorSelect", {
|
|
|
124
124
|
return _DTableCustomizeCollaboratorSelect.default;
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
|
+
Object.defineProperty(exports, "DTableCustomizeSearchInput", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function () {
|
|
130
|
+
return _DTableCustomizeSearchInput.default;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
127
133
|
Object.defineProperty(exports, "DTableCustomizeSelect", {
|
|
128
134
|
enumerable: true,
|
|
129
135
|
get: function () {
|
|
@@ -724,6 +730,7 @@ var _DTableSwitch = _interopRequireDefault(require("./DTableSwitch"));
|
|
|
724
730
|
var _DTableCustomizeSelect = _interopRequireDefault(require("./DTableCustomizeSelect"));
|
|
725
731
|
var _DTableCustomizeCollaboratorSelect = _interopRequireDefault(require("./DTableCustomizeCollaboratorSelect"));
|
|
726
732
|
var _DTableSearchInput = _interopRequireDefault(require("./DTableSearchInput"));
|
|
733
|
+
var _DTableCustomizeSearchInput = _interopRequireDefault(require("./DTableCustomizeSearchInput"));
|
|
727
734
|
var _DTableColorPicker = _interopRequireDefault(require("./DTableColorPicker"));
|
|
728
735
|
var _ModalPortal = _interopRequireDefault(require("./ModalPortal"));
|
|
729
736
|
var _RoleStatusEditor = _interopRequireDefault(require("./RoleStatusEditor"));
|