antd-management-fast-framework 1.9.18 → 1.9.31

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.
Files changed (41) hide show
  1. package/es/configGroup/configGeneral.d.ts +47 -0
  2. package/es/configGroup/configGeneral.js +61 -0
  3. package/es/configGroup/themeCollection.d.ts +29 -0
  4. package/es/configGroup/themeCollection.js +117 -0
  5. package/es/configGroup/webpackPlugin.d.ts +11 -0
  6. package/es/configGroup/webpackPlugin.js +166 -0
  7. package/es/customComponents/PageLoading/index.d.ts +2 -0
  8. package/es/customComponents/PageLoading/index.js +13 -0
  9. package/es/framework/Base/index.d.ts +25 -2
  10. package/es/framework/Base/index.js +164 -6
  11. package/es/framework/ButtonExtension/SelectButton/Base/index.d.ts +1 -1
  12. package/es/framework/ButtonExtension/SelectButton/Base/index.js +2 -2
  13. package/es/framework/Common/index.d.ts +18 -6
  14. package/es/framework/Common/index.js +228 -144
  15. package/es/framework/DataDrawer/Base/index.d.ts +1 -1
  16. package/es/framework/DataDrawer/Base/index.js +2 -2
  17. package/es/framework/DataDrawer/BaseLoadDrawer/index.js +2 -6
  18. package/es/framework/DataForm/BaseAddForm/index.js +42 -27
  19. package/es/framework/DataForm/BaseUpdateForm/index.js +42 -31
  20. package/es/framework/DataForm/BaseUpdateFormContent/index.js +2 -2
  21. package/es/framework/DataListView/Base/index.d.ts +2 -1
  22. package/es/framework/DataListView/Base/index.js +9 -15
  23. package/es/framework/DataMenuContainer/index.d.ts +1 -1
  24. package/es/framework/DataMenuContainer/index.js +2 -2
  25. package/es/framework/DataModal/Base/index.d.ts +1 -1
  26. package/es/framework/DataModal/Base/index.js +3 -3
  27. package/es/framework/DataModal/BaseLoadModal/index.js +3 -11
  28. package/es/framework/DataModal/BaseUpdateTransferModal/index.js +1 -1
  29. package/es/framework/DataMultiPageView/MultiPage/index.js +3 -4
  30. package/es/framework/DataMultiPageView/MultiPageDrawer/index.js +6 -10
  31. package/es/framework/DataOperation/BaseWindow/index.js +41 -30
  32. package/es/framework/DataSinglePageView/SinglePage/index.js +1 -3
  33. package/es/framework/DataSinglePageView/SinglePageDrawer/index.js +2 -2
  34. package/es/framework/DataSingleView/DataCore/index.d.ts +1 -1
  35. package/es/framework/DataSingleView/DataCore/index.js +2 -2
  36. package/es/framework/DataTabContainer/index.js +2 -2
  37. package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.d.ts +1 -1
  38. package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.js +4 -7
  39. package/es/utils/actionAssist.js +67 -54
  40. package/es/utils/requestAssistor.js +15 -6
  41. package/package.json +10 -9
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -37,11 +35,89 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
37
35
 
38
36
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
37
 
