@adaptabletools/adaptable-cjs 20.0.0-canary.15 → 20.0.0-canary.17
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/package.json +2 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +32 -32
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +5 -6
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +9 -10
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +27 -27
- package/src/Utilities/Helpers/DateHelper.js +3 -5
- package/src/Utilities/Helpers/FormatHelper.js +2 -3
- package/src/View/Comments/CommentsEditor.js +5 -2
- package/src/View/Comments/CommentsPopup.js +5 -2
- package/src/View/Components/ColumnFilter/utils.js +1 -1
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +2 -2
- package/src/View/Note/NotePopup.js +5 -2
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
- package/src/agGrid/AdaptableAgGrid.js +22 -0
- package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +2 -2
- package/src/components/Datepicker/DatepickerContext.d.ts +1 -0
- package/src/components/Datepicker/index.d.ts +1 -0
- package/src/components/Select/Select.js +3 -3
- package/src/env.js +2 -2
- package/src/migration/VersionUpgrade20.d.ts +2 -0
- package/src/migration/VersionUpgrade20.js +36 -12
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "20.0.0-canary.
|
|
3
|
+
"version": "20.0.0-canary.17",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@finos/fdc3": "2.1.0",
|
|
42
42
|
"@infinite-table/infinite-react": "6.2.5",
|
|
43
|
-
"date-fns": "^
|
|
43
|
+
"date-fns": "^4.1.0",
|
|
44
44
|
"lodash": "^4.17.15",
|
|
45
45
|
"normalize.css": "^8.0.1",
|
|
46
46
|
"prop-types": "^15.6.2",
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SystemBadgeStylePredicateIds = exports.SystemFlashingCellPredicateIds = exports.SystemFormatColumnPredicateIds = exports.SystemAlertPredicateIds = exports.SystemFilterPredicateIds = exports.SystemPredicateDefs = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
5
|
+
const date_fns_1 = require("date-fns");
|
|
6
|
+
const date_fns_2 = require("date-fns");
|
|
7
|
+
const date_fns_3 = require("date-fns");
|
|
8
|
+
const date_fns_4 = require("date-fns");
|
|
9
|
+
const date_fns_5 = require("date-fns");
|
|
10
|
+
const date_fns_6 = require("date-fns");
|
|
11
|
+
const date_fns_7 = require("date-fns");
|
|
12
|
+
const date_fns_8 = require("date-fns");
|
|
13
|
+
const date_fns_9 = require("date-fns");
|
|
14
|
+
const date_fns_10 = require("date-fns");
|
|
15
|
+
const date_fns_11 = require("date-fns");
|
|
16
|
+
const date_fns_12 = require("date-fns");
|
|
17
|
+
const date_fns_13 = require("date-fns");
|
|
18
18
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
19
19
|
const DateHelper_1 = require("../../Utilities/Helpers/DateHelper");
|
|
20
20
|
const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
|
|
@@ -56,10 +56,10 @@ exports.SystemPredicateDefs = [
|
|
|
56
56
|
if (column.dataType === 'date') {
|
|
57
57
|
return inputs.some((input) => {
|
|
58
58
|
if (adaptableApi.optionsApi.getPredicateOptions().evaluateValuesPredicateUsingTime) {
|
|
59
|
-
return (0,
|
|
59
|
+
return (0, date_fns_3.isEqual)(input, value);
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
|
-
return (0,
|
|
62
|
+
return (0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(input), (0, DateHelper_1.parseDateValue)(value));
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -116,12 +116,12 @@ exports.SystemPredicateDefs = [
|
|
|
116
116
|
if (column.dataType === 'date') {
|
|
117
117
|
if (adaptableApi.optionsApi.getPredicateOptions().evaluateValuesPredicateUsingTime) {
|
|
118
118
|
return inputs.every((input) => {
|
|
119
|
-
return !(0,
|
|
119
|
+
return !(0, date_fns_3.isEqual)(input, value);
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
123
|
return inputs.every((input) => {
|
|
124
|
-
return !(0,
|
|
124
|
+
return !(0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(input), (0, DateHelper_1.parseDateValue)(value));
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
}
|
|
@@ -398,7 +398,7 @@ exports.SystemPredicateDefs = [
|
|
|
398
398
|
icon: { name: 'calendar' },
|
|
399
399
|
columnScope: { DataTypes: ['date'] },
|
|
400
400
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
401
|
-
handler: ({ value }) => (0,
|
|
401
|
+
handler: ({ value }) => (0, date_fns_11.isToday)((0, DateHelper_1.parseDateValue)(value)),
|
|
402
402
|
},
|
|
403
403
|
{
|
|
404
404
|
id: 'Yesterday',
|
|
@@ -406,7 +406,7 @@ exports.SystemPredicateDefs = [
|
|
|
406
406
|
icon: { name: 'calendar' },
|
|
407
407
|
columnScope: { DataTypes: ['date'] },
|
|
408
408
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
409
|
-
handler: ({ value }) => (0,
|
|
409
|
+
handler: ({ value }) => (0, date_fns_13.isYesterday)((0, DateHelper_1.parseDateValue)(value)),
|
|
410
410
|
},
|
|
411
411
|
{
|
|
412
412
|
id: 'Tomorrow',
|
|
@@ -414,7 +414,7 @@ exports.SystemPredicateDefs = [
|
|
|
414
414
|
icon: { name: 'calendar' },
|
|
415
415
|
columnScope: { DataTypes: ['date'] },
|
|
416
416
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
417
|
-
handler: ({ value }) => (0,
|
|
417
|
+
handler: ({ value }) => (0, date_fns_12.isTomorrow)((0, DateHelper_1.parseDateValue)(value)),
|
|
418
418
|
},
|
|
419
419
|
{
|
|
420
420
|
id: 'ThisWeek',
|
|
@@ -422,7 +422,7 @@ exports.SystemPredicateDefs = [
|
|
|
422
422
|
icon: { name: 'calendar' },
|
|
423
423
|
columnScope: { DataTypes: ['date'] },
|
|
424
424
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
425
|
-
handler: ({ value }) => (0,
|
|
425
|
+
handler: ({ value }) => (0, date_fns_9.isThisWeek)((0, DateHelper_1.parseDateValue)(value)),
|
|
426
426
|
},
|
|
427
427
|
{
|
|
428
428
|
id: 'ThisMonth',
|
|
@@ -430,7 +430,7 @@ exports.SystemPredicateDefs = [
|
|
|
430
430
|
icon: { name: 'calendar' },
|
|
431
431
|
columnScope: { DataTypes: ['date'] },
|
|
432
432
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
433
|
-
handler: ({ value }) => (0,
|
|
433
|
+
handler: ({ value }) => (0, date_fns_7.isThisMonth)((0, DateHelper_1.parseDateValue)(value)),
|
|
434
434
|
},
|
|
435
435
|
{
|
|
436
436
|
id: 'ThisQuarter',
|
|
@@ -438,7 +438,7 @@ exports.SystemPredicateDefs = [
|
|
|
438
438
|
icon: { name: 'calendar' },
|
|
439
439
|
columnScope: { DataTypes: ['date'] },
|
|
440
440
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
441
|
-
handler: ({ value }) => (0,
|
|
441
|
+
handler: ({ value }) => (0, date_fns_8.isThisQuarter)((0, DateHelper_1.parseDateValue)(value)),
|
|
442
442
|
},
|
|
443
443
|
{
|
|
444
444
|
id: 'ThisYear',
|
|
@@ -446,7 +446,7 @@ exports.SystemPredicateDefs = [
|
|
|
446
446
|
icon: { name: 'calendar' },
|
|
447
447
|
columnScope: { DataTypes: ['date'] },
|
|
448
448
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
449
|
-
handler: ({ value }) => (0,
|
|
449
|
+
handler: ({ value }) => (0, date_fns_10.isThisYear)((0, DateHelper_1.parseDateValue)(value)),
|
|
450
450
|
},
|
|
451
451
|
{
|
|
452
452
|
id: 'InPast',
|
|
@@ -454,7 +454,7 @@ exports.SystemPredicateDefs = [
|
|
|
454
454
|
icon: { name: 'calendar' },
|
|
455
455
|
columnScope: { DataTypes: ['date'] },
|
|
456
456
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
457
|
-
handler: ({ value }) => (0,
|
|
457
|
+
handler: ({ value }) => (0, date_fns_5.isPast)((0, DateHelper_1.parseDateValue)(value)),
|
|
458
458
|
},
|
|
459
459
|
{
|
|
460
460
|
id: 'InFuture',
|
|
@@ -462,7 +462,7 @@ exports.SystemPredicateDefs = [
|
|
|
462
462
|
icon: { name: 'calendar' },
|
|
463
463
|
columnScope: { DataTypes: ['date'] },
|
|
464
464
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
465
|
-
handler: ({ value }) => (0,
|
|
465
|
+
handler: ({ value }) => (0, date_fns_4.isFuture)((0, DateHelper_1.parseDateValue)(value)),
|
|
466
466
|
},
|
|
467
467
|
{
|
|
468
468
|
id: 'After',
|
|
@@ -471,7 +471,7 @@ exports.SystemPredicateDefs = [
|
|
|
471
471
|
columnScope: { DataTypes: ['date'] },
|
|
472
472
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
473
473
|
inputs: [{ type: 'date' }],
|
|
474
|
-
handler: ({ value, inputs }) => (0,
|
|
474
|
+
handler: ({ value, inputs }) => (0, date_fns_1.isAfter)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
|
|
475
475
|
toString: ({ inputs }) => `> ${inputs[0] ?? ''}`,
|
|
476
476
|
},
|
|
477
477
|
{
|
|
@@ -481,7 +481,7 @@ exports.SystemPredicateDefs = [
|
|
|
481
481
|
columnScope: { DataTypes: ['date'] },
|
|
482
482
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
483
483
|
inputs: [{ type: 'date' }],
|
|
484
|
-
handler: ({ value, inputs }) => (0,
|
|
484
|
+
handler: ({ value, inputs }) => (0, date_fns_2.isBefore)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
|
|
485
485
|
toString: ({ inputs }) => `< ${inputs[0] ?? ''}`,
|
|
486
486
|
},
|
|
487
487
|
{
|
|
@@ -491,7 +491,7 @@ exports.SystemPredicateDefs = [
|
|
|
491
491
|
columnScope: { DataTypes: ['date'] },
|
|
492
492
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
493
493
|
inputs: [{ type: 'date' }],
|
|
494
|
-
handler: ({ value, inputs }) => (0,
|
|
494
|
+
handler: ({ value, inputs }) => (0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
|
|
495
495
|
toString: ({ inputs }) => `= ${inputs[0] ?? ''}`,
|
|
496
496
|
},
|
|
497
497
|
{
|
|
@@ -501,7 +501,7 @@ exports.SystemPredicateDefs = [
|
|
|
501
501
|
columnScope: { DataTypes: ['date'] },
|
|
502
502
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
503
503
|
inputs: [{ type: 'date' }],
|
|
504
|
-
handler: ({ value, inputs }) => !(0,
|
|
504
|
+
handler: ({ value, inputs }) => !(0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
|
|
505
505
|
toString: ({ inputs }) => `!= ${inputs[0] ?? ''}`,
|
|
506
506
|
},
|
|
507
507
|
{
|
|
@@ -510,7 +510,7 @@ exports.SystemPredicateDefs = [
|
|
|
510
510
|
icon: { name: 'calendar' },
|
|
511
511
|
columnScope: { DataTypes: ['date'] },
|
|
512
512
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
513
|
-
handler: ({ value, adaptableApi }) => (0,
|
|
513
|
+
handler: ({ value, adaptableApi }) => (0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(value), adaptableApi.calendarApi.getNextWorkingDay()),
|
|
514
514
|
},
|
|
515
515
|
{
|
|
516
516
|
id: 'LastWorkDay',
|
|
@@ -518,7 +518,7 @@ exports.SystemPredicateDefs = [
|
|
|
518
518
|
icon: { name: 'calendar' },
|
|
519
519
|
columnScope: { DataTypes: ['date'] },
|
|
520
520
|
moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
|
|
521
|
-
handler: ({ value, adaptableApi }) => (0,
|
|
521
|
+
handler: ({ value, adaptableApi }) => (0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(value), adaptableApi.calendarApi.getPreviousWorkingDay()),
|
|
522
522
|
},
|
|
523
523
|
{
|
|
524
524
|
id: 'WorkDay',
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addGroupByParams = exports.aggregatedScalarExpressionFunctionNames = exports.aggregatedScalarExpressionFunctions = exports.quantileAggregatedExpressionFunctions = exports.cumulativeAggregatedExpressionFunctions = exports.aggregatedExpressionFunctions = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
6
5
|
const ArrayExtensions_1 = require("../Extensions/ArrayExtensions");
|
|
7
6
|
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
8
7
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
9
|
-
const
|
|
8
|
+
const date_fns_1 = require("date-fns");
|
|
10
9
|
const DateHelper_1 = require("../Helpers/DateHelper");
|
|
11
10
|
exports.aggregatedExpressionFunctions = [
|
|
12
11
|
'SUM',
|
|
@@ -589,7 +588,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
589
588
|
}
|
|
590
589
|
else {
|
|
591
590
|
// Date
|
|
592
|
-
return (0,
|
|
591
|
+
return (0, date_fns_1.isAfter)((0, DateHelper_1.parseDateValue)(rowValue), (0, DateHelper_1.parseDateValue)(minValue))
|
|
593
592
|
? minValue
|
|
594
593
|
: rowValue;
|
|
595
594
|
}
|
|
@@ -653,7 +652,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
653
652
|
}
|
|
654
653
|
else {
|
|
655
654
|
// Date
|
|
656
|
-
return (0,
|
|
655
|
+
return (0, date_fns_1.isAfter)((0, DateHelper_1.parseDateValue)(rowValue), (0, DateHelper_1.parseDateValue)(maxValue))
|
|
657
656
|
? rowValue
|
|
658
657
|
: maxValue;
|
|
659
658
|
}
|
|
@@ -1245,7 +1244,7 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
|
|
|
1245
1244
|
if (isDefinedValue(rowValue)) {
|
|
1246
1245
|
if (aggregationEvaluation.columnType === 'date') {
|
|
1247
1246
|
if (cumulationBag.currentValue === aggregationReducer.initialValue ||
|
|
1248
|
-
(0,
|
|
1247
|
+
(0, date_fns_1.isAfter)((0, DateHelper_1.parseDateValue)(cumulationBag.currentValue), (0, DateHelper_1.parseDateValue)(rowValue))) {
|
|
1249
1248
|
cumulationBag.currentValue = rowValue;
|
|
1250
1249
|
}
|
|
1251
1250
|
}
|
|
@@ -1271,7 +1270,7 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
|
|
|
1271
1270
|
if (isDefinedValue(rowValue)) {
|
|
1272
1271
|
if (aggregationEvaluation.columnType === 'date') {
|
|
1273
1272
|
if (cumulationBag.currentValue === aggregationReducer.initialValue ||
|
|
1274
|
-
(0,
|
|
1273
|
+
(0, date_fns_1.isAfter)((0, DateHelper_1.parseDateValue)(rowValue), (0, DateHelper_1.parseDateValue)(cumulationBag.currentValue))) {
|
|
1275
1274
|
cumulationBag.currentValue = rowValue;
|
|
1276
1275
|
}
|
|
1277
1276
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isBooleanAdaptableQlFunction = exports.booleanExpressionFunctionsNames = exports.booleanExpressionFunctions = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const isEqual_1 = tslib_1.__importDefault(require("date-fns/isEqual"));
|
|
4
|
+
const date_fns_1 = require("date-fns");
|
|
5
|
+
const date_fns_2 = require("date-fns");
|
|
6
|
+
const date_fns_3 = require("date-fns");
|
|
8
7
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
9
8
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
10
9
|
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
@@ -69,7 +68,7 @@ exports.booleanExpressionFunctions = {
|
|
|
69
68
|
EQ: {
|
|
70
69
|
handler(args, context) {
|
|
71
70
|
if (args[0] instanceof Date && args[1] instanceof Date) {
|
|
72
|
-
return (0,
|
|
71
|
+
return (0, date_fns_3.isEqual)(args[0], args[1]);
|
|
73
72
|
}
|
|
74
73
|
if (typeof args[0] === 'string' || typeof args[1] === 'string') {
|
|
75
74
|
const [first, second] = (0, expressionFunctionUtils_1.getStringValues)(context, String(args[0]), String(args[1]));
|
|
@@ -93,7 +92,7 @@ exports.booleanExpressionFunctions = {
|
|
|
93
92
|
NEQ: {
|
|
94
93
|
handler(args, context) {
|
|
95
94
|
if (args[0] instanceof Date && args[1] instanceof Date) {
|
|
96
|
-
return !(0,
|
|
95
|
+
return !(0, date_fns_3.isEqual)(args[0], args[1]);
|
|
97
96
|
}
|
|
98
97
|
if (typeof args[0] === 'string' || typeof args[1] === 'string') {
|
|
99
98
|
const [first, second] = (0, expressionFunctionUtils_1.getStringValues)(context, String(args[0]), String(args[1]));
|
|
@@ -117,7 +116,7 @@ exports.booleanExpressionFunctions = {
|
|
|
117
116
|
LT: {
|
|
118
117
|
handler(args, context) {
|
|
119
118
|
if (args[0] instanceof Date && args[1] instanceof Date) {
|
|
120
|
-
return (0,
|
|
119
|
+
return (0, date_fns_2.isBefore)(args[0], args[1]);
|
|
121
120
|
}
|
|
122
121
|
if (typeof args[0] === 'string' || typeof args[1] === 'string') {
|
|
123
122
|
const [first, second] = (0, expressionFunctionUtils_1.getStringValues)(context, String(args[0]), String(args[1]));
|
|
@@ -144,7 +143,7 @@ exports.booleanExpressionFunctions = {
|
|
|
144
143
|
LTE: {
|
|
145
144
|
handler(args, context) {
|
|
146
145
|
if (args[0] instanceof Date && args[1] instanceof Date) {
|
|
147
|
-
return (0,
|
|
146
|
+
return (0, date_fns_2.isBefore)(args[0], args[1]) || (0, date_fns_3.isEqual)(args[0], args[1]);
|
|
148
147
|
}
|
|
149
148
|
if (typeof args[0] === 'string' || typeof args[1] === 'string') {
|
|
150
149
|
const [first, second] = (0, expressionFunctionUtils_1.getStringValues)(context, String(args[0]), String(args[1]));
|
|
@@ -171,7 +170,7 @@ exports.booleanExpressionFunctions = {
|
|
|
171
170
|
GT: {
|
|
172
171
|
handler(args, context) {
|
|
173
172
|
if (args[0] instanceof Date && args[1] instanceof Date) {
|
|
174
|
-
return (0,
|
|
173
|
+
return (0, date_fns_1.isAfter)(args[0], args[1]);
|
|
175
174
|
}
|
|
176
175
|
if (typeof args[0] === 'string' || typeof args[1] === 'string') {
|
|
177
176
|
const [first, second] = (0, expressionFunctionUtils_1.getStringValues)(context, String(args[0]), String(args[1]));
|
|
@@ -198,7 +197,7 @@ exports.booleanExpressionFunctions = {
|
|
|
198
197
|
GTE: {
|
|
199
198
|
handler(args, context) {
|
|
200
199
|
if (args[0] instanceof Date && args[1] instanceof Date) {
|
|
201
|
-
return (0,
|
|
200
|
+
return (0, date_fns_1.isAfter)(args[0], args[1]) || (0, date_fns_3.isEqual)(args[0], args[1]);
|
|
202
201
|
}
|
|
203
202
|
if (typeof args[0] === 'string' || typeof args[1] === 'string') {
|
|
204
203
|
const [first, second] = (0, expressionFunctionUtils_1.getStringValues)(context, String(args[0]), String(args[1]));
|
|
@@ -3,19 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.scalarExpressionFunctionNames = exports.scalarExpressionFunctions = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
6
|
+
const date_fns_1 = require("date-fns");
|
|
7
|
+
const date_fns_2 = require("date-fns");
|
|
8
|
+
const date_fns_3 = require("date-fns");
|
|
9
|
+
const date_fns_4 = require("date-fns");
|
|
10
|
+
const date_fns_5 = require("date-fns");
|
|
11
|
+
const date_fns_6 = require("date-fns");
|
|
12
|
+
const date_fns_7 = require("date-fns");
|
|
13
|
+
const date_fns_8 = require("date-fns");
|
|
14
|
+
const date_fns_9 = require("date-fns");
|
|
15
|
+
const date_fns_10 = require("date-fns");
|
|
16
|
+
const date_fns_11 = require("date-fns");
|
|
17
|
+
const date_fns_12 = require("date-fns");
|
|
18
|
+
const date_fns_13 = require("date-fns");
|
|
19
19
|
const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
|
|
20
20
|
const dateUtils_1 = require("./dateUtils");
|
|
21
21
|
const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
|
|
@@ -377,7 +377,7 @@ exports.scalarExpressionFunctions = {
|
|
|
377
377
|
},
|
|
378
378
|
DATE: {
|
|
379
379
|
handler(args) {
|
|
380
|
-
return (0,
|
|
380
|
+
return (0, date_fns_1.parseISO)(args[0]);
|
|
381
381
|
},
|
|
382
382
|
description: 'Returns a new date by parsing the given string in ISO 8601 format',
|
|
383
383
|
signatures: [
|
|
@@ -402,7 +402,7 @@ exports.scalarExpressionFunctions = {
|
|
|
402
402
|
},
|
|
403
403
|
CURRENT_DAY: {
|
|
404
404
|
handler() {
|
|
405
|
-
return (0,
|
|
405
|
+
return (0, date_fns_2.startOfDay)(new Date());
|
|
406
406
|
},
|
|
407
407
|
description: 'Returns the current day',
|
|
408
408
|
signatures: ['CURRENT_DAY()'],
|
|
@@ -412,7 +412,7 @@ exports.scalarExpressionFunctions = {
|
|
|
412
412
|
},
|
|
413
413
|
DAY: {
|
|
414
414
|
handler(args) {
|
|
415
|
-
return (0,
|
|
415
|
+
return (0, date_fns_2.startOfDay)(args[0]);
|
|
416
416
|
},
|
|
417
417
|
description: 'Returns the day from a date',
|
|
418
418
|
signatures: ['DAY(input: date)'],
|
|
@@ -422,7 +422,7 @@ exports.scalarExpressionFunctions = {
|
|
|
422
422
|
},
|
|
423
423
|
WEEK: {
|
|
424
424
|
handler(args) {
|
|
425
|
-
return (0,
|
|
425
|
+
return (0, date_fns_3.startOfWeek)(args[0]);
|
|
426
426
|
},
|
|
427
427
|
description: 'Returns the week from a date',
|
|
428
428
|
signatures: ['WEEK(input: date)'],
|
|
@@ -432,7 +432,7 @@ exports.scalarExpressionFunctions = {
|
|
|
432
432
|
},
|
|
433
433
|
MONTH: {
|
|
434
434
|
handler(args) {
|
|
435
|
-
return (0,
|
|
435
|
+
return (0, date_fns_4.startOfMonth)(args[0]);
|
|
436
436
|
},
|
|
437
437
|
description: 'Returns the month from a date',
|
|
438
438
|
signatures: ['MONTH(input: date)'],
|
|
@@ -442,7 +442,7 @@ exports.scalarExpressionFunctions = {
|
|
|
442
442
|
},
|
|
443
443
|
YEAR: {
|
|
444
444
|
handler(args) {
|
|
445
|
-
return (0,
|
|
445
|
+
return (0, date_fns_5.startOfYear)(args[0]);
|
|
446
446
|
},
|
|
447
447
|
description: 'Returns the year from a date',
|
|
448
448
|
signatures: ['YEAR(input: date)'],
|
|
@@ -452,7 +452,7 @@ exports.scalarExpressionFunctions = {
|
|
|
452
452
|
},
|
|
453
453
|
ADD_DAYS: {
|
|
454
454
|
handler(args) {
|
|
455
|
-
return (0,
|
|
455
|
+
return (0, date_fns_6.addDays)(args[0], args[1]);
|
|
456
456
|
},
|
|
457
457
|
description: 'Returns a date based on input data and days to add',
|
|
458
458
|
signatures: ['ADD_DAYS(input: date, days: number)'],
|
|
@@ -462,7 +462,7 @@ exports.scalarExpressionFunctions = {
|
|
|
462
462
|
},
|
|
463
463
|
ADD_WEEKS: {
|
|
464
464
|
handler(args) {
|
|
465
|
-
return (0,
|
|
465
|
+
return (0, date_fns_7.addWeeks)(args[0], args[1]);
|
|
466
466
|
},
|
|
467
467
|
description: 'Returns a date based on input data and weeks to add',
|
|
468
468
|
signatures: ['ADD_WEEKS(input: date, weeks: number)'],
|
|
@@ -472,7 +472,7 @@ exports.scalarExpressionFunctions = {
|
|
|
472
472
|
},
|
|
473
473
|
ADD_MONTHS: {
|
|
474
474
|
handler(args) {
|
|
475
|
-
return (0,
|
|
475
|
+
return (0, date_fns_8.addMonths)(args[0], args[1]);
|
|
476
476
|
},
|
|
477
477
|
description: 'Returns a date based on input data and months to add',
|
|
478
478
|
signatures: ['ADD_MONTHS(input: date, months: number)'],
|
|
@@ -482,7 +482,7 @@ exports.scalarExpressionFunctions = {
|
|
|
482
482
|
},
|
|
483
483
|
ADD_YEARS: {
|
|
484
484
|
handler(args) {
|
|
485
|
-
return (0,
|
|
485
|
+
return (0, date_fns_9.addYears)(args[0], args[1]);
|
|
486
486
|
},
|
|
487
487
|
description: 'Returns a date based on input data and years to add',
|
|
488
488
|
signatures: ['ADD_YEARS(input: date, years: number)'],
|
|
@@ -493,7 +493,7 @@ exports.scalarExpressionFunctions = {
|
|
|
493
493
|
DIFF_DAYS: {
|
|
494
494
|
handler(args) {
|
|
495
495
|
const [first, second] = (0, dateUtils_1.normalizeDateParams)(args);
|
|
496
|
-
const result = (0,
|
|
496
|
+
const result = (0, date_fns_10.differenceInDays)(first, second);
|
|
497
497
|
return sanitizeNumericResult(result);
|
|
498
498
|
},
|
|
499
499
|
description: 'Returns the difference in days between 2 dates',
|
|
@@ -505,7 +505,7 @@ exports.scalarExpressionFunctions = {
|
|
|
505
505
|
DIFF_WEEKS: {
|
|
506
506
|
handler(args) {
|
|
507
507
|
const [first, second] = (0, dateUtils_1.normalizeDateParams)(args);
|
|
508
|
-
const result = (0,
|
|
508
|
+
const result = (0, date_fns_11.differenceInWeeks)(first, second);
|
|
509
509
|
return sanitizeNumericResult(result);
|
|
510
510
|
},
|
|
511
511
|
description: 'Returns the difference in weeks between 2 dates',
|
|
@@ -517,7 +517,7 @@ exports.scalarExpressionFunctions = {
|
|
|
517
517
|
DIFF_MONTHS: {
|
|
518
518
|
handler(args) {
|
|
519
519
|
const [first, second] = (0, dateUtils_1.normalizeDateParams)(args);
|
|
520
|
-
const result = (0,
|
|
520
|
+
const result = (0, date_fns_12.differenceInMonths)(first, second);
|
|
521
521
|
return sanitizeNumericResult(result);
|
|
522
522
|
},
|
|
523
523
|
description: 'Returns the difference in months between 2 dates',
|
|
@@ -529,7 +529,7 @@ exports.scalarExpressionFunctions = {
|
|
|
529
529
|
DIFF_YEARS: {
|
|
530
530
|
handler(args) {
|
|
531
531
|
const [first, second] = (0, dateUtils_1.normalizeDateParams)(args);
|
|
532
|
-
const result = (0,
|
|
532
|
+
const result = (0, date_fns_13.differenceInYears)(first, second);
|
|
533
533
|
return sanitizeNumericResult(result);
|
|
534
534
|
},
|
|
535
535
|
description: 'Returns the difference in years between 2 dates',
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseFilterInputDate = exports.parseDateValue = exports.parseToISO = exports.dateToISO = exports.isValueValidDate = exports.isValidDate = void 0;
|
|
4
|
-
const
|
|
5
|
-
const parseISO_1 = tslib_1.__importDefault(require("date-fns/parseISO"));
|
|
6
|
-
const parse_1 = tslib_1.__importDefault(require("date-fns/parse"));
|
|
4
|
+
const date_fns_1 = require("date-fns");
|
|
7
5
|
const FormatHelper_1 = require("./FormatHelper");
|
|
8
6
|
const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
|
|
9
7
|
const isValidDate = (date) => {
|
|
@@ -46,10 +44,10 @@ const parseDateValue = (dateValue, dateFormat) => {
|
|
|
46
44
|
else {
|
|
47
45
|
// typeof dateValue === 'string'
|
|
48
46
|
if (dateFormat) {
|
|
49
|
-
dateInstance = (0,
|
|
47
|
+
dateInstance = (0, date_fns_1.parse)(dateValue, dateFormat, new Date());
|
|
50
48
|
}
|
|
51
49
|
else {
|
|
52
|
-
dateInstance = (0,
|
|
50
|
+
dateInstance = (0, date_fns_1.parseISO)(dateValue);
|
|
53
51
|
}
|
|
54
52
|
if (!(0, exports.isValidDate)(dateInstance)) {
|
|
55
53
|
// last chance: try to use the native Date.parse(), https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
|
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.StringFormatter = exports.DateFormatter = exports.NumberFormatter = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
// TODO inspect why the following is erroring on angular build
|
|
6
|
-
|
|
7
|
-
const format_1 = tslib_1.__importDefault(require("date-fns/format"));
|
|
6
|
+
const date_fns_1 = require("date-fns");
|
|
8
7
|
const sentence_case_1 = require("sentence-case");
|
|
9
8
|
const GeneralConstants_1 = require("../Constants/GeneralConstants");
|
|
10
9
|
const Helper_1 = tslib_1.__importDefault(require("./Helper"));
|
|
@@ -103,7 +102,7 @@ function DateFormatter(input, options, strictFormatting = false) {
|
|
|
103
102
|
if (typeof input === 'string') {
|
|
104
103
|
input = new Date(input);
|
|
105
104
|
}
|
|
106
|
-
return (0,
|
|
105
|
+
return (0, date_fns_1.format)(input, options?.Pattern || GeneralConstants_1.DEFAULT_DATE_FORMAT_PATTERN);
|
|
107
106
|
}
|
|
108
107
|
catch (error) {
|
|
109
108
|
if (strictFormatting) {
|
|
@@ -12,7 +12,7 @@ const CommentsRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/
|
|
|
12
12
|
const InternalRedux_1 = require("../../Redux/ActionsReducers/InternalRedux");
|
|
13
13
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
14
14
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../Components/AdaptableInput"));
|
|
15
|
-
const
|
|
15
|
+
const FormatHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/FormatHelper"));
|
|
16
16
|
// Edit Mode
|
|
17
17
|
// [author] [edit, delete]
|
|
18
18
|
// [text-editor] * this is different
|
|
@@ -52,6 +52,9 @@ const CommentsEditor = (props) => {
|
|
|
52
52
|
if (!commentThread) {
|
|
53
53
|
return null;
|
|
54
54
|
}
|
|
55
|
+
const formatDate = (date, format) => {
|
|
56
|
+
return FormatHelper_1.default.DateFormatter(date, { Pattern: format });
|
|
57
|
+
};
|
|
55
58
|
return (React.createElement(Panel_1.default, { color: "var(--ab-color-text-on-primary)", onClick: () => props.enableEditMode(), minWidth: 250, className: "ab-CommentPopup", onKeyDown: (event) => {
|
|
56
59
|
if (event.key === 'Escape') {
|
|
57
60
|
api.commentApi.hideCommentsPopup();
|
|
@@ -79,7 +82,7 @@ const CommentsEditor = (props) => {
|
|
|
79
82
|
React.createElement(rebass_1.Flex, { mb: 2, alignItems: "center" },
|
|
80
83
|
React.createElement(rebass_1.Box, null,
|
|
81
84
|
React.createElement(rebass_1.Box, { "data-name": "comment-username", fontSize: 3, fontWeight: "bold" }, comment?.Author?.UserName),
|
|
82
|
-
comment.Timestamp && (React.createElement(rebass_1.Box, { "data-name": "comment-timestamp", fontSize: 2 }, (
|
|
85
|
+
comment.Timestamp && (React.createElement(rebass_1.Box, { "data-name": "comment-timestamp", fontSize: 2 }, formatDate(comment.Timestamp, api.commentApi.internalApi.getCommentsDateFormat())))),
|
|
83
86
|
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
84
87
|
React.createElement(SimpleButton_1.default, { variant: "text", icon: "edit", disabled: !isOwnComment || isReadOnlyModule, onClick: () => setActiveEditingComment(comment.Uuid) }),
|
|
85
88
|
React.createElement(SimpleButton_1.default, { variant: "text", icon: "delete", disabled: !isOwnComment || isReadOnlyModule, onClick: () => {
|
|
@@ -7,10 +7,10 @@ const react_redux_1 = require("react-redux");
|
|
|
7
7
|
const InfiniteTable_1 = require("../../components/InfiniteTable");
|
|
8
8
|
const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
|
|
9
9
|
const rebass_1 = require("rebass");
|
|
10
|
-
const format_1 = tslib_1.__importDefault(require("date-fns/format"));
|
|
11
10
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
12
11
|
const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
|
|
13
12
|
const AdaptableButton_1 = require("../Components/AdaptableButton");
|
|
13
|
+
const FormatHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/FormatHelper"));
|
|
14
14
|
const tableDOMProps = {
|
|
15
15
|
style: {
|
|
16
16
|
minHeight: 160,
|
|
@@ -20,6 +20,9 @@ const tableDOMProps = {
|
|
|
20
20
|
const CellComments = (props) => {
|
|
21
21
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
22
22
|
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
|
|
23
|
+
const formatDate = (date, format) => {
|
|
24
|
+
return FormatHelper_1.default.DateFormatter(date, { Pattern: format });
|
|
25
|
+
};
|
|
23
26
|
const columnsMap = React.useMemo(() => {
|
|
24
27
|
const columns = {
|
|
25
28
|
author: {
|
|
@@ -31,7 +34,7 @@ const CellComments = (props) => {
|
|
|
31
34
|
field: 'Timestamp',
|
|
32
35
|
maxWidth: 150,
|
|
33
36
|
valueGetter: (params) => {
|
|
34
|
-
return (
|
|
37
|
+
return formatDate(params.data.Timestamp, adaptable.api.commentApi.internalApi.getCommentsDateFormat());
|
|
35
38
|
},
|
|
36
39
|
},
|
|
37
40
|
text: {
|
|
@@ -75,7 +75,7 @@ const qlPredicateToString = (qlPredicate, predicateDefs) => {
|
|
|
75
75
|
};
|
|
76
76
|
exports.qlPredicateToString = qlPredicateToString;
|
|
77
77
|
const isPredicateEmpty = (predicate, predicateDef) => {
|
|
78
|
-
if (!predicateDef
|
|
78
|
+
if (!predicateDef?.inputs || predicateDef.inputs.length === 0) {
|
|
79
79
|
return false;
|
|
80
80
|
}
|
|
81
81
|
return (!predicate ||
|
|
@@ -4,7 +4,7 @@ exports.ColumnValuesSelect = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const StringExtensions_1 = require("../../../Utilities/Extensions/StringExtensions");
|
|
7
|
-
const
|
|
7
|
+
const date_fns_1 = require("date-fns");
|
|
8
8
|
const DateHelper_1 = require("../../../Utilities/Helpers/DateHelper");
|
|
9
9
|
const join_1 = tslib_1.__importDefault(require("../../../components/utils/join"));
|
|
10
10
|
const Select_1 = require("../../../components/Select");
|
|
@@ -17,7 +17,7 @@ const ColumnValuesSelect = (props) => {
|
|
|
17
17
|
let isActive = selectedColumnValues.indexOf(distinctValue.value) >= 0;
|
|
18
18
|
// special case for date objects, need to check against string values
|
|
19
19
|
if (!isActive && distinctValue.value && distinctValue.value instanceof Date) {
|
|
20
|
-
isActive = selectedColumnValues.some((dateStr) => (0,
|
|
20
|
+
isActive = selectedColumnValues.some((dateStr) => (0, date_fns_1.isEqual)((0, DateHelper_1.parseDateValue)(dateStr), (0, DateHelper_1.parseDateValue)(distinctValue.value)));
|
|
21
21
|
}
|
|
22
22
|
const columnLabel = distinctValue.label;
|
|
23
23
|
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(columnLabel)) {
|