@pisell/materials 1.0.615 → 1.0.616

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.
@@ -17,7 +17,7 @@ interface UseTablePropsProps {
17
17
  * @returns
18
18
  */
19
19
  declare const useTableProps: (props: UseTablePropsProps) => {
20
- title: number | boolean | Iterable<React.ReactNode> | React.JSX.Element | (() => React.ReactNode) | null | undefined;
20
+ title: number | boolean | React.JSX.Element | Iterable<React.ReactNode> | (() => React.ReactNode) | null | undefined;
21
21
  pagination: {
22
22
  total: number;
23
23
  current: number;
@@ -26,7 +26,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
26
26
  showSizeChanger: boolean;
27
27
  };
28
28
  columns: import("./useColumns").Column[];
29
- subTitle: number | boolean | Iterable<React.ReactNode> | React.JSX.Element | (() => React.ReactNode) | null | undefined;
29
+ subTitle: number | boolean | React.JSX.Element | Iterable<React.ReactNode> | (() => React.ReactNode) | null | undefined;
30
30
  buttons: any[] | null;
31
31
  filter: React.JSX.Element | null;
32
32
  onRow: (record: any) => any;
@@ -47,7 +47,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
47
47
  width: number;
48
48
  align: "center" | "left" | "right";
49
49
  fixed: false | "left" | "right";
50
- type: "button" | "link";
50
+ type: "link" | "button";
51
51
  items: OperationItem[];
52
52
  } | undefined;
53
53
  operationContent?: {
@@ -166,7 +166,8 @@ var useTableProps = function useTableProps(props) {
166
166
  var label = item.label,
167
167
  actionType = item.actionType,
168
168
  show = item.show;
169
- var handleClick = function handleClick() {
169
+ var handleClick = function handleClick(e) {
170
+ e.stopPropagation();
170
171
  if (actionType === 'delete') {
171
172
  PisellModal.confirm({
172
173
  title: getText('pisell-delete-confirm-title'),
@@ -3,13 +3,55 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
4
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
5
5
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
- import React from 'react';
6
+ import React, { useEffect } from 'react';
7
7
  import classNames from 'classnames';
8
8
  import PcModal from "../PcModal";
9
9
  import "./index.less";
10
10
  var MobileModal = function MobileModal(props) {
11
11
  var wrapClassName = props.wrapClassName,
12
12
  mobileModalHeight = props.mobileModalHeight;
13
+ var ref = React.useRef(null);
14
+
15
+ // const targetY = useRef<null | number>(null);
16
+
17
+ // const touchStart = useCallback((e: React.TouchEvent<HTMLDivElement>) => {
18
+ // targetY.current = Math.floor(e.targetTouches[0].clientY);
19
+ // }, []);
20
+
21
+ // const touchmove = useCallback((e: React.TouchEvent<HTMLDivElement>) => {
22
+ // e.preventDefault();
23
+
24
+ // console.log(e.targetTouches[0].clientY, 'e.targetTouches[0].clientY');
25
+ // const NewTargetY = Math.floor(e.targetTouches[0].clientY),
26
+ // sTop = ref.current?.scrollTop || 0,
27
+ // sH = ref.current?.scrollHeight || 0,
28
+ // lyBoxH = ref.current?.clientHeight || 0;
29
+ // // 到顶部阻止
30
+ // if (sTop <= 0 && NewTargetY - targetY.current! > 0) {
31
+ // e.preventDefault();
32
+ // // 到底部阻止
33
+ // } else if (sTop >= sH - lyBoxH && NewTargetY - targetY.current! < 0) {
34
+ // e.preventDefault();
35
+ // }
36
+ // }, []);
37
+
38
+ useEffect(function () {
39
+ console.log(ref.current, 'ref.current');
40
+ // if (ref.current) {
41
+ // ref.current?.addEventListener('touchstart', touchStart);
42
+ // ref.current?.addEventListener('touchmove', touchmove);
43
+ // return () => {
44
+ // ref.current?.removeEventListener('touchstart', touchStart);
45
+ // ref.current?.removeEventListener('touchmove', touchmove);
46
+ // };
47
+ // }
48
+
49
+ if (props.open) {
50
+ document.body.style.overflow = 'hidden';
51
+ } else {
52
+ document.body.style.overflow = 'auto';
53
+ }
54
+ }, [props.open]);
13
55
  return /*#__PURE__*/React.createElement(PcModal, _extends({}, props, {
14
56
  transitionName: "pisell-move-down",
15
57
  width: "100%",
@@ -19,7 +61,8 @@ var MobileModal = function MobileModal(props) {
19
61
  className: classNames(_defineProperty({}, 'pisell-mobile-modal-render', mobileModalHeight)),
20
62
  style: {
21
63
  height: mobileModalHeight || '100%'
22
- }
64
+ },
65
+ ref: ref
23
66
  }, node);
24
67
  }
25
68
  }));
@@ -167,7 +167,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
167
167
  sort?: SortType | undefined;
168
168
  mode: "" | "localStorage" | "remote";
169
169
  currentViewMode: ModeType;
170
- }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
170
+ }) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
171
171
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
172
172
  export declare const stringify: (obj: Record<string, any>) => string;
173
173
  export {};
@@ -17,7 +17,7 @@ interface UseTablePropsProps {
17
17
  * @returns
18
18
  */
19
19
  declare const useTableProps: (props: UseTablePropsProps) => {
20
- title: number | boolean | Iterable<React.ReactNode> | React.JSX.Element | (() => React.ReactNode) | null | undefined;
20
+ title: number | boolean | React.JSX.Element | Iterable<React.ReactNode> | (() => React.ReactNode) | null | undefined;
21
21
  pagination: {
22
22
  total: number;
23
23
  current: number;
@@ -26,7 +26,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
26
26
  showSizeChanger: boolean;
27
27
  };
28
28
  columns: import("./useColumns").Column[];
29
- subTitle: number | boolean | Iterable<React.ReactNode> | React.JSX.Element | (() => React.ReactNode) | null | undefined;
29
+ subTitle: number | boolean | React.JSX.Element | Iterable<React.ReactNode> | (() => React.ReactNode) | null | undefined;
30
30
  buttons: any[] | null;
31
31
  filter: React.JSX.Element | null;
32
32
  onRow: (record: any) => any;
@@ -47,7 +47,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
47
47
  width: number;
48
48
  align: "center" | "left" | "right";
49
49
  fixed: false | "left" | "right";
50
- type: "button" | "link";
50
+ type: "link" | "button";
51
51
  items: OperationItem[];
52
52
  } | undefined;
53
53
  operationContent?: {
@@ -148,7 +148,8 @@ var useTableProps = (props) => {
148
148
  render: (_, record) => {
149
149
  return /* @__PURE__ */ import_react.default.createElement(import_antd.Space, null, items == null ? void 0 : items.map((item) => {
150
150
  const { label, actionType, show: show2 } = item;
151
- const handleClick = () => {
151
+ const handleClick = (e) => {
152
+ e.stopPropagation();
152
153
  if (actionType === "delete") {
153
154
  import_pisellModal.default.confirm({
154
155
  title: (0, import_locales.getText)("pisell-delete-confirm-title"),
@@ -38,6 +38,15 @@ var import_PcModal = __toESM(require("../PcModal"));
38
38
  var import_index = require("./index.less");
39
39
  var MobileModal = (props) => {
40
40
  const { wrapClassName, mobileModalHeight } = props;
41
+ const ref = import_react.default.useRef(null);
42
+ (0, import_react.useEffect)(() => {
43
+ console.log(ref.current, "ref.current");
44
+ if (props.open) {
45
+ document.body.style.overflow = "hidden";
46
+ } else {
47
+ document.body.style.overflow = "auto";
48
+ }
49
+ }, [props.open]);
41
50
  return /* @__PURE__ */ import_react.default.createElement(
42
51
  import_PcModal.default,
43
52
  {
@@ -56,7 +65,8 @@ var MobileModal = (props) => {
56
65
  }),
57
66
  style: {
58
67
  height: mobileModalHeight || "100%"
59
- }
68
+ },
69
+ ref
60
70
  },
61
71
  node
62
72
  );
@@ -167,7 +167,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
167
167
  sort?: SortType | undefined;
168
168
  mode: "" | "localStorage" | "remote";
169
169
  currentViewMode: ModeType;
170
- }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
170
+ }) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
171
171
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
172
172
  export declare const stringify: (obj: Record<string, any>) => string;
173
173
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.615",
3
+ "version": "1.0.616",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",