dtable-ui-component 7.0.1-beta.select1 → 7.0.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.
Files changed (39) hide show
  1. package/lib/AsyncUserSelect/index.css +28 -38
  2. package/lib/AsyncUserSelect/index.js +18 -29
  3. package/lib/DTableCustomizeCollaboratorSelect/index.css +86 -0
  4. package/lib/DTableCustomizeCollaboratorSelect/index.js +158 -0
  5. package/lib/DTableCustomizeSelect/index.css +42 -120
  6. package/lib/DTableCustomizeSelect/index.js +6 -12
  7. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +19 -7
  8. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -5
  9. package/lib/DTableFiltersPopover/widgets/filter-item.js +7 -15
  10. package/lib/DTableFiltersPopover/widgets/filter-list/index.css +3 -3
  11. package/lib/DTableGroupSelect/index.css +96 -0
  12. package/lib/DTableGroupSelect/index.js +131 -0
  13. package/lib/DTableGroupSelect/option.js +42 -0
  14. package/lib/DTableGroupSelect/select-option-group.css +54 -0
  15. package/lib/DTableGroupSelect/select-option-group.js +227 -0
  16. package/lib/DTableSelect/dtable-select-label.css +3 -8
  17. package/lib/DTableSelect/dtable-select-label.js +1 -1
  18. package/lib/DTableSelect/index.js +3 -3
  19. package/lib/DTableSelect/user-select.css +46 -7
  20. package/lib/DTableSelect/utils.js +79 -170
  21. package/lib/ImageEditor/images-previewer/image-preview/index.js +2 -1
  22. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +2 -2
  23. package/lib/ImageFormatter/images-lazy-load.js +2 -2
  24. package/lib/ImageFormatter/index.js +5 -2
  25. package/lib/ImagePreviewerLightbox/index.js +2 -1
  26. package/lib/ImageThumbnail/index.js +2 -1
  27. package/lib/SelectOptionGroup/KeyCodes.js +4 -96
  28. package/lib/SelectOptionGroup/index.css +54 -44
  29. package/lib/SelectOptionGroup/index.js +18 -35
  30. package/lib/SelectOptionGroup/option.js +4 -16
  31. package/lib/index.js +10 -3
  32. package/lib/utils/url.js +10 -35
  33. package/package.json +2 -2
  34. package/lib/DTableCustomizeSearchInput/index.css +0 -75
  35. package/lib/DTableCustomizeSearchInput/index.js +0 -133
  36. package/lib/DTableSelect/select-dropdown-indicator/index.css +0 -16
  37. package/lib/DTableSelect/select-dropdown-indicator/index.js +0 -24
  38. package/lib/assets/icons/close.svg +0 -1
  39. package/lib/assets/icons/down.svg +0 -3
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _DTableSearchInput = _interopRequireDefault(require("../DTableSearchInput"));
12
+ var _option = _interopRequireDefault(require("./option"));
13
+ var _KeyCodes = _interopRequireDefault(require("../SelectOptionGroup/KeyCodes"));
14
+ require("./select-option-group.css");
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ const OPTION_HEIGHT = 32;
17
+ class SelectOptionGroup extends _react.Component {
18
+ constructor(props) {
19
+ super(props);
20
+ this.handleDocumentClick = e => {
21
+ this.props.onClickOutside(e);
22
+ };
23
+ this.resetMenuStyle = () => {
24
+ const _this$props = this.props,
25
+ isInModal = _this$props.isInModal,
26
+ position = _this$props.position;
27
+ const _this$optionGroupRef$ = this.optionGroupRef.getBoundingClientRect(),
28
+ top = _this$optionGroupRef$.top,
29
+ height = _this$optionGroupRef$.height;
30
+ if (isInModal) {
31
+ if (position.y + position.height + height > window.innerHeight) {
32
+ this.optionGroupRef.style.top = position.y - height + 'px';
33
+ }
34
+ this.optionGroupRef.style.opacity = 1;
35
+ this.searchInputRef.current && this.searchInputRef.current.inputRef.focus();
36
+ } else {
37
+ if (height + top > window.innerHeight) {
38
+ const borderWidth = 2;
39
+ this.optionGroupRef.style.top = -1 * (height + borderWidth) + 'px';
40
+ }
41
+ }
42
+ };
43
+ this.onHotKey = event => {
44
+ const keyCode = event.keyCode;
45
+ if (keyCode === _KeyCodes.default.UpArrow) {
46
+ this.onPressUp();
47
+ } else if (keyCode === _KeyCodes.default.DownArrow) {
48
+ this.onPressDown();
49
+ } else if (keyCode === _KeyCodes.default.Enter) {
50
+ let option = this.filterOptions && this.filterOptions[this.state.activeIndex];
51
+ if (option) {
52
+ this.props.onSelectOption(option);
53
+ }
54
+ } else if (keyCode === _KeyCodes.default.Tab || keyCode === _KeyCodes.default.Escape) {
55
+ this.props.closeSelect();
56
+ }
57
+ };
58
+ this.onPressUp = () => {
59
+ if (this.state.activeIndex > 0) {
60
+ this.setState({
61
+ activeIndex: this.state.activeIndex - 1
62
+ }, () => {
63
+ this.scrollContent();
64
+ });
65
+ }
66
+ };
67
+ this.onPressDown = () => {
68
+ if (this.filterOptions && this.state.activeIndex < this.filterOptions.length - 1) {
69
+ this.setState({
70
+ activeIndex: this.state.activeIndex + 1
71
+ }, () => {
72
+ this.scrollContent();
73
+ });
74
+ }
75
+ };
76
+ this.onMouseDown = e => {
77
+ const isInModal = this.props.isInModal;
78
+ // prevent event propagation when click option or search input
79
+ if (isInModal) {
80
+ e.stopPropagation();
81
+ e.nativeEvent.stopImmediatePropagation();
82
+ }
83
+ };
84
+ this.scrollContent = () => {
85
+ const _this$optionGroupCont = this.optionGroupContentRef,
86
+ offsetHeight = _this$optionGroupCont.offsetHeight,
87
+ scrollTop = _this$optionGroupCont.scrollTop;
88
+ this.setState({
89
+ disableHover: true
90
+ });
91
+ this.timer = setTimeout(() => {
92
+ this.setState({
93
+ disableHover: false
94
+ });
95
+ }, 500);
96
+ if (this.state.activeIndex * OPTION_HEIGHT === 0) {
97
+ this.optionGroupContentRef.scrollTop = 0;
98
+ return;
99
+ }
100
+ if (this.state.activeIndex * OPTION_HEIGHT < scrollTop) {
101
+ this.optionGroupContentRef.scrollTop = scrollTop - OPTION_HEIGHT;
102
+ } else if (this.state.activeIndex * OPTION_HEIGHT > offsetHeight + scrollTop) {
103
+ this.optionGroupContentRef.scrollTop = scrollTop + OPTION_HEIGHT;
104
+ }
105
+ };
106
+ this.changeIndex = index => {
107
+ this.setState({
108
+ activeIndex: index
109
+ });
110
+ };
111
+ this.onChangeSearch = searchVal => {
112
+ this.setState({
113
+ searchVal: searchVal || '',
114
+ activeIndex: -1
115
+ });
116
+ };
117
+ this.clearValue = () => {
118
+ this.setState({
119
+ searchVal: '',
120
+ activeIndex: -1
121
+ });
122
+ };
123
+ this.renderOptGroup = searchVal => {
124
+ let _this$props2 = this.props,
125
+ noOptionsPlaceholder = _this$props2.noOptionsPlaceholder,
126
+ onSelectOption = _this$props2.onSelectOption,
127
+ selectedOptions = _this$props2.selectedOptions;
128
+ this.filterOptions = this.props.getFilterOptions(searchVal);
129
+ if (this.filterOptions.length === 0) {
130
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
131
+ className: "none-search-result",
132
+ children: noOptionsPlaceholder
133
+ });
134
+ }
135
+ return this.filterOptions.map((option, index) => {
136
+ const isSelected = selectedOptions.some(item => item.id === option.id);
137
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_option.default, {
138
+ index: index,
139
+ isActive: this.state.activeIndex === index,
140
+ option: option,
141
+ onSelectOption: onSelectOption,
142
+ changeIndex: this.changeIndex,
143
+ disableHover: this.state.disableHover,
144
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
145
+ className: "option-label text-truncate",
146
+ title: option.label,
147
+ children: option.label
148
+ }), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
149
+ className: "dtable-font dtable-icon-check-mark"
150
+ })]
151
+ }, "".concat(option.id, "-").concat(index));
152
+ });
153
+ };
154
+ this.state = {
155
+ searchVal: '',
156
+ activeIndex: -1,
157
+ disableHover: false
158
+ };
159
+ this.filterOptions = null;
160
+ this.timer = null;
161
+ this.searchInputRef = /*#__PURE__*/_react.default.createRef();
162
+ }
163
+ componentDidMount() {
164
+ window.addEventListener('keydown', this.onHotKey);
165
+ document.addEventListener('mousedown', this.handleDocumentClick);
166
+ setTimeout(() => {
167
+ this.resetMenuStyle();
168
+ }, 1);
169
+ }
170
+ componentWillUnmount() {
171
+ this.filterOptions = null;
172
+ this.timer && clearTimeout(this.timer);
173
+ window.removeEventListener('keydown', this.onHotKey);
174
+ document.removeEventListener('mousedown', this.handleDocumentClick);
175
+ }
176
+ render() {
177
+ const _this$props3 = this.props,
178
+ searchPlaceholder = _this$props3.searchPlaceholder,
179
+ top = _this$props3.top,
180
+ left = _this$props3.left,
181
+ minWidth = _this$props3.minWidth,
182
+ isInModal = _this$props3.isInModal,
183
+ position = _this$props3.position,
184
+ className = _this$props3.className;
185
+ let searchVal = this.state.searchVal;
186
+ let style = {
187
+ top: top || 0,
188
+ left: left || 0
189
+ };
190
+ if (minWidth) {
191
+ style = {
192
+ top: top || 0,
193
+ left: left || 0,
194
+ minWidth
195
+ };
196
+ }
197
+ if (isInModal) {
198
+ style = {
199
+ position: 'fixed',
200
+ left: position.x,
201
+ top: position.y + position.height,
202
+ minWidth: position.width,
203
+ opacity: 0
204
+ };
205
+ }
206
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
207
+ className: (0, _classnames.default)('option-group group-selector', className ? 'option-group-' + className : ''),
208
+ ref: ref => this.optionGroupRef = ref,
209
+ style: style,
210
+ onMouseDown: this.onMouseDown,
211
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
212
+ className: "option-group-search position-relative",
213
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
214
+ className: "option-search-control",
215
+ placeholder: searchPlaceholder,
216
+ onChange: this.onChangeSearch,
217
+ ref: this.searchInputRef
218
+ })
219
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
220
+ className: "option-group-content",
221
+ ref: ref => this.optionGroupContentRef = ref,
222
+ children: this.renderOptGroup(searchVal)
223
+ })]
224
+ });
225
+ }
226
+ }
227
+ var _default = exports.default = SelectOptionGroup;
@@ -1,15 +1,10 @@
1
1
  .dtable-select-check-icon {
2
- width: 14px;
3
- height: 14px;
2
+ width: 20px;
3
+ height: 20px;
4
4
  text-align: center;
5
5
  }
