@pisell/materials 6.4.7 → 6.4.9

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 (124) 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 +7 -7
  6. package/build/lowcode/preview.js +146 -146
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +24 -23
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +25 -24
  11. package/es/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
  12. package/es/components/auto-resize-text/auto-text-size-standalone.js +258 -0
  13. package/es/components/auto-resize-text/index.d.ts +6 -0
  14. package/es/components/auto-resize-text/index.js +40 -0
  15. package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +11 -4
  16. package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
  17. package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
  18. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +6 -7
  19. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
  20. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -1
  21. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +92 -6
  22. package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +5 -0
  23. package/es/components/filter/types.d.ts +2 -0
  24. package/es/components/keyboard/index.d.ts +22 -0
  25. package/es/components/keyboard/index.js +159 -0
  26. package/es/components/keyboard/index.less +44 -0
  27. package/es/components/pisellQRScanner/index.d.ts +0 -13
  28. package/es/components/pisellQRScanner/index.js +0 -8
  29. package/es/components/pisellWalletPassCard/index.d.ts +1 -1
  30. package/es/components/pisellWalletPassCard/index.js +2 -1
  31. package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  32. package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +1 -0
  33. package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +73 -5
  34. package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
  35. package/es/components/productCard/cartSkuCard/index.js +2 -11
  36. package/es/components/productCard/components/Packages/utils.d.ts +1 -1
  37. package/es/components/table/Table/utils.d.ts +1 -1
  38. package/es/components/table/Table/utils.js +22 -1
  39. package/es/components/table/hooks/useTableSetting.d.ts +3 -4
  40. package/es/components/table/hooks/useTableSetting.js +113 -5
  41. package/es/components/table/index.js +14 -3
  42. package/es/components/table/types.d.ts +17 -0
  43. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
  44. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +21 -7
  45. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
  46. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
  47. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +44 -25
  48. package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
  49. package/es/components/virtualInput/BaseVirtualInput/index.js +163 -0
  50. package/es/components/virtualInput/BaseVirtualInput/index.less +78 -0
  51. package/es/components/virtualInput/index.d.ts +24 -0
  52. package/es/components/virtualInput/index.js +60 -0
  53. package/es/components/virtualInput/index.less +42 -0
  54. package/es/index.d.ts +2 -0
  55. package/es/index.js +3 -1
  56. package/es/locales/en-US.d.ts +1 -0
  57. package/es/locales/en-US.js +1 -0
  58. package/es/locales/zh-CN.d.ts +1 -0
  59. package/es/locales/zh-CN.js +1 -0
  60. package/es/locales/zh-TW.d.ts +1 -0
  61. package/es/locales/zh-TW.js +1 -0
  62. package/es/utils/platform.d.ts +1 -1
  63. package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
  64. package/lib/components/auto-resize-text/auto-text-size-standalone.js +273 -0
  65. package/lib/components/auto-resize-text/index.d.ts +6 -0
  66. package/lib/components/auto-resize-text/index.js +71 -0
  67. package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +8 -2
  68. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
  69. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
  70. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +6 -7
  71. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
  72. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -1
  73. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +78 -7
  74. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +5 -0
  75. package/lib/components/filter/types.d.ts +2 -0
  76. package/lib/components/keyboard/index.d.ts +22 -0
  77. package/lib/components/keyboard/index.js +223 -0
  78. package/lib/components/keyboard/index.less +44 -0
  79. package/lib/components/pisellQRScanner/index.d.ts +0 -13
  80. package/lib/components/pisellWalletPassCard/index.d.ts +1 -1
  81. package/lib/components/pisellWalletPassCard/index.js +2 -1
  82. package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  83. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +1 -0
  84. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +45 -11
  85. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
  86. package/lib/components/productCard/cartSkuCard/index.js +2 -13
  87. package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
  88. package/lib/components/table/Table/utils.d.ts +1 -1
  89. package/lib/components/table/Table/utils.js +18 -1
  90. package/lib/components/table/hooks/useTableSetting.d.ts +3 -4
  91. package/lib/components/table/hooks/useTableSetting.js +114 -4
  92. package/lib/components/table/index.js +12 -1
  93. package/lib/components/table/types.d.ts +17 -0
  94. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
  95. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +19 -2
  96. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
  97. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
  98. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +45 -27
  99. package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
  100. package/lib/components/virtualInput/BaseVirtualInput/index.js +179 -0
  101. package/lib/components/virtualInput/BaseVirtualInput/index.less +78 -0
  102. package/lib/components/virtualInput/index.d.ts +24 -0
  103. package/lib/components/virtualInput/index.js +102 -0
  104. package/lib/components/virtualInput/index.less +42 -0
  105. package/lib/index.d.ts +2 -0
  106. package/lib/index.js +6 -0
  107. package/lib/locales/en-US.d.ts +1 -0
  108. package/lib/locales/en-US.js +1 -0
  109. package/lib/locales/zh-CN.d.ts +1 -0
  110. package/lib/locales/zh-CN.js +1 -0
  111. package/lib/locales/zh-TW.d.ts +1 -0
  112. package/lib/locales/zh-TW.js +1 -0
  113. package/lib/utils/platform.d.ts +1 -1
  114. package/lowcode/data-source-table/meta.ts +239 -0
  115. package/lowcode/table/meta.ts +104 -0
  116. package/package.json +1 -1
  117. package/dist/umd/materials.min.css +0 -1
  118. package/dist/umd/materials.min.js +0 -1
  119. package/dist/umd/static/DotsSix.57d66266.svg +0 -1
  120. package/dist/umd/static/arrow-left.e542294f.svg +0 -1
  121. package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
  122. package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
  123. package/dist/umd/static/help-circle.31c9be40.svg +0 -1
  124. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ColumnType } from 'antd/es/table';
