d2coreui 21.0.11 → 21.0.12
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/components/color/colorPicker.d.ts +20 -0
- package/components/color/colorPicker.js +54 -0
- package/components/color/colorPicker.js.map +1 -0
- package/components/color/colorUtils.d.ts +2 -0
- package/components/color/colorUtils.js +29 -0
- package/components/color/colorUtils.js.map +1 -1
- package/components/date/dateRangeInput.d.ts +13 -1
- package/components/date/dateRangeInput.js +100 -9
- package/components/date/dateRangeInput.js.map +1 -1
- package/components/date/dateRangeInputAdvancedPanel.d.ts +26 -0
- package/components/date/dateRangeInputAdvancedPanel.js +116 -0
- package/components/date/dateRangeInputAdvancedPanel.js.map +1 -0
- package/components/date/dateRangeInputConfirm.d.ts +11 -1
- package/components/date/dateRangeInputConfirm.js +67 -27
- package/components/date/dateRangeInputConfirm.js.map +1 -1
- package/components/date/dateTimeInput.d.ts +2 -0
- package/components/date/dateTimeInput.js +5 -5
- package/components/date/dateTimeInput.js.map +1 -1
- package/components/grid/cell/simpleStatusTextCellEditor.d.ts +1 -0
- package/components/grid/cell/simpleStatusTextCellEditor.js +17 -10
- package/components/grid/cell/simpleStatusTextCellEditor.js.map +1 -1
- package/components/grid/config/rowStylePicker.d.ts +1 -5
- package/components/grid/config/rowStylePicker.js +14 -70
- package/components/grid/config/rowStylePicker.js.map +1 -1
- package/components/grid/dataGrid.d.ts +1 -1
- package/components/grid/dataGrid.js +101 -122
- package/components/grid/dataGrid.js.map +1 -1
- package/components/grid/extendedDataGrid.d.ts +2 -0
- package/components/grid/extendedDataGrid.js +6 -1
- package/components/grid/extendedDataGrid.js.map +1 -1
- package/components/input/maskedInput.d.ts +3 -3
- package/components/scrollTo/scrollTo.d.ts +1 -0
- package/components/scrollTo/scrollTo.js +13 -0
- package/components/scrollTo/scrollTo.js.map +1 -1
- package/i18n/components.sk.json +17 -0
- package/package.json +2 -2
- package/style/index.less +5 -0
|
@@ -30,6 +30,7 @@ import NoRecordsOverlay from "d2coreui/components/grid/panel/noRecordsOverlay";
|
|
|
30
30
|
import at from "lodash/at";
|
|
31
31
|
import ColumnTransfer from "d2coreui/components/grid/config/columnTransfer";
|
|
32
32
|
import cloneDeep from "lodash/cloneDeep";
|
|
33
|
+
import escape from "lodash/escape";
|
|
33
34
|
import { RangeSelector } from "d2coreui/components/grid/cell/rangeSelector";
|
|
34
35
|
import { WildcardQuickFilter } from "d2coreui/components/grid/cell/wildcardQuickFilter";
|
|
35
36
|
import { ColDefUtil } from "ag-grid-community";
|
|
@@ -141,8 +142,8 @@ export default class DataGrid extends React.Component {
|
|
|
141
142
|
this.wildcardQuickFilter = new WildcardQuickFilter();
|
|
142
143
|
this.columnTypes = {
|
|
143
144
|
"localizedArrayColumn": {
|
|
144
|
-
cellRenderer: (
|
|
145
|
-
const value = DataGrid.
|
|
145
|
+
cellRenderer: (params) => {
|
|
146
|
+
const value = DataGrid.getCellValue(params);
|
|
146
147
|
if (value) {
|
|
147
148
|
return value.map((s) => i18n(s)).join(",");
|
|
148
149
|
}
|
|
@@ -154,27 +155,23 @@ export default class DataGrid extends React.Component {
|
|
|
154
155
|
textCustomComparator: this.textCustomComparator
|
|
155
156
|
},
|
|
156
157
|
filterValueGetter: function (params) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return value.map((s) => i18n(s)).join(",");
|
|
161
|
-
}
|
|
158
|
+
const value = DataGrid.getCellValue(params);
|
|
159
|
+
if (value) {
|
|
160
|
+
return value.map((s) => i18n(s)).join(",");
|
|
162
161
|
}
|
|
163
162
|
return null;
|
|
164
163
|
},
|
|
165
164
|
getQuickFilterText: function (params) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return value.map((s) => i18n(s)).join(",");
|
|
170
|
-
}
|
|
165
|
+
const value = DataGrid.getCellValue(params);
|
|
166
|
+
if (value) {
|
|
167
|
+
return value.map((s) => i18n(s)).join(",");
|
|
171
168
|
}
|
|
172
169
|
return "";
|
|
173
170
|
}
|
|
174
171
|
},
|
|
175
172
|
"numberColumn": {
|
|
176
|
-
cellRenderer: (
|
|
177
|
-
const value = DataGrid.
|
|
173
|
+
cellRenderer: (params) => {
|
|
174
|
+
const value = DataGrid.getCellValue(params);
|
|
178
175
|
if (value || value === 0) {
|
|
179
176
|
return LocaleHolder.formatNumber(value);
|
|
180
177
|
}
|
|
@@ -186,33 +183,27 @@ export default class DataGrid extends React.Component {
|
|
|
186
183
|
textCustomComparator: this.textCustomComparator
|
|
187
184
|
},
|
|
188
185
|
filterValueGetter: function (params) {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return "";
|
|
196
|
-
}
|
|
186
|
+
const value = DataGrid.getCellValue(params);
|
|
187
|
+
if (value || value === 0) {
|
|
188
|
+
return LocaleHolder.formatNumber(value);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
return "";
|
|
197
192
|
}
|
|
198
|
-
return null;
|
|
199
193
|
},
|
|
200
194
|
getQuickFilterText: function (params) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return "";
|
|
208
|
-
}
|
|
195
|
+
const value = DataGrid.getCellValue(params);
|
|
196
|
+
if (value || value === 0) {
|
|
197
|
+
return LocaleHolder.formatNumber(value);
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
return "";
|
|
209
201
|
}
|
|
210
|
-
return "";
|
|
211
202
|
}
|
|
212
203
|
},
|
|
213
204
|
"dateColumn": {
|
|
214
|
-
cellRenderer: (
|
|
215
|
-
const value = DataGrid.
|
|
205
|
+
cellRenderer: (params) => {
|
|
206
|
+
const value = DataGrid.getCellValue(params);
|
|
216
207
|
if (value) {
|
|
217
208
|
if (value === D2000UnixTimeNullValue) {
|
|
218
209
|
return "---";
|
|
@@ -225,12 +216,10 @@ export default class DataGrid extends React.Component {
|
|
|
225
216
|
return "---";
|
|
226
217
|
}
|
|
227
218
|
},
|
|
228
|
-
valueFormatter: (
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
return unixTimeToMoment(value).format(LocaleHolder.getDateFormat(!this.props.hideYear));
|
|
233
|
-
}
|
|
219
|
+
valueFormatter: (params) => {
|
|
220
|
+
const value = DataGrid.getCellValue(params);
|
|
221
|
+
if (value) {
|
|
222
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateFormat(!this.props.hideYear));
|
|
234
223
|
}
|
|
235
224
|
return "---";
|
|
236
225
|
},
|
|
@@ -238,46 +227,39 @@ export default class DataGrid extends React.Component {
|
|
|
238
227
|
textCustomComparator: this.textCustomComparator
|
|
239
228
|
},
|
|
240
229
|
filterValueGetter: (params) => {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
return unixTimeToMoment(value).format(LocaleHolder.getDateFormat(!this.props.hideYear));
|
|
245
|
-
}
|
|
230
|
+
const value = DataGrid.getCellValue(params);
|
|
231
|
+
if (value) {
|
|
232
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateFormat(!this.props.hideYear));
|
|
246
233
|
}
|
|
247
234
|
return null;
|
|
248
235
|
},
|
|
249
236
|
getQuickFilterText: (params) => {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
return unixTimeToMoment(value).format(LocaleHolder.getDateFormat(!this.props.hideYear));
|
|
254
|
-
}
|
|
237
|
+
const value = DataGrid.getCellValue(params);
|
|
238
|
+
if (value) {
|
|
239
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateFormat(!this.props.hideYear));
|
|
255
240
|
}
|
|
256
241
|
return "";
|
|
257
242
|
}
|
|
258
243
|
},
|
|
259
244
|
"dateTimeColumn": {
|
|
260
|
-
cellRenderer: (
|
|
261
|
-
|
|
262
|
-
if (
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
if (value === D2000UnixTimeNullValue) {
|
|
266
|
-
return "---";
|
|
267
|
-
}
|
|
268
|
-
let tooltipValue;
|
|
269
|
-
tooltipValue = unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(true, true, true));
|
|
270
|
-
return `<span title="${tooltipValue}">${unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds))}</span>`;
|
|
245
|
+
cellRenderer: (params) => {
|
|
246
|
+
const value = DataGrid.getCellValue(params);
|
|
247
|
+
if (value) {
|
|
248
|
+
if (value === D2000UnixTimeNullValue) {
|
|
249
|
+
return "---";
|
|
271
250
|
}
|
|
251
|
+
let tooltipValue;
|
|
252
|
+
tooltipValue = unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(true, true, true));
|
|
253
|
+
return `<span title="${tooltipValue}">${unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds))}</span>`;
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
return "---";
|
|
272
257
|
}
|
|
273
|
-
return "---";
|
|
274
258
|
},
|
|
275
|
-
valueFormatter: (
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
280
|
-
}
|
|
259
|
+
valueFormatter: (params) => {
|
|
260
|
+
const value = DataGrid.getCellValue(params);
|
|
261
|
+
if (value) {
|
|
262
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
281
263
|
}
|
|
282
264
|
return "---";
|
|
283
265
|
},
|
|
@@ -285,27 +267,23 @@ export default class DataGrid extends React.Component {
|
|
|
285
267
|
textCustomComparator: this.textCustomComparator
|
|
286
268
|
},
|
|
287
269
|
filterValueGetter: (params) => {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
292
|
-
}
|
|
270
|
+
const value = DataGrid.getCellValue(params);
|
|
271
|
+
if (value) {
|
|
272
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
293
273
|
}
|
|
294
274
|
return null;
|
|
295
275
|
},
|
|
296
276
|
getQuickFilterText: (params) => {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
301
|
-
}
|
|
277
|
+
const value = DataGrid.getCellValue(params);
|
|
278
|
+
if (value) {
|
|
279
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
302
280
|
}
|
|
303
281
|
return "";
|
|
304
282
|
}
|
|
305
283
|
},
|
|
306
284
|
"fromNowDateTimeColumn": {
|
|
307
|
-
cellRenderer: (
|
|
308
|
-
const value = DataGrid.
|
|
285
|
+
cellRenderer: (params) => {
|
|
286
|
+
const value = DataGrid.getCellValue(params);
|
|
309
287
|
if (value) {
|
|
310
288
|
let tooltipValue;
|
|
311
289
|
tooltipValue = unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(true, true, true));
|
|
@@ -315,12 +293,10 @@ export default class DataGrid extends React.Component {
|
|
|
315
293
|
return "---";
|
|
316
294
|
}
|
|
317
295
|
},
|
|
318
|
-
valueFormatter: (
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
323
|
-
}
|
|
296
|
+
valueFormatter: (params) => {
|
|
297
|
+
const value = DataGrid.getCellValue(params);
|
|
298
|
+
if (value) {
|
|
299
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
324
300
|
}
|
|
325
301
|
return "---";
|
|
326
302
|
},
|
|
@@ -328,24 +304,41 @@ export default class DataGrid extends React.Component {
|
|
|
328
304
|
textCustomComparator: this.textCustomComparator
|
|
329
305
|
},
|
|
330
306
|
filterValueGetter: (params) => {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
335
|
-
}
|
|
307
|
+
const value = DataGrid.getCellValue(params);
|
|
308
|
+
if (value) {
|
|
309
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
336
310
|
}
|
|
337
311
|
return null;
|
|
338
312
|
},
|
|
339
313
|
getQuickFilterText: (params) => {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
344
|
-
}
|
|
314
|
+
const value = DataGrid.getCellValue(params);
|
|
315
|
+
if (value) {
|
|
316
|
+
return unixTimeToMoment(value).format(LocaleHolder.getDateTimeFormat(!this.props.hideYear, true, this.props.showMilliseconds));
|
|
345
317
|
}
|
|
346
318
|
return "";
|
|
347
319
|
}
|
|
348
320
|
},
|
|
321
|
+
"escapedValueColumn": {
|
|
322
|
+
cellRenderer: (params) => {
|
|
323
|
+
const value = DataGrid.getCellValue(params);
|
|
324
|
+
if (value) {
|
|
325
|
+
const text = typeof value === "string" ? escape(value.replace(/[\r\n]+/g, ' ')) : value;
|
|
326
|
+
return `<span style="white-space: pre" title="${text}">${text}</span>`;
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
return "";
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
valueFormatter: (params) => {
|
|
333
|
+
const value = DataGrid.getCellValue(params);
|
|
334
|
+
if (value) {
|
|
335
|
+
return typeof value === "string" ? value.replace(/[\r\n]+/g, ' ') : value;
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
return "";
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
},
|
|
349
342
|
"textColumnFilter": {
|
|
350
343
|
filter: "agTextColumnFilter",
|
|
351
344
|
floatingFilter: true,
|
|
@@ -384,33 +377,19 @@ export default class DataGrid extends React.Component {
|
|
|
384
377
|
"alignRight": {}
|
|
385
378
|
};
|
|
386
379
|
}
|
|
387
|
-
static
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
return props.colDef.valueGetter;
|
|
399
|
-
case "function":
|
|
400
|
-
try {
|
|
401
|
-
return props.colDef.valueGetter(props);
|
|
402
|
-
}
|
|
403
|
-
catch (e) {
|
|
404
|
-
if (props.colDef.field) {
|
|
405
|
-
return at(props.data, props.colDef.field)[0];
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
return "---";
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
default:
|
|
412
|
-
return "---";
|
|
380
|
+
static getCellValue(props) {
|
|
381
|
+
if (props) {
|
|
382
|
+
if (props.colDef.field && typeof props.getValue === "function") {
|
|
383
|
+
return props.getValue(props.colDef.field);
|
|
384
|
+
}
|
|
385
|
+
if (props.data && props.colDef && props.colDef.field) {
|
|
386
|
+
return at(props.data, props.colDef.field)[0];
|
|
387
|
+
}
|
|
388
|
+
if (props.value !== undefined) {
|
|
389
|
+
return props.value;
|
|
390
|
+
}
|
|
413
391
|
}
|
|
392
|
+
return undefined;
|
|
414
393
|
}
|
|
415
394
|
textCustomComparator(filter, value, filterText) {
|
|
416
395
|
const filterTextLowerCase = filterText.toLowerCase();
|