@pisell/materials 1.0.97 → 1.0.99

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.
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM8 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM8 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.707 4.293a1 1 0 0 1 0 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l5.293 5.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L16.586 13H5a1 1 0 1 1 0-2h11.586l-5.293-5.293a1 1 0 0 1 0-1.414Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 6a1 1 0 0 1 1-1h18a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Zm3 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Zm3 6a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12Zm11.258-3.976a2 2 0 0 0-2.225 1.308 1 1 0 1 1-1.886-.664 4 4 0 0 1 7.773 1.333c0 1.53-1.135 2.54-1.945 3.081a8.044 8.044 0 0 1-1.686.848l-.035.013-.011.003-.004.002h-.002L11.92 13l.316.949a1 1 0 0 1-.633-1.897l.016-.006.074-.027a6.051 6.051 0 0 0 1.172-.6c.69-.46 1.055-.95 1.055-1.419v-.001a2 2 0 0 0-1.662-1.975ZM11 17a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.293 3.293a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L8 6.414V20a1 1 0 1 1-2 0V6.414L3.707 8.707a1 1 0 0 1-1.414-1.414l4-4ZM16 17.586V4a1 1 0 1 1 2 0v13.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L16 17.586Z"/></svg>
@@ -10,6 +10,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
10
10
  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; }
11
11
  import React, { useCallback, useMemo, useState } from "react";
12
12
  import { Button, Col, Empty, List, Row, Skeleton, Space } from "antd";
13
+ import { getUniqueId } from "@pisell/utils";
13
14
  import Pagination from "../Pagination";
14
15
  import { CloseOutlined } from "@ant-design/icons";
15
16
  import InfiniteScroll from "react-infinite-scroll-component";
@@ -54,6 +55,9 @@ var RecordView = function RecordView(props) {
54
55
  }
55
56
  }, [responsive, pcDetailModalDisplay, padDetailModalDisplay, mobilePadDetailModalDisplay]);
56
57
  var _footer = useMemo(function () {
58
+ if (!(pagination && paginationType === "default") && !footer) {
59
+ return null;
60
+ }
57
61
  return /*#__PURE__*/React.createElement(React.Fragment, null, pagination && paginationType === "default" && /*#__PURE__*/React.createElement(Pagination, _extends({
58
62
  showLessItems: true
59
63
  }, pagination)), footer);
@@ -88,12 +92,15 @@ var RecordView = function RecordView(props) {
88
92
  return /*#__PURE__*/React.createElement(Button, item);
89
93
  }))));
90
94
  }, [props.dataSource, locale, emptyButtons]);
