dtable-ui-component 6.0.124 → 6.0.125-vjs.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.
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 +74 -11
  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
@@ -6,7 +6,7 @@
6
6
  min-height: 60px;
7
7
  min-width: 100%;
8
8
  max-width: 15rem;
9
- padding: 0.5rem 0;
9
+ padding-top: 0;
10
10
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
11
11
  background: #fff;
12
12
  border: 1px solid rgba(0, 40, 100, 0.12);
@@ -17,17 +17,23 @@
17
17
  .option-group .option-group-search {
18
18
  width: 100%;
19
19
  min-width: 170px;
20
- padding: 0 10px 6px;
20
+ }
21
+
22
+ .option-group .option-group-content .label-space {
23
+ display: flex;
24
+ justify-content: space-between;
25
+ align-items: center;
26
+ width: 100%;
21
27
  }
22
28
 
23
29
  .option-group-search .form-control {
24
- height: 31px;
30
+ height: 32px;
31
+ border-radius: 4px;
25
32
  }
26
33
 
27
34
  .option-group .none-search-result {
28
35
  height: 100px;
29
36
  width: 100%;
30
- padding: 10px;
31
37
  color: #666666;
32
38
  }
33
39
 
@@ -35,13 +41,18 @@
35
41
  flex: 1;
36
42
  max-height: 252px;
37
43
  overflow-y: auto;
44
+ padding: 8px;
45
+ }
46
+
47
+ .option-group .option-group-top {
48
+ padding-top: 8px !important;
38
49
  }
39
50
 
40
51
  .option {
41
52
  display: block;
42
53
  width: 100%;
43
54
  line-height: 24px;
44
- padding: 0.25rem 10px;
55
+ padding: 0.25rem 8px;
45
56
  clear: both;
46
57
  font-weight: 400;
47
58
  text-align: inherit;
@@ -50,34 +61,40 @@
50
61
  overflow: hidden;
51
62
  text-overflow: ellipsis;
52
63
  white-space: nowrap;
64
+ border-radius: 4px;
53
65
  }
54
66
 
55
- .option.option-active {
56
- background-color: #20a0ff;
57
- color: #fff;
58
- cursor: pointer;
67
+ .option-group .option-group-search .form-control {
68
+ border: none;
69
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
70
+ border-radius: 4px 4px 0 0;
71
+ padding: .375rem 0 .375rem 1rem;
72
+ height: 32px;
59
73
  }
60
74
 
61
- .option:hover .header-icon .dtable-font,
62
- .option:hover .header-icon .multicolor-icon,
63
- .option.option-active .select-option-name {
64
- color: #fff;
75
+ .option-group .option-group-search .form-control:focus {
76
+ border-color: transparent !important;
77
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
78
+ box-shadow: none !important;
65
79
  }
66
80
 
67
- .option.option-active .header-icon .dtable-font,
68
- .option.option-active .header-icon .multicolor-icon {
69
- color: #fff;
81
+
82
+ .option-group-content .label-check-icon {
83
+ margin-left: 16px;
70
84
  }
71
85
 
72
- .option:not(.option-active):hover .header-icon .dtable-font,
73
- .option:not(.option-active):hover .header-icon .multicolor-icon {
74
- color: #aaa;
86
+ .option-group-content .dtable-icon-check {
87
+ font-size: 14px !important;
88
+ color: var(--bs-icon-color);
75
89
  }
76
90
 
77
- .option .select-option-name .single-select-option {
78
- margin: 0 0 0 12px;
91
+ .option.option-active {
92
+ background-color: #f5f5f5;
93
+ color: #212529;
94
+ cursor: pointer;
79
95
  }
80
96
 
97
+
81
98
  .option .select-option-name .multiple-select-option {
82
99
  margin: 0;
83
100
  }
@@ -97,7 +114,7 @@
97
114
 
98
115
  .option-group-dtable-ui-multiple-select-selector .multiple-check-icon .dtable-icon-check-mark {
99
116
  font-size: 12px;
100
- color: #798d99;
117
+ color: #666666;
101
118
  }
102
119
 
103
120
  .option-group-dtable-ui-single-select-selector .option:hover,
@@ -111,3 +128,11 @@
111
128
  .option-group-selector-multiple-select .option.option-active .select-option-name {
112
129
  color: #212529;
113
130
  }
131
+
132
+ .option-group-selector-single-select .option .select-option-name .single-select-option {
133
+ margin: 0;
134
+ }
135
+
136
+ .option-group-selector-single-select .form-control {
137
+ padding: .375rem .5rem !important;
138
+ }
@@ -132,10 +132,17 @@ class SelectOptionGroup extends _react.Component {
132
132
  });
133
133
  }
134
134
  };
135
+ this.isEqual = (obj1, obj2) => {
136
+ if (obj1 === obj2) return true;
137
+ if (!obj1 || !obj2) return false;
138
+ return JSON.stringify(obj1) === JSON.stringify(obj2);
139
+ };
135
140
  this.renderOptGroup = searchVal => {
136
141
  let {
137
142
  noOptionsPlaceholder,
138
- onSelectOption
143
+ onSelectOption,
144
+ value,
145
+ supportMultipleSelect
139
146
  } = this.props;
140
147
  this.filterOptions = this.props.getFilterOptions(searchVal);
141
148
  if (this.filterOptions.length === 0) {
@@ -147,6 +154,7 @@ class SelectOptionGroup extends _react.Component {
147
154
  return this.filterOptions.map((opt, i) => {
148
155
  let key = opt.value.column ? opt.value.column.key : i;
149
156
  let isActive = this.state.activeIndex === i;
157
+ let isSelected = value && typeof value === 'object' && !supportMultipleSelect ? this.isEqual(value.value, opt.value) : Array.isArray(value.value) ? value.value.includes(opt.value.column_key) : false;
150
158
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
151
159
  index: i,
152
160
  isActive: isActive,
@@ -155,10 +163,26 @@ class SelectOptionGroup extends _react.Component {
155
163
  changeIndex: this.changeIndex,
156
164
  supportMultipleSelect: this.props.supportMultipleSelect,
157
165
  disableHover: this.state.disableHover,
158
- children: opt.label
166
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
167
+ className: "label-space",
168
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
169
+ children: [" ", opt.label]
170
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
171
+ className: "label-check-icon",
172
+ children: [" ", isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
173
+ className: "dtable-font dtable-icon-check"
174
+ })]
175
+ })]
176
+ })
159
177
  }, "".concat(key, "-").concat(i));
