blue-react 8.7.0 → 8.7.2

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.
@@ -134,7 +134,9 @@ function MenuItem(props) {
134
134
  onDragLeave: props.onDragLeave,
135
135
  onDrop: props.onDrop,
136
136
  draggable: props.draggable,
137
- "data-tooltip": props["data-tooltip"]
137
+ "data-tooltip": props["data-tooltip"],
138
+ disabled: props.disabled,
139
+ style: props.style
138
140
  }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
139
141
  className: (0, _clsx.default)("blue-menu-item-icon", {
140
142
  hasIconForActive: iconForActive
@@ -147,6 +147,18 @@ function scrollToTop() {
147
147
  });
148
148
  }
149
149
 
150
+ var httpStatusCodes = {
151
+ 400: "Bad Request",
152
+ 401: "Unauthorized",
153
+ 403: "Forbidden",
154
+ 404: "Not Found",
155
+ 405: "Method Not Allowed",
156
+ 408: "Request Timeout",
157
+ 409: "Conflict",
158
+ 500: "Internal Server Error",
159
+ 502: "Bad Gateway"
160
+ };
161
+
150
162
  function fetchData(input, init) {
151
163
  var showErrorDetail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
152
164
  var onError = arguments.length > 3 ? arguments[3] : undefined;
@@ -156,7 +168,7 @@ function fetchData(input, init) {
156
168
  }).catch(function (reason) {
157
169
  if (reason.text) {
158
170
  reason.text().then(function (errorMessage) {
159
- setAlertMessage("".concat(reason.status, " - ").concat(reason.statusText), "danger", true, showErrorDetail ? errorMessage : undefined);
171
+ setAlertMessage("".concat(reason.status, " - ").concat(reason.statusText || httpStatusCodes[reason.status] || "Error"), "danger", true, showErrorDetail ? errorMessage.toString().replace(/(<style[\w\W]+style>)/g, "").replace(/<[^>]+>/g, "") : undefined);
160
172
 
161
173
  if (onError) {
162
174
  onError(errorMessage, reason);