dtable-ui-component 7.0.0 → 7.0.1-beta.2
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 +36 -18
- package/lib/AsyncUserSelect/index.js +29 -18
- package/lib/DTableCustomizeSearchInput/index.css +81 -0
- package/lib/DTableCustomizeSearchInput/index.js +136 -0
- package/lib/DTableCustomizeSelect/index.css +120 -42
- package/lib/DTableCustomizeSelect/index.js +9 -4
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +7 -19
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +5 -9
- package/lib/DTableFiltersPopover/widgets/filter-item.js +15 -7
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +3 -3
- 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 +24 -0
- package/lib/DTableSelect/user-select.css +7 -46
- package/lib/DTableSelect/utils.js +165 -79
- package/lib/SelectOptionGroup/KeyCodes.js +96 -4
- package/lib/SelectOptionGroup/index.css +74 -52
- package/lib/SelectOptionGroup/index.js +35 -26
- package/lib/SelectOptionGroup/option.js +16 -4
- package/lib/assets/icons/close.svg +1 -0
- package/lib/assets/icons/down.svg +3 -0
- package/lib/index.js +3 -10
- package/package.json +1 -1
- package/lib/DTableCustomizeCollaboratorSelect/index.css +0 -86
- package/lib/DTableCustomizeCollaboratorSelect/index.js +0 -158
- package/lib/DTableGroupSelect/index.css +0 -96
- package/lib/DTableGroupSelect/index.js +0 -131
- package/lib/DTableGroupSelect/option.js +0 -42
- package/lib/DTableGroupSelect/select-option-group.css +0 -54
- package/lib/DTableGroupSelect/select-option-group.js +0 -227
|
@@ -91,9 +91,9 @@ class FilterItemUtils {
|
|
|
91
91
|
value: {
|
|
92
92
|
columnOption: option
|
|
93
93
|
},
|
|
94
|
-
label: /*#__PURE__*/(0, _jsxRuntime.
|
|
94
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
95
95
|
className: "select-option-name single-select-option-name",
|
|
96
|
-
children:
|
|
96
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
97
97
|
className: "single-select-option",
|
|
98
98
|
style: {
|
|
99
99
|
background: option.color,
|
|
@@ -102,23 +102,16 @@ class FilterItemUtils {
|
|
|
102
102
|
title: option.name,
|
|
103
103
|
"aria-label": option.name,
|
|
104
104
|
children: option.name
|
|
105
|
-
})
|
|
106
|
-
className: "single-select-check-icon",
|
|
107
|
-
children: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.id) === option.id && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
108
|
-
className: "option-edit dtable-font dtable-icon-check-mark"
|
|
109
|
-
})
|
|
110
|
-
})]
|
|
105
|
+
})
|
|
111
106
|
})
|
|
112
107
|
};
|
|
113
108
|
}
|
|
114
109
|
static generatorMultipleSelectOption(option, filterTerm) {
|
|
115
110
|
return {
|
|
116
|
-
value:
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
111
|
+
value: option,
|
|
112
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
120
113
|
className: "select-option-name multiple-option-name",
|
|
121
|
-
children:
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
122
115
|
className: "multiple-select-option",
|
|
123
116
|
style: {
|
|
124
117
|
background: option.color,
|
|
@@ -127,12 +120,7 @@ class FilterItemUtils {
|
|
|
127
120
|
title: option.name,
|
|
128
121
|
"aria-label": option.name,
|
|
129
122
|
children: option.name
|
|
130
|
-
})
|
|
131
|
-
className: "multiple-check-icon",
|
|
132
|
-
children: filterTerm.indexOf(option.id) > -1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
133
|
-
className: "option-edit dtable-font dtable-icon-check-mark"
|
|
134
|
-
})
|
|
135
|
-
})]
|
|
123
|
+
})
|
|
136
124
|
})
|
|
137
125
|
};
|
|
138
126
|
}
|
|
@@ -16,16 +16,15 @@ class CollaboratorFilter extends _react.Component {
|
|
|
16
16
|
super(props);
|
|
17
17
|
this.createCollaboratorOptions = (filterIndex, collaborators, filterTerm) => {
|
|
18
18
|
return collaborators.map(collaborator => {
|
|
19
|
-
let isSelected = filterTerm.findIndex(item => item === collaborator.email) > -1;
|
|
20
19
|
return {
|
|
21
20
|
value: {
|
|
22
21
|
filterIndex,
|
|
23
22
|
columnOption: collaborator
|
|
24
23
|
},
|
|
25
24
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
26
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
25
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
27
26
|
className: "select-option-name option-collaborator",
|
|
28
|
-
children:
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
29
28
|
className: "collaborator-container",
|
|
30
29
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
31
30
|
className: "collaborator",
|
|
@@ -46,12 +45,7 @@ class CollaboratorFilter extends _react.Component {
|
|
|
46
45
|
children: collaborator.name
|
|
47
46
|
})]
|
|
48
47
|
})
|
|
49
|
-
})
|
|
50
|
-
className: "collaborator-check-icon",
|
|
51
|
-
children: isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
52
|
-
className: "option-edit dtable-font dtable-icon-check-mark"
|
|
53
|
-
})
|
|
54
|
-
})]
|
|
48
|
+
})
|
|
55
49
|
})
|
|
56
50
|
})
|
|
57
51
|
};
|
|
@@ -106,7 +100,9 @@ class CollaboratorFilter extends _react.Component {
|
|
|
106
100
|
})]
|
|
107
101
|
}, item);
|
|
108
102
|
});
|
|
103
|
+
let selectCollaborators = Array.isArray(filterTerm) && filterTerm.length > 0 ? collaborators.filter(col => filterTerm.includes(col.email)) : [];
|
|
109
104
|
let value = selectedCollaborators ? {
|
|
105
|
+
value: selectCollaborators,
|
|
110
106
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
111
107
|
children: selectedCollaborators
|
|
112
108
|
})
|
|
@@ -128,8 +128,7 @@ class FilterItem extends _react.default.Component {
|
|
|
128
128
|
const _this$props5 = this.props,
|
|
129
129
|
index = _this$props5.index,
|
|
130
130
|
filter = _this$props5.filter;
|
|
131
|
-
|
|
132
|
-
let newFilter = (0, _utils.getUpdatedFilterBySelectMultiple)(filter, option);
|
|
131
|
+
let newFilter = (0, _utils.getUpdatedFilterBySelectMultiple)(filter, value);
|
|
133
132
|
this.resetState(newFilter);
|
|
134
133
|
this.props.updateFilter(index, newFilter);
|
|
135
134
|
};
|
|
@@ -137,8 +136,7 @@ class FilterItem extends _react.default.Component {
|
|
|
137
136
|
const _this$props6 = this.props,
|
|
138
137
|
index = _this$props6.index,
|
|
139
138
|
filter = _this$props6.filter;
|
|
140
|
-
|
|
141
|
-
let newFilter = (0, _utils.getUpdatedFilterByCollaborator)(filter, collaborator);
|
|
139
|
+
let newFilter = (0, _utils.getUpdatedFilterByCollaborator)(filter, value);
|
|
142
140
|
this.resetState(newFilter);
|
|
143
141
|
this.props.updateFilter(index, newFilter);
|
|
144
142
|
};
|
|
@@ -146,7 +144,10 @@ class FilterItem extends _react.default.Component {
|
|
|
146
144
|
const _this$props7 = this.props,
|
|
147
145
|
index = _this$props7.index,
|
|
148
146
|
filter = _this$props7.filter;
|
|
149
|
-
const collaborator = value.columnOption;
|
|
147
|
+
const collaborator = value && (value.columnOption || value.value || value);
|
|
148
|
+
if (!collaborator || !collaborator.email) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
150
151
|
let newFilter = (0, _utils.getUpdatedFilterByCreator)(filter, collaborator);
|
|
151
152
|
// the predicate is 'is' or 'is not'
|
|
152
153
|
if (!newFilter) {
|
|
@@ -294,11 +295,12 @@ class FilterItem extends _react.default.Component {
|
|
|
294
295
|
}
|
|
295
296
|
const className = 'select-option-name multiple-select-option';
|
|
296
297
|
let labelArray = [];
|
|
298
|
+
let valueArray = [];
|
|
297
299
|
if (Array.isArray(options) && Array.isArray(filterTerm)) {
|
|
298
300
|
filterTerm.forEach(item => {
|
|
299
301
|
let inOption = options.find(option => option.id === item);
|
|
300
302
|
let optionStyle = {
|
|
301
|
-
margin: '0
|
|
303
|
+
margin: '0 4px 0 0'
|
|
302
304
|
};
|
|
303
305
|
let optionName = null;
|
|
304
306
|
if (inOption) {
|
|
@@ -309,6 +311,7 @@ class FilterItem extends _react.default.Component {
|
|
|
309
311
|
optionStyle.background = _constants.DELETED_OPTION_BACKGROUND_COLOR;
|
|
310
312
|
optionName = (0, _lang.getLocale)(_constants.DELETED_OPTION_TIPS);
|
|
311
313
|
}
|
|
314
|
+
valueArray.push(inOption);
|
|
312
315
|
labelArray.push(/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
313
316
|
className: className,
|
|
314
317
|
style: optionStyle,
|
|
@@ -319,6 +322,7 @@ class FilterItem extends _react.default.Component {
|
|
|
319
322
|
});
|
|
320
323
|
}
|
|
321
324
|
const selectedOptionNames = labelArray.length > 0 ? {
|
|
325
|
+
value: valueArray,
|
|
322
326
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
323
327
|
children: labelArray
|
|
324
328
|
})
|
|
@@ -425,6 +429,9 @@ class FilterItem extends _react.default.Component {
|
|
|
425
429
|
color: selectedOption.textColor || null
|
|
426
430
|
};
|
|
427
431
|
selectedOptionName = {
|
|
432
|
+
value: {
|
|
433
|
+
columnOption: selectedOption
|
|
434
|
+
},
|
|
428
435
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
429
436
|
className: className,
|
|
430
437
|
style: style,
|
|
@@ -507,7 +514,8 @@ class FilterItem extends _react.default.Component {
|
|
|
507
514
|
collaborators: creators,
|
|
508
515
|
onSelectCollaborator: this.onSelectCreator,
|
|
509
516
|
isInModal: this.props.isInModal,
|
|
510
|
-
readOnly: readOnly
|
|
517
|
+
readOnly: readOnly,
|
|
518
|
+
filter_predicate: filter_predicate
|
|
511
519
|
});
|
|
512
520
|
}
|
|
513
521
|
case _dtableUtils.CellType.RATE:
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
display: inline-flex;
|
|
334
334
|
align-items: center;
|
|
335
335
|
height: 20px;
|
|
336
|
-
margin-right:
|
|
336
|
+
margin-right: 4px;
|
|
337
337
|
padding: 0 8px 0 2px;
|
|
338
338
|
font-size: 13px;
|
|
339
339
|
border-radius: 10px;
|
|
@@ -412,14 +412,14 @@
|
|
|
412
412
|
|
|
413
413
|
.filter-header-icon {
|
|
414
414
|
display: inline-block;
|
|
415
|
-
padding: 0
|
|
415
|
+
padding-right: 0.5rem;
|
|
416
416
|
margin-left: -0.3125rem;
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
.filter-header-icon .dtable-font,
|
|
420
420
|
.filter-header-icon .multicolor-icon {
|
|
421
421
|
font-size: 14px;
|
|
422
|
-
color:
|
|
422
|
+
color: var(--bs-icon-secondary-color);
|
|
423
423
|
cursor: default;
|
|
424
424
|
}
|
|
425
425
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
.dtable-select-check-icon {
|
|
2
|
-
width:
|
|
3
|
-
height:
|
|
2
|
+
width: 14px;
|
|
3
|
+
height: 14px;
|
|
4
4
|
text-align: center;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.dtable-select-check-icon .dtable-font {
|
|
8
|
-
font-size:
|
|
9
|
-
color:
|
|
8
|
+
font-size: 14px;
|
|
9
|
+
color: var(--bs-icon-color);
|
|
10
10
|
}
|
|
@@ -22,7 +22,7 @@ function DTableSelectLabel(_ref) {
|
|
|
22
22
|
}), isSelect && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
23
23
|
className: "dtable-select-check-icon",
|
|
24
24
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
25
|
-
className: "dtable-font dtable-icon-check
|
|
25
|
+
className: "dtable-font dtable-icon-check"
|
|
26
26
|
})
|
|
27
27
|
})]
|
|
28
28
|
});
|
|
@@ -39,10 +39,11 @@ class DTableSelect extends _react.default.Component {
|
|
|
39
39
|
MenuList: _utils.MenuList,
|
|
40
40
|
ClearIndicator: _utils.ClearIndicator
|
|
41
41
|
}, userComponents);
|
|
42
|
+
const processedOptions = (0, _utils.processOptionsWithClear)(options, isClearable);
|
|
42
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.default, {
|
|
43
44
|
value: value,
|
|
44
|
-
onChange: onChange,
|
|
45
|
-
options:
|
|
45
|
+
onChange: (0, _utils.createHandleChange)(onChange),
|
|
46
|
+
options: processedOptions,
|
|
46
47
|
isMulti: isMulti,
|
|
47
48
|
className: className,
|
|
48
49
|
classNamePrefix: classNamePrefix,
|
|
@@ -50,7 +51,6 @@ class DTableSelect extends _react.default.Component {
|
|
|
50
51
|
components: mergedComponents,
|
|
51
52
|
placeholder: placeholder,
|
|
52
53
|
isSearchable: isSearchable,
|
|
53
|
-
isClearable: isClearable,
|
|
54
54
|
menuPosition: menuPosition || 'fixed' // when use default menuPosition(absolute), menuPortalTarget is unnecessary.
|
|
55
55
|
,
|
|
56
56
|
menuShouldScrollIntoView: true,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.select-dropdown-indicator {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 50%;
|
|
4
|
+
right: 18px;
|
|
5
|
+
transform: translateY(-50%);
|
|
6
|
+
margin-left: -2px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.select-dropdown-indicator svg {
|
|
10
|
+
width: 12px;
|
|
11
|
+
height: 12px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dis-multicolor-icon-down {
|
|
15
|
+
opacity: 0.65 !important;
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _DTableIcon = _interopRequireDefault(require("../../DTableIcon"));
|
|
10
|
+
require("./index.css");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
const SelectDropdownIndicator = _ref => {
|
|
13
|
+
let isDisabled = _ref.isDisabled;
|
|
14
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
15
|
+
className: "select-dropdown-indicator d-flex align-items-center",
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
|
|
18
|
+
symbol: "down",
|
|
19
|
+
color: "var(--bs-icon-color)",
|
|
20
|
+
className: isDisabled ? 'dis-multicolor-icon-down' : ''
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var _default = exports.default = SelectDropdownIndicator;
|
|
@@ -1,51 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/* hide checkbox in select value container */
|
|
2
|
+
.seatable-select-value-container .seatable-multicolor-icon-check {
|
|
3
|
+
display: none;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
width: 24px;
|
|
9
|
-
border-radius: 50%;
|
|
6
|
+
.seatable-select-value-container .select-option-label {
|
|
7
|
+
font-size: 14px !important;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
|
-
.
|
|
13
|
-
color:
|
|
14
|
-
font-size: 14px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.user-select .true__value-container .select-module-container {
|
|
18
|
-
display: block;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.user-select .true__value-container .select-module.select-module-avatar {
|
|
22
|
-
height: 16px;
|
|
23
|
-
width: 16px;
|
|
24
|
-
border-radius: 50%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.user-select .true__value-container .true__multi-value__label {
|
|
28
|
-
padding: 0px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.user-select .true__value-container .true__multi-value__label .select-module.select-module-avatar {
|
|
32
|
-
transform: translateY(-2px);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.user-select .true__value-container .select-module.select-module-name {
|
|
36
|
-
font-size: 13px;
|
|
37
|
-
overflow: hidden;
|
|
38
|
-
text-overflow: ellipsis;
|
|
39
|
-
white-space: nowrap;
|
|
40
|
-
flex: 1 1;
|
|
41
|
-
line-height: 20px;
|
|
42
|
-
margin-left: 5px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.user-select .true__control.true__control--is-focused,
|
|
46
|
-
.user-select .true__control.true__control--is-focused:hover {
|
|
47
|
-
background-color: #ffffff;
|
|
48
|
-
border-color: #1991eb;
|
|
49
|
-
outline: 0;
|
|
50
|
-
box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25);
|
|
10
|
+
.seatable-check-color {
|
|
11
|
+
color: var(--bs-icon-secondary-color);
|
|
51
12
|
}
|
|
@@ -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,108 +12,146 @@ 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 0 8px',
|
|
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 0 8px',
|
|
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 0 8px',
|
|
37
|
+
border: '1px solid var(--bs-bg-border-color)',
|
|
38
|
+
boxShadow: 'none',
|
|
39
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
40
|
+
borderRadius: '4px',
|
|
41
|
+
outline: '0'
|
|
42
|
+
};
|
|
43
|
+
const HEADER_ICON_STYLE = {
|
|
44
|
+
padding: '0 0.5rem !important'
|
|
23
45
|
};
|
|
24
|
-
const noneCallback = () => ({
|
|
25
|
-
display: 'none'
|
|
26
|
-
});
|
|
27
46
|
const controlCallback = (provided, state) => {
|
|
28
47
|
const isDisabled = state.isDisabled,
|
|
29
48
|
isFocused = state.isFocused;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
49
|
+
const headerIconStyle = {
|
|
50
|
+
'.header-icon': HEADER_ICON_STYLE,
|
|
51
|
+
'.header-icon .dtable-font': {
|
|
52
|
+
color: 'var(--bs-icon-secondary-color) !important'
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
if (isDisabled) {
|
|
56
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), DISABLED_CONTROL_STYLE), {}, {
|
|
57
|
+
':active': {
|
|
58
|
+
border: '1px solid var(--bs-bg-border-color)'
|
|
59
|
+
}
|
|
60
|
+
}, headerIconStyle);
|
|
61
|
+
}
|
|
62
|
+
if (isFocused) {
|
|
63
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE), headerIconStyle);
|
|
34
64
|
}
|
|
35
65
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
36
66
|
fontSize: '14px',
|
|
37
67
|
lineHeight: '1.5',
|
|
38
68
|
cursor: 'pointer'
|
|
39
|
-
}, DEFAULT_CONTROL_STYLE),
|
|
40
|
-
'&:hover': (0, _objectSpread2.default)({}, DEFAULT_CONTROL_STYLE)
|
|
41
|
-
});
|
|
69
|
+
}, DEFAULT_CONTROL_STYLE), headerIconStyle);
|
|
42
70
|
};
|
|
43
|
-
const
|
|
71
|
+
const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
72
|
+
menu: base => {
|
|
73
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
74
|
+
padding: '8px',
|
|
75
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
76
|
+
border: '1px solid var(--bs-border-secondary-color)',
|
|
77
|
+
borderRadius: '4px',
|
|
78
|
+
boxShadow: 'var(--bs-border-secondary-shadow)',
|
|
79
|
+
marginTop: '4px',
|
|
80
|
+
marginBottom: 0
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
menuList: provided => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
84
|
+
padding: 0
|
|
85
|
+
}),
|
|
44
86
|
option: (provided, state) => {
|
|
45
|
-
const isDisabled = state.isDisabled
|
|
46
|
-
isFocused = state.isFocused;
|
|
87
|
+
const isDisabled = state.isDisabled;
|
|
47
88
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
89
|
+
color: 'var(--bs-body-color)',
|
|
90
|
+
borderRadius: '4px',
|
|
91
|
+
minHeight: '32px',
|
|
92
|
+
padding: '8px',
|
|
48
93
|
cursor: isDisabled ? 'default' : 'pointer',
|
|
49
|
-
backgroundColor:
|
|
94
|
+
backgroundColor: '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': HEADER_ICON_STYLE
|
|
50
102
|
});
|
|
51
103
|
},
|
|
52
104
|
control: controlCallback,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
105
|
+
menuPortal: base => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
106
|
+
zIndex: 9999,
|
|
107
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
108
|
+
color: 'var(--bs-body-color)',
|
|
109
|
+
borderColor: 'var(--bs-border-secondary-color)'
|
|
110
|
+
}),
|
|
111
|
+
singleValue: provided => {
|
|
57
112
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
58
|
-
|
|
59
|
-
alignItems: 'center',
|
|
60
|
-
background: '#eaeaea',
|
|
61
|
-
borderRadius: '10px',
|
|
62
|
-
margin: '0 10px 0 0',
|
|
63
|
-
padding: '0 0 0 2px'
|
|
113
|
+
color: 'var(--bs-body-color)'
|
|
64
114
|
});
|
|
65
115
|
},
|
|
66
|
-
|
|
116
|
+
multiValue: provided => {
|
|
67
117
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
68
|
-
|
|
118
|
+
color: 'var(--bs-body-color)'
|
|
69
119
|
});
|
|
70
120
|
},
|
|
71
|
-
multiValueRemove:
|
|
121
|
+
multiValueRemove: styles => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
|
122
|
+
'.dtable-font': {
|
|
123
|
+
color: 'var(--bs-icon-color)'
|
|
124
|
+
},
|
|
125
|
+
'.dtable-font:hover': {
|
|
126
|
+
backgroundColor: 'transparent',
|
|
127
|
+
color: 'var(--bs-icon-color)'
|
|
128
|
+
}
|
|
129
|
+
}),
|
|
130
|
+
input: styles => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
|
131
|
+
color: 'var(--bs-body-color)'
|
|
132
|
+
}),
|
|
133
|
+
placeholder: (provided, state) => {
|
|
134
|
+
const isDisabled = state.isDisabled;
|
|
72
135
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
73
|
-
color: '
|
|
74
|
-
|
|
75
|
-
backgroundColor: 'transparent',
|
|
76
|
-
color: '#555555'
|
|
77
|
-
}
|
|
136
|
+
color: 'var(--bs-bg-placeholder-color)',
|
|
137
|
+
opacity: isDisabled ? 0.65 : 1
|
|
78
138
|
});
|
|
79
139
|
},
|
|
80
|
-
|
|
81
|
-
return
|
|
82
|
-
display: '
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
padding: '0 2px',
|
|
88
|
-
width: 'fit-content'
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
93
|
-
option: (provided, state) => {
|
|
94
|
-
const isDisabled = state.isDisabled,
|
|
95
|
-
isFocused = state.isFocused;
|
|
140
|
+
indicatorSeparator: (styles, state) => {
|
|
141
|
+
return {
|
|
142
|
+
'display': 'none'
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
dropdownIndicator: (provided, state) => {
|
|
146
|
+
const isDisabled = state.isDisabled;
|
|
96
147
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
':active': {
|
|
102
|
-
backgroundColor: '#f5f5f5'
|
|
103
|
-
},
|
|
104
|
-
'.header-icon .dtable-font': {
|
|
105
|
-
color: '#aaa'
|
|
106
|
-
},
|
|
107
|
-
'.header-icon .multicolor-icon': {
|
|
108
|
-
color: '#aaa'
|
|
148
|
+
paddingRight: '12px',
|
|
149
|
+
'.dtable-font': {
|
|
150
|
+
color: 'var(--bs-icon-color) !important',
|
|
151
|
+
opacity: isDisabled ? 0.65 : 1
|
|
109
152
|
}
|
|
110
153
|
});
|
|
111
|
-
}
|
|
112
|
-
control: controlCallback,
|
|
113
|
-
menuPortal: base => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
114
|
-
zIndex: 9999
|
|
115
|
-
}),
|
|
116
|
-
indicatorSeparator: noneCallback
|
|
154
|
+
}
|
|
117
155
|
};
|
|
118
156
|
const DropdownIndicator = props => {
|
|
119
157
|
return _reactSelect.components.DropdownIndicator && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.DropdownIndicator, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
@@ -121,7 +159,9 @@ const DropdownIndicator = props => {
|
|
|
121
159
|
className: "dtable-font dtable-icon-down3",
|
|
122
160
|
style: {
|
|
123
161
|
fontSize: '12px',
|
|
124
|
-
marginLeft: '-2px'
|
|
162
|
+
marginLeft: '-2px',
|
|
163
|
+
color: 'var(--bs-icon-color)',
|
|
164
|
+
paddingRight: 0
|
|
125
165
|
}
|
|
126
166
|
})
|
|
127
167
|
}));
|
|
@@ -142,7 +182,8 @@ const ClearIndicator = _ref => {
|
|
|
142
182
|
className: "dtable-font dtable-icon-fork-number",
|
|
143
183
|
style: {
|
|
144
184
|
fontSize: '12px',
|
|
145
|
-
marginRight: '-2px'
|
|
185
|
+
marginRight: '-2px',
|
|
186
|
+
color: 'var(--bs-icon-color)'
|
|
146
187
|
}
|
|
147
188
|
})
|
|
148
189
|
}));
|
|
@@ -157,9 +198,54 @@ const MenuList = props => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
|
157
198
|
});
|
|
158
199
|
exports.MenuList = MenuList;
|
|
159
200
|
const Option = props => {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
201
|
+
const isSelected = props.isSelected,
|
|
202
|
+
label = props.label;
|
|
203
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
204
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
205
|
+
style: {
|
|
206
|
+
display: 'flex',
|
|
207
|
+
alignItems: 'center',
|
|
208
|
+
justifyContent: 'space-between',
|
|
209
|
+
width: '100%',
|
|
210
|
+
whiteSpace: 'pre-line'
|
|
211
|
+
},
|
|
212
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
213
|
+
children: label
|
|
214
|
+
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
215
|
+
className: "dtable-font dtable-icon-check",
|
|
216
|
+
style: {
|
|
217
|
+
fontSize: '14px',
|
|
218
|
+
color: 'var(--bs-icon-color)',
|
|
219
|
+
paddingLeft: '16px'
|
|
220
|
+
}
|
|
221
|
+
})]
|
|
222
|
+
})
|
|
223
|
+
}));
|
|
224
|
+
};
|
|
225
|
+
exports.Option = Option;
|
|
226
|
+
const processOptionsWithClear = (options, isClearable) => {
|
|
227
|
+
if (isClearable && options && options.length > 0) {
|
|
228
|
+
return [{
|
|
229
|
+
label: '--',
|
|
230
|
+
value: '__clear__'
|
|
231
|
+
}, ...options];
|
|
232
|
+
}
|
|
233
|
+
return options;
|
|
234
|
+
};
|
|
235
|
+
exports.processOptionsWithClear = processOptionsWithClear;
|
|
236
|
+
const handleSelectChange = (selectedOption, actionMeta, onChangeCallback) => {
|
|
237
|
+
if (selectedOption && selectedOption.value === '__clear__') {
|
|
238
|
+
onChangeCallback(null, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, actionMeta), {}, {
|
|
239
|
+
action: 'clear'
|
|
240
|
+
}));
|
|
241
|
+
} else {
|
|
242
|
+
onChangeCallback(selectedOption, actionMeta);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
exports.handleSelectChange = handleSelectChange;
|
|
246
|
+
const createHandleChange = onChange => {
|
|
247
|
+
return (selectedOption, actionMeta) => {
|
|
248
|
+
handleSelectChange(selectedOption, actionMeta, onChange);
|
|
249
|
+
};
|
|
164
250
|
};
|
|
165
|
-
exports.
|
|
251
|
+
exports.createHandleChange = createHandleChange;
|