6
6
 
7
7
  .dtable-select-check-icon .dtable-font {
8
- font-size: 14px;
9
- color: var(--bs-icon-color);
10
- }
11
-
12
- .seatable-option .select-option-name .seatable-tip-default {
13
8
  font-size: 12px;
14
- margin-top: 4px
9
+ color: #798d99;
15
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-mark"
26
26
  })
27
27
  })]
28
28
  });
@@ -39,11 +39,10 @@ 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);
43
42
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.default, {
44
43
  value: value,
45
- onChange: (0, _utils.createHandleChange)(onChange),
46
- options: processedOptions,
44
+ onChange: onChange,
45
+ options: options,
47
46
  isMulti: isMulti,
48
47
  className: className,
49
48
  classNamePrefix: classNamePrefix,
@@ -51,6 +50,7 @@ class DTableSelect extends _react.default.Component {
51
50
  components: mergedComponents,
52
51
  placeholder: placeholder,
53
52
  isSearchable: isSearchable,
53
+ isClearable: isClearable,
54
54
  menuPosition: menuPosition || 'fixed' // when use default menuPosition(absolute), menuPortalTarget is unnecessary.
55
55
  ,
56
56
  menuShouldScrollIntoView: true,
@@ -1,12 +1,51 @@
1
- /* hide checkbox in select value container */
2
- .seatable-select-value-container .seatable-multicolor-icon-check {
3
- display: none;
1
+ .user-select .select-module-container {
2
+ display: flex;
3
+ align-items: center;
4
4
  }
5
5
 
6
- .seatable-select-value-container .select-option-label {
7
- font-size: 14px !important;
6
+ .user-select .select-module.select-module-avatar {
7
+ height: 24px;
8
+ width: 24px;
9
+ border-radius: 50%;
8
10
  }
9
11
 
10
- .seatable-check-color {
11
- color: var(--bs-icon-secondary-color);
12
+ .user-select .select-module.select-module-name {
13
+ color: #212529;
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);
12
51
  }
@@ -4,168 +4,124 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.processOptionsWithClear = exports.handleSelectChange = exports.createHandleChange = exports.Option = exports.MenuSelectStyle = exports.MenuList = exports.DropdownIndicator = exports.ClearIndicator = void 0;
7
+ exports.UserSelectStyle = 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"));
11
11
  var _reactSelect = require("react-select");
12
- require("./dtable-select-label.css");
13
12
  var _jsxRuntime = require("react/jsx-runtime");
14
13
  const _excluded = ["innerProps"]; // DtableSelect is based on seatable-ui.css, so use the following content to override the default react-select style
15
14
  const DEFAULT_CONTROL_STYLE = {
16
- fontSize: '14px',
17
- padding: '0 4px 0 8px',
18
- border: '1px solid var(--bs-border-color) !important',
19
- boxShadow: 'none',
20
- backgroundColor: 'var(--bs-popover-bg)',
21
- borderRadius: '4px',
22
- outline: '0'
23
- };
24
- const DISABLED_CONTROL_STYLE = {
25
- fontSize: '14px',
26
- padding: '0 4px 0 8px',
27
- border: '1px solid rgba(0, 40, 100, 0.12)',
28
- boxShadow: 'none',
29
- backgroundColor: 'var(--bs-bg-color)',
30
- borderRadius: '4px',
31
- outline: '0',
32
- cursor: 'default',
33
- opacity: 0.65
15
+ border: '1px solid rgba(0, 40, 100, 0.12) !important'
34
16
  };
35
17
  const FOCUS_CONTROL_STYLE = {
36
18
  fontSize: '14px',
37
- padding: '0 4px 0 8px',
38
- border: '1px solid var(--bs-bg-border-color)',
39
- boxShadow: 'none',
40
- backgroundColor: 'var(--bs-popover-bg)',
41
- borderRadius: '4px',
42
- outline: '0'
43
- };
44
- const HEADER_ICON_STYLE = {
45
- margin: '0 0.5rem 0 0 !important',
46
- padding: 0
19
+ backgroundColor: '#ffffff',
20
+ borderColor: '#1991eb',
21
+ outline: '0',
22
+ boxShadow: '0 0 0 2px rgba(70, 127, 207, 0.25)'
47
23
  };
24
+ const noneCallback = () => ({
25
+ display: 'none'
26
+ });
48
27
  const controlCallback = (provided, state) => {
49
28
  const isDisabled = state.isDisabled,
50
29
  isFocused = state.isFocused;
51
- const headerIconStyle = {
52
- '.header-icon': HEADER_ICON_STYLE,
53
- '.header-icon .dtable-font': {
54
- color: 'var(--bs-icon-secondary-color) !important'
55
- }
56
- };
57
- if (isDisabled) {
58
- return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), DISABLED_CONTROL_STYLE), {}, {
59
- ':active': {
60
- border: '1px solid var(--bs-bg-border-color)'
61
- }
62
- }, headerIconStyle);
63
- }
64
- if (isFocused) {
65
- return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE), headerIconStyle);
30
+ if (isFocused && !isDisabled) {
31
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE), {}, {
32
+ '&:hover': (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), FOCUS_CONTROL_STYLE)
33
+ });
66
34
  }
