@pisell/materials 2.2.97 → 2.2.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.
Files changed (40) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +164 -148
  7. package/build/lowcode/render/default/view.js +39 -25
  8. package/build/lowcode/view.js +39 -25
  9. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +2 -0
  10. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -2
  11. package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
  12. package/es/components/filter/index.d.ts +1 -0
  13. package/es/components/pisellCardList/index.js +3 -1
  14. package/es/components/pisellCheckboxGroup/index.d.ts +1 -0
  15. package/es/components/pisellCheckboxGroup/index.js +15 -1
  16. package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +1 -0
  17. package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  18. package/es/components/productCard/components/MultiDay/index.d.ts +1 -0
  19. package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -0
  20. package/es/components/productCard/components/Packages/components/options/index.d.ts +1 -0
  21. package/es/components/productCard/components/Packages/utils.d.ts +1 -1
  22. package/es/components/walletCard/Guide/index.js +12 -1
  23. package/es/utils/platform.d.ts +1 -1
  24. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +2 -0
  25. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -2
  26. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
  27. package/lib/components/filter/index.d.ts +1 -0
  28. package/lib/components/pisellCardList/index.js +3 -1
  29. package/lib/components/pisellCheckboxGroup/index.d.ts +1 -0
  30. package/lib/components/pisellCheckboxGroup/index.js +16 -0
  31. package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +1 -0
  32. package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  33. package/lib/components/productCard/components/MultiDay/index.d.ts +1 -0
  34. package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -0
  35. package/lib/components/productCard/components/Packages/components/options/index.d.ts +1 -0
  36. package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
  37. package/lib/components/walletCard/Guide/index.js +11 -1
  38. package/lib/utils/platform.d.ts +1 -1
  39. package/lowcode/data-source-table/meta.ts +14 -0
  40. package/package.json +3 -3
