@teamix/pro 1.1.36 → 1.1.37

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/dist/pro.js CHANGED
@@ -59745,7 +59745,9 @@ var ProAction = function ProAction(props) {
59745
59745
  /* harmony export */ "R": () => (/* binding */ useLinkAction)
59746
59746
  /* harmony export */ });
59747
59747
  /* harmony import */ var _teamix_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80653);
59748
- /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54842);
59748
+ /* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18944);
59749
+ /* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_1__);
59750
+ /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(54842);
59749
59751
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
59750
59752
 
59751
59753
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -59754,10 +59756,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
59754
59756
 
59755
59757
 
59756
59758
 
59759
+
59757
59760
  function useLinkAction(action, context) {
59758
- var linkAction = (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_0__.getTargetValue)(action, context);
59759
- return _objectSpread({}, (0,_base__WEBPACK_IMPORTED_MODULE_1__/* .eventHandler */ .$)(action, function () {
59760
- (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_0__.goToLink)(linkAction);
59761
+ var history = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_1__.useHistory)();
59762
+ return _objectSpread({}, (0,_base__WEBPACK_IMPORTED_MODULE_2__/* .eventHandler */ .$)(action, function () {
59763
+ var linkAction = (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_0__.getTargetValue)(action, context);
59764
+ (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_0__.goToLink)(linkAction, history);
59761
59765
  }));
59762
59766
  }
59763
59767
  /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (useLinkAction)));
@@ -65733,7 +65737,8 @@ var PlayGround = function PlayGround(props) {
65733
65737
  /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28758);
65734
65738
  /* harmony import */ var _skeleton__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(53277);
65735
65739
  /* harmony import */ var _info__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27872);
65736
- var _excluded = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
65740
+ var _excluded = ["text", "children", "closable"],
65741
+ _excluded2 = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
65737
65742
 
65738
65743
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
65739
65744
 
@@ -65803,15 +65808,29 @@ var renderTags = function renderTags(tags) {
65803
65808
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_4__.Tag.Group, {
65804
65809
  className: cls('tags')
65805
65810
  }, tags.map(function (tag, i) {
65806
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_4__.Tag, {
65811
+ // @ts-ignore
65812
+ var text = tag.text,
65813
+ children = tag.children,
65814
+ closable = tag.closable,
65815
+ others = _objectWithoutPropertiesLoose(tag, _excluded);
65816
+
65817
+ if (closable) {
65818
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_4__.Tag.Closeable, _extends({
65819
+ key: i,
65820
+ size: "large",
65821
+ style: {
65822
+ marginBottom: 0
65823
+ }
65824
+ }, others), text || children);
65825
+ }
65826
+
65827
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_4__.Tag, _extends({
65807
65828
  key: i,
65808
65829
  size: "large",
65809
- type: tag.type,
65810
- color: tag.color,
65811
65830
  style: {
65812
65831
  marginBottom: 0
65813
65832
  }
65814
- }, tag.text);
65833
+ }, others), text || children);
65815
65834
  }));
65816
65835
  };
65817
65836
 
@@ -65896,7 +65915,7 @@ var PageHeader = function PageHeader(props) {
65896
65915
  children = props.children,
65897
65916
  className = props.className,
65898
65917
  style = props.style,
65899
- others = _objectWithoutPropertiesLoose(props, _excluded);
65918
+ others = _objectWithoutPropertiesLoose(props, _excluded2);
65900
65919
 
65901
65920
  var history = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_1__.useHistory)();
65902
65921
  var backgroundImage = image ? "url('" + image + "')" : undefined;
@@ -68726,7 +68745,9 @@ var isHTMLElement = function isHTMLElement(target) {
68726
68745
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
68727
68746
  /* harmony import */ var _alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33049);
68728
68747
  /* harmony import */ var _alicloudfe_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__);
68729
- /* harmony import */ var ahooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(86018);
68748
+ /* harmony import */ var ahooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26245);
68749
+ /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39339);
68750
+ /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_3__);
68730
68751
  var _excluded = ["children", "className", "ellipsisPosition", "endCharCount", "tooltipProps", "rows", "tooltip", "style"];
68731
68752
 
68732
68753
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
@@ -68742,10 +68763,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
68742
68763
 
68743
68764
 
68744
68765
 
68766
+
68745
68767
  var Tooltip = _alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Balloon.Tooltip;
68746
68768
 