160
178
  });
161
179
  };
180
+ this.clearValue = () => {
181
+ this.setState({
182
+ searchVal: '',
183
+ activeIndex: -1
184
+ });
185
+ };
162
186
  this.state = {
163
187
  searchVal: '',
164
188
  activeIndex: -1,
@@ -192,7 +216,8 @@ class SelectOptionGroup extends _react.Component {
192
216
  position,
193
217
  className,
194
218
  addOptionAble,
195
- component
219
+ component,
220
+ supportMultipleSelect
196
221
  } = this.props;
197
222
  const {
198
223
  AddOption
@@ -215,7 +240,7 @@ class SelectOptionGroup extends _react.Component {
215
240
  style = {
216
241
  position: 'fixed',
217
242
  left: position.x,
218
- top: position.y + position.height,
243
+ top: "".concat(position.y + position.height + 4, "px"),
219
244
  minWidth: position.width,
220
245
  opacity: 0
221
246
  };
@@ -232,20 +257,34 @@ class SelectOptionGroup extends _react.Component {
232
257
  style: style,
233
258
  onMouseDown: this.onMouseDown,
234
259
  children: [isShowSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
235
- className: "editor-list-delete mb-2",
260
+ className: "editor-list-delete",
236
261
  onClick: e => e.stopPropagation(),
237
262
  children: value.label || ''
238
- }), searchable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
263
+ }), searchable && this.props.options && this.props.options.length > 10 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
239
264
  className: "option-group-search",
240
265
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
241
266
  className: "option-search-control",
242
267
  placeholder: searchPlaceholder,
243
268
  onChange: this.onChangeSearch,
244
269
  autoFocus: true,
245
- ref: this.searchInputRef
270
+ ref: this.searchInputRef,
271
+ clearValue: this.clearValue,
272
+ isClearable: true,
273
+ components: {
274
+ ClearIndicator: props => {
275
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
276
+ className: (0, _classnames.default)('select-search-text-clear input-icon-addon seatable-icon dtable-font dtable-icon-x'),
277
+ onClick: e => {
278
+ e.stopPropagation();
279
+ e.nativeEvent.stopImmediatePropagation();
280
+ props.clearValue();
281
+ }
282
+ });
283
+ }
284
+ }
246
285
  })
247
286
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
248
- className: "option-group-content",
287
+ className: "option-group-content ".concat(!searchable && !supportMultipleSelect ? 'option-group-top' : ''),
249
288
  ref: ref => this.optionGroupContentRef = ref,
250
289
  children: this.renderOptGroup(searchVal)
251
290
  }), addOptionAble && AddOption]
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1718937171668" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18368" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M489.6 444.8l294.4-294.4 67.2 67.2-294.4 294.4 294.4 294.4-67.2 67.2-294.4-294.4-272 272-67.2-67.2 272-272-272-272 67.2-67.2z" p-id="18369" fill="currentColor"></path></svg>
@@ -0,0 +1,3 @@
1
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M3.27148 11.2718L6.09991 8.44336L15.9994 18.3429L25.8989 8.44336L28.7273 11.2718L15.9994 23.9997L3.27148 11.2718Z" fill="currentColor"/>
3
+ </svg>
package/lib/index.js CHANGED
@@ -124,6 +124,12 @@ Object.defineProperty(exports, "DTableCustomizeCollaboratorSelect", {
124
124
  return _DTableCustomizeCollaboratorSelect.default;
125
125
  }
126
126
  });
