dtable-ui-component 6.0.110-ast.2 → 6.0.110-ast.3
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.
|
@@ -120,3 +120,9 @@
|
|
|
120
120
|
.seatable-option-group-selector-multiple-select .seatable-select-option.seatable-select-option-active {
|
|
121
121
|
background-color: #f5f5f5;
|
|
122
122
|
}
|
|
123
|
+
|
|
124
|
+
.seatable-option-group-selector-multiple-select .select-label .select-label .header-icon {
|
|
125
|
+
display: inline-block;
|
|
126
|
+
padding: 0 0.5rem !important;
|
|
127
|
+
margin-left: 0 !important;
|
|
128
|
+
}
|
|
@@ -181,10 +181,10 @@ class DTableSelect extends _react.default.Component {
|
|
|
181
181
|
className: "select-option-label",
|
|
182
182
|
children: option.label
|
|
183
183
|
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
184
|
-
className: "dtable-font dtable-icon-check seatable-check-color",
|
|
184
|
+
className: "dtable-font dtable-icon-check seatable-check-color d-flex align-items-center justify-content-center",
|
|
185
185
|
style: {
|
|
186
|
-
width: '
|
|
187
|
-
height: '
|
|
186
|
+
width: '14px',
|
|
187
|
+
height: '14px'
|
|
188
188
|
}
|
|
189
189
|
})]
|
|
190
190
|
});
|
package/package.json
CHANGED
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.processOptionsWithClear = exports.handleSelectChange = exports.createHandleChange = exports.UserSelectStyle = exports.Option = exports.MenuSelectStyle = exports.MenuList = exports.DropdownIndicator = exports.ClearIndicator = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _reactSelect = require("react-select");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
const _excluded = ["innerProps"]; // DtableSelect is based on seatable-ui.css, so use the following content to override the default react-select style
|
|
14
|
-
const DEFAULT_CONTROL_STYLE = {
|
|
15
|
-
border: '1px solid rgba(0, 40, 100, 0.12) !important'
|
|
16
|
-
};
|
|
17
|
-
const FOCUS_CONTROL_STYLE = {
|
|
18
|
-
fontSize: '14px',
|
|
19
|
-
backgroundColor: '#ffffff',
|
|
20
|
-
borderColor: '#1991eb',
|
|
21
|
-
outline: '0',
|
|
22
|
-
boxShadow: '0 0 0 2px rgba(70, 127, 207, 0.25)'
|
|
23
|
-
};
|
|
24
|
-
const noneCallback = () => ({
|
|
25
|
-
display: 'none'
|
|
26
|
-
});
|
|
27
|
-
const controlCallback = (provided, state) => {
|
|
28
|
-
const {
|
|
29
|
-
isDisabled,
|
|
30
|
-
isFocused
|
|
31
|
-
} = state;
|
|
32
|
-
if (isFocused && !isDisabled) {
|
|
33
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE), {}, {
|
|
34
|
-
'&:hover': (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE)
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
38
|
-
fontSize: '14px',
|
|
39
|
-
lineHeight: '1.5',
|
|
40
|
-
cursor: 'pointer'
|
|
41
|
-
}, DEFAULT_CONTROL_STYLE), {}, {
|
|
42
|
-
'&:hover': (0, _objectSpread2.default)({}, DEFAULT_CONTROL_STYLE)
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
const UserSelectStyle = exports.UserSelectStyle = {
|
|
46
|
-
option: (provided, state) => {
|
|
47
|
-
const {
|
|
48
|
-
isDisabled,
|
|
49
|
-
isFocused
|
|
50
|
-
} = state;
|
|
51
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
52
|
-
cursor: isDisabled ? 'default' : 'pointer',
|
|
53
|
-
backgroundColor: isFocused ? '#f5f5f5' : '#fff'
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
control: controlCallback,
|
|
57
|
-
indicatorSeparator: noneCallback,
|
|
58
|
-
dropdownIndicator: noneCallback,
|
|
59
|
-
clearIndicator: noneCallback,
|
|
60
|
-
multiValue: provided => {
|
|
61
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
62
|
-
display: 'inline-flex',
|
|
63
|
-
alignItems: 'center',
|
|
64
|
-
background: '#eaeaea',
|
|
65
|
-
borderRadius: '10px',
|
|
66
|
-
margin: '0 10px 0 0',
|
|
67
|
-
padding: '0 0 0 2px'
|
|
68
|
-
});
|
|
69
|
-
},
|
|
70
|
-
multiValueLabel: provided => {
|
|
71
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
72
|
-
padding: '0px'
|
|
73
|
-
});
|
|
74
|
-
},
|
|
75
|
-
multiValueRemove: provided => {
|
|
76
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
77
|
-
color: '#666',
|
|
78
|
-
':hover': {
|
|
79
|
-
backgroundColor: 'transparent',
|
|
80
|
-
color: '#555555'
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
singleValue: provided => {
|
|
85
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
86
|
-
display: 'inline-flex',
|
|
87
|
-
alignItems: 'center',
|
|
88
|
-
background: '#eaeaea',
|
|
89
|
-
borderRadius: '10px',
|
|
90
|
-
margin: '0',
|
|
91
|
-
padding: '0 2px',
|
|
92
|
-
width: 'fit-content'
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
97
|
-
option: (provided, state) => {
|
|
98
|
-
const {
|
|
99
|
-
isDisabled,
|
|
100
|
-
isFocused
|
|
101
|
-
} = state;
|
|
102
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
103
|
-
padding: '8px',
|
|
104
|
-
fontSize: '14px',
|
|
105
|
-
color: '#212529',
|
|
106
|
-
cursor: isDisabled ? 'default' : 'pointer',
|
|
107
|
-
backgroundColor: isFocused ? '#f5f5f5' : '#fff',
|
|
108
|
-
borderRadius: '4px',
|
|
109
|
-
':active': {
|
|
110
|
-
backgroundColor: '#f5f5f5'
|
|
111
|
-
},
|
|
112
|
-
'.header-icon .dtable-font': {
|
|
113
|
-
color: '#999'
|
|
114
|
-
},
|
|
115
|
-
'.header-icon .multicolor-icon': {
|
|
116
|
-
color: '#999'
|
|
117
|
-
},
|
|
118
|
-
'.seatable-ui-select-tip': {
|
|
119
|
-
fontSize: '12px',
|
|
120
|
-
color: '#666666'
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
},
|
|
124
|
-
control: controlCallback,
|
|
125
|
-
menuPortal: base => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
126
|
-
zIndex: 9999
|
|
127
|
-
}),
|
|
128
|
-
indicatorSeparator: noneCallback,
|
|
129
|
-
menuList: provided => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
130
|
-
padding: '8px'
|
|
131
|
-
}),
|
|
132
|
-
valueContainer: (provided, state) => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
133
|
-
padding: '2px 8px 2px 16px'
|
|
134
|
-
}),
|
|
135
|
-
dropdownIndicator: (provided, state) => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
136
|
-
padding: 0
|
|
137
|
-
})
|
|
138
|
-
};
|
|
139
|
-
const DropdownIndicator = props => {
|
|
140
|
-
return _reactSelect.components.DropdownIndicator && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.DropdownIndicator, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
141
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
142
|
-
className: "dtable-font dtable-icon-down3",
|
|
143
|
-
style: {
|
|
144
|
-
fontSize: '12px',
|
|
145
|
-
marginLeft: '-2px',
|
|
146
|
-
color: '#666666',
|
|
147
|
-
paddingRight: '16px'
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
}));
|
|
151
|
-
};
|
|
152
|
-
exports.DropdownIndicator = DropdownIndicator;
|
|
153
|
-
const ClearIndicator = _ref => {
|
|
154
|
-
let {
|
|
155
|
-
innerProps
|
|
156
|
-
} = _ref,
|
|
157
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
158
|
-
const onMouseDown = e => {
|
|
159
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
160
|
-
innerProps.onMouseDown(e);
|
|
161
|
-
};
|
|
162
|
-
props.innerProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, innerProps), {}, {
|
|
163
|
-
onMouseDown
|
|
164
|
-
});
|
|
165
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.ClearIndicator, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
166
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
167
|
-
className: "dtable-font dtable-icon-fork-number",
|
|
168
|
-
style: {
|
|
169
|
-
fontSize: '12px',
|
|
170
|
-
marginRight: '-2px'
|
|
171
|
-
}
|
|
172
|
-
})
|
|
173
|
-
}));
|
|
174
|
-
};
|
|
175
|
-
exports.ClearIndicator = ClearIndicator;
|
|
176
|
-
const MenuList = props => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
177
|
-
onClick: e => e.nativeEvent.stopImmediatePropagation(),
|
|
178
|
-
onMouseDown: e => e.nativeEvent.stopImmediatePropagation(),
|
|
179
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.MenuList, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
180
|
-
children: props.children
|
|
181
|
-
}))
|
|
182
|
-
});
|
|
183
|
-
exports.MenuList = MenuList;
|
|
184
|
-
const Option = props => {
|
|
185
|
-
const {
|
|
186
|
-
isSelected,
|
|
187
|
-
label
|
|
188
|
-
} = props;
|
|
189
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
190
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
191
|
-
style: {
|
|
192
|
-
display: 'flex',
|
|
193
|
-
alignItems: 'center',
|
|
194
|
-
justifyContent: 'space-between',
|
|
195
|
-
width: '100%'
|
|
196
|
-
},
|
|
197
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
198
|
-
children: label
|
|
199
|
-
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
200
|
-
className: "dtable-font dtable-icon-check",
|
|
201
|
-
style: {
|
|
202
|
-
fontSize: '14px',
|
|
203
|
-
color: '#666666',
|
|
204
|
-
paddingLeft: '16px'
|
|
205
|
-
}
|
|
206
|
-
})]
|
|
207
|
-
})
|
|
208
|
-
}));
|
|
209
|
-
};
|
|
210
|
-
exports.Option = Option;
|
|
211
|
-
const processOptionsWithClear = (options, isClearable) => {
|
|
212
|
-
if (isClearable && options && options.length > 0) {
|
|
213
|
-
return [{
|
|
214
|
-
label: '--',
|
|
215
|
-
value: '__clear__'
|
|
216
|
-
}, ...options];
|
|
217
|
-
}
|
|
218
|
-
return options;
|
|
219
|
-
};
|
|
220
|
-
exports.processOptionsWithClear = processOptionsWithClear;
|
|
221
|
-
const handleSelectChange = (selectedOption, actionMeta, onChangeCallback, isMulti) => {
|
|
222
|
-
if (isMulti && Array.isArray(selectedOption)) {
|
|
223
|
-
const hasClear = selectedOption && selectedOption.some(opt => opt && opt.value === '__clear__');
|
|
224
|
-
if (hasClear) {
|
|
225
|
-
onChangeCallback([], (0, _objectSpread2.default)((0, _objectSpread2.default)({}, actionMeta), {}, {
|
|
226
|
-
action: 'clear'
|
|
227
|
-
}));
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
} else if (selectedOption && selectedOption.value === '__clear__') {
|
|
231
|
-
onChangeCallback(null, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, actionMeta), {}, {
|
|
232
|
-
action: 'clear'
|
|
233
|
-
}));
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
onChangeCallback(selectedOption, actionMeta);
|
|
237
|
-
};
|
|
238
|
-
exports.handleSelectChange = handleSelectChange;
|
|
239
|
-
const createHandleChange = (onChange, isMulti) => {
|
|
240
|
-
return (selectedOption, actionMeta) => {
|
|
241
|
-
handleSelectChange(selectedOption, actionMeta, onChange, isMulti);
|
|
242
|
-
};
|
|
243
|
-
};
|
|
244
|
-
exports.createHandleChange = createHandleChange;
|