@datarobot/design-system 29.7.1 → 29.7.3
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/cjs/file-uploader/file-uploader.js +5 -2
- package/cjs/table/tooltip-cell.d.ts +1 -1
- package/cjs/table/tooltip-cell.js +6 -4
- package/esm/file-uploader/file-uploader.js +5 -2
- package/esm/table/tooltip-cell.d.ts +1 -1
- package/esm/table/tooltip-cell.js +6 -4
- package/js/bundle/bundle.js +19 -10
- package/js/bundle/bundle.min.js +1 -1
- package/js/bundle/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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 =
|
|
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');
|
|
@@ -5,5 +5,5 @@ type TooltipCellProps = {
|
|
|
5
5
|
/**
|
|
6
6
|
* Adds tooltip for cells with simple string value
|
|
7
7
|
*/
|
|
8
|
-
export default function TooltipCell({ value, testId, }: TooltipCellProps): import("react/jsx-runtime").JSX.Element
|
|
8
|
+
export default function TooltipCell({ value, testId, }: TooltipCellProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = TooltipCell;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _useTranslation = require("../hooks/use-translation");
|
|
8
9
|
var _truncateWithTooltip = require("../truncate-with-tooltip");
|
|
9
10
|
var _tooltip = require("../tooltip");
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -16,14 +17,15 @@ function TooltipCell({
|
|
|
16
17
|
value,
|
|
17
18
|
testId = 'tooltip-cell'
|
|
18
19
|
}) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
20
|
+
const {
|
|
21
|
+
t
|
|
22
|
+
} = (0, _useTranslation.useTranslation)();
|
|
23
|
+
const valueText = value == null || value === '' ? t('N/A') : value;
|
|
22
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_truncateWithTooltip.TruncateWithTooltip, {
|
|
23
25
|
tooltipPlacement: _tooltip.TOOLTIP_PLACEMENT_TYPES.TOP,
|
|
24
26
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
25
27
|
"test-id": testId,
|
|
26
|
-
children:
|
|
28
|
+
children: valueText
|
|
27
29
|
})
|
|
28
30
|
});
|
|
29
31
|
}
|
|
@@ -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 =
|
|
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');
|
|
@@ -5,5 +5,5 @@ type TooltipCellProps = {
|
|
|
5
5
|
/**
|
|
6
6
|
* Adds tooltip for cells with simple string value
|
|
7
7
|
*/
|
|
8
|
-
export default function TooltipCell({ value, testId, }: TooltipCellProps): import("react/jsx-runtime").JSX.Element
|
|
8
|
+
export default function TooltipCell({ value, testId, }: TooltipCellProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useTranslation } from '../hooks/use-translation';
|
|
2
3
|
import { TruncateWithTooltip } from '../truncate-with-tooltip';
|
|
3
4
|
import { TOOLTIP_PLACEMENT_TYPES } from '../tooltip';
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -9,14 +10,15 @@ export default function TooltipCell({
|
|
|
9
10
|
value,
|
|
10
11
|
testId = 'tooltip-cell'
|
|
11
12
|
}) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
13
|
+
const {
|
|
14
|
+
t
|
|
15
|
+
} = useTranslation();
|
|
16
|
+
const valueText = value == null || value === '' ? t('N/A') : value;
|
|
15
17
|
return /*#__PURE__*/_jsx(TruncateWithTooltip, {
|
|
16
18
|
tooltipPlacement: TOOLTIP_PLACEMENT_TYPES.TOP,
|
|
17
19
|
children: /*#__PURE__*/_jsx("span", {
|
|
18
20
|
"test-id": testId,
|
|
19
|
-
children:
|
|
21
|
+
children: valueText
|
|
20
22
|
})
|
|
21
23
|
});
|
|
22
24
|
}
|
package/js/bundle/bundle.js
CHANGED
|
@@ -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
|
-
|
|
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 =
|
|
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');
|
|
@@ -80479,8 +80486,10 @@ Table.displayName = 'Table';
|
|
|
80479
80486
|
/* harmony export */ });
|
|
80480
80487
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
80481
80488
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
80482
|
-
/* harmony import */ var
|
|
80483
|
-
/* harmony import */ var
|
|
80489
|
+
/* harmony import */ var _hooks_use_translation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hooks/use-translation */ "./src/components/hooks/use-translation/index.ts");
|
|
80490
|
+
/* harmony import */ var _truncate_with_tooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../truncate-with-tooltip */ "./src/components/truncate-with-tooltip/index.ts");
|
|
80491
|
+
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../tooltip */ "./src/components/tooltip/index.ts");
|
|
80492
|
+
|
|
80484
80493
|
|
|
80485
80494
|
|
|
80486
80495
|
|
|
@@ -80491,14 +80500,14 @@ function TooltipCell(_ref) {
|
|
|
80491
80500
|
var value = _ref.value,
|
|
80492
80501
|
_ref$testId = _ref.testId,
|
|
80493
80502
|
testId = _ref$testId === void 0 ? 'tooltip-cell' : _ref$testId;
|
|
80494
|
-
|
|
80495
|
-
|
|
80496
|
-
|
|
80497
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
80498
|
-
tooltipPlacement:
|
|
80503
|
+
var _useTranslation = (0,_hooks_use_translation__WEBPACK_IMPORTED_MODULE_1__.useTranslation)(),
|
|
80504
|
+
t = _useTranslation.t;
|
|
80505
|
+
var valueText = value == null || value === '' ? t('N/A') : value;
|
|
80506
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_truncate_with_tooltip__WEBPACK_IMPORTED_MODULE_2__.TruncateWithTooltip, {
|
|
80507
|
+
tooltipPlacement: _tooltip__WEBPACK_IMPORTED_MODULE_3__.TOOLTIP_PLACEMENT_TYPES.TOP
|
|
80499
80508
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
|
|
80500
80509
|
"test-id": testId
|
|
80501
|
-
},
|
|
80510
|
+
}, valueText));
|
|
80502
80511
|
}
|
|
80503
80512
|
|
|
80504
80513
|
/***/ }),
|