@pisell/materials 1.0.929 → 1.0.930

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 (51) 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 +148 -164
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +23 -37
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +28 -42
  11. package/es/components/batch-editor/index.d.ts +1 -0
  12. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  13. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  14. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
  15. package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  16. package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  17. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  18. package/es/components/dataSourceComponents/fields/index.d.ts +7 -6
  19. package/es/components/iconfont/index.js +1 -1
  20. package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +1 -0
  21. package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +73 -5
  22. package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
  23. package/es/components/productCard/cartSkuCard/index.js +2 -11
  24. package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
  25. package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
  26. package/es/components/table/Table/fields/text/Show/index.d.ts +1 -0
  27. package/es/components/table/Table/fields/text/index.d.ts +1 -0
  28. package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
  29. package/es/components/table/Table/utils.d.ts +1 -1
  30. package/es/utils/index.d.ts +1 -1
  31. package/lib/components/batch-editor/index.d.ts +1 -0
  32. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  33. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  34. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
  35. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  36. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  37. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  38. package/lib/components/dataSourceComponents/fields/index.d.ts +7 -6
  39. package/lib/components/iconfont/index.js +1 -1
  40. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +1 -0
  41. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +45 -11
  42. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
  43. package/lib/components/productCard/cartSkuCard/index.js +2 -13
  44. package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
  45. package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
  46. package/lib/components/table/Table/fields/text/Show/index.d.ts +1 -0
  47. package/lib/components/table/Table/fields/text/index.d.ts +1 -0
  48. package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
  49. package/lib/components/table/Table/utils.d.ts +1 -1
  50. package/lib/utils/index.d.ts +1 -1
  51. package/package.json +1 -1
@@ -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;
50
+ height: 40px;
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;
61
+ height: 40px;
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:
@@ -1,5 +1,5 @@
1
1
  declare const useGapSize: (gap: number | number[]) => {
2
- horizontal: any;
3
- vertical: any;
2
+ horizontal: number;
3
+ vertical: number;
4
4
  };
5
5
  export default useGapSize;
@@ -2,4 +2,4 @@ export default function ({ value, key, item, }: {
2
2
  value: string | string[];
3
3
  key: string | string[];
4
4
  item: Record<string, any>;
5
- }): any;
5
+ }): boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FieldPropsType } from "../../types";
2
3
  import "./index.less";
3
4
  declare const Show: (props: FieldPropsType) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import filter from "./filterUtil";
2
3
  declare const _default: {
3
4
  field: {
@@ -2,4 +2,4 @@ export default function ({ value, key, item, }: {
2
2
  value: string | string[] | Record<string, any>[];
3
3
  key: string | string[];
4
4
  item: Record<string, any>;
5
- }): any;
5
+ }): boolean;
@@ -161,7 +161,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
161
161
  sort?: SortType | undefined;
162
162
  mode: "" | "localStorage" | "remote";
163
163
  currentViewMode: ModeType;
164
- }) => ("view_mode" | "filter_setting" | "group_by" | "order_by" | "column_setting" | "gallery_setting" | "filters")[];
164
+ }) => ("filters" | "order_by" | "group_by" | "column_setting" | "gallery_setting" | "filter_setting" | "view_mode")[];
165
165
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
166
166
  export declare const stringify: (obj: Record<string, any>) => string;
167
167
  export {};
@@ -1,4 +1,4 @@
1
1
  export declare const isBrowser: boolean;
2
- export declare const getCssNumber: (val: string | number) => string | number;
2
+ export declare const getCssNumber: (val: string | number) => string;
3
3
  export declare function uuid(): string;
4
4
  export * from './mergeWith';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.929",
3
+ "version": "1.0.930",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",