@@ -54,6 +54,8 @@ var useDrawerState = function useDrawerState(operationContent) {
54
54
  setDrawerVisible(false);
55
55
  // 等待动画完成后再清除item
56
56
  timerRef.current = setTimeout(function () {
57
+ var _item$afterClose;
58
+ item === null || item === void 0 || (_item$afterClose = item.afterClose) === null || _item$afterClose === void 0 || _item$afterClose.call(item);
57
59
  setItem(null);
58
60
  timerRef.current = undefined;
59
61
  }, 300);
@@ -42,13 +42,14 @@ declare const useTableProps: (props: UseTablePropsProps) => {
42
42
  items: OperationItem[];
43
43
  } | undefined;
44
44
  operation?: {
45
- show: boolean;
46
- title: string; /**
45
+ /**
47
46
  * 处理table的props
48
47
  * 转换title
49
48
  * @param props
50
49
  * @returns
51
50
  */
51
+ show: boolean;
52
+ title: string;
52
53
  width: number;
53
54
  align: "center" | "left" | "right";
54
55
  fixed: false | "left" | "right";
@@ -10,6 +10,7 @@ export declare type OperationItem = {
10
10
  key: string;
11
11
  buttonProps?: any;
12
12
  onClick?: (record: any) => void;
13
+ afterClose?: () => void;
13
14
  };
14
15
  export interface DataSourceTableProps {
15
16
  title?: string | React.ReactNode | (() => React.ReactNode);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FilterProps } from "./types";
2
3
  declare const Filter: (props: FilterProps) => JSX.Element | null;
3
4
  export default Filter;
@@ -37,7 +37,8 @@ var PisellCardList = function PisellCardList(props) {
37
37
  showValidDate = props.showValidDate,
38
38
  empty = props.empty,
39
39
  showEmpty = props.showEmpty,
40
- showBalanceSymbol = props.showBalanceSymbol;
40
+ showBalanceSymbol = props.showBalanceSymbol,
41
+ onChangeDebounce = props.onChangeDebounce;
41
42
  return data.length ? /*#__PURE__*/React.createElement(PisellCheckboxGroup, {
42
43
  options: data,
43
44
  value: value,
@@ -48,6 +49,7 @@ var PisellCardList = function PisellCardList(props) {
48
49
  onChange: onChange,
49
50
  iconPosition: "hide",
50
51
  fullWidth: fullWidth,
52
+ onChangeDebounce: onChangeDebounce,
51
53
  renderOption: function renderOption(item, active, index) {
52
54
  return /*#__PURE__*/React.createElement(PisellWalletPassCard, _extends({}, item, {
53
55
  active: active,
@@ -23,6 +23,7 @@ export interface PisellCheckboxGroupProps extends React.HTMLAttributes<HTMLDivEl
23
23
  iconPosition?: 'left' | 'right' | 'hide';
24
24
  optionClassName?: string;
25
25
  optionActiveClassName?: string;
26
+ onChangeDebounce?: boolean;
26
27
  }
27
28
  /**
28
29
  * @title: PisellCheckboxGroup
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["platform", "gap", "style", "options", "onChange", "value", "renderOption", "padding", "rowKey", "mode", "direction", "fullWidth", "iconPosition", "optionClassName", "optionActiveClassName"];
2
+ var _excluded = ["platform", "gap", "style", "options", "onChange", "value", "renderOption", "padding", "rowKey", "mode", "direction", "fullWidth", "iconPosition", "optionClassName", "optionActiveClassName", "onChangeDebounce"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -18,6 +18,7 @@ import React, { useEffect, useMemo } from 'react';
18
18
  import usePisellConfig from "../pisell-config-provider/hooks/usePisellConfig";
19
19
  import classNames from 'classnames';
20
20
  import { Checkbox, Radio } from 'antd';
21
+ import { useDebounceFn } from "ahooks";
21
22
  import { isNumber } from '@pisell/utils';
22
23
  import { changeArray } from '@pisell/utils';
23
24
  import "./index.less";
@@ -63,6 +64,7 @@ var PisellCheckboxGroup = function PisellCheckboxGroup(props) {
63
64
  iconPosition = _props$iconPosition === void 0 ? 'left' : _props$iconPosition,
64
65
  optionClassName = props.optionClassName,
65
66
  optionActiveClassName = props.optionActiveClassName,
67
+ onChangeDebounce = props.onChangeDebounce,
66
68
  rest = _objectWithoutProperties(props, _excluded);
67
69
  var _useState = useState([]),
68
70
  _useState2 = _slicedToArray(_useState, 2),
@@ -141,6 +143,14 @@ var PisellCheckboxGroup = function PisellCheckboxGroup(props) {
141
143
  // 单选模式, 只返回第一个值
142
144
  onChange === null || onChange === void 0 || onChange(mode === 'single' ? val[0] : val, item);
143
145
  };
146
+ var _useDebounceFn = useDebounceFn(function (key, item) {
147
+ handleSelectItem(key, item);
148
+ }, {
149
+ wait: 400,
150
+ leading: true,
151
+ trailing: false
152
+ }),
153
+ run = _useDebounceFn.run;
144
154
 
145
155
  /**
146
156
  * @title: 选择
@@ -181,6 +191,10 @@ var PisellCheckboxGroup = function PisellCheckboxGroup(props) {
181
191
  style: rowStyle,
182
192
  onClick: function onClick(e) {
183
193
  if (option.disabled) return;
194
+ if (onChangeDebounce) {
195
+ run(option[rowKey], option);
196
+ return;
197
+ }
184
198
  handleSelectItem(option[rowKey], option);
185
199
  },
186
200
  leftContent: iconPosition === 'left' && /*#__PURE__*/React.createElement(CheckBoxItem, {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const MultiDay: ({ dataSource, hideDivider }: any) => JSX.Element;
3
4
  export default MultiDay;
@@ -17,4 +17,4 @@ export declare const minusSign: (item: any, type?: string) => "" | "-";
17
17
  * @Author: WangHan
18
18
  * @Date: 2024-11-22 10:58
19
19
  */
20
- export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
20
+ export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const MultiDay: ({ dataSource, hideDivider }: any) => JSX.Element;
3
4
  export default MultiDay;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const renderBundles: (item: any, hidePrice?: boolean, isShowPackageNote?: boolean) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Options: ({ options, amountSymbol }: any) => JSX.Element | null;
3
4
  export default Options;
@@ -17,4 +17,4 @@ export declare const minusSign: (item: any, type?: string) => "" | "-";
17
17
  * @Author: WangHan
18
18
  * @Date: 2024-11-22 10:58
19
19
  */
20
- export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
20
+ export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => any;
@@ -37,9 +37,20 @@ var Guide = function Guide(props) {
37
37
  * @Date: 2025-06-09 14:36
38
38
  */
39
39
  var handleClick = function handleClick(e) {
40
- var _setting$skipLink;
40
+ var _setting$skipLink, _utils$interaction, _utils$interaction$is;
41
41
  e.stopPropagation();
42
42
  if (!(_setting !== null && _setting !== void 0 && (_setting$skipLink = _setting.skipLink) !== null && _setting$skipLink !== void 0 && _setting$skipLink.page)) return;
43
+ if (utils !== null && utils !== void 0 && (_utils$interaction = utils.interaction) !== null && _utils$interaction !== void 0 && (_utils$interaction = _utils$interaction.utils) !== null && _utils$interaction !== void 0 && (_utils$interaction$is = _utils$interaction.isAppEnv) !== null && _utils$interaction$is !== void 0 && _utils$interaction$is.call(_utils$interaction)) {
44
+ var _utils$interaction2, _utils$interaction2$p;
45
+ utils === null || utils === void 0 || (_utils$interaction2 = utils.interaction) === null || _utils$interaction2 === void 0 || (_utils$interaction2 = _utils$interaction2.utils) === null || _utils$interaction2 === void 0 || (_utils$interaction2$p = _utils$interaction2.postMessageToApp) === null || _utils$interaction2$p === void 0 || _utils$interaction2$p.call(_utils$interaction2, {
46
+ module: 'global',
47
+ key: 'openNative',
48
+ data: {
49
+ link: _setting === null || _setting === void 0 ? void 0 : _setting.skipLink
50
+ }
51
+ });
52
+ return;
53
+ }
43
54
  utils === null || utils === void 0 || utils.jumpPageByLink(_setting === null || _setting === void 0 ? void 0 : _setting.skipLink);
44
55
  };
45
56
  return /*#__PURE__*/React.createElement("div", {
@@ -1 +1 @@
1
- export declare const isMobile: () => boolean;
1
+ export declare const isMobile: () => any;
@@ -64,6 +64,8 @@ var useDrawerState = (operationContent) => {
64
64
  }
65
65
  setDrawerVisible(false);
66
66
  timerRef.current = setTimeout(() => {
67
+ var _a;
68
+ (_a = item == null ? void 0 : item.afterClose) == null ? void 0 : _a.call(item);
67
69
  setItem(null);
68
70
  timerRef.current = void 0;
69
71
  }, 300);
@@ -42,13 +42,14 @@ declare const useTableProps: (props: UseTablePropsProps) => {
42
42
  items: OperationItem[];
43
43
  } | undefined;
44
44
  operation?: {
45
- show: boolean;
46
- title: string; /**
45
+ /**
47
46
  * 处理table的props
48
47
  * 转换title
49
48
  * @param props
50
49
  * @returns
51
50
  */
51
+ show: boolean;
52
+ title: string;
52
53
  width: number;
53
54
  align: "center" | "left" | "right";
54
55
  fixed: false | "left" | "right";
@@ -10,6 +10,7 @@ export declare type OperationItem = {
10
10
  key: string;
11
11
  buttonProps?: any;
12
12
  onClick?: (record: any) => void;
13
+ afterClose?: () => void;
13
14
  };
14
15
  export interface DataSourceTableProps {
15
16
  title?: string | React.ReactNode | (() => React.ReactNode);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FilterProps } from "./types";
2
3
  declare const Filter: (props: FilterProps) => JSX.Element | null;
3
4
  export default Filter;
@@ -62,7 +62,8 @@ var PisellCardList = (props) => {
62
62
  showValidDate,
63
63
  empty,
64
64
  showEmpty,
65
- showBalanceSymbol
65
+ showBalanceSymbol,
66
+ onChangeDebounce
66
67
  } = props;
67
68
  return data.length ? /* @__PURE__ */ import_react.default.createElement(
68
69
  import_pisellCheckboxGroup.default,
@@ -76,6 +77,7 @@ var PisellCardList = (props) => {
76
77
  onChange,
77
78
  iconPosition: "hide",
78
79
  fullWidth,
80
+ onChangeDebounce,
79
81
  renderOption: (item, active, index) => {
80
82
  return /* @__PURE__ */ import_react.default.createElement(
81
83
  import_pisellWalletPassCard.default,
@@ -23,6 +23,7 @@ export interface PisellCheckboxGroupProps extends React.HTMLAttributes<HTMLDivEl
23
23
  iconPosition?: 'left' | 'right' | 'hide';
24
24
  optionClassName?: string;
25
25
  optionActiveClassName?: string;
26
+ onChangeDebounce?: boolean;
26
27
  }
27
28
  /**
28
29
  * @title: PisellCheckboxGroup
@@ -36,6 +36,7 @@ var import_react = __toESM(require("react"));
36
36
  var import_usePisellConfig = __toESM(require("../pisell-config-provider/hooks/usePisellConfig"));
37
37
  var import_classnames = __toESM(require("classnames"));
38
38
  var import_antd = require("antd");
39
+ var import_ahooks = require("ahooks");
39
40
  var import_utils = require("@pisell/utils");
40
41
  var import_utils2 = require("@pisell/utils");
41
42
  var import_index = require("./index.less");
@@ -62,6 +63,7 @@ var PisellCheckboxGroup = (props) => {
62
63
  iconPosition = "left",
63
64
  optionClassName,
64
65
  optionActiveClassName,
66
+ onChangeDebounce,
65
67
  ...rest
66
68
  } = props;
67
69
  const [_value, set_value] = (0, import_react2.useState)([]);
@@ -112,6 +114,16 @@ var PisellCheckboxGroup = (props) => {
112
114
  const _onChange = (val, item) => {
113
115
  onChange == null ? void 0 : onChange(mode === "single" ? val[0] : val, item);
114
116
  };
117
+ const { run } = (0, import_ahooks.useDebounceFn)(
118
+ (key, item) => {
119
+ handleSelectItem(key, item);
120
+ },
121
+ {
122
+ wait: 400,
123
+ leading: true,
124
+ trailing: false
125
+ }
126
+ );
115
127
  const handleSelectItem = (key, item) => {
116
128
  let newVal = [key];
117
129
  if (mode === "multiple") {
@@ -146,6 +158,10 @@ var PisellCheckboxGroup = (props) => {
146
158
  style: rowStyle,
147
159
  onClick: (e) => {
148
160
  if (option.disabled) return;
161
+ if (onChangeDebounce) {
162
+ run(option[rowKey], option);
163
+ return;
164
+ }
149
165
  handleSelectItem(option[rowKey], option);
150
166
  },
151
167
  leftContent: iconPosition === "left" && /* @__PURE__ */ import_react.default.createElement(
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const MultiDay: ({ dataSource, hideDivider }: any) => JSX.Element;
3
4
  export default MultiDay;
@@ -17,4 +17,4 @@ export declare const minusSign: (item: any, type?: string) => "" | "-";
17
17
  * @Author: WangHan
18
18
  * @Date: 2024-11-22 10:58
19
19
  */
20
- export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
20
+ export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const MultiDay: ({ dataSource, hideDivider }: any) => JSX.Element;
3
4
  export default MultiDay;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const renderBundles: (item: any, hidePrice?: boolean, isShowPackageNote?: boolean) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Options: ({ options, amountSymbol }: any) => JSX.Element | null;
3
4
  export default Options;
@@ -17,4 +17,4 @@ export declare const minusSign: (item: any, type?: string) => "" | "-";
17
17
  * @Author: WangHan
18
18
  * @Date: 2024-11-22 10:58
19
19
  */
20
- export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
20
+ export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => any;
@@ -51,9 +51,19 @@ var Guide = (props) => {
51
51
  return (setting == null ? void 0 : setting.walletGuideConfig) || {};
52
52
  }, [setting == null ? void 0 : setting.walletGuideConfig]);
53
53
  const handleClick = (e) => {
54
- var _a2;
54
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
55
55
  e.stopPropagation();
56
56
  if (!((_a2 = _setting == null ? void 0 : _setting.skipLink) == null ? void 0 : _a2.page)) return;
57
+ if ((_d2 = (_c2 = (_b2 = utils == null ? void 0 : utils.interaction) == null ? void 0 : _b2.utils) == null ? void 0 : _c2.isAppEnv) == null ? void 0 : _d2.call(_c2)) {
58
+ (_g2 = (_f2 = (_e2 = utils == null ? void 0 : utils.interaction) == null ? void 0 : _e2.utils) == null ? void 0 : _f2.postMessageToApp) == null ? void 0 : _g2.call(_f2, {
59
+ module: "global",
60
+ key: "openNative",
61
+ data: {
62
+ link: _setting == null ? void 0 : _setting.skipLink
63
+ }
64
+ });
65
+ return;
66
+ }
57
67
  utils == null ? void 0 : utils.jumpPageByLink(_setting == null ? void 0 : _setting.skipLink);
58
68
  };
59
69
  return /* @__PURE__ */ import_react.default.createElement(
@@ -1 +1 @@
1
- export declare const isMobile: () => boolean;
1
+ export declare const isMobile: () => any;
@@ -897,6 +897,13 @@ const dataSourceTable = {
897
897
  },
898
898
  },
899
899
  },
900
+ {
901
+ name: 'afterClose',
902
+ title: { label: '关闭后' },
903
+ setter: {
904
+ componentName: 'FunctionSetter'
905
+ }
906
+ }
900
907
  ],
901
908
  },
902
909
  },
@@ -2689,6 +2696,13 @@ const dataSourceTable = {
2689
2696
  componentName: 'BoolSetter'
2690
2697
  },
2691
2698
  ],
2699
+ },
2700
+ {
2701
+ name: 'afterClose',
2702
+ title: { label: '关闭后' },
2703
+ setter: {
2704
+ componentName: 'FunctionSetter'
2705
+ }
2692
2706
  }
2693
2707
  ],
2694
2708
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "2.2.97",
3
+ "version": "2.2.99",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -74,8 +74,8 @@
74
74
  "swiper": "^8.4.7",
75
75
  "vod-js-sdk-v6": "^1.4.11",
76
76
  "@pisell/date-picker": "1.0.101",
77
- "@pisell/utils": "2.0.1",
78
- "@pisell/icon": "0.0.11"
77
+ "@pisell/icon": "0.0.11",
78
+ "@pisell/utils": "2.0.1"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "react": "^18.0.0",