@pisell/materials 6.2.38 → 6.2.40
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +36 -21
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +35 -20
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +33 -15
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +92 -6
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +199 -19
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.js +66 -0
- package/es/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/es/components/filter/types.d.ts +2 -0
- package/es/components/pisellCamera/index.js +228 -0
- package/es/components/pisellCamera/index.less +131 -0
- package/es/components/pisellCardList/index.js +3 -1
- package/es/components/pisellCheckboxGroup/index.js +15 -1
- package/es/components/pisellWalletPassCard/index.d.ts +1 -0
- package/es/components/pisellWalletPassCard/index.js +6 -1
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +2 -1
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +74 -6
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
- package/es/components/productCard/cartSkuCard/index.js +2 -11
- package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/es/components/table/Table/fields/index.d.ts +2 -2
- package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/Table/utils.js +22 -1
- package/es/components/table/hooks/useTableSetting.d.ts +3 -4
- package/es/components/table/hooks/useTableSetting.js +113 -5
- package/es/components/table/index.js +14 -3
- package/es/components/table/types.d.ts +17 -0
- package/es/components/walletCard/Guide/index.js +12 -1
- package/es/components/walletCard/index.js +29 -3
- package/es/components/walletCard/index.less +27 -0
- package/es/locales/en-US.js +83 -69
- package/es/locales/zh-CN.js +84 -70
- package/es/locales/zh-TW.js +84 -70
- package/es/utils/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +8 -2
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +20 -7
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +78 -7
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +168 -5
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.js +95 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
- package/lib/components/filter/types.d.ts +2 -0
- package/lib/components/pisellCamera/index.js +222 -0
- package/lib/components/pisellCamera/index.less +131 -0
- package/lib/components/pisellCardList/index.js +3 -1
- package/lib/components/pisellCheckboxGroup/index.js +16 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +1 -0
- package/lib/components/pisellWalletPassCard/index.js +9 -1
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +2 -1
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +45 -11
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
- package/lib/components/productCard/cartSkuCard/index.js +2 -13
- package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/lib/components/table/Table/fields/index.d.ts +2 -2
- package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/Table/utils.js +18 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +3 -4
- package/lib/components/table/hooks/useTableSetting.js +114 -4
- package/lib/components/table/index.js +12 -1
- package/lib/components/table/types.d.ts +17 -0
- package/lib/components/walletCard/Guide/index.js +11 -1
- package/lib/components/walletCard/index.js +27 -3
- package/lib/components/walletCard/index.less +27 -0
- package/lib/locales/en-US.js +15 -1
- package/lib/locales/zh-CN.js +15 -1
- package/lib/locales/zh-TW.js +15 -1
- package/lib/utils/index.d.ts +1 -1
- package/lowcode/data-source-table/meta.ts +358 -66
- package/lowcode/form-item-upload/meta.ts +20 -5
- package/lowcode/pisell-upload/meta.ts +8 -0
- package/lowcode/pisell-wallet-pass-card/meta.ts +19 -0
- package/lowcode/table/meta.ts +104 -0
- package/lowcode/wallet-card/meta.ts +81 -63
- package/package.json +2 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -98
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/es/components/pisell-config-provider/context.d.ts +0 -20
- package/es/components/pisell-config-provider/index.d.ts +0 -12
- package/es/components/pisellAdjustPrice/index.d.ts +0 -4
- package/es/components/pisellAdjustPrice/type.d.ts +0 -20
- package/es/components/pisellCheckboxGroup/index.d.ts +0 -36
- package/es/components/pisellQRScanner/index.d.ts +0 -37
- package/es/components/pisellText/components/Amount/index.d.ts +0 -20
- package/es/components/table/Table/AddFieldModal/index.d.ts +0 -3
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -11
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -21
- package/es/components/virtual-keyboard/Number/index.d.ts +0 -5
- package/es/components/virtual-keyboard/Number/types.d.ts +0 -25
- package/es/components/walletCard/index.d.ts +0 -67
- package/es/locales/en-US.d.ts +0 -278
- package/es/locales/zh-CN.d.ts +0 -273
- package/es/locales/zh-TW.d.ts +0 -273
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -98
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/lib/components/pisell-config-provider/context.d.ts +0 -20
- package/lib/components/pisell-config-provider/index.d.ts +0 -12
- package/lib/components/pisellAdjustPrice/index.d.ts +0 -4
- package/lib/components/pisellAdjustPrice/type.d.ts +0 -20
- package/lib/components/pisellCheckboxGroup/index.d.ts +0 -36
- package/lib/components/pisellQRScanner/index.d.ts +0 -37
- package/lib/components/pisellText/components/Amount/index.d.ts +0 -20
- package/lib/components/table/Table/AddFieldModal/index.d.ts +0 -3
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -11
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -21
- package/lib/components/virtual-keyboard/Number/index.d.ts +0 -5
- package/lib/components/virtual-keyboard/Number/types.d.ts +0 -25
- package/lib/components/walletCard/index.d.ts +0 -67
- package/lib/locales/en-US.d.ts +0 -278
- package/lib/locales/zh-CN.d.ts +0 -273
- package/lib/locales/zh-TW.d.ts +0 -273
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
.pisell-camera-modal {
|
|
2
|
+
.pisell-camera-container {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 90vh;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
|
|
10
|
+
.pisell-camera-action {
|
|
11
|
+
position: absolute;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
height: 100px;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
|
|
20
|
+
.pisell-camera-action-item-wrap {
|
|
21
|
+
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
padding: 6px;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
border: 2px solid #fff;
|
|
26
|
+
|
|
27
|
+
.pisell-camera-action-item {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
width: 60px;
|
|
32
|
+
height: 60px;
|
|
33
|
+
background-color: #fff;
|
|
34
|
+
border-radius: 50%;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pisell-camera-photo-container {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
bottom: 0;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
|
|
49
|
+
.pisell-camera-photo {
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
object-fit: cover;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.pisell-camera-photo-img-action {
|
|
57
|
+
position: absolute;
|
|
58
|
+
bottom: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
right: 0;
|
|
61
|
+
height: 100px;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: row;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
67
|
+
|
|
68
|
+
.pisell-camera-photo-img-action-item {
|
|
69
|
+
padding: 20px 60px;
|
|
70
|
+
font-size: 20px;
|
|
71
|
+
color: #fff;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.pisell-camera-loading {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 0;
|
|
79
|
+
left: 0;
|
|
80
|
+
right: 0;
|
|
81
|
+
bottom: 0;
|
|
82
|
+
background-color: transparent;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
|
|
87
|
+
.pisell-camera-loading-text {
|
|
88
|
+
font-size: 18px;
|
|
89
|
+
color: #666;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pisell-camera-no-camera {
|
|
94
|
+
position: absolute;
|
|
95
|
+
top: 0;
|
|
96
|
+
left: 0;
|
|
97
|
+
right: 0;
|
|
98
|
+
bottom: 0;
|
|
99
|
+
background-color: #ffffff;
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
background-color: #f5f5f5;
|
|
107
|
+
padding: 40px;
|
|
108
|
+
text-align: center;
|
|
109
|
+
|
|
110
|
+
.pisell-camera-no-camera-icon {
|
|
111
|
+
font-size: 64px;
|
|
112
|
+
margin-bottom: 20px;
|
|
113
|
+
opacity: 0.6;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.pisell-camera-no-camera-text {
|
|
117
|
+
font-size: 20px;
|
|
118
|
+
color: #333;
|
|
119
|
+
margin-bottom: 12px;
|
|
120
|
+
font-weight: 500;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.pisell-camera-no-camera-desc {
|
|
124
|
+
font-size: 14px;
|
|
125
|
+
color: #666;
|
|
126
|
+
line-height: 1.5;
|
|
127
|
+
max-width: 300px;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -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,
|
|
@@ -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(
|
|
@@ -293,6 +293,7 @@ var PisellWalletPassCard = (props) => {
|
|
|
293
293
|
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-name-wrap" }, showName && name), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-store-name" }, showStoreName && storeName));
|
|
294
294
|
};
|
|
295
295
|
const renderBalanceInfo = () => {
|
|
296
|
+
var _a;
|
|
296
297
|
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-wrap" }, showRedeem && !disabled && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item pisell-wallet-pass-card-redeem" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-label" }, redeemTitle || (0, import_locales.getText)("pisell-wallet-pass-card-redeem"), isMini ? ": " : ""), /* @__PURE__ */ import_react.default.createElement(
|
|
297
298
|
import_Amount.default,
|
|
298
299
|
{
|
|
@@ -308,7 +309,14 @@ var PisellWalletPassCard = (props) => {
|
|
|
308
309
|
value: balance,
|
|
309
310
|
showCurrencySymbol: showBalanceSymbol
|
|
310
311
|
}
|
|
311
|
-
)), showDiscount && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-label" }, (0, import_locales.getText)("pisell-discount-card-title")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-value" },
|
|
312
|
+
)), showDiscount && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-label" }, (0, import_locales.getText)("pisell-discount-card-title")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-value" }, ((_a = props.metadata) == null ? void 0 : _a.discount_card_type) === "fixed_amount" ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, (0, import_locales.getText)("pisell-discount-card-fixed-amount-prefix"), " ", /* @__PURE__ */ import_react.default.createElement(
|
|
313
|
+
import_Amount.default,
|
|
314
|
+
{
|
|
315
|
+
className: "pisell-card-amount-item-value",
|
|
316
|
+
useThousandsSeparator: true,
|
|
317
|
+
value: discount
|
|
318
|
+
}
|
|
319
|
+
)) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, discount, "% ", (0, import_locales.getText)("pisell-discount-card-unit"))))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-code-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-code" }, showCode && !isMini && /* @__PURE__ */ import_react.default.createElement("div", null, code), showValidDate && /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_locales.getText)("pisell-wallet-pass-card-valid-to"), " ", !!validDate ? validDate : (0, import_locales.getText)("pisell-wallet-pass-card-expireDate")))));
|
|
312
320
|
};
|
|
313
321
|
const getInputItem = (name2) => {
|
|
314
322
|
if ("validDate" === name2) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import './index.less';
|
|
3
4
|
declare type NativeProps<S extends string = never> = {
|
|
4
5
|
className?: string;
|
|
5
6
|
style?: React.CSSProperties & Partial<Record<S, string>>;
|
|
6
7
|
};
|
|
7
8
|
declare type PropagationEvent = 'click';
|
|
8
|
-
import './index.less';
|
|
9
9
|
declare type SideType = 'left' | 'right';
|
|
10
10
|
export declare type SwipeActionRef = {
|
|
11
11
|
close: () => void;
|
|
@@ -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
|
-
|
|
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:
|
|
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(
|
|
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
|
-
)
|
|
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:
|
|
@@ -197,12 +197,12 @@ export declare const fieldList: ({
|
|
|
197
197
|
field_icon: string;
|
|
198
198
|
field_name: string;
|
|
199
199
|
field_type: string;
|
|
200
|
-
default_value:
|
|
200
|
+
default_value: string;
|
|
201
201
|
} | {
|
|
202
202
|
field_icon: string;
|
|
203
203
|
field_name: string;
|
|
204
204
|
field_type: string;
|
|
205
|
-
default_value:
|
|
205
|
+
default_value: boolean;
|
|
206
206
|
} | {
|
|
207
207
|
field_icon: string;
|
|
208
208
|
field_name: string;
|
|
@@ -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
|
-
}) => ("
|
|
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) =>
|
|
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;
|