3
+ import { LocalSettingsType } from '../../table/types';
3
4
  import { DataSourceType } from '../provider/dataSource/DataSourceContext';
4
5
  export declare type OperationItem = {
5
6
  label?: string;
@@ -13,6 +14,9 @@ export declare type OperationItem = {
13
14
  afterClose?: () => void;
14
15
  };
15
16
  export interface DataSourceTableProps {
17
+ __id?: string;
18
+ currentComponentId?: string;
19
+ currentSettingKey?: string;
16
20
  title?: string | React.ReactNode | (() => React.ReactNode);
17
21
  subTitle?: string | React.ReactNode | (() => React.ReactNode);
18
22
  titleButtons?: {
@@ -76,4 +80,5 @@ export interface DataSourceTableProps {
76
80
  create?: Record<string, any>;
77
81
  destroy?: Record<string, any>;
78
82
  };
83
+ localSettings?: LocalSettingsType;
79
84
  }
@@ -9,6 +9,8 @@ export declare type FilterType = {
9
9
  sortButtonShow: boolean;
10
10
  /** 筛选列表 */
11
11
  list: FilterItemProps[];
12
+ items?: string[];
13
+ __items: string[];
12
14
  /** 快速筛选最大长度 */
13
15
  quickFilterMaxLength: number;
14
16
  /** 配置存储模式 */
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export declare type ItemValue = string | number;
4
+ export interface Item {
5
+ value: ItemValue;
6
+ label: React.ReactNode;
7
+ disabled: boolean;
8
+ type: 'text' | 'primary';
9
+ style?: React.CSSProperties;
10
+ size?: number;
11
+ }
12
+ export interface KeyboardProps {
13
+ id?: string;
14
+ className?: string;
15
+ style?: React.CSSProperties;
16
+ onChange?: (value?: ItemValue) => void;
17
+ items?: Item[];
18
+ rightItems?: Item[];
19
+ keydown?: boolean;
20
+ }
21
+ declare const _default: React.MemoExoticComponent<(props: KeyboardProps) => JSX.Element>;
22
+ export default _default;
@@ -0,0 +1,223 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/keyboard/index.tsx
30
+ var keyboard_exports = {};
31
+ __export(keyboard_exports, {
32
+ default: () => keyboard_default
33
+ });
34
+ module.exports = __toCommonJS(keyboard_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_index = require("./index.less");
38
+ var import_classnames = __toESM(require("classnames"));
39
+ var import_ahooks = require("ahooks");
40
+ var list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "+", "ok"];
41
+ var defaultArr = [
42
+ {
43
+ value: 1,
44
+ label: "1",
45
+ disabled: false,
46
+ type: "text"
47
+ },
48
+ {
49
+ value: 2,
50
+ label: "2",
51
+ disabled: false,
52
+ type: "text"
53
+ },
54
+ {
55
+ value: 3,
56
+ label: "3",
57
+ disabled: false,
58
+ type: "text"
59
+ },
60
+ {
61
+ value: 4,
62
+ label: "4",
63
+ disabled: false,
64
+ type: "text"
65
+ },
66
+ {
67
+ value: 5,
68
+ label: "5",
69
+ disabled: false,
70
+ type: "text"
71
+ },
72
+ {
73
+ value: 6,
74
+ label: "6",
75
+ disabled: false,
76
+ type: "text"
77
+ },
78
+ {
79
+ value: 7,
80
+ label: "7",
81
+ disabled: false,
82
+ type: "text"
83
+ },
84
+ {
85
+ value: 8,
86
+ label: "8",
87
+ disabled: false,
88
+ type: "text"
89
+ },
90
+ {
91
+ value: 9,
92
+ label: "9",
93
+ disabled: false,
94
+ type: "text"
95
+ },
96
+ {
97
+ value: "0",
98
+ label: "0",
99
+ disabled: false,
100
+ type: "text"
101
+ },
102
+ {
103
+ value: "00",
104
+ label: "00",
105
+ disabled: false,
106
+ type: "text"
107
+ },
108
+ {
109
+ value: ".",
110
+ label: ".",
111
+ disabled: false,
112
+ type: "text"
113
+ }
114
+ ];
115
+ var Keyboard = (props) => {
116
+ const {
117
+ items = defaultArr,
118
+ className,
119
+ style,
120
+ onChange,
121
+ rightItems,
122
+ keydown = true
123
+ } = props;
124
+ const contentRef = (0, import_react.useRef)(null);
125
+ const size = (0, import_ahooks.useSize)(contentRef);
126
+ (0, import_ahooks.useEventListener)("keydown", (ev) => {
127
+ console.log("ev", ev);
128
+ if (!keydown) {
129
+ return;
130
+ }
131
+ let key = ev.key;
132
+ if (key === "Enter") {
133
+ key = "ok";
134
+ }
135
+ if (key === "keydown") {
136
+ key = "+";
137
+ }
138
+ if (list.includes(key)) {
139
+ onChange == null ? void 0 : onChange(key);
140
+ }
141
+ });
142
+ const getHeight = (0, import_ahooks.useMemoizedFn)((itemSize = 1) => {
143
+ return ((size == null ? void 0 : size.width) || 0) / 4 * itemSize + (itemSize - 1) * 7;
144
+ });
145
+ return /* @__PURE__ */ import_react.default.createElement(
146
+ "div",
147
+ {
148
+ id: props.id || "",
149
+ className: (0, import_classnames.default)("pisell-virtual-keyboard-wrap", className),
150
+ style
151
+ },
152
+ /* @__PURE__ */ import_react.default.createElement(
153
+ "div",
154
+ {
155
+ className: (0, import_classnames.default)("pisell-virtual-keyboard-content"),
156
+ ref: contentRef
157
+ },
158
+ items.map((item) => {
159
+ var _a;
160
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-virtual-keyboard-item", style: item.style }, /* @__PURE__ */ import_react.default.createElement(
161
+ import_antd.Button,
162
+ {
163
+ id: `pisell-virtual-keyboard-${item.value}`,
164
+ key: item.value,
165
+ type: item.type,
166
+ className: "pisell-virtual-keyboard-item-button",
167
+ style: {
168
+ color: item.type === "primary" ? "#fff" : ((_a = item.style) == null ? void 0 : _a.color) || void 0
169
+ },
170
+ disabled: item.disabled,
171
+ onClick: (e) => {
172
+ onChange == null ? void 0 : onChange(item.value);
173
+ }
174
+ },
175
+ item.label
176
+ ));
177
+ })
178
+ ),
179
+ rightItems && /* @__PURE__ */ import_react.default.createElement(
180
+ "div",
181
+ {
182
+ className: (0, import_classnames.default)(
183
+ "pisell-virtual-keyboard-content",
184
+ "pisell-virtual-keyboard-right"
185
+ ),
186
+ style: { flex: `0 0 calc((100% - 21px) / 4 * 1)` }
187
+ },
188
+ rightItems == null ? void 0 : rightItems.map((item) => {
189
+ var _a, _b;
190
+ return /* @__PURE__ */ import_react.default.createElement(
191
+ "div",
192
+ {
193
+ className: "pisell-virtual-keyboard-item",
194
+ style: {
195
+ ...item.style || {},
196
+ height: getHeight(item.size)
197
+ }
198
+ },
199
+ /* @__PURE__ */ import_react.default.createElement(
200
+ import_antd.Button,
201
+ {
202
+ id: `pisell-virtual-keyboard-${item.value}`,
203
+ key: item.value,
204
+ type: item.type,
205
+ className: "pisell-virtual-keyboard-item-button",
206
+ style: {
207
+ fontSize: ((_a = item.style) == null ? void 0 : _a.fontSize) || 25,
208
+ color: item.type === "primary" ? "#fff" : ((_b = item.style) == null ? void 0 : _b.color) || void 0,
209
+ ...item.type === "primary" ? item.style || {} : {}
210
+ },
211
+ disabled: item.disabled,
212
+ onClick: (e) => {
213
+ onChange == null ? void 0 : onChange(item.value);
214
+ }
215
+ },
216
+ item.label
217
+ )
218
+ );
219
+ })
220
+ )
221
+ );
222
+ };
223
+ var keyboard_default = import_react.default.memo(Keyboard);
@@ -0,0 +1,44 @@
1
+ .pisell-virtual-keyboard-wrap {
2
+ display: flex;
3
+ gap: 7px;
4
+ .pisell-virtual-keyboard-content {
5
+ width: 100%;
6
+ display: flex;
7
+ flex-wrap: wrap;
8
+ align-items: center;
9
+ justify-content: flex-end;
10
+ gap: 7px;
11
+
12
+ .pisell-virtual-keyboard-item {
13
+ border-radius: 5px;
14
+ background: var(--Base-White, #fff);
15
+ box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.06);;
16
+ overflow: hidden;
17
+ width: calc((100% - 14px) / 3 * 1);
18
+ padding-top: 25%;
19
+ position: relative;
20
+
21
+ .pisell-virtual-keyboard-item-button {
22
+ position: absolute;
23
+ left: 0;
24
+ top: 0;
25
+ width: 100%;
26
+ height: 100%;
27
+ border-radius: 5px;
28
+ color: var(--Base-Black, #000);
29
+ font-size: 25px;
30
+ font-style: normal;
31
+ font-weight: 400;
32
+ box-shadow: none;
33
+ padding: 0 !important;
34
+ }
35
+ }
36
+ }
37
+ .pisell-virtual-keyboard-right {
38
+ flex-direction: column;
39
+ justify-content: start;
40
+ .pisell-virtual-keyboard-item{
41
+ width: 100%;
42
+ }
43
+ }
44
+ }
@@ -1,18 +1,5 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
- import type { DetailedHTMLProps, HTMLAttributes, VideoHTMLAttributes, InputHTMLAttributes } from 'react';
4
- declare type ExtendedDetailedHTMLProps<T extends HTMLAttributes<E>, E extends HTMLElement> = DetailedHTMLProps<T, E> & {
5
- children?: React.ReactNode;
6
- };
7
- declare global {
8
- namespace JSX {
9
- interface IntrinsicElements {
10
- div: ExtendedDetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
11
- video: DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
12
- input: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
13
- }
14
- }
15
- }
16
3
  export interface PisellQRScannerProps {
17
4
  /** 是否可见 */
18
5
  visible: boolean;
@@ -117,7 +117,7 @@ export interface PisellWalletPassCardProps {
117
117
  color: string;
118
118
  };
119
119
  /** 卡片状态 */
120
- cardStatus?: 'used' | 'expired' | 'disabled' | 'conflict';
120
+ cardStatus?: 'used' | 'expired' | 'disabled' | 'conflict' | 'lastPayment';
121
121
  /** 自定义余额格式化函数,如果提供则优先使用 */
122
122
  formatBalance?: (balance?: number, option?: FormatOption) => React.ReactNode;
123
123
  /** 自定义余额标题格式化函数,如果提供则优先使用 */
@@ -50,7 +50,8 @@ var cardStatusMap = {
50
50
  used: "warning",
51
51
  expired: "error",
52
52
  conflict: "error",
53
- disabled: "gray"
53
+ disabled: "gray",
54
+ lastPayment: "gray"
54
55
  };
55
56
  var PisellWalletPassCard = (props) => {
56
57
  const [isShowDetail, setIsShowDetail] = import_react.default.useState(false);
@@ -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) => any;
20
+ export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
@@ -17,6 +17,7 @@ export declare type Action = {
17
17
  text: ReactNode;
18
18
  color?: ActionColor | string;
19
19
  onClick?: (e: React.MouseEvent) => void;
20
+ style?: React.CSSProperties;
20
21
  };
21
22
  export declare type SwipeActionProps = {
22
23
  rightActions?: Action[];
@@ -110,17 +110,26 @@ var SwipeAction = (0, import_react.forwardRef)(
110
110
  const rootRef = (0, import_react.useRef)(null);
111
111
  const leftRef = (0, import_react.useRef)(null);
112
112
  const rightRef = (0, import_react.useRef)(null);
113
+ const [containerHeight, setContainerHeight] = (0, import_react.useState)(0);
113
114
  function getWidth(ref2) {
114
115
  const element = ref2.current;
115
116
  if (!element) return 0;
116
117
  return element.offsetWidth;
117
118
  }
119
+ function getHeight(ref2) {
120
+ const element = ref2.current;
121
+ if (!element) return 0;
122
+ return element.offsetHeight;
123
+ }
118
124
  function getLeftWidth() {
119
125
  return getWidth(leftRef);
120
126
  }
121
127
  function getRightWidth() {
122
128
  return getWidth(rightRef);
123
129
  }
130
+ function getRootHeight() {
131
+ return getHeight(rootRef);
132
+ }
124
133
  const [{ x }, api] = (0, import_web.useSpring)(
125
134
  () => ({
126
135
  x: 0,
@@ -213,6 +222,20 @@ var SwipeAction = (0, import_react.forwardRef)(
213
222
  },
214
223
  close
215
224
  }));
225
+ (0, import_react.useEffect)(() => {
226
+ const updateHeight = () => {
227
+ const height = getRootHeight();
228
+ setContainerHeight(height);
229
+ };
230
+ updateHeight();
231
+ const resizeObserver = new ResizeObserver(updateHeight);
232
+ if (rootRef.current) {
233
+ resizeObserver.observe(rootRef.current);
234
+ }
235
+ return () => {
236
+ resizeObserver.disconnect();
237
+ };
238
+ }, []);
216
239
  (0, import_react.useEffect)(() => {
217
240
  if (!props.closeOnTouchOutside) return;
218
241
  function handle(e) {
@@ -238,14 +261,32 @@ var SwipeAction = (0, import_react.forwardRef)(
238
261
  document.removeEventListener("mousedown", handle);
239
262
  };
240
263
  }, [props.closeOnTouchOutside, props.escapeDom]);
241
- function renderAction(action) {
264
+ const getRightContainerClass = () => {
265
+ const baseClass = `${classPrefix}-actions ${classPrefix}-actions-right`;
266
+ if (containerHeight > 180) {
267
+ return `${baseClass} ${classPrefix}-height-large`;
268
+ } else if (containerHeight > 120) {
269
+ return `${baseClass} ${classPrefix}-height-medium`;
270
+ }
271
+ return `${baseClass} ${classPrefix}-height-small`;
272
+ };
273
+ const getRightActionButtonClass = () => {
274
+ if (containerHeight > 180) {
275
+ return `${classPrefix}-action-height-large`;
276
+ } else if (containerHeight > 120) {
277
+ return `${classPrefix}-action-height-medium`;
278
+ }
279
+ return `${classPrefix}-action-height-small`;
280
+ };
281
+ function renderAction(action, isRightAction = false) {
242
282
  const color = action.color ?? "light";
243
283
  const _style = action.style || {};
284
+ const buttonClass = isRightAction ? `${classPrefix}-action-button ${getRightActionButtonClass()}` : `${classPrefix}-action-button`;
244
285
  return /* @__PURE__ */ import_react.default.createElement(
245
286
  Button,
246
287
  {
247
288
  key: action.key,
248
- className: `${classPrefix}-action-button`,
289
+ className: buttonClass,
249
290
  style: {
250
291
  "--background-color": colorRecord[color] ?? color,
251
292
  ..._style
@@ -285,7 +326,7 @@ var SwipeAction = (0, import_react.forwardRef)(
285
326
  className: `${classPrefix}-actions ${classPrefix}-actions-left`,
286
327
  ref: leftRef
287
328
  },
288
- props.leftActions.map(renderAction)
329
+ props.leftActions.map((action) => renderAction(action, false))
289
330
  )
290
331
  ), /* @__PURE__ */ import_react.default.createElement(
291
332
  "div",
@@ -312,14 +353,7 @@ var SwipeAction = (0, import_react.forwardRef)(
312
353
  )
313
354
  ), withStopPropagation(
314
355
  props.stopPropagation,
315
- /* @__PURE__ */ import_react.default.createElement(
316
- "div",
317
- {
318
- className: `${classPrefix}-actions ${classPrefix}-actions-right`,
319
- ref: rightRef
320
- },
321
- props.rightActions.map(renderAction)
322
- )
356
+ /* @__PURE__ */ import_react.default.createElement("div", { className: getRightContainerClass(), ref: rightRef }, props.rightActions.map((action) => renderAction(action, true)))
323
357
  ))
324
358
  )
325
359
  );
@@ -33,3 +33,42 @@
33
33
  padding-right: 4px;
34
34
  }
35
35
  }
36
+
37
+ .pisell-custom-swipe-action-action-button {
38
+ min-width: 80px;
39
+ }
40
+
41
+ /* 容器样式 */
42
+ .pisell-custom-swipe-action-height-large {
43
+ display: flex;
44
+ flex-direction: column;
45
+ background-color: rgba(67, 93, 147, 0.3);
46
+ justify-content: flex-start;
47
+
48
+ .pisell-number-selector-btn {
49
+ width: 40px !important;
50
+ height: 40px !important;
51
+ }
52
+ }
53
+
54
+ .pisell-custom-swipe-action-height-medium {
55
+ display: flex;
56
+ flex-direction: column;
57
+ background-color: rgba(67, 93, 147, 0.3);
58
+
59
+ .pisell-number-selector-btn {
60
+ width: 40px !important;
61
+ height: 40px !important;
62
+ }
63
+ }
64
+
65
+ /* 按钮样式 */
66
+ .pisell-custom-swipe-action-action-height-large {
67
+ height: 60px;
68
+ width: 200px;
69
+ }
70
+
71
+ .pisell-custom-swipe-action-action-height-medium {
72
+ flex: 1;
73
+ width: 200px;
74
+ }
@@ -199,7 +199,7 @@ var CartSkuCard = (props) => {
199
199
  }
200
200
  return renderA2();
201
201
  };
202
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, type === "a2" ? /* @__PURE__ */ import_react.default.createElement(
202
+ return /* @__PURE__ */ import_react.default.createElement(
203
203
  import_swipeAction.SwipeAction,
204
204
  {
205
205
  closeOnAction: false,
@@ -219,18 +219,7 @@ var CartSkuCard = (props) => {
219
219
  },
220
220
  renderContent()
221
221
  )
222
- ) : /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${PREFIX}-wrapper`) }, /* @__PURE__ */ import_react.default.createElement(
223
- "div",
224
- {
225
- className: (0, import_classnames.default)(PREFIX, `${PREFIX}-${type}`),
226
- onClick: (e) => {
227
- e.preventDefault();
228
- e.stopPropagation();
229
- onCard == null ? void 0 : onCard(dataSource);
230
- }
231
- },
232
- renderContent()
233
- )));
222
+ );
234
223
  };
235
224
  var cartSkuCard_default = CartSkuCard;
236
225
  // Annotate the CommonJS export names for ESM import in node:
@@ -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) => any;
20
+ export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
155
155
  sort?: SortType | undefined;
156
156
  mode: "" | "localStorage" | "remote";
157
157
  currentViewMode: ModeType;
158
- }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
158
+ }) => ("filters" | "filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
159
159
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
160
160
  export declare const stringify: (obj: Record<string, any>) => string;
161
161
  export {};
@@ -307,7 +307,24 @@ var setFormValuesToLocalStorage = ({
307
307
  currentSettingHash
308
308
  });
309
309
  };
310
- var getTableKey = (tableId) => `${tableKeyPrefix}-${tableId}`;
310
+ var getTableKey = (tableId) => {
311
+ if (typeof window === "undefined" || typeof window.location === "undefined") {
312
+ return `${tableKeyPrefix}-${tableId}`;
313
+ }
314
+ const { pathname, search } = window.location;
315
+ let appendPath = pathname || "/";
316
+ let memoryKey = "";
317
+ try {
318
+ const params = new URLSearchParams(search || "");
319
+ const mk = params.get("memory_key");
320
+ if (mk && mk.trim() !== "") {
321
+ memoryKey = mk.trim();
322
+ }
323
+ } catch (e) {
324
+ }
325
+ const urlPart = memoryKey ? `${appendPath}#${memoryKey}` : appendPath;
326
+ return `${tableKeyPrefix}-${tableId}-${urlPart}`;
327
+ };
311
328
  var mergeFilterSetting = ({
312
329
  list,
313
330
  quickFilterMaxLength,
@@ -1,5 +1,5 @@
1
1
  import { FilterType } from "../../filter/types";
2
- import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, ModeType, SortType, ExportImportModeType } from "../types";
2
+ import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, ModeType, SortType, ExportImportModeType, LocalSettingsType } from "../types";
3
3
  declare type UseTableSettingProps = {
4
4
  tableId?: string;
5
5
  filter: FilterType;
@@ -12,11 +12,10 @@ declare type UseTableSettingProps = {
12
12
  gallery?: GallerySettingType;
13
13
  currentSettingHash: string;
14
14
  exportImport?: ExportImportModeType;
15
+ localSettings?: LocalSettingsType;
15
16
  };
16
17
  declare const useTableSetting: (params: UseTableSettingProps) => {
17
18
  setTableSetting: (values: Record<string, any>) => void;
18
- tableSetting: {
19
- [x: string]: any;
20
- };
19
+ tableSetting: any;
21
20
  };
22
21
  export default useTableSetting;