@carbon/ibm-products 2.0.0-rc.12 → 2.0.0-rc.13
Sign up to get free protection for your applications and to get access to all the features.
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +8 -4
- package/es/components/Datagrid/utils/getInlineEditColumns.js +1 -0
- package/es/components/Datagrid/utils/makeData.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +8 -4
- package/lib/components/Datagrid/utils/getInlineEditColumns.js +1 -0
- package/lib/components/Datagrid/utils/makeData.js +1 -1
- package/package.json +2 -2
@@ -421,20 +421,24 @@ export var InlineEditCell = function InlineEditCell(_ref) {
|
|
421
421
|
};
|
422
422
|
|
423
423
|
var buildDate = function buildDate(value) {
|
424
|
+
var _config$inputProps2;
|
425
|
+
|
426
|
+
var dateFormat = config === null || config === void 0 ? void 0 : (_config$inputProps2 = config.inputProps) === null || _config$inputProps2 === void 0 ? void 0 : _config$inputProps2.dateFormat;
|
427
|
+
|
424
428
|
if (value instanceof Date) {
|
425
|
-
var _config$dateFormat = config.dateFormat,
|
426
|
-
dateFormat = _config$dateFormat === void 0 ? 'm/d/Y' : _config$dateFormat;
|
427
429
|
var maskedFullYear = value.getFullYear();
|
428
430
|
var maskedMonth = padTo2Digits(value.getMonth() + 1);
|
429
431
|
var maskedDay = padTo2Digits(value.getDate());
|
430
432
|
|
431
|
-
if (dateFormat === 'm/d/Y' ||
|
433
|
+
if (dateFormat === 'm/d/Y' || value === 'm/d/y') {
|
432
434
|
return [maskedMonth, maskedDay, maskedFullYear].join('/');
|
433
435
|
}
|
434
436
|
|
435
|
-
if (dateFormat === 'd/m/Y' || dateFormat === 'd/m/y') {
|
437
|
+
if (dateFormat === 'd/m/Y' || dateFormat === 'd/m/y' || dateFormat === undefined) {
|
436
438
|
return [maskedDay, maskedMonth, maskedFullYear].join('/');
|
437
439
|
}
|
440
|
+
} else {
|
441
|
+
return value;
|
438
442
|
}
|
439
443
|
|
440
444
|
return null;
|
@@ -108,6 +108,7 @@ export var getInlineEditColumns = function getInlineEditColumns() {
|
|
108
108
|
onChange: function onChange(newDateObj, cell) {
|
109
109
|
console.log(newDateObj, cell);
|
110
110
|
},
|
111
|
+
dateFormat: 'd/m/Y',
|
111
112
|
// optionally pass props here to be passed through to Carbon's DatePickerInput component
|
112
113
|
datePickerInputProps: {
|
113
114
|
labelText: 'Change active since date'
|
@@ -179,7 +179,7 @@ var newPerson = function newPerson() {
|
|
179
179
|
numbers: 0
|
180
180
|
}),
|
181
181
|
chartType: initialChartTypeIndex === 0 ? inlineEditSelectItems[0] : initialChartTypeIndex === 1 ? inlineEditSelectItems[1] : inlineEditSelectItems[2],
|
182
|
-
activeSince: activeChance > 0.66 ? activeSinceDate : activeChance > 0.33 ? yesterdayDate :
|
182
|
+
activeSince: activeChance > 0.66 ? activeSinceDate : activeChance > 0.33 ? yesterdayDate : '23/05/2020',
|
183
183
|
bonus: "$\r".concat(getRandomInteger(100, 500, 2)),
|
184
184
|
passwordStrength: getPasswordStrength(),
|
185
185
|
doc_link: renderDocLink()
|
@@ -444,20 +444,24 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
444
444
|
};
|
445
445
|
|
446
446
|
var buildDate = function buildDate(value) {
|
447
|
+
var _config$inputProps2;
|
448
|
+
|
449
|
+
var dateFormat = config === null || config === void 0 ? void 0 : (_config$inputProps2 = config.inputProps) === null || _config$inputProps2 === void 0 ? void 0 : _config$inputProps2.dateFormat;
|
450
|
+
|
447
451
|
if (value instanceof Date) {
|
448
|
-
var _config$dateFormat = config.dateFormat,
|
449
|
-
dateFormat = _config$dateFormat === void 0 ? 'm/d/Y' : _config$dateFormat;
|
450
452
|
var maskedFullYear = value.getFullYear();
|
451
453
|
var maskedMonth = padTo2Digits(value.getMonth() + 1);
|
452
454
|
var maskedDay = padTo2Digits(value.getDate());
|
453
455
|
|
454
|
-
if (dateFormat === 'm/d/Y' ||
|
456
|
+
if (dateFormat === 'm/d/Y' || value === 'm/d/y') {
|
455
457
|
return [maskedMonth, maskedDay, maskedFullYear].join('/');
|
456
458
|
}
|
457
459
|
|
458
|
-
if (dateFormat === 'd/m/Y' || dateFormat === 'd/m/y') {
|
460
|
+
if (dateFormat === 'd/m/Y' || dateFormat === 'd/m/y' || dateFormat === undefined) {
|
459
461
|
return [maskedDay, maskedMonth, maskedFullYear].join('/');
|
460
462
|
}
|
463
|
+
} else {
|
464
|
+
return value;
|
461
465
|
}
|
462
466
|
|
463
467
|
return null;
|
@@ -121,6 +121,7 @@ var getInlineEditColumns = function getInlineEditColumns() {
|
|
121
121
|
onChange: function onChange(newDateObj, cell) {
|
122
122
|
console.log(newDateObj, cell);
|
123
123
|
},
|
124
|
+
dateFormat: 'd/m/Y',
|
124
125
|
// optionally pass props here to be passed through to Carbon's DatePickerInput component
|
125
126
|
datePickerInputProps: {
|
126
127
|
labelText: 'Change active since date'
|
@@ -190,7 +190,7 @@ var newPerson = function newPerson() {
|
|
190
190
|
numbers: 0
|
191
191
|
}),
|
192
192
|
chartType: initialChartTypeIndex === 0 ? _getInlineEditColumns.inlineEditSelectItems[0] : initialChartTypeIndex === 1 ? _getInlineEditColumns.inlineEditSelectItems[1] : _getInlineEditColumns.inlineEditSelectItems[2],
|
193
|
-
activeSince: activeChance > 0.66 ? activeSinceDate : activeChance > 0.33 ? yesterdayDate :
|
193
|
+
activeSince: activeChance > 0.66 ? activeSinceDate : activeChance > 0.33 ? yesterdayDate : '23/05/2020',
|
194
194
|
bonus: "$\r".concat(getRandomInteger(100, 500, 2)),
|
195
195
|
passwordStrength: getPasswordStrength(),
|
196
196
|
doc_link: renderDocLink()
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.0.0-rc.
|
4
|
+
"version": "2.0.0-rc.13",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -94,5 +94,5 @@
|
|
94
94
|
"react": "^16.8.6 || ^17.0.1",
|
95
95
|
"react-dom": "^16.8.6 || ^17.0.1"
|
96
96
|
},
|
97
|
-
"gitHead": "
|
97
|
+
"gitHead": "a562f82207cf4516c61e32e97a3f4c5c9b159d03"
|
98
98
|
}
|