67
35
  return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
68
36
  fontSize: '14px',
69
37
  lineHeight: '1.5',
70
38
  cursor: 'pointer'
71
- }, DEFAULT_CONTROL_STYLE), headerIconStyle);
39
+ }, DEFAULT_CONTROL_STYLE), {}, {
40
+ '&:hover': (0, _objectSpread2.default)({}, DEFAULT_CONTROL_STYLE)
41
+ });
72
42
  };
73
- const MenuSelectStyle = exports.MenuSelectStyle = {
74
- menu: base => {
75
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
76
- backgroundColor: 'var(--bs-popover-bg)',
77
- border: '1px solid var(--bs-border-secondary-color)',
78
- borderRadius: '4px',
79
- boxShadow: 'var(--bs-border-secondary-shadow)',
80
- marginTop: '4px',
81
- marginBottom: 0
82
- });
83
- },
84
- menuList: provided => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
85
- padding: '8px'
86
- }),
43
+ const UserSelectStyle = exports.UserSelectStyle = {
87
44
  option: (provided, state) => {
88
- const isDisabled = state.isDisabled;
45
+ const isDisabled = state.isDisabled,
46
+ isFocused = state.isFocused;
89
47
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
90
- color: 'var(--bs-body-color)',
91
- borderRadius: '4px',
92
- minHeight: '32px',
93
- padding: '8px',
94
48
  cursor: isDisabled ? 'default' : 'pointer',
95
- backgroundColor: 'var(--bs-popover-bg)',
96
- overflow: 'hidden',
97
- whiteSpace: 'nowrap',
98
- textOverflow: 'ellipsis',
99
- ':hover': {
100
- backgroundColor: 'var(--bs-btn-background-hover)'
101
- },
102
- '.header-icon': HEADER_ICON_STYLE
49
+ backgroundColor: isFocused ? '#f5f5f5' : '#fff'
103
50
  });
