tntd 1.4.7 → 1.4.10

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 (85) hide show
  1. package/components/DevelopmentLogin/LoginModal.js +2 -2
  2. package/components/Layout/HeaderTabs.js +98 -73
  3. package/dist/1.tntd.js +1 -1
  4. package/dist/stats.json +98 -98
  5. package/dist/tntd.js +1 -1
  6. package/es/DevelopmentLogin/LoginModal.js +2 -2
  7. package/es/Layout/HeaderTabs.js +19 -15
  8. package/lib/ArrayInput/icon.js +31 -27
  9. package/lib/ArrayInput/index.js +298 -211
  10. package/lib/AuthContext.js +13 -2
  11. package/lib/Columns/index.js +100 -71
  12. package/lib/DevelopmentLogin/LoginModal.js +141 -79
  13. package/lib/DevelopmentLogin/index.js +55 -28
  14. package/lib/Ellipsis/Svg/CopySVG.js +71 -23
  15. package/lib/Ellipsis/Svg/TickSVG.js +49 -17
  16. package/lib/Ellipsis/index.js +154 -148
  17. package/lib/Handle/index.js +109 -72
  18. package/lib/Icon/fonts/iconfont.js +43 -1
  19. package/lib/Icon/iconList.js +8 -119
  20. package/lib/Icon/index.js +45 -13
  21. package/lib/Img/Contain.js +81 -49
  22. package/lib/Img/Cover.js +136 -88
  23. package/lib/Img/index.js +89 -36
  24. package/lib/Layout/ActionsContext.js +11 -2
  25. package/lib/Layout/AppList.js +256 -262
  26. package/lib/Layout/Application.js +135 -119
  27. package/lib/Layout/Avatar.js +137 -137
  28. package/lib/Layout/CompatibleLanguage.js +195 -214
  29. package/lib/Layout/EnterpriseLayout/Avatar.js +168 -156
  30. package/lib/Layout/EnterpriseLayout/Language.js +100 -75
  31. package/lib/Layout/EnterpriseLayout/Theme.js +94 -96
  32. package/lib/Layout/EnterpriseLayout/index.js +45 -32
  33. package/lib/Layout/GlobalNavigation/NavigationPopup.js +407 -335
  34. package/lib/Layout/GlobalNavigation/index.js +158 -110
  35. package/lib/Layout/Header.js +116 -165
  36. package/lib/Layout/HeaderActions.js +129 -132
  37. package/lib/Layout/HeaderNavs.js +113 -90
  38. package/lib/Layout/HeaderTabs.js +282 -312
  39. package/lib/Layout/Iconfont.js +15 -2
  40. package/lib/Layout/Language.js +102 -63
  41. package/lib/Layout/Layout.js +261 -272
  42. package/lib/Layout/Logo.js +87 -132
  43. package/lib/Layout/OrgAppList.js +319 -440
  44. package/lib/Layout/SideMenu.js +343 -429
  45. package/lib/Layout/Theme.js +124 -95
  46. package/lib/Layout/checkAuth.js +35 -21
  47. package/lib/Layout/createActions.js +51 -38
  48. package/lib/Layout/images/index.js +41 -33
  49. package/lib/Layout/index.js +161 -110
  50. package/lib/Layout/paaslayout/CompactSideMenu.js +178 -200
  51. package/lib/Layout/paaslayout/Header.js +90 -84
  52. package/lib/Layout/paaslayout/Logo.js +32 -27
  53. package/lib/Layout/paaslayout/SideMenu.js +174 -161
  54. package/lib/Layout/paaslayout/index.js +261 -240
  55. package/lib/Layout/storage.js +78 -20
  56. package/lib/Layout/utils.js +143 -93
  57. package/lib/LoadingButton/index.js +67 -25
  58. package/lib/Modal/index.js +108 -83
  59. package/lib/Page/Box.js +81 -56
  60. package/lib/Page/index.js +173 -151
  61. package/lib/Page/utils.js +30 -12
  62. package/lib/QueryForm/Field/Checkbox.js +33 -11
  63. package/lib/QueryForm/Field/Select.js +99 -63
  64. package/lib/QueryForm/Field/SelectInput.js +114 -69
  65. package/lib/QueryForm/Field/fieldsMap.js +52 -30
  66. package/lib/QueryForm/Field/index.js +158 -76
  67. package/lib/QueryForm/createActions.js +65 -50
  68. package/lib/QueryForm/index.js +383 -304
  69. package/lib/QueryForm/useForm.js +17 -6
  70. package/lib/QueryListScene/List.js +366 -290
  71. package/lib/QueryListScene/QueryForm.js +161 -93
  72. package/lib/QueryListScene/QueryListScene.js +87 -33
  73. package/lib/QueryListScene/Title.js +20 -10
  74. package/lib/QueryListScene/Toolbar.js +31 -8
  75. package/lib/QueryListScene/createActions.js +79 -64
  76. package/lib/QueryListScene/index.js +40 -23
  77. package/lib/QueryListScene/useActions.js +17 -6
  78. package/lib/Select/DropDownWrap.js +124 -60
  79. package/lib/Select/index.js +561 -425
  80. package/lib/Table/ResizableTable/index.js +121 -77
  81. package/lib/Table/index.js +51 -19
  82. package/lib/Title/index.js +52 -34
  83. package/lib/index.js +159 -19
  84. package/lib/locale.js +63 -48
  85. package/package.json +1 -1
@@ -1,113 +1,181 @@
1
- import React from 'react';
2
- import classnames from 'classnames';
3
- import Form from '../QueryForm';
1
+ "use strict";
4
2
 
5
- const clsPrefix = 'tnt-querylistscene-queryform';
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
6
7
 
7
- export default class QueryForm extends React.PureComponent {
8
- constructor(props) {
9
- super(props);
10
- const { actions, form } = props;
8
+ var _react = _interopRequireDefault(require("react"));
11
9
 
12
- this.form = form || Form.createForm();
10
+ var _classnames2 = _interopRequireDefault(require("classnames"));
13
11
 
14
- actions.on('setFormData', this.setFormData);
15
- actions.on('resetFormData', this.resetFormData);
16
- }
12
+ var _QueryForm = _interopRequireDefault(require("../QueryForm"));
17
13
 
18
- render() {
19
- const {
20
- className,
21
- actions,
22
- extraActions,
23
- extralActions,
24
- qlsProps,
25
- ...props
26
- } = this.props;
27
-
28
- return (
29
- <Form
30
- {...props}
31
- form={this.form}
32
- className={classnames(clsPrefix, { [className]: className })}
33
- // 前期拼写错误,导致需要兼容错误的api
34
- extraActions={extraActions || extralActions}
35
- onChange={this.onChange}
36
- onSearch={this.onSearch}
37
- onReset={this.onReset}
38
- />
39
- );
40
- }
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
41
15
 
42
- componentDidMount() {
43
- const { initialValues = {}, actions, qlsProps } = this.props;
44
-
45
- if (qlsProps.memory) {
46
- actions.setFormData({
47
- ...initialValues,
48
- ...actions.getFormData()
49
- }, false);
50
- } else {
51
- actions.setData('formData', initialValues);
52
- }
53
- }
16
+ function _typeof(obj) { 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); }
54
17
 
55
- onSearch = () => {
56
- const {
57
- onSearch,
58
- actions
59
- } = this.props;
60
- const values = actions.getFormData();
61
- const params = { ...values, current: 1 };
62
-
63
- // memory url解析setForm时 监听事件异步
64
- actions.setData('formData', values);
65
- Promise.resolve().then(()=>{
66
- onSearch && onSearch(params);
67
- actions.emit('search', params);
68
- });
69
- };
18
+ 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); }
19
+
20
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
21
+
22
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
23
+
24
+ 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; }
25
+
26
+ 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; }
27
+
28
+ 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; }
29
+
30
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
+
32
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
33
+
34
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
35
+
36
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
37
+
38
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
+
40
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
+
42
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
43
+
44
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
45
+
46
+ var clsPrefix = 'tnt-querylistscene-queryform';
47
+
48
+ var QueryForm =
49
+ /*#__PURE__*/
50
+ function (_React$PureComponent) {
51
+ _inherits(QueryForm, _React$PureComponent);
70
52
 
71
- onReset = () => {
72
- const { initialValues, onReset, actions } = this.props;
53
+ function QueryForm(props) {
54
+ var _this;
73
55
 
74
- actions.setFormData(initialValues, false);
56
+ _classCallCheck(this, QueryForm);
75
57
 
76
- onReset && onReset(initialValues);
77
- this.onSearch();
58
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));
59
+
60
+ _this.onSearch = function () {
61
+ var _this$props = _this.props,
62
+ onSearch = _this$props.onSearch,
63
+ actions = _this$props.actions;
64
+ var values = actions.getFormData();
65
+
66
+ var params = _objectSpread({}, values, {
67
+ current: 1
68
+ }); // memory 与 url解析setForm时 监听事件异步
69
+
70
+
71
+ actions.setData('formData', values);
72
+ Promise.resolve().then(function () {
73
+ onSearch && onSearch(params);
74
+ actions.emit('search', params);
75
+ });
78
76
  };
79
77
 
80
- onChange = (newValues, changedInfo, ...rest) => {
81
- const { onChange, actions } = this.props;
78
+ _this.onReset = function () {
79
+ var _this$props2 = _this.props,
80
+ initialValues = _this$props2.initialValues,
81
+ onReset = _this$props2.onReset,
82
+ actions = _this$props2.actions;
83
+ actions.setFormData(initialValues, false);
84
+ onReset && onReset(initialValues);
82
85
 
83
- onChange && onChange(
84
- newValues,
85
- changedInfo,
86
- ...rest
87
- );
88
- actions.setFormData(newValues, false);
89
- }
86
+ _this.onSearch();
87
+ };
90
88
 
91
- setFormData = (data, needSearch) => {
92
- const { actions } = this.props;
93
- actions.setData('formData', data);
94
- this.form.setValues(data);
95
- needSearch && this.onSearch();
96
- }
89
+ _this.onChange = function (newValues, changedInfo) {
90
+ var _this$props3 = _this.props,
91
+ onChange = _this$props3.onChange,
92
+ actions = _this$props3.actions;
97
93
 
98
- resetFormData = (needSearch) => {
99
- const { initialValues, actions } = this.props;
94
+ for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
95
+ rest[_key - 2] = arguments[_key];
96
+ }
100
97
 
101
- actions.setFormData(initialValues, needSearch);
102
- this.form.resetValues();
103
- }
98
+ onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));
99
+ actions.setFormData(newValues, false);
100
+ };
104
101
 
105
- componentWillUnmount() {
106
- const { actions } = this.props;
102
+ _this.setFormData = function (data, needSearch) {
103
+ var actions = _this.props.actions;
104
+ actions.setData('formData', data);
107
105
 
108
- actions.removeListener('setFormData', this.setFormData);
109
- actions.removeListener('resetFormData', this.resetFormData);
106
+ _this.form.setValues(data);
107
+
108
+ needSearch && _this.onSearch();
109
+ };
110
+
111
+ _this.resetFormData = function (needSearch) {
112
+ var _this$props4 = _this.props,
113
+ initialValues = _this$props4.initialValues,
114
+ actions = _this$props4.actions;
115
+ actions.setFormData(initialValues, needSearch);
116
+
117
+ _this.form.resetValues();
118
+ };
119
+
120
+ var _actions = props.actions,
121
+ form = props.form;
122
+ _this.form = form || _QueryForm["default"].createForm();
123
+
124
+ _actions.on('setFormData', _this.setFormData);
125
+
126
+ _actions.on('resetFormData', _this.resetFormData);
127
+
128
+ return _this;
129
+ }
130
+
131
+ _createClass(QueryForm, [{
132
+ key: "render",
133
+ value: function render() {
134
+ var _this$props5 = this.props,
135
+ className = _this$props5.className,
136
+ actions = _this$props5.actions,
137
+ extraActions = _this$props5.extraActions,
138
+ extralActions = _this$props5.extralActions,
139
+ qlsProps = _this$props5.qlsProps,
140
+ props = _objectWithoutProperties(_this$props5, ["className", "actions", "extraActions", "extralActions", "qlsProps"]);
141
+
142
+ return _react["default"].createElement(_QueryForm["default"], _extends({}, props, {
143
+ form: this.form,
144
+ className: (0, _classnames2["default"])(clsPrefix, _defineProperty({}, className, className)) // 前期拼写错误,导致需要兼容错误的api
145
+ ,
146
+ extraActions: extraActions || extralActions,
147
+ onChange: this.onChange,
148
+ onSearch: this.onSearch,
149
+ onReset: this.onReset
150
+ }));
151
+ }
152
+ }, {
153
+ key: "componentDidMount",
154
+ value: function componentDidMount() {
155
+ var _this$props6 = this.props,
156
+ _this$props6$initialV = _this$props6.initialValues,
157
+ initialValues = _this$props6$initialV === void 0 ? {} : _this$props6$initialV,
158
+ actions = _this$props6.actions,
159
+ qlsProps = _this$props6.qlsProps;
160
+
161
+ if (qlsProps.memory) {
162
+ actions.setFormData(_objectSpread({}, initialValues, {}, actions.getFormData()), false);
163
+ } else {
164
+ actions.setData('formData', initialValues);
165
+ }
110
166
  }
111
- };
167
+ }, {
168
+ key: "componentWillUnmount",
169
+ value: function componentWillUnmount() {
170
+ var actions = this.props.actions;
171
+ actions.removeListener('setFormData', this.setFormData);
172
+ actions.removeListener('resetFormData', this.resetFormData);
173
+ }
174
+ }]);
175
+
176
+ return QueryForm;
177
+ }(_react["default"].PureComponent);
112
178
 
113
- QueryForm.Field = Form.Field;
179
+ exports["default"] = QueryForm;
180
+ ;
181
+ QueryForm.Field = _QueryForm["default"].Field;
@@ -1,35 +1,89 @@
1
- import React from 'react';
2
- import cn from 'classnames';
3
- import Title from './Title';
4
- import Toolbar from './Toolbar';
5
- import createActions from './createActions';
6
-
7
- export default class QueryListScene extends React.Component {
8
- constructor(props) {
9
- super(props);
10
- this.actions = props.actions || createActions();
11
- }
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
12
+ var _Title = _interopRequireDefault(require("./Title"));
13
+
14
+ var _Toolbar = _interopRequireDefault(require("./Toolbar"));
15
+
16
+ var _createActions = _interopRequireDefault(require("./createActions"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ function _typeof(obj) { 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); }
21
+
22
+ 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; }
23
+
24
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
+
26
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
27
+
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
12
29
 
13
- render() {
14
- const { title, children, size, className = '' } = this.props;
15
- const hasToolbar = [].some.call(children || [], child => child?.type === Toolbar);
16
-
17
- return (
18
- <div className={cn('tnt-querylistscene', { [className]: className, 'large-size': size === 'large', hasToolbar })}>
19
- {
20
- title && <Title title={title} size={size} />
21
- }
22
- <div className="tnt-querylistscene-content">
23
- {
24
- React.Children.map(
25
- children, child => child && React.cloneElement(child, {
26
- qlsProps: this.props,
27
- actions: this.actions
28
- })
29
- )
30
- }
31
- </div>
32
- </div>
33
- );
30
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
31
+
32
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
33
+
34
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
35
+
36
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
37
+
38
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
+
40
+ var QueryListScene =
41
+ /*#__PURE__*/
42
+ function (_React$Component) {
43
+ _inherits(QueryListScene, _React$Component);
44
+
45
+ function QueryListScene(props) {
46
+ var _this;
47
+
48
+ _classCallCheck(this, QueryListScene);
49
+
50
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryListScene).call(this, props));
51
+ _this.actions = props.actions || (0, _createActions["default"])();
52
+ return _this;
53
+ }
54
+
55
+ _createClass(QueryListScene, [{
56
+ key: "render",
57
+ value: function render() {
58
+ var _cn,
59
+ _this2 = this;
60
+
61
+ var _this$props = this.props,
62
+ title = _this$props.title,
63
+ children = _this$props.children,
64
+ size = _this$props.size,
65
+ _this$props$className = _this$props.className,
66
+ className = _this$props$className === void 0 ? '' : _this$props$className;
67
+ var hasToolbar = [].some.call(children || [], function (child) {
68
+ return (child == null ? void 0 : child.type) === _Toolbar["default"];
69
+ });
70
+ return _react["default"].createElement("div", {
71
+ className: (0, _classnames["default"])('tnt-querylistscene', (_cn = {}, _defineProperty(_cn, className, className), _defineProperty(_cn, 'large-size', size === 'large'), _defineProperty(_cn, "hasToolbar", hasToolbar), _cn))
72
+ }, title && _react["default"].createElement(_Title["default"], {
73
+ title: title,
74
+ size: size
75
+ }), _react["default"].createElement("div", {
76
+ className: "tnt-querylistscene-content"
77
+ }, _react["default"].Children.map(children, function (child) {
78
+ return child && _react["default"].cloneElement(child, {
79
+ qlsProps: _this2.props,
80
+ actions: _this2.actions
81
+ });
82
+ })));
34
83
  }
35
- }
84
+ }]);
85
+
86
+ return QueryListScene;
87
+ }(_react["default"].Component);
88
+
89
+ exports["default"] = QueryListScene;
@@ -1,14 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+
1
12
  /**
2
13
  * @file Title
3
14
  * @author zhangyou
4
15
  */
5
- import React from 'react';
6
-
7
- export default ({ title, children }) => (
8
- <div className="tnt-querylistscene-title">
9
- <span>{title}</span>
10
- <span>
11
- {children}
12
- </span>
13
- </div>
14
- );
16
+ var _default = function _default(_ref) {
17
+ var title = _ref.title,
18
+ children = _ref.children;
19
+ return _react["default"].createElement("div", {
20
+ className: "tnt-querylistscene-title"
21
+ }, _react["default"].createElement("span", null, title), _react["default"].createElement("span", null, children));
22
+ };
23
+
24
+ exports["default"] = _default;
@@ -1,9 +1,32 @@
1
- import cn from 'classnames';
2
-
3
- export default ({ className, children, actions, qslProps, ...rest }) => {
4
- return (
5
- <div {...rest} className={cn('tnt-querylistscene-toolbar', { [className]: className })}>
6
- {children}
7
- </div>
8
- );
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+
12
+ 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); }
13
+
14
+ 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; }
15
+
16
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
+
18
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
19
+
20
+ var _default = function _default(_ref) {
21
+ var className = _ref.className,
22
+ children = _ref.children,
23
+ actions = _ref.actions,
24
+ qslProps = _ref.qslProps,
25
+ rest = _objectWithoutProperties(_ref, ["className", "children", "actions", "qslProps"]);
26
+
27
+ return React.createElement("div", _extends({}, rest, {
28
+ className: (0, _classnames["default"])('tnt-querylistscene-toolbar', _defineProperty({}, className, className))
29
+ }), children);
9
30
  };
31
+
32
+ exports["default"] = _default;
@@ -1,70 +1,85 @@
1
- import EventEmitter from 'eventemitter3';
2
- import { get, set } from 'lodash';
1
+ "use strict";
3
2
 
