@pisell/materials 2.2.33 → 2.2.35

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.
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
5
5
  className: string;
6
6
  defaultCurrent: number;
7
7
  showTotal: (total: number, range: [number, number]) => string;
8
- itemRender: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
8
+ itemRender: (page: number, type: "page" | "next" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
9
9
  responsive: boolean;
10
10
  size: string;
11
11
  };
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import "./index.less";
1
+ import React from 'react';
2
+ import './index.less';
3
3
  interface RightPanelProps {
4
4
  value: string;
5
5
  onChange: (value: string) => void;
@@ -1,7 +1,7 @@
1
- import React, { useMemo, useEffect } from "react";
1
+ import React, { useMemo, useEffect } from 'react';
2
2
  import "./index.less";
3
3
  import { sliceDayIntoFiveMinutes, findNextSlice } from "../utils";
4
- import classNames from "classnames";
4
+ import classNames from 'classnames';
5
5
  var RightPanel = function RightPanel(props) {
6
6
  var value = props.value,
7
7
  onChange = props.onChange,
@@ -19,8 +19,8 @@ var RightPanel = function RightPanel(props) {
19
19
  timeSlices: list,
20
20
  date: value
21
21
  });
22
- var scrollDom = document.querySelector(".select-time-right-panel-list");
23
- var timeDom = document.querySelector("#time".concat(nextTime.replace(":", "")));
22
+ var scrollDom = document.querySelector('.select-time-right-panel-list');
23
+ var timeDom = document.querySelector("#time".concat(nextTime.replace(':', '')));
24
24
  if (scrollDom && timeDom) {
25
25
  scrollDom.scrollTop = timeDom.offsetTop;
26
26
  }
@@ -31,11 +31,11 @@ var RightPanel = function RightPanel(props) {
31
31
  className: "select-time-right-panel-list"
32
32
  }, list.map(function (d) {
33
33
  return /*#__PURE__*/React.createElement("div", {
34
- className: classNames("select-time-right-panel-item", {
35
- "select-time-right-panel-item-active": d.value === value
34
+ className: classNames('select-time-right-panel-item', {
35
+ 'select-time-right-panel-item-active': d.value === value
36
36
  }),
37
37
  key: d.value,
38
- id: "time" + d.value.replace(":", ""),
38
+ id: 'time' + d.value.replace(':', ''),
39
39
  onClick: function onClick() {
40
40
  onChange(d.value);
41
41
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export declare const formatApiUrl: (url: string) => string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export var formatApiUrl = function formatApiUrl(url) {
10
+ return url || '/shop/form/data';
11
+ };
@@ -54,11 +54,17 @@ var BasicTable = function BasicTable(props) {
54
54
  return isArr(group) && group.length > 0;
55
55
  }, [group]);
56
56
  var showTotal = pagination.showTotal,
57
- localPagination = pagination.localPagination;
57
+ localPagination = pagination.localPagination,
58
+ showSizeChange = pagination.showSizeChange;
58
59
  var _showTotal = useCallback(function (total, range) {
59
60
  var _size = formPagination.size || 10;
60
61
  return showTotal(total, range, _size);
61
62
  }, [showTotal, formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, formPagination === null || formPagination === void 0 ? void 0 : formPagination.size]);
63
+ useEffect(function () {
64
+ // 默认100条每页
65
+ var _size = formPagination.size || 100;
66
+ showSizeChange && showSizeChange(formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, _size);
67
+ }, [formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, formPagination === null || formPagination === void 0 ? void 0 : formPagination.size]);
62
68
 
63
69
  // 分割数据源
64
70
  var _dataSource = useMemo(function () {
@@ -15,6 +15,7 @@ export interface KeyboardProps {
15
15
  onChange?: (value?: ItemValue) => void;
16
16
  items?: Item[];
17
17
  rightItems?: Item[];
18
+ keydown?: boolean;
18
19
  }
19
20
  declare const _default: React.MemoExoticComponent<(props: KeyboardProps) => React.JSX.Element>;
20
21
  export default _default;
@@ -9,7 +9,7 @@ import { Button } from 'antd';
9
9
  import "./index.less";
10
10
  import classNames from 'classnames';
11
11
  import { useEventListener, useMemoizedFn, useSize } from 'ahooks';
12
- var list = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ok'];
12
+ var list = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '+', 'ok'];
13
13
  var defaultArr = [];
14
14
  var Keyboard = function Keyboard(props) {
15
15
  var _props$items = props.items,
@@ -17,15 +17,23 @@ var Keyboard = function Keyboard(props) {
17
17
  className = props.className,
18
18
  style = props.style,
19
19
  onChange = props.onChange,
20
- rightItems = props.rightItems;
20
+ rightItems = props.rightItems,
21
+ _props$keydown = props.keydown,
22
+ keydown = _props$keydown === void 0 ? true : _props$keydown;
21
23
  var contentRef = useRef(null);
22
24
  var size = useSize(contentRef);
23
25
  useEventListener('keydown', function (ev) {
24
26
  console.log('ev', ev);
27
+ if (!keydown) {
28
+ return;
29
+ }
25
30
  var key = ev.key;
26
31
  if (key === 'Enter') {
27
32
  key = 'ok';
28
33
  }
34
+ if (key === 'keydown') {
35
+ key = '+';
36
+ }
29
37
  if (list.includes(key)) {
30
38
  // let dom = document.querySelector(`#virtual-keyboard-${ev.key}`);
31
39
  // if (dom) {
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
5
5
  className: string;
6
6
  defaultCurrent: number;
7
7
  showTotal: (total: number, range: [number, number]) => string;
8
- itemRender: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
8
+ itemRender: (page: number, type: "page" | "next" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
9
9
  responsive: boolean;
10
10
  size: string;
11
11
  };
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import "./index.less";
1
+ import React from 'react';
2
+ import './index.less';
3
3
  interface RightPanelProps {
4
4
  value: string;
5
5
  onChange: (value: string) => void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export declare const formatApiUrl: (url: string) => string;
@@ -0,0 +1,31 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/table/Actions/component/ExportImport/utils/index.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ formatApiUrl: () => formatApiUrl
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ var formatApiUrl = (url) => {
26
+ return url || "/shop/form/data";
27
+ };
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ formatApiUrl
31
+ });
@@ -55,7 +55,7 @@ var BasicTable = (props) => {
55
55
  const group = import_antd.Form.useWatch("group_by", { form, preserve: true });
56
56
  const { dispatch } = (0, import_hooks.useSharedState)(import_model.Context);
57
57
  const isGroup = (0, import_react.useMemo)(() => (0, import_utils2.isArr)(group) && group.length > 0, [group]);
58
- const { showTotal, localPagination } = pagination;
58
+ const { showTotal, localPagination, showSizeChange } = pagination;
59
59
  const _showTotal = (0, import_react.useCallback)(
60
60
  (total2, range) => {
61
61
  let _size = formPagination.size || 10;
@@ -63,6 +63,10 @@ var BasicTable = (props) => {
63
63
  },
64
64
  [showTotal, formPagination == null ? void 0 : formPagination.page, formPagination == null ? void 0 : formPagination.size]
65
65
  );
66
+ (0, import_react.useEffect)(() => {
67
+ let _size = formPagination.size || 100;
68
+ showSizeChange && showSizeChange(formPagination == null ? void 0 : formPagination.page, _size);
69
+ }, [formPagination == null ? void 0 : formPagination.page, formPagination == null ? void 0 : formPagination.size]);
66
70
  const _dataSource = (0, import_react.useMemo)(() => {
67
71
  let _page = formPagination.page;
68
72
  let _size = formPagination.size || 10;
@@ -15,6 +15,7 @@ export interface KeyboardProps {
15
15
  onChange?: (value?: ItemValue) => void;
16
16
  items?: Item[];
17
17
  rightItems?: Item[];
18
+ keydown?: boolean;
18
19
  }
19
20
  declare const _default: React.MemoExoticComponent<(props: KeyboardProps) => React.JSX.Element>;
20
21
  export default _default;
@@ -37,18 +37,31 @@ var import_antd = require("antd");
37
37
  var import_index = require("./index.less");
38
38
  var import_classnames = __toESM(require("classnames"));
39
39
  var import_ahooks = require("ahooks");
40
- var list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "ok"];
40
+ var list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "ok"];
41
41
  var defaultArr = [];
42
42
  var Keyboard = (props) => {
43
- const { items = defaultArr, className, style, onChange, rightItems } = props;
43
+ const {
44
+ items = defaultArr,
45
+ className,
46
+ style,
47
+ onChange,
48
+ rightItems,
49
+ keydown = true
50
+ } = props;
44
51
  const contentRef = (0, import_react.useRef)(null);
45
52
  const size = (0, import_ahooks.useSize)(contentRef);
46
53
  (0, import_ahooks.useEventListener)("keydown", (ev) => {
47
54
  console.log("ev", ev);
55
+ if (!keydown) {
56
+ return;
57
+ }
48
58
  let key = ev.key;
49
59
  if (key === "Enter") {
50
60
  key = "ok";
51
61
  }
62
+ if (key === "keydown") {
63
+ key = "+";
64
+ }
52
65
  if (list.includes(key)) {
53
66
  onChange == null ? void 0 : onChange(key);
54
67
  }
@@ -982,6 +982,28 @@ export default {
982
982
  value: 'target => !!target.getProps().getPropValue("pagination")',
983
983
  },
984
984
  },
985
+ {
986
+ name: "pagination.showSizeChange",
987
+ title: {
988
+ label: "页数改变",
989
+ tip: "pagination.showSizeChange | pageSize 变化的回调",
990
+ },
991
+ propType: "func",
992
+ setter: [
993
+ {
994
+ componentName: "FunctionSetter",
995
+ props: {
996
+ template:
997
+ "showSizeChange(current,size,${extParams}){\n// pageSize 变化的回调\nconsole.log('showSizeChange', current, size);\n}",
998
+ },
999
+ },
1000
+ "VariableSetter",
1001
+ ],
1002
+ condition: {
1003
+ type: "JSFunction",
1004
+ value: 'target => !!target.getProps().getPropValue("pagination")',
1005
+ },
1006
+ },
985
1007
  {
986
1008
  name: "pagination.localPagination",
987
1009
  title: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "2.2.33",
3
+ "version": "2.2.35",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -63,8 +63,8 @@
63
63
  "react-virtualized-auto-sizer": "^1.0.20",
64
64
  "crypto-js": "^4.2.0",
65
65
  "@zxing/library": "0.21.2",
66
- "@pisell/icon": "0.0.11",
67
66
  "@pisell/utils": "2.0.1",
67
+ "@pisell/icon": "0.0.11",
68
68
  "@pisell/date-picker": "1.0.100"
69
69
  },
70
70
  "peerDependencies": {