@pisell/private-materials 6.3.32 → 6.3.34
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 +151 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +23 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -8
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +1 -2
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/es/components/walletList/index.d.ts +0 -25
- package/es/components/walletList/index.js +98 -66
- package/es/components/walletList/serve.d.ts +4 -0
- package/es/components/walletList/serve.js +46 -13
- package/es/components/walletList/types/index.d.ts +12 -12
- package/es/components/walletList/types/index.js +2 -2
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/plus/productSelect/CategoryTabs/index.d.ts +2 -0
- package/es/plus/productSelect/CategoryTabs/index.js +6 -3
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.less +0 -11
- package/es/plus/productSelect/utils.js +0 -1
- package/es/plus/walletEditor/WalletEditor.d.ts +5 -0
- package/es/plus/walletEditor/WalletEditor.js +316 -0
- package/es/plus/walletEditor/WalletEditor.less +129 -0
- package/es/plus/walletEditor/components/ImageUpload/index.d.ts +8 -0
- package/es/plus/walletEditor/components/ImageUpload/index.js +223 -0
- package/es/plus/walletEditor/components/JsonEditor/index.d.ts +11 -0
- package/es/plus/walletEditor/components/JsonEditor/index.js +68 -0
- package/es/plus/walletEditor/components/JsonEditor/index.less +4 -0
- package/es/plus/walletEditor/components/ValidityPeriodSelector/index.d.ts +20 -0
- package/es/plus/walletEditor/components/ValidityPeriodSelector/index.js +222 -0
- package/es/plus/walletEditor/components/ValidityPeriodSelector/index.less +4 -0
- package/es/plus/walletEditor/components/relationProduct/index.d.ts +6 -0
- package/es/plus/walletEditor/components/relationProduct/index.js +49 -0
- package/es/plus/walletEditor/components/relationProduct/index.less +15 -0
- package/es/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +37 -0
- package/es/plus/walletEditor/components/sortableWalletPassTypes/index.js +193 -0
- package/es/plus/walletEditor/components/sortableWalletPassTypes/index.less +110 -0
- package/es/plus/walletEditor/index.d.ts +3 -0
- package/es/plus/walletEditor/index.js +3 -0
- package/es/plus/walletEditor/locales.d.ts +126 -0
- package/es/plus/walletEditor/locales.js +143 -0
- package/es/plus/walletEditor/types.d.ts +52 -0
- package/es/plus/walletEditor/types.js +1 -0
- package/es/plus/walletPassGallery/components/footerButton/index.d.ts +14 -0
- package/es/plus/walletPassGallery/components/footerButton/index.js +247 -0
- package/es/plus/walletPassGallery/components/footerButton/index.less +93 -0
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +8 -0
- package/es/plus/walletPassGallery/components/passDetail/index.js +274 -0
- package/es/plus/walletPassGallery/components/passDetail/index.less +57 -0
- package/es/plus/walletPassGallery/components/passList/index.d.ts +11 -0
- package/es/plus/walletPassGallery/components/passList/index.js +115 -0
- package/es/plus/walletPassGallery/components/recharge/index.d.ts +11 -0
- package/es/plus/walletPassGallery/components/recharge/index.js +134 -0
- package/es/plus/walletPassGallery/components/recharge/index.less +16 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +8 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.js +176 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.less +67 -0
- package/es/plus/walletPassGallery/components/usageRule/index.d.ts +9 -0
- package/es/plus/walletPassGallery/components/usageRule/index.js +248 -0
- package/es/plus/walletPassGallery/components/usageRule/index.less +157 -0
- package/es/plus/walletPassGallery/index.d.ts +6 -0
- package/es/plus/walletPassGallery/index.js +602 -0
- package/es/plus/walletPassGallery/index.less +115 -0
- package/es/plus/walletPassGallery/locales.d.ts +270 -0
- package/es/plus/walletPassGallery/locales.js +279 -0
- package/es/plus/walletPassGallery/serve.d.ts +218 -0
- package/es/plus/walletPassGallery/serve.js +289 -0
- package/es/pro/Login2.0/AuthModal.js +14 -8
- package/es/pro/Login2.0/Login2.js +52 -28
- package/es/pro/Login2.0/Register2.js +1 -1
- package/es/pro/Login2.0/components/phoneValidation.js +1 -1
- package/es/pro/Login2.0/index.less +11 -2
- package/es/pro/Login2.0/locales.js +112 -112
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/index.d.ts +1 -2
- package/lib/components/index.js +0 -3
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/lib/components/walletList/index.d.ts +0 -25
- package/lib/components/walletList/index.js +90 -51
- package/lib/components/walletList/serve.d.ts +4 -0
- package/lib/components/walletList/serve.js +12 -0
- package/lib/components/walletList/types/index.d.ts +12 -12
- package/lib/index.d.ts +2 -1
- package/lib/index.js +6 -3
- package/lib/plus/productSelect/CategoryTabs/index.d.ts +2 -0
- package/lib/plus/productSelect/CategoryTabs/index.js +84 -69
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.less +0 -11
- package/lib/plus/productSelect/utils.js +0 -1
- package/lib/plus/walletEditor/WalletEditor.d.ts +5 -0
- package/lib/plus/walletEditor/WalletEditor.js +354 -0
- package/lib/plus/walletEditor/WalletEditor.less +129 -0
- package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +8 -0
- package/lib/plus/walletEditor/components/ImageUpload/index.js +201 -0
- package/lib/plus/walletEditor/components/JsonEditor/index.d.ts +11 -0
- package/lib/plus/walletEditor/components/JsonEditor/index.js +89 -0
- package/lib/plus/walletEditor/components/JsonEditor/index.less +4 -0
- package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.d.ts +20 -0
- package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.js +176 -0
- package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.less +4 -0
- package/lib/plus/walletEditor/components/relationProduct/index.d.ts +6 -0
- package/lib/plus/walletEditor/components/relationProduct/index.js +73 -0
- package/lib/plus/walletEditor/components/relationProduct/index.less +15 -0
- package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +37 -0
- package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.js +211 -0
- package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.less +110 -0
- package/lib/plus/walletEditor/index.d.ts +3 -0
- package/lib/plus/walletEditor/index.js +42 -0
- package/lib/plus/walletEditor/locales.d.ts +126 -0
- package/lib/plus/walletEditor/locales.js +167 -0
- package/lib/plus/walletEditor/types.d.ts +52 -0
- package/lib/plus/walletEditor/types.js +17 -0
- package/lib/plus/walletPassGallery/components/footerButton/index.d.ts +14 -0
- package/lib/plus/walletPassGallery/components/footerButton/index.js +187 -0
- package/lib/plus/walletPassGallery/components/footerButton/index.less +93 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +8 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.js +287 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.less +57 -0
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +11 -0
- package/lib/plus/walletPassGallery/components/passList/index.js +136 -0
- package/lib/plus/walletPassGallery/components/recharge/index.d.ts +11 -0
- package/lib/plus/walletPassGallery/components/recharge/index.js +146 -0
- package/lib/plus/walletPassGallery/components/recharge/index.less +16 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +8 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.js +212 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.less +67 -0
- package/lib/plus/walletPassGallery/components/usageRule/index.d.ts +9 -0
- package/lib/plus/walletPassGallery/components/usageRule/index.js +209 -0
- package/lib/plus/walletPassGallery/components/usageRule/index.less +157 -0
- package/lib/plus/walletPassGallery/index.d.ts +6 -0
- package/lib/plus/walletPassGallery/index.js +498 -0
- package/lib/plus/walletPassGallery/index.less +115 -0
- package/lib/plus/walletPassGallery/locales.d.ts +270 -0
- package/lib/plus/walletPassGallery/locales.js +299 -0
- package/lib/plus/walletPassGallery/serve.d.ts +218 -0
- package/lib/plus/walletPassGallery/serve.js +98 -0
- package/lib/pro/Login2.0/AuthModal.js +16 -11
- package/lib/pro/Login2.0/Login2.js +14 -4
- package/lib/pro/Login2.0/Register2.js +1 -1
- package/lib/pro/Login2.0/components/phoneValidation.js +1 -1
- package/lib/pro/Login2.0/index.less +11 -2
- package/lib/pro/Login2.0/locales.js +112 -112
- package/lowcode/sortable-wallet-pass-types/meta.ts +267 -0
- package/lowcode/wallet-editor/meta.ts +57 -0
- package/lowcode/wallet-editor/snippets.ts +13 -0
- package/lowcode/wallet-pass-gallery/meta.ts +35 -0
- package/package.json +4 -4
- package/lowcode/wallet/meta.ts +0 -79
|
@@ -40,7 +40,15 @@ var import_TabsStructure2 = require("../components/TabsStructure/TabsStructure.l
|
|
|
40
40
|
var import_CategorySkeleton = __toESM(require("./CategorySkeleton"));
|
|
41
41
|
var import__ = require("../index");
|
|
42
42
|
var CategoryTabs = (0, import_react.forwardRef)((props, ref) => {
|
|
43
|
-
const {
|
|
43
|
+
const {
|
|
44
|
+
className,
|
|
45
|
+
items,
|
|
46
|
+
activeKey,
|
|
47
|
+
onChange,
|
|
48
|
+
loading = false,
|
|
49
|
+
skeleton,
|
|
50
|
+
style
|
|
51
|
+
} = props;
|
|
44
52
|
const railRef = (0, import_react.useRef)(null);
|
|
45
53
|
const [isAtStart, setIsAtStart] = (0, import_react.useState)(true);
|
|
46
54
|
const [isAtEnd, setIsAtEnd] = (0, import_react.useState)(false);
|
|
@@ -100,81 +108,88 @@ var CategoryTabs = (0, import_react.forwardRef)((props, ref) => {
|
|
|
100
108
|
if (loading && skeleton) {
|
|
101
109
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, skeleton);
|
|
102
110
|
}
|
|
103
|
-
return /* @__PURE__ */ import_react.default.createElement(import_IntersectionObserver.default, null, items.length > 0 && /* @__PURE__ */ import_react.default.createElement(
|
|
104
|
-
|
|
111
|
+
return /* @__PURE__ */ import_react.default.createElement(import_IntersectionObserver.default, null, items.length > 0 && /* @__PURE__ */ import_react.default.createElement(
|
|
112
|
+
"div",
|
|
105
113
|
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
selectedTab: activeKey
|
|
114
|
+
className: `${import__.PREFIX}__tabs-wrapper ${className || ""}`,
|
|
115
|
+
style
|
|
109
116
|
},
|
|
110
|
-
|
|
111
|
-
import_TabsStructure.TabsStructure
|
|
117
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
118
|
+
import_TabsStructure.TabsStructure,
|
|
112
119
|
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
style: { marginRight: "8px" }
|
|
117
|
-
}
|
|
118
|
-
),
|
|
119
|
-
/* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.Rail, { ref: railRef }, /* @__PURE__ */ import_react.default.createElement(
|
|
120
|
-
import_IntersectionObserver.IntersectionTrigger,
|
|
121
|
-
{
|
|
122
|
-
onShow: () => {
|
|
123
|
-
console.log("is start");
|
|
124
|
-
setIsAtStart(true);
|
|
125
|
-
},
|
|
126
|
-
onHide: () => {
|
|
127
|
-
console.log("is start false");
|
|
128
|
-
setIsAtStart(false);
|
|
129
|
-
},
|
|
130
|
-
style: {
|
|
131
|
-
width: 1,
|
|
132
|
-
height: 1,
|
|
133
|
-
flexShrink: 0,
|
|
134
|
-
background: "rgba(0,0,0,0)"
|
|
135
|
-
},
|
|
136
|
-
className: "visibility-detector start-detector"
|
|
137
|
-
}
|
|
138
|
-
), /* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.SelectionIndicator, { ...selectionIndicatorProps }), /* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.ListContainer, { ...listContainerProps }, items.map((item) => /* @__PURE__ */ import_react.default.createElement(
|
|
139
|
-
import_TabsStructure.TabsStructure.Item,
|
|
140
|
-
{
|
|
141
|
-
key: item.key,
|
|
142
|
-
tabId: item.key,
|
|
143
|
-
"aria-selected": activeKey === item.key,
|
|
144
|
-
onClick: () => onChange(item.key),
|
|
145
|
-
className: "tab-item"
|
|
120
|
+
variant: "pill",
|
|
121
|
+
backgroundVariant: "onPage",
|
|
122
|
+
selectedTab: activeKey
|
|
146
123
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
124
|
+
needsScrollButtons && /* @__PURE__ */ import_react.default.createElement(
|
|
125
|
+
import_TabsStructure.TabsStructure.ChevronButton,
|
|
126
|
+
{
|
|
127
|
+
direction: "prev",
|
|
128
|
+
disabled: isAtStart,
|
|
129
|
+
onClick: scrollLeft,
|
|
130
|
+
style: { marginRight: "8px" }
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.Rail, { ref: railRef }, /* @__PURE__ */ import_react.default.createElement(
|
|
134
|
+
import_IntersectionObserver.IntersectionTrigger,
|
|
135
|
+
{
|
|
136
|
+
onShow: () => {
|
|
137
|
+
console.log("is start");
|
|
138
|
+
setIsAtStart(true);
|
|
139
|
+
},
|
|
140
|
+
onHide: () => {
|
|
141
|
+
console.log("is start false");
|
|
142
|
+
setIsAtStart(false);
|
|
143
|
+
},
|
|
144
|
+
style: {
|
|
145
|
+
width: 1,
|
|
146
|
+
height: 1,
|
|
147
|
+
flexShrink: 0,
|
|
148
|
+
background: "rgba(0,0,0,0)"
|
|
149
|
+
},
|
|
150
|
+
className: "visibility-detector start-detector"
|
|
151
|
+
}
|
|
152
|
+
), /* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.SelectionIndicator, { ...selectionIndicatorProps }), /* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.ListContainer, { ...listContainerProps }, items.map((item) => /* @__PURE__ */ import_react.default.createElement(
|
|
153
|
+
import_TabsStructure.TabsStructure.Item,
|
|
154
|
+
{
|
|
155
|
+
key: item.key,
|
|
156
|
+
tabId: item.key,
|
|
157
|
+
"aria-selected": activeKey === item.key,
|
|
158
|
+
onClick: () => onChange(item.key),
|
|
159
|
+
className: "tab-item"
|
|
159
160
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
item.label
|
|
162
|
+
))), /* @__PURE__ */ import_react.default.createElement(
|
|
163
|
+
import_IntersectionObserver.IntersectionTrigger,
|
|
164
|
+
{
|
|
165
|
+
className: "visibility-detector end-detector",
|
|
166
|
+
onShow: () => {
|
|
167
|
+
console.log("is end");
|
|
168
|
+
setIsAtEnd(true);
|
|
169
|
+
},
|
|
170
|
+
onHide: () => {
|
|
171
|
+
console.log("is end false");
|
|
172
|
+
setIsAtEnd(false);
|
|
173
|
+
},
|
|
174
|
+
style: {
|
|
175
|
+
width: 1,
|
|
176
|
+
height: 1,
|
|
177
|
+
flexShrink: 0,
|
|
178
|
+
background: "rgba(0,0,0,0)"
|
|
179
|
+
}
|
|
165
180
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
181
|
+
)),
|
|
182
|
+
needsScrollButtons && /* @__PURE__ */ import_react.default.createElement(
|
|
183
|
+
import_TabsStructure.TabsStructure.ChevronButton,
|
|
184
|
+
{
|
|
185
|
+
direction: "next",
|
|
186
|
+
disabled: isAtEnd,
|
|
187
|
+
onClick: scrollRight,
|
|
188
|
+
style: { marginLeft: "8px" }
|
|
189
|
+
}
|
|
190
|
+
)
|
|
176
191
|
)
|
|
177
|
-
))
|
|
192
|
+
));
|
|
178
193
|
});
|
|
179
194
|
var CategoryTabs_default = CategoryTabs;
|
|
180
195
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -129,17 +129,6 @@
|
|
|
129
129
|
border-radius: calc(20px - 2px);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
&::after {
|
|
133
|
-
content: '';
|
|
134
|
-
position: absolute;
|
|
135
|
-
inset-block-start: 1px;
|
|
136
|
-
inset-inline-start: 1px;
|
|
137
|
-
inset-inline-end: 1px;
|
|
138
|
-
block-size: 50%;
|
|
139
|
-
background-color: var(--ps-color-primary, #7f56d9);
|
|
140
|
-
border-radius: 20px 20px 0 0;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
132
|
&--focused {
|
|
144
133
|
.pisell-tabstruct-focus-ring();
|
|
145
134
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WalletEditorProps, WalletEditorRef } from './types';
|
|
3
|
+
import './WalletEditor.less';
|
|
4
|
+
declare const WalletEditor: React.ForwardRefExoticComponent<WalletEditorProps & React.RefAttributes<WalletEditorRef>>;
|
|
5
|
+
export default WalletEditor;
|
|
@@ -0,0 +1,354 @@
|
|
|
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/walletEditor/WalletEditor.tsx
|
|
30
|
+
var WalletEditor_exports = {};
|
|
31
|
+
__export(WalletEditor_exports, {
|
|
32
|
+
default: () => WalletEditor_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(WalletEditor_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_materials = require("@pisell/materials");
|
|
39
|
+
var import_ImageUpload = __toESM(require("./components/ImageUpload"));
|
|
40
|
+
var import_JsonEditor = __toESM(require("./components/JsonEditor"));
|
|
41
|
+
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
42
|
+
var import_locales = __toESM(require("./locales"));
|
|
43
|
+
var import_sortableWalletPassTypes = __toESM(require("./components/sortableWalletPassTypes"));
|
|
44
|
+
var import_ValidityPeriodSelector = __toESM(require("./components/ValidityPeriodSelector"));
|
|
45
|
+
var import_relationProduct = __toESM(require("./components/relationProduct"));
|
|
46
|
+
var import_WalletEditor = require("./WalletEditor.less");
|
|
47
|
+
var WalletEditor = (0, import_react.forwardRef)(
|
|
48
|
+
(props, ref) => {
|
|
49
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
50
|
+
const { value, onChange, disabled = false, className, style } = props;
|
|
51
|
+
const context = (0, import_useEngineContext.default)();
|
|
52
|
+
import_utils.locales.init(
|
|
53
|
+
import_locales.default,
|
|
54
|
+
((_b = (_a = context.appHelper.utils) == null ? void 0 : _a.storage) == null ? void 0 : _b.get("umi_locale")) || "en"
|
|
55
|
+
);
|
|
56
|
+
const amountSymbol = ((_d = (_c = context.appHelper.utils).getData) == null ? void 0 : _d.call(_c, "shop_symbol")) || "";
|
|
57
|
+
const store = ((_h = (_g = (_f = (_e = context.appHelper.utils).getStore) == null ? void 0 : _f.call(_e)) == null ? void 0 : _g.getState) == null ? void 0 : _h.call(_g)) || {};
|
|
58
|
+
const shopName = ((_j = (_i = store.global) == null ? void 0 : _i.shopDetail) == null ? void 0 : _j.name) || "";
|
|
59
|
+
const [sendConfigVisible, setSendConfigVisible] = (0, import_react.useState)(true);
|
|
60
|
+
const [previewVisible, setPreviewVisible] = (0, import_react.useState)(false);
|
|
61
|
+
const [form] = import_antd.Form.useForm();
|
|
62
|
+
const isControlled = value !== void 0;
|
|
63
|
+
const defaultValue = (0, import_react.useMemo)(
|
|
64
|
+
() => ({
|
|
65
|
+
status: "enable",
|
|
66
|
+
valid_for: {
|
|
67
|
+
unit: "1",
|
|
68
|
+
unit_type: "year",
|
|
69
|
+
type: "normal"
|
|
70
|
+
},
|
|
71
|
+
metadata: {
|
|
72
|
+
showcaseWalletPassNew: import_sortableWalletPassTypes.DEFAULT_WALLET_PASS_TYPES_CONFIG.map(
|
|
73
|
+
(item) => ({
|
|
74
|
+
...item,
|
|
75
|
+
display: 1
|
|
76
|
+
})
|
|
77
|
+
),
|
|
78
|
+
coverImage: "",
|
|
79
|
+
send_config: { type: "register" }
|
|
80
|
+
}
|
|
81
|
+
}),
|
|
82
|
+
[]
|
|
83
|
+
);
|
|
84
|
+
const currentValue = (0, import_react.useMemo)(() => {
|
|
85
|
+
return { ...defaultValue, ...value };
|
|
86
|
+
}, [value, defaultValue]);
|
|
87
|
+
(0, import_react.useImperativeHandle)(
|
|
88
|
+
ref,
|
|
89
|
+
() => ({
|
|
90
|
+
form,
|
|
91
|
+
setInitialValues: (values) => {
|
|
92
|
+
form.setFieldsValue({ ...defaultValue, ...values });
|
|
93
|
+
},
|
|
94
|
+
getValues: () => {
|
|
95
|
+
var _a2;
|
|
96
|
+
const formValues = form.getFieldsValue();
|
|
97
|
+
const processedValues = {
|
|
98
|
+
...formValues,
|
|
99
|
+
metadata: {
|
|
100
|
+
...formValues.metadata,
|
|
101
|
+
showcaseWalletPass: convertShowcaseWalletPass(
|
|
102
|
+
(_a2 = formValues.metadata) == null ? void 0 : _a2.showcaseWalletPassNew
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return processedValues;
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
[form, defaultValue]
|
|
110
|
+
);
|
|
111
|
+
(0, import_react.useEffect)(() => {
|
|
112
|
+
if (isControlled && currentValue) {
|
|
113
|
+
form.setFieldsValue(currentValue);
|
|
114
|
+
}
|
|
115
|
+
}, [currentValue, form, isControlled]);
|
|
116
|
+
const convertShowcaseWalletPass = (showcaseWalletPassNew) => {
|
|
117
|
+
if (!showcaseWalletPassNew) return [];
|
|
118
|
+
return showcaseWalletPassNew.filter((item) => item.display === 1).map((item) => item.type);
|
|
119
|
+
};
|
|
120
|
+
const toggleSendConfig = (0, import_react.useCallback)(() => {
|
|
121
|
+
setSendConfigVisible((prev) => !prev);
|
|
122
|
+
}, []);
|
|
123
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: `wallet-editor ${className || ""}`, style }, /* @__PURE__ */ import_react.default.createElement(
|
|
124
|
+
import_antd.Form,
|
|
125
|
+
{
|
|
126
|
+
size: "large",
|
|
127
|
+
form,
|
|
128
|
+
layout: "vertical",
|
|
129
|
+
initialValues: isControlled ? currentValue : { ...defaultValue },
|
|
130
|
+
onValuesChange: (...args) => {
|
|
131
|
+
var _a2;
|
|
132
|
+
(_a2 = props.onValuesChange) == null ? void 0 : _a2.call(props, ...args);
|
|
133
|
+
},
|
|
134
|
+
onFinish: (values) => {
|
|
135
|
+
var _a2;
|
|
136
|
+
if (onChange) {
|
|
137
|
+
const processedValues = {
|
|
138
|
+
...values,
|
|
139
|
+
metadata: {
|
|
140
|
+
...values.metadata,
|
|
141
|
+
showcaseWalletPass: convertShowcaseWalletPass(
|
|
142
|
+
(_a2 = values.metadata) == null ? void 0 : _a2.showcaseWalletPassNew
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
onChange(processedValues);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
disabled
|
|
150
|
+
},
|
|
151
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
style: {
|
|
155
|
+
padding: "20px 20px 0px 20px",
|
|
156
|
+
borderRadius: 10,
|
|
157
|
+
marginTop: 24,
|
|
158
|
+
border: "1px solid var(--Gray-300,#d0d5dd)"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
162
|
+
import_antd.Form.Item,
|
|
163
|
+
{
|
|
164
|
+
label: import_utils.locales.getText("walletName"),
|
|
165
|
+
name: "name",
|
|
166
|
+
rules: [
|
|
167
|
+
{
|
|
168
|
+
validator: async (_, value2) => {
|
|
169
|
+
const msg = import_utils.locales.getText("pleaseInputWalletName");
|
|
170
|
+
if (value2 == null || typeof value2 !== "object") {
|
|
171
|
+
return Promise.reject(new Error(msg));
|
|
172
|
+
}
|
|
173
|
+
const keys = Object.keys(value2);
|
|
174
|
+
if (keys.length === 0) {
|
|
175
|
+
return Promise.reject(new Error(msg));
|
|
176
|
+
}
|
|
177
|
+
const hasNonEmpty = keys.some((k) => {
|
|
178
|
+
const v = value2[k];
|
|
179
|
+
return typeof v === "string" && v.trim() !== "";
|
|
180
|
+
});
|
|
181
|
+
return hasNonEmpty ? Promise.resolve() : Promise.reject(new Error(msg));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
/* @__PURE__ */ import_react.default.createElement(import_materials.Translation, null)
|
|
187
|
+
),
|
|
188
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
189
|
+
import_antd.Form.Item,
|
|
190
|
+
{
|
|
191
|
+
label: import_utils.locales.getText("validityPeriod"),
|
|
192
|
+
name: "valid_for"
|
|
193
|
+
},
|
|
194
|
+
/* @__PURE__ */ import_react.default.createElement(import_ValidityPeriodSelector.default, null)
|
|
195
|
+
),
|
|
196
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
197
|
+
import_antd.Form.Item,
|
|
198
|
+
{
|
|
199
|
+
label: import_utils.locales.getText("linkedPasses"),
|
|
200
|
+
name: "relation_id",
|
|
201
|
+
initialValue: []
|
|
202
|
+
},
|
|
203
|
+
/* @__PURE__ */ import_react.default.createElement(import_relationProduct.default, null)
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label: import_utils.locales.getText("sort"), name: "sort" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, { style: { width: "100%" } })),
|
|
206
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
207
|
+
import_antd.Form.Item,
|
|
208
|
+
{
|
|
209
|
+
label: import_utils.locales.getText("status"),
|
|
210
|
+
name: "status",
|
|
211
|
+
initialValue: "enable"
|
|
212
|
+
},
|
|
213
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Radio.Group, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: "enable" }, import_utils.locales.getText("enable")), /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: "disable" }, import_utils.locales.getText("disable")))
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label: import_utils.locales.getText("distributionConditions") }, /* @__PURE__ */ import_react.default.createElement(
|
|
216
|
+
"div",
|
|
217
|
+
{
|
|
218
|
+
style: {
|
|
219
|
+
color: "#8c5cff",
|
|
220
|
+
cursor: "pointer",
|
|
221
|
+
height: 40,
|
|
222
|
+
display: "flex",
|
|
223
|
+
alignItems: "center",
|
|
224
|
+
border: "none",
|
|
225
|
+
background: "transparent",
|
|
226
|
+
padding: 0
|
|
227
|
+
},
|
|
228
|
+
onClick: toggleSendConfig
|
|
229
|
+
},
|
|
230
|
+
import_utils.locales.getText("advancedSettings"),
|
|
231
|
+
" ",
|
|
232
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
233
|
+
import_materials.Icon,
|
|
234
|
+
{
|
|
235
|
+
type: "pisell2-chevron-down",
|
|
236
|
+
size: 18,
|
|
237
|
+
style: {
|
|
238
|
+
transform: sendConfigVisible ? "rotate(0deg)" : "rotate(180deg)"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
243
|
+
import_antd.Form.Item,
|
|
244
|
+
{
|
|
245
|
+
noStyle: true,
|
|
246
|
+
name: ["metadata", "send_config"],
|
|
247
|
+
initialValue: {
|
|
248
|
+
type: "register"
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
252
|
+
import_JsonEditor.default,
|
|
253
|
+
{
|
|
254
|
+
placeholder: import_utils.locales.getText("enterJSONConfig"),
|
|
255
|
+
rows: 4,
|
|
256
|
+
disabled,
|
|
257
|
+
style: { display: sendConfigVisible ? "block" : "none" }
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
))
|
|
261
|
+
),
|
|
262
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
263
|
+
"div",
|
|
264
|
+
{
|
|
265
|
+
style: {
|
|
266
|
+
padding: "20px 20px 0px 20px",
|
|
267
|
+
borderRadius: 10,
|
|
268
|
+
margin: "24px 0",
|
|
269
|
+
border: "1px solid var(--Gray-300,#d0d5dd)"
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
273
|
+
"div",
|
|
274
|
+
{
|
|
275
|
+
style: {
|
|
276
|
+
marginBottom: "8px",
|
|
277
|
+
display: "flex",
|
|
278
|
+
justifyContent: "space-between",
|
|
279
|
+
alignItems: "center"
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
/* @__PURE__ */ import_react.default.createElement("span", { style: { fontWeight: "bold", fontSize: 16 } }, import_utils.locales.getText("displaySettings")),
|
|
283
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
284
|
+
"span",
|
|
285
|
+
{
|
|
286
|
+
style: { color: "#8c5cff", cursor: "pointer" },
|
|
287
|
+
onClick: () => setPreviewVisible(true)
|
|
288
|
+
},
|
|
289
|
+
import_utils.locales.getText("viewPreview")
|
|
290
|
+
)
|
|
291
|
+
),
|
|
292
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
293
|
+
import_antd.Form.Item,
|
|
294
|
+
{
|
|
295
|
+
label: "",
|
|
296
|
+
name: ["metadata", "showcaseWalletPassNew"],
|
|
297
|
+
initialValue: import_sortableWalletPassTypes.DEFAULT_WALLET_PASS_TYPES_CONFIG.map((item) => ({
|
|
298
|
+
...item,
|
|
299
|
+
display: 1
|
|
300
|
+
}))
|
|
301
|
+
},
|
|
302
|
+
/* @__PURE__ */ import_react.default.createElement(import_sortableWalletPassTypes.default, null)
|
|
303
|
+
),
|
|
304
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
305
|
+
import_antd.Form.Item,
|
|
306
|
+
{
|
|
307
|
+
label: import_utils.locales.getText("icon"),
|
|
308
|
+
name: ["metadata", "icon"]
|
|
309
|
+
},
|
|
310
|
+
/* @__PURE__ */ import_react.default.createElement(import_ImageUpload.default, null)
|
|
311
|
+
),
|
|
312
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
313
|
+
import_antd.Form.Item,
|
|
314
|
+
{
|
|
315
|
+
label: import_utils.locales.getText("coverImage"),
|
|
316
|
+
name: ["metadata", "coverImage"]
|
|
317
|
+
},
|
|
318
|
+
/* @__PURE__ */ import_react.default.createElement(import_ImageUpload.default, null)
|
|
319
|
+
)
|
|
320
|
+
)
|
|
321
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
322
|
+
import_materials.PisellModal,
|
|
323
|
+
{
|
|
324
|
+
open: previewVisible,
|
|
325
|
+
onCancel: () => setPreviewVisible(false),
|
|
326
|
+
title: import_utils.locales.getText("preview"),
|
|
327
|
+
width: "auto",
|
|
328
|
+
footer: false,
|
|
329
|
+
header: false,
|
|
330
|
+
className: "pisell-wallet-editor_preview-modal"
|
|
331
|
+
},
|
|
332
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
333
|
+
import_materials.WalletCard,
|
|
334
|
+
{
|
|
335
|
+
mode: "dark",
|
|
336
|
+
shopName,
|
|
337
|
+
cardStyle: "normal",
|
|
338
|
+
codeType: "qrCode",
|
|
339
|
+
symbol: amountSymbol,
|
|
340
|
+
items: form.getFieldValue(["metadata", "showcaseWalletPassNew"]),
|
|
341
|
+
customBackgroundImage: form.getFieldValue([
|
|
342
|
+
"metadata",
|
|
343
|
+
"coverImage"
|
|
344
|
+
]),
|
|
345
|
+
iconImg: form.getFieldValue(["metadata", "icon"]),
|
|
346
|
+
style: {
|
|
347
|
+
minWidth: 368
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
));
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
var WalletEditor_default = WalletEditor;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
.wallet-editor {
|
|
2
|
+
.ant-form {
|
|
3
|
+
.ant-form-item {
|
|
4
|
+
margin-bottom: 24px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ant-form-item-label {
|
|
8
|
+
> label {
|
|
9
|
+
font-weight: 500;
|
|
10
|
+
color: #262626;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.display-settings {
|
|
16
|
+
border: 1px solid #d9d9d9;
|
|
17
|
+
border-radius: 6px;
|
|
18
|
+
padding: 16px;
|
|
19
|
+
margin-bottom: 24px;
|
|
20
|
+
|
|
21
|
+
&-header {
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
align-items: center;
|
|
25
|
+
margin-bottom: 16px;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
color: #262626;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-items {
|
|
31
|
+
.display-item {
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
align-items: center;
|
|
35
|
+
padding: 8px 0;
|
|
36
|
+
border-bottom: 1px solid #f0f0f0;
|
|
37
|
+
|
|
38
|
+
&:last-child {
|
|
39
|
+
border-bottom: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.display-toggle {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
color: #1890ff;
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
|
|
47
|
+
&:hover {
|
|
48
|
+
color: #40a9ff;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.upload-area {
|
|
56
|
+
border: 2px dashed #d9d9d9;
|
|
57
|
+
border-radius: 6px;
|
|
58
|
+
padding: 32px;
|
|
59
|
+
text-align: center;
|
|
60
|
+
background-color: #fafafa;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
transition: border-color 0.3s;
|
|
63
|
+
|
|
64
|
+
&:hover {
|
|
65
|
+
border-color: #1890ff;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.upload-placeholder {
|
|
69
|
+
color: #999;
|
|
70
|
+
font-size: 14px;
|
|
71
|
+
line-height: 1.4;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ant-select {
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ant-radio-group {
|
|
80
|
+
display: flex;
|
|
81
|
+
gap: 16px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ant-input,
|
|
85
|
+
.ant-select-selector,
|
|
86
|
+
.ant-picker {
|
|
87
|
+
border-radius: 6px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ant-form-item-required {
|
|
91
|
+
&::before {
|
|
92
|
+
color: #ff4d4f !important;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// 响应式设计
|
|
98
|
+
@media (max-width: 768px) {
|
|
99
|
+
.wallet-editor {
|
|
100
|
+
.display-settings {
|
|
101
|
+
padding: 12px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.upload-area {
|
|
105
|
+
padding: 24px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.ant-radio-group {
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
gap: 8px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.pisell-wallet-editor_preview-modal {
|
|
116
|
+
|
|
117
|
+
.pisell-lowcode-modal-content {
|
|
118
|
+
background-color: transparent !important;
|
|
119
|
+
box-shadow: none !important;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.pisell-lowcode-modal-body {
|
|
123
|
+
padding: 0 !important;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.pisell-lowcode-modal-close {
|
|
127
|
+
display: none;
|
|
128
|
+
}
|
|
129
|
+
}
|