95
+ var scrollListId = useMemo(function () {
96
+ return "scrollableDiv-".concat(getUniqueId());
97
+ }, []);
91
98
  var list = useMemo(function () {
92
99
  if (paginationType === "scroll") {
93
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
100
+ return /*#__PURE__*/React.createElement("div", null, header && /*#__PURE__*/React.createElement("div", {
94
101
  className: "".concat(prefix, "scroll-header-wrap")
95
102
  }, header), /*#__PURE__*/React.createElement("div", {
96
- id: "scrollableDiv",
103
+ id: scrollListId,
97
104
  style: {
98
105
  height: listHeight || 400,
99
106
  overflow: "auto"
@@ -102,23 +109,22 @@ var RecordView = function RecordView(props) {
102
109
  dataLength: props.dataSource.length,
103
110
  next: loadMoreData,
104
111
  hasMore: props.dataSource.length < ((pagination === null || pagination === void 0 ? void 0 : pagination.total) || 999999),
105
- loader: /*#__PURE__*/React.createElement(Skeleton, {
112
+ loader: props.dataSource.length > 0 && /*#__PURE__*/React.createElement(Skeleton, {
106
113
  avatar: true,
107
114
  paragraph: {
108
115
  rows: 1
109
116
  },
110
- active: true
117
+ active: true,
118
+ className: "".concat(prefix, "scroll-skeleton")
111
119
  }),
112
- scrollableTarget: "scrollableDiv"
120
+ scrollableTarget: scrollListId
113
121
  }, /*#__PURE__*/React.createElement(List, _extends({}, others, {
114
- split: false,
115
122
  renderItem: _renderItem
116
- }), emptyDom))), /*#__PURE__*/React.createElement("div", {
123
+ }), emptyDom))), _footer && /*#__PURE__*/React.createElement("div", {
117
124
  className: "".concat(prefix, "scroll-footer-wrap")
118
125
  }, _footer));
119
126
  }
120
127
  return /*#__PURE__*/React.createElement(List, _extends({}, others, {
121
- split: false,
122
128
  renderItem: _renderItem,
123
129
  header: header,
124
130
  footer: _footer
@@ -36,5 +36,11 @@
36
36
  }
37
37
  &-close-icon {
38
38
  font-size: 18px;
39
+ position: absolute;
40
+ top: 12px;
41
+ right: 20px;
42
+ }
43
+ &-scroll-skeleton {
44
+ padding: 12px 24px;
39
45
  }
40
46
  }
package/es/index.d.ts CHANGED
@@ -26,6 +26,7 @@ export { Progress } from "antd";
26
26
  export { Rate } from "antd";
27
27
  export { Result } from "antd";
28
28
  export { Row } from "antd";
29
+ export { QRCode } from "antd";
29
30
  export { Space } from "antd";
30
31
  export { Spin } from "antd";
31
32
  export { Steps } from "antd";
package/es/index.js CHANGED
@@ -44,6 +44,7 @@ export { Row } from "antd";
44
44
 
45
45
  // export { Skeleton } from 'antd';
46
46
 
47
+ export { QRCode } from "antd";
47
48
  export { Space } from "antd";
48
49
  export { Spin } from "antd";
49
50
  export { Steps } from "antd";
@@ -34,6 +34,7 @@ __export(record_view_exports, {
34
34
  module.exports = __toCommonJS(record_view_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
+ var import_utils = require("@pisell/utils");
37
38
  var import_Pagination = __toESM(require("../Pagination"));
38
39
  var import_icons = require("@ant-design/icons");
39
40
  var import_react_infinite_scroll_component = __toESM(require("react-infinite-scroll-component"));
@@ -81,6 +82,9 @@ var RecordView = (props) => {
81
82
  mobilePadDetailModalDisplay
82
83
  ]);
83
84
  const _footer = (0, import_react.useMemo)(() => {
85
+ if (!(pagination && paginationType === "default") && !footer) {
86
+ return null;
87
+ }
84
88
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, pagination && paginationType === "default" && /* @__PURE__ */ import_react.default.createElement(import_Pagination.default, { showLessItems: true, ...pagination }), footer);
85
89
  }, [pagination, footer]);
86
90
  const _renderItem = (0, import_react.useCallback)(
@@ -117,12 +121,15 @@ var RecordView = (props) => {
117
121
  }
118
122
  ), !!emptyButtons.length && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}empty-button` }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, null, emptyButtons.map((item) => /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { ...item })))));
119
123
  }, [props.dataSource, locale, emptyButtons]);
124
+ const scrollListId = (0, import_react.useMemo)(() => {
125
+ return `scrollableDiv-${(0, import_utils.getUniqueId)()}`;
126
+ }, []);
120
127
  const list = (0, import_react.useMemo)(() => {
121
128
  if (paginationType === "scroll") {
122
- return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}scroll-header-wrap` }, header), /* @__PURE__ */ import_react.default.createElement(
129
+ return /* @__PURE__ */ import_react.default.createElement("div", null, header && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}scroll-header-wrap` }, header), /* @__PURE__ */ import_react.default.createElement(
123
130
  "div",
124
131
  {
125
- id: "scrollableDiv",
132
+ id: scrollListId,
126
133
  style: {
127
134
  height: listHeight || 400,
128
135
  overflow: "auto"
@@ -134,18 +141,25 @@ var RecordView = (props) => {
134
141
  dataLength: props.dataSource.length,
135
142
  next: loadMoreData,
136
143
  hasMore: props.dataSource.length < ((pagination == null ? void 0 : pagination.total) || 999999),
137
- loader: /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { avatar: true, paragraph: { rows: 1 }, active: true }),
138
- scrollableTarget: "scrollableDiv"
144
+ loader: props.dataSource.length > 0 && /* @__PURE__ */ import_react.default.createElement(
145
+ import_antd.Skeleton,
146
+ {
147
+ avatar: true,
148
+ paragraph: { rows: 1 },
149
+ active: true,
150
+ className: `${prefix}scroll-skeleton`
151
+ }
152
+ ),
153
+ scrollableTarget: scrollListId
139
154
  },
140
- /* @__PURE__ */ import_react.default.createElement(import_antd.List, { ...others, split: false, renderItem: _renderItem }, emptyDom)
155
+ /* @__PURE__ */ import_react.default.createElement(import_antd.List, { ...others, renderItem: _renderItem }, emptyDom)
141
156
  )
142
- ), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}scroll-footer-wrap` }, _footer));
157
+ ), _footer && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}scroll-footer-wrap` }, _footer));
143
158
  }
144
159
  return /* @__PURE__ */ import_react.default.createElement(
145
160
  import_antd.List,
146
161
  {
147
162
  ...others,
148
- split: false,
149
163
  renderItem: _renderItem,
150
164
  header,
151
165
  footer: _footer
@@ -36,5 +36,11 @@
36
36
  }
37
37
  &-close-icon {
38
38
  font-size: 18px;
39
+ position: absolute;
40
+ top: 12px;
41
+ right: 20px;
42
+ }
43
+ &-scroll-skeleton {
44
+ padding: 12px 24px;
39
45
  }
40
46
  }
package/lib/index.d.ts CHANGED
@@ -26,6 +26,7 @@ export { Progress } from "antd";
26
26
  export { Rate } from "antd";
27
27
  export { Result } from "antd";
28
28
  export { Row } from "antd";
29
+ export { QRCode } from "antd";
29
30
  export { Space } from "antd";
30
31
  export { Spin } from "antd";
31
32
  export { Steps } from "antd";
package/lib/index.js CHANGED
@@ -67,6 +67,7 @@ __export(src_exports, {
67
67
  Popconfirm: () => import_antd23.Popconfirm,
68
68
  Popover: () => import_antd24.Popover,
69
69
  Progress: () => import_antd25.Progress,
70
+ QRCode: () => import_antd29.QRCode,
70
71
  Radio: () => import_radio.default,
71
72
  Rate: () => import_antd26.Rate,
72
73
  RecordView: () => import_record_view.default,
@@ -76,26 +77,26 @@ __export(src_exports, {
76
77
  Skeleton: () => import_skeleton.default,
77
78
  Slider: () => import_slider.default,
78
79
  SortableList: () => import_sortableList.default,
79
- Space: () => import_antd29.Space,
80
- Spin: () => import_antd30.Spin,
80
+ Space: () => import_antd30.Space,
81
+ Spin: () => import_antd31.Spin,
81
82
  Statistic: () => import_antd20.Statistic,
82
- Steps: () => import_antd31.Steps,
83
- Switch: () => import_antd32.Switch,
83
+ Steps: () => import_antd32.Steps,
84
+ Switch: () => import_antd33.Switch,
84
85
  Table: () => import_table.default,
85
86
  Tabs: () => import_tabs.default,
86
- Tag: () => import_antd35.Tag,
87
+ Tag: () => import_antd36.Tag,
87
88
  TimePicker: () => import_time_picker.default,
88
- Timeline: () => import_antd36.Timeline,
89
- Tooltip: () => import_antd37.Tooltip,
90
- Transfer: () => import_antd33.Transfer,
89
+ Timeline: () => import_antd37.Timeline,
90
+ Tooltip: () => import_antd38.Tooltip,
91
+ Transfer: () => import_antd34.Transfer,
91
92
  Translation: () => import_translation.default,
92
- Tree: () => import_antd34.Tree,
93
+ Tree: () => import_antd35.Tree,
93
94
  TreeSelect: () => import_tree_select.default,
94
95
  Typography: () => import_typography.default,
95
96
  Upload: () => import_upload.default,
96
97
  message: () => import_antd18.message,
97
98
  notification: () => import_antd21.notification,
98
- version: () => import_antd38.version
99
+ version: () => import_antd39.version
99
100
  });
100
101
  module.exports = __toCommonJS(src_exports);
101
102
  var import_antd = require("antd");
@@ -136,6 +137,7 @@ var import_antd35 = require("antd");
136
137
  var import_antd36 = require("antd");
137
138
  var import_antd37 = require("antd");
138
139
  var import_antd38 = require("antd");
140
+ var import_antd39 = require("antd");
139
141
  var import_typography = __toESM(require("./components/typography"));
140
142
  var import_skeleton = __toESM(require("./components/skeleton"));
141
143
  var import_checkbox = __toESM(require("./components/checkbox"));
@@ -205,6 +207,7 @@ var import_record_view = __toESM(require("./components/record-view"));
205
207
  Popconfirm,
206
208
  Popover,
207
209
  Progress,
210
+ QRCode,
208
211
  Radio,
209
212
  Rate,
210
213
  RecordView,
@@ -0,0 +1,139 @@
1
+ import snippets from './snippets';
2
+
3
+ export default {
4
+ snippets,
5
+ componentName: 'QRCode',
6
+ title: '二维码',
7
+ category: '数据展示',
8
+ docUrl: "",
9
+ screenshot: "",
10
+ devMode: "proCode",
11
+ npm: {
12
+ package: "@pisell/materials",
13
+ version: "1.0.1",
14
+ exportName: "QRCode",
15
+ main: "src/index.tsx",
16
+ destructuring: true,
17
+ subName: "",
18
+ },
19
+ props: [
20
+ {
21
+ name: 'value',
22
+ title: { label: '内容', tip: '内容' },
23
+ propType: 'string',
24
+ },
25
+ {
26
+ name: 'type',
27
+ title: { label: '渲染类型', tip: '渲染类型' },
28
+ setter: {
29
+ componentName: 'RadioGroupSetter',
30
+ props: {
31
+ options: [
32
+ {
33
+ title: 'Canvas',
34
+ value: 'canvas',
35
+ },
36
+ {
37
+ title: 'Svg',
38
+ value: 'svg',
39
+ },
40
+ ],
41
+ },
42
+ },
43
+ },
44
+ {
45
+ name: 'icon',
46
+ title: { label: '二维码中图片的地址', tip: '二维码中图片的地址(目前只支持图片地址)' },
47
+ propType: 'string',
48
+ },
49
+ {
50
+ name: 'size',
51
+ title: { label: '二维码大小', tip: '二维码大小' },
52
+ propType: 'number',
53
+ },
54
+ {
55
+ name: 'iconSize',
56
+ title: { label: '二维码中图片的大小', tip: '二维码中图片的大小' },
57
+ propType: 'number',
58
+ },
59
+ {
60
+ name: 'color',
61
+ description: '二维码颜色',
62
+ propType: 'string',
63
+ setter: 'ColorSetter',
64
+ },
65
+ {
66
+ name: 'bgColor',
67
+ description: '二维码背景颜色',
68
+ propType: 'string',
69
+ setter: 'ColorSetter',
70
+ },
71
+ {
72
+ name: 'bordered',
73
+ title: { label: '是否有边框', tip: '是否有边框' },
74
+ propType: 'bool',
75
+ setter: 'BoolSetter'
76
+ },
77
+ {
78
+ name: 'errorLevel',
79
+ title: { label: '二维码纠错等级', tip: '通常情况下二维码分为 4 个纠错级别:L级 可纠正约 7% 错误、M级 可纠正约 15% 错误、Q级 可纠正约 25% 错误、H级 可纠正约30% 错误。并不是所有位置都可以缺损,像最明显的三个角上的方框,直接影响初始定位。中间零散的部分是内容编码,可以容忍缺损。当二维码的内容编码携带信息比较少的时候,也就是链接比较短的时候,设置不同的纠错等级,生成的图片不会发生变化。' },
80
+ setter: {
81
+ componentName: 'RadioGroupSetter',
82
+ props: {
83
+ options: [
84
+ {
85
+ title: 'L',
86
+ value: 'L',
87
+ },
88
+ {
89
+ title: 'M',
90
+ value: 'M',
91
+ },
92
+ {
93
+ title: 'Q',
94
+ value: 'Q',
95
+ },
96
+ {
97
+ title: 'H',
98
+ value: 'H',
99
+ },
100
+ ],
101
+ },
102
+ },
103
+ },
104
+ {
105
+ name: 'status',
106
+ title: { label: '二维码状态', tip: '二维码状态' },
107
+ setter: {
108
+ componentName: 'RadioGroupSetter',
109
+ props: {
110
+ options: [
111
+ {
112
+ title: 'active',
113
+ value: 'active',
114
+ },
115
+ {
116
+ title: 'expired',
117
+ value: 'expired',
118
+ },
119
+ {
120
+ title: 'loading',
121
+ value: 'loading',
122
+ },
123
+ ],
124
+ },
125
+ },
126
+ },
127
+ ],
128
+ configure: {
129
+ supports: {
130
+ style: true,
131
+ events: [
132
+ {
133
+ name: 'onRefresh',
134
+ template: "onRefresh(event,${extParams}){\n// 刷新\nconsole.log('onClose',event);}",
135
+ },
136
+ ],
137
+ },
138
+ },
139
+ };
@@ -0,0 +1,20 @@
1
+ export default [
2
+ {
3
+ title: '二维码',
4
+ screenshot: '',
5
+ schema: {
6
+ componentName: 'QRCode',
7
+ props: {
8
+ value: "pisell2",
9
+ size: 160,
10
+ iconSize: 40,
11
+ status: "active",
12
+ errorLevel: "L",
13
+ type: "canvas",
14
+ color: "#000",
15
+ bgColor: "transparent",
16
+ bordered: true,
17
+ },
18
+ },
19
+ },
20
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.97",
3
+ "version": "1.0.99",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",