40
- var Base = /*#__PURE__*/function (_PureComponent) {
41
- _inherits(Base, _PureComponent);
38
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
39
+
40
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
41
+
42
+ 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."); }
43
+
44
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
45
+
46
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
47
+
48
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
49
+
50
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
51
+
52
+ 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; }
53
+
54
+ 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; }
55
+
56
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
57
+
58
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
59
+
60
+ function filterModel(props) {
61
+ var result = _objectSpread({}, props);
62
+
63
+ delete result.loading;
64
+ Object.entries(result).forEach(function (o) {
65
+ var _o = _slicedToArray(o, 2),
66
+ k = _o[0],
67
+ v = _o[1];
68
+
69
+ if ((0, _tools.isObject)(v)) {
70
+ if (!!v.fromRemote) {
71
+ delete result[k];
72
+ }
73
+ }
74
+ });
75
+ return result;
76
+ }
77
+ /**
78
+ * Performs equality by iterating through keys on an object and returning false
79
+ * when any key has values which are not strictly equal between the arguments.
80
+ * Returns true when the values of all keys are strictly equal.
81
+ */
82
+
83
+
84
+ function shallowEqual(a, b) {
85
+ // 调用Object.is判断是否相等,相同返回true,不同返回false
86
+ if (Object.is(a, b)) {
87
+ return true;
88
+ } // object.is比较发现不等,但并不代表真的不等,object对象还需要比较
89
+ // 这里判断是否是object,如果不是,那直接返回false
90
+
91
+
92
+ if (_typeof(a) !== 'object' || a === null || _typeof(b) !== 'object' || b === null) {
93
+ return false;
94
+ }
95
+
96
+ var keysA = Object.keys(a);
97
+ var keysB = Object.keys(b); // 比较对象中的keys长度,不等返回false
98
+
99
+ if (keysA.length !== keysB.length) {
100
+ return false;
101
+ } // 比较对象中相同的key的val是否相等
102
+
103
+
104
+ for (var i = 0; i < keysA.length; i++) {
105
+ if (!hasOwnProperty.call(b, keysA[i]) || !Object.is(a[keysA[i]], b[keysA[i]])) {
106
+ return false;
107
+ }
108
+ }
109
+
110
+ return true;
111
+ }
112
+
113
+ var Base = /*#__PURE__*/function (_Component) {
114
+ _inherits(Base, _Component);
42
115
 
43
116
  var _super = _createSuper(Base);
44
117
 
118
+ /**
119
+ *显示render次数开关,用于开发时候调试页面渲染性能
120
+ */
45
121
  function Base(props) {
46
122
  var _this;
47
123
 
@@ -49,9 +125,15 @@ var Base = /*#__PURE__*/function (_PureComponent) {
49
125
 
50
126
  _this = _super.call(this, props);
51
127
  _this.mounted = false;
128
+ _this.showRenderCountInConsole = false;
129
+ _this.renderCount = 0;
52
130
 
53
131
  _this.doDidMountTask = function () {};
54
132
 
133
+ _this.doOtherCheckComponentUpdate = function (nextProps, nextState) {
134
+ return null;
135
+ };
136
+
55
137
  _this.doWhenGetSnapshotBeforeUpdate = function (preProps, preState) {
56
138
  return null;
57
139
  };
@@ -123,6 +205,28 @@ var Base = /*#__PURE__*/function (_PureComponent) {
123
205
  value: function componentDidUpdate(preProps, preState, snapshot) {
124
206
  this.doWorkWhenDidUpdate(preProps, preState, snapshot);
125
207
  }
208
+ }, {
209
+ key: "shouldComponentUpdate",
210
+ value: function shouldComponentUpdate(nextProps, nextState) {
211
+ var _dispatchComplete$nex = _objectSpread(_objectSpread({}, {
212
+ dispatchComplete: true
213
+ }), nextState),
214
+ dispatchComplete = _dispatchComplete$nex.dispatchComplete;
215
+
216
+ if (!!!dispatchComplete) {
217
+ return false;
218
+ }
219
+
220
+ var checkComponentUpdate = this.doOtherCheckComponentUpdate(nextProps, nextState);
221
+
222
+ if ((checkComponentUpdate || null) != null) {
223
+ return !!checkComponentUpdate;
224
+ }
225
+
226
+ var nextPropsIgnoreModel = filterModel(nextProps);
227
+ var currentPropsIgnoreModel = filterModel(this.props);
228
+ return !shallowEqual(nextPropsIgnoreModel, currentPropsIgnoreModel) || !shallowEqual(nextState, this.state);
229
+ }
126
230
  }, {
127
231
  key: "componentWillUnmount",
128
232
  value: function componentWillUnmount() {
@@ -133,10 +237,64 @@ var Base = /*#__PURE__*/function (_PureComponent) {
133
237
 
134
238
  this.afterUnmount();
135
239
  }
240
+ }, {
241
+ key: "showRenderCount",
242
+ value: function showRenderCount() {
243
+ if (this.showRenderCountInConsole) {
244
+ this.renderCount += 1;
245
+ console.log("render frequency: ".concat(this.renderCount));
246
+ }
247
+ }
248
+ /**
249
+ * check loading progress,if loading or load fail,return false,else return true
250
+ * @returns bool
251
+ */
252
+
253
+ }, {
254
+ key: "checkLoadingProgress",
255
+ value: function checkLoadingProgress() {
256
+ var _this$state = this.state,
257
+ dataLoading = _this$state.dataLoading,
258
+ loadSuccess = _this$state.loadSuccess;
259
+ return dataLoading || !loadSuccess;
260
+ }
261
+ /**
262
+ * check operability,if loading or or processing or load fail,return false,else return true
263
+ * @returns bool
264
+ */
265
+
266
+ }, {
267
+ key: "checkOperability",
268
+ value: function checkOperability() {
269
+ var _this$state2 = this.state,
270
+ dataLoading = _this$state2.dataLoading,
271
+ processing = _this$state2.processing,
272
+ loadSuccess = _this$state2.loadSuccess;
273
+ return dataLoading || processing || !loadSuccess;
274
+ }
275
+ /**
276
+ * check in progress,if loading or or processing,return false,else return true
277
+ * @returns bool
278
+ */
279
+
280
+ }, {
281
+ key: "checkInProgress",
282
+ value: function checkInProgress() {
283
+ var _this$state3 = this.state,
284
+ dataLoading = _this$state3.dataLoading,
285
+ processing = _this$state3.processing;
286
+ return dataLoading || processing;
287
+ }
288
+ }, {
289
+ key: "renderFurther",
290
+ value: function renderFurther() {
291
+ return null;
292
+ }
136
293
  }, {
137
294
  key: "render",
138
295
  value: function render() {
139
- return null;
296
+ this.showRenderCount();
297
+ return this.renderFurther();
140
298
  }
141
299
  }], [{
142
300
  key: "getDerivedStateFromProps",
@@ -146,7 +304,7 @@ var Base = /*#__PURE__*/function (_PureComponent) {
146
304
  }]);
147
305
 
148
306
  return Base;
149
- }(_react.PureComponent);
307
+ }(_react.Component);
150
308
 
151
309
  var _default = Base;
152
310
  exports["default"] = _default;
@@ -10,6 +10,6 @@ declare class Base extends SupplementWrapper {
10
10
  placeholder: string;
11
11
  };
12
12
  renderButton: () => JSX.Element;
13
- render(): JSX.Element;
13
+ renderFurther(): JSX.Element;
14
14
  }