68747
68769
  var Ellipsis = function Ellipsis(props) {
68748
- var _cls2;
68770
+ var _cls;
68749
68771
 
68750
68772
  var children = props.children,
68751
68773
  className = props.className,
@@ -68759,13 +68781,14 @@ var Ellipsis = function Ellipsis(props) {
68759
68781
  otherProps = _objectWithoutPropertiesLoose(props, _excluded);
68760
68782
 
68761
68783
  var textRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
68784
+ var contentRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
68762
68785
 
68763
68786
  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
68764
68787
  tooltipVisible = _useState[0],
68765
68788
  setTooltipVisible = _useState[1];
68766
68789
 
68767
- var responsive = (0,ahooks__WEBPACK_IMPORTED_MODULE_3__/* .useResponsive */ .F)();
68768
- (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
68790
+ var contentSize = (0,ahooks__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(contentRef);
68791
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(lodash_debounce__WEBPACK_IMPORTED_MODULE_3___default()(function () {
68769
68792
  var _textRef$current$offs, _textRef$current, _textRef$current$scro, _textRef$current2, _textRef$current$offs2, _textRef$current3, _textRef$current$scro2, _textRef$current4;
68770
68793
 
68771
68794
  var visible = false;
@@ -68783,41 +68806,29 @@ var Ellipsis = function Ellipsis(props) {
68783
68806
  }
68784
68807
 
68785
68808
  setTooltipVisible(visible);
68786
- }, [responsive]);
68787
-
68788
- if (tooltipVisible && tooltip !== false) {
68789
- var _cls;
68790
-
68791
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Tooltip, {
68792
- trigger: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", {
68793
- ref: textRef,
68794
- style: _objectSpread({
68795
- WebkitLineClamp: rows
68796
- }, style),
68797
- className: classnames__WEBPACK_IMPORTED_MODULE_0___default()((_cls = {
68798
- 'teamix-pro-ellipsis': true
68799
- }, _cls[className != null ? className : ''] = true, _cls))
68800
- }, children),
68801
- align: "t",
68802
- popupProps: {
68803
- offset: [0, -6],
68804
- animation: {
68805
- "in": 'fadeIn',
68806
- out: 'fadeOut'
68807
- }
68808
- }
68809
- }, tooltip == null ? void 0 : tooltip.toString());
68810
- }
68811
-
68812
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", {
68809
+ }, 300), [contentSize, children]);
68810
+ var renderContent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", {
68813
68811
  ref: textRef,
68814
- style: {
68812
+ style: _objectSpread({
68815
68813
  WebkitLineClamp: rows
68816
- },
68817
- className: classnames__WEBPACK_IMPORTED_MODULE_0___default()((_cls2 = {
68818
- 'teamix-pro-field-ellipsis': true
68819
- }, _cls2[className != null ? className : ''] = true, _cls2))
68814
+ }, style),
68815
+ className: classnames__WEBPACK_IMPORTED_MODULE_0___default()((_cls = {
68816
+ 'teamix-pro-ellipsis': true
68817
+ }, _cls[className != null ? className : ''] = true, _cls))
68820
68818
  }, children);
68819
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", {
68820
+ ref: contentRef
68821
+ }, tooltipVisible && tooltip !== false && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Tooltip, {
68822
+ trigger: renderContent,
68823
+ align: "t",
68824
+ popupProps: {
68825
+ offset: [0, -6],
68826
+ animation: {
68827
+ "in": 'fadeIn',
68828
+ out: 'fadeOut'
68829
+ }
68830
+ }
68831
+ }, tooltip == null ? void 0 : tooltip.toString()), (!tooltipVisible || tooltip === false) && renderContent);
68821
68832
  };
68822
68833
 
68823
68834
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Ellipsis);
@@ -69252,7 +69263,27 @@ var getTeamixIconConfig = function getTeamixIconConfig() {
69252
69263
  /* harmony export */ });
69253
69264
  var GLOBAL_CONFIG = {};
69254
69265
  function setGlobalConfig(config) {
69255
- GLOBAL_CONFIG = config;
69266
+ if (!config) {
69267
+ return;
69268
+ }
69269
+
69270
+ for (var key in config) {
69271
+ var configKey = key;
69272
+
69273
+ if (Object.prototype.hasOwnProperty.call(config, configKey)) {
69274
+ (function () {
69275
+ var configValue = config[configKey];
69276
+
69277
+ if (configKey === 'history') {
69278
+ GLOBAL_CONFIG[configKey] = typeof configValue === 'undefined' ? function () {
69279
+ return configValue;
69280
+ } : configValue;
69281
+ } else {
69282
+ GLOBAL_CONFIG[configKey] = configValue;
69283
+ }
69284
+ })();
69285
+ }
69286
+ }
69256
69287
  }
69257
69288
  function updateGlobalConfig(key, value) {
69258
69289
  GLOBAL_CONFIG[key] = value;
@@ -69400,7 +69431,8 @@ function goToLink(link, history) {
69400
69431
  return;
69401
69432
  }
69402
69433
 
69403
- var globalHistory = (0,_globalConfig__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalConfig */ .Hi)('history');
69434
+ var globalConfigHistory = (0,_globalConfig__WEBPACK_IMPORTED_MODULE_0__/* .getGlobalConfig */ .Hi)('history');
69435
+ var globalHistory = typeof globalConfigHistory === 'function' ? globalConfigHistory() : globalConfigHistory;
69404
69436
  var historyPushMethod = (globalHistory == null ? void 0 : globalHistory.push) || (history == null ? void 0 : history.push);
69405
69437
 
69406
69438
  if (typeof historyPushMethod !== 'function' || /^https?:\/\//.test(href)) {