@pisell/private-materials 3.4.16 → 3.4.18
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 +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/appointmentBooking/components/Content/index.js +1 -1
- package/es/components/appointmentBooking/components/Content/index.less +3 -3
- package/es/components/appointmentBooking/components/Services/index.js +2 -2
- package/es/components/appointmentBooking/index.js +8 -2
- package/es/components/booking/info2/service/addTimeModal/index.js +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eventBooking/index.js +8 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +3 -3
- package/es/hooks/useWindowSize.js +8 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -1
- package/es/plus/productSelect/CategoryTabs/CategorySkeleton.d.ts +10 -0
- package/es/plus/productSelect/CategoryTabs/CategorySkeleton.js +29 -0
- package/es/plus/productSelect/CategoryTabs/CategorySkeleton.less +30 -0
- package/es/plus/productSelect/CategoryTabs/index.d.ts +18 -0
- package/es/plus/productSelect/CategoryTabs/index.js +171 -0
- package/es/plus/productSelect/ProductCard/ProductCardSkeleton.d.ts +10 -0
- package/es/plus/productSelect/ProductCard/ProductCardSkeleton.js +37 -0
- package/es/plus/productSelect/ProductCard/ProductCardSkeleton.less +81 -0
- package/es/plus/productSelect/ProductCard/index.d.ts +45 -0
- package/es/plus/productSelect/ProductCard/index.js +170 -0
- package/es/plus/productSelect/ProductCard/index.less +253 -0
- package/es/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
- package/es/plus/productSelect/ProductList/gridComponents.js +149 -0
- package/es/plus/productSelect/ProductList/index.d.ts +22 -0
- package/es/plus/productSelect/ProductList/index.js +72 -0
- package/es/plus/productSelect/ProductList/index.less +0 -0
- package/es/plus/productSelect/components/IntersectionObserver.d.ts +42 -0
- package/es/plus/productSelect/components/IntersectionObserver.js +276 -0
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +30 -0
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.js +357 -0
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.less +224 -0
- package/es/plus/productSelect/components/TabsStructure/hooks.d.ts +22 -0
- package/es/plus/productSelect/components/TabsStructure/hooks.js +243 -0
- package/es/plus/productSelect/components/TabsStructure/index.d.ts +5 -0
- package/es/plus/productSelect/components/TabsStructure/index.js +13 -0
- package/es/plus/productSelect/components/TabsStructure/styles.d.ts +47 -0
- package/es/plus/productSelect/components/TabsStructure/styles.js +87 -0
- package/es/plus/productSelect/components/TabsStructure/types.d.ts +105 -0
- package/es/plus/productSelect/components/TabsStructure/types.js +1 -0
- package/es/plus/productSelect/components/TabsStructure/utils.d.ts +12 -0
- package/es/plus/productSelect/components/TabsStructure/utils.js +56 -0
- package/es/plus/productSelect/components/pisellPriceText/index.d.ts +12 -0
- package/es/plus/productSelect/components/pisellPriceText/index.js +44 -0
- package/es/plus/productSelect/components/pisellPriceText/index.less +4 -0
- package/es/plus/productSelect/hooks/useToken.d.ts +18 -0
- package/es/plus/productSelect/hooks/useToken.js +34 -0
- package/es/plus/productSelect/index.d.ts +31 -0
- package/es/plus/productSelect/index.js +270 -0
- package/es/plus/productSelect/index.less +56 -0
- package/es/plus/productSelect/locales.d.ts +18 -0
- package/es/plus/productSelect/locales.js +17 -0
- package/es/plus/productSelect/theme/token.d.ts +17 -0
- package/es/plus/productSelect/theme/token.js +19 -0
- package/es/plus/productSelect/utils.d.ts +39 -0
- package/es/plus/productSelect/utils.js +162 -0
- package/es/plus/saasCreateOrganization/components/Header.d.ts +3 -0
- package/es/plus/saasCreateOrganization/components/Header.js +62 -0
- package/es/plus/saasCreateOrganization/index.d.ts +4 -0
- package/es/plus/saasCreateOrganization/index.js +15 -0
- package/es/plus/saasCreateOrganization/index.less +55 -0
- package/es/plus/saasCreateOrganization/locales.d.ts +15 -0
- package/es/plus/saasCreateOrganization/locales.js +14 -0
- package/es/plus/saasCreateOrganization/types.d.ts +69 -0
- package/es/plus/saasCreateOrganization/types.js +1 -0
- package/es/plus/saasLogin/index.d.ts +5 -0
- package/es/plus/saasLogin/index.js +165 -0
- package/es/plus/saasLogin/index.less +136 -0
- package/es/plus/saasLogin/locales.d.ts +51 -0
- package/es/plus/saasLogin/locales.js +50 -0
- package/es/plus/saasLogin/types.d.ts +62 -0
- package/es/plus/saasLogin/types.js +1 -0
- package/es/plus/saasLogin/utils.d.ts +35 -0
- package/es/plus/saasLogin/utils.js +31 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +9 -0
- package/es/plus/saasRegister/components/EntryEmail.js +92 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +9 -0
- package/es/plus/saasRegister/components/EntryInfo.js +145 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +4 -0
- package/es/plus/saasRegister/components/GoLogin.js +27 -0
- package/es/plus/saasRegister/components/Header.d.ts +3 -0
- package/es/plus/saasRegister/components/Header.js +62 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +8 -0
- package/es/plus/saasRegister/components/VerifyError.js +68 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +5 -0
- package/es/plus/saasRegister/components/VerifyingLink.js +16 -0
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +7 -0
- package/es/plus/saasRegister/components/VertifyEmail.js +121 -0
- package/es/plus/saasRegister/index.d.ts +5 -0
- package/es/plus/saasRegister/index.js +246 -0
- package/es/plus/saasRegister/index.less +218 -0
- package/es/plus/saasRegister/locales.d.ts +117 -0
- package/es/plus/saasRegister/locales.js +116 -0
- package/es/plus/saasRegister/types.d.ts +114 -0
- package/es/plus/saasRegister/types.js +24 -0
- package/lib/components/appointmentBooking/components/Content/index.js +1 -1
- package/lib/components/appointmentBooking/components/Content/index.less +3 -3
- package/lib/components/appointmentBooking/components/Services/index.js +2 -2
- package/lib/components/appointmentBooking/index.js +6 -1
- package/lib/components/booking/info2/service/addTimeModal/index.js +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eventBooking/index.js +6 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +3 -3
- package/lib/hooks/useWindowSize.js +6 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +9 -0
- package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.d.ts +10 -0
- package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.js +62 -0
- package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.less +30 -0
- package/lib/plus/productSelect/CategoryTabs/index.d.ts +18 -0
- package/lib/plus/productSelect/CategoryTabs/index.js +183 -0
- package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.d.ts +10 -0
- package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.js +58 -0
- package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.less +81 -0
- package/lib/plus/productSelect/ProductCard/index.d.ts +45 -0
- package/lib/plus/productSelect/ProductCard/index.js +184 -0
- package/lib/plus/productSelect/ProductCard/index.less +253 -0
- package/lib/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
- package/lib/plus/productSelect/ProductList/gridComponents.js +148 -0
- package/lib/plus/productSelect/ProductList/index.d.ts +22 -0
- package/lib/plus/productSelect/ProductList/index.js +86 -0
- package/lib/plus/productSelect/ProductList/index.less +0 -0
- package/lib/plus/productSelect/components/IntersectionObserver.d.ts +42 -0
- package/lib/plus/productSelect/components/IntersectionObserver.js +269 -0
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +30 -0
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.js +393 -0
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.less +224 -0
- package/lib/plus/productSelect/components/TabsStructure/hooks.d.ts +22 -0
- package/lib/plus/productSelect/components/TabsStructure/hooks.js +209 -0
- package/lib/plus/productSelect/components/TabsStructure/index.d.ts +5 -0
- package/lib/plus/productSelect/components/TabsStructure/index.js +92 -0
- package/lib/plus/productSelect/components/TabsStructure/styles.d.ts +47 -0
- package/lib/plus/productSelect/components/TabsStructure/styles.js +122 -0
- package/lib/plus/productSelect/components/TabsStructure/types.d.ts +105 -0
- package/lib/plus/productSelect/components/TabsStructure/types.js +17 -0
- package/lib/plus/productSelect/components/TabsStructure/utils.d.ts +12 -0
- package/lib/plus/productSelect/components/TabsStructure/utils.js +72 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.d.ts +12 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.js +73 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.less +4 -0
- package/lib/plus/productSelect/hooks/useToken.d.ts +18 -0
- package/lib/plus/productSelect/hooks/useToken.js +50 -0
- package/lib/plus/productSelect/index.d.ts +31 -0
- package/lib/plus/productSelect/index.js +299 -0
- package/lib/plus/productSelect/index.less +56 -0
- package/lib/plus/productSelect/locales.d.ts +18 -0
- package/lib/plus/productSelect/locales.js +41 -0
- package/lib/plus/productSelect/theme/token.d.ts +17 -0
- package/lib/plus/productSelect/theme/token.js +47 -0
- package/lib/plus/productSelect/utils.d.ts +39 -0
- package/lib/plus/productSelect/utils.js +138 -0
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +3 -0
- package/lib/plus/saasCreateOrganization/components/Header.js +99 -0
- package/lib/plus/saasCreateOrganization/index.d.ts +4 -0
- package/lib/plus/saasCreateOrganization/index.js +47 -0
- package/lib/plus/saasCreateOrganization/index.less +55 -0
- package/lib/plus/saasCreateOrganization/locales.d.ts +15 -0
- package/lib/plus/saasCreateOrganization/locales.js +38 -0
- package/lib/plus/saasCreateOrganization/types.d.ts +69 -0
- package/lib/plus/saasCreateOrganization/types.js +17 -0
- package/lib/plus/saasLogin/index.d.ts +5 -0
- package/lib/plus/saasLogin/index.js +171 -0
- package/lib/plus/saasLogin/index.less +136 -0
- package/lib/plus/saasLogin/locales.d.ts +51 -0
- package/lib/plus/saasLogin/locales.js +74 -0
- package/lib/plus/saasLogin/types.d.ts +62 -0
- package/lib/plus/saasLogin/types.js +17 -0
- package/lib/plus/saasLogin/utils.d.ts +35 -0
- package/lib/plus/saasLogin/utils.js +50 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +9 -0
- package/lib/plus/saasRegister/components/EntryEmail.js +92 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +9 -0
- package/lib/plus/saasRegister/components/EntryInfo.js +128 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +4 -0
- package/lib/plus/saasRegister/components/GoLogin.js +58 -0
- package/lib/plus/saasRegister/components/Header.d.ts +3 -0
- package/lib/plus/saasRegister/components/Header.js +99 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +8 -0
- package/lib/plus/saasRegister/components/VerifyError.js +123 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +5 -0
- package/lib/plus/saasRegister/components/VerifyingLink.js +44 -0
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +7 -0
- package/lib/plus/saasRegister/components/VertifyEmail.js +110 -0
- package/lib/plus/saasRegister/index.d.ts +5 -0
- package/lib/plus/saasRegister/index.js +205 -0
- package/lib/plus/saasRegister/index.less +218 -0
- package/lib/plus/saasRegister/locales.d.ts +117 -0
- package/lib/plus/saasRegister/locales.js +140 -0
- package/lib/plus/saasRegister/types.d.ts +114 -0
- package/lib/plus/saasRegister/types.js +54 -0
- package/lowcode/saas-create-organization/meta.ts +214 -0
- package/lowcode/saas-create-organization/snippets.ts +25 -0
- package/lowcode/saas-login/meta.ts +370 -0
- package/lowcode/saas-login/snippets.ts +38 -0
- package/lowcode/saas-register/meta.ts +386 -0
- package/lowcode/saas-register/snippets.ts +31 -0
- package/package.json +2 -2
|
@@ -0,0 +1,183 @@
|
|
|
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/plus/productSelect/CategoryTabs/index.tsx
|
|
30
|
+
var CategoryTabs_exports = {};
|
|
31
|
+
__export(CategoryTabs_exports, {
|
|
32
|
+
CategorySkeleton: () => import_CategorySkeleton.default,
|
|
33
|
+
default: () => CategoryTabs_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(CategoryTabs_exports);
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_IntersectionObserver = __toESM(require("../components/IntersectionObserver"));
|
|
38
|
+
var import_TabsStructure = require("../components/TabsStructure");
|
|
39
|
+
var import_TabsStructure2 = require("../components/TabsStructure/TabsStructure.less");
|
|
40
|
+
var import_CategorySkeleton = __toESM(require("./CategorySkeleton"));
|
|
41
|
+
var import__ = require("../index");
|
|
42
|
+
var CategoryTabs = (0, import_react.forwardRef)((props, ref) => {
|
|
43
|
+
const { items, activeKey, onChange, loading = false, skeleton } = props;
|
|
44
|
+
const railRef = (0, import_react.useRef)(null);
|
|
45
|
+
const [isAtStart, setIsAtStart] = (0, import_react.useState)(true);
|
|
46
|
+
const [isAtEnd, setIsAtEnd] = (0, import_react.useState)(false);
|
|
47
|
+
const [needsScrollButtons, setNeedsScrollButtons] = (0, import_react.useState)(false);
|
|
48
|
+
const scrollLeft = (0, import_react.useCallback)(() => {
|
|
49
|
+
if (!railRef.current) return;
|
|
50
|
+
const container = railRef.current;
|
|
51
|
+
const scrollAmount = container.clientWidth * 0.8;
|
|
52
|
+
const newPosition = Math.max(0, container.scrollLeft - scrollAmount);
|
|
53
|
+
container.scrollTo({ left: newPosition, behavior: "smooth" });
|
|
54
|
+
}, []);
|
|
55
|
+
const scrollRight = (0, import_react.useCallback)(() => {
|
|
56
|
+
if (!railRef.current) return;
|
|
57
|
+
const container = railRef.current;
|
|
58
|
+
const scrollAmount = container.clientWidth * 0.8;
|
|
59
|
+
const maxScroll = container.scrollWidth - container.clientWidth;
|
|
60
|
+
const newPosition = Math.min(
|
|
61
|
+
maxScroll,
|
|
62
|
+
container.scrollLeft + scrollAmount
|
|
63
|
+
);
|
|
64
|
+
container.scrollTo({ left: newPosition, behavior: "smooth" });
|
|
65
|
+
}, []);
|
|
66
|
+
(0, import_react.useEffect)(() => {
|
|
67
|
+
const updateScrollButtonsVisibility = () => {
|
|
68
|
+
if (railRef.current) {
|
|
69
|
+
const { scrollWidth, clientWidth } = railRef.current;
|
|
70
|
+
console.log("检测滚动按钮需求:", {
|
|
71
|
+
scrollWidth,
|
|
72
|
+
clientWidth,
|
|
73
|
+
needsScroll: scrollWidth > clientWidth
|
|
74
|
+
});
|
|
75
|
+
setNeedsScrollButtons(scrollWidth > clientWidth);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
let resizeObserver = null;
|
|
79
|
+
const timer = setTimeout(() => {
|
|
80
|
+
const container = railRef.current;
|
|
81
|
+
if (!container) {
|
|
82
|
+
console.log("容器未找到,跳过滚动按钮检测");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
updateScrollButtonsVisibility();
|
|
86
|
+
resizeObserver = new ResizeObserver(updateScrollButtonsVisibility);
|
|
87
|
+
resizeObserver.observe(container);
|
|
88
|
+
}, 100);
|
|
89
|
+
return () => {
|
|
90
|
+
clearTimeout(timer);
|
|
91
|
+
if (resizeObserver) {
|
|
92
|
+
resizeObserver.disconnect();
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}, [items]);
|
|
96
|
+
const { selectionIndicatorProps, listContainerProps } = (0, import_TabsStructure.useSelectionIndicator)(
|
|
97
|
+
railRef,
|
|
98
|
+
activeKey || ""
|
|
99
|
+
);
|
|
100
|
+
if (loading && skeleton) {
|
|
101
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, skeleton);
|
|
102
|
+
}
|
|
103
|
+
return /* @__PURE__ */ import_react.default.createElement(import_IntersectionObserver.default, null, items.length > 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__tabs-wrapper` }, /* @__PURE__ */ import_react.default.createElement(
|
|
104
|
+
import_TabsStructure.TabsStructure,
|
|
105
|
+
{
|
|
106
|
+
variant: "pill",
|
|
107
|
+
backgroundVariant: "onPage",
|
|
108
|
+
selectedTab: activeKey
|
|
109
|
+
},
|
|
110
|
+
needsScrollButtons && /* @__PURE__ */ import_react.default.createElement(
|
|
111
|
+
import_TabsStructure.TabsStructure.ChevronButton,
|
|
112
|
+
{
|
|
113
|
+
direction: "prev",
|
|
114
|
+
disabled: isAtStart,
|
|
115
|
+
onClick: scrollLeft,
|
|
116
|
+
style: { marginRight: "8px" }
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.Rail, { ref: railRef }, /* @__PURE__ */ import_react.default.createElement(
|
|
120
|
+
import_IntersectionObserver.IntersectionTrigger,
|
|
121
|
+
{
|
|
122
|
+
onShow: () => {
|
|
123
|
+
console.log("is start");
|
|
124
|
+
setIsAtStart(true);
|
|
125
|
+
},
|
|
126
|
+
onHide: () => {
|
|
127
|
+
console.log("is start false");
|
|
128
|
+
setIsAtStart(false);
|
|
129
|
+
},
|
|
130
|
+
style: {
|
|
131
|
+
width: 1,
|
|
132
|
+
height: 1,
|
|
133
|
+
flexShrink: 0,
|
|
134
|
+
background: "rgba(0,0,0,0)"
|
|
135
|
+
},
|
|
136
|
+
className: "visibility-detector start-detector"
|
|
137
|
+
}
|
|
138
|
+
), /* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.SelectionIndicator, { ...selectionIndicatorProps }), /* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.ListContainer, { ...listContainerProps }, items.map((item) => /* @__PURE__ */ import_react.default.createElement(
|
|
139
|
+
import_TabsStructure.TabsStructure.Item,
|
|
140
|
+
{
|
|
141
|
+
key: item.key,
|
|
142
|
+
tabId: item.key,
|
|
143
|
+
"aria-selected": activeKey === item.key,
|
|
144
|
+
onClick: () => onChange(item.key),
|
|
145
|
+
className: "tab-item"
|
|
146
|
+
},
|
|
147
|
+
item.label
|
|
148
|
+
))), /* @__PURE__ */ import_react.default.createElement(
|
|
149
|
+
import_IntersectionObserver.IntersectionTrigger,
|
|
150
|
+
{
|
|
151
|
+
className: "visibility-detector end-detector",
|
|
152
|
+
onShow: () => {
|
|
153
|
+
console.log("is end");
|
|
154
|
+
setIsAtEnd(true);
|
|
155
|
+
},
|
|
156
|
+
onHide: () => {
|
|
157
|
+
console.log("is end false");
|
|
158
|
+
setIsAtEnd(false);
|
|
159
|
+
},
|
|
160
|
+
style: {
|
|
161
|
+
width: 1,
|
|
162
|
+
height: 1,
|
|
163
|
+
flexShrink: 0,
|
|
164
|
+
background: "rgba(0,0,0,0)"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
)),
|
|
168
|
+
needsScrollButtons && /* @__PURE__ */ import_react.default.createElement(
|
|
169
|
+
import_TabsStructure.TabsStructure.ChevronButton,
|
|
170
|
+
{
|
|
171
|
+
direction: "next",
|
|
172
|
+
disabled: isAtEnd,
|
|
173
|
+
onClick: scrollRight,
|
|
174
|
+
style: { marginLeft: "8px" }
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
)));
|
|
178
|
+
});
|
|
179
|
+
var CategoryTabs_default = CategoryTabs;
|
|
180
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
181
|
+
0 && (module.exports = {
|
|
182
|
+
CategorySkeleton
|
|
183
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ProductCardSkeletonProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
isProductCover?: boolean;
|
|
6
|
+
item?: any;
|
|
7
|
+
index?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const ProductCardSkeleton: React.FC<ProductCardSkeletonProps>;
|
|
10
|
+
export default ProductCardSkeleton;
|
|
@@ -0,0 +1,58 @@
|
|
|
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/plus/productSelect/ProductCard/ProductCardSkeleton.tsx
|
|
30
|
+
var ProductCardSkeleton_exports = {};
|
|
31
|
+
__export(ProductCardSkeleton_exports, {
|
|
32
|
+
default: () => ProductCardSkeleton_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ProductCardSkeleton_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import__ = require("../index");
|
|
39
|
+
var ProductCardSkeleton = ({
|
|
40
|
+
className,
|
|
41
|
+
style,
|
|
42
|
+
isProductCover = true,
|
|
43
|
+
item
|
|
44
|
+
}) => {
|
|
45
|
+
if ((item == null ? void 0 : item.__typename) === "category") {
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton.Input, { active: true, size: "small", block: false });
|
|
47
|
+
}
|
|
48
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: (0, import_classnames.default)(`${import__.PREFIX}__product-card`, className),
|
|
52
|
+
style
|
|
53
|
+
},
|
|
54
|
+
isProductCover && /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton.Image, { active: true, style: { width: 180, height: 126 } }),
|
|
55
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { active: true, paragraph: { rows: 2 } })
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
var ProductCardSkeleton_default = ProductCardSkeleton;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
.product-card-skeleton {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 12px;
|
|
4
|
+
padding: 8px;
|
|
5
|
+
border-radius: 12px;
|
|
6
|
+
background: #fff;
|
|
7
|
+
box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06);
|
|
8
|
+
|
|
9
|
+
&__cover {
|
|
10
|
+
width: 180px;
|
|
11
|
+
height: 126px;
|
|
12
|
+
border-radius: 6px;
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__content {
|
|
17
|
+
flex: 1;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 8px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&__title {
|
|
24
|
+
height: 20px;
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__specs {
|
|
29
|
+
display: flex;
|
|
30
|
+
gap: 6px;
|
|
31
|
+
flex-wrap: wrap;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&__spec-item {
|
|
35
|
+
height: 24px;
|
|
36
|
+
width: 60px;
|
|
37
|
+
border-radius: 12px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&__price {
|
|
41
|
+
height: 18px;
|
|
42
|
+
width: 60%;
|
|
43
|
+
border-radius: 4px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.skeleton-item {
|
|
48
|
+
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
49
|
+
background-size: 200% 100%;
|
|
50
|
+
display: block;
|
|
51
|
+
position: relative;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
|
|
54
|
+
&--animated {
|
|
55
|
+
animation: skeleton-loading 1.5s ease-in-out infinite;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@keyframes skeleton-loading {
|
|
60
|
+
0% {
|
|
61
|
+
background-position: 200% 0;
|
|
62
|
+
}
|
|
63
|
+
100% {
|
|
64
|
+
background-position: -200% 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 网格布局中的产品卡片骨架屏样式调整
|
|
69
|
+
.product-grid-wrapper {
|
|
70
|
+
.product-card-skeleton {
|
|
71
|
+
min-width: unset;
|
|
72
|
+
width: 100%;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 列表布局中的产品卡片骨架屏样式调整
|
|
77
|
+
.product-list-wrapper {
|
|
78
|
+
.product-card-skeleton {
|
|
79
|
+
width: 100%;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ProductCardSkeleton from './ProductCardSkeleton';
|
|
3
|
+
import './index.less';
|
|
4
|
+
declare type BoolConfigVal = 0 | 1;
|
|
5
|
+
export interface ProductCardConfig {
|
|
6
|
+
isProductCover?: BoolConfigVal;
|
|
7
|
+
imgWidth?: string;
|
|
8
|
+
imgHeight?: string;
|
|
9
|
+
radius?: number;
|
|
10
|
+
isTitle?: BoolConfigVal;
|
|
11
|
+
isSubtitle?: BoolConfigVal;
|
|
12
|
+
showSpec?: boolean;
|
|
13
|
+
isTag?: BoolConfigVal;
|
|
14
|
+
isPrice?: BoolConfigVal;
|
|
15
|
+
isOriginPrice?: BoolConfigVal;
|
|
16
|
+
showZeroPrice?: boolean;
|
|
17
|
+
showMarketingTag?: boolean;
|
|
18
|
+
showRemark?: boolean;
|
|
19
|
+
isStock?: BoolConfigVal;
|
|
20
|
+
}
|
|
21
|
+
export interface ProductCardProps {
|
|
22
|
+
item: any;
|
|
23
|
+
index: number;
|
|
24
|
+
context?: {
|
|
25
|
+
onItemIntersectionIn: (item: any) => void;
|
|
26
|
+
onItemIntersectionOut: (item: any) => void;
|
|
27
|
+
};
|
|
28
|
+
className?: string;
|
|
29
|
+
onSelectProduct?: (item: any) => void;
|
|
30
|
+
currentProductId?: number;
|
|
31
|
+
onSelect?: (item: any) => void;
|
|
32
|
+
isSelected?: boolean;
|
|
33
|
+
decorateConfig?: ProductCardConfig;
|
|
34
|
+
}
|
|
35
|
+
export declare const ProductCard: React.MemoExoticComponent<({ item, index, context, onSelect, isSelected, className, decorateConfig, }: ProductCardProps) => JSX.Element>;
|
|
36
|
+
export declare const DefaultItemContent: React.MemoExoticComponent<(props: {
|
|
37
|
+
item: any;
|
|
38
|
+
index: number;
|
|
39
|
+
context?: {
|
|
40
|
+
onItemIntersectionIn: (item: any) => void;
|
|
41
|
+
onItemIntersectionOut: (item: any) => void;
|
|
42
|
+
} | undefined;
|
|
43
|
+
}) => JSX.Element>;
|
|
44
|
+
export default ProductCard;
|
|
45
|
+
export { ProductCardSkeleton };
|
|
@@ -0,0 +1,184 @@
|
|
|
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/plus/productSelect/ProductCard/index.tsx
|
|
30
|
+
var ProductCard_exports = {};
|
|
31
|
+
__export(ProductCard_exports, {
|
|
32
|
+
DefaultItemContent: () => DefaultItemContent,
|
|
33
|
+
ProductCard: () => ProductCard,
|
|
34
|
+
ProductCardSkeleton: () => import_ProductCardSkeleton.default,
|
|
35
|
+
default: () => ProductCard_default
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(ProductCard_exports);
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_classnames = __toESM(require("classnames"));
|
|
40
|
+
var import_utils = require("@pisell/utils");
|
|
41
|
+
var import_decimal = __toESM(require("decimal.js"));
|
|
42
|
+
var import_IntersectionObserver = require("../components/IntersectionObserver");
|
|
43
|
+
var import_pisellPriceText = __toESM(require("../components/pisellPriceText"));
|
|
44
|
+
var import_ProductCardSkeleton = __toESM(require("./ProductCardSkeleton"));
|
|
45
|
+
var import_index = require("./index.less");
|
|
46
|
+
var import__ = require("../index");
|
|
47
|
+
var defaultConfig = {
|
|
48
|
+
isProductCover: 1,
|
|
49
|
+
imgWidth: "180px",
|
|
50
|
+
imgHeight: "126px",
|
|
51
|
+
radius: 8,
|
|
52
|
+
isTitle: 1,
|
|
53
|
+
isSubtitle: 0,
|
|
54
|
+
showSpec: true,
|
|
55
|
+
isTag: 0,
|
|
56
|
+
isPrice: 0,
|
|
57
|
+
isOriginPrice: 0,
|
|
58
|
+
showZeroPrice: false,
|
|
59
|
+
showMarketingTag: true,
|
|
60
|
+
showRemark: true,
|
|
61
|
+
isStock: 0
|
|
62
|
+
};
|
|
63
|
+
var ProductCard = (0, import_react.memo)(
|
|
64
|
+
({
|
|
65
|
+
item,
|
|
66
|
+
index,
|
|
67
|
+
context,
|
|
68
|
+
onSelect,
|
|
69
|
+
isSelected,
|
|
70
|
+
className,
|
|
71
|
+
decorateConfig = {}
|
|
72
|
+
}) => {
|
|
73
|
+
const finalConfig = { ...defaultConfig, ...decorateConfig };
|
|
74
|
+
const {
|
|
75
|
+
imgHeight,
|
|
76
|
+
imgWidth,
|
|
77
|
+
isOriginPrice,
|
|
78
|
+
isPrice,
|
|
79
|
+
isProductCover,
|
|
80
|
+
isStock,
|
|
81
|
+
isSubtitle,
|
|
82
|
+
isTitle,
|
|
83
|
+
radius,
|
|
84
|
+
showZeroPrice
|
|
85
|
+
} = finalConfig;
|
|
86
|
+
const { __typename } = item;
|
|
87
|
+
if (__typename === "category") {
|
|
88
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
className: (0, import_classnames.default)(`${import__.PREFIX}__product-category`, className),
|
|
92
|
+
"data-index": index,
|
|
93
|
+
"data-item-index": index
|
|
94
|
+
},
|
|
95
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "category-title" }, item.name)
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
const getStockText = (item2) => {
|
|
99
|
+
if (item2.is_track === 0) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return `${import_utils.locales.getText("pisell2.product-select.stock")}:${item2.stock_quantity}`;
|
|
103
|
+
};
|
|
104
|
+
const getTextCover = (title) => {
|
|
105
|
+
if (!title) return "";
|
|
106
|
+
const cleanTitle = title.trim();
|
|
107
|
+
if (cleanTitle.length === 0) return "";
|
|
108
|
+
return cleanTitle.substring(0, 2).toUpperCase();
|
|
109
|
+
};
|
|
110
|
+
const renderPrice = (item2) => {
|
|
111
|
+
const {
|
|
112
|
+
price: _price,
|
|
113
|
+
original_price: _original_price,
|
|
114
|
+
is_bundle,
|
|
115
|
+
minimum_markup_price
|
|
116
|
+
} = item2;
|
|
117
|
+
let price = _price;
|
|
118
|
+
let original_price = _original_price;
|
|
119
|
+
if (is_bundle) {
|
|
120
|
+
price = new import_decimal.default(price).plus(new import_decimal.default(minimum_markup_price)).toFixed(2);
|
|
121
|
+
original_price = new import_decimal.default(original_price).plus(new import_decimal.default(minimum_markup_price)).toFixed(2);
|
|
122
|
+
}
|
|
123
|
+
if (!showZeroPrice && !parseFloat(price)) return null;
|
|
124
|
+
return !!isPrice || !!isOriginPrice ? /* @__PURE__ */ import_react.default.createElement("div", { className: "price-info" }, isPrice ? /* @__PURE__ */ import_react.default.createElement("div", { className: "price" }, /* @__PURE__ */ import_react.default.createElement(import_pisellPriceText.default, { value: price, isMini: is_bundle })) : null, !!isOriginPrice && parseFloat(original_price) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "original-price" }, /* @__PURE__ */ import_react.default.createElement(import_pisellPriceText.default, { value: original_price, isMini: is_bundle })) : null) : null;
|
|
125
|
+
};
|
|
126
|
+
const cardContent = /* @__PURE__ */ import_react.default.createElement(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
className: (0, import_classnames.default)(`${import__.PREFIX}__product-card`, className, {
|
|
130
|
+
selected: isSelected
|
|
131
|
+
}),
|
|
132
|
+
onClick: () => {
|
|
133
|
+
onSelect == null ? void 0 : onSelect(item);
|
|
134
|
+
},
|
|
135
|
+
"data-index": index,
|
|
136
|
+
"data-item-index": index
|
|
137
|
+
},
|
|
138
|
+
isProductCover ? /* @__PURE__ */ import_react.default.createElement(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
className: "card-left",
|
|
142
|
+
style: {
|
|
143
|
+
width: imgWidth || "auto",
|
|
144
|
+
height: imgHeight || "auto"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
item.cover ? /* @__PURE__ */ import_react.default.createElement(
|
|
148
|
+
"img",
|
|
149
|
+
{
|
|
150
|
+
loading: "lazy",
|
|
151
|
+
src: import_utils.image.ali(item.cover, 360),
|
|
152
|
+
alt: item.title,
|
|
153
|
+
style: { borderRadius: radius }
|
|
154
|
+
}
|
|
155
|
+
) : /* @__PURE__ */ import_react.default.createElement("div", { className: "text-cover", style: { borderRadius: radius } }, getTextCover(item.title))
|
|
156
|
+
) : null,
|
|
157
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "card-right" }, !!isTitle ? /* @__PURE__ */ import_react.default.createElement("div", { className: "title" }, item.title) : null, !!isSubtitle && item.subtitle ? /* @__PURE__ */ import_react.default.createElement("div", { className: "subtitle" }, item.subtitle) : null, !!isStock && !!item.is_track ? /* @__PURE__ */ import_react.default.createElement("div", { className: "stock" }, getStockText(item)) : null, renderPrice(item))
|
|
158
|
+
);
|
|
159
|
+
if (context) {
|
|
160
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
161
|
+
import_IntersectionObserver.IntersectionTrigger,
|
|
162
|
+
{
|
|
163
|
+
onShow: () => context.onItemIntersectionIn(item)
|
|
164
|
+
},
|
|
165
|
+
cardContent
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
return cardContent;
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
ProductCard.displayName = "ProductCard";
|
|
172
|
+
var DefaultItemContent = (0, import_react.memo)(
|
|
173
|
+
(props) => {
|
|
174
|
+
return /* @__PURE__ */ import_react.default.createElement(ProductCard, { ...props });
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
DefaultItemContent.displayName = "DefaultItemContent";
|
|
178
|
+
var ProductCard_default = ProductCard;
|
|
179
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
180
|
+
0 && (module.exports = {
|
|
181
|
+
DefaultItemContent,
|
|
182
|
+
ProductCard,
|
|
183
|
+
ProductCardSkeleton
|
|
184
|
+
});
|