@teamias/rex-pro 0.0.8 → 0.0.9

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) cloudovo
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) cloudovo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,65 +1,65 @@
1
- # @teamias/rex-pro
2
-
3
- [![NPM version](https://img.shields.io/npm/v/@teamias/rex-pro.svg?style=flat)](https://npmjs.org/package/@teamias/rex-pro)
4
- [![NPM downloads](http://img.shields.io/npm/dm/@teamias/rex-pro.svg?style=flat)](https://npmjs.org/package/@teamias/rex-pro)
5
-
6
- 用 dumi 开发的 react 库
7
-
8
- ## Usage
9
-
10
- ### 安装组件库
11
-
12
- ```bash
13
- # 安装组件库
14
- $ pnpm add @teamias/rex-pro
15
-
16
- ```
17
-
18
- ### 代码引用
19
-
20
- ```ts
21
- import { ActionButtons } from '@teamias/rex-pro';
22
- ```
23
-
24
- ## Options
25
-
26
- TODO
27
-
28
- ## Development
29
-
30
- ```bash
31
- # 安装依赖项
32
- $ pnpm install
33
-
34
- # 通过文档演示开发库
35
- $ pnpm start
36
-
37
- # 构建库源代码
38
- $ pnpm run build
39
-
40
- # 在监视模式下构建库源代码
41
- $ pnpm run build:watch
42
-
43
- # 生成文档
44
- $ pnpm run docs:build
45
-
46
- # 本地预览生产构建。
47
- $ pnpm run docs:preview
48
-
49
- # 检查项目的潜在问题
50
- $ pnpm run doctor
51
- ```
52
-
53
- ## Publish
54
-
55
- ```bash
56
- # 首次发包前,进行用户添加
57
- $ pnpm adduser
58
-
59
- # 发布新版本
60
- $ pnpm run deploy
61
- ```
62
-
63
- ## LICENSE
64
-
65
- MIT
1
+ # @teamias/rex-pro
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/@teamias/rex-pro.svg?style=flat)](https://npmjs.org/package/@teamias/rex-pro)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/@teamias/rex-pro.svg?style=flat)](https://npmjs.org/package/@teamias/rex-pro)
5
+
6
+ 用 dumi 开发的 react 库
7
+
8
+ ## Usage
9
+
10
+ ### 安装组件库
11
+
12
+ ```bash
13
+ # 安装组件库
14
+ $ pnpm add @teamias/rex-pro
15
+
16
+ ```
17
+
18
+ ### 代码引用
19
+
20
+ ```ts
21
+ import { ActionButtons } from '@teamias/rex-pro';
22
+ ```
23
+
24
+ ## Options
25
+
26
+ TODO
27
+
28
+ ## Development
29
+
30
+ ```bash
31
+ # 安装依赖项
32
+ $ pnpm install
33
+
34
+ # 通过文档演示开发库
35
+ $ pnpm start
36
+
37
+ # 构建库源代码
38
+ $ pnpm run build
39
+
40
+ # 在监视模式下构建库源代码
41
+ $ pnpm run build:watch
42
+
43
+ # 生成文档
44
+ $ pnpm run docs:build
45
+
46
+ # 本地预览生产构建。
47
+ $ pnpm run docs:preview
48
+
49
+ # 检查项目的潜在问题
50
+ $ pnpm run doctor
51
+ ```
52
+
53
+ ## Publish
54
+
55
+ ```bash
56
+ # 首次发包前,进行用户添加
57
+ $ pnpm adduser
58
+
59
+ # 发布新版本
60
+ $ pnpm run deploy
61
+ ```
62
+
63
+ ## LICENSE
64
+
65
+ MIT
@@ -13,11 +13,11 @@ import classNames from 'classnames';
13
13
  import { useMemo } from 'react';
14
14
  import { Card } from "./style";
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
- /**
17
- * 平分列数
18
- * @param len
19
- * @param defaultCol
20
- * @returns number
16
+ /**
17
+ * 平分列数
18
+ * @param len
19
+ * @param defaultCol
20
+ * @returns number
21
21
  */
22
22
  var useSpan = function useSpan(len, defaultCol) {
23
23
  return useMemo(function () {
@@ -21,9 +21,9 @@ import { cloneDeep } from 'lodash';
21
21
  import { useEffect, useImperativeHandle, useRef } from 'react';
22
22
  import { FilterFormAutoWidthStyle, FilterFormStyle } from "./style";
23
23
 
24
- /**
25
- * FilterForm 组件 - 支持多语言的筛选表单
26
- * @param T 表单数据类型
24
+ /**
25
+ * FilterForm 组件 - 支持多语言的筛选表单
26
+ * @param T 表单数据类型
27
27
  */
28
28
  import { jsx as _jsx } from "react/jsx-runtime";
29
29
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -46,8 +46,8 @@ export function ProDrawerTable(_ref) {
46
46
  onOpenChange === null || onOpenChange === void 0 || onOpenChange(open);
47
47
  }, [open]);
48
48
 
49
- /**
50
- * 暴露方法
49
+ /**
50
+ * 暴露方法
51
51
  */
52
52
  useImperativeHandle(action, function () {
53
53
  return _objectSpread({}, actionRef);
@@ -48,8 +48,8 @@ export function ProModalForm(_ref) {
48
48
  onOpenChange === null || onOpenChange === void 0 || onOpenChange(open);
49
49
  }, [open]);
50
50
 
51
- /**
52
- * 暴露方法
51
+ /**
52
+ * 暴露方法
53
53
  */
54
54
  useImperativeHandle(action, function () {
55
55
  return _objectSpread({}, actionRef);
@@ -655,7 +655,8 @@ export default (function () {
655
655
  }, {
656
656
  title: '供应商',
657
657
  dataIndex: 'factory',
658
- key: 'factory'
658
+ key: 'factory',
659
+ sorter: 'factory'
659
660
  }, {
660
661
  title: 'ASIN',
661
662
  dataIndex: 'asin',
@@ -1071,14 +1072,21 @@ export default (function () {
1071
1072
  }
1072
1073
  },
1073
1074
  request: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1075
+ var _len2,
1076
+ args,
1077
+ _key2,
1078
+ _args2 = arguments;
1074
1079
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1075
1080
  while (1) switch (_context2.prev = _context2.next) {
1076
1081
  case 0:
1077
- console.log('调用次');
1082
+ for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1083
+ args[_key2] = _args2[_key2];
1084
+ }
1085
+ console.log('调用次', args);
1078
1086
  state.selectKeys = [];
1079
1087
  update({});
1080
1088
  return _context2.abrupt("return", JSON.parse(JSON.stringify(tableData)));
1081
- case 4:
1089
+ case 5:
1082
1090
  case "end":
1083
1091
  return _context2.stop();
1084
1092
  }
@@ -13,12 +13,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
13
13
  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; }
14
14
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
+ import { FilterForm } from "../../filter-form";
16
17
  import { ProForm } from '@ant-design/pro-components';
17
18
  import { BaseListTable, BaseTable, useRequestFieldsConfig, useRexProConfigProvider, useStateData } from '@teamias/rex-design';
18
19
  import { Card, Pagination, Skeleton, Space } from 'antd';
19
20
  import { cloneDeep } from 'lodash';
20
21
  import React, { useImperativeHandle, useRef } from 'react';
21
- import { FilterForm } from "../../filter-form";
22
22
  import { ActionButtons } from "./components/ActionButtons";
23
23
  import { TableActionButtonGroup, ToolbarBox, Wrapper } from "./style";
24
24
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -321,7 +321,12 @@ var InlineRexProTable = function InlineRexProTable(_ref) {
321
321
  customEmptyText: state.customEmptyText,
322
322
  loading: state.loading,
323
323
  pagination: false,
324
- extraColumns: extraColumns
324
+ extraColumns: extraColumns,
325
+ onChange: function onChange(pagination, filters, sorter) {
326
+ state.params.sort = JSON.parse(JSON.stringify(sorter || {}));
327
+ state.params.filter = JSON.parse(JSON.stringify(filters || {}));
328
+ action.getList(1);
329
+ }
325
330
  })), (_state$dataSource = state.dataSource) !== null && _state$dataSource !== void 0 && _state$dataSource.length && !hidePagination ? /*#__PURE__*/_jsx(Pagination, {
326
331
  style: {
327
332
  marginTop: 10
@@ -1,8 +1,8 @@
1
+ import { FilterForm, IFilterFormProps } from "../../filter-form";
1
2
  import { BaseListTable, BaseTable, RequestFieldsContainer, TButtonFilterItem } from '@teamias/rex-design';
2
3
  import { Button, DrawerProps, DropDownProps, FormInstance, GetProps, ModalProps } from 'antd';
3
4
  import { SizeType } from 'antd/es/config-provider/SizeContext';
4
5
  import { MutableRefObject, ReactNode } from 'react';
5
- import { FilterForm, IFilterFormProps } from "../../filter-form";
6
6
  /** 组件props */
7
7
  export interface IRexProTableProps<TF extends Record<string, unknown>, TT extends Record<string, unknown>> {
8
8
  toolbar?: {
@@ -156,7 +156,10 @@ export type TRexProTableRequestParams<T> = {
156
156
  page_size: number;
157
157
  current: number;
158
158
  };
159
- sort: unknown;
159
+ sort: {
160
+ field?: string;
161
+ order?: 'ascend' | 'descend';
162
+ };
160
163
  filter: unknown;
161
164
  };
162
165
  /** 接口回调 */
@@ -1,26 +1,26 @@
1
- {
2
- "pro": {
3
- "components": {
4
- "rex-pro-table": {
5
- "empty-text": "Please select relevant filter criteria to search",
6
- "column-action-title": "Actions",
7
- "pagination-total": "{total} entries in total",
8
- "action-buttons": {
9
- "please-check-data": "Please select data",
10
- "confirm-operation": "Confirm operation {label}",
11
- "confirm-execute": "Are you sure you want to proceed?",
12
- "item-label-missing": "Button label not configured",
13
- "group-label-missing": "Group label not configured"
14
- },
15
- "form": {
16
- "cancel": "Cancel",
17
- "confirm": "Confirm"
18
- }
19
- },
20
- "filter-form": {
21
- "reset": "Reset",
22
- "search": "Search"
23
- }
24
- }
25
- }
26
- }
1
+ {
2
+ "pro": {
3
+ "components": {
4
+ "rex-pro-table": {
5
+ "empty-text": "Please select relevant filter criteria to search",
6
+ "column-action-title": "Actions",
7
+ "pagination-total": "{total} entries in total",
8
+ "action-buttons": {
9
+ "please-check-data": "Please select data",
10
+ "confirm-operation": "Confirm operation {label}",
11
+ "confirm-execute": "Are you sure you want to proceed?",
12
+ "item-label-missing": "Button label not configured",
13
+ "group-label-missing": "Group label not configured"
14
+ },
15
+ "form": {
16
+ "cancel": "Cancel",
17
+ "confirm": "Confirm"
18
+ }
19
+ },
20
+ "filter-form": {
21
+ "reset": "Reset",
22
+ "search": "Search"
23
+ }
24
+ }
25
+ }
26
+ }
@@ -1,26 +1,26 @@
1
- {
2
- "pro": {
3
- "components": {
4
- "rex-pro-table": {
5
- "empty-text": "请选择相关筛选条件进行搜索",
6
- "column-action-title": "操作",
7
- "pagination-total": "共 {total} 条",
8
- "action-buttons": {
9
- "please-check-data": "请勾选数据",
10
- "confirm-operation": "确认操作{label}",
11
- "confirm-execute": "确认要执行此操作吗?",
12
- "item-label-missing": "未配置按钮标签",
13
- "group-label-missing": "未配置分组标签"
14
- },
15
- "form": {
16
- "cancel": "取消",
17
- "confirm": "确认"
18
- }
19
- },
20
- "filter-form": {
21
- "reset": "重置",
22
- "search": "查询"
23
- }
24
- }
25
- }
26
- }
1
+ {
2
+ "pro": {
3
+ "components": {
4
+ "rex-pro-table": {
5
+ "empty-text": "请选择相关筛选条件进行搜索",
6
+ "column-action-title": "操作",
7
+ "pagination-total": "共 {total} 条",
8
+ "action-buttons": {
9
+ "please-check-data": "请勾选数据",
10
+ "confirm-operation": "确认操作{label}",
11
+ "confirm-execute": "确认要执行此操作吗?",
12
+ "item-label-missing": "未配置按钮标签",
13
+ "group-label-missing": "未配置分组标签"
14
+ },
15
+ "form": {
16
+ "cancel": "取消",
17
+ "confirm": "确认"
18
+ }
19
+ },
20
+ "filter-form": {
21
+ "reset": "重置",
22
+ "search": "查询"
23
+ }
24
+ }
25
+ }
26
+ }
@@ -1,4 +1,4 @@
1
- declare module '*.svg' {
2
- const content: string;
3
- export default content;
4
- }
1
+ declare module '*.svg' {
2
+ const content: string;
3
+ export default content;
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamias/rex-pro",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",