@pisell/materials 1.10.21 → 1.10.23
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 +16 -16
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +19 -19
- package/es/components/PisellCards/index.d.ts +1 -0
- package/es/components/PisellFields/index.d.ts +1 -0
- package/es/components/PisellLayouts/index.d.ts +1 -0
- package/es/components/PisellMetrics/index.d.ts +1 -0
- package/es/components/PisellSelectionFlow/PisellSelectionFlow.js +2 -3
- package/es/components/appVersionControl/types.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Radio/WithMode.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/es/components/drag-sort-tree/types.d.ts +1 -0
- package/es/components/filter/components/FilterButton/types.d.ts +1 -0
- package/es/components/input/index.d.ts +1 -0
- package/es/components/list/index.d.ts +1 -0
- package/es/components/page/dateLocale.js +33 -0
- package/es/components/page/index.d.ts +1 -0
- package/es/components/page/index.js +30 -4
- package/es/components/pisell-config-provider/context.d.ts +1 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +2 -1
- package/es/components/pisellFloorMapLayout/components/FigmaTableCard.d.ts +1 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapBuiltinShapeElement.d.ts +1 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapImageElement.d.ts +1 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +1 -0
- package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +22 -5
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +26 -3
- package/es/components/pisellGridPro/ToolBar/type.d.ts +1 -0
- package/es/components/pisellInput/index.d.ts +1 -0
- package/es/components/pisellMenu/types.d.ts +1 -0
- package/es/components/pisellQuickFilter/type.d.ts +1 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.d.ts +1 -0
- package/es/components/pisellReservationSchedule/PisellReservationSchedule.d.ts +1 -0
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.d.ts +1 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +1 -0
- package/es/components/pisellWalletPassCard/index.d.ts +2 -0
- package/es/components/pisellWalletPassCard/index.js +2 -2
- package/es/components/productCard/cartSkuCard/index.js +33 -3
- package/es/components/productCard/cartSkuCard/index.less +18 -0
- package/es/components/productCard/cartSkuCard/types.d.ts +56 -0
- package/es/components/productCard/cartSkuCard/variants/A12/index.js +126 -0
- package/es/components/productCard/cartSkuCard/variants/A12/index.less +279 -0
- package/es/components/productCard/lineItem/index.js +42 -11
- package/es/components/productCard/types.d.ts +4 -1
- package/es/components/section-footers/index.d.ts +1 -0
- package/es/components/virtual-keyboard/Amount/types.d.ts +1 -0
- package/es/index.d.ts +2 -1
- package/lib/components/PisellBasicGrid/PisellBasicGrid.d.ts +1 -0
- package/lib/components/PisellCards/components/GraphicTextCard/GraphicTextCard.d.ts +1 -0
- package/lib/components/PisellCards/components/PisellImageCard/PisellImageCard.d.ts +1 -0
- package/lib/components/PisellCards/components/TabCard/TabCard.d.ts +1 -0
- package/lib/components/PisellCards/components/TextCard/TextCard.d.ts +1 -0
- package/lib/components/PisellCards/index.d.ts +1 -0
- package/lib/components/PisellFields/index.d.ts +1 -0
- package/lib/components/PisellGroupView/PisellGroupView.d.ts +1 -0
- package/lib/components/PisellLayouts/index.d.ts +1 -0
- package/lib/components/PisellMetrics/index.d.ts +1 -0
- package/lib/components/PisellSelectionFlow/PisellSelectionFlow.js +2 -3
- package/lib/components/appVersionControl/index.d.ts +1 -0
- package/lib/components/appVersionControl/types.d.ts +1 -0
- package/lib/components/auto-complete-number/index.d.ts +1 -0
- package/lib/components/badge/index.d.ts +1 -0
- package/lib/components/batch-editor/index.d.ts +1 -0
- package/lib/components/calendar/index.d.ts +1 -0
- package/lib/components/cardPro/index.d.ts +1 -0
- package/lib/components/checkbox/index.d.ts +1 -0
- package/lib/components/classicLayout/index.d.ts +1 -0
- package/lib/components/config-provider/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Radio/WithMode.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/drag-sort-tree/index.d.ts +1 -0
- package/lib/components/drag-sort-tree/types.d.ts +1 -0
- package/lib/components/dropdown/index.d.ts +1 -0
- package/lib/components/filter/components/FilterButton/types.d.ts +1 -0
- package/lib/components/filter/index.d.ts +1 -0
- package/lib/components/input/index.d.ts +1 -0
- package/lib/components/list/index.d.ts +1 -0
- package/lib/components/lowCodePage/index.d.ts +1 -0
- package/lib/components/page/dateLocale.js +35 -0
- package/lib/components/page/index.d.ts +2 -0
- package/lib/components/page/index.js +33 -4
- package/lib/components/pisell-config-provider/context.d.ts +1 -0
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
- package/lib/components/pisellAdjustPrice/index.d.ts +1 -0
- package/lib/components/pisellCard/index.d.ts +1 -0
- package/lib/components/pisellDatePicker/index.d.ts +1 -0
- package/lib/components/pisellFilter/index.d.ts +1 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +2 -1
- package/lib/components/pisellFloorMapLayout/components/FigmaTableCard.d.ts +1 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapBuiltinShapeElement.d.ts +1 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapImageElement.d.ts +1 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +1 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +22 -5
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +26 -3
- package/lib/components/pisellGridPro/GridView/index.d.ts +1 -0
- package/lib/components/pisellGridPro/ToolBar/type.d.ts +1 -0
- package/lib/components/pisellInput/components/BankCard/index.d.ts +1 -0
- package/lib/components/pisellInput/components/Copy/index.d.ts +1 -0
- package/lib/components/pisellInput/components/SecurityCode/index.d.ts +1 -0
- package/lib/components/pisellInput/index.d.ts +1 -0
- package/lib/components/pisellLoading/index.d.ts +1 -0
- package/lib/components/pisellMenu/types.d.ts +1 -0
- package/lib/components/pisellQuickFilter/type.d.ts +1 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.d.ts +1 -0
- package/lib/components/pisellReservationSchedule/PisellReservationSchedule.d.ts +1 -0
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.d.ts +1 -0
- package/lib/components/pisellSort/index.d.ts +1 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +1 -0
- package/lib/components/pisellTooltip/index.d.ts +1 -0
- package/lib/components/pisellUpload/index.d.ts +1 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +2 -0
- package/lib/components/pisellWalletPassCard/index.js +2 -2
- package/lib/components/productCard/cartSkuCard/index.js +33 -3
- package/lib/components/productCard/cartSkuCard/index.less +18 -0
- package/lib/components/productCard/cartSkuCard/types.d.ts +56 -0
- package/lib/components/productCard/cartSkuCard/variants/A12/index.js +129 -0
- package/lib/components/productCard/cartSkuCard/variants/A12/index.less +279 -0
- package/lib/components/productCard/lineItem/index.js +42 -11
- package/lib/components/productCard/types.d.ts +4 -1
- package/lib/components/qrcode/index.d.ts +1 -0
- package/lib/components/radio/index.d.ts +1 -0
- package/lib/components/section-footers/index.d.ts +1 -0
- package/lib/components/segmented/index.d.ts +1 -0
- package/lib/components/select-time/index.d.ts +1 -0
- package/lib/components/skeleton/index.d.ts +1 -0
- package/lib/components/slider/index.d.ts +1 -0
- package/lib/components/time-picker/index.d.ts +1 -0
- package/lib/components/upload/index.d.ts +1 -0
- package/lib/components/versionSelect/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/Amount/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/Amount/types.d.ts +1 -0
- package/lib/components/virtual-keyboard/Number/index.d.ts +1 -0
- package/lib/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PisellBasicCardProps } from "./types.js";
|
|
2
3
|
import { ImageDataSource, ImageFillMode, PisellImageCardProps } from "./components/PisellImageCard/types.js";
|
|
3
4
|
import { GraphicConfig, GraphicTextCardProps, GraphicTextCardSize, GraphicTextCardVariant } from "./components/GraphicTextCard/types.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PisellBasicGridProps } from "../PisellBasicGrid/types.js";
|
|
2
3
|
import { PisellScrollViewProps, PisellScrollViewRef } from "../PisellScrollView/types.js";
|
|
3
4
|
import { FloorMapFullscreenMode, FloorMapItemBase, FloorMapLayoutContextValue, PisellFloorMapLayoutProps, PisellFloorMapLayoutRef } from "../pisellFloorMapLayout/types.js";
|
|
@@ -16,7 +16,7 @@ const createUnexpectedCompileError = (error) => {
|
|
|
16
16
|
};
|
|
17
17
|
const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialStepIndex = 0, hostContext, services, children, onDraftChange, onStepChange, onCompiledStepsChange, onValidationFailed, onConfigurationError, onComplete }, ref) => {
|
|
18
18
|
const mountedRef = useRef(true);
|
|
19
|
-
const flowGenerationRef = useRef(
|
|
19
|
+
const flowGenerationRef = useRef(1);
|
|
20
20
|
const draftRevisionRef = useRef(0);
|
|
21
21
|
const navigationRevisionRef = useRef(0);
|
|
22
22
|
const preparationRevisionRef = useRef(0);
|
|
@@ -69,8 +69,7 @@ const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialSte
|
|
|
69
69
|
params
|
|
70
70
|
}), []);
|
|
71
71
|
useEffect(() => {
|
|
72
|
-
const generation = flowGenerationRef.current
|
|
73
|
-
flowGenerationRef.current = generation;
|
|
72
|
+
const generation = flowGenerationRef.current;
|
|
74
73
|
mountedRef.current = true;
|
|
75
74
|
if (generation > 1) {
|
|
76
75
|
const nextModuleState = Object.fromEntries(Object.keys(moduleStateRef.current).map((moduleKey) => [moduleKey, { status: "idle" }]));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/components/page/dateLocale.ts
|
|
2
|
+
const COUNTRY_WEEK_STARTS_ON = {
|
|
3
|
+
US: 0,
|
|
4
|
+
CA: 0,
|
|
5
|
+
AU: 1,
|
|
6
|
+
NZ: 1,
|
|
7
|
+
SG: 0,
|
|
8
|
+
HK: 0,
|
|
9
|
+
TW: 0,
|
|
10
|
+
CN: 1,
|
|
11
|
+
JP: 0,
|
|
12
|
+
KR: 0,
|
|
13
|
+
MY: 1,
|
|
14
|
+
GB: 1,
|
|
15
|
+
FR: 1,
|
|
16
|
+
IT: 1
|
|
17
|
+
};
|
|
18
|
+
function normalizePageCountryCode(value) {
|
|
19
|
+
const countryCode = String(value !== null && value !== void 0 ? value : "").trim().toUpperCase();
|
|
20
|
+
return /^[A-Z]{2}$/.test(countryCode) ? countryCode : void 0;
|
|
21
|
+
}
|
|
22
|
+
/** Undefined tells Page to preserve its previous locale behaviour. */
|
|
23
|
+
function getPageWeekStartsOn(countryCode) {
|
|
24
|
+
const normalized = normalizePageCountryCode(countryCode);
|
|
25
|
+
return normalized ? COUNTRY_WEEK_STARTS_ON[normalized] : void 0;
|
|
26
|
+
}
|
|
27
|
+
function getPageEnglishAdapterLocale(countryCode) {
|
|
28
|
+
const weekStartsOn = getPageWeekStartsOn(countryCode);
|
|
29
|
+
if (weekStartsOn === void 0) return void 0;
|
|
30
|
+
return weekStartsOn === 1 ? "en-gb" : "en";
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { getPageEnglishAdapterLocale, getPageWeekStartsOn, normalizePageCountryCode };
|
|
@@ -5,25 +5,31 @@ import ConfigProvider$1 from "../config-provider/index.js";
|
|
|
5
5
|
import VariablesProvider from "../dataSourceComponents/provider/variables/VariablesProvider.js";
|
|
6
6
|
import PisellConfigProvider from "../pisell-config-provider/index.js";
|
|
7
7
|
import { getThemeConfig } from "../../theme/tokens.js";
|
|
8
|
+
import { getPageEnglishAdapterLocale, getPageWeekStartsOn, normalizePageCountryCode } from "./dateLocale.js";
|
|
8
9
|
import React, { useEffect, useMemo } from "react";
|
|
9
10
|
import { App } from "antd";
|
|
11
|
+
import dayjs from "dayjs";
|
|
10
12
|
import { LocaleProvider, LocalizationProvider, ThemeProvider, createTheme } from "@pisell/date-picker";
|
|
11
13
|
import zhCN from "antd/es/locale/zh_CN";
|
|
12
14
|
import { AdapterDayjs } from "@pisell/date-picker/es/AdapterDayjs";
|
|
13
15
|
import enUS from "antd/es/locale/en_US";
|
|
16
|
+
import enGB from "antd/es/locale/en_GB";
|
|
14
17
|
import zhTW from "antd/es/locale/zh_TW";
|
|
15
18
|
import zhHK from "antd/es/locale/zh_HK";
|
|
16
19
|
import jaJP from "antd/es/locale/ja_JP";
|
|
17
20
|
import ptPT from "antd/es/locale/pt_PT";
|
|
21
|
+
import enGbLocale from "dayjs/locale/en-gb";
|
|
18
22
|
//#region src/components/page/index.tsx
|
|
19
23
|
const _excluded = [
|
|
20
24
|
"children",
|
|
21
25
|
"style",
|
|
22
26
|
"className",
|
|
23
27
|
"locale",
|
|
28
|
+
"countryCode",
|
|
24
29
|
"variablesConfig",
|
|
25
30
|
"isRenderPisellConfigProvider"
|
|
26
31
|
];
|
|
32
|
+
dayjs.locale(enGbLocale, void 0, true);
|
|
27
33
|
const localMap = {
|
|
28
34
|
"zh-TW": zhTW,
|
|
29
35
|
"zh-CN": zhCN,
|
|
@@ -43,11 +49,31 @@ const localeDateMap = {
|
|
|
43
49
|
"pt": { adapterLocale: "pt" }
|
|
44
50
|
};
|
|
45
51
|
const Page = (props) => {
|
|
46
|
-
var _context$appHelper, _context$engine, _localeDateMap, _context$engine2;
|
|
47
|
-
const { children, style, className, locale: propsLocale, variablesConfig, isRenderPisellConfigProvider = true } = props, others = _objectWithoutProperties(props, _excluded);
|
|
52
|
+
var _context$appHelper, _context$engine, _context$appHelper2, _localeDateMap, _context$engine2;
|
|
53
|
+
const { children, style, className, locale: propsLocale, countryCode: propsCountryCode, variablesConfig, isRenderPisellConfigProvider = true } = props, others = _objectWithoutProperties(props, _excluded);
|
|
48
54
|
const context = useEngineContext();
|
|
49
55
|
const { platform, themeColor } = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.constants) || {};
|
|
50
56
|
const locale = propsLocale || (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || "en";
|
|
57
|
+
const utils = context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.utils;
|
|
58
|
+
let countryCode = normalizePageCountryCode(propsCountryCode);
|
|
59
|
+
try {
|
|
60
|
+
var _utils$getStore, _utils$getStore$getSt, _utils$store, _utils$store$getState, _utils$getApp, _utils$getApp$getStor, _utils$getApp$getStor2, _hostState$global, _utils$getData, _context$appHelper3, _context$appHelper4, _context$appHelper5;
|
|
61
|
+
const hostState = (utils === null || utils === void 0 || (_utils$getStore = utils.getStore) === null || _utils$getStore === void 0 || (_utils$getStore = _utils$getStore.call(utils)) === null || _utils$getStore === void 0 || (_utils$getStore$getSt = _utils$getStore.getState) === null || _utils$getStore$getSt === void 0 ? void 0 : _utils$getStore$getSt.call(_utils$getStore)) || (utils === null || utils === void 0 || (_utils$store = utils.store) === null || _utils$store === void 0 || (_utils$store$getState = _utils$store.getState) === null || _utils$store$getState === void 0 ? void 0 : _utils$store$getState.call(_utils$store));
|
|
62
|
+
const appCore = utils === null || utils === void 0 || (_utils$getApp = utils.getApp) === null || _utils$getApp === void 0 || (_utils$getApp = _utils$getApp.call(utils)) === null || _utils$getApp === void 0 || (_utils$getApp = _utils$getApp.data) === null || _utils$getApp === void 0 || (_utils$getApp = _utils$getApp.store) === null || _utils$getApp === void 0 || (_utils$getApp$getStor = _utils$getApp.getStore) === null || _utils$getApp$getStor === void 0 || (_utils$getApp$getStor = _utils$getApp$getStor.call(_utils$getApp)) === null || _utils$getApp$getStor === void 0 || (_utils$getApp$getStor2 = _utils$getApp$getStor.getDataByModel) === null || _utils$getApp$getStor2 === void 0 ? void 0 : _utils$getApp$getStor2.call(_utils$getApp$getStor, "core", "core");
|
|
63
|
+
countryCode = [
|
|
64
|
+
countryCode,
|
|
65
|
+
hostState === null || hostState === void 0 || (_hostState$global = hostState.global) === null || _hostState$global === void 0 || (_hostState$global = _hostState$global.shopDetail) === null || _hostState$global === void 0 ? void 0 : _hostState$global.country_code,
|
|
66
|
+
utils === null || utils === void 0 || (_utils$getData = utils.getData) === null || _utils$getData === void 0 || (_utils$getData = _utils$getData.call(utils, "shop_info")) === null || _utils$getData === void 0 ? void 0 : _utils$getData.country_code,
|
|
67
|
+
appCore === null || appCore === void 0 ? void 0 : appCore.country_code,
|
|
68
|
+
context === null || context === void 0 || (_context$appHelper3 = context.appHelper) === null || _context$appHelper3 === void 0 || (_context$appHelper3 = _context$appHelper3.constants) === null || _context$appHelper3 === void 0 ? void 0 : _context$appHelper3.countryCode,
|
|
69
|
+
context === null || context === void 0 || (_context$appHelper4 = context.appHelper) === null || _context$appHelper4 === void 0 || (_context$appHelper4 = _context$appHelper4.constants) === null || _context$appHelper4 === void 0 ? void 0 : _context$appHelper4.country_code,
|
|
70
|
+
context === null || context === void 0 || (_context$appHelper5 = context.appHelper) === null || _context$appHelper5 === void 0 || (_context$appHelper5 = _context$appHelper5.constants) === null || _context$appHelper5 === void 0 ? void 0 : _context$appHelper5.country
|
|
71
|
+
].map(normalizePageCountryCode).find((candidate) => candidate !== void 0);
|
|
72
|
+
} catch (_unused) {}
|
|
73
|
+
const englishAdapterLocale = getPageEnglishAdapterLocale(countryCode);
|
|
74
|
+
const weekStartsOn = getPageWeekStartsOn(countryCode);
|
|
75
|
+
const isEnglish = String(locale).toLowerCase().startsWith("en");
|
|
76
|
+
const antdLocale = isEnglish && weekStartsOn !== void 0 ? weekStartsOn === 1 ? enGB : enUS : localMap[locale];
|
|
51
77
|
const theme = useMemo(() => {
|
|
52
78
|
if (props === null || props === void 0 ? void 0 : props.theme) {
|
|
53
79
|
var _props$theme;
|
|
@@ -64,7 +90,7 @@ const Page = (props) => {
|
|
|
64
90
|
document.body.id = "body";
|
|
65
91
|
}, []);
|
|
66
92
|
return /* @__PURE__ */ React.createElement(ConfigProvider$1, _objectSpread2(_objectSpread2({}, others), {}, {
|
|
67
|
-
locale:
|
|
93
|
+
locale: antdLocale,
|
|
68
94
|
prefixCls: props.prefixCls || "pisell-lowcode",
|
|
69
95
|
theme
|
|
70
96
|
}), /* @__PURE__ */ React.createElement(App, {
|
|
@@ -72,7 +98,7 @@ const Page = (props) => {
|
|
|
72
98
|
message: { maxCount: 1 }
|
|
73
99
|
}, /* @__PURE__ */ React.createElement(LocalizationProvider, {
|
|
74
100
|
dateAdapter: AdapterDayjs,
|
|
75
|
-
adapterLocale: (localeDateMap === null || localeDateMap === void 0 || (_localeDateMap = localeDateMap[locale]) === null || _localeDateMap === void 0 ? void 0 : _localeDateMap.adapterLocale) || "en"
|
|
101
|
+
adapterLocale: isEnglish && englishAdapterLocale || (localeDateMap === null || localeDateMap === void 0 || (_localeDateMap = localeDateMap[locale]) === null || _localeDateMap === void 0 ? void 0 : _localeDateMap.adapterLocale) || "en"
|
|
76
102
|
}, /* @__PURE__ */ React.createElement(ThemeProvider, { theme: datePickerTheme }, /* @__PURE__ */ React.createElement(LocaleProvider, { value: { locale } }, /* @__PURE__ */ React.createElement(PisellConfigProvid, { locale }, /* @__PURE__ */ React.createElement(VariablesProvider, {
|
|
77
103
|
variables: ((_context$engine2 = context.engine) === null || _context$engine2 === void 0 || (_context$engine2 = _context$engine2.props) === null || _context$engine2 === void 0 ? void 0 : _context$engine2.variables) || {},
|
|
78
104
|
config: variablesConfig
|
|
@@ -314,7 +314,7 @@ function PisellFloorMapLayoutInner(props, ref) {
|
|
|
314
314
|
shape: "rect"
|
|
315
315
|
}];
|
|
316
316
|
}, [overviewLayout]);
|
|
317
|
-
const { containerRef, mapAreaRef, mapAreaSize, contentWidth, contentHeight, contentOffsetX, contentOffsetY, initialPositionX, initialPositionY, zoomConfig, scale, setScale, isFullscreen, toggleFullscreen, fitBounds, focusContentBounds, isAtFitBounds, notifyTransformed, persistCurrentViewport, attachTransformContext, isInteractingWithElement, setIsInteractingWithElement, viewportLocked, toggleViewportLocked } = useFloorMapTransformMetrics({
|
|
317
|
+
const { containerRef, mapAreaRef, mapAreaSize, contentWidth, contentHeight, contentOffsetX, contentOffsetY, initialPositionX, initialPositionY, zoomConfig, scale, setScale, isFullscreen, toggleFullscreen, fitBounds, focusContentBounds, isAtFitBounds, notifyTransformed, persistCurrentViewport, markViewportControlInteraction, attachTransformContext, isInteractingWithElement, setIsInteractingWithElement, viewportLocked, toggleViewportLocked } = useFloorMapTransformMetrics({
|
|
318
318
|
items: isOverview && overviewLayout ? overviewMetricsItems : items,
|
|
319
319
|
cellSize,
|
|
320
320
|
itemGap: isOverview ? 0 : itemGap,
|
|
@@ -1042,6 +1042,7 @@ function PisellFloorMapLayoutInner(props, ref) {
|
|
|
1042
1042
|
isFullscreen,
|
|
1043
1043
|
fitBoundsActive: isAtFitBounds,
|
|
1044
1044
|
fitBounds,
|
|
1045
|
+
onViewportControlStart: markViewportControlInteraction,
|
|
1045
1046
|
toggleFullscreen: dockToggleFullscreen,
|
|
1046
1047
|
mapGridVisible: isOverview ? false : Boolean(effectiveMapLayer === null || effectiveMapLayer === void 0 ? void 0 : effectiveMapLayer.showGrid),
|
|
1047
1048
|
onToggleMapGrid: isFloorMapView && !isOverview ? toggleDraftCanvasShowGrid : void 0,
|
|
@@ -8,17 +8,34 @@ import { useControls } from "react-zoom-pan-pinch";
|
|
|
8
8
|
function ViewControlsWithZoom(props) {
|
|
9
9
|
const { zoomIn, zoomOut, resetTransform } = useControls();
|
|
10
10
|
const api = useMemo(() => ({
|
|
11
|
-
zoomIn
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
zoomIn: () => {
|
|
12
|
+
var _props$onViewportCont;
|
|
13
|
+
(_props$onViewportCont = props.onViewportControlStart) === null || _props$onViewportCont === void 0 || _props$onViewportCont.call(props);
|
|
14
|
+
zoomIn();
|
|
15
|
+
},
|
|
16
|
+
zoomOut: () => {
|
|
17
|
+
var _props$onViewportCont2;
|
|
18
|
+
(_props$onViewportCont2 = props.onViewportControlStart) === null || _props$onViewportCont2 === void 0 || _props$onViewportCont2.call(props);
|
|
19
|
+
zoomOut();
|
|
20
|
+
},
|
|
21
|
+
resetTransform: () => {
|
|
22
|
+
var _props$onViewportCont3;
|
|
23
|
+
(_props$onViewportCont3 = props.onViewportControlStart) === null || _props$onViewportCont3 === void 0 || _props$onViewportCont3.call(props);
|
|
24
|
+
resetTransform();
|
|
25
|
+
},
|
|
26
|
+
fitBounds: () => {
|
|
27
|
+
var _props$onViewportCont4;
|
|
28
|
+
(_props$onViewportCont4 = props.onViewportControlStart) === null || _props$onViewportCont4 === void 0 || _props$onViewportCont4.call(props);
|
|
29
|
+
props.fitBounds();
|
|
30
|
+
},
|
|
15
31
|
toggleFullscreen: props.toggleFullscreen
|
|
16
32
|
}), [
|
|
17
33
|
zoomIn,
|
|
18
34
|
zoomOut,
|
|
19
35
|
resetTransform,
|
|
20
36
|
props.fitBounds,
|
|
21
|
-
props.toggleFullscreen
|
|
37
|
+
props.toggleFullscreen,
|
|
38
|
+
props.onViewportControlStart
|
|
22
39
|
]);
|
|
23
40
|
return /* @__PURE__ */ React.createElement(ViewControls, {
|
|
24
41
|
api,
|
|
@@ -535,8 +535,11 @@ function useFloorMapTransformMetrics(params) {
|
|
|
535
535
|
persistKeyRef.current = viewportPersistKey;
|
|
536
536
|
const persistTimerRef = useRef(null);
|
|
537
537
|
const flushPersistRef = useRef(null);
|
|
538
|
-
|
|
539
|
-
|
|
538
|
+
/** Dock 按钮触发的是程序化动画,快速切画布时 onZoomStop 可能来不及触发。 */
|
|
539
|
+
const viewportControlPersistKeyRef = useRef();
|
|
540
|
+
const viewportControlTimerRef = useRef(null);
|
|
541
|
+
const schedulePersistViewport = useCallback((snapshot, explicitKey) => {
|
|
542
|
+
const key = explicitKey !== null && explicitKey !== void 0 ? explicitKey : persistKeyRef.current;
|
|
540
543
|
if (!key) return;
|
|
541
544
|
if (persistTimerRef.current != null) {
|
|
542
545
|
clearTimeout(persistTimerRef.current);
|
|
@@ -551,6 +554,14 @@ function useFloorMapTransformMetrics(params) {
|
|
|
551
554
|
flushPersistRef.current = doWrite;
|
|
552
555
|
persistTimerRef.current = setTimeout(doWrite, 300);
|
|
553
556
|
}, []);
|
|
557
|
+
const markViewportControlInteraction = useCallback(() => {
|
|
558
|
+
viewportControlPersistKeyRef.current = persistKeyRef.current;
|
|
559
|
+
if (viewportControlTimerRef.current != null) clearTimeout(viewportControlTimerRef.current);
|
|
560
|
+
viewportControlTimerRef.current = setTimeout(() => {
|
|
561
|
+
viewportControlTimerRef.current = null;
|
|
562
|
+
viewportControlPersistKeyRef.current = void 0;
|
|
563
|
+
}, FIT_BOUNDS_PROGRAMMATIC_TWEEN_GUARD_MS);
|
|
564
|
+
}, []);
|
|
554
565
|
/**
|
|
555
566
|
* 由 onTransformed 回调统一上报当前 transform:
|
|
556
567
|
* - 写 lastTransformRef(替代父组件直接赋值)
|
|
@@ -569,6 +580,12 @@ function useFloorMapTransformMetrics(params) {
|
|
|
569
580
|
y,
|
|
570
581
|
scale: nextScale
|
|
571
582
|
};
|
|
583
|
+
const controlKey = viewportControlPersistKeyRef.current;
|
|
584
|
+
if (controlKey) schedulePersistViewport({
|
|
585
|
+
x,
|
|
586
|
+
y,
|
|
587
|
+
scale: nextScale
|
|
588
|
+
}, controlKey);
|
|
572
589
|
const snap = lastFitSnapshotRef.current;
|
|
573
590
|
if (snap) {
|
|
574
591
|
const same = Math.abs(snap.x - x) < .5 && Math.abs(snap.y - y) < .5 && Math.abs(snap.scale - nextScale) < .005;
|
|
@@ -582,7 +599,7 @@ function useFloorMapTransformMetrics(params) {
|
|
|
582
599
|
}
|
|
583
600
|
setIsAtFitBounds((prev) => prev === same ? prev : same);
|
|
584
601
|
} else setIsAtFitBounds((prev) => prev ? false : prev);
|
|
585
|
-
}, [clearFitBoundsTweenHold]);
|
|
602
|
+
}, [clearFitBoundsTweenHold, schedulePersistViewport]);
|
|
586
603
|
/**
|
|
587
604
|
* 用户交互结束时(pan / zoom / pinch / wheel stop)调用:
|
|
588
605
|
* 以 lastTransformRef 当前值为快照写 localStorage(debounce 兜底高频 stop)。
|
|
@@ -717,6 +734,11 @@ function useFloorMapTransformMetrics(params) {
|
|
|
717
734
|
useEffect(() => {
|
|
718
735
|
return () => {
|
|
719
736
|
var _flushPersistRef$curr;
|
|
737
|
+
if (viewportControlTimerRef.current != null) {
|
|
738
|
+
clearTimeout(viewportControlTimerRef.current);
|
|
739
|
+
viewportControlTimerRef.current = null;
|
|
740
|
+
}
|
|
741
|
+
viewportControlPersistKeyRef.current = void 0;
|
|
720
742
|
if (persistTimerRef.current != null) {
|
|
721
743
|
clearTimeout(persistTimerRef.current);
|
|
722
744
|
persistTimerRef.current = null;
|
|
@@ -750,6 +772,7 @@ function useFloorMapTransformMetrics(params) {
|
|
|
750
772
|
isAtFitBounds,
|
|
751
773
|
notifyTransformed,
|
|
752
774
|
persistCurrentViewport,
|
|
775
|
+
markViewportControlInteraction,
|
|
753
776
|
attachTransformContext,
|
|
754
777
|
lastTransformRef,
|
|
755
778
|
isInteractingWithElement,
|
|
@@ -39,7 +39,7 @@ const PisellWalletPassCard = (props) => {
|
|
|
39
39
|
if (pressTimer) clearTimeout(pressTimer);
|
|
40
40
|
};
|
|
41
41
|
}, [pressTimer]);
|
|
42
|
-
const { id, type, code, qrCode, balance, disabledReason, name, storeName, redeem, validDate, disabled, active = false, cover, balanceTitle, redeemTitle, showCover = true, showDetail = true, showBalance = true, showRedeem = true, showName = true, showCode = true, showStoreName = true, showValidDate = true, showQrCode = true, showBalanceSymbol = true, showDisabledReason = true, showDiscount = false, discount, showActions, actions, beforeEdit, onBeforeEditAmount, onConfirmEdit, onConfirmEditAmount, onDetail, useExternalDetail = false, originData, style = {}, mode = "multiple", showActiveIcon, enableEditAmount, showStatus, cardStatus, nameTitleStyle, formatBalance, formatBalanceTitle, formatRedeem, formatRedeemTitle, maxRedeem, showHolderName = true, holder, onSetHolder, validDateBySchedule, scheduleList } = props;
|
|
42
|
+
const { id, type, code, qrCode, balance, formattedBalance, disabledReason, name, storeName, redeem, validDate, disabled, active = false, cover, balanceTitle, redeemTitle, showCover = true, showDetail = true, showBalance = true, showRedeem = true, showName = true, showCode = true, showStoreName = true, showValidDate = true, showQrCode = true, showBalanceSymbol = true, showDisabledReason = true, showDiscount = false, discount, showActions, actions, beforeEdit, onBeforeEditAmount, onConfirmEdit, onConfirmEditAmount, onDetail, useExternalDetail = false, originData, style = {}, mode = "multiple", showActiveIcon, enableEditAmount, showStatus, cardStatus, nameTitleStyle, formatBalance, formatBalanceTitle, formatRedeem, formatRedeemTitle, maxRedeem, showHolderName = true, holder, onSetHolder, validDateBySchedule, scheduleList } = props;
|
|
43
43
|
useEffect(() => {
|
|
44
44
|
document.body.id = "body";
|
|
45
45
|
}, []);
|
|
@@ -267,7 +267,7 @@ const PisellWalletPassCard = (props) => {
|
|
|
267
267
|
active,
|
|
268
268
|
data: props
|
|
269
269
|
}) : balanceTitle || getText("pisell-wallet-pass-card-balance"), disabled || isMini ? ": " : "");
|
|
270
|
-
const createOriginalBalanceDom = () => /* @__PURE__ */ React.createElement(Amount, {
|
|
270
|
+
const createOriginalBalanceDom = () => formattedBalance !== void 0 ? /* @__PURE__ */ React.createElement("span", { className: "pisell-card-amount-item-value" }, formattedBalance) : /* @__PURE__ */ React.createElement(Amount, {
|
|
271
271
|
className: "pisell-card-amount-item-value",
|
|
272
272
|
useThousandsSeparator: true,
|
|
273
273
|
value: balance,
|
|
@@ -19,6 +19,7 @@ import Promotion from "./components/Promotion/index.js";
|
|
|
19
19
|
import Gift from "./components/Gift/index.js";
|
|
20
20
|
import BookingItem from "./components/BookingItem/index.js";
|
|
21
21
|
import InlineActions from "./components/inlineActions/index.js";
|
|
22
|
+
import A12 from "./variants/A12/index.js";
|
|
22
23
|
import React, { useMemo, useRef } from "react";
|
|
23
24
|
import { locales } from "@pisell/utils";
|
|
24
25
|
import classNames from "classnames";
|
|
@@ -56,12 +57,14 @@ const _excluded = [
|
|
|
56
57
|
"rightActionsDisplay",
|
|
57
58
|
"escapeDom",
|
|
58
59
|
"maxSpecsCount",
|
|
59
|
-
"isShowRelatedProduct"
|
|
60
|
+
"isShowRelatedProduct",
|
|
61
|
+
"a12Slots",
|
|
62
|
+
"a12Presentation"
|
|
60
63
|
];
|
|
61
64
|
const PREFIX = "pisell-cart-sku-card";
|
|
62
65
|
const CartSkuCard = (props) => {
|
|
63
66
|
var _context$appHelper$ut;
|
|
64
|
-
const { dataSource = defaultValue.dataSource, isShowImage = defaultValue.isShowImage, isShowQuantityBadge = true, isShowOriginalPrice = defaultValue.isShowOriginalPrice, isShowHolder = defaultValue.isShowHolder, isShowNote = defaultValue.isShowNote, isShowDelete = defaultValue.isShowDelete, isShowInlineDelete = isShowDelete, isShowAmountFooter = defaultValue.isShowAmountFooter, isShowPackageNote = defaultValue.isShowPackageNote, isShowEditProduct = defaultValue.isShowEditProduct, disabledClick = defaultValue.disabledClick, disabledEditClick = defaultValue.disabledEditClick, disabledNoteEdit, externalNoteEditor = false, onEditProduct, onAction, onDelete, onNote, onLike, onCard, onChangeResource, onPromotion, onGift, onChangeHolder, itemType = "product", type, rightActions = [], rightActionsDisplay = "swipe", escapeDom, maxSpecsCount = 1, isShowRelatedProduct = true } = props, other = _objectWithoutProperties(props, _excluded);
|
|
67
|
+
const { dataSource = defaultValue.dataSource, isShowImage = defaultValue.isShowImage, isShowQuantityBadge = true, isShowOriginalPrice = defaultValue.isShowOriginalPrice, isShowHolder = defaultValue.isShowHolder, isShowNote = defaultValue.isShowNote, isShowDelete = defaultValue.isShowDelete, isShowInlineDelete = isShowDelete, isShowAmountFooter = defaultValue.isShowAmountFooter, isShowPackageNote = defaultValue.isShowPackageNote, isShowEditProduct = defaultValue.isShowEditProduct, disabledClick = defaultValue.disabledClick, disabledEditClick = defaultValue.disabledEditClick, disabledNoteEdit, externalNoteEditor = false, onEditProduct, onAction, onDelete, onNote, onLike, onCard, onChangeResource, onPromotion, onGift, onChangeHolder, itemType = "product", type, rightActions = [], rightActionsDisplay = "swipe", escapeDom, maxSpecsCount = 1, isShowRelatedProduct = true, a12Slots, a12Presentation } = props, other = _objectWithoutProperties(props, _excluded);
|
|
65
68
|
const useOpenNoteRef = useRef();
|
|
66
69
|
const context = useEngineContext();
|
|
67
70
|
locales.init(locales_default, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get("umi_locale")) || "en");
|
|
@@ -219,13 +222,37 @@ const CartSkuCard = (props) => {
|
|
|
219
222
|
openNote: openNoteEditor
|
|
220
223
|
})) : null);
|
|
221
224
|
};
|
|
225
|
+
const renderA12 = () => {
|
|
226
|
+
var _a12Slots$contentFoot;
|
|
227
|
+
const note = isShowNote ? /* @__PURE__ */ React.createElement(Note, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
228
|
+
item: dataSource,
|
|
229
|
+
disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
|
|
230
|
+
openNote: openNoteEditor
|
|
231
|
+
})) : null;
|
|
232
|
+
const slots = note ? _objectSpread2(_objectSpread2({}, a12Slots), {}, { contentFooter: (_a12Slots$contentFoot = a12Slots === null || a12Slots === void 0 ? void 0 : a12Slots.contentFooter) !== null && _a12Slots$contentFoot !== void 0 ? _a12Slots$contentFoot : (() => note) }) : a12Slots;
|
|
233
|
+
return /* @__PURE__ */ React.createElement(A12, {
|
|
234
|
+
dataSource,
|
|
235
|
+
isShowImage,
|
|
236
|
+
isShowDelete,
|
|
237
|
+
isShowOriginalPrice,
|
|
238
|
+
isShowEditProduct,
|
|
239
|
+
disabled: Boolean(disabledClick),
|
|
240
|
+
disabledEditClick,
|
|
241
|
+
slots,
|
|
242
|
+
presentation: a12Presentation,
|
|
243
|
+
onDelete,
|
|
244
|
+
onEditProduct
|
|
245
|
+
});
|
|
246
|
+
};
|
|
222
247
|
const renderContent = () => {
|
|
248
|
+
if (type === "a12") return renderA12();
|
|
223
249
|
if (type === "a9") return renderA9();
|
|
224
250
|
if (type === "a5") return renderA5();
|
|
225
251
|
return renderA2();
|
|
226
252
|
};
|
|
227
253
|
if (dataSource === null || dataSource === void 0 ? void 0 : dataSource.isGift) return null;
|
|
228
254
|
const content = renderContent();
|
|
255
|
+
const useIntegratedWrapper = type === "a12" || rightActionsDisplay === "inline";
|
|
229
256
|
const cardContent = /* @__PURE__ */ React.createElement("div", {
|
|
230
257
|
className: classNames(PREFIX, `${PREFIX}--${type}`),
|
|
231
258
|
onClick: (e) => {
|
|
@@ -239,7 +266,10 @@ const CartSkuCard = (props) => {
|
|
|
239
266
|
isShowRelatedProduct,
|
|
240
267
|
isShowDelete
|
|
241
268
|
}, content) : content);
|
|
242
|
-
return /* @__PURE__ */ React.createElement("div", { className: classNames(`${PREFIX}-wrapper-container`, {
|
|
269
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames(`${PREFIX}-wrapper-container`, {
|
|
270
|
+
[`${PREFIX}-wrapper-container--inline`]: useIntegratedWrapper,
|
|
271
|
+
[`${PREFIX}-wrapper-container--a12`]: type === "a12"
|
|
272
|
+
}) }, useIntegratedWrapper ? /* @__PURE__ */ React.createElement("div", { className: classNames(`${PREFIX}-wrapper`, `${PREFIX}-wrapper--inline`, type === "a12" && `pisell-cart-sku-card-wrapper--a12`) }, cardContent) : /* @__PURE__ */ React.createElement(SwipeAction, {
|
|
243
273
|
closeOnAction: false,
|
|
244
274
|
className: classNames(`${PREFIX}-wrapper`),
|
|
245
275
|
rightActions: _rightActions,
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
width: 100%;
|
|
4
4
|
min-width: 0;
|
|
5
5
|
}
|
|
6
|
+
|
|
7
|
+
&--a12 {
|
|
8
|
+
container-type: inline-size;
|
|
9
|
+
}
|
|
6
10
|
}
|
|
7
11
|
|
|
8
12
|
.pisell-cart-sku-card-wrapper {
|
|
@@ -15,6 +19,14 @@
|
|
|
15
19
|
width: 100%;
|
|
16
20
|
overflow: hidden;
|
|
17
21
|
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
&--a12 {
|
|
25
|
+
border: 0;
|
|
26
|
+
border-radius: 18px;
|
|
27
|
+
background: transparent;
|
|
28
|
+
overflow: visible;
|
|
29
|
+
}
|
|
18
30
|
}
|
|
19
31
|
|
|
20
32
|
.pisell-cart-sku-card__main-row {
|
|
@@ -51,6 +63,12 @@
|
|
|
51
63
|
cursor: pointer;
|
|
52
64
|
}
|
|
53
65
|
|
|
66
|
+
&--a12 {
|
|
67
|
+
display: block;
|
|
68
|
+
padding: 0;
|
|
69
|
+
gap: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
54
72
|
&__delete-btn {
|
|
55
73
|
cursor: pointer;
|
|
56
74
|
position: absolute;
|