@seafile/sdoc-editor 1.0.17 → 1.0.18
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/dist/basic-sdk/comment/components/global-comment/index.js +0 -1
- package/dist/basic-sdk/extension/plugins/seatable-tables/formatter/index.js +17 -1
- package/dist/basic-sdk/extension/plugins/seatable-tables/helpers.js +15 -2
- package/dist/basic-sdk/extension/plugins/seatable-tables/model.js +7 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/op-menu/index.js +0 -1
- package/dist/basic-sdk/extension/plugins/seatable-tables/render-element/index.css +23 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/render-element/record-header.js +6 -3
- package/dist/basic-sdk/extension/plugins/seatable-tables/render-element/record-item.js +5 -1
- package/dist/basic-sdk/extension/plugins/seatable-tables/render-element/record-list.js +6 -3
- package/dist/basic-sdk/extension/plugins/seatable-tables/render-element/seatable-table.js +86 -10
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/common-add-tool/index.css +18 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/common-add-tool/index.js +24 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/dtable-search-input/index.js +131 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/calendar-filter/date-translate.js +56 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/calendar-filter/dayjs.js +4 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/calendar-filter/index.js +175 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/collaborator-filter/index.js +107 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/department-filter/_department-select.css +209 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/department-filter/_department-utils.js +39 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/department-filter/department-multiple-select-filter.js +89 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/department-filter/department-multiple-select.js +148 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/department-filter/department-single-select-filter.js +90 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/department-filter/department-single-select.js +275 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/department-filter/index.js +3 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/department-filter/selected-departments.js +84 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/department-filter/use-click-outside.js +22 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/filter-item-utils.js +144 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/filter-item.js +696 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/filters-list.css +321 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/filters-list.js +121 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/number-editor/index.js +161 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover-widgets/rate-item/index.js +73 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover.css +30 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filter-popover.js +200 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/filters-utils.js +456 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/index.css +0 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/index.js +81 -7
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/hide-column-setter/hide-column-item.js +54 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/hide-column-setter/hide-column-popover.js +203 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/hide-column-setter/index.css +105 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/hide-column-setter/index.js +89 -8
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/index.css +4 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/index.js +98 -26
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/sort-setter/index.css +83 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/sort-setter/index.js +67 -8
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/sort-setter/sort-popover.js +279 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/sort-setter/sort-utils.js +71 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/utils/utils.js +33 -0
- package/dist/basic-sdk/extension/plugins/table/menu/horizontal-align-popover/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/table/menu/table-context-menu/index.js +1 -2
- package/dist/basic-sdk/socket/socket-client.js +1 -1
- package/dist/pages/document-plugin-editor.js +3 -1
- package/package.json +2 -1
- package/public/locales/cs/sdoc-editor.json +40 -1
- package/public/locales/de/sdoc-editor.json +40 -1
- package/public/locales/en/sdoc-editor.json +40 -1
- package/public/locales/es/sdoc-editor.json +40 -1
- package/public/locales/es_AR/sdoc-editor.json +40 -1
- package/public/locales/es_MX/sdoc-editor.json +40 -1
- package/public/locales/fr/sdoc-editor.json +40 -1
- package/public/locales/it/sdoc-editor.json +40 -1
- package/public/locales/ru/sdoc-editor.json +40 -1
- package/public/locales/zh_CN/sdoc-editor.json +41 -2
- package/dist/basic-sdk/extension/plugins/seatable-tables/setting/index.css +0 -1
- package/dist/basic-sdk/extension/plugins/seatable-tables/setting/index.js +0 -6
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
.filters-list {
|
|
2
|
+
min-height: 120px;
|
|
3
|
+
max-height: 100%;
|
|
4
|
+
padding: 15px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.filters-list.empty-filters-container {
|
|
8
|
+
min-height: 80px;
|
|
9
|
+
padding: 16px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.filters-list.empty-filters-container .empty-filters-list {
|
|
13
|
+
padding-left: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.filters-list .empty-filters-list {
|
|
17
|
+
padding: 0.25rem;
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
opacity: 0.5;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.filters-list .filter-item {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
padding: 0.25rem 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.filters-list .filter-item .condition {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex: 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.filters-list .filter-item .condition > div {
|
|
34
|
+
height: 38px;
|
|
35
|
+
line-height: 38px;
|
|
36
|
+
margin-left: 0.5rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.filters-list .filter-item .condition > div:first-child {
|
|
40
|
+
margin-left: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.filters-list .filter-item .filter-term {
|
|
44
|
+
max-width: 300px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.filters-list .filter-item .filter-term .option-group-content .option.option-active .dtable-font {
|
|
48
|
+
color: #798d99;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.filters-list .filter-conjunction {
|
|
52
|
+
width: 72px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.filters-list .filter-conjunction-readonly {
|
|
56
|
+
width: 52px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.filters-list .filter-container {
|
|
60
|
+
width: calc(100% - 72px);
|
|
61
|
+
display: flex;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.filters-list .dtable-select .selected-option-show {
|
|
65
|
+
width: calc(100% - 20px);
|
|
66
|
+
height: 20px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.filters-list .dtable-select .selected-option {
|
|
70
|
+
width: auto;
|
|
71
|
+
overflow-x: auto;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.filters-list .dtable-select .dtable-icon-drop-down {
|
|
75
|
+
margin-left: 0.5rem;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.filters-list .selected-conjunction-show {
|
|
79
|
+
padding: 0 10px;
|
|
80
|
+
color: #999;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.filters-list .filter-column {
|
|
84
|
+
max-width: 150px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.filter-term .selector-multiple-select .option,
|
|
88
|
+
.filter-term .selector-single-select .option {
|
|
89
|
+
height: 30px;
|
|
90
|
+
padding: 0 10px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.filter-term .selector-multiple-select .select-option-name,
|
|
94
|
+
.filter-term .selector-single-select .select-option-name {
|
|
95
|
+
margin-top: 5px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.filter-term .selector-single-select .option:hover {
|
|
99
|
+
color: #212529;
|
|
100
|
+
background-color: #f7f7f7;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.filter-term .selector-single-select .option:hover .select-option-name,
|
|
104
|
+
.filter-term .selector-multiple-select .option:hover .select-option-name,
|
|
105
|
+
.filter-term .selector-collaborator .option:hover .select-option-name {
|
|
106
|
+
color: unset;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.filter-term .selector-collaborator .dtable-icon-drop-down {
|
|
110
|
+
padding-left: 5px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.filters-list .selector-collaborator .selected-option-show {
|
|
114
|
+
text-overflow: unset;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.filters-list .selector-multiple-select .option:hover,
|
|
118
|
+
.filters-list .selector-multiple-select .option.option-active,
|
|
119
|
+
.filters-list .selector-collaborator .option:hover,
|
|
120
|
+
.filters-list .selector-collaborator .option.option-active {
|
|
121
|
+
color: #212529;
|
|
122
|
+
background-color: #f7f7f7;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.filters-list .selector-multiple-select .option.option-active .select-option-name,
|
|
126
|
+
.filters-list .selector-collaborator .option.option-active .select-option-name {
|
|
127
|
+
color: #212529;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.filters-list .selected-option .multiple-select-option,
|
|
131
|
+
.filters-list .selected-option .single-select-option {
|
|
132
|
+
margin: 0;
|
|
133
|
+
display: inline-block;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.filters-list .filter-term input {
|
|
137
|
+
display: flex;
|
|
138
|
+
width: 100%;
|
|
139
|
+
height: 38px;
|
|
140
|
+
background-color: #ffffff;
|
|
141
|
+
padding-left: 8px;
|
|
142
|
+
padding-right: 8px;
|
|
143
|
+
outline: none;
|
|
144
|
+
border-radius: 3px;
|
|
145
|
+
font-size: 0.875rem;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.filters-list .filter-term input:hover {
|
|
149
|
+
border-color: rgb(179, 179, 179);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.filters-list .filter-term input.disabled:hover {
|
|
153
|
+
border-color: rgba(0, 40, 100, 0.12);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.filters-list .filter-term input:hover:focus {
|
|
157
|
+
border-color: #1991eb;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.filters-list .filter-term input:focus {
|
|
161
|
+
color: #495057;
|
|
162
|
+
background-color: #fff;
|
|
163
|
+
border-color: #1991eb;
|
|
164
|
+
outline: 0;
|
|
165
|
+
box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.filters-list .filter-term .date-picker-container input:focus {
|
|
169
|
+
color: #495057;
|
|
170
|
+
background-color: #fff;
|
|
171
|
+
border: 1px solid #fff;
|
|
172
|
+
outline: 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.filters-list .filter-term .date-picker-container table tr {
|
|
176
|
+
height: 30px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.filters-list .filter-term input[type='checkbox'] {
|
|
180
|
+
width: inherit;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.filters-list .filter-term input[type='checkbox']:focus {
|
|
184
|
+
border: 0;
|
|
185
|
+
box-shadow: none;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.filter-term .filter-rate-list {
|
|
189
|
+
display: flex;
|
|
190
|
+
padding: 0 5px;
|
|
191
|
+
border: 1px solid rgba(0, 40, 100, 0.12);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.filters-list .delete-filter {
|
|
195
|
+
width: 12px;
|
|
196
|
+
height: 20px;
|
|
197
|
+
margin-right: 14px;
|
|
198
|
+
text-align: center;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.filters-list .delete-filter:hover {
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.filters-list .delete-filter .dtable-icon-fork-number {
|
|
206
|
+
display: inline-block;
|
|
207
|
+
font-size: 12px;
|
|
208
|
+
color: #999;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.filters-list .multiple-option-name {
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.filters-list .multiple-check-icon,
|
|
217
|
+
.filters-list .collaborator-check-icon {
|
|
218
|
+
display: inline-flex;
|
|
219
|
+
width: 20px;
|
|
220
|
+
height: 20px;
|
|
221
|
+
align-items: center;
|
|
222
|
+
text-align: center;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.filters-list .multiple-check-icon .dtable-icon-check-mark,
|
|
226
|
+
.filters-list .collaborator-check-icon .dtable-icon-check-mark {
|
|
227
|
+
font-size: 12px;
|
|
228
|
+
color: #798d99;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.user-select-item,
|
|
232
|
+
.collaborator {
|
|
233
|
+
display: inline-flex;
|
|
234
|
+
align-items: center;
|
|
235
|
+
height: 20px;
|
|
236
|
+
margin-right: 10px;
|
|
237
|
+
padding: 0 8px 0 2px;
|
|
238
|
+
font-size: 13px;
|
|
239
|
+
border-radius: 10px;
|
|
240
|
+
background: #eaeaea;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.filters-list .collaborator-show {
|
|
244
|
+
flex: 1;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.filters-list .collaborator-avatar-container {
|
|
248
|
+
width: 16px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.filters-list .collaborator-avatar {
|
|
252
|
+
width: 16px;
|
|
253
|
+
height: 16px;
|
|
254
|
+
transform: translateY(-1px);
|
|
255
|
+
border-radius: 50%;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.filters-list .option .collaborator-avatar {
|
|
259
|
+
transform: translateY(-2px);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.filters-list .collaborator-name {
|
|
263
|
+
margin-left: 5px;
|
|
264
|
+
max-width: 200px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.filters-list .option-collaborator {
|
|
268
|
+
display: flex;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.filters-list .collaborator-container {
|
|
272
|
+
flex: 1;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.filters-list .popover-add-tool {
|
|
276
|
+
border-top: none;
|
|
277
|
+
color: #555555;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.filters-list .popover-add-tool .popover-add-icon {
|
|
281
|
+
margin-right: 14px;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.filters-list .option-group {
|
|
285
|
+
max-height: 360px;
|
|
286
|
+
overflow: auto;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.filters-list .filter-item .dtable-icon-fork-number:hover {
|
|
290
|
+
color: #555;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.filters-list .filter-container-readonly .dtable-select .selected-option-show,
|
|
294
|
+
.filters-list .filter-conjunction-readonly .dtable-select .selected-option-show {
|
|
295
|
+
width: 100%;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.filters-list .filter-checkbox-predicate .dtable-select .selected-option-show {
|
|
299
|
+
width: 100%;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.dropdown-item .collaborator,
|
|
303
|
+
.filters-list .option-group .option-group-content .collaborator {
|
|
304
|
+
background-color: unset;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.filters-list .dtable-select .selected-option-show .remove-container {
|
|
308
|
+
display: none;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.filter-header-icon {
|
|
312
|
+
display: inline-block;
|
|
313
|
+
padding: 0 0.3125rem;
|
|
314
|
+
margin-left: -0.3125rem;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.filter-header-icon .dtable-font {
|
|
318
|
+
font-size: 14px;
|
|
319
|
+
color: #aaa;
|
|
320
|
+
cursor: default;
|
|
321
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { CellType, FILTER_COLUMN_OPTIONS, FORMULA_COLUMN_TYPES_MAP, FORMULA_RESULT_TYPE, ValidateFilter } from 'dtable-utils';
|
|
5
|
+
import { getColumnByKey } from '../../utils/utils';
|
|
6
|
+
import FilterItemUtils from './filter-item-utils';
|
|
7
|
+
import FilterItem from './filter-item';
|
|
8
|
+
import './filters-list.css';
|
|
9
|
+
class FiltersList extends Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
_defineProperty(this, "updateFilter", (filterIndex, updatedFilter) => {
|
|
13
|
+
if (!updatedFilter) return;
|
|
14
|
+
this.props.updateFilter(filterIndex, updatedFilter);
|
|
15
|
+
});
|
|
16
|
+
_defineProperty(this, "deleteFilter", index => {
|
|
17
|
+
const {
|
|
18
|
+
scheduleUpdate
|
|
19
|
+
} = this.props;
|
|
20
|
+
this.props.deleteFilter(index, scheduleUpdate);
|
|
21
|
+
});
|
|
22
|
+
_defineProperty(this, "updateConjunction", filterConjunction => {
|
|
23
|
+
this.props.updateFilterConjunction(filterConjunction);
|
|
24
|
+
});
|
|
25
|
+
_defineProperty(this, "getConjunctionOptions", () => {
|
|
26
|
+
const {
|
|
27
|
+
t
|
|
28
|
+
} = this.props;
|
|
29
|
+
if (!this.conjunctionOptions) {
|
|
30
|
+
this.conjunctionOptions = FilterItemUtils.generatorConjunctionOptions(t);
|
|
31
|
+
}
|
|
32
|
+
return this.conjunctionOptions;
|
|
33
|
+
});
|
|
34
|
+
_defineProperty(this, "getFilterColumns", () => {
|
|
35
|
+
const {
|
|
36
|
+
columns
|
|
37
|
+
} = this.props;
|
|
38
|
+
return columns.filter(column => {
|
|
39
|
+
const {
|
|
40
|
+
data
|
|
41
|
+
} = column;
|
|
42
|
+
let {
|
|
43
|
+
type
|
|
44
|
+
} = column;
|
|
45
|
+
if (data && (type === CellType.LINK || FORMULA_COLUMN_TYPES_MAP[type] && data.result_type === FORMULA_RESULT_TYPE.ARRAY)) {
|
|
46
|
+
type = data.array_type;
|
|
47
|
+
}
|
|
48
|
+
return Object.prototype.hasOwnProperty.call(FILTER_COLUMN_OPTIONS, type);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
_defineProperty(this, "getColumnOptions", () => {
|
|
52
|
+
if (!this.columnOptions) {
|
|
53
|
+
const filterColumns = this.getFilterColumns();
|
|
54
|
+
this.columnOptions = filterColumns.map(column => {
|
|
55
|
+
return FilterItemUtils.generatorColumnOption(column);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return this.columnOptions;
|
|
59
|
+
});
|
|
60
|
+
_defineProperty(this, "renderFilterItem", (filter, index, errMsg, filterColumn) => {
|
|
61
|
+
const {
|
|
62
|
+
filterConjunction,
|
|
63
|
+
value
|
|
64
|
+
} = this.props;
|
|
65
|
+
const conjunctionOptions = this.getConjunctionOptions();
|
|
66
|
+
const columnOptions = this.getColumnOptions();
|
|
67
|
+
return /*#__PURE__*/React.createElement(FilterItem, {
|
|
68
|
+
key: index,
|
|
69
|
+
isLocked: this.props.isLocked,
|
|
70
|
+
index: index,
|
|
71
|
+
filter: filter,
|
|
72
|
+
errMsg: errMsg,
|
|
73
|
+
filterColumn: filterColumn,
|
|
74
|
+
filterConjunction: filterConjunction,
|
|
75
|
+
conjunctionOptions: conjunctionOptions,
|
|
76
|
+
filterColumnOptions: columnOptions,
|
|
77
|
+
value: value,
|
|
78
|
+
deleteFilter: this.deleteFilter,
|
|
79
|
+
updateFilter: this.updateFilter,
|
|
80
|
+
updateConjunction: this.updateConjunction,
|
|
81
|
+
collaborators: this.props.collaborators,
|
|
82
|
+
isPre: this.props.isPre
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
this.conjunctionOptions = null;
|
|
86
|
+
this.columnOptions = null;
|
|
87
|
+
}
|
|
88
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
89
|
+
if (nextProps.columns !== this.props.columns) {
|
|
90
|
+
this.columnOptions = null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
render() {
|
|
94
|
+
let {
|
|
95
|
+
filters,
|
|
96
|
+
className,
|
|
97
|
+
emptyPlaceholder,
|
|
98
|
+
columns
|
|
99
|
+
} = this.props;
|
|
100
|
+
const isEmpty = filters.length === 0;
|
|
101
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
className: classnames('filters-list', {
|
|
103
|
+
'empty-filters-container': isEmpty
|
|
104
|
+
}, {
|
|
105
|
+
[className]: className
|
|
106
|
+
})
|
|
107
|
+
}, isEmpty && /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
className: "empty-filters-list"
|
|
109
|
+
}, emptyPlaceholder), !isEmpty && filters.map((filter, index) => {
|
|
110
|
+
const {
|
|
111
|
+
column_key
|
|
112
|
+
} = filter;
|
|
113
|
+
const {
|
|
114
|
+
error_message
|
|
115
|
+
} = ValidateFilter.validateColumn(column_key, columns);
|
|
116
|
+
const filterColumn = getColumnByKey(column_key, columns) || {};
|
|
117
|
+
return this.renderFilterItem(filter, index, error_message, filterColumn);
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export default FiltersList;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom';
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
import { DEFAULT_NUMBER_FORMAT, getNumberDisplayString, replaceNumberNotAllowInput, formatStringToNumber } from 'dtable-utils';
|
|
6
|
+
import { isMac } from '../../../utils/utils';
|
|
7
|
+
class NumberEditor extends Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
_defineProperty(this, "getValue", () => {
|
|
11
|
+
const {
|
|
12
|
+
column
|
|
13
|
+
} = this.props;
|
|
14
|
+
const {
|
|
15
|
+
value
|
|
16
|
+
} = this.state;
|
|
17
|
+
return {
|
|
18
|
+
[column.key]: formatStringToNumber(value, column.data)
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
_defineProperty(this, "updateValue", (value, callback) => {
|
|
22
|
+
if (value === this.state.value) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
this.setState({
|
|
26
|
+
value
|
|
27
|
+
}, () => {
|
|
28
|
+
callback && callback();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
_defineProperty(this, "focusInput", () => {
|
|
32
|
+
this.input && this.input.focus();
|
|
33
|
+
});
|
|
34
|
+
_defineProperty(this, "blurInput", () => {
|
|
35
|
+
this.input && this.input.blur();
|
|
36
|
+
});
|
|
37
|
+
_defineProperty(this, "onBlur", () => {
|
|
38
|
+
const {
|
|
39
|
+
column
|
|
40
|
+
} = this.props;
|
|
41
|
+
const columnData = column.data;
|
|
42
|
+
const number = formatStringToNumber(this.getInputNode().value, columnData);
|
|
43
|
+
const formattedNumber = getNumberDisplayString(number, columnData) || '';
|
|
44
|
+
this.setState({
|
|
45
|
+
value: formattedNumber
|
|
46
|
+
}, () => {
|
|
47
|
+
this.props.onCommit();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
_defineProperty(this, "onPaste", e => {
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
});
|
|
53
|
+
_defineProperty(this, "onCut", e => {
|
|
54
|
+
e.stopPropagation();
|
|
55
|
+
});
|
|
56
|
+
_defineProperty(this, "onKeyDown", event => {
|
|
57
|
+
let {
|
|
58
|
+
selectionStart,
|
|
59
|
+
selectionEnd,
|
|
60
|
+
value
|
|
61
|
+
} = event.currentTarget;
|
|
62
|
+
// 13: enter
|
|
63
|
+
if (event.keyCode === 13) {
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
this.onBlur();
|
|
66
|
+
// 37: left arrow; 39: right arrow
|
|
67
|
+
} else if (event.keyCode === 37 && selectionStart === 0 || event.keyCode === 39 && selectionEnd === value.length) {
|
|
68
|
+
event.stopPropagation();
|
|
69
|
+
}
|
|
70
|
+
if (this.props.onKeyDown) {
|
|
71
|
+
this.props.onKeyDown(event);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
_defineProperty(this, "onChange", event => {
|
|
75
|
+
event.persist();
|
|
76
|
+
const {
|
|
77
|
+
data
|
|
78
|
+
} = this.props.column; // data maybe 'null'
|
|
79
|
+
const format = data && data.format ? data.format : DEFAULT_NUMBER_FORMAT;
|
|
80
|
+
let currency_symbol = null;
|
|
81
|
+
if (data && data.format === 'custom_currency') {
|
|
82
|
+
currency_symbol = data['currency_symbol'];
|
|
83
|
+
}
|
|
84
|
+
const initValue = event.target.value.trim();
|
|
85
|
+
|
|
86
|
+
// Prevent the repetition of periods bug in the Chinese input method of the Windows system
|
|
87
|
+
if (!isMac() && initValue.indexOf('.。') > -1) return;
|
|
88
|
+
const value = replaceNumberNotAllowInput(initValue, format, currency_symbol);
|
|
89
|
+
if (value === this.state.value) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.setState({
|
|
93
|
+
value
|
|
94
|
+
}, () => {
|
|
95
|
+
if (this.props.onChange) {
|
|
96
|
+
this.props.onChange(event);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
_defineProperty(this, "onClick", event => {
|
|
101
|
+
if (this.props.onInputClick) {
|
|
102
|
+
this.props.onInputClick(event);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
_defineProperty(this, "getInputNode", () => {
|
|
106
|
+
const domNode = ReactDOM.findDOMNode(this.input);
|
|
107
|
+
if (domNode.tagName === 'INPUT') {
|
|
108
|
+
return domNode;
|
|
109
|
+
}
|
|
110
|
+
return domNode.querySelector('input:not([type=hidden])');
|
|
111
|
+
});
|
|
112
|
+
_defineProperty(this, "setInputRef", input => {
|
|
113
|
+
this.input = input;
|
|
114
|
+
return this.input;
|
|
115
|
+
});
|
|
116
|
+
const {
|
|
117
|
+
value: _value,
|
|
118
|
+
column: _column
|
|
119
|
+
} = props;
|
|
120
|
+
const {
|
|
121
|
+
data: _data = {}
|
|
122
|
+
} = _column;
|
|
123
|
+
this.state = {
|
|
124
|
+
value: getNumberDisplayString(_value, _data) || ''
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
128
|
+
if (this.props.value !== nextProps.value) {
|
|
129
|
+
const {
|
|
130
|
+
column
|
|
131
|
+
} = nextProps;
|
|
132
|
+
const {
|
|
133
|
+
data = {}
|
|
134
|
+
} = column;
|
|
135
|
+
const newValue = getNumberDisplayString(nextProps.value, data) || '';
|
|
136
|
+
this.setState({
|
|
137
|
+
value: newValue
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
render() {
|
|
142
|
+
const {
|
|
143
|
+
readOnly,
|
|
144
|
+
extraClassName
|
|
145
|
+
} = this.props;
|
|
146
|
+
return /*#__PURE__*/React.createElement("input", {
|
|
147
|
+
ref: this.setInputRef,
|
|
148
|
+
type: "text",
|
|
149
|
+
className: classnames('form-control number-editor', extraClassName),
|
|
150
|
+
disabled: readOnly,
|
|
151
|
+
value: this.state.value || '',
|
|
152
|
+
onBlur: this.onBlur,
|
|
153
|
+
onPaste: this.onPaste,
|
|
154
|
+
onCut: this.onCut,
|
|
155
|
+
onKeyDown: this.onKeyDown,
|
|
156
|
+
onChange: this.onChange,
|
|
157
|
+
onClick: this.onClick
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
export default NumberEditor;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { UncontrolledTooltip } from 'reactstrap';
|
|
5
|
+
class RateItem extends React.Component {
|
|
6
|
+
constructor(props) {
|
|
7
|
+
super(props);
|
|
8
|
+
_defineProperty(this, "onMouseEnterRateItem", () => {
|
|
9
|
+
const {
|
|
10
|
+
rateItemIndex
|
|
11
|
+
} = this.props;
|
|
12
|
+
this.props.onMouseEnterRateItem(rateItemIndex);
|
|
13
|
+
});
|
|
14
|
+
_defineProperty(this, "onMouseLeaveRateItem", () => {
|
|
15
|
+
this.props.onMouseLeaveRateItem();
|
|
16
|
+
});
|
|
17
|
+
_defineProperty(this, "onChangeRateNumber", () => {
|
|
18
|
+
const {
|
|
19
|
+
onChangeRateNumber,
|
|
20
|
+
rateItemIndex,
|
|
21
|
+
editable
|
|
22
|
+
} = this.props;
|
|
23
|
+
if (onChangeRateNumber && editable) {
|
|
24
|
+
onChangeRateNumber(rateItemIndex);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
this.tooltipRef = React.createRef();
|
|
28
|
+
this.state = {
|
|
29
|
+
isOpen: false
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const {
|
|
34
|
+
enterRateItemIndex,
|
|
35
|
+
rateItemIndex,
|
|
36
|
+
value,
|
|
37
|
+
column,
|
|
38
|
+
isShowRateItem,
|
|
39
|
+
editable
|
|
40
|
+
} = this.props;
|
|
41
|
+
const {
|
|
42
|
+
rate_style_color,
|
|
43
|
+
rate_style_type
|
|
44
|
+
} = column.data || {};
|
|
45
|
+
const rateShowType = rate_style_type ? rate_style_type : 'dtable-icon-rate';
|
|
46
|
+
if (!isShowRateItem && rateItemIndex > value) return null;
|
|
47
|
+
let itemStyle = {
|
|
48
|
+
cursor: editable ? 'pointer' : 'default',
|
|
49
|
+
color: value >= rateItemIndex ? rate_style_color : '#e5e5e5'
|
|
50
|
+
};
|
|
51
|
+
let style = itemStyle;
|
|
52
|
+
if (enterRateItemIndex >= rateItemIndex) {
|
|
53
|
+
style = _objectSpread(_objectSpread({}, itemStyle), {}, {
|
|
54
|
+
color: rate_style_color,
|
|
55
|
+
opacity: 0.4
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
onMouseEnter: this.onMouseEnterRateItem,
|
|
60
|
+
onMouseLeave: this.onMouseLeaveRateItem,
|
|
61
|
+
style: style,
|
|
62
|
+
onClick: this.onChangeRateNumber,
|
|
63
|
+
className: "rate-item ".concat(value >= rateItemIndex ? 'rate-item-active' : '')
|
|
64
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
65
|
+
className: "dtable-font ".concat(rateShowType),
|
|
66
|
+
ref: this.tooltipRef
|
|
67
|
+
}), editable && /*#__PURE__*/React.createElement(UncontrolledTooltip, {
|
|
68
|
+
placement: "bottom",
|
|
69
|
+
target: this.tooltipRef
|
|
70
|
+
}, rateItemIndex));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export default RateItem;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.filter-popover .popover {
|
|
2
|
+
max-width: none;
|
|
3
|
+
min-width: 300px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.filter-popover .popover-add-tool {
|
|
7
|
+
border-top: none;
|
|
8
|
+
color: #555555;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.filter-popover .popover-add-tool.disabled {
|
|
12
|
+
color: #c2c2c2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.filter-popover .popover-add-tool.disabled:hover {
|
|
16
|
+
cursor: not-allowed;
|
|
17
|
+
background: #fff;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.filter-popover .popover-add-tool .popover-add-icon {
|
|
21
|
+
margin-right: 14px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.filter-popover .filter-popover-footer {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: flex-end;
|
|
28
|
+
padding: 1rem;
|
|
29
|
+
border-top: 1px solid #e9ecef;
|
|
30
|
+
}
|