104
51
  },
105
52
  control: controlCallback,
106
- menuPortal: base => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
107
- zIndex: 9999,
108
- backgroundColor: 'var(--bs-popover-bg)',
109
- color: 'var(--bs-body-color)',
110
- borderColor: 'var(--bs-border-secondary-color)'
111
- }),
112
- singleValue: provided => {
53
+ indicatorSeparator: noneCallback,
54
+ dropdownIndicator: noneCallback,
55
+ clearIndicator: noneCallback,
56
+ multiValue: provided => {
113
57
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
114
- color: 'var(--bs-body-color)',
115
- margin: 0
58
+ display: 'inline-flex',
59
+ alignItems: 'center',
60
+ background: '#eaeaea',
61
+ borderRadius: '10px',
62
+ margin: '0 10px 0 0',
63
+ padding: '0 0 0 2px'
116
64
  });
117
65
  },
118
- multiValue: provided => {
66
+ multiValueLabel: provided => {
119
67
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
120
- color: 'var(--bs-body-color)',
121
- margin: 0
68
+ padding: '0px'
122
69
  });
123
70
  },
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 isDisabled = state.isDisabled;
71
+ multiValueRemove: provided => {
138
72
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
139
- color: 'var(--bs-bg-placeholder-color)',
140
- opacity: isDisabled ? 0.65 : 1,
141
- margin: 0
73
+ color: '#666',
74
+ ':hover': {
75
+ backgroundColor: 'transparent',
76
+ color: '#555555'
77
+ }
142
78
  });
