@teamix/pro 1.4.15 → 1.4.16

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
@@ -75930,14 +75930,15 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
75930
75930
 
75931
75931
 
75932
75932
  function eventHandler(action, actionContext, onTrigger) {
75933
- var _ref;
75933
+ var _baseProps;
75934
75934
 
75935
75935
  var _action$trigger = action.trigger,
75936
75936
  trigger = _action$trigger === void 0 ? 'onClick' : _action$trigger,
75937
75937
  preventDefault = action.preventDefault,
75938
75938
  stopPropagation = action.stopPropagation,
75939
75939
  beforeAction = action.beforeAction;
75940
- return _ref = {}, _ref["" + trigger] = function () {
75940
+ var openIdentifier = action.openIdentifier;
75941
+ var baseProps = (_baseProps = {}, _baseProps["" + trigger] = function () {
75941
75942
  var _2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(e) {
75942
75943
  var beforeActionContext;
75943
75944
  return regeneratorRuntime.wrap(function _callee$(_context) {
@@ -75996,7 +75997,15 @@ function eventHandler(action, actionContext, onTrigger) {
75996
75997
  }
75997
75998
 
75998
75999
  return _;
75999
- }(), _ref;
76000
+ }(), _baseProps);
76001
+
76002
+ if (openIdentifier) {
76003
+ baseProps = Object.assign({}, baseProps, {
76004
+ id: openIdentifier
76005
+ });
76006
+ }
76007
+
76008
+ return baseProps;
76000
76009
  }
76001
76010
  /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (eventHandler)));
76002
76011
 
@@ -76399,9 +76408,10 @@ function useDialogTableAction(action, context) {
76399
76408
  /* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(94891);
76400
76409
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(54842);
76401
76410
  /* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(67096);
76402
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(95983);
76411
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(95983);
76412
+ /* harmony import */ var _teamix_hooks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42341);
76403
76413
  var _excluded = ["trigger", "url", "customRequest", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError", "onOk", "onCancel"],
76404
- _excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "popType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "message", "footerDescription", "footerAlign", "className"];
76414
+ _excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "popType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "message", "footerDescription", "footerAlign", "className", "openIdentifier"];
76405
76415
 
76406
76416
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
76407
76417
 
@@ -76423,6 +76433,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
76423
76433
 
76424
76434
 
76425
76435
 
76436
+
76426
76437
  function addContextForReactNode(content, context) {
76427
76438
  if (typeof content === 'function' && context) {
76428
76439
  return content(context);
@@ -76464,6 +76475,10 @@ function useDialogAction(action, actionContext, hasForm) {
76464
76475
  var footerDescriptionRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
76465
76476
  var history = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useHistory)();
76466
76477
 
76478
+ var _useUrlState = (0,_teamix_hooks__WEBPACK_IMPORTED_MODULE_10__.useUrlState)(),
76479
+ urlState = _useUrlState[0],
76480
+ setUrlState = _useUrlState[1];
76481
+
76467
76482
  var onActionStart = function onActionStart(context, e) {
76468
76483
  var _extends2;
76469
76484
 
@@ -76504,7 +76519,18 @@ function useDialogAction(action, actionContext, hasForm) {
76504
76519
  footerDescription = _getTargetValue.footerDescription,
76505
76520
  footerAlign = _getTargetValue.footerAlign,
76506
76521
  className = _getTargetValue.className,
76522
+ openIdentifier = _getTargetValue.openIdentifier,
76507
76523
  containerOtherProps = _objectWithoutPropertiesLoose(_getTargetValue, _excluded2);
76524
+ /**
76525
+ * 判断是否含有 openIdentifierIdentifiy参数 ,更改对应 url
76526
+ */
76527
+
76528
+
76529
+ if (openIdentifier) {
76530
+ setUrlState({
76531
+ openIdentifier: openIdentifier
76532
+ });
76533
+ }
76508
76534
 
76509
76535
  var isDrawer = dialogType === 'drawer';
76510
76536
  var isPop = dialogType === 'pop';
@@ -76610,10 +76636,18 @@ function useDialogAction(action, actionContext, hasForm) {
76610
76636
  var dialogContext = Object.assign({}, context, {
76611
76637
  hide: hide
76612
76638
  });
76613
- var dialogContent = Component ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Component, (0,_utils__WEBPACK_IMPORTED_MODULE_10__/* .addContext */ .F)(componentProps, dialogContext)) : addContextForReactNode(content, dialogContext);
76639
+ var dialogContent = Component ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Component, (0,_utils__WEBPACK_IMPORTED_MODULE_11__/* .addContext */ .F)(componentProps, dialogContext)) : addContextForReactNode(content, dialogContext);
76614
76640
 
76615
76641
  var quickShowProps = _extends((_extends2 = {}, _extends2["" + (isPop ? 'onConfirm' : 'onOk')] = onOk, _extends2.onCancel = function onCancel() {
76642
+ setUrlState({
76643
+ openIdentifier: undefined
76644
+ });
76616
76645
  propsOnCancel && propsOnCancel(context);
76646
+ }, _extends2.onClose = function onClose() {
76647
+ setUrlState({
76648
+ openIdentifier: undefined
76649
+ });
76650
+ hide == null ? void 0 : hide();
76617
76651
  }, _extends2.title = addContextForReactNode(title, dialogContext), _extends2.content = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, beforeContent && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
76618
76652
  className: "teamix-pro-dialog-before-content"
76619
76653
  }, addContextForReactNode(beforeContent, dialogContext)), message && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
@@ -76699,10 +76733,19 @@ function useDrawerTableAction(action, context) {
76699
76733
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
76700
76734
  /* harmony export */ "T": () => (/* binding */ useDrawerAction)
76701
76735
  /* harmony export */ });
76702
- /* harmony import */ var _dialog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28653);
76736
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59787);
76737
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
76738
+ /* harmony import */ var _dialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28653);
76739
+
76703
76740
 
76704
76741
  function useDrawerAction(action, context) {
76705
- return (0,_dialog__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(Object.assign({
76742
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
76743
+ var _action$openIdentifie, _action$openIdentifie2;
76744
+
76745
+ var dom = document.getElementById((_action$openIdentifie = (_action$openIdentifie2 = action.openIdentifier) == null ? void 0 : _action$openIdentifie2.toString()) != null ? _action$openIdentifie : '');
76746
+ dom == null ? void 0 : dom.click();
76747
+ }, []);
76748
+ return (0,_dialog__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(Object.assign({
76706
76749
  dialogType: 'drawer'
76707
76750
  }, action), context);
76708
76751
  }
@@ -80034,9 +80077,11 @@ var ProForm = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(function
80034
80077
  var mergedComponents = _extends({}, globalComponents, components, formilyComponents, _Components_ProField__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
80035
80078
 
80036
80079
  var onAutoSubmit = (0,_useAutoSubmit__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)(onSubmit, context);
80080
+ console.log(otherProps);
80037
80081
  var autoTeamixLayout = (0,_useAutoLayout__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z)(_extends({}, otherProps, {
80038
80082
  schema: schema
80039
80083
  }), formRef);
80084
+ console.log(autoTeamixLayout);
80040
80085
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
80041
80086
  // 配置表单默认值
80042
80087
  if (initialValues) {
@@ -80130,7 +80175,7 @@ var useAutoLayout = function useAutoLayout(_ref, formRef) {
80130
80175
  autoLabel = _ref2.autoLabel;
80131
80176
 
80132
80177
  var breakpoints = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
80133
- return autoLabel ? false : breakpoints;
80178
+ return autoLabel ? false : outBreakpoints;
80134
80179
  }, []); // 当前断点不支持Col更新
80135
80180
 
80136
80181
  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
@@ -80901,7 +80946,8 @@ var initialize = function initialize(item) {
80901
80946
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
80902
80947
  /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
80903
80948
  /* harmony export */ });
80904
- var _excluded = ["title", "decoratorProps"];
80949
+ var _excluded = ["title", "decoratorProps"],
80950
+ _excluded2 = ["title", "dataIndex", "cell", "htmlTitle", "sortable", "width", "align", "alignHeader", "filters", "filterMode", "filterMenuProps", "lock", "resizable", "colSpan"];
80905
80951
 
80906
80952
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
80907
80953
 
@@ -80909,16 +80955,49 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
80909
80955
 
80910
80956
  var initializeColumn = function initializeColumn(item) {
80911
80957
  var title = item.title,
80912
- decoratorProps = item.decoratorProps,
80913
- children = _objectWithoutPropertiesLoose(item, _excluded);
80914
-
80958
+ _item$decoratorProps = item.decoratorProps,
80959
+ decoratorProps = _item$decoratorProps === void 0 ? {} : _item$decoratorProps,
80960
+ children = _objectWithoutPropertiesLoose(item, _excluded); // 将Table.Column属性和组件FormItem属性通过decoratorProps统一传入,再分别赋值
80961
+
80962
+
80963
+ var columnTitle = decoratorProps.title,
80964
+ dataIndex = decoratorProps.dataIndex,
80965
+ cell = decoratorProps.cell,
80966
+ htmlTitle = decoratorProps.htmlTitle,
80967
+ sortable = decoratorProps.sortable,
80968
+ width = decoratorProps.width,
80969
+ align = decoratorProps.align,
80970
+ alignHeader = decoratorProps.alignHeader,
80971
+ filters = decoratorProps.filters,
80972
+ filterMode = decoratorProps.filterMode,
80973
+ filterMenuProps = decoratorProps.filterMenuProps,
80974
+ lock = decoratorProps.lock,
80975
+ resizable = decoratorProps.resizable,
80976
+ colSpan = decoratorProps.colSpan,
80977
+ formItemDecoratorProps = _objectWithoutPropertiesLoose(decoratorProps, _excluded2);
80978
+
80979
+ var columnProperties = {
80980
+ title: title != null ? title : columnTitle,
80981
+ dataIndex: dataIndex,
80982
+ cell: cell,
80983
+ htmlTitle: htmlTitle,
80984
+ sortable: sortable,
80985
+ width: width,
80986
+ align: align,
80987
+ alignHeader: alignHeader,
80988
+ filters: filters,
80989
+ filterMode: filterMode,
80990
+ filterMenuProps: filterMenuProps,
80991
+ lock: lock,
80992
+ resizable: resizable,
80993
+ colSpan: colSpan
80994
+ };
80915
80995
  return {
80916
80996
  component: 'ArrayTable.Column',
80917
- props: _extends({}, decoratorProps, {
80918
- // 将ArrayTable.Column理解为decorator,传入decoratorProps作为component的props
80919
- title: title
80920
- }),
80921
- children: [_extends({}, children)]
80997
+ props: columnProperties,
80998
+ children: [_extends({}, children, {
80999
+ decoratorProps: formItemDecoratorProps
81000
+ })]
80922
81001
  };
80923
81002
  };
80924
81003
 
@@ -82585,7 +82664,7 @@ if (!((_window = window) != null && _window.TEAMIXPRO_WITHOUT_ICON)) {
82585
82664
 
82586
82665
 
82587
82666
 
82588
- var version = '1.4.15';
82667
+ var version = '1.4.16';
82589
82668
 
82590
82669
 
82591
82670
  /***/ }),
@@ -87644,16 +87723,18 @@ var Layout = function Layout(props) {
87644
87723
  // 没传 dataFilter 但是传了 mainAction
87645
87724
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_form__WEBPACK_IMPORTED_MODULE_4__/* .QueryFilterLayout */ .rx, {
87646
87725
  addonBefore: renderMainAction(),
87647
- addonAfter: renderAddonAfter()
87648
- }), afterDataFilter && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
87649
- className: "mb8 " + cls('after-data-filter-wrapper')
87650
- }, afterDataFilter));
87726
+ addonAfter: renderAddonAfter(),
87727
+ children: afterDataFilter ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
87728
+ className: "mb8 " + cls('after-data-filter-wrapper')
87729
+ }, afterDataFilter) : null
87730
+ }));
87651
87731
  } else {
87652
87732
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_form__WEBPACK_IMPORTED_MODULE_4__/* .QueryFilterLayout */ .rx, {
87653
- addonAfter: renderAddonAfter()
87654
- }), ' ', afterDataFilter && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
87655
- className: "mb8 " + cls('after-data-filter-wrapper')
87656
- }, afterDataFilter));
87733
+ addonAfter: renderAddonAfter(),
87734
+ children: afterDataFilter ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
87735
+ className: "mb8 " + cls('after-data-filter-wrapper')
87736
+ }, afterDataFilter) : null
87737
+ }));
87657
87738
  }
87658
87739
  }; // 区域组合渲染
87659
87740