@pisell/private-materials 6.3.3 → 6.3.4
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 +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/Sales/Summary/utils.d.ts +1 -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/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Services/index.js +2 -2
- package/es/components/appointmentBooking/index.js +8 -2
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info2/service/addTimeModal/index.js +0 -1
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftpos/surcharge/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/eventBooking/index.js +8 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -2
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- 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 +270 -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 +11 -0
- package/es/plus/productSelect/components/pisellPriceText/index.js +43 -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/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/Sales/Summary/utils.d.ts +1 -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/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Services/index.js +2 -2
- package/lib/components/appointmentBooking/index.js +6 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info2/service/addTimeModal/index.js +0 -1
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftpos/surcharge/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/eventBooking/index.js +6 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +2 -2
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- 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 +270 -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 +11 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.js +72 -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/package.json +2 -2
@@ -0,0 +1,148 @@
|
|
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/ProductList/gridComponents.tsx
|
30
|
+
var gridComponents_exports = {};
|
31
|
+
__export(gridComponents_exports, {
|
32
|
+
GRID_LAYOUTS: () => GRID_LAYOUTS,
|
33
|
+
createCustomGrid: () => createCustomGrid,
|
34
|
+
createGridComponents: () => createGridComponents,
|
35
|
+
createTwoColumnGrid: () => createTwoColumnGrid,
|
36
|
+
parseGridConfig: () => parseGridConfig
|
37
|
+
});
|
38
|
+
module.exports = __toCommonJS(gridComponents_exports);
|
39
|
+
var import_react = __toESM(require("react"));
|
40
|
+
var parseGridConfig = (config) => {
|
41
|
+
return config.split(":").map((num) => parseInt(num, 10)).filter((num) => !isNaN(num));
|
42
|
+
};
|
43
|
+
var calculateColumnWidth = (columns, index) => {
|
44
|
+
const total = columns.reduce((sum, col) => sum + col, 0);
|
45
|
+
const percentage = columns[index] / total * 100;
|
46
|
+
return `${percentage}%`;
|
47
|
+
};
|
48
|
+
var createGridComponents = (layout) => {
|
49
|
+
if (!layout) {
|
50
|
+
layout = GRID_LAYOUTS.SINGLE_COLUMN;
|
51
|
+
}
|
52
|
+
const columns = parseGridConfig(layout.config);
|
53
|
+
const isGrid = layout.grid && columns.length > 1;
|
54
|
+
const GridListComponent = (0, import_react.memo)(({ children, ...props }) => {
|
55
|
+
if (!isGrid) {
|
56
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
57
|
+
"div",
|
58
|
+
{
|
59
|
+
className: "product-list-wrapper",
|
60
|
+
style: {
|
61
|
+
display: "flex",
|
62
|
+
flexDirection: "column",
|
63
|
+
gap: "12px"
|
64
|
+
},
|
65
|
+
...props
|
66
|
+
},
|
67
|
+
children
|
68
|
+
);
|
69
|
+
}
|
70
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
71
|
+
"div",
|
72
|
+
{
|
73
|
+
className: "product-grid-wrapper",
|
74
|
+
style: {
|
75
|
+
display: "flex",
|
76
|
+
flexWrap: "wrap",
|
77
|
+
gap: "12px",
|
78
|
+
...props.style
|
79
|
+
},
|
80
|
+
...props
|
81
|
+
},
|
82
|
+
children
|
83
|
+
);
|
84
|
+
});
|
85
|
+
const GridItemComponent = (0, import_react.memo)(({ children, index, item, ...props }) => {
|
86
|
+
if (!isGrid) {
|
87
|
+
if (item && item.__typename === "category") {
|
88
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { id: `ps_category_${item.id}`, ...props }, children);
|
89
|
+
}
|
90
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { ...props }, children);
|
91
|
+
}
|
92
|
+
if (item && item.__typename === "category") {
|
93
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
94
|
+
"div",
|
95
|
+
{
|
96
|
+
id: `ps_category_${item.id}`,
|
97
|
+
style: {
|
98
|
+
width: "100%",
|
99
|
+
flexShrink: 0,
|
100
|
+
...props.style
|
101
|
+
},
|
102
|
+
...props
|
103
|
+
},
|
104
|
+
children
|
105
|
+
);
|
106
|
+
}
|
107
|
+
const columnIndex = index % columns.length;
|
108
|
+
const width = calculateColumnWidth(columns, columnIndex);
|
109
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
110
|
+
"div",
|
111
|
+
{
|
112
|
+
style: {
|
113
|
+
width: `calc(${width} - ${(columns.length - 1) * 12 / columns.length}px)`,
|
114
|
+
flexShrink: 0,
|
115
|
+
...props.style
|
116
|
+
},
|
117
|
+
...props
|
118
|
+
},
|
119
|
+
children
|
120
|
+
);
|
121
|
+
});
|
122
|
+
GridListComponent.displayName = `GridListComponent_${layout.config}`;
|
123
|
+
GridItemComponent.displayName = `GridItemComponent_${layout.config}`;
|
124
|
+
return {
|
125
|
+
List: GridListComponent,
|
126
|
+
Item: GridItemComponent
|
127
|
+
};
|
128
|
+
};
|
129
|
+
var GRID_LAYOUTS = {
|
130
|
+
SINGLE_COLUMN: { grid: false, config: "12" },
|
131
|
+
TWO_COLUMNS: { grid: true, config: "12:12" },
|
132
|
+
THREE_COLUMNS: { grid: true, config: "8:8:8" },
|
133
|
+
FOUR_COLUMNS: { grid: true, config: "6:6:6:6" },
|
134
|
+
UNEQUAL_TWO: { grid: true, config: "8:16" },
|
135
|
+
// 1:2 比例
|
136
|
+
UNEQUAL_THREE: { grid: true, config: "6:12:6" }
|
137
|
+
// 1:2:1 比例
|
138
|
+
};
|
139
|
+
var createTwoColumnGrid = () => createGridComponents(GRID_LAYOUTS.TWO_COLUMNS);
|
140
|
+
var createCustomGrid = (config) => createGridComponents({ grid: true, config });
|
141
|
+
// Annotate the CommonJS export names for ESM import in node:
|
142
|
+
0 && (module.exports = {
|
143
|
+
GRID_LAYOUTS,
|
144
|
+
createCustomGrid,
|
145
|
+
createGridComponents,
|
146
|
+
createTwoColumnGrid,
|
147
|
+
parseGridConfig
|
148
|
+
});
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
interface IProps {
|
3
|
+
className?: string;
|
4
|
+
loading?: boolean;
|
5
|
+
data: any[];
|
6
|
+
context: {
|
7
|
+
onItemIntersectionIn: (item: any) => void;
|
8
|
+
onItemIntersectionOut: (item: any) => void;
|
9
|
+
};
|
10
|
+
customScrollParent?: Element | null;
|
11
|
+
components?: {
|
12
|
+
List?: React.ComponentType<any>;
|
13
|
+
Item?: React.ComponentType<any>;
|
14
|
+
[key: string]: React.ComponentType<any> | undefined;
|
15
|
+
};
|
16
|
+
itemContent?: (index: number, data: any, context: any) => React.ReactNode;
|
17
|
+
itemSkeleton?: React.ReactNode;
|
18
|
+
[key: string]: any;
|
19
|
+
}
|
20
|
+
declare const ProductList: React.ForwardRefExoticComponent<Omit<IProps, "ref"> & React.RefAttributes<any>>;
|
21
|
+
export default ProductList;
|
22
|
+
export { createGridComponents, createTwoColumnGrid, createCustomGrid, GRID_LAYOUTS, type GridConfig, } from './gridComponents';
|
@@ -0,0 +1,86 @@
|
|
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/ProductList/index.tsx
|
30
|
+
var ProductList_exports = {};
|
31
|
+
__export(ProductList_exports, {
|
32
|
+
GRID_LAYOUTS: () => import_gridComponents.GRID_LAYOUTS,
|
33
|
+
createCustomGrid: () => import_gridComponents.createCustomGrid,
|
34
|
+
createGridComponents: () => import_gridComponents.createGridComponents,
|
35
|
+
createTwoColumnGrid: () => import_gridComponents.createTwoColumnGrid,
|
36
|
+
default: () => ProductList_default
|
37
|
+
});
|
38
|
+
module.exports = __toCommonJS(ProductList_exports);
|
39
|
+
var import_react = __toESM(require("react"));
|
40
|
+
var import_classnames = __toESM(require("classnames"));
|
41
|
+
var import_gridComponents = require("./gridComponents");
|
42
|
+
var DefaultListComponent = (0, import_react.memo)(({ children, ...listProps }) => /* @__PURE__ */ import_react.default.createElement("div", { className: "product-list-wrapper", ...listProps }, children));
|
43
|
+
var DefaultItemComponent = (0, import_react.memo)(({ children, index, ...itemProps }) => /* @__PURE__ */ import_react.default.createElement("div", { ...itemProps, "data-index": index, "data-item-index": index }, children));
|
44
|
+
var ProductList = (0, import_react.forwardRef)((props, ref) => {
|
45
|
+
const { className, data, context, components, itemContent } = props;
|
46
|
+
const ListComponent = (0, import_react.useMemo)(
|
47
|
+
() => (components == null ? void 0 : components.List) || DefaultListComponent,
|
48
|
+
[components == null ? void 0 : components.List]
|
49
|
+
);
|
50
|
+
const ItemComponent = (0, import_react.useMemo)(
|
51
|
+
() => (components == null ? void 0 : components.Item) || DefaultItemComponent,
|
52
|
+
[components == null ? void 0 : components.Item]
|
53
|
+
);
|
54
|
+
const itemContentRenderer = (0, import_react.useMemo)(() => {
|
55
|
+
if (itemContent) {
|
56
|
+
return (item, index) => itemContent(index, item, context);
|
57
|
+
}
|
58
|
+
return (item, index) => /* @__PURE__ */ import_react.default.createElement("div", null, index);
|
59
|
+
}, [itemContent, context]);
|
60
|
+
const renderedItems = (0, import_react.useMemo)(() => {
|
61
|
+
return data == null ? void 0 : data.map((item, index) => {
|
62
|
+
const content = itemContentRenderer(item, index);
|
63
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
64
|
+
ItemComponent,
|
65
|
+
{
|
66
|
+
key: `${item.id || index}-${index}`,
|
67
|
+
item,
|
68
|
+
index,
|
69
|
+
"data-index": index,
|
70
|
+
"data-item-index": index,
|
71
|
+
context
|
72
|
+
},
|
73
|
+
content
|
74
|
+
);
|
75
|
+
});
|
76
|
+
}, [data, ItemComponent, itemContentRenderer]);
|
77
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(className) }, /* @__PURE__ */ import_react.default.createElement(ListComponent, { ref, context }, renderedItems));
|
78
|
+
});
|
79
|
+
var ProductList_default = ProductList;
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
81
|
+
0 && (module.exports = {
|
82
|
+
GRID_LAYOUTS,
|
83
|
+
createCustomGrid,
|
84
|
+
createGridComponents,
|
85
|
+
createTwoColumnGrid
|
86
|
+
});
|
File without changes
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { ReactNode, CSSProperties } from 'react';
|
3
|
+
declare global {
|
4
|
+
interface Window {
|
5
|
+
IntersectionObserver: typeof IntersectionObserver;
|
6
|
+
}
|
7
|
+
}
|
8
|
+
interface IntersectionObserverContextValue {
|
9
|
+
initialized: boolean;
|
10
|
+
register: (params: {
|
11
|
+
ref: React.RefObject<HTMLElement>;
|
12
|
+
callback: (entry: IntersectionObserverEntry) => void;
|
13
|
+
}) => void;
|
14
|
+
unregister: (params: {
|
15
|
+
ref: React.RefObject<HTMLElement>;
|
16
|
+
}) => void;
|
17
|
+
}
|
18
|
+
declare type PriorityMode = 'top' | 'bottom' | 'left' | 'right' | undefined;
|
19
|
+
interface IntersectionObserverProps {
|
20
|
+
children: ReactNode;
|
21
|
+
root?: Element | null;
|
22
|
+
rootMargin?: string;
|
23
|
+
threshold?: number | number[];
|
24
|
+
priorityMode?: PriorityMode;
|
25
|
+
}
|
26
|
+
interface IntersectionTriggerOptions {
|
27
|
+
once?: boolean;
|
28
|
+
onHide?: (cleanup: () => void) => void;
|
29
|
+
onShow?: (cleanup: () => void) => void;
|
30
|
+
}
|
31
|
+
interface IntersectionTriggerProps extends IntersectionTriggerOptions {
|
32
|
+
children?: ReactNode;
|
33
|
+
className?: string;
|
34
|
+
style?: CSSProperties;
|
35
|
+
}
|
36
|
+
declare const IntersectionObserverContext: React.Context<IntersectionObserverContextValue>;
|
37
|
+
declare const Consumer: React.Consumer<IntersectionObserverContextValue>;
|
38
|
+
export declare const IntersectionObserverProvider: React.FC<IntersectionObserverProps>;
|
39
|
+
export declare const IntersectionTrigger: React.FC<IntersectionTriggerProps>;
|
40
|
+
export type { IntersectionObserverProps, IntersectionTriggerProps, IntersectionTriggerOptions, IntersectionObserverContextValue, PriorityMode, };
|
41
|
+
export { IntersectionObserverContext, Consumer as IntersectionObserverConsumer, };
|
42
|
+
export default IntersectionObserverProvider;
|
@@ -0,0 +1,269 @@
|
|
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/components/IntersectionObserver.tsx
|
30
|
+
var IntersectionObserver_exports = {};
|
31
|
+
__export(IntersectionObserver_exports, {
|
32
|
+
IntersectionObserverConsumer: () => Consumer,
|
33
|
+
IntersectionObserverContext: () => IntersectionObserverContext,
|
34
|
+
IntersectionObserverProvider: () => IntersectionObserverProvider,
|
35
|
+
IntersectionTrigger: () => IntersectionTrigger,
|
36
|
+
default: () => IntersectionObserver_default
|
37
|
+
});
|
38
|
+
module.exports = __toCommonJS(IntersectionObserver_exports);
|
39
|
+
var import_react = __toESM(require("react"));
|
40
|
+
var IntersectionObserverContext = (0, import_react.createContext)({
|
41
|
+
initialized: false,
|
42
|
+
register: () => {
|
43
|
+
},
|
44
|
+
unregister: () => {
|
45
|
+
}
|
46
|
+
});
|
47
|
+
var { Provider, Consumer } = IntersectionObserverContext;
|
48
|
+
var IntersectionObserverProvider = ({
|
49
|
+
children,
|
50
|
+
root = null,
|
51
|
+
rootMargin = "0px",
|
52
|
+
threshold = 0,
|
53
|
+
priorityMode
|
54
|
+
}) => {
|
55
|
+
const [mounted, setMounted] = (0, import_react.useState)(false);
|
56
|
+
const [initialized, setInitialized] = (0, import_react.useState)(false);
|
57
|
+
const observerRef = (0, import_react.useRef)(null);
|
58
|
+
const callbackMapRef = (0, import_react.useRef)(/* @__PURE__ */ new Map());
|
59
|
+
const findCallback = (0, import_react.useCallback)((target) => {
|
60
|
+
return callbackMapRef.current.get(target);
|
61
|
+
}, []);
|
62
|
+
const selectPriorityEntry = (0, import_react.useCallback)(
|
63
|
+
(entries, mode) => {
|
64
|
+
if (entries.length === 0) return void 0;
|
65
|
+
if (entries.length === 1) return entries[0];
|
66
|
+
switch (mode) {
|
67
|
+
case "top":
|
68
|
+
return entries.reduce(
|
69
|
+
(prev, curr) => curr.boundingClientRect.top < prev.boundingClientRect.top ? curr : prev
|
70
|
+
);
|
71
|
+
case "bottom":
|
72
|
+
return entries.reduce(
|
73
|
+
(prev, curr) => curr.boundingClientRect.bottom > prev.boundingClientRect.bottom ? curr : prev
|
74
|
+
);
|
75
|
+
case "left":
|
76
|
+
return entries.reduce(
|
77
|
+
(prev, curr) => curr.boundingClientRect.left < prev.boundingClientRect.left ? curr : prev
|
78
|
+
);
|
79
|
+
case "right":
|
80
|
+
return entries.reduce(
|
81
|
+
(prev, curr) => curr.boundingClientRect.right > prev.boundingClientRect.right ? curr : prev
|
82
|
+
);
|
83
|
+
default:
|
84
|
+
return entries[0];
|
85
|
+
}
|
86
|
+
},
|
87
|
+
[]
|
88
|
+
);
|
89
|
+
const observerOptions = (0, import_react.useMemo)(
|
90
|
+
() => ({
|
91
|
+
root,
|
92
|
+
rootMargin,
|
93
|
+
threshold
|
94
|
+
}),
|
95
|
+
[root, rootMargin, threshold]
|
96
|
+
);
|
97
|
+
const createObserver = (0, import_react.useCallback)(() => {
|
98
|
+
if (typeof window !== "undefined" && !window.IntersectionObserver) {
|
99
|
+
console.warn("IntersectionObserver is not supported in this browser");
|
100
|
+
return null;
|
101
|
+
}
|
102
|
+
return new IntersectionObserver((entries) => {
|
103
|
+
if (entries.length === 0) return;
|
104
|
+
try {
|
105
|
+
if (!priorityMode) {
|
106
|
+
entries.forEach((entry) => {
|
107
|
+
const callback = findCallback(entry.target);
|
108
|
+
if (callback) {
|
109
|
+
callback(entry);
|
110
|
+
}
|
111
|
+
});
|
112
|
+
return;
|
113
|
+
}
|
114
|
+
const visibleEntries = [];
|
115
|
+
const invisibleEntries = [];
|
116
|
+
entries.forEach((entry) => {
|
117
|
+
if (entry.isIntersecting) {
|
118
|
+
visibleEntries.push(entry);
|
119
|
+
} else {
|
120
|
+
invisibleEntries.push(entry);
|
121
|
+
}
|
122
|
+
});
|
123
|
+
invisibleEntries.forEach((entry) => {
|
124
|
+
const callback = findCallback(entry.target);
|
125
|
+
if (callback) {
|
126
|
+
callback(entry);
|
127
|
+
}
|
128
|
+
});
|
129
|
+
if (visibleEntries.length > 0) {
|
130
|
+
const selectedEntry = selectPriorityEntry(
|
131
|
+
visibleEntries,
|
132
|
+
priorityMode
|
133
|
+
);
|
134
|
+
if (selectedEntry) {
|
135
|
+
const callback = findCallback(selectedEntry.target);
|
136
|
+
if (callback) {
|
137
|
+
callback(selectedEntry);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
} catch (error) {
|
142
|
+
console.error("IntersectionObserver callback error:", error);
|
143
|
+
}
|
144
|
+
}, observerOptions);
|
145
|
+
}, [observerOptions, priorityMode, findCallback, selectPriorityEntry]);
|
146
|
+
const register = (0, import_react.useCallback)(
|
147
|
+
({
|
148
|
+
ref,
|
149
|
+
callback
|
150
|
+
}) => {
|
151
|
+
if ((ref == null ? void 0 : ref.current) && (observerRef == null ? void 0 : observerRef.current)) {
|
152
|
+
const element = ref.current;
|
153
|
+
if (callbackMapRef.current.has(element)) {
|
154
|
+
return;
|
155
|
+
}
|
156
|
+
callbackMapRef.current.set(element, callback);
|
157
|
+
observerRef.current.observe(element);
|
158
|
+
}
|
159
|
+
},
|
160
|
+
[]
|
161
|
+
);
|
162
|
+
const unregister = (0, import_react.useCallback)(
|
163
|
+
({ ref }) => {
|
164
|
+
if ((ref == null ? void 0 : ref.current) && (observerRef == null ? void 0 : observerRef.current)) {
|
165
|
+
const element = ref.current;
|
166
|
+
callbackMapRef.current.delete(element);
|
167
|
+
observerRef.current.unobserve(element);
|
168
|
+
}
|
169
|
+
},
|
170
|
+
[]
|
171
|
+
);
|
172
|
+
(0, import_react.useEffect)(() => {
|
173
|
+
if (mounted) {
|
174
|
+
if (observerRef.current) {
|
175
|
+
observerRef.current.disconnect();
|
176
|
+
}
|
177
|
+
observerRef.current = createObserver();
|
178
|
+
setInitialized(true);
|
179
|
+
}
|
180
|
+
}, [mounted, createObserver]);
|
181
|
+
(0, import_react.useEffect)(() => {
|
182
|
+
setMounted(true);
|
183
|
+
return () => {
|
184
|
+
if (observerRef.current) {
|
185
|
+
observerRef.current.disconnect();
|
186
|
+
callbackMapRef.current.clear();
|
187
|
+
setInitialized(false);
|
188
|
+
}
|
189
|
+
};
|
190
|
+
}, []);
|
191
|
+
const contextValue = {
|
192
|
+
initialized,
|
193
|
+
register,
|
194
|
+
unregister
|
195
|
+
};
|
196
|
+
return /* @__PURE__ */ import_react.default.createElement(Provider, { value: contextValue }, children);
|
197
|
+
};
|
198
|
+
var useIntersectionTrigger = (elementRef, options = {}) => {
|
199
|
+
const { once = false, onHide, onShow } = options;
|
200
|
+
const { initialized, register, unregister } = (0, import_react.useContext)(
|
201
|
+
IntersectionObserverContext
|
202
|
+
);
|
203
|
+
const [isIntersecting, setIsIntersecting] = (0, import_react.useState)(false);
|
204
|
+
const cleanup = (0, import_react.useCallback)(
|
205
|
+
() => unregister({ ref: elementRef }),
|
206
|
+
[elementRef, unregister]
|
207
|
+
);
|
208
|
+
const intersectionCallback = (0, import_react.useCallback)(
|
209
|
+
(entry) => {
|
210
|
+
if (entry.isIntersecting) {
|
211
|
+
onShow == null ? void 0 : onShow(cleanup);
|
212
|
+
if (once) {
|
213
|
+
unregister({ ref: elementRef });
|
214
|
+
}
|
215
|
+
} else {
|
216
|
+
onHide == null ? void 0 : onHide(cleanup);
|
217
|
+
}
|
218
|
+
setIsIntersecting(entry.isIntersecting);
|
219
|
+
},
|
220
|
+
[onShow, onHide, once, cleanup, unregister, elementRef]
|
221
|
+
);
|
222
|
+
const registerRef = (0, import_react.useRef)();
|
223
|
+
registerRef.current = () => {
|
224
|
+
return register({
|
225
|
+
ref: elementRef,
|
226
|
+
callback: intersectionCallback
|
227
|
+
});
|
228
|
+
};
|
229
|
+
(0, import_react.useEffect)(() => {
|
230
|
+
var _a;
|
231
|
+
if (initialized) {
|
232
|
+
(_a = registerRef.current) == null ? void 0 : _a.call(registerRef);
|
233
|
+
}
|
234
|
+
return () => {
|
235
|
+
cleanup();
|
236
|
+
};
|
237
|
+
}, [initialized, cleanup]);
|
238
|
+
return { isIntersecting };
|
239
|
+
};
|
240
|
+
var IntersectionTrigger = ({
|
241
|
+
children,
|
242
|
+
className,
|
243
|
+
style = {},
|
244
|
+
...options
|
245
|
+
}) => {
|
246
|
+
const elementRef = (0, import_react.useRef)(null);
|
247
|
+
const { isIntersecting } = useIntersectionTrigger(elementRef, options);
|
248
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
249
|
+
"div",
|
250
|
+
{
|
251
|
+
className,
|
252
|
+
ref: elementRef,
|
253
|
+
style: {
|
254
|
+
width: "100%",
|
255
|
+
height: "100%",
|
256
|
+
...style
|
257
|
+
}
|
258
|
+
},
|
259
|
+
children
|
260
|
+
);
|
261
|
+
};
|
262
|
+
var IntersectionObserver_default = IntersectionObserverProvider;
|
263
|
+
// Annotate the CommonJS export names for ESM import in node:
|
264
|
+
0 && (module.exports = {
|
265
|
+
IntersectionObserverConsumer,
|
266
|
+
IntersectionObserverContext,
|
267
|
+
IntersectionObserverProvider,
|
268
|
+
IntersectionTrigger
|
269
|
+
});
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { TabsStructureProps, TabListContainerProps, TabItemProps, RailProps, SelectionIndicatorProps, ScrollShadowProps, ChevronControlsProps, ChevronButtonProps } from './types';
|
3
|
+
declare global {
|
4
|
+
interface WeakRef<T extends object> {
|
5
|
+
deref(): T | undefined;
|
6
|
+
}
|
7
|
+
interface WeakRefConstructor {
|
8
|
+
new <T extends object>(target: T): WeakRef<T>;
|
9
|
+
}
|
10
|
+
const WeakRef: WeakRefConstructor | undefined;
|
11
|
+
}
|
12
|
+
declare const TabListContainer: React.ForwardRefExoticComponent<Omit<TabListContainerProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
13
|
+
declare const TabItem: React.ForwardRefExoticComponent<Omit<TabItemProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
14
|
+
declare const Rail: React.ForwardRefExoticComponent<Omit<RailProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
15
|
+
declare const SelectionIndicator: React.ForwardRefExoticComponent<Omit<SelectionIndicatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
16
|
+
declare const ScrollShadow: React.ForwardRefExoticComponent<Omit<ScrollShadowProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
17
|
+
declare const ChevronButton: React.ForwardRefExoticComponent<Omit<ChevronButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
18
|
+
declare const ChevronControls: React.FC<ChevronControlsProps>;
|
19
|
+
declare type TabsStructureComponent = React.FC<TabsStructureProps> & {
|
20
|
+
Rail: typeof Rail;
|
21
|
+
ListContainer: typeof TabListContainer;
|
22
|
+
Item: typeof TabItem;
|
23
|
+
SelectionIndicator: typeof SelectionIndicator;
|
24
|
+
ScrollShadow: typeof ScrollShadow;
|
25
|
+
ChevronControls: typeof ChevronControls;
|
26
|
+
ChevronButton: typeof ChevronButton;
|
27
|
+
};
|
28
|
+
declare const TabsStructureWithSubComponents: TabsStructureComponent;
|
29
|
+
export default TabsStructureWithSubComponents;
|
30
|
+
export { TabListContainer, TabItem, Rail, SelectionIndicator, ScrollShadow, ChevronControls, ChevronButton, };
|