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
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
line-height: 24px;
|
|
5
|
-
padding: 6px 10px;
|
|
6
5
|
clear: both;
|
|
7
6
|
font-weight: 400;
|
|
8
7
|
text-align: inherit;
|
|
@@ -14,28 +13,25 @@
|
|
|
14
13
|
display: flex;
|
|
15
14
|
align-items: center;
|
|
16
15
|
justify-content: space-between;
|
|
16
|
+
padding: 0.25rem 8px;
|
|
17
|
+
border-radius: 4px;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
.group-selector .option .dtable-icon-check
|
|
20
|
-
font-size:
|
|
21
|
-
color:
|
|
20
|
+
.group-selector .option .dtable-icon-check{
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
color: var(--bs-icon-color);
|
|
23
|
+
height: 14px !important;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
.group-selector .option.option-active {
|
|
25
|
-
background-color: #
|
|
26
|
-
color: #
|
|
30
|
+
background-color: #f5f5f5;
|
|
31
|
+
color: #212529;
|
|
27
32
|
cursor: pointer;
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
.group-selector .option.option-active .dtable-icon-check-mark,
|
|
31
|
-
.group-selector .option.option-active .select-option-name {
|
|
32
|
-
color: #fff !important;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.group-selector .option .select-option-name .single-select-option {
|
|
36
|
-
margin: 0 0 0 12px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
35
|
.group-selector .option .select-option-name .multiple-select-option {
|
|
40
36
|
margin: 0;
|
|
41
37
|
}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var
|
|
11
|
+
var _DTableCustomizeSearchInput = _interopRequireDefault(require("../DTableCustomizeSearchInput"));
|
|
12
12
|
var _option = _interopRequireDefault(require("./option"));
|
|
13
13
|
var _KeyCodes = _interopRequireDefault(require("../SelectOptionGroup/KeyCodes"));
|
|
14
14
|
require("./select-option-group.css");
|
|
@@ -152,7 +152,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
152
152
|
title: option.label,
|
|
153
153
|
children: option.label
|
|
154
154
|
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
155
|
-
className: "dtable-font dtable-icon-check
|
|
155
|
+
className: "dtable-font dtable-icon-check"
|
|
156
156
|
})]
|
|
157
157
|
}, "".concat(option.id, "-").concat(index));
|
|
158
158
|
});
|
|
@@ -213,17 +213,20 @@ class SelectOptionGroup extends _react.Component {
|
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
216
|
-
className: (0, _classnames.default)('option-group group-selector', className ? 'option-group-' + className : ''),
|
|
216
|
+
className: (0, _classnames.default)('option-group group-selector seatable-group-select', className ? 'option-group-' + className : ''),
|
|
217
217
|
ref: ref => this.optionGroupRef = ref,
|
|
218
218
|
style: style,
|
|
219
219
|
onMouseDown: this.onMouseDown,
|
|
220
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
221
|
-
className: "
|
|
222
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
223
|
-
className: "option-search-control",
|
|
220
|
+
children: [this.props.options && this.props.options.length > 10 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
221
|
+
className: "seatable-search-input",
|
|
222
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
|
|
224
223
|
placeholder: searchPlaceholder,
|
|
225
224
|
onChange: this.onChangeSearch,
|
|
226
|
-
|
|
225
|
+
autoFocus: true,
|
|
226
|
+
value: searchVal,
|
|
227
|
+
clearValue: this.clearValue,
|
|
228
|
+
isClearable: true,
|
|
229
|
+
isLeftIcon: true
|
|
227
230
|
})
|
|
228
231
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
229
232
|
className: "option-group-content",
|
|
@@ -21,7 +21,7 @@ function DTableSelectLabel(_ref) {
|
|
|
21
21
|
}), isSelect && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
22
|
className: "dtable-select-check-icon",
|
|
23
23
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
24
|
-
className: "dtable-font dtable-icon-check
|
|
24
|
+
className: "dtable-font dtable-icon-check"
|
|
25
25
|
})
|
|
26
26
|
})]
|
|
27
27
|
});
|
|
@@ -40,10 +40,11 @@ class DTableSelect extends _react.default.Component {
|
|
|
40
40
|
MenuList: _utils.MenuList,
|
|
41
41
|
ClearIndicator: _utils.ClearIndicator
|
|
42
42
|
}, userComponents);
|
|
43
|
+
const processedOptions = (0, _utils.processOptionsWithClear)(options, isClearable);
|
|
43
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.default, {
|
|
44
45
|
value: value,
|
|
45
|
-
onChange: onChange,
|
|
46
|
-
options:
|
|
46
|
+
onChange: (0, _utils.createHandleChange)(onChange),
|
|
47
|
+
options: processedOptions,
|
|
47
48
|
isMulti: isMulti,
|
|
48
49
|
className: className,
|
|
49
50
|
classNamePrefix: classNamePrefix,
|
|
@@ -51,7 +52,6 @@ class DTableSelect extends _react.default.Component {
|
|
|
51
52
|
components: mergedComponents,
|
|
52
53
|
placeholder: placeholder,
|
|
53
54
|
isSearchable: isSearchable,
|
|
54
|
-
isClearable: isClearable,
|
|
55
55
|
menuPosition: menuPosition || 'fixed' // when use default menuPosition(absolute), menuPortalTarget is unnecessary.
|
|
56
56
|
,
|
|
57
57
|
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,26 @@
|
|
|
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 {
|
|
14
|
+
isDisabled
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
17
|
+
className: "select-dropdown-indicator d-flex align-items-center",
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
|
|
20
|
+
symbol: "down",
|
|
21
|
+
color: "var(--bs-icon-color)",
|
|
22
|
+
className: isDisabled ? 'dis-multicolor-icon-down' : ''
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var _default = exports.default = SelectDropdownIndicator;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.MenuSelectStyle = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
+
const DEFAULT_CONTROL_STYLE = {
|
|
10
|
+
fontSize: '14px',
|
|
11
|
+
padding: '0 1rem 0 .5rem',
|
|
12
|
+
border: '1px solid var(--bs-border-color) !important',
|
|
13
|
+
boxShadow: 'none',
|
|
14
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
15
|
+
borderRadius: '4px',
|
|
16
|
+
outline: '0'
|
|
17
|
+
};
|
|
18
|
+
const FOCUS_CONTROL_STYLE = {
|
|
19
|
+
fontSize: '14px',
|
|
20
|
+
padding: '0 1rem 0 .5rem',
|
|
21
|
+
border: '1px solid #3e84f7',
|
|
22
|
+
boxShadow: 'none',
|
|
23
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
24
|
+
borderRadius: '4px',
|
|
25
|
+
outline: '0'
|
|
26
|
+
};
|
|
27
|
+
const controlCallback = (provided, state) => {
|
|
28
|
+
const {
|
|
29
|
+
isDisabled,
|
|
30
|
+
isFocused
|
|
31
|
+
} = state;
|
|
32
|
+
if (isDisabled) {
|
|
33
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), DEFAULT_CONTROL_STYLE), {}, {
|
|
34
|
+
cursor: 'default',
|
|
35
|
+
backgroundColor: '#f5f5f5',
|
|
36
|
+
opacity: 0.65
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (isFocused) {
|
|
40
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE), {}, {
|
|
41
|
+
'&:hover': (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
45
|
+
fontSize: '14px',
|
|
46
|
+
lineHeight: '1.5',
|
|
47
|
+
cursor: 'pointer'
|
|
48
|
+
}, DEFAULT_CONTROL_STYLE), {}, {
|
|
49
|
+
'&:hover': (0, _objectSpread2.default)({}, DEFAULT_CONTROL_STYLE)
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
53
|
+
// .react-select__menu / react-select-2-listbox
|
|
54
|
+
menu: base => {
|
|
55
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
56
|
+
padding: '8px',
|
|
57
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
58
|
+
border: '1px solid var(--bs-border-secondary-color)',
|
|
59
|
+
borderRadius: '4px',
|
|
60
|
+
boxShadow: '0px 6px 14px rgba(0, 0, 0, 0.1)',
|
|
61
|
+
marginTop: '4px',
|
|
62
|
+
marginBottom: 0
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
option: (provided, state) => {
|
|
66
|
+
const {
|
|
67
|
+
isDisabled,
|
|
68
|
+
isFocused,
|
|
69
|
+
isActive,
|
|
70
|
+
isVisited
|
|
71
|
+
} = state;
|
|
72
|
+
let bgColor;
|
|
73
|
+
if (isActive || isVisited) {
|
|
74
|
+
bgColor = 'rgba(0, 0, 0, 0.06)';
|
|
75
|
+
} else if (isFocused) {
|
|
76
|
+
bgColor = 'rgba(0, 0, 0, .04)';
|
|
77
|
+
} else {
|
|
78
|
+
bgColor = 'var(--bs-popover-bg)';
|
|
79
|
+
}
|
|
80
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
81
|
+
color: 'var(--bs-body-color)',
|
|
82
|
+
borderRadius: '4px',
|
|
83
|
+
minHeight: '32px',
|
|
84
|
+
padding: '6px 8px 6px 8px',
|
|
85
|
+
cursor: isDisabled ? 'default' : 'pointer',
|
|
86
|
+
backgroundColor: "".concat(bgColor, " !important")
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
control: controlCallback,
|
|
90
|
+
menuPortal: base => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
91
|
+
zIndex: 9999,
|
|
92
|
+
backgroundColor: 'var(--bs-popover-bg)',
|
|
93
|
+
color: 'var(--bs-body-color)',
|
|
94
|
+
borderColor: 'var(--bs-border-secondary-color)'
|
|
95
|
+
}),
|
|
96
|
+
singleValue: provided => {
|
|
97
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
98
|
+
color: 'var(--bs-body-color)'
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
multiValue: provided => {
|
|
102
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
103
|
+
color: 'var(--bs-body-color)'
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
multiValueRemove: styles => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
|
107
|
+
color: '#909090',
|
|
108
|
+
':hover': {
|
|
109
|
+
backgroundColor: 'transparent',
|
|
110
|
+
color: 'var(--bs-icon-color)'
|
|
111
|
+
}
|
|
112
|
+
}),
|
|
113
|
+
input: styles => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
|
114
|
+
color: 'var(--bs-body-color)'
|
|
115
|
+
}),
|
|
116
|
+
placeholder: (provided, state) => {
|
|
117
|
+
const {
|
|
118
|
+
isDisabled
|
|
119
|
+
} = state;
|
|
120
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
121
|
+
color: '#868e96',
|
|
122
|
+
opacity: isDisabled ? 0.65 : 1
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
indicatorSeparator: (styles, state) => {
|
|
126
|
+
return {
|
|
127
|
+
'display': 'none'
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
indicatorContainer: (provided, state) => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
131
|
+
padding: 0
|
|
132
|
+
})
|
|
133
|
+
};
|
|
@@ -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
|
}
|