@pisell/private-materials 3.4.17 → 3.4.19
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 +7 -7
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- 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/components/Voucher/index.d.ts +0 -1
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.js +8 -2
- package/es/components/booking/addons/index.js +12 -8
- package/es/components/booking/components/footer/index.js +19 -9
- package/es/components/booking/components/voucher/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addTimeModal/index.js +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/eventBooking/components/progressBar/index.js +20 -0
- package/es/components/eventBooking/index.js +8 -1
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +20 -7
- package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.js +12 -2
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +31 -24
- package/es/components/pay/toC/utils.d.ts +1 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +3 -3
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/es/components/wallet/Detail/index.js +2 -2
- package/es/components/wallet/components/WalletCard.js +3 -2
- package/es/hooks/useWindowSize.js +8 -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 +1 -0
- package/es/plus/saasCreateOrganization/index.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/es/plus/saasRegister/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- 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/components/Voucher/index.d.ts +0 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.js +6 -1
- package/lib/components/booking/addons/index.js +1 -11
- package/lib/components/booking/components/footer/index.js +15 -8
- package/lib/components/booking/components/voucher/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addTimeModal/index.js +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/eventBooking/components/progressBar/index.js +18 -0
- package/lib/components/eventBooking/index.js +6 -1
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +11 -7
- package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.js +9 -2
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +6 -2
- package/lib/components/pay/toC/utils.d.ts +1 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +3 -3
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/wallet/Detail/index.js +3 -3
- package/lib/components/wallet/components/WalletCard.js +1 -1
- package/lib/hooks/useWindowSize.js +6 -1
- 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 +1 -0
- package/lib/plus/saasCreateOrganization/index.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/lib/plus/saasRegister/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
interface Product {
|
|
2
|
+
id: number;
|
|
3
|
+
title: string;
|
|
4
|
+
sort?: number;
|
|
5
|
+
category: Array<{
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
sort: number;
|
|
11
|
+
}>;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
interface CategoryItem {
|
|
15
|
+
__typename: 'category';
|
|
16
|
+
id: number;
|
|
17
|
+
name: string;
|
|
18
|
+
icon?: string;
|
|
19
|
+
slug: string;
|
|
20
|
+
sort: number;
|
|
21
|
+
}
|
|
22
|
+
interface ProductItem extends Product {
|
|
23
|
+
__typename?: 'product';
|
|
24
|
+
}
|
|
25
|
+
declare type ListItem = CategoryItem | ProductItem;
|
|
26
|
+
/**
|
|
27
|
+
* 按目录对商品进行分组,产出平级的数据结构用于虚拟列表渲染
|
|
28
|
+
* @param products 商品列表
|
|
29
|
+
* @returns 包含目录项和商品项的平级数组
|
|
30
|
+
*/
|
|
31
|
+
export declare function groupProductsByCategory(products: Product[]): ListItem[];
|
|
32
|
+
/**
|
|
33
|
+
* 根据传入的元素标识符获取DOM元素
|
|
34
|
+
* @param elementIdentifier 元素标识符,可以是HTMLElement、带'#'的id、带'.'的类名或CSS选择器
|
|
35
|
+
* @returns 找到的DOM元素或null
|
|
36
|
+
*/
|
|
37
|
+
export declare function getElementByIdentifier(elementIdentifier: HTMLElement | string | null | undefined): HTMLElement | null;
|
|
38
|
+
export declare const getOffsetTopRelativeToScrollContainer: (targetElement: HTMLElement, scrollContainer: HTMLElement) => number;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/plus/productSelect/utils.ts
|
|
20
|
+
var utils_exports = {};
|
|
21
|
+
__export(utils_exports, {
|
|
22
|
+
getElementByIdentifier: () => getElementByIdentifier,
|
|
23
|
+
getOffsetTopRelativeToScrollContainer: () => getOffsetTopRelativeToScrollContainer,
|
|
24
|
+
groupProductsByCategory: () => groupProductsByCategory
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(utils_exports);
|
|
27
|
+
var import_utils = require("@pisell/utils");
|
|
28
|
+
function groupProductsByCategory(products) {
|
|
29
|
+
if (!products || products.length === 0) {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
const categoryMap = /* @__PURE__ */ new Map();
|
|
33
|
+
const categoryProductsMap = /* @__PURE__ */ new Map();
|
|
34
|
+
const uncategorizedProducts = [];
|
|
35
|
+
products.forEach((product) => {
|
|
36
|
+
if (product.category && Array.isArray(product.category) && product.category.length > 0) {
|
|
37
|
+
product.category.forEach((cat) => {
|
|
38
|
+
if (!categoryMap.has(cat.id)) {
|
|
39
|
+
categoryMap.set(cat.id, {
|
|
40
|
+
__typename: "category",
|
|
41
|
+
id: cat.id,
|
|
42
|
+
name: cat.name,
|
|
43
|
+
icon: cat.icon,
|
|
44
|
+
slug: cat.slug,
|
|
45
|
+
sort: cat.sort
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (!categoryProductsMap.has(cat.id)) {
|
|
49
|
+
categoryProductsMap.set(cat.id, []);
|
|
50
|
+
}
|
|
51
|
+
categoryProductsMap.get(cat.id).push({
|
|
52
|
+
...product,
|
|
53
|
+
__typename: "product",
|
|
54
|
+
__categoryId: cat.id
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
} else {
|
|
58
|
+
uncategorizedProducts.push({
|
|
59
|
+
...product,
|
|
60
|
+
__typename: "product",
|
|
61
|
+
__categoryId: 0
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const sortedCategories = Array.from(categoryMap.values()).sort(
|
|
66
|
+
(a, b) => b.sort - a.sort
|
|
67
|
+
);
|
|
68
|
+
const result = [];
|
|
69
|
+
sortedCategories.forEach((category) => {
|
|
70
|
+
result.push(category);
|
|
71
|
+
const categoryProducts = categoryProductsMap.get(category.id) || [];
|
|
72
|
+
const sortedProducts = categoryProducts.sort((a, b) => {
|
|
73
|
+
const sortA = a.sort || 0;
|
|
74
|
+
const sortB = b.sort || 0;
|
|
75
|
+
return sortB - sortA;
|
|
76
|
+
});
|
|
77
|
+
result.push(...sortedProducts);
|
|
78
|
+
});
|
|
79
|
+
if (uncategorizedProducts.length > 0) {
|
|
80
|
+
const otherCategory = {
|
|
81
|
+
__typename: "category",
|
|
82
|
+
id: 0,
|
|
83
|
+
name: import_utils.locales.getText("pisell2.text.other"),
|
|
84
|
+
icon: "",
|
|
85
|
+
slug: "other",
|
|
86
|
+
sort: 99999999
|
|
87
|
+
// 确保other分组排在最后
|
|
88
|
+
};
|
|
89
|
+
result.push(otherCategory);
|
|
90
|
+
const sortedUncategorizedProducts = uncategorizedProducts.sort((a, b) => {
|
|
91
|
+
const sortA = a.sort || 0;
|
|
92
|
+
const sortB = b.sort || 0;
|
|
93
|
+
return sortB - sortA;
|
|
94
|
+
});
|
|
95
|
+
result.push(...sortedUncategorizedProducts);
|
|
96
|
+
}
|
|
97
|
+
console.log("xxxxxx", result);
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
function getElementByIdentifier(elementIdentifier) {
|
|
101
|
+
if (!elementIdentifier) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
if (elementIdentifier instanceof HTMLElement) {
|
|
105
|
+
return elementIdentifier;
|
|
106
|
+
}
|
|
107
|
+
if (typeof elementIdentifier === "string") {
|
|
108
|
+
if (elementIdentifier.startsWith("#")) {
|
|
109
|
+
return document.getElementById(elementIdentifier.slice(1));
|
|
110
|
+
}
|
|
111
|
+
if (elementIdentifier.startsWith(".")) {
|
|
112
|
+
return document.querySelector(elementIdentifier);
|
|
113
|
+
}
|
|
114
|
+
return document.querySelector(elementIdentifier);
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
var getOffsetTopRelativeToScrollContainer = (targetElement, scrollContainer) => {
|
|
119
|
+
if (!targetElement || !scrollContainer) return 0;
|
|
120
|
+
if (targetElement === scrollContainer) {
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
const bodyTransform = getComputedStyle(document.body).transform;
|
|
124
|
+
let scaleY = 1;
|
|
125
|
+
if (bodyTransform !== "none") {
|
|
126
|
+
const matrix = new DOMMatrix(bodyTransform);
|
|
127
|
+
scaleY = matrix.d;
|
|
128
|
+
}
|
|
129
|
+
const targetRect = targetElement.getBoundingClientRect();
|
|
130
|
+
const containerRect = scrollContainer.getBoundingClientRect();
|
|
131
|
+
return targetRect.top / scaleY - containerRect.top / scaleY + scrollContainer.scrollTop;
|
|
132
|
+
};
|
|
133
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
+
0 && (module.exports = {
|
|
135
|
+
getElementByIdentifier,
|
|
136
|
+
getOffsetTopRelativeToScrollContainer,
|
|
137
|
+
groupProductsByCategory
|
|
138
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.19",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
62
|
"@pisell/utils": "3.0.1",
|
|
63
|
-
"@pisell/materials": "3.3.
|
|
64
|
-
"@pisell/
|
|
65
|
-
"@pisell/
|
|
63
|
+
"@pisell/materials": "3.3.56",
|
|
64
|
+
"@pisell/date-picker": "3.0.3",
|
|
65
|
+
"@pisell/icon": "0.0.11"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0",
|