@zohodesk/components 1.0.0-alpha-277 → 1.0.0-alpha-278

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/README.md CHANGED
@@ -32,6 +32,10 @@ In this Package, we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
+ # 1.0.0-alpha-278
36
+
37
+ - **DateTime** - Date.Raplace check added to avoid run time error
38
+
35
39
  # 1.0.0-alpha-277
36
40
 
37
41
  - **DropBox** - `focusScopeProps` will be served by `customProps` from now.
@@ -16,7 +16,7 @@ export default class Buttongroup extends React.Component {
16
16
  dataSelectorId
17
17
  } = this.props;
18
18
  let btnGroup = [];
19
- children.forEach(child => {
19
+ children && children.forEach(child => {
20
20
  let btnRight = /*#__PURE__*/React.createElement("span", {
21
21
  className: style[type]
22
22
  }, child);
@@ -112,8 +112,8 @@ export default class DateTime extends React.PureComponent {
112
112
  if (timeZone && value) {
113
113
  result = datetime.toDate(datetime.tz.utcToTz(value, timeZone));
114
114
  } else {
115
- value = value.replace('Z', '');
116
- result = new Date(value);
115
+ value = value ? value.replace('Z', '') : null;
116
+ result = value ? new Date(value) : new Date();
117
117
  }
118
118
  } else {
119
119
  if (value) {
@@ -10,7 +10,7 @@ export const AdvancedGroupMultiSelect_propTypes = {
10
10
  emptyMessage: PropTypes.string.isRequired,
11
11
  getContainerRef: PropTypes.func,
12
12
  getFooter: PropTypes.func,
13
- groupedOptions: PropTypes.array.required,
13
+ groupedOptions: PropTypes.array.isRequired,
14
14
  i18nKeys: PropTypes.shape({
15
15
  loadingText: PropTypes.string,
16
16
  emptyText: PropTypes.string,
@@ -61,7 +61,7 @@ var Buttongroup = /*#__PURE__*/function (_React$Component) {
61
61
  dataId = _this$props.dataId,
62
62
  dataSelectorId = _this$props.dataSelectorId;
63
63
  var btnGroup = [];
64
- children.forEach(function (child) {
64
+ children && children.forEach(function (child) {
65
65
  var btnRight = /*#__PURE__*/_react["default"].createElement("span", {
66
66
  className: _ButtongroupModule["default"][type]
67
67
  }, child);
@@ -182,8 +182,8 @@ var DateTime = /*#__PURE__*/function (_React$PureComponent) {
182
182
  if (timeZone && value) {
183
183
  result = _datetimejs["default"].toDate(_datetimejs["default"].tz.utcToTz(value, timeZone));
184
184
  } else {
185
- value = value.replace('Z', '');
186
- result = new Date(value);
185
+ value = value ? value.replace('Z', '') : null;
186
+ result = value ? new Date(value) : new Date();
187
187
  }
188
188
  } else {
189
189
  if (value) {
@@ -20,7 +20,7 @@ var AdvancedGroupMultiSelect_propTypes = {
20
20
  emptyMessage: _propTypes["default"].string.isRequired,
21
21
  getContainerRef: _propTypes["default"].func,
22
22
  getFooter: _propTypes["default"].func,
23
- groupedOptions: _propTypes["default"].array.required,
23
+ groupedOptions: _propTypes["default"].array.isRequired,
24
24
  i18nKeys: _propTypes["default"].shape({
25
25
  loadingText: _propTypes["default"].string,
26
26
  emptyText: _propTypes["default"].string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/components",
3
- "version": "1.0.0-alpha-277",
3
+ "version": "1.0.0-alpha-278",
4
4
  "main": "es/index.js",
5
5
  "module": "es/index.js",
6
6
  "private": false,
@@ -48,9 +48,11 @@
48
48
  "cssVariableConvert": "react-cli variableConverter ./lib ./lib && react-cli variableConverter ./es ./es",
49
49
  "variable:addignore": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/variableIgnore.js ./src",
50
50
  "variable:convert": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/pxParserPostcss.js ./src",
51
- "variable:check": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/variableErrorCheck.js ./src ./node_modules/@zohodesk-private/css-variable-migrator/es/config/cssVariableReplacementOptions.json"
51
+ "variable:check": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/variableErrorCheck.js ./src ./node_modules/@zohodesk-private/css-variable-migrator/es/config/cssVariableReplacementOptions.json",
52
+ "review:props": "node ./node_modules/@zohodesk-private/react-prop-validator/es/propValidation.js ./src/ ./.cli "
52
53
  },
53
54
  "devDependencies": {
55
+ "@zohodesk-private/react-prop-validator": "0.0.4",
54
56
  "@zohodesk-private/css-variable-migrator": "^1.0.5",
55
57
  "@zohodesk/a11y": "2.0.0",
56
58
  "@zohodesk-private/node-plugins": "^1.0.0",