dtable-ui-component 6.0.124 → 6.0.125-vjs.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.
Files changed (39) hide show
  1. package/lib/AsyncUserSelect/index.css +51 -12
  2. package/lib/AsyncUserSelect/index.js +25 -14
  3. package/lib/DTableCustomizeCollaboratorSelect/index.js +20 -2
  4. package/lib/DTableCustomizeSearchInput/index.css +82 -0
  5. package/lib/DTableCustomizeSearchInput/index.js +141 -0
  6. package/lib/DTableCustomizeSelect/index.css +61 -43
  7. package/lib/DTableCustomizeSelect/index.js +18 -12
  8. package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +109 -0
  9. package/lib/DTableCustomizeSelect/select-option-group/index.css +128 -0
  10. package/lib/DTableCustomizeSelect/select-option-group/index.js +261 -0
  11. package/lib/DTableCustomizeSelect/select-option-group/option.js +48 -0
  12. package/lib/DTableCustomizeSelect/util.js +12 -0
  13. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +2 -2
  14. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +1 -1
  15. package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
  16. package/lib/DTableGroupSelect/index.css +33 -5
  17. package/lib/DTableGroupSelect/index.js +1 -1
  18. package/lib/DTableGroupSelect/select-option-group.css +11 -15
  19. package/lib/DTableGroupSelect/select-option-group.js +12 -9
  20. package/lib/DTableSelect/index.js +3 -3
  21. package/lib/DTableSelect/select-dropdown-indicator/index.css +16 -0
  22. package/lib/DTableSelect/select-dropdown-indicator/index.js +26 -0
  23. package/lib/DTableSelect/select-style.js +133 -0
  24. package/lib/DTableSelect/user-select.css +7 -46
  25. package/lib/DTableSelect/utils.js +126 -73
  26. package/lib/ImagePreviewerLightbox/index.js +2 -2
  27. package/lib/SelectOptionGroup/index.css +47 -22
  28. package/lib/SelectOptionGroup/index.js +47 -8
  29. package/lib/assets/icons/close.svg +1 -0
  30. package/lib/assets/icons/down.svg +3 -0
  31. package/lib/index.js +7 -0
  32. package/lib/locales/de.json +2 -2
  33. package/lib/locales/en.json +2 -2
  34. package/lib/locales/es.json +2 -2
  35. package/lib/locales/fr.json +2 -2
  36. package/lib/locales/pt.json +2 -2
  37. package/lib/locales/ru.json +2 -2
  38. package/lib/locales/zh-CN.json +2 -2
  39. package/package.json +1 -1
@@ -205,7 +205,7 @@
205
205
  .option-group-dtable-ui-collaborator-selector .option:hover,
206
206
  .option-group-dtable-ui-collaborator-selector .option.option-active {
207
207
  color: #212529;
208
- background-color: #f7f7f7;
208
+ background-color: #f5f5f5;
209
209
  }
210
210
 
211
211
  .dtable-ui-filters-list .dtable-ui-multiple-select-selector .option.option-active .select-option-name,
@@ -333,7 +333,7 @@
333
333
  display: inline-flex;
334
334
  align-items: center;
335
335
  height: 20px;
336
- margin-right: 10px;
336
+ margin-right: 4px;
337
337
  padding: 0 8px 0 2px;
338
338
  font-size: 13px;
339
339
  border-radius: 10px;
@@ -412,20 +412,20 @@
412
412
 
413
413
  .filter-header-icon {
414
414
  display: inline-block;
415
- padding: 0 0.3125rem;
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: #aaa;
422
+ color: #999;
423
423
  cursor: default;
424
424
  }
425
425
 
426
426
  .option.option-active .filter-header-icon .dtable-font,
427
427
  .option.option-active .filter-header-icon .multicolor-icon {
428
- color: #fff;
428
+ color: #999;
429
429
  }
430
430
 
431
431
  .dtable-ui-filters-list .single-select-option,
@@ -4,7 +4,7 @@
4
4
 
5
5
  .group-select.custom-select {
6
6
  display: flex;
7
- padding: 5px 10px;
7
+ padding: 7px 8px !important;
8
8
  border-radius: 3px;
9
9
  align-items: center;
10
10
  justify-content: space-between;
@@ -79,18 +79,46 @@
79
79
  }
80
80
 
81
81
  .group-select .selected-option-show .selected-option-item {
82
- background-color: rgb(240, 240, 240);
83
- border-radius: 16px;
82
+ background-color: #F7F7F5;
83
+ border-radius: 4px !important;
84
84
  display: flex;
85
85
  align-items: center;
86
+ height: 24px;
86
87
  }
87
88
 
88
89
  .group-select .selected-option-show .selected-option-item .selected-option-item-name {
89
- font-size: 13px;
90
+ font-size: 14px !important;
90
91
  color: #212529;
92
+ margin-left: 6px;
93
+ margin-right: 8px
91
94
  }
92
95
 
93
96
  .group-select .selected-option-show .selected-option-item .dtable-icon-x {
94
97
  cursor: pointer;
95
- color: rgb(103, 103, 103);
98
+ color: #666666;
99
+ font-size: 12px;
100
+ margin-right: 6px;
101
+ }
102
+
103
+ .seatable-group-select .option-group-search {
104
+ padding: 0 !important;
105
+ }
106
+
107
+ .seatable-group-select .form-control {
108
+ border: none;
109
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
110
+ border-radius: 4px 4px 0 0;
111
+ padding: .375rem 0 .375rem 1rem;
112
+ height: 32px;
113
+ }
114
+
115
+ .seatable-group-select .form-control:focus {
116
+ border-color: transparent !important;
117
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
118
+ box-shadow: none !important;
119
+ }
120
+
121
+ .option-group-content .dtable-icon-check {
122
+ color: var(--bs-icon-color);
123
+ font-size: 14px;
96
124
  }
@@ -86,7 +86,7 @@ class DTableGroupSelect extends _react.Component {
86
86
  children: [selectedOptions.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
87
87
  className: "selected-option-show",
88
88
  children: selectedOptions.map(item => /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
89
- className: "selected-option-item mr-1 pr-1 pl-2",
89
+ className: "selected-option-item",
90
90
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
91
91
  className: "selected-option-item-name",
92
92
  children: item.name
@@ -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-mark {
20
- font-size: 12px;
21
- color: #798d99;
20
+ .group-selector .option .dtable-icon-check{
21
+ font-size: 14px;
22
+ color: #666666;
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: #20a0ff;
26
- color: #fff;
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 _DTableSearchInput = _interopRequireDefault(require("../DTableSearchInput"));
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-mark"
155
+ className: "dtable-font dtable-icon-check"
156
156
  })]
157
157
  }, "".concat(option.id, "-").concat(index));
158
158
  });
@@ -207,23 +207,26 @@ class SelectOptionGroup extends _react.Component {
207
207
  style = {
208
208
  position: 'fixed',
209
209
  left: position.x,
210
- top: position.y + position.height,
210
+ top: position.y + position.height + 4,
211
211
  minWidth: position.width,
212
212
  opacity: 0
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: "option-group-search position-relative",
222
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
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
- ref: this.searchInputRef
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",
@@ -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: 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
- .user-select .select-module-container {
2
- display: flex;
3
- align-items: center;
1
+ /* hide checkbox in select value container */
2
+ .seatable-select-value-container .seatable-multicolor-icon-check {
3
+ display: none;
4
4
  }
5
5
 
6
- .user-select .select-module.select-module-avatar {
7
- height: 24px;
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
- .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);
10
+ .seatable-check-color {
11
+ color: var(--bs-icon-secondary-color);
51
12
  }