127
+ Object.defineProperty(exports, "DTableCustomizeSearchInput", {
128
+ enumerable: true,
129
+ get: function () {
130
+ return _DTableCustomizeSearchInput.default;
131
+ }
132
+ });
127
133
  Object.defineProperty(exports, "DTableCustomizeSelect", {
128
134
  enumerable: true,
129
135
  get: function () {
@@ -724,6 +730,7 @@ var _DTableSwitch = _interopRequireDefault(require("./DTableSwitch"));
724
730
  var _DTableCustomizeSelect = _interopRequireDefault(require("./DTableCustomizeSelect"));
725
731
  var _DTableCustomizeCollaboratorSelect = _interopRequireDefault(require("./DTableCustomizeCollaboratorSelect"));
726
732
  var _DTableSearchInput = _interopRequireDefault(require("./DTableSearchInput"));
733
+ var _DTableCustomizeSearchInput = _interopRequireDefault(require("./DTableCustomizeSearchInput"));
727
734
  var _DTableColorPicker = _interopRequireDefault(require("./DTableColorPicker"));
728
735
  var _ModalPortal = _interopRequireDefault(require("./ModalPortal"));
729
736
  var _RoleStatusEditor = _interopRequireDefault(require("./RoleStatusEditor"));
@@ -12,8 +12,8 @@
12
12
  "Rotate_image": "Rotate image",
13
13
  "Delete_image": "delete image",
14
14
  "Download_image": "Download image",
15
- "Pre_Line": "previous Line",
16
- "Next_Line": "next Line",
15
+ "Previous_record": "Vorheriger Eintrag",
16
+ "Next_record": "Nächster Eintrag",
17
17
  "Zoom_in": "Zoom in",
18
18
  "Zoom_out": "Zoom out",
19
19
  "Choose_a_collaborator": "Wählen Sie einen Mitarbeiter",
@@ -12,8 +12,8 @@
12
12
  "Rotate_image": "Rotate image",
13
13
  "Delete_image": "delete image",
14
14
  "Download_image": "Download image",
15
- "Pre_Line": "previous Line",
16
- "Next_Line": "next Line",
15
+ "Previous_record": "Previous record",
16
+ "Next_record": "Next record",
17
17
  "Zoom_in": "Zoom in",
18
18
  "Zoom_out": "Zoom out",
19
19
  "Choose_a_collaborator": "Choose a collaborator",
@@ -12,8 +12,8 @@
12
12
  "Rotate_image": "Rotate image",
13
13
  "Delete_image": "delete image",
14
14
  "Download_image": "Download image",
15
- "Pre_Line": "previous Line",
16
- "Next_Line": "next Line",
15
+ "Previous_record": "Registro previo",
16
+ "Next_record": "Próximo registro",
17
17
  "Zoom_in": "Zoom in",
18
18
  "Zoom_out": "Zoom out",
19
19
  "Choose_a_collaborator": "Choose a collaborator",
@@ -12,8 +12,8 @@
12
12
  "Rotate_image": "Rotate image",
13
13
  "Delete_image": "delete image",
14
14
  "Download_image": "Download image",
15
- "Pre_Line": "previous Line",
16
- "Next_Line": "next Line",
15
+ "Previous_record": "Enregistrement précédent",
16
+ "Next_record": "Enregistrement suivant",
17
17
  "Zoom_in": "Zoom in",
18
18
  "Zoom_out": "Zoom out",
19
19
  "Choose_a_collaborator": "Choisissez un collaborateur",
@@ -12,8 +12,8 @@
12
12
  "Rotate_image": "Rotate image",
13
13
  "Delete_image": "delete image",
14
14
  "Download_image": "Download image",
15
- "Pre_Line": "previous Line",
16
- "Next_Line": "next Line",
15
+ "Previous_record": "Registro anterior",
16
+ "Next_record": "Próximo registro",
17
17
  "Zoom_in": "Zoom in",
18
18
  "Zoom_out": "Zoom out",
19
19
  "Choose_a_collaborator": "Choose a collaborator",
@@ -12,8 +12,8 @@
12
12
  "Rotate_image": "Rotate image",
13
13
  "Delete_image": "delete image",
14
14
  "Download_image": "Download image",
15
- "Pre_Line": "previous Line",
16
- "Next_Line": "next Line",
15
+ "Previous_record": "Предыдущая запись",
16
+ "Next_record": "Следующая запись",
17
17
  "Zoom_in": "Zoom in",
18
18
  "Zoom_out": "Zoom out",
19
19
  "Choose_a_collaborator": "Choose a collaborator",
@@ -12,8 +12,8 @@
12
12
  "Rotate_image": "旋转",
13
13
  "Delete_image": "删除",
14
14
  "Download_image": "下载",
15
- "Pre_Line": "上一行",
16
- "Next_Line": "下一行",
15
+ "Previous_record": "前一行",
16
+ "Next_record": "后一行",
17
17
  "Zoom_in": "放大",
18
18
  "Zoom_out": "缩小",
19
19
  "Choose_a_collaborator": "选择一个协作人",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.124",
3
+ "version": "6.0.125vjs.2",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "5.0.9",