@pisell/private-materials 3.4.41 → 3.4.43
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/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +3 -3
- package/es/components/appointmentBooking/components/Services/index.js +22 -8
- package/es/components/authentication/admin/AuthMethods/AuthMethods.less +11 -9
- package/es/components/authentication/admin/AuthMethods/index.js +29 -6
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +1 -1
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +1 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/index.d.ts +3 -1
- package/es/plus/productSelect/ProductCard/index.js +14 -5
- package/es/plus/productSelect/index.d.ts +3 -2
- package/es/plus/productSelect/index.js +33 -8
- package/es/plus/productSelect/index.less +4 -0
- package/lib/components/appointmentBooking/components/Services/index.js +8 -3
- package/lib/components/authentication/admin/AuthMethods/AuthMethods.less +11 -9
- package/lib/components/authentication/admin/AuthMethods/index.js +23 -7
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/index.d.ts +3 -1
- package/lib/plus/productSelect/ProductCard/index.js +18 -4
- package/lib/plus/productSelect/index.d.ts +3 -2
- package/lib/plus/productSelect/index.js +20 -6
- package/lib/plus/productSelect/index.less +4 -0
- package/package.json +2 -2
|
@@ -70,7 +70,11 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
70
70
|
setProductLoading(false);
|
|
71
71
|
});
|
|
72
72
|
}, [isDateSelectedFirst]);
|
|
73
|
-
const
|
|
73
|
+
const isShowProductDetailStepper = (0, import_react.useMemo)(() => {
|
|
74
|
+
const { productModuleParams } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
|
|
75
|
+
return productModuleParams == null ? void 0 : productModuleParams.isShowProductDetailStepper;
|
|
76
|
+
}, [appointmentBooking == null ? void 0 : appointmentBooking.otherParams]);
|
|
77
|
+
const handleSelectProduct = async (item, clickType) => {
|
|
74
78
|
let type = "";
|
|
75
79
|
if (!isRetailTemplate) {
|
|
76
80
|
type = await checkProductType(item == null ? void 0 : item.id);
|
|
@@ -82,7 +86,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
82
86
|
type: "pisell1.productDetail",
|
|
83
87
|
data: {
|
|
84
88
|
detail: { ...item, open_deposit: 1 },
|
|
85
|
-
setting: { can_input: true }
|
|
89
|
+
setting: { can_input: true, item_max_length: isShowProductDetailStepper, is_detail_open: clickType === "cover" }
|
|
86
90
|
},
|
|
87
91
|
callback: async (data) => {
|
|
88
92
|
var _a, _b;
|
|
@@ -205,7 +209,8 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
205
209
|
cardSelectedBg: "var(--theme-color)"
|
|
206
210
|
},
|
|
207
211
|
productListSetting,
|
|
208
|
-
selectedItems: carts
|
|
212
|
+
selectedItems: carts,
|
|
213
|
+
hideCategoryWhenOne: true
|
|
209
214
|
}
|
|
210
215
|
));
|
|
211
216
|
});
|
|
@@ -6,13 +6,17 @@
|
|
|
6
6
|
.auth-methods-item {
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
9
|
-
padding: 20px 24px;
|
|
10
9
|
border: 1px solid #f0f0f0;
|
|
11
10
|
border-radius: 8px;
|
|
12
11
|
background: #fff;
|
|
13
12
|
margin-bottom: 12px;
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.auth-methods-item-body {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex: 1;
|
|
18
|
+
padding: 20px 24px 20px 0;
|
|
19
|
+
align-items: center;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
.auth-methods-item:hover {
|
|
@@ -23,14 +27,12 @@
|
|
|
23
27
|
display: flex;
|
|
24
28
|
align-items: center;
|
|
25
29
|
justify-content: center;
|
|
26
|
-
margin-right: 16px;
|
|
27
30
|
color: #d9d9d9;
|
|
28
|
-
font-size:
|
|
31
|
+
font-size: 20px;
|
|
32
|
+
padding-left: 24px;
|
|
33
|
+
padding-right: 16px;
|
|
29
34
|
cursor: grab;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.auth-methods-item-drag:active {
|
|
33
|
-
cursor: grabbing;
|
|
35
|
+
align-self: stretch;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
.auth-methods-item-icon {
|
|
@@ -37,6 +37,7 @@ __export(AuthMethods_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(AuthMethods_exports);
|
|
38
38
|
var import_react = __toESM(require("react"));
|
|
39
39
|
var import_antd = require("antd");
|
|
40
|
+
var import_materials = require("@pisell/materials");
|
|
40
41
|
var import_icons = require("@ant-design/icons");
|
|
41
42
|
var import_core = require("@dnd-kit/core");
|
|
42
43
|
var import_sortable = require("@dnd-kit/sortable");
|
|
@@ -87,8 +88,7 @@ var SortableItem = ({
|
|
|
87
88
|
})
|
|
88
89
|
},
|
|
89
90
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-drag", ...attributes, ...listeners }, /* @__PURE__ */ import_react.default.createElement(import_icons.HolderOutlined, null)),
|
|
90
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-icon" }, method.icon),
|
|
91
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-header" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "auth-methods-item-title" }, method.title), /* @__PURE__ */ import_react.default.createElement(
|
|
91
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-body" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-icon" }, method.icon), /* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-header" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "auth-methods-item-title" }, method.title), /* @__PURE__ */ import_react.default.createElement(
|
|
92
92
|
"span",
|
|
93
93
|
{
|
|
94
94
|
className: (0, import_classnames.default)(
|
|
@@ -97,8 +97,15 @@ var SortableItem = ({
|
|
|
97
97
|
)
|
|
98
98
|
},
|
|
99
99
|
getCategoryText(method.category)
|
|
100
|
-
)), /* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-description" }, method.description), method.configLink && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginTop: 8, fontSize: 12, color: "#8c8c8c", display: "flex", alignItems: "center", gap: 4 } }, /* @__PURE__ */ import_react.default.createElement(import_icons.InfoCircleOutlined, { style: { marginRight: 4 } }), import_utils.locales.getText(method.configLink), /* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-config-link", onClick: onConfigClick }, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("auth.oauth.config.link")))))),
|
|
101
|
-
|
|
100
|
+
)), /* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-description" }, method.description), method.configLink && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginTop: 8, fontSize: 12, color: "#8c8c8c", display: "flex", alignItems: "center", gap: 4 } }, /* @__PURE__ */ import_react.default.createElement(import_icons.InfoCircleOutlined, { style: { marginRight: 4 } }), import_utils.locales.getText(method.configLink), /* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-config-link", onClick: onConfigClick }, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("auth.oauth.config.link")))))), /* @__PURE__ */ import_react.default.createElement("div", { className: "auth-methods-item-actions" }, enableSetting && method.hasSettings && /* @__PURE__ */ import_react.default.createElement(
|
|
101
|
+
import_materials.Button,
|
|
102
|
+
{
|
|
103
|
+
type: "default",
|
|
104
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icons.SettingOutlined, null),
|
|
105
|
+
onClick: () => onSettings()
|
|
106
|
+
},
|
|
107
|
+
import_utils.locales.getText("auth.button.settings")
|
|
108
|
+
), /* @__PURE__ */ import_react.default.createElement(import_antd.Switch, { checked: method.enabled, onChange: onToggle, disabled: method.disableToggle })))
|
|
102
109
|
);
|
|
103
110
|
};
|
|
104
111
|
var AuthMethods = ({
|
|
@@ -118,7 +125,12 @@ var AuthMethods = ({
|
|
|
118
125
|
(0, import_react.useEffect)(() => {
|
|
119
126
|
if (initialMethods && initialMethods.length > 0) {
|
|
120
127
|
console.log("AuthMethods 组件同步父组件数据:", initialMethods);
|
|
121
|
-
|
|
128
|
+
const sortedMethods = [...initialMethods].sort((a, b) => {
|
|
129
|
+
const sortA = a.sort ?? 0;
|
|
130
|
+
const sortB = b.sort ?? 0;
|
|
131
|
+
return sortA - sortB;
|
|
132
|
+
});
|
|
133
|
+
setMethods(sortedMethods);
|
|
122
134
|
}
|
|
123
135
|
}, [initialMethods]);
|
|
124
136
|
const sensors = (0, import_core.useSensors)(
|
|
@@ -138,8 +150,12 @@ var AuthMethods = ({
|
|
|
138
150
|
const oldIndex = items.findIndex((item) => item.id === active.id);
|
|
139
151
|
const newIndex = items.findIndex((item) => item.id === over.id);
|
|
140
152
|
const newItems = (0, import_sortable.arrayMove)(items, oldIndex, newIndex);
|
|
141
|
-
|
|
142
|
-
|
|
153
|
+
const updatedItems = newItems.map((item, index) => ({
|
|
154
|
+
...item,
|
|
155
|
+
sort: index
|
|
156
|
+
}));
|
|
157
|
+
onOrderChange == null ? void 0 : onOrderChange(updatedItems);
|
|
158
|
+
return updatedItems;
|
|
143
159
|
});
|
|
144
160
|
}
|
|
145
161
|
};
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"stripe" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "payo" | "linkly">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
298
|
mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "stripe" | "
|
|
300
|
+
eftpos?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | undefined;
|
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
@@ -94,7 +94,7 @@ var ApplePay = (props, ref) => {
|
|
|
94
94
|
linkElement.href = currentURL;
|
|
95
95
|
const shop_domain = linkElement.hostname;
|
|
96
96
|
const _href = `${config.pay}${(0, import_utils2.formatFranchiseeRoute)(
|
|
97
|
-
`/apple-pay?order_id=${(_g = state.payGroup) == null ? void 0 : _g.order_id}&shop_id=${shopId}&locale=${locale}&shop_domain=${shop_domain}&total_amount=${values.amount}&payment_group_id=${values.payment_group_id}&front_order_uuid=${state.front_order_uuid}`,
|
|
97
|
+
`/apple-pay?order_id=${(_g = state.payGroup) == null ? void 0 : _g.order_id}&shop_id=${shopId}&locale=${locale}&shop_domain=${shop_domain}&total_amount=${values.amount}&payment_group_id=${values.payment_group_id}&front_order_uuid=${state.front_order_uuid}&is_replace_router=1`,
|
|
98
98
|
state.history
|
|
99
99
|
)}`;
|
|
100
100
|
paymentLogger.addLog({
|
|
@@ -107,7 +107,7 @@ var GooglePay = (props, ref) => {
|
|
|
107
107
|
linkElement.href = currentURL;
|
|
108
108
|
const shop_domain = linkElement.hostname;
|
|
109
109
|
const _href = `${config.pay}${(0, import_utils2.formatFranchiseeRoute)(
|
|
110
|
-
`/google-pay?order_id=${(_k = state.payGroup) == null ? void 0 : _k.order_id}&shop_id=${shopId}&locale=${locale}&shop_domain=${shop_domain}&total_amount=${values.amount}&payment_group_id=${values.payment_group_id}&front_order_uuid=${state.front_order_uuid}`,
|
|
110
|
+
`/google-pay?order_id=${(_k = state.payGroup) == null ? void 0 : _k.order_id}&shop_id=${shopId}&locale=${locale}&shop_domain=${shop_domain}&total_amount=${values.amount}&payment_group_id=${values.payment_group_id}&front_order_uuid=${state.front_order_uuid}&is_replace_router=1`,
|
|
111
111
|
state.history
|
|
112
112
|
)}`;
|
|
113
113
|
paymentLogger.addLog({
|
|
@@ -29,10 +29,12 @@ export interface ProductCardProps {
|
|
|
29
29
|
onSelectProduct?: (item: any) => void;
|
|
30
30
|
currentProductId?: number;
|
|
31
31
|
onSelect?: (item: any) => void;
|
|
32
|
+
onSelectCover?: (item: any) => void;
|
|
33
|
+
onSelectInfo?: (item: any) => void;
|
|
32
34
|
isSelected?: boolean;
|
|
33
35
|
decorateConfig?: ProductCardConfig;
|
|
34
36
|
}
|
|
35
|
-
export declare const ProductCard: React.MemoExoticComponent<({ item, index, context, onSelect, isSelected, className, decorateConfig, }: ProductCardProps) => JSX.Element>;
|
|
37
|
+
export declare const ProductCard: React.MemoExoticComponent<({ item, index, context, onSelect, onSelectCover, onSelectInfo, isSelected, className, decorateConfig, }: ProductCardProps) => JSX.Element>;
|
|
36
38
|
export declare const DefaultItemContent: React.MemoExoticComponent<(props: {
|
|
37
39
|
item: any;
|
|
38
40
|
index: number;
|
|
@@ -66,6 +66,8 @@ var ProductCard = (0, import_react.memo)(
|
|
|
66
66
|
index,
|
|
67
67
|
context,
|
|
68
68
|
onSelect,
|
|
69
|
+
onSelectCover,
|
|
70
|
+
onSelectInfo,
|
|
69
71
|
isSelected,
|
|
70
72
|
className,
|
|
71
73
|
decorateConfig = {}
|
|
@@ -129,9 +131,6 @@ var ProductCard = (0, import_react.memo)(
|
|
|
129
131
|
className: (0, import_classnames.default)(`${import__.PREFIX}__product-card`, className, {
|
|
130
132
|
selected: isSelected
|
|
131
133
|
}),
|
|
132
|
-
onClick: () => {
|
|
133
|
-
onSelect == null ? void 0 : onSelect(item);
|
|
134
|
-
},
|
|
135
134
|
"data-index": index,
|
|
136
135
|
"data-item-index": index
|
|
137
136
|
},
|
|
@@ -142,6 +141,9 @@ var ProductCard = (0, import_react.memo)(
|
|
|
142
141
|
style: {
|
|
143
142
|
width: imgWidth || "auto",
|
|
144
143
|
height: imgHeight || "auto"
|
|
144
|
+
},
|
|
145
|
+
onClick: () => {
|
|
146
|
+
onSelectCover == null ? void 0 : onSelectCover(item);
|
|
145
147
|
}
|
|
146
148
|
},
|
|
147
149
|
item.cover ? /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -154,7 +156,19 @@ var ProductCard = (0, import_react.memo)(
|
|
|
154
156
|
}
|
|
155
157
|
) : /* @__PURE__ */ import_react.default.createElement("div", { className: "text-cover", style: { borderRadius: radius } }, getTextCover(item.title))
|
|
156
158
|
) : null,
|
|
157
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
159
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
className: "card-right",
|
|
163
|
+
onClick: () => {
|
|
164
|
+
onSelectInfo == null ? void 0 : onSelectInfo(item);
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
!!isTitle ? /* @__PURE__ */ import_react.default.createElement("div", { className: "title" }, item.title) : null,
|
|
168
|
+
!!isSubtitle && item.subtitle ? /* @__PURE__ */ import_react.default.createElement("div", { className: "subtitle" }, item.subtitle) : null,
|
|
169
|
+
!!isStock && !!item.is_track ? /* @__PURE__ */ import_react.default.createElement("div", { className: "stock" }, getStockText(item)) : null,
|
|
170
|
+
renderPrice(item)
|
|
171
|
+
)
|
|
158
172
|
);
|
|
159
173
|
if (context) {
|
|
160
174
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -8,7 +8,7 @@ interface ProductSelectProps {
|
|
|
8
8
|
grid: boolean;
|
|
9
9
|
config: string;
|
|
10
10
|
};
|
|
11
|
-
onChange: (value: any) => void;
|
|
11
|
+
onChange: (value: any, type?: string) => void;
|
|
12
12
|
value?: number;
|
|
13
13
|
loading?: boolean;
|
|
14
14
|
style?: React.CSSProperties;
|
|
@@ -25,7 +25,8 @@ interface ProductSelectProps {
|
|
|
25
25
|
productListSetting?: Partial<any>;
|
|
26
26
|
/** 兼容scrollDom */
|
|
27
27
|
customScrollParent?: HTMLElement | string;
|
|
28
|
+
hideCategoryWhenOne?: boolean;
|
|
28
29
|
}
|
|
29
30
|
export declare const PREFIX = "pisell-product-select";
|
|
30
|
-
declare const index: ({ dataSource, emptyDescription, showSearch, scrollDom, offsetDom, style, token: customToken, onChange, value, selectedItems, productListSetting, customScrollParent, loading, layout, ...rest }: ProductSelectProps) => JSX.Element;
|
|
31
|
+
declare const index: ({ dataSource, emptyDescription, showSearch, scrollDom, offsetDom, style, token: customToken, onChange, value, selectedItems, productListSetting, customScrollParent, loading, layout, hideCategoryWhenOne, ...rest }: ProductSelectProps) => JSX.Element;
|
|
31
32
|
export default index;
|
|
@@ -79,6 +79,7 @@ var index = ({
|
|
|
79
79
|
customScrollParent,
|
|
80
80
|
loading = false,
|
|
81
81
|
layout,
|
|
82
|
+
hideCategoryWhenOne = false,
|
|
82
83
|
...rest
|
|
83
84
|
}) => {
|
|
84
85
|
const searchRef = (0, import_react.useRef)(null);
|
|
@@ -119,6 +120,12 @@ var index = ({
|
|
|
119
120
|
};
|
|
120
121
|
});
|
|
121
122
|
}, [_groupedList]);
|
|
123
|
+
const isHideCategory = (0, import_react.useMemo)(() => {
|
|
124
|
+
if (hideCategoryWhenOne) {
|
|
125
|
+
return (_categories == null ? void 0 : _categories.length) === 1 || !(_categories == null ? void 0 : _categories.length);
|
|
126
|
+
}
|
|
127
|
+
return false;
|
|
128
|
+
}, [_categories, hideCategoryWhenOne]);
|
|
122
129
|
(0, import_react.useEffect)(() => {
|
|
123
130
|
if (!(_categories == null ? void 0 : _categories.length)) {
|
|
124
131
|
setActiveKey("");
|
|
@@ -158,9 +165,9 @@ var index = ({
|
|
|
158
165
|
return !!(productListSetting == null ? void 0 : productListSetting.list_max_length) && Array.isArray(selectedItems) && (selectedItems == null ? void 0 : selectedItems.length) > 0;
|
|
159
166
|
}, [productListSetting, selectedItems]);
|
|
160
167
|
const _onChange = (0, import_react.useCallback)(
|
|
161
|
-
(value2) => {
|
|
168
|
+
(value2, type) => {
|
|
162
169
|
if (disabled) return;
|
|
163
|
-
onChange == null ? void 0 : onChange(value2);
|
|
170
|
+
onChange == null ? void 0 : onChange(value2, type);
|
|
164
171
|
},
|
|
165
172
|
[disabled, onChange]
|
|
166
173
|
);
|
|
@@ -237,7 +244,7 @@ var index = ({
|
|
|
237
244
|
}
|
|
238
245
|
}
|
|
239
246
|
)) : null,
|
|
240
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
247
|
+
!isHideCategory ? /* @__PURE__ */ import_react.default.createElement(
|
|
241
248
|
import_CategoryTabs.default,
|
|
242
249
|
{
|
|
243
250
|
activeKey,
|
|
@@ -246,7 +253,7 @@ var index = ({
|
|
|
246
253
|
loading,
|
|
247
254
|
skeleton: /* @__PURE__ */ import_react.default.createElement(import_CategoryTabs.CategorySkeleton, null)
|
|
248
255
|
}
|
|
249
|
-
),
|
|
256
|
+
) : null,
|
|
250
257
|
!loading && !(_groupedList == null ? void 0 : _groupedList.length) ? /* @__PURE__ */ import_react.default.createElement(
|
|
251
258
|
import_materials2.PisellEmpty,
|
|
252
259
|
{
|
|
@@ -261,7 +268,9 @@ var index = ({
|
|
|
261
268
|
/* @__PURE__ */ import_react.default.createElement(
|
|
262
269
|
import_ProductList.default,
|
|
263
270
|
{
|
|
264
|
-
className: `${PREFIX}__product-list`,
|
|
271
|
+
className: (0, import_classnames.default)(`${PREFIX}__product-list`, {
|
|
272
|
+
[`${PREFIX}__product-list_hide_category`]: isHideCategory
|
|
273
|
+
}),
|
|
265
274
|
loading,
|
|
266
275
|
data: loading ? MOCK_DATA : _groupedList,
|
|
267
276
|
context: {
|
|
@@ -281,7 +290,12 @@ var index = ({
|
|
|
281
290
|
index: index2,
|
|
282
291
|
item,
|
|
283
292
|
context: context2,
|
|
284
|
-
|
|
293
|
+
onSelectCover: (e) => {
|
|
294
|
+
_onChange(e, "cover");
|
|
295
|
+
},
|
|
296
|
+
onSelectInfo: (e) => {
|
|
297
|
+
_onChange(e, "info");
|
|
298
|
+
},
|
|
285
299
|
isSelected: item.id === value,
|
|
286
300
|
decorateConfig: productListSetting
|
|
287
301
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.43",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"react-infinite-scroll-component": "^6.1.0",
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
|
-
"@pisell/materials": "3.3.63",
|
|
63
62
|
"@pisell/utils": "3.0.1",
|
|
63
|
+
"@pisell/materials": "3.3.63",
|
|
64
64
|
"@pisell/icon": "0.0.11",
|
|
65
65
|
"@pisell/date-picker": "3.0.3"
|
|
66
66
|
},
|