@carbon/ibm-products 2.0.0-rc.12 → 2.0.0-rc.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -54,6 +54,7 @@ export var ButtonMenu = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
54
54
  ),
55
55
  ariaLabel: menuAriaLabel,
56
56
  menuOptionsClass: cx("".concat(blockClass, "__options"), menuOptionsClass),
57
+ size: size,
57
58
  renderIcon: function renderIcon() {
58
59
  return /*#__PURE__*/React.createElement("div", {
59
60
  className: cx(["".concat(blockClass, "__trigger"), "".concat(carbonPrefix, "--btn"), "".concat(carbonPrefix, "--btn--").concat(kind), "".concat(carbonPrefix, "--btn--").concat(size)])
@@ -120,8 +121,8 @@ ButtonMenu.propTypes = {
120
121
  renderIcon: Button.propTypes.renderIcon,
121
122
 
122
123
  /**
123
- * The size of the button for the menu trigger. The values can be any valid
124
- * value for the carbon Button component 'size' prop.
124
+ * The size of the button for the menu trigger.
125
+ * The menu button supports: sm, md, lg
125
126
  */
126
- size: Button.propTypes.size
127
+ size: PropTypes.oneOf(['sm', 'md', 'lg'])
127
128
  };
@@ -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' || 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 : twoDaysAgoDate,
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()
@@ -59,6 +59,7 @@ var ButtonMenu = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
59
59
  ),
60
60
  ariaLabel: menuAriaLabel,
61
61
  menuOptionsClass: (0, _classnames.default)("".concat(blockClass, "__options"), menuOptionsClass),
62
+ size: size,
62
63
  renderIcon: function renderIcon() {
63
64
  return /*#__PURE__*/_react.default.createElement("div", {
64
65
  className: (0, _classnames.default)(["".concat(blockClass, "__trigger"), "".concat(carbonPrefix, "--btn"), "".concat(carbonPrefix, "--btn--").concat(kind), "".concat(carbonPrefix, "--btn--").concat(size)])
@@ -127,8 +128,8 @@ ButtonMenu.propTypes = {
127
128
  renderIcon: _react2.Button.propTypes.renderIcon,
128
129
 
129
130
  /**
130
- * The size of the button for the menu trigger. The values can be any valid
131
- * value for the carbon Button component 'size' prop.
131
+ * The size of the button for the menu trigger.
132
+ * The menu button supports: sm, md, lg
132
133
  */
133
- size: _react2.Button.propTypes.size
134
+ size: _propTypes.default.oneOf(['sm', 'md', 'lg'])
134
135
  };
@@ -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' || 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 : twoDaysAgoDate,
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.12",
4
+ "version": "2.0.0-rc.14",
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": "feb17ff087be1ed1174b0e0cfa44dd1f991e2881"
97
+ "gitHead": "841dab2f0145b838bd5b3691dbb58cda52c986b6"
98
98
  }