143
79
  },
144
- indicatorSeparator: (styles, state) => {
145
- return {
146
- 'display': 'none'
147
- };
148
- },
149
- dropdownIndicator: (provided, state) => {
150
- const isDisabled = state.isDisabled;
80
+ singleValue: provided => {
151
81
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
152
- paddingRight: '12px',
153
- '.dtable-font': {
154
- color: 'var(--bs-icon-color) !important',
155
- opacity: isDisabled ? 0.65 : 1
156
- }
82
+ display: 'inline-flex',
83
+ alignItems: 'center',
84
+ background: '#eaeaea',
85
+ borderRadius: '10px',
86
+ margin: '0',
87
+ padding: '0 2px',
88
+ width: 'fit-content'
157
89
  });
158
90
  }
159
91
  };
92
+ const MenuSelectStyle = exports.MenuSelectStyle = {
93
+ option: (provided, state) => {
94
+ const isDisabled = state.isDisabled,
95
+ isFocused = state.isFocused;
96
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
97
+ fontSize: '13px',
98
+ color: '#212529',
99
+ cursor: isDisabled ? 'default' : 'pointer',
100
+ backgroundColor: isFocused ? '#f5f5f5' : '#fff',
101
+ ':active': {
102
+ backgroundColor: '#f5f5f5'
103
+ },
104
+ '.header-icon .dtable-font': {
105
+ color: '#aaa'
106
+ },
107
+ '.header-icon .multicolor-icon': {
108
+ color: '#aaa'
109
+ }
110
+ });
111
+ },
112
+ control: controlCallback,
113
+ menuPortal: base => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
114
+ zIndex: 9999
115
+ }),
116
+ indicatorSeparator: noneCallback
117
+ };
160
118
  const DropdownIndicator = props => {
161
119
  return _reactSelect.components.DropdownIndicator && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.DropdownIndicator, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
162
120
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
163
121
  className: "dtable-font dtable-icon-down3",
164
122
  style: {
165
123
  fontSize: '12px',
166
- marginLeft: '-2px',
167
- color: 'var(--bs-icon-color)',
168
- paddingRight: 0
124
+ marginLeft: '-2px'
169
125
  }
170
126
  })
