@capillarytech/blaze-ui 4.13.0 → 4.13.1-beta.0

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.
@@ -3622,28 +3622,38 @@ module.exports = arrayPush;
3622
3622
  exports.__esModule = true;
3623
3623
  exports["default"] = void 0;
3624
3624
  var _classnames = _interopRequireDefault(__webpack_require__(46942));
3625
- var _propTypes = _interopRequireDefault(__webpack_require__(43363));
3626
3625
  var _react = _interopRequireDefault(__webpack_require__(9206));
3626
+ var _reactIntl = __webpack_require__(46407);
3627
3627
  var _CapLabel = _interopRequireDefault(__webpack_require__(92675));
3628
3628
  var _CapRow = _interopRequireDefault(__webpack_require__(69813));
3629
3629
  var _CapTooltip = _interopRequireDefault(__webpack_require__(85684));
3630
- var _LocaleHoc = _interopRequireDefault(__webpack_require__(39879));
3630
+ var _messages = _interopRequireDefault(__webpack_require__(74891));
3631
3631
  var _jsxRuntime = __webpack_require__(74848);
3632
+ const _excluded = ["intl", "list", "showNumber", "capLabelType", "more", "showTooltip", "truncateToWidth", "className"];
3632
3633
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
3633
- const CapTruncateList = props => {
3634
- const {
3635
- list,
3636
- showNumber = 1,
3637
- capLabelType,
3638
- more: moreMsg,
3639
- showTooltip,
3640
- truncateToWidth
3641
- } = props;
3634
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3635
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
3636
+ const CapTruncateList = _ref => {
3637
+ let {
3638
+ intl: {
3639
+ formatMessage
3640
+ },
3641
+ list = [],
3642
+ showNumber = 1,
3643
+ capLabelType = 'label1',
3644
+ more,
3645
+ showTooltip = true,
3646
+ truncateToWidth = false,
3647
+ className
3648
+ } = _ref,
3649
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
3642
3650
  const visibleList = list.slice(0, showNumber);
3643
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
3651
+ const moreMessage = more || formatMessage(_messages.default.more);
3652
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, _extends({
3644
3653
  type: "flex",
3645
3654
  align: "middle",
3646
- className: "cap-truncate-list",
3655
+ className: (0, _classnames.default)('cap-truncate-list', className)
3656
+ }, rest, {
3647
3657
  children: [visibleList.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, {
3648
3658
  className: (0, _classnames.default)({
3649
3659
  'truncate-text': truncateToWidth,
@@ -3664,33 +3674,16 @@ const CapTruncateList = props => {
3664
3674
  title: list.slice(showNumber).join(', '),
3665
3675
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
3666
3676
  type: capLabelType,
3667
- children: "+" + (list.length - visibleList.length) + " " + moreMsg
3677
+ children: "+" + (list.length - visibleList.length) + " " + moreMessage
3668
3678
  })
3669
3679
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapLabel.default, {
3670
3680
  type: capLabelType,
3671
- children: "+" + (list.length - visibleList.length) + " " + moreMsg
3681
+ children: "+" + (list.length - visibleList.length) + " " + moreMessage
3672
3682
  })
3673
3683
  }) : null]
3674
- });
3675
- };
3676
- CapTruncateList.defaultProps = {
3677
- list: [],
3678
- showNumber: 1,
3679
- capLabelType: 'label1',
3680
- showTooltip: true,
3681
- truncateToWidth: false
3682
- };
3683
- CapTruncateList.propTypes = {
3684
- list: _propTypes.default.array,
3685
- showNumber: _propTypes.default.number,
3686
- capLabelType: _propTypes.default.string,
3687
- more: _propTypes.default.string,
3688
- showTooltip: _propTypes.default.bool,
3689
- truncateToWidth: _propTypes.default.bool
3684
+ }));
3690
3685
  };
3691
- var _default = exports["default"] = (0, _LocaleHoc.default)(CapTruncateList, {
3692
- key: 'CapTruncateList'
3693
- });
3686
+ var _default = exports["default"] = (0, _reactIntl.injectIntl)(CapTruncateList);
3694
3687
 
3695
3688
  /***/ }),
3696
3689
 
@@ -15177,6 +15170,25 @@ if (true) {
15177
15170
  {}
15178
15171
 
15179
15172
 
15173
+ /***/ }),
15174
+
15175
+ /***/ 74891:
15176
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15177
+
15178
+ "use strict";
15179
+
15180
+
15181
+ exports.__esModule = true;
15182
+ exports["default"] = void 0;
15183
+ var _reactIntl = __webpack_require__(46407);
15184
+ const scope = 'app.commonUtils.capUiLibrary.CapTruncateList';
15185
+ var _default = exports["default"] = (0, _reactIntl.defineMessages)({
15186
+ more: {
15187
+ id: scope + ".more",
15188
+ defaultMessage: 'more'
15189
+ }
15190
+ });
15191
+
15180
15192
  /***/ }),
15181
15193
 
15182
15194
  /***/ 75288: