tntd 1.3.57 → 1.3.62

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 (110) hide show
  1. package/babel.config.js +2 -2
  2. package/components/Layout/Application.js +1 -1
  3. package/components/QueryForm/Field/index.js +2 -1
  4. package/components/QueryListScene/List.js +17 -13
  5. package/lib/0645cf743e4e44ca9da321d689897f07.png +0 -0
  6. package/lib/09db77de0c24fa0f45f8a5cf299a3d11.png +0 -0
  7. package/lib/1d0b52448de217857b270af807e9360d.png +0 -0
  8. package/lib/25d78d77c9c2f0d403e5d899ceb5b1ef.png +0 -0
  9. package/lib/27fa44ff0c98e1594d79b73045aabedf.png +0 -0
  10. package/lib/2c95075adb68d6131b59cae9fa554ec2.png +0 -0
  11. package/lib/377c871d922a25c773a9e7c2f42ed7c0.png +0 -0
  12. package/lib/3d901589b40bd56ff1fde2bbb700bfe1.png +0 -0
  13. package/lib/4abe481e130d7be0574e45573de8beb7.png +0 -0
  14. package/lib/95ee2260a509cd630d89c5367ed1973b.png +0 -0
  15. package/lib/ArrayInput/icon.js +31 -27
  16. package/lib/ArrayInput/index.js +298 -211
  17. package/lib/AuthContext.js +13 -2
  18. package/lib/BlockHeader/README.md +83 -0
  19. package/lib/BlockHeader/fonts/OswaldLight.ttf +0 -0
  20. package/lib/BlockHeader/index.js +42 -0
  21. package/lib/BlockHeader/index.less +141 -0
  22. package/lib/Columns/index.js +100 -71
  23. package/lib/DevelopmentLogin/LoginModal.js +141 -79
  24. package/lib/DevelopmentLogin/index.js +55 -28
  25. package/lib/Ellipsis/Svg/CopySVG.js +71 -23
  26. package/lib/Ellipsis/Svg/TickSVG.js +49 -17
  27. package/lib/Ellipsis/index.js +155 -149
  28. package/lib/Handle/index.js +109 -72
  29. package/lib/Icon/fonts/iconfont.js +43 -1
  30. package/lib/Icon/iconList.js +8 -119
  31. package/lib/Icon/index.js +45 -13
  32. package/lib/Img/Contain.js +81 -49
  33. package/lib/Img/Cover.js +136 -88
  34. package/lib/Img/index.js +89 -36
  35. package/lib/Layout/ActionsContext.js +11 -2
  36. package/lib/Layout/AppList.js +256 -262
  37. package/lib/Layout/Application.js +135 -119
  38. package/lib/Layout/Avatar.js +137 -137
  39. package/lib/Layout/CompatibleLanguage.js +195 -214
  40. package/lib/Layout/EnterpriseLayout/Avatar.js +168 -156
  41. package/lib/Layout/EnterpriseLayout/Language.js +100 -75
  42. package/lib/Layout/EnterpriseLayout/Theme.js +94 -96
  43. package/lib/Layout/EnterpriseLayout/index.js +45 -32
  44. package/lib/Layout/GlobalNavigation/NavigationPopup.js +407 -335
  45. package/lib/Layout/GlobalNavigation/index.js +158 -110
  46. package/lib/Layout/Header.js +116 -165
  47. package/lib/Layout/HeaderActions.js +129 -170
  48. package/lib/Layout/HeaderNavs.js +113 -90
  49. package/lib/Layout/HeaderTabs.js +278 -312
  50. package/lib/Layout/Iconfont.js +15 -2
  51. package/lib/Layout/Language.js +102 -63
  52. package/lib/Layout/Layout.js +261 -272
  53. package/lib/Layout/Logo.js +87 -132
  54. package/lib/Layout/OrgAppList.js +319 -440
  55. package/lib/Layout/SideMenu.js +343 -429
  56. package/lib/Layout/Theme.js +124 -95
  57. package/lib/Layout/checkAuth.js +35 -21
  58. package/lib/Layout/createActions.js +51 -38
  59. package/lib/Layout/images/index.js +41 -33
  60. package/lib/Layout/index.js +161 -110
  61. package/lib/Layout/locale.js +53 -0
  62. package/lib/Layout/paaslayout/CompactSideMenu.js +178 -200
  63. package/lib/Layout/paaslayout/Header.js +90 -84
  64. package/lib/Layout/paaslayout/Logo.js +32 -27
  65. package/lib/Layout/paaslayout/SideMenu.js +174 -161
  66. package/lib/Layout/paaslayout/index.js +261 -240
  67. package/lib/Layout/paaslayout/index.less +75 -0
  68. package/lib/Layout/storage.js +78 -20
  69. package/lib/Layout/utils.js +143 -93
  70. package/lib/LoadingButton/index.js +57 -29
  71. package/lib/Modal/index.js +108 -83
  72. package/lib/Page/Box.js +81 -56
  73. package/lib/Page/index.js +173 -151
  74. package/lib/Page/utils.js +30 -12
  75. package/lib/QueryForm/Field/Checkbox.js +33 -11
  76. package/lib/QueryForm/Field/Select.js +99 -63
  77. package/lib/QueryForm/Field/SelectInput.js +114 -69
  78. package/lib/QueryForm/Field/fieldsMap.js +52 -30
  79. package/lib/QueryForm/Field/index.js +158 -75
  80. package/lib/QueryForm/createActions.js +65 -50
  81. package/lib/QueryForm/index.js +382 -303
  82. package/lib/QueryForm/useForm.js +17 -6
  83. package/lib/QueryListScene/Field/SelectInput.js +115 -0
  84. package/lib/QueryListScene/Field/fieldsMap.js +52 -0
  85. package/lib/QueryListScene/Field/index.js +159 -0
  86. package/lib/QueryListScene/Field/select.js +100 -0
  87. package/lib/QueryListScene/List.js +362 -285
  88. package/lib/QueryListScene/QueryForm/index.js +423 -0
  89. package/lib/QueryListScene/QueryForm/index.less +141 -0
  90. package/lib/QueryListScene/QueryForm.js +159 -91
  91. package/lib/QueryListScene/QueryListScene.js +87 -33
  92. package/lib/QueryListScene/Title.js +20 -10
  93. package/lib/QueryListScene/Toolbar.js +31 -8
  94. package/lib/QueryListScene/createActions.js +79 -64
  95. package/lib/QueryListScene/index.js +40 -23
  96. package/lib/QueryListScene/useActions.js +17 -6
  97. package/lib/Select/DropDownWrap.js +124 -60
  98. package/lib/Select/index.js +563 -426
  99. package/lib/Table/ResizableTable/index.js +121 -77
  100. package/lib/Table/index.js +51 -19
  101. package/lib/Title/index.js +52 -34
  102. package/lib/b9dd5ff3622296fbee51ed68f4bca1bf.png +0 -0
  103. package/lib/bd2921989f9296089ba58efb7a76f3ef.png +0 -0
  104. package/lib/index.html +6 -0
  105. package/lib/index.js +159 -19
  106. package/lib/locale.js +63 -48
  107. package/lib/main.css +16420 -0
  108. package/lib/tntd.js +2 -0
  109. package/lib/tntd.js.LICENSE.txt +36 -0
  110. package/package.json +1 -1
@@ -1,110 +1,178 @@
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';
6
-
7
- export default class QueryForm extends React.PureComponent {
8
- constructor(props) {
9
- super(props);
10
- const { actions, form } = props;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
11
7
 
12
- this.form = form || Form.createForm();
8
+ var _react = _interopRequireDefault(require("react"));
13
9
 
14
- actions.on('setFormData', this.setFormData);
15
- actions.on('resetFormData', this.resetFormData);
16
- }
10
+ var _classnames2 = _interopRequireDefault(require("classnames"));
17
11
 
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
- }
12
+ var _QueryForm = _interopRequireDefault(require("../QueryForm"));
41
13
 
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
- }
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
54
15
 
55
- onSearch = () => {
56
- const {
57
- onSearch,
58
- actions
59
- } = this.props;
60
- const values = actions.getFormData();
61
- const params = { ...values, current: 1 };
62
-
63
- actions.setData('formData', values);
64
- onSearch && onSearch(params);
65
- actions.emit('search', params);
66
- };
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); }
17
+
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';
67
47
 
68
- onReset = () => {
69
- const { initialValues, onReset, actions } = this.props;
48
+ var QueryForm =
49
+ /*#__PURE__*/
50
+ function (_React$PureComponent) {
51
+ _inherits(QueryForm, _React$PureComponent);
70
52
 
71
- actions.setFormData(initialValues, false);
53
+ function QueryForm(props) {
54
+ var _this;
72
55
 
73
- onReset && onReset(initialValues);
74
- this.onSearch();
56
+ _classCallCheck(this, QueryForm);
57
+
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
+ });
69
+
70
+ actions.setData('formData', values);
71
+ onSearch && onSearch(params);
72
+ actions.emit('search', params);
75
73
  };
76
74
 
77
- onChange = (newValues, changedInfo, ...rest) => {
78
- const { onChange, actions } = this.props;
75
+ _this.onReset = function () {
76
+ var _this$props2 = _this.props,
77
+ initialValues = _this$props2.initialValues,
78
+ onReset = _this$props2.onReset,
79
+ actions = _this$props2.actions;
80
+ actions.setFormData(initialValues, false);
81
+ onReset && onReset(initialValues);
79
82
 
80
- onChange && onChange(
81
- newValues,
82
- changedInfo,
83
- ...rest
84
- );
85
- actions.setFormData(newValues, false);
86
- }
83
+ _this.onSearch();
84
+ };
87
85
 
88
- setFormData = (data, needSearch) => {
89
- const { actions } = this.props;
90
- actions.setData('formData', data);
91
- this.form.setValues(data);
92
- needSearch && this.onSearch();
93
- }
86
+ _this.onChange = function (newValues, changedInfo) {
87
+ var _this$props3 = _this.props,
88
+ onChange = _this$props3.onChange,
89
+ actions = _this$props3.actions;
94
90
 
95
- resetFormData = (needSearch) => {
96
- const { initialValues, actions } = this.props;
91
+ for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
92
+ rest[_key - 2] = arguments[_key];
93
+ }
97
94
 
98
- actions.setFormData(initialValues, needSearch);
99
- this.form.resetValues();
100
- }
95
+ onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));
96
+ actions.setFormData(newValues, false);
97
+ };
101
98
 
102
- componentWillUnmount() {
103
- const { actions } = this.props;
99
+ _this.setFormData = function (data, needSearch) {
100
+ var actions = _this.props.actions;
101
+ actions.setData('formData', data);
104
102
 
105
- actions.removeListener('setFormData', this.setFormData);
106
- actions.removeListener('resetFormData', this.resetFormData);
103
+ _this.form.setValues(data);
104
+
105
+ needSearch && _this.onSearch();
106
+ };
107
+
108
+ _this.resetFormData = function (needSearch) {
109
+ var _this$props4 = _this.props,
110
+ initialValues = _this$props4.initialValues,
111
+ actions = _this$props4.actions;
112
+ actions.setFormData(initialValues, needSearch);
113
+
114
+ _this.form.resetValues();
115
+ };
116
+
117
+ var _actions = props.actions,
118
+ form = props.form;
119
+ _this.form = form || _QueryForm["default"].createForm();
120
+
121
+ _actions.on('setFormData', _this.setFormData);
122
+
123
+ _actions.on('resetFormData', _this.resetFormData);
124
+
125
+ return _this;
126
+ }
127
+
128
+ _createClass(QueryForm, [{
129
+ key: "render",
130
+ value: function render() {
131
+ var _this$props5 = this.props,
132
+ className = _this$props5.className,
133
+ actions = _this$props5.actions,
134
+ extraActions = _this$props5.extraActions,
135
+ extralActions = _this$props5.extralActions,
136
+ qlsProps = _this$props5.qlsProps,
137
+ props = _objectWithoutProperties(_this$props5, ["className", "actions", "extraActions", "extralActions", "qlsProps"]);
138
+
139
+ return _react["default"].createElement(_QueryForm["default"], _extends({}, props, {
140
+ form: this.form,
141
+ className: (0, _classnames2["default"])(clsPrefix, _defineProperty({}, className, className)) // 前期拼写错误,导致需要兼容错误的api
142
+ ,
143
+ extraActions: extraActions || extralActions,
144
+ onChange: this.onChange,
145
+ onSearch: this.onSearch,
146
+ onReset: this.onReset
147
+ }));
148
+ }
149
+ }, {
150
+ key: "componentDidMount",
151
+ value: function componentDidMount() {
152
+ var _this$props6 = this.props,
153
+ _this$props6$initialV = _this$props6.initialValues,
154
+ initialValues = _this$props6$initialV === void 0 ? {} : _this$props6$initialV,
155
+ actions = _this$props6.actions,
156
+ qlsProps = _this$props6.qlsProps;
157
+
158
+ if (qlsProps.memory) {
159
+ actions.setFormData(_objectSpread({}, initialValues, {}, actions.getFormData()), false);
160
+ } else {
161
+ actions.setData('formData', initialValues);
162
+ }
107
163
  }
108
- };
164
+ }, {
165
+ key: "componentWillUnmount",
166
+ value: function componentWillUnmount() {
167
+ var actions = this.props.actions;
168
+ actions.removeListener('setFormData', this.setFormData);
169
+ actions.removeListener('resetFormData', this.resetFormData);
170
+ }
171
+ }]);
172
+
173
+ return QueryForm;
174
+ }(_react["default"].PureComponent);
109
175
 
110
- QueryForm.Field = Form.Field;
176
+ exports["default"] = QueryForm;
177
+ ;
178
+ 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;