4
- export default () => {
5
- const eventEmitter = new EventEmitter();
6
- const data = {
7
- dataSource: [],
8
- pagination: {},
9
- formData: {},
10
- submittedFormData: {}
11
- };
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
12
7
 
13
- return {
14
- setData: (key, val) => {
15
- set(data, key, val);
16
- },
8
+ var _eventemitter = _interopRequireDefault(require("eventemitter3"));
17
9
 
18
- getFormData: name => get(data, `formData${name ? ('.' + name) : ''}`),
19
- getSubmittedFormData: name => get(data, `submittedFormData${name ? ('.' + name) : ''}`),
20
- getTableDataSource: () => get(data, 'dataSource'),
21
- getPagination: () => get(data, 'pagination'),
10
+ var _lodash = require("lodash");
22
11
 
23
- setFormData: (formData, needSearch = true) => {
24
- set('formData', formData);
25
- eventEmitter.emit('setFormData', formData, needSearch);
26
- },
27
- resetFormData: (needSearch = false) => {
28
- eventEmitter.emit('resetFormData', needSearch);
29
- },
30
- setTableDataSource: dataSource => {
31
- set('dataSource', dataSource);
32
- eventEmitter.emit('setTableDataSource', dataSource);
33
- },
34
- setPagination: pagination => {
35
- set('pagination', pagination);
36
- eventEmitter.emit('setPagination', pagination);
37
- },
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
38
13
 
39
- // 重置记忆数据,form、pagination
40
- resetMemoryData: () => {
41
- data.formData = {};
42
- data.pagination = {};
43
- },
44
-
45
- search: (params = {}, showLoading = true) => {
46
- return new Promise((resolve, reject) => {
47
- eventEmitter.emit('search', params, {
48
- callback: resolve,
49
- showLoading
50
- });
51
- });
52
- },
53
-
54
- on: (eventName, callback) => {
55
- eventEmitter.on(eventName, callback);
56
- },
57
-
58
- emit: (...args) => {
59
- eventEmitter.emit(...args);
60
- },
61
-
62
- removeListener: (...args) => {
63
- eventEmitter.removeListener(...args);
64
- },
65
-
66
- off: (...args) => {
67
- eventEmitter.removeListener(...args);
68
- }
69
- };
14
+ var _default = function _default() {
15
+ var eventEmitter = new _eventemitter["default"]();
16
+ var data = {
17
+ dataSource: [],
18
+ pagination: {},
19
+ formData: {},
20
+ submittedFormData: {}
21
+ };
22
+ return {
23
+ setData: function setData(key, val) {
24
+ (0, _lodash.set)(data, key, val);
25
+ },
26
+ getFormData: function getFormData(name) {
27
+ return (0, _lodash.get)(data, "formData".concat(name ? '.' + name : ''));
28
+ },
29
+ getSubmittedFormData: function getSubmittedFormData(name) {
30
+ return (0, _lodash.get)(data, "submittedFormData".concat(name ? '.' + name : ''));
31
+ },
32
+ getTableDataSource: function getTableDataSource() {
33
+ return (0, _lodash.get)(data, 'dataSource');
34
+ },
35
+ getPagination: function getPagination() {
36
+ return (0, _lodash.get)(data, 'pagination');
37
+ },
38
+ setFormData: function setFormData(formData) {
39
+ var needSearch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
40
+ (0, _lodash.set)('formData', formData);
41
+ eventEmitter.emit('setFormData', formData, needSearch);
42
+ },
43
+ resetFormData: function resetFormData() {
44
+ var needSearch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
45
+ eventEmitter.emit('resetFormData', needSearch);
46
+ },
47
+ setTableDataSource: function setTableDataSource(dataSource) {
48
+ (0, _lodash.set)('dataSource', dataSource);
49
+ eventEmitter.emit('setTableDataSource', dataSource);
50
+ },
51
+ setPagination: function setPagination(pagination) {
52
+ (0, _lodash.set)('pagination', pagination);
53
+ eventEmitter.emit('setPagination', pagination);
54
+ },
55
+ // 重置记忆数据,form、pagination
56
+ resetMemoryData: function resetMemoryData() {
57
+ data.formData = {};
58
+ data.pagination = {};
59
+ },
60
+ search: function search() {
61
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
62
+ var showLoading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
63
+ return new Promise(function (resolve, reject) {
64
+ eventEmitter.emit('search', params, {
65
+ callback: resolve,
66
+ showLoading: showLoading
67
+ });
68
+ });
69
+ },
70
+ on: function on(eventName, callback) {
71
+ eventEmitter.on(eventName, callback);
72
+ },
73
+ emit: function emit() {
74
+ eventEmitter.emit.apply(eventEmitter, arguments);
75
+ },
76
+ removeListener: function removeListener() {
77
+ eventEmitter.removeListener.apply(eventEmitter, arguments);
78
+ },
79
+ off: function off() {
80
+ eventEmitter.removeListener.apply(eventEmitter, arguments);
81
+ }
82
+ };
70
83
  };
84
+
85
+ exports["default"] = _default;