15
15
  import SupplementWrapper from "../../../CustomWrapper/SupplementWrapper";
@@ -98,8 +98,8 @@ var Base = /*#__PURE__*/function (_SupplementWrapper) {
98
98
  }
99
99
 
100
100
  _createClass(Base, [{
101
- key: "render",
102
- value: function render() {
101
+ key: "renderFurther",
102
+ value: function renderFurther() {
103
103
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, this.renderButton(), this.renderOther());
104
104
  }
105
105
  }], [{
@@ -35,13 +35,25 @@ declare class Common extends Core {
35
35
  initLoadRequestParams: (o: any) => any;
36
36
  supplementLoadRequestParams: (o: any) => any;
37
37
  checkLoadRequestParams: (o: any) => boolean;
38
- initLoad: (callback?: any) => void;
38
+ initLoad: ({ otherState, delay, callback }: {
39
+ otherState?: {} | undefined;
40
+ delay?: number | undefined;
41
+ callback?: any;
42
+ }) => void;
39
43
  adjustLoadApiPath: () => string;
40
- initLoadCore: (requestData: any, callback: any) => void;
41
- pageListData: (otherState: any, callback?: any) => void;
42
- reloadData: (otherState: any, callback?: any) => void;
43
- searchData: (otherState: any, callback?: any) => void;
44
- refreshData: (callback?: any) => void;
44
+ initLoadCore: ({ requestData, delay, callback }: {
45
+ requestData: any;
46
+ delay?: number | undefined;
47
+ callback: any;
48
+ }) => void;
49
+ loadFromApi: ({ requestData, callback }: {
50
+ requestData: any;
51
+ callback: any;
52
+ }) => void;
53
+ pageListData: (otherState: any, callback?: any, delay?: number) => void;
54
+ reloadData: (otherState: any, callback?: any, delay?: number) => void;
55
+ searchData: (otherState: any, callback?: any, delay?: number) => void;
56
+ refreshData: (otherState: any, callback?: any, delay?: number) => void;
45
57
  reloadGlobalData: (callback?: any) => void;
46
58
  afterFirstLoadSuccess: () => void;
47
59
  afterLoadSuccess: ({ metaData, metaListData, metaExtra, metaOriginalData, }: {