@datarobot/design-system 29.7.0 → 29.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.
@@ -61,7 +61,7 @@ function FileUploader({
61
61
  placeholderLabel: placeholderLabelParams,
62
62
  controlsContent = null,
63
63
  isCancelAllowed = true,
64
- errorMessages: errorMessagesParams,
64
+ errorMessages: errorMessagesParams = {},
65
65
  deleteLabelText: deleteLabelTextParams,
66
66
  cancelLabelText: cancelLabelTextParams,
67
67
  chooseFileLabelText: chooseFileLabelTextParams,
@@ -75,7 +75,10 @@ function FileUploader({
75
75
  t
76
76
  } = (0, _useTranslation.useTranslation)();
77
77
  const errors = (0, _fileUploaderConstants.useFileUploaderErrors)();
78
- const errorMessages = errorMessagesParams ?? errors;
78
+ const errorMessages = {
79
+ ...errors,
80
+ ...errorMessagesParams
81
+ };
79
82
  const placeholderLabel = placeholderLabelParams ?? t('Drop file(s) here to upload or');
80
83
  const deleteLabelText = deleteLabelTextParams ?? t('Delete');
81
84
  const cancelLabelText = cancelLabelTextParams ?? t('Cancel');
@@ -53,7 +53,7 @@ export function FileUploader({
53
53
  placeholderLabel: placeholderLabelParams,
54
54
  controlsContent = null,
55
55
  isCancelAllowed = true,
56
- errorMessages: errorMessagesParams,
56
+ errorMessages: errorMessagesParams = {},
57
57
  deleteLabelText: deleteLabelTextParams,
58
58
  cancelLabelText: cancelLabelTextParams,
59
59
  chooseFileLabelText: chooseFileLabelTextParams,
@@ -67,7 +67,10 @@ export function FileUploader({
67
67
  t
68
68
  } = useTranslation();
69
69
  const errors = useFileUploaderErrors();
70
- const errorMessages = errorMessagesParams ?? errors;
70
+ const errorMessages = {
71
+ ...errors,
72
+ ...errorMessagesParams
73
+ };
71
74
  const placeholderLabel = placeholderLabelParams ?? t('Drop file(s) here to upload or');
72
75
  const deleteLabelText = deleteLabelTextParams ?? t('Delete');
73
76
  const cancelLabelText = cancelLabelTextParams ?? t('Cancel');
@@ -56166,12 +56166,18 @@ function UploadFileStatusMessage(_ref) {
56166
56166
  /* harmony import */ var _file_uploader_less__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./file-uploader.less */ "./src/components/file-uploader/file-uploader.less");
56167
56167
  /* harmony import */ var _file_uploader_less__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_file_uploader_less__WEBPACK_IMPORTED_MODULE_21__);
56168
56168
  /* harmony import */ var _truncate_string_truncate_string__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../truncate-string/truncate-string */ "./src/components/truncate-string/truncate-string.tsx");
56169
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
56169
56170
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
56170
56171
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
56171
56172
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
56172
56173
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
56173
56174
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
56174
56175
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
56176
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
56177
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
56178
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
56179
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
56180
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
56175
56181
 
56176
56182
 
56177
56183
 
@@ -56247,7 +56253,8 @@ function FileUploader(_ref) {
56247
56253
  controlsContent = _ref$controlsContent === void 0 ? null : _ref$controlsContent,
56248
56254
  _ref$isCancelAllowed = _ref.isCancelAllowed,
56249
56255
  isCancelAllowed = _ref$isCancelAllowed === void 0 ? true : _ref$isCancelAllowed,
56250
- errorMessagesParams = _ref.errorMessages,
56256
+ _ref$errorMessages = _ref.errorMessages,
56257
+ errorMessagesParams = _ref$errorMessages === void 0 ? {} : _ref$errorMessages,
56251
56258
  deleteLabelTextParams = _ref.deleteLabelText,
56252
56259
  cancelLabelTextParams = _ref.cancelLabelText,
56253
56260
  chooseFileLabelTextParams = _ref.chooseFileLabelText,
@@ -56263,7 +56270,7 @@ function FileUploader(_ref) {
56263
56270
  var _useTranslation = (0,_hooks_use_translation__WEBPACK_IMPORTED_MODULE_20__.useTranslation)(),
56264
56271
  t = _useTranslation.t;
56265
56272
  var errors = (0,_file_uploader_constants__WEBPACK_IMPORTED_MODULE_10__.useFileUploaderErrors)();
56266
- var errorMessages = errorMessagesParams !== null && errorMessagesParams !== void 0 ? errorMessagesParams : errors;
56273
+ var errorMessages = _objectSpread(_objectSpread({}, errors), errorMessagesParams);
56267
56274
  var placeholderLabel = placeholderLabelParams !== null && placeholderLabelParams !== void 0 ? placeholderLabelParams : t('Drop file(s) here to upload or');
56268
56275
  var deleteLabelText = deleteLabelTextParams !== null && deleteLabelTextParams !== void 0 ? deleteLabelTextParams : t('Delete');
56269
56276
  var cancelLabelText = cancelLabelTextParams !== null && cancelLabelTextParams !== void 0 ? cancelLabelTextParams : t('Cancel');