171
127
  }));
@@ -186,8 +142,7 @@ const ClearIndicator = _ref => {
186
142
  className: "dtable-font dtable-icon-fork-number",
187
143
  style: {
188
144
  fontSize: '12px',
189
- marginRight: '-2px',
190
- color: 'var(--bs-icon-color)'
145
+ marginRight: '-2px'
191
146
  }
192
147
  })
193
148
  }));
@@ -202,55 +157,9 @@ const MenuList = props => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
202
157
  });
203
158
  exports.MenuList = MenuList;
204
159
  const Option = props => {
205
- const isSelected = props.isSelected,
206
- label = props.label;
207
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
208
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
209
- style: {
210
- display: 'flex',
211
- alignItems: 'center',
212
- justifyContent: 'space-between',
213
- width: '100%',
214
- whiteSpace: 'pre-line'
215
- },
216
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
217
- className: "seatable-option",
218
- children: label
219
- }), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
220
- className: "dtable-font dtable-icon-check",
221
- style: {
222
- fontSize: '14px',
223
- color: 'var(--bs-icon-color)',
224
- paddingLeft: '16px'
225
- }
226
- })]
227
- })
228
- }));
229
- };
230
- exports.Option = Option;
231
- const processOptionsWithClear = (options, isClearable) => {
232
- if (isClearable && options && options.length > 0) {
233
- return [{
234
- label: '--',
235
- value: '__clear__'
236
- }, ...options];
237
- }
238
- return options;
239
- };
240
- exports.processOptionsWithClear = processOptionsWithClear;
241
- const handleSelectChange = (selectedOption, actionMeta, onChangeCallback) => {
242
- if (selectedOption && selectedOption.value === '__clear__') {
243
- onChangeCallback(null, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, actionMeta), {}, {
244
- action: 'clear'
245
- }));
246
- } else {
247
- onChangeCallback(selectedOption, actionMeta);
248
- }
249
- };
250
- exports.handleSelectChange = handleSelectChange;
251
- const createHandleChange = onChange => {
252
- return (selectedOption, actionMeta) => {
253
- handleSelectChange(selectedOption, actionMeta, onChange);
254
- };
160
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
161
+ style: props.data.style,
162
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, (0, _objectSpread2.default)({}, props))
163
+ });
255
164
  };
256
- exports.createHandleChange = createHandleChange;
165
+ exports.Option = Option;
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
+ var _dtableUtils = require("dtable-utils");
10
11
  var _DTableToolTip = _interopRequireDefault(require("../../../DTableToolTip"));
11
12
  var _DeleteTip = _interopRequireDefault(require("../../../DeleteTip"));
12
13
  var _url = require("../../../utils/url");
@@ -99,7 +100,7 @@ class ImagePreviewer extends _react.default.Component {
99
100
  });
100
101
  return;
101
102
  }
102
- let imageThumbnailUrl = (0, _url.getImageThumbnailUrl)(imageItemUrl, config);
103
+ let imageThumbnailUrl = (0, _dtableUtils.getImageThumbnailUrl)(imageItemUrl, config);
103
104
  (0, _url.checkImgExists)(imageThumbnailUrl).then(() => {
104
105
  this.setState({
105
106
  imageThumbnailUrl: imageThumbnailUrl