@sooloer/pages 0.0.1 → 0.1.0

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.
@@ -20,7 +20,7 @@ export default (function () {
20
20
  setLoading = _useState4[1];
21
21
  var _useState5 = useState({
22
22
  pageNo: 1,
23
- pageSize: 20
23
+ pageSize: 2
24
24
  }),
25
25
  _useState6 = _slicedToArray(_useState5, 2),
26
26
  _useState6$ = _useState6[0],
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { ProTableProps } from '../typing';
3
- import './index.less';
4
3
  declare const ElTable: React.FC<ProTableProps>;
5
4
  export default ElTable;
@@ -19,12 +19,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
19
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
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
21
  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; }
22
+ import { StyleProvider } from '@ant-design/cssinjs';
22
23
  import { sum } from '@tmaito/utils';
23
24
  import { Checkbox, Col, ConfigProvider, Row, Table } from 'antd';
24
25
  import React, { useContext, useLayoutEffect, useMemo, useState } from 'react';
25
26
  import { render } from 'react-dom';
26
27
  import Setting from "../setting";
27
- import "./index.less";
28
+ import Style from "./style";
28
29
  var ElTable = function ElTable(_ref) {
29
30
  var _ref$loading = _ref.loading,
30
31
  loading = _ref$loading === void 0 ? false : _ref$loading,
@@ -151,7 +152,11 @@ var ElTable = function ElTable(_ref) {
151
152
  }
152
153
  return scrollProps;
153
154
  };
154
- return /*#__PURE__*/React.createElement(Table, _extends({}, args, {
155
+ return /*#__PURE__*/React.createElement(StyleProvider, {
156
+ hashPriority: "high"
157
+ }, /*#__PURE__*/React.createElement(Style, {
158
+ prefix: getPrefixCls()
159
+ }), /*#__PURE__*/React.createElement(Table, _extends({}, args, {
155
160
  size: size,
156
161
  rowKey: rowKey,
157
162
  className: "sooloer-table",
@@ -165,6 +170,6 @@ var ElTable = function ElTable(_ref) {
165
170
  ,
166
171
  pagination: paginationConfig,
167
172
  scroll: resetScrollProps()
168
- }));
173
+ })));
169
174
  };
170
175
  export default ElTable;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const Style: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & {
3
+ prefix?: string | undefined;
4
+ }>;
5
+ export default Style;
@@ -0,0 +1,7 @@
1
+ import { createGlobalStyle } from 'styled-components';
2
+ var Style = createGlobalStyle([".sooloer-table{height:100%;> .", "-spin-nested-loading{height:100%;> div[class$='-spin-container']{height:100%;}.", "-table{height:calc(100% - 48px);}}div[class$='-table-container']{height:100%;}div[class$='-table-body']{height:100%;}tr[class$='-table-placeholder']{> td{border-bottom:none;}}li[class$='-pagination-total-text']{flex:1;}&-global-checkbox{margin-left:12px;}.sooloer-table-pagination{margin:12px 0 !important;}}"], function (props) {
3
+ return props.prefix;
4
+ }, function (props) {
5
+ return props.prefix;
6
+ });
7
+ export default Style;
package/package.json CHANGED
@@ -1,29 +1,26 @@
1
1
  {
2
2
  "name": "@sooloer/pages",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "A react library developed with dumi",
5
+ "license": "MIT",
5
6
  "module": "dist/index.js",
6
7
  "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
7
11
  "scripts": {
8
- "start": "npm run dev",
9
- "dev": "dumi dev",
10
12
  "build": "father build",
11
13
  "build:watch": "father dev",
14
+ "dev": "dumi dev",
12
15
  "docs:build": "dumi build",
13
- "prepare": "husky install && dumi setup",
14
16
  "doctor": "father doctor",
15
17
  "lint": "npm run lint:es && npm run lint:css",
16
18
  "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
17
19
  "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
18
- "prepublishOnly": "father doctor && npm run build"
20
+ "prepare": "husky install && dumi setup",
21
+ "prepublishOnly": "father doctor && npm run build",
22
+ "start": "npm run dev"
19
23
  },
20
- "authors": [
21
- "menghan.zhu@outlook.com"
22
- ],
23
- "license": "MIT",
24
- "files": [
25
- "dist"
26
- ],
27
24
  "commitlint": {
28
25
  "extends": [
29
26
  "@commitlint/config-conventional"
@@ -46,12 +43,16 @@
46
43
  "prettier --parser=typescript --write"
47
44
  ]
48
45
  },
49
- "publishConfig": {
50
- "access": "public"
51
- },
52
- "peerDependencies": {
53
- "react": ">=16.9.0",
54
- "react-dom": ">=16.9.0"
46
+ "dependencies": {
47
+ "@ant-design/cssinjs": "^1.18.4",
48
+ "@ant-design/icons": "^5.3.0",
49
+ "@tmaito/utils": "^0.4.14",
50
+ "antd": "^5.14.2",
51
+ "dayjs": "^1.11.10",
52
+ "mockjs": "^1.1.0",
53
+ "react-sortable-hoc": "^2.0.0",
54
+ "react-virtualized-auto-sizer": "^1.0.23",
55
+ "styled-components": "^6.1.8"
55
56
  },
56
57
  "devDependencies": {
57
58
  "@commitlint/cli": "^17.1.2",
@@ -73,14 +74,14 @@
73
74
  "react-dom": "^18.0.0",
74
75
  "stylelint": "^14.9.1"
75
76
  },
76
- "dependencies": {
77
- "@ant-design/icons": "^5.3.0",
78
- "@tmaito/utils": "^0.4.14",
79
- "antd": "^5.14.2",
80
- "dayjs": "^1.11.10",
81
- "mockjs": "^1.1.0",
82
- "react-sortable-hoc": "^2.0.0",
83
- "react-virtualized-auto-sizer": "^1.0.23",
84
- "styled-components": "^6.1.8"
85
- }
77
+ "peerDependencies": {
78
+ "react": ">=16.9.0",
79
+ "react-dom": ">=16.9.0"
80
+ },
81
+ "publishConfig": {
82
+ "access": "public"
83
+ },
84
+ "authors": [
85
+ "menghan.zhu@outlook.com"
86
+ ]
86
87
  }