@zlooks.cn/password-auth-server 1.0.2 → 1.0.3
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/.hile-rsc/{build-mtjl0eh7-90bc0b3a/client-browser/chunks/chunk-RZRQMKUX.js → build-mtsn68qv-a841a566/client-browser/chunks/chunk-CZF5VGOJ.js} +40053 -45863
- package/.hile-rsc/build-mtsn68qv-a841a566/client-browser/src-plugin-page-frame-07c4de56a6-C2WHPDGD.js +2312 -0
- package/.hile-rsc/build-mtsn68qv-a841a566/client-browser/src-plugin-password-form-3bd63d69e5-G5UQAB5W.js +4494 -0
- package/.hile-rsc/build-mtsn68qv-a841a566/client-ssr/chunks/chunk-RMKQVF3F.js +36281 -0
- package/.hile-rsc/build-mtsn68qv-a841a566/client-ssr/src-plugin-page-frame-07c4de56a6-ICZZGKBP.js +15609 -0
- package/.hile-rsc/{build-mtjl0eh7-90bc0b3a/client-ssr/chunks/chunk-SH36JXFV.js → build-mtsn68qv-a841a566/client-ssr/src-plugin-password-form-3bd63d69e5-UV3K6EC6.js} +104665 -140085
- package/.hile-rsc/{build-mtjl0eh7-90bc0b3a → build-mtsn68qv-a841a566}/plugin.json +18 -18
- package/.hile-rsc/{build-mtjl0eh7-90bc0b3a → build-mtsn68qv-a841a566}/server-rsc/index.js +2 -2
- package/package.json +3 -3
- package/.hile-rsc/build-mtjl0eh7-90bc0b3a/client-browser/src-plugin-page-frame-07c4de56a6-GJVQS7WE.js +0 -440
- package/.hile-rsc/build-mtjl0eh7-90bc0b3a/client-browser/src-plugin-password-form-3bd63d69e5-PXXZM4RL.js +0 -706
- package/.hile-rsc/build-mtjl0eh7-90bc0b3a/client-ssr/src-plugin-page-frame-07c4de56a6-JTUKAMPR.js +0 -441
- package/.hile-rsc/build-mtjl0eh7-90bc0b3a/client-ssr/src-plugin-password-form-3bd63d69e5-ESX5GCJR.js +0 -708
- /package/.hile-rsc/{build-mtjl0eh7-90bc0b3a → build-mtsn68qv-a841a566}/client-browser/src-plugin-page-frame-07c4de56a6-3F24AYCH.css +0 -0
- /package/.hile-rsc/{build-mtjl0eh7-90bc0b3a → build-mtsn68qv-a841a566}/client-browser/src-plugin-password-form-3bd63d69e5-TRYMJX4F.css +0 -0
- /package/.hile-rsc/{build-mtjl0eh7-90bc0b3a → build-mtsn68qv-a841a566}/styles/4b3193c4f2b317ffed425ccf401342a4bdd6ccfd5f9c42def3315e776f166975.css +0 -0
|
@@ -0,0 +1,4494 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
AntdIconLight_default,
|
|
4
|
+
App_default,
|
|
5
|
+
Button_default,
|
|
6
|
+
CSSMotionList_default,
|
|
7
|
+
CheckCircleFilled_default,
|
|
8
|
+
CloseCircleFilled_default,
|
|
9
|
+
Compact_default,
|
|
10
|
+
ConfigContext,
|
|
11
|
+
DisabledContextProvider,
|
|
12
|
+
DisabledContext_default,
|
|
13
|
+
ExclamationCircleFilled_default,
|
|
14
|
+
FieldContext_default,
|
|
15
|
+
Field_default,
|
|
16
|
+
FormContext,
|
|
17
|
+
FormItemInputContext,
|
|
18
|
+
FormItemPrefixContext,
|
|
19
|
+
FormProvider,
|
|
20
|
+
Fragment,
|
|
21
|
+
Input_default,
|
|
22
|
+
ListContext_default,
|
|
23
|
+
List_default,
|
|
24
|
+
LoadingOutlined_default,
|
|
25
|
+
NoFormStyle,
|
|
26
|
+
NoStyleItemContext,
|
|
27
|
+
RscLink,
|
|
28
|
+
SizeContext_default,
|
|
29
|
+
TextArea_default,
|
|
30
|
+
USER_SESSION_COOKIE,
|
|
31
|
+
VariantContext,
|
|
32
|
+
__commonJS,
|
|
33
|
+
__toESM,
|
|
34
|
+
_toConsumableArray,
|
|
35
|
+
browserApiDispatchResponseSchema,
|
|
36
|
+
browserApiResponseSchema,
|
|
37
|
+
cloneElement,
|
|
38
|
+
clsx,
|
|
39
|
+
collapse_default,
|
|
40
|
+
composeRef,
|
|
41
|
+
createContext,
|
|
42
|
+
createElement,
|
|
43
|
+
devUseWarning,
|
|
44
|
+
en_US_default,
|
|
45
|
+
es_default,
|
|
46
|
+
es_default3 as es_default2,
|
|
47
|
+
external_exports,
|
|
48
|
+
fallbackProp,
|
|
49
|
+
forwardRef,
|
|
50
|
+
genCssVar,
|
|
51
|
+
genFocusOutline,
|
|
52
|
+
genFocusStyle,
|
|
53
|
+
genStyleHooks,
|
|
54
|
+
genSubStyleComponent,
|
|
55
|
+
get,
|
|
56
|
+
getDOM,
|
|
57
|
+
getMergedStatus,
|
|
58
|
+
getNodeRef,
|
|
59
|
+
initComponentToken,
|
|
60
|
+
initInputToken,
|
|
61
|
+
isBrowserApiFailure,
|
|
62
|
+
isFunction,
|
|
63
|
+
isNonNullable,
|
|
64
|
+
isNumber,
|
|
65
|
+
isPlainObject,
|
|
66
|
+
isReactRenderable,
|
|
67
|
+
isString,
|
|
68
|
+
isValidElement,
|
|
69
|
+
isVisible_default,
|
|
70
|
+
jsx,
|
|
71
|
+
jsxs,
|
|
72
|
+
memo,
|
|
73
|
+
merge,
|
|
74
|
+
motion_default,
|
|
75
|
+
omit,
|
|
76
|
+
pickAttrs,
|
|
77
|
+
raf_default,
|
|
78
|
+
resetComponent,
|
|
79
|
+
responsiveArray,
|
|
80
|
+
responsiveArrayReversed,
|
|
81
|
+
set,
|
|
82
|
+
space_default,
|
|
83
|
+
style_default,
|
|
84
|
+
supportRef,
|
|
85
|
+
textEllipsis,
|
|
86
|
+
toArray,
|
|
87
|
+
tooltip_default,
|
|
88
|
+
unit,
|
|
89
|
+
useApp_default,
|
|
90
|
+
useBreakpoint_default,
|
|
91
|
+
useCSSVarCls_default,
|
|
92
|
+
useColStyle,
|
|
93
|
+
useCompactItemContext,
|
|
94
|
+
useComponentConfig,
|
|
95
|
+
useContext,
|
|
96
|
+
useControlledState,
|
|
97
|
+
useDelayState,
|
|
98
|
+
useDevWarning,
|
|
99
|
+
useEffect,
|
|
100
|
+
useEvent_default,
|
|
101
|
+
useForm_default,
|
|
102
|
+
useId_default,
|
|
103
|
+
useImperativeHandle,
|
|
104
|
+
useLayoutEffect_default,
|
|
105
|
+
useLocale_default,
|
|
106
|
+
useMemo,
|
|
107
|
+
useMergeSemantic,
|
|
108
|
+
useOrientation,
|
|
109
|
+
useRef,
|
|
110
|
+
useRemovePasswordTimeout,
|
|
111
|
+
useRequest,
|
|
112
|
+
useRowStyle,
|
|
113
|
+
useRscNavigation,
|
|
114
|
+
useSemanticRootStyle,
|
|
115
|
+
useSize_default,
|
|
116
|
+
useState,
|
|
117
|
+
useState_default,
|
|
118
|
+
useVariants_default,
|
|
119
|
+
useWatch_default,
|
|
120
|
+
validateMessagesContext_default,
|
|
121
|
+
version,
|
|
122
|
+
warning_default,
|
|
123
|
+
zoomIn
|
|
124
|
+
} from "./chunks/chunk-CZF5VGOJ.js";
|
|
125
|
+
|
|
126
|
+
// ../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/SearchOutlined.js
|
|
127
|
+
var require_SearchOutlined = __commonJS({
|
|
128
|
+
"../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/SearchOutlined.js"(exports) {
|
|
129
|
+
"use strict";
|
|
130
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
131
|
+
var SearchOutlined2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, "name": "search", "theme": "outlined" };
|
|
132
|
+
exports.default = SearchOutlined2;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// ../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/QuestionCircleOutlined.js
|
|
137
|
+
var require_QuestionCircleOutlined = __commonJS({
|
|
138
|
+
"../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/QuestionCircleOutlined.js"(exports) {
|
|
139
|
+
"use strict";
|
|
140
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
141
|
+
var QuestionCircleOutlined2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, "name": "question-circle", "theme": "outlined" };
|
|
142
|
+
exports.default = QuestionCircleOutlined2;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// ../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/EyeInvisibleOutlined.js
|
|
147
|
+
var require_EyeInvisibleOutlined = __commonJS({
|
|
148
|
+
"../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/EyeInvisibleOutlined.js"(exports) {
|
|
149
|
+
"use strict";
|
|
150
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
151
|
+
var EyeInvisibleOutlined2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" };
|
|
152
|
+
exports.default = EyeInvisibleOutlined2;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// ../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/EyeOutlined.js
|
|
157
|
+
var require_EyeOutlined = __commonJS({
|
|
158
|
+
"../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/EyeOutlined.js"(exports) {
|
|
159
|
+
"use strict";
|
|
160
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
161
|
+
var EyeOutlined2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };
|
|
162
|
+
exports.default = EyeOutlined2;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// ../user-shared/dist/identity.js
|
|
167
|
+
var USER_SERVICE_NAMESPACE = "cn.zlooks.user.server";
|
|
168
|
+
|
|
169
|
+
// ../user-shared/dist/events/snapshots.js
|
|
170
|
+
var userSessionRevocationReasonSchema = external_exports.enum([
|
|
171
|
+
"logout",
|
|
172
|
+
"user-request",
|
|
173
|
+
"family-limit",
|
|
174
|
+
"credential-recovery"
|
|
175
|
+
]);
|
|
176
|
+
var displayNameSchema = external_exports.string().refine((value) => value === value.trim().normalize("NFKC"), "Display name must be normalized").refine((value) => Array.from(value).length >= 1 && Array.from(value).length <= 160, "Display name must contain 1 to 160 Unicode code points");
|
|
177
|
+
var bioSchema = external_exports.string().refine((value) => value === value.trim().normalize("NFKC"), "Bio must be normalized").refine((value) => Array.from(value).length >= 1 && Array.from(value).length <= 500, "Bio must contain 1 to 500 Unicode code points");
|
|
178
|
+
var httpUrlSchema = external_exports.url().max(2048).refine((value) => {
|
|
179
|
+
const protocol = new URL(value).protocol;
|
|
180
|
+
return protocol === "http:" || protocol === "https:";
|
|
181
|
+
}, "URL must use HTTP or HTTPS").refine((value) => value === new URL(value).toString(), "URL must be canonical");
|
|
182
|
+
var emailSchema = external_exports.email().max(320).refine((value) => value === value.toLocaleLowerCase("en-US"), "Email must be lowercase");
|
|
183
|
+
var userEventSnapshotSchema = external_exports.strictObject({
|
|
184
|
+
id: external_exports.uuid(),
|
|
185
|
+
displayName: displayNameSchema.nullable(),
|
|
186
|
+
avatar: httpUrlSchema.nullable(),
|
|
187
|
+
homepage: httpUrlSchema.nullable(),
|
|
188
|
+
bio: bioSchema.nullable(),
|
|
189
|
+
email: emailSchema.nullable(),
|
|
190
|
+
emailVerified: external_exports.boolean(),
|
|
191
|
+
status: external_exports.enum(["active", "disabled", "deleted"]),
|
|
192
|
+
createdAt: external_exports.iso.datetime({ offset: true }),
|
|
193
|
+
updatedAt: external_exports.iso.datetime({ offset: true }),
|
|
194
|
+
version: external_exports.number().int().positive()
|
|
195
|
+
}).superRefine((user, context) => {
|
|
196
|
+
if (user.emailVerified && user.email === null) {
|
|
197
|
+
context.addIssue({
|
|
198
|
+
code: "custom",
|
|
199
|
+
message: "A verified user snapshot must include its email",
|
|
200
|
+
path: ["email"]
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
if (Date.parse(user.updatedAt) < Date.parse(user.createdAt)) {
|
|
204
|
+
context.addIssue({
|
|
205
|
+
code: "custom",
|
|
206
|
+
message: "User updated time must not precede creation time",
|
|
207
|
+
path: ["updatedAt"]
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}).readonly();
|
|
211
|
+
var userSessionFamilyEventSnapshotSchema = external_exports.strictObject({
|
|
212
|
+
id: external_exports.uuid(),
|
|
213
|
+
userId: external_exports.uuid(),
|
|
214
|
+
createdAt: external_exports.iso.datetime({ offset: true }),
|
|
215
|
+
expiresAt: external_exports.iso.datetime({ offset: true }),
|
|
216
|
+
lastSeenAt: external_exports.iso.datetime({ offset: true }),
|
|
217
|
+
revokedAt: external_exports.iso.datetime({ offset: true }).nullable(),
|
|
218
|
+
revokeReason: userSessionRevocationReasonSchema.nullable()
|
|
219
|
+
}).superRefine((session, context) => {
|
|
220
|
+
const createdAt = Date.parse(session.createdAt);
|
|
221
|
+
if (session.revokedAt === null !== (session.revokeReason === null)) {
|
|
222
|
+
context.addIssue({
|
|
223
|
+
code: "custom",
|
|
224
|
+
message: "Session revocation time and reason must be present together",
|
|
225
|
+
path: ["revokedAt"]
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
if (Date.parse(session.expiresAt) <= createdAt) {
|
|
229
|
+
context.addIssue({
|
|
230
|
+
code: "custom",
|
|
231
|
+
message: "Session expiry must follow creation time",
|
|
232
|
+
path: ["expiresAt"]
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
const lastSeenAt = Date.parse(session.lastSeenAt);
|
|
236
|
+
if (lastSeenAt < createdAt || lastSeenAt > Date.parse(session.expiresAt)) {
|
|
237
|
+
context.addIssue({
|
|
238
|
+
code: "custom",
|
|
239
|
+
message: "Session last-seen time must fall within its lifetime",
|
|
240
|
+
path: ["lastSeenAt"]
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
if (session.revokedAt !== null && Date.parse(session.revokedAt) < createdAt) {
|
|
244
|
+
context.addIssue({
|
|
245
|
+
code: "custom",
|
|
246
|
+
message: "Session revoked time must not precede creation time",
|
|
247
|
+
path: ["revokedAt"]
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}).readonly();
|
|
251
|
+
|
|
252
|
+
// ../event-bus/dist/index.js
|
|
253
|
+
var eventType = external_exports.string().max(256).regex(/^[a-z][a-z0-9]*(?:\.[a-z][a-z0-9-]*)+\.v[1-9][0-9]*$/);
|
|
254
|
+
var serviceNamespace = external_exports.string().max(256).regex(/^[a-z][a-z0-9]*(?:\.[a-z][a-z0-9]*)+$/);
|
|
255
|
+
var aggregateType = external_exports.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
256
|
+
var aggregateId = external_exports.string().trim().min(1).max(256);
|
|
257
|
+
var eventEnvelopeSchema = external_exports.strictObject({
|
|
258
|
+
protocol: external_exports.literal("zlooks.event"),
|
|
259
|
+
protocolVersion: external_exports.literal(1),
|
|
260
|
+
eventId: external_exports.uuid(),
|
|
261
|
+
type: eventType,
|
|
262
|
+
producer: serviceNamespace,
|
|
263
|
+
aggregate: external_exports.strictObject({
|
|
264
|
+
type: aggregateType,
|
|
265
|
+
id: aggregateId
|
|
266
|
+
}).readonly(),
|
|
267
|
+
occurredAt: external_exports.iso.datetime({ offset: true }),
|
|
268
|
+
data: external_exports.unknown()
|
|
269
|
+
}).readonly();
|
|
270
|
+
function defineEvent(type, dataSchema5) {
|
|
271
|
+
const parsedType = eventType.parse(type);
|
|
272
|
+
return Object.freeze({
|
|
273
|
+
type: parsedType,
|
|
274
|
+
parse(value) {
|
|
275
|
+
const envelope = eventEnvelopeSchema.parse(value);
|
|
276
|
+
if (envelope.type !== parsedType) {
|
|
277
|
+
throw new TypeError(`Expected event type ${parsedType}`);
|
|
278
|
+
}
|
|
279
|
+
return Object.freeze({
|
|
280
|
+
...envelope,
|
|
281
|
+
type: parsedType,
|
|
282
|
+
aggregate: Object.freeze({ ...envelope.aggregate }),
|
|
283
|
+
data: dataSchema5.parse(envelope.data)
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// ../user-shared/dist/events/definition.js
|
|
290
|
+
function defineUserEvent(type, aggregateType2, dataSchema5, aggregateId2) {
|
|
291
|
+
const base = defineEvent(type, dataSchema5);
|
|
292
|
+
return Object.freeze({
|
|
293
|
+
type: base.type,
|
|
294
|
+
parse(input) {
|
|
295
|
+
const event = base.parse(input);
|
|
296
|
+
if (event.producer !== USER_SERVICE_NAMESPACE) {
|
|
297
|
+
throw new TypeError(`Expected event producer ${USER_SERVICE_NAMESPACE}`);
|
|
298
|
+
}
|
|
299
|
+
if (event.aggregate.type !== aggregateType2 || event.aggregate.id !== aggregateId2(event.data)) {
|
|
300
|
+
throw new TypeError(`${type} aggregate does not identify its event data`);
|
|
301
|
+
}
|
|
302
|
+
return event;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// ../user-shared/dist/events/user-registered.js
|
|
308
|
+
var USER_REGISTERED_EVENT_TYPE = "cn.zlooks.user.registered.v1";
|
|
309
|
+
var userRegisteredDataSchema = external_exports.strictObject({
|
|
310
|
+
user: userEventSnapshotSchema
|
|
311
|
+
}).refine((data) => data.user.status === "active", {
|
|
312
|
+
message: "A registered user snapshot must be active",
|
|
313
|
+
path: ["user", "status"]
|
|
314
|
+
}).readonly();
|
|
315
|
+
var userRegisteredEvent = defineUserEvent(USER_REGISTERED_EVENT_TYPE, "user", userRegisteredDataSchema, (data) => data.user.id);
|
|
316
|
+
|
|
317
|
+
// ../user-shared/dist/events/user-email-verified.js
|
|
318
|
+
var USER_EMAIL_VERIFIED_EVENT_TYPE = "cn.zlooks.user.email-verified.v1";
|
|
319
|
+
var dataSchema = external_exports.strictObject({ user: userEventSnapshotSchema }).refine((data) => data.user.email !== null && data.user.emailVerified, {
|
|
320
|
+
message: "An email-verified event must contain a verified email snapshot",
|
|
321
|
+
path: ["user", "emailVerified"]
|
|
322
|
+
}).readonly();
|
|
323
|
+
var userEmailVerifiedEvent = defineUserEvent(USER_EMAIL_VERIFIED_EVENT_TYPE, "user", dataSchema, (data) => data.user.id);
|
|
324
|
+
|
|
325
|
+
// ../user-shared/dist/events/user-profile-updated.js
|
|
326
|
+
var USER_PROFILE_UPDATED_EVENT_TYPE = "cn.zlooks.user.profile-updated.v1";
|
|
327
|
+
var userProfileFieldSchema = external_exports.enum(["displayName", "avatar", "homepage", "bio"]);
|
|
328
|
+
var dataSchema2 = external_exports.strictObject({
|
|
329
|
+
user: userEventSnapshotSchema,
|
|
330
|
+
changedFields: external_exports.array(userProfileFieldSchema).min(1).max(4).refine((fields) => new Set(fields).size === fields.length, "Profile fields must be unique").readonly()
|
|
331
|
+
}).readonly();
|
|
332
|
+
var userProfileUpdatedEvent = defineUserEvent(USER_PROFILE_UPDATED_EVENT_TYPE, "user", dataSchema2, (data) => data.user.id);
|
|
333
|
+
|
|
334
|
+
// ../user-shared/dist/events/user-session-created.js
|
|
335
|
+
var USER_SESSION_CREATED_EVENT_TYPE = "cn.zlooks.user.session-created.v1";
|
|
336
|
+
var dataSchema3 = external_exports.strictObject({
|
|
337
|
+
user: userEventSnapshotSchema,
|
|
338
|
+
sessionFamily: userSessionFamilyEventSnapshotSchema,
|
|
339
|
+
intent: external_exports.enum(["login", "registration", "recovery"])
|
|
340
|
+
}).superRefine((data, context) => {
|
|
341
|
+
if (data.sessionFamily.userId !== data.user.id) {
|
|
342
|
+
context.addIssue({
|
|
343
|
+
code: "custom",
|
|
344
|
+
message: "Session and user snapshots must identify the same user",
|
|
345
|
+
path: ["sessionFamily", "userId"]
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
if (data.sessionFamily.revokedAt !== null) {
|
|
349
|
+
context.addIssue({
|
|
350
|
+
code: "custom",
|
|
351
|
+
message: "A created session snapshot must be active",
|
|
352
|
+
path: ["sessionFamily", "revokedAt"]
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
if (data.user.status !== "active") {
|
|
356
|
+
context.addIssue({
|
|
357
|
+
code: "custom",
|
|
358
|
+
message: "A session-created event must contain an active user snapshot",
|
|
359
|
+
path: ["user", "status"]
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}).readonly();
|
|
363
|
+
var userSessionCreatedEvent = defineUserEvent(USER_SESSION_CREATED_EVENT_TYPE, "session-family", dataSchema3, (data) => data.sessionFamily.id);
|
|
364
|
+
|
|
365
|
+
// ../user-shared/dist/events/user-session-revoked.js
|
|
366
|
+
var USER_SESSION_REVOKED_EVENT_TYPE = "cn.zlooks.user.session-revoked.v1";
|
|
367
|
+
var dataSchema4 = external_exports.strictObject({
|
|
368
|
+
user: userEventSnapshotSchema,
|
|
369
|
+
sessionFamily: userSessionFamilyEventSnapshotSchema
|
|
370
|
+
}).superRefine((data, context) => {
|
|
371
|
+
if (data.sessionFamily.userId !== data.user.id) {
|
|
372
|
+
context.addIssue({
|
|
373
|
+
code: "custom",
|
|
374
|
+
message: "Session and user snapshots must identify the same user",
|
|
375
|
+
path: ["sessionFamily", "userId"]
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
if (data.sessionFamily.revokedAt === null) {
|
|
379
|
+
context.addIssue({
|
|
380
|
+
code: "custom",
|
|
381
|
+
message: "A revoked session snapshot must include its revocation",
|
|
382
|
+
path: ["sessionFamily", "revokedAt"]
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
}).readonly();
|
|
386
|
+
var userSessionRevokedEvent = defineUserEvent(USER_SESSION_REVOKED_EVENT_TYPE, "session-family", dataSchema4, (data) => data.sessionFamily.id);
|
|
387
|
+
|
|
388
|
+
// ../user-shared/dist/index.js
|
|
389
|
+
var USER_BROWSER_API_PUBLIC_ROUTES = Object.freeze([
|
|
390
|
+
Object.freeze({
|
|
391
|
+
exact: "/api/auth/methods",
|
|
392
|
+
methods: Object.freeze(["GET"]),
|
|
393
|
+
forwardCookieNames: Object.freeze([])
|
|
394
|
+
}),
|
|
395
|
+
Object.freeze({
|
|
396
|
+
exact: "/api/user/shell",
|
|
397
|
+
methods: Object.freeze(["GET"]),
|
|
398
|
+
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
399
|
+
}),
|
|
400
|
+
Object.freeze({
|
|
401
|
+
exact: "/api/user",
|
|
402
|
+
methods: Object.freeze(["GET", "PATCH"]),
|
|
403
|
+
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
404
|
+
}),
|
|
405
|
+
Object.freeze({
|
|
406
|
+
exact: "/api/user/sessions",
|
|
407
|
+
methods: Object.freeze(["GET"]),
|
|
408
|
+
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
409
|
+
}),
|
|
410
|
+
Object.freeze({
|
|
411
|
+
exact: "/api/auth/transactions",
|
|
412
|
+
methods: Object.freeze(["POST"]),
|
|
413
|
+
forwardCookieNames: Object.freeze([])
|
|
414
|
+
}),
|
|
415
|
+
Object.freeze({
|
|
416
|
+
prefix: "/api/auth/transactions/",
|
|
417
|
+
methods: Object.freeze(["POST"]),
|
|
418
|
+
forwardCookieNames: Object.freeze([])
|
|
419
|
+
}),
|
|
420
|
+
Object.freeze({
|
|
421
|
+
exact: "/api/auth/logout",
|
|
422
|
+
methods: Object.freeze(["POST"]),
|
|
423
|
+
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
424
|
+
}),
|
|
425
|
+
Object.freeze({
|
|
426
|
+
exact: "/api/auth/session/refresh",
|
|
427
|
+
methods: Object.freeze(["POST"]),
|
|
428
|
+
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
429
|
+
}),
|
|
430
|
+
Object.freeze({
|
|
431
|
+
prefix: "/api/user/sessions/",
|
|
432
|
+
methods: Object.freeze(["POST"]),
|
|
433
|
+
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
434
|
+
})
|
|
435
|
+
]);
|
|
436
|
+
var USER_ACCOUNT_HREF = "/user.account/account";
|
|
437
|
+
var USER_BROWSER_API_ERROR_CODES = Object.freeze({
|
|
438
|
+
crossOriginRejected: 1001,
|
|
439
|
+
requestRejected: 1002,
|
|
440
|
+
authenticationRequired: 1003,
|
|
441
|
+
sessionExpired: 1004,
|
|
442
|
+
authenticationDenied: 1005,
|
|
443
|
+
authenticationPending: 1006,
|
|
444
|
+
routeNotFound: 1007,
|
|
445
|
+
accountNotFound: 1008,
|
|
446
|
+
accountAlreadyExists: 1009,
|
|
447
|
+
invalidVerificationCode: 1010,
|
|
448
|
+
verificationRateLimited: 1011,
|
|
449
|
+
emailDeliveryFailed: 1012,
|
|
450
|
+
serviceUnavailable: 1013
|
|
451
|
+
});
|
|
452
|
+
var absolutePath = external_exports.string().min(1).max(2048).regex(/^\/(?!\/)[^?#]*$/);
|
|
453
|
+
var userShellViewSchema = external_exports.discriminatedUnion("status", [
|
|
454
|
+
external_exports.strictObject({
|
|
455
|
+
status: external_exports.literal("anonymous"),
|
|
456
|
+
loginMethods: external_exports.array(external_exports.strictObject({
|
|
457
|
+
id: external_exports.string().min(1).max(128),
|
|
458
|
+
label: external_exports.string().min(1).max(80),
|
|
459
|
+
href: absolutePath
|
|
460
|
+
})).max(64)
|
|
461
|
+
}),
|
|
462
|
+
external_exports.strictObject({
|
|
463
|
+
status: external_exports.literal("authenticated"),
|
|
464
|
+
user: external_exports.strictObject({
|
|
465
|
+
label: external_exports.string().min(1).max(160),
|
|
466
|
+
secondary: external_exports.string().min(1).max(320).optional(),
|
|
467
|
+
avatarText: external_exports.string().min(1).max(8),
|
|
468
|
+
avatarUrl: external_exports.url({ protocol: /^https?$/ }).max(2048).optional()
|
|
469
|
+
}),
|
|
470
|
+
accountHref: absolutePath,
|
|
471
|
+
logoutHref: absolutePath
|
|
472
|
+
})
|
|
473
|
+
]).readonly();
|
|
474
|
+
var sessionCookieSchema = external_exports.discriminatedUnion("action", [
|
|
475
|
+
external_exports.strictObject({
|
|
476
|
+
action: external_exports.literal("set"),
|
|
477
|
+
value: external_exports.string().min(1).max(4096),
|
|
478
|
+
expiresAt: external_exports.iso.datetime({ offset: true })
|
|
479
|
+
}),
|
|
480
|
+
external_exports.strictObject({ action: external_exports.literal("clear") })
|
|
481
|
+
]);
|
|
482
|
+
var userCurrentUserRequestSchema = external_exports.strictObject({}).readonly();
|
|
483
|
+
var userPublicProfileSchema = external_exports.strictObject({
|
|
484
|
+
id: external_exports.uuid(),
|
|
485
|
+
displayName: external_exports.string().trim().min(1).max(160).nullable(),
|
|
486
|
+
avatar: external_exports.url({ protocol: /^https?$/ }).max(2048).nullable(),
|
|
487
|
+
homepage: external_exports.url({ protocol: /^https?$/ }).max(2048).nullable().optional(),
|
|
488
|
+
bio: external_exports.string().trim().min(1).max(500).nullable().optional()
|
|
489
|
+
}).readonly();
|
|
490
|
+
var userCurrentUserSchema = userPublicProfileSchema;
|
|
491
|
+
var userCurrentUserResponseSchema = external_exports.discriminatedUnion("authenticated", [
|
|
492
|
+
external_exports.strictObject({ authenticated: external_exports.literal(false) }),
|
|
493
|
+
external_exports.strictObject({
|
|
494
|
+
authenticated: external_exports.literal(true),
|
|
495
|
+
user: userCurrentUserSchema
|
|
496
|
+
})
|
|
497
|
+
]).readonly();
|
|
498
|
+
var userPublicProfilesRequestSchema = external_exports.strictObject({
|
|
499
|
+
userIds: external_exports.array(external_exports.uuid()).min(1).max(100).refine((userIds) => new Set(userIds).size === userIds.length, { message: "User IDs must be unique" }).readonly()
|
|
500
|
+
}).readonly();
|
|
501
|
+
var userPublicProfilesResponseSchema = external_exports.strictObject({
|
|
502
|
+
users: external_exports.array(userPublicProfileSchema).max(100).refine((users) => new Set(users.map((user) => user.id)).size === users.length, { message: "Public user profiles must be unique" }).readonly()
|
|
503
|
+
}).readonly();
|
|
504
|
+
var userBrowserApiRequestSchema = external_exports.strictObject({
|
|
505
|
+
method: external_exports.enum(["GET", "POST", "PATCH"]),
|
|
506
|
+
path: absolutePath,
|
|
507
|
+
origin: external_exports.string().max(2048).optional(),
|
|
508
|
+
clientKey: external_exports.string().regex(/^[a-f0-9]{64}$/),
|
|
509
|
+
body: external_exports.unknown().optional()
|
|
510
|
+
}).readonly();
|
|
511
|
+
var userBrowserApiProviderRequestSchema = external_exports.strictObject({
|
|
512
|
+
method: external_exports.enum(["GET", "POST", "PATCH"]),
|
|
513
|
+
path: absolutePath,
|
|
514
|
+
origin: external_exports.string().max(2048).optional(),
|
|
515
|
+
clientKey: external_exports.string().regex(/^[a-f0-9]{64}$/),
|
|
516
|
+
body: external_exports.unknown().optional()
|
|
517
|
+
}).readonly();
|
|
518
|
+
var userBrowserApiProviderResponseSchema = browserApiDispatchResponseSchema.superRefine((response, context) => {
|
|
519
|
+
for (const [index, effect] of (response.cookieEffects ?? []).entries()) {
|
|
520
|
+
if (effect.name === USER_SESSION_COOKIE)
|
|
521
|
+
continue;
|
|
522
|
+
context.addIssue({
|
|
523
|
+
code: "custom",
|
|
524
|
+
message: "User Browser API may only mutate its declared session cookie",
|
|
525
|
+
path: ["cookieEffects", index, "name"]
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
}).readonly();
|
|
529
|
+
var userBrowserApiResponseSchema = external_exports.strictObject({
|
|
530
|
+
status: external_exports.number().int().min(200).max(599).refine((status) => status < 300 || status >= 400),
|
|
531
|
+
body: browserApiResponseSchema,
|
|
532
|
+
sessionCookie: sessionCookieSchema.optional()
|
|
533
|
+
}).superRefine((response, context) => {
|
|
534
|
+
const httpSucceeded = response.status >= 200 && response.status < 300;
|
|
535
|
+
if (httpSucceeded === !isBrowserApiFailure(response.body))
|
|
536
|
+
return;
|
|
537
|
+
context.addIssue({
|
|
538
|
+
code: "custom",
|
|
539
|
+
message: "HTTP status and browser API response code disagree",
|
|
540
|
+
path: ["body", "code"]
|
|
541
|
+
});
|
|
542
|
+
}).readonly();
|
|
543
|
+
var userCredentialLifecycleEventSchema = external_exports.strictObject({
|
|
544
|
+
protocol: external_exports.literal("zlooks.user.credential-lifecycle"),
|
|
545
|
+
kind: external_exports.enum(["registration", "recovery"]),
|
|
546
|
+
authenticationTransactionId: external_exports.uuid(),
|
|
547
|
+
extensionId: external_exports.string().regex(/^[a-z][a-z0-9._-]{0,127}$/),
|
|
548
|
+
methodId: external_exports.string().regex(/^[a-z][a-z0-9._-]{0,127}$/),
|
|
549
|
+
subject: external_exports.string().trim().min(1).max(512),
|
|
550
|
+
email: external_exports.email().max(320),
|
|
551
|
+
occurredAt: external_exports.iso.datetime({ offset: true })
|
|
552
|
+
}).readonly();
|
|
553
|
+
var userCredentialLifecycleResponseSchema = external_exports.strictObject({
|
|
554
|
+
acknowledged: external_exports.literal(true)
|
|
555
|
+
}).readonly();
|
|
556
|
+
|
|
557
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/_util/getReactMajorVersionCanDelMe.js
|
|
558
|
+
function getReactMajorVersion() {
|
|
559
|
+
const majorVersion = Number.parseInt(version.split(".")[0], 10);
|
|
560
|
+
return majorVersion;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// ../../node_modules/.pnpm/compute-scroll-into-view@3.1.1/node_modules/compute-scroll-into-view/dist/index.js
|
|
564
|
+
var t = (t2) => "object" == typeof t2 && null != t2 && 1 === t2.nodeType;
|
|
565
|
+
var e = (t2, e3) => (!e3 || "hidden" !== t2) && ("visible" !== t2 && "clip" !== t2);
|
|
566
|
+
var n = (t2, n2) => {
|
|
567
|
+
if (t2.clientHeight < t2.scrollHeight || t2.clientWidth < t2.scrollWidth) {
|
|
568
|
+
const o3 = getComputedStyle(t2, null);
|
|
569
|
+
return e(o3.overflowY, n2) || e(o3.overflowX, n2) || ((t3) => {
|
|
570
|
+
const e3 = ((t4) => {
|
|
571
|
+
if (!t4.ownerDocument || !t4.ownerDocument.defaultView) return null;
|
|
572
|
+
try {
|
|
573
|
+
return t4.ownerDocument.defaultView.frameElement;
|
|
574
|
+
} catch (t5) {
|
|
575
|
+
return null;
|
|
576
|
+
}
|
|
577
|
+
})(t3);
|
|
578
|
+
return !!e3 && (e3.clientHeight < t3.scrollHeight || e3.clientWidth < t3.scrollWidth);
|
|
579
|
+
})(t2);
|
|
580
|
+
}
|
|
581
|
+
return false;
|
|
582
|
+
};
|
|
583
|
+
var o = (t2, e3, n2, o3, l2, r2, i, s) => r2 < t2 && i > e3 || r2 > t2 && i < e3 ? 0 : r2 <= t2 && s <= n2 || i >= e3 && s >= n2 ? r2 - t2 - o3 : i > e3 && s < n2 || r2 < t2 && s > n2 ? i - e3 + l2 : 0;
|
|
584
|
+
var l = (t2) => {
|
|
585
|
+
const e3 = t2.parentElement;
|
|
586
|
+
return null == e3 ? t2.getRootNode().host || null : e3;
|
|
587
|
+
};
|
|
588
|
+
var r = (e3, r2) => {
|
|
589
|
+
var i, s, d, h;
|
|
590
|
+
if ("undefined" == typeof document) return [];
|
|
591
|
+
const { scrollMode: c, block: f, inline: u, boundary: a, skipOverflowHiddenElements: g } = r2, p = "function" == typeof a ? a : (t2) => t2 !== a;
|
|
592
|
+
if (!t(e3)) throw new TypeError("Invalid target");
|
|
593
|
+
const m = document.scrollingElement || document.documentElement, w = [];
|
|
594
|
+
let W = e3;
|
|
595
|
+
for (; t(W) && p(W); ) {
|
|
596
|
+
if (W = l(W), W === m) {
|
|
597
|
+
w.push(W);
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
null != W && W === document.body && n(W) && !n(document.documentElement) || null != W && n(W, g) && w.push(W);
|
|
601
|
+
}
|
|
602
|
+
const b = null != (s = null == (i = window.visualViewport) ? void 0 : i.width) ? s : innerWidth, H = null != (h = null == (d = window.visualViewport) ? void 0 : d.height) ? h : innerHeight, { scrollX: y, scrollY: M } = window, { height: v, width: E, top: x, right: C, bottom: I, left: R } = e3.getBoundingClientRect(), { top: T, right: B, bottom: F, left: V } = ((t2) => {
|
|
603
|
+
const e4 = window.getComputedStyle(t2);
|
|
604
|
+
return { top: parseFloat(e4.scrollMarginTop) || 0, right: parseFloat(e4.scrollMarginRight) || 0, bottom: parseFloat(e4.scrollMarginBottom) || 0, left: parseFloat(e4.scrollMarginLeft) || 0 };
|
|
605
|
+
})(e3);
|
|
606
|
+
let k = "start" === f || "nearest" === f ? x - T : "end" === f ? I + F : x + v / 2 - T + F, D = "center" === u ? R + E / 2 - V + B : "end" === u ? C + B : R - V;
|
|
607
|
+
const L = [];
|
|
608
|
+
for (let t2 = 0; t2 < w.length; t2++) {
|
|
609
|
+
const e4 = w[t2], { height: l2, width: r3, top: i2, right: s2, bottom: d2, left: h2 } = e4.getBoundingClientRect();
|
|
610
|
+
if ("if-needed" === c && x >= 0 && R >= 0 && I <= H && C <= b && (e4 === m && !n(e4) || x >= i2 && I <= d2 && R >= h2 && C <= s2)) return L;
|
|
611
|
+
const a2 = getComputedStyle(e4), g2 = parseInt(a2.borderLeftWidth, 10), p2 = parseInt(a2.borderTopWidth, 10), W2 = parseInt(a2.borderRightWidth, 10), T2 = parseInt(a2.borderBottomWidth, 10);
|
|
612
|
+
let B2 = 0, F2 = 0;
|
|
613
|
+
const V2 = "offsetWidth" in e4 ? e4.offsetWidth - e4.clientWidth - g2 - W2 : 0, S = "offsetHeight" in e4 ? e4.offsetHeight - e4.clientHeight - p2 - T2 : 0, X = "offsetWidth" in e4 ? 0 === e4.offsetWidth ? 0 : r3 / e4.offsetWidth : 0, Y = "offsetHeight" in e4 ? 0 === e4.offsetHeight ? 0 : l2 / e4.offsetHeight : 0;
|
|
614
|
+
if (m === e4) B2 = "start" === f ? k : "end" === f ? k - H : "nearest" === f ? o(M, M + H, H, p2, T2, M + k, M + k + v, v) : k - H / 2, F2 = "start" === u ? D : "center" === u ? D - b / 2 : "end" === u ? D - b : o(y, y + b, b, g2, W2, y + D, y + D + E, E), B2 = Math.max(0, B2 + M), F2 = Math.max(0, F2 + y);
|
|
615
|
+
else {
|
|
616
|
+
B2 = "start" === f ? k - i2 - p2 : "end" === f ? k - d2 + T2 + S : "nearest" === f ? o(i2, d2, l2, p2, T2 + S, k, k + v, v) : k - (i2 + l2 / 2) + S / 2, F2 = "start" === u ? D - h2 - g2 : "center" === u ? D - (h2 + r3 / 2) + V2 / 2 : "end" === u ? D - s2 + W2 + V2 : o(h2, s2, r3, g2, W2 + V2, D, D + E, E);
|
|
617
|
+
const { scrollLeft: t3, scrollTop: n2 } = e4;
|
|
618
|
+
B2 = 0 === Y ? 0 : Math.max(0, Math.min(n2 + B2 / Y, e4.scrollHeight - l2 / Y + S)), F2 = 0 === X ? 0 : Math.max(0, Math.min(t3 + F2 / X, e4.scrollWidth - r3 / X + V2)), k += n2 - B2, D += t3 - F2;
|
|
619
|
+
}
|
|
620
|
+
L.push({ el: e4, top: B2, left: F2 });
|
|
621
|
+
}
|
|
622
|
+
return L;
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
// ../../node_modules/.pnpm/scroll-into-view-if-needed@3.1.0/node_modules/scroll-into-view-if-needed/dist/index.js
|
|
626
|
+
var o2 = (t2) => false === t2 ? { block: "end", inline: "nearest" } : ((t3) => t3 === Object(t3) && 0 !== Object.keys(t3).length)(t2) ? t2 : { block: "start", inline: "nearest" };
|
|
627
|
+
function e2(e3, r2) {
|
|
628
|
+
if (!e3.isConnected || !((t2) => {
|
|
629
|
+
let o3 = t2;
|
|
630
|
+
for (; o3 && o3.parentNode; ) {
|
|
631
|
+
if (o3.parentNode === document) return true;
|
|
632
|
+
o3 = o3.parentNode instanceof ShadowRoot ? o3.parentNode.host : o3.parentNode;
|
|
633
|
+
}
|
|
634
|
+
return false;
|
|
635
|
+
})(e3)) return;
|
|
636
|
+
const n2 = ((t2) => {
|
|
637
|
+
const o3 = window.getComputedStyle(t2);
|
|
638
|
+
return { top: parseFloat(o3.scrollMarginTop) || 0, right: parseFloat(o3.scrollMarginRight) || 0, bottom: parseFloat(o3.scrollMarginBottom) || 0, left: parseFloat(o3.scrollMarginLeft) || 0 };
|
|
639
|
+
})(e3);
|
|
640
|
+
if (((t2) => "object" == typeof t2 && "function" == typeof t2.behavior)(r2)) return r2.behavior(r(e3, r2));
|
|
641
|
+
const l2 = "boolean" == typeof r2 || null == r2 ? void 0 : r2.behavior;
|
|
642
|
+
for (const { el: a, top: i, left: s } of r(e3, o2(r2))) {
|
|
643
|
+
const t2 = i - n2.top + n2.bottom, o3 = s - n2.left + n2.right;
|
|
644
|
+
a.scroll({ top: t2, left: o3, behavior: l2 });
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
// ../../node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
649
|
+
function _extends() {
|
|
650
|
+
return _extends = Object.assign ? Object.assign.bind() : function(n2) {
|
|
651
|
+
for (var e3 = 1; e3 < arguments.length; e3++) {
|
|
652
|
+
var t2 = arguments[e3];
|
|
653
|
+
for (var r2 in t2) ({}).hasOwnProperty.call(t2, r2) && (n2[r2] = t2[r2]);
|
|
654
|
+
}
|
|
655
|
+
return n2;
|
|
656
|
+
}, _extends.apply(null, arguments);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/app/index.js
|
|
660
|
+
var App = App_default;
|
|
661
|
+
App.useApp = useApp_default;
|
|
662
|
+
var app_default = App;
|
|
663
|
+
|
|
664
|
+
// ../../node_modules/.pnpm/@ant-design+icons@6.3.2_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@ant-design/icons/es/icons/SearchOutlined.js
|
|
665
|
+
var import_SearchOutlined = __toESM(require_SearchOutlined());
|
|
666
|
+
function _extends2() {
|
|
667
|
+
_extends2 = Object.assign ? Object.assign.bind() : function(target) {
|
|
668
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
669
|
+
var source = arguments[i];
|
|
670
|
+
for (var key in source) {
|
|
671
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
672
|
+
target[key] = source[key];
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return target;
|
|
677
|
+
};
|
|
678
|
+
return _extends2.apply(this, arguments);
|
|
679
|
+
}
|
|
680
|
+
var SearchOutlined = (props, ref) => /* @__PURE__ */ createElement(AntdIconLight_default, _extends2({}, props, {
|
|
681
|
+
ref,
|
|
682
|
+
icon: import_SearchOutlined.default
|
|
683
|
+
}));
|
|
684
|
+
var RefIcon = /* @__PURE__ */ forwardRef(SearchOutlined);
|
|
685
|
+
if (true) {
|
|
686
|
+
RefIcon.displayName = "SearchOutlined";
|
|
687
|
+
}
|
|
688
|
+
var SearchOutlined_default = RefIcon;
|
|
689
|
+
|
|
690
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/button/index.js
|
|
691
|
+
var button_default = Button_default;
|
|
692
|
+
|
|
693
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/util.js
|
|
694
|
+
var formItemNameBlackList = ["parentNode"];
|
|
695
|
+
var defaultItemNamePrefixCls = "form_item";
|
|
696
|
+
function toArray2(candidate) {
|
|
697
|
+
if (candidate === void 0 || candidate === false) {
|
|
698
|
+
return [];
|
|
699
|
+
}
|
|
700
|
+
return Array.isArray(candidate) ? candidate : [candidate];
|
|
701
|
+
}
|
|
702
|
+
function getFieldId(namePath, formName) {
|
|
703
|
+
if (!namePath.length) {
|
|
704
|
+
return void 0;
|
|
705
|
+
}
|
|
706
|
+
const mergedId = namePath.join("_");
|
|
707
|
+
if (formName) {
|
|
708
|
+
return `${formName}_${mergedId}`;
|
|
709
|
+
}
|
|
710
|
+
const isIllegalName = formItemNameBlackList.includes(mergedId);
|
|
711
|
+
return isIllegalName ? `${defaultItemNamePrefixCls}_${mergedId}` : mergedId;
|
|
712
|
+
}
|
|
713
|
+
function getStatus(errors, warnings, meta, defaultValidateStatus, hasFeedback, validateStatus) {
|
|
714
|
+
let status = defaultValidateStatus;
|
|
715
|
+
if (validateStatus !== void 0) {
|
|
716
|
+
status = validateStatus;
|
|
717
|
+
} else if (meta.validating) {
|
|
718
|
+
status = "validating";
|
|
719
|
+
} else if (errors.length) {
|
|
720
|
+
status = "error";
|
|
721
|
+
} else if (warnings.length) {
|
|
722
|
+
status = "warning";
|
|
723
|
+
} else if (meta.touched || hasFeedback && meta.validated) {
|
|
724
|
+
status = "success";
|
|
725
|
+
}
|
|
726
|
+
return status;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/hooks/useForm.js
|
|
730
|
+
function toNamePathStr(name) {
|
|
731
|
+
const namePath = toArray2(name);
|
|
732
|
+
return namePath.join("_");
|
|
733
|
+
}
|
|
734
|
+
function getFieldDOMNode(name, wrapForm) {
|
|
735
|
+
const field = wrapForm.getFieldInstance(name);
|
|
736
|
+
const fieldDom = getDOM(field);
|
|
737
|
+
if (fieldDom) {
|
|
738
|
+
return fieldDom;
|
|
739
|
+
}
|
|
740
|
+
const fieldId = getFieldId(toArray2(name), wrapForm.__INTERNAL__.name);
|
|
741
|
+
if (fieldId) {
|
|
742
|
+
return document.getElementById(fieldId);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
function useForm(form) {
|
|
746
|
+
const [rcForm] = useForm_default();
|
|
747
|
+
const itemsRef = useRef({});
|
|
748
|
+
const wrapForm = useMemo(() => form ?? {
|
|
749
|
+
...rcForm,
|
|
750
|
+
__INTERNAL__: {
|
|
751
|
+
itemRef: (name) => (node) => {
|
|
752
|
+
const namePathStr = toNamePathStr(name);
|
|
753
|
+
if (node) {
|
|
754
|
+
itemsRef.current[namePathStr] = node;
|
|
755
|
+
} else {
|
|
756
|
+
delete itemsRef.current[namePathStr];
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
scrollToField: (name, options = {}) => {
|
|
761
|
+
const {
|
|
762
|
+
focus,
|
|
763
|
+
...restOpt
|
|
764
|
+
} = options;
|
|
765
|
+
const node = getFieldDOMNode(name, wrapForm);
|
|
766
|
+
if (node) {
|
|
767
|
+
e2(node, {
|
|
768
|
+
scrollMode: "if-needed",
|
|
769
|
+
block: "nearest",
|
|
770
|
+
...restOpt
|
|
771
|
+
});
|
|
772
|
+
if (focus) {
|
|
773
|
+
wrapForm.focusField(name);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
},
|
|
777
|
+
focusField: (name) => {
|
|
778
|
+
const itemRef = wrapForm.getFieldInstance(name);
|
|
779
|
+
if (isFunction(itemRef?.focus)) {
|
|
780
|
+
itemRef.focus();
|
|
781
|
+
} else {
|
|
782
|
+
getFieldDOMNode(name, wrapForm)?.focus?.();
|
|
783
|
+
}
|
|
784
|
+
},
|
|
785
|
+
getFieldInstance: (name) => {
|
|
786
|
+
const namePathStr = toNamePathStr(name);
|
|
787
|
+
return itemsRef.current[namePathStr];
|
|
788
|
+
}
|
|
789
|
+
}, [form, rcForm]);
|
|
790
|
+
return [wrapForm];
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/grid/RowContext.js
|
|
794
|
+
var RowContext = /* @__PURE__ */ createContext({});
|
|
795
|
+
var RowContext_default = RowContext;
|
|
796
|
+
|
|
797
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/grid/col.js
|
|
798
|
+
function parseFlex(flex) {
|
|
799
|
+
if (flex === "auto") {
|
|
800
|
+
return "1 1 auto";
|
|
801
|
+
}
|
|
802
|
+
if (isNumber(flex)) {
|
|
803
|
+
return `${flex} ${flex} auto`;
|
|
804
|
+
}
|
|
805
|
+
if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) {
|
|
806
|
+
return `0 0 ${flex}`;
|
|
807
|
+
}
|
|
808
|
+
return flex;
|
|
809
|
+
}
|
|
810
|
+
var Col = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
811
|
+
const {
|
|
812
|
+
getPrefixCls,
|
|
813
|
+
direction
|
|
814
|
+
} = useContext(ConfigContext);
|
|
815
|
+
const {
|
|
816
|
+
gutter,
|
|
817
|
+
wrap
|
|
818
|
+
} = useContext(RowContext_default);
|
|
819
|
+
const {
|
|
820
|
+
prefixCls: customizePrefixCls,
|
|
821
|
+
span,
|
|
822
|
+
order,
|
|
823
|
+
offset,
|
|
824
|
+
push,
|
|
825
|
+
pull,
|
|
826
|
+
className,
|
|
827
|
+
children,
|
|
828
|
+
flex,
|
|
829
|
+
style,
|
|
830
|
+
...others
|
|
831
|
+
} = props;
|
|
832
|
+
const prefixCls = getPrefixCls("col", customizePrefixCls);
|
|
833
|
+
const rootPrefixCls = getPrefixCls();
|
|
834
|
+
const [hashId, cssVarCls] = useColStyle(prefixCls);
|
|
835
|
+
const [varName] = genCssVar(rootPrefixCls, "col");
|
|
836
|
+
const sizeStyle = {};
|
|
837
|
+
let sizeClassObj = {};
|
|
838
|
+
responsiveArrayReversed.forEach((size) => {
|
|
839
|
+
let sizeProps = {};
|
|
840
|
+
const propSize = props[size];
|
|
841
|
+
if (isNumber(propSize)) {
|
|
842
|
+
sizeProps.span = propSize;
|
|
843
|
+
} else if (isPlainObject(propSize)) {
|
|
844
|
+
sizeProps = propSize || {};
|
|
845
|
+
}
|
|
846
|
+
delete others[size];
|
|
847
|
+
sizeClassObj = {
|
|
848
|
+
...sizeClassObj,
|
|
849
|
+
[`${prefixCls}-${size}-${sizeProps.span}`]: isNonNullable(sizeProps.span),
|
|
850
|
+
[`${prefixCls}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0,
|
|
851
|
+
[`${prefixCls}-${size}-offset-${sizeProps.offset}`]: sizeProps.offset || sizeProps.offset === 0,
|
|
852
|
+
[`${prefixCls}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0,
|
|
853
|
+
[`${prefixCls}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0,
|
|
854
|
+
[`${prefixCls}-rtl`]: direction === "rtl"
|
|
855
|
+
};
|
|
856
|
+
if (sizeProps.flex || sizeProps.flex === 0) {
|
|
857
|
+
sizeClassObj[`${prefixCls}-${size}-flex`] = true;
|
|
858
|
+
sizeStyle[varName(`${size}-flex`)] = parseFlex(sizeProps.flex);
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
const classes = clsx(prefixCls, {
|
|
862
|
+
[`${prefixCls}-${span}`]: span !== void 0,
|
|
863
|
+
[`${prefixCls}-order-${order}`]: order,
|
|
864
|
+
[`${prefixCls}-offset-${offset}`]: offset,
|
|
865
|
+
[`${prefixCls}-push-${push}`]: push,
|
|
866
|
+
[`${prefixCls}-pull-${pull}`]: pull
|
|
867
|
+
}, className, sizeClassObj, hashId, cssVarCls);
|
|
868
|
+
const mergedStyle = {};
|
|
869
|
+
if (gutter?.[0]) {
|
|
870
|
+
const horizontalGutter = isNumber(gutter[0]) ? `${gutter[0] / 2}px` : `calc(${gutter[0]} / 2)`;
|
|
871
|
+
mergedStyle.paddingInline = horizontalGutter;
|
|
872
|
+
}
|
|
873
|
+
if (flex || flex === 0) {
|
|
874
|
+
mergedStyle.flex = parseFlex(flex);
|
|
875
|
+
if (wrap === false && !mergedStyle.minWidth) {
|
|
876
|
+
mergedStyle.minWidth = 0;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
return /* @__PURE__ */ createElement("div", {
|
|
880
|
+
...others,
|
|
881
|
+
style: {
|
|
882
|
+
...mergedStyle,
|
|
883
|
+
...style,
|
|
884
|
+
...sizeStyle
|
|
885
|
+
},
|
|
886
|
+
className: classes,
|
|
887
|
+
ref
|
|
888
|
+
}, children);
|
|
889
|
+
});
|
|
890
|
+
if (true) {
|
|
891
|
+
Col.displayName = "Col";
|
|
892
|
+
}
|
|
893
|
+
var col_default = Col;
|
|
894
|
+
|
|
895
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/grid/hooks/useGutter.js
|
|
896
|
+
function useGutter(gutter, screens) {
|
|
897
|
+
const results = [void 0, void 0];
|
|
898
|
+
const normalizedGutter = Array.isArray(gutter) ? gutter : [gutter, void 0];
|
|
899
|
+
const mergedScreens = screens || {
|
|
900
|
+
xs: true,
|
|
901
|
+
sm: true,
|
|
902
|
+
md: true,
|
|
903
|
+
lg: true,
|
|
904
|
+
xl: true,
|
|
905
|
+
xxl: true,
|
|
906
|
+
xxxl: true
|
|
907
|
+
};
|
|
908
|
+
normalizedGutter.forEach((g, index) => {
|
|
909
|
+
if (isPlainObject(g)) {
|
|
910
|
+
for (let i = 0; i < responsiveArray.length; i++) {
|
|
911
|
+
const breakpoint = responsiveArray[i];
|
|
912
|
+
if (mergedScreens[breakpoint] && g[breakpoint] !== void 0) {
|
|
913
|
+
results[index] = g[breakpoint];
|
|
914
|
+
break;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
} else {
|
|
918
|
+
results[index] = g;
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
return results;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/grid/row.js
|
|
925
|
+
var useMergedPropByScreen = (oriProp, screen) => {
|
|
926
|
+
const [prop, setProp] = useState(() => isString(oriProp) ? oriProp : "");
|
|
927
|
+
const calcMergedAlignOrJustify = () => {
|
|
928
|
+
if (isString(oriProp)) {
|
|
929
|
+
setProp(oriProp);
|
|
930
|
+
}
|
|
931
|
+
if (!isPlainObject(oriProp)) {
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
934
|
+
for (let i = 0; i < responsiveArray.length; i++) {
|
|
935
|
+
const breakpoint = responsiveArray[i];
|
|
936
|
+
if (!screen || !screen[breakpoint]) {
|
|
937
|
+
continue;
|
|
938
|
+
}
|
|
939
|
+
const curVal = oriProp[breakpoint];
|
|
940
|
+
if (curVal !== void 0) {
|
|
941
|
+
setProp(curVal);
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
useEffect(() => {
|
|
947
|
+
calcMergedAlignOrJustify();
|
|
948
|
+
}, [JSON.stringify(oriProp), screen]);
|
|
949
|
+
return prop;
|
|
950
|
+
};
|
|
951
|
+
var Row = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
952
|
+
const {
|
|
953
|
+
prefixCls: customizePrefixCls,
|
|
954
|
+
justify,
|
|
955
|
+
align,
|
|
956
|
+
className,
|
|
957
|
+
style,
|
|
958
|
+
children,
|
|
959
|
+
gutter = 0,
|
|
960
|
+
wrap,
|
|
961
|
+
...others
|
|
962
|
+
} = props;
|
|
963
|
+
const {
|
|
964
|
+
getPrefixCls,
|
|
965
|
+
direction
|
|
966
|
+
} = useContext(ConfigContext);
|
|
967
|
+
const screens = useBreakpoint_default(true, null);
|
|
968
|
+
const mergedAlign = useMergedPropByScreen(align, screens);
|
|
969
|
+
const mergedJustify = useMergedPropByScreen(justify, screens);
|
|
970
|
+
const prefixCls = getPrefixCls("row", customizePrefixCls);
|
|
971
|
+
const [hashId, cssVarCls] = useRowStyle(prefixCls);
|
|
972
|
+
const gutters = useGutter(gutter, screens);
|
|
973
|
+
const classes = clsx(prefixCls, {
|
|
974
|
+
[`${prefixCls}-no-wrap`]: wrap === false,
|
|
975
|
+
[`${prefixCls}-${mergedJustify}`]: mergedJustify,
|
|
976
|
+
[`${prefixCls}-${mergedAlign}`]: mergedAlign,
|
|
977
|
+
[`${prefixCls}-rtl`]: direction === "rtl"
|
|
978
|
+
}, className, hashId, cssVarCls);
|
|
979
|
+
const rowStyle = {};
|
|
980
|
+
if (gutters?.[0]) {
|
|
981
|
+
const horizontalGutter = isNumber(gutters[0]) ? `${gutters[0] / -2}px` : `calc(${gutters[0]} / -2)`;
|
|
982
|
+
rowStyle.marginInline = horizontalGutter;
|
|
983
|
+
}
|
|
984
|
+
const [gutterH, gutterV] = gutters;
|
|
985
|
+
rowStyle.rowGap = gutterV;
|
|
986
|
+
const rowContext = useMemo(() => ({
|
|
987
|
+
gutter: [gutterH, gutterV],
|
|
988
|
+
wrap
|
|
989
|
+
}), [gutterH, gutterV, wrap]);
|
|
990
|
+
return /* @__PURE__ */ createElement(RowContext_default.Provider, {
|
|
991
|
+
value: rowContext
|
|
992
|
+
}, /* @__PURE__ */ createElement("div", {
|
|
993
|
+
...others,
|
|
994
|
+
className: classes,
|
|
995
|
+
style: {
|
|
996
|
+
...rowStyle,
|
|
997
|
+
...style
|
|
998
|
+
},
|
|
999
|
+
ref
|
|
1000
|
+
}, children));
|
|
1001
|
+
});
|
|
1002
|
+
if (true) {
|
|
1003
|
+
Row.displayName = "Row";
|
|
1004
|
+
}
|
|
1005
|
+
var row_default = Row;
|
|
1006
|
+
|
|
1007
|
+
// ../../node_modules/.pnpm/@rc-component+segmented@1.3.0_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@rc-component/segmented/es/MotionThumb.js
|
|
1008
|
+
var calcThumbStyle = (targetElement, vertical) => {
|
|
1009
|
+
if (!targetElement) return null;
|
|
1010
|
+
const style = {
|
|
1011
|
+
left: targetElement.offsetLeft,
|
|
1012
|
+
right: targetElement.parentElement.clientWidth - targetElement.clientWidth - targetElement.offsetLeft,
|
|
1013
|
+
width: targetElement.clientWidth,
|
|
1014
|
+
top: targetElement.offsetTop,
|
|
1015
|
+
bottom: targetElement.parentElement.clientHeight - targetElement.clientHeight - targetElement.offsetTop,
|
|
1016
|
+
height: targetElement.clientHeight
|
|
1017
|
+
};
|
|
1018
|
+
if (vertical) {
|
|
1019
|
+
return {
|
|
1020
|
+
left: 0,
|
|
1021
|
+
right: 0,
|
|
1022
|
+
width: 0,
|
|
1023
|
+
top: style.top,
|
|
1024
|
+
bottom: style.bottom,
|
|
1025
|
+
height: style.height
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
return {
|
|
1029
|
+
left: style.left,
|
|
1030
|
+
right: style.right,
|
|
1031
|
+
width: style.width,
|
|
1032
|
+
top: 0,
|
|
1033
|
+
bottom: 0,
|
|
1034
|
+
height: 0
|
|
1035
|
+
};
|
|
1036
|
+
};
|
|
1037
|
+
var toPX = (value) => value !== void 0 ? `${value}px` : void 0;
|
|
1038
|
+
function MotionThumb(props) {
|
|
1039
|
+
const {
|
|
1040
|
+
prefixCls,
|
|
1041
|
+
containerRef,
|
|
1042
|
+
value,
|
|
1043
|
+
getValueIndex,
|
|
1044
|
+
motionName,
|
|
1045
|
+
onMotionStart,
|
|
1046
|
+
onMotionEnd,
|
|
1047
|
+
direction,
|
|
1048
|
+
vertical = false
|
|
1049
|
+
} = props;
|
|
1050
|
+
const thumbRef = useRef(null);
|
|
1051
|
+
const [prevValue, setPrevValue] = useState(value);
|
|
1052
|
+
const findValueElement = (val) => {
|
|
1053
|
+
const index = getValueIndex(val);
|
|
1054
|
+
const ele = containerRef.current?.querySelectorAll(`.${prefixCls}-item`)[index];
|
|
1055
|
+
return ele?.offsetParent && ele;
|
|
1056
|
+
};
|
|
1057
|
+
const [prevStyle, setPrevStyle] = useState(null);
|
|
1058
|
+
const [nextStyle, setNextStyle] = useState(null);
|
|
1059
|
+
useLayoutEffect_default(() => {
|
|
1060
|
+
if (prevValue !== value) {
|
|
1061
|
+
const prev = findValueElement(prevValue);
|
|
1062
|
+
const next = findValueElement(value);
|
|
1063
|
+
const calcPrevStyle = calcThumbStyle(prev, vertical);
|
|
1064
|
+
const calcNextStyle = calcThumbStyle(next, vertical);
|
|
1065
|
+
setPrevValue(value);
|
|
1066
|
+
setPrevStyle(calcPrevStyle);
|
|
1067
|
+
setNextStyle(calcNextStyle);
|
|
1068
|
+
if (prev && next) {
|
|
1069
|
+
onMotionStart();
|
|
1070
|
+
} else {
|
|
1071
|
+
onMotionEnd();
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
}, [value]);
|
|
1075
|
+
const thumbStart = useMemo(() => {
|
|
1076
|
+
if (vertical) {
|
|
1077
|
+
return toPX(prevStyle?.top ?? 0);
|
|
1078
|
+
}
|
|
1079
|
+
if (direction === "rtl") {
|
|
1080
|
+
return toPX(-prevStyle?.right);
|
|
1081
|
+
}
|
|
1082
|
+
return toPX(prevStyle?.left);
|
|
1083
|
+
}, [vertical, direction, prevStyle]);
|
|
1084
|
+
const thumbActive = useMemo(() => {
|
|
1085
|
+
if (vertical) {
|
|
1086
|
+
return toPX(nextStyle?.top ?? 0);
|
|
1087
|
+
}
|
|
1088
|
+
if (direction === "rtl") {
|
|
1089
|
+
return toPX(-nextStyle?.right);
|
|
1090
|
+
}
|
|
1091
|
+
return toPX(nextStyle?.left);
|
|
1092
|
+
}, [vertical, direction, nextStyle]);
|
|
1093
|
+
const onAppearStart = () => {
|
|
1094
|
+
if (vertical) {
|
|
1095
|
+
return {
|
|
1096
|
+
transform: "translateY(var(--thumb-start-top))",
|
|
1097
|
+
height: "var(--thumb-start-height)"
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
return {
|
|
1101
|
+
transform: "translateX(var(--thumb-start-left))",
|
|
1102
|
+
width: "var(--thumb-start-width)"
|
|
1103
|
+
};
|
|
1104
|
+
};
|
|
1105
|
+
const onAppearActive = () => {
|
|
1106
|
+
if (vertical) {
|
|
1107
|
+
return {
|
|
1108
|
+
transform: "translateY(var(--thumb-active-top))",
|
|
1109
|
+
height: "var(--thumb-active-height)"
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
return {
|
|
1113
|
+
transform: "translateX(var(--thumb-active-left))",
|
|
1114
|
+
width: "var(--thumb-active-width)"
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
const onVisibleChanged = () => {
|
|
1118
|
+
setPrevStyle(null);
|
|
1119
|
+
setNextStyle(null);
|
|
1120
|
+
onMotionEnd();
|
|
1121
|
+
};
|
|
1122
|
+
if (!prevStyle || !nextStyle) {
|
|
1123
|
+
return null;
|
|
1124
|
+
}
|
|
1125
|
+
return /* @__PURE__ */ createElement(es_default, {
|
|
1126
|
+
visible: true,
|
|
1127
|
+
motionName,
|
|
1128
|
+
motionAppear: true,
|
|
1129
|
+
onAppearStart,
|
|
1130
|
+
onAppearActive,
|
|
1131
|
+
onVisibleChanged
|
|
1132
|
+
}, ({
|
|
1133
|
+
className: motionClassName,
|
|
1134
|
+
style: motionStyle
|
|
1135
|
+
}, ref) => {
|
|
1136
|
+
const mergedStyle = {
|
|
1137
|
+
...motionStyle,
|
|
1138
|
+
"--thumb-start-left": thumbStart,
|
|
1139
|
+
"--thumb-start-width": toPX(prevStyle?.width),
|
|
1140
|
+
"--thumb-active-left": thumbActive,
|
|
1141
|
+
"--thumb-active-width": toPX(nextStyle?.width),
|
|
1142
|
+
"--thumb-start-top": thumbStart,
|
|
1143
|
+
"--thumb-start-height": toPX(prevStyle?.height),
|
|
1144
|
+
"--thumb-active-top": thumbActive,
|
|
1145
|
+
"--thumb-active-height": toPX(nextStyle?.height)
|
|
1146
|
+
};
|
|
1147
|
+
const motionProps = {
|
|
1148
|
+
ref: composeRef(thumbRef, ref),
|
|
1149
|
+
style: mergedStyle,
|
|
1150
|
+
className: clsx(`${prefixCls}-thumb`, motionClassName)
|
|
1151
|
+
};
|
|
1152
|
+
if (false) {
|
|
1153
|
+
motionProps["data-test-style"] = JSON.stringify(mergedStyle);
|
|
1154
|
+
}
|
|
1155
|
+
return /* @__PURE__ */ createElement("div", motionProps);
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
// ../../node_modules/.pnpm/@rc-component+segmented@1.3.0_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@rc-component/segmented/es/index.js
|
|
1160
|
+
function getValidTitle(option) {
|
|
1161
|
+
if (typeof option.title !== "undefined") {
|
|
1162
|
+
return option.title;
|
|
1163
|
+
}
|
|
1164
|
+
if (typeof option.label !== "object") {
|
|
1165
|
+
return option.label?.toString();
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
function normalizeOptions(options) {
|
|
1169
|
+
return options.map((option) => {
|
|
1170
|
+
if (typeof option === "object" && option !== null) {
|
|
1171
|
+
const validTitle = getValidTitle(option);
|
|
1172
|
+
return {
|
|
1173
|
+
...option,
|
|
1174
|
+
title: validTitle
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
return {
|
|
1178
|
+
label: option?.toString(),
|
|
1179
|
+
title: option?.toString(),
|
|
1180
|
+
value: option
|
|
1181
|
+
};
|
|
1182
|
+
});
|
|
1183
|
+
}
|
|
1184
|
+
var InternalSegmentedOption = ({
|
|
1185
|
+
prefixCls,
|
|
1186
|
+
className,
|
|
1187
|
+
style,
|
|
1188
|
+
styles,
|
|
1189
|
+
classNames: segmentedClassNames,
|
|
1190
|
+
data,
|
|
1191
|
+
disabled,
|
|
1192
|
+
checked,
|
|
1193
|
+
label,
|
|
1194
|
+
title,
|
|
1195
|
+
value,
|
|
1196
|
+
name,
|
|
1197
|
+
onChange,
|
|
1198
|
+
onFocus,
|
|
1199
|
+
onBlur,
|
|
1200
|
+
onKeyDown,
|
|
1201
|
+
onKeyUp,
|
|
1202
|
+
onMouseDown,
|
|
1203
|
+
itemRender = (node) => node
|
|
1204
|
+
}) => {
|
|
1205
|
+
const handleChange = (event) => {
|
|
1206
|
+
if (disabled) {
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1209
|
+
onChange(event, value);
|
|
1210
|
+
};
|
|
1211
|
+
const itemContent = /* @__PURE__ */ createElement("label", {
|
|
1212
|
+
className: clsx(className, {
|
|
1213
|
+
[`${prefixCls}-item-disabled`]: disabled
|
|
1214
|
+
}),
|
|
1215
|
+
style,
|
|
1216
|
+
onMouseDown
|
|
1217
|
+
}, /* @__PURE__ */ createElement("input", {
|
|
1218
|
+
name,
|
|
1219
|
+
className: `${prefixCls}-item-input`,
|
|
1220
|
+
type: "radio",
|
|
1221
|
+
disabled,
|
|
1222
|
+
checked,
|
|
1223
|
+
onChange: handleChange,
|
|
1224
|
+
onFocus,
|
|
1225
|
+
onBlur,
|
|
1226
|
+
onKeyDown,
|
|
1227
|
+
onKeyUp
|
|
1228
|
+
}), /* @__PURE__ */ createElement("div", {
|
|
1229
|
+
className: clsx(`${prefixCls}-item-label`, segmentedClassNames?.label),
|
|
1230
|
+
title,
|
|
1231
|
+
style: styles?.label
|
|
1232
|
+
}, label));
|
|
1233
|
+
return itemRender(itemContent, {
|
|
1234
|
+
item: data
|
|
1235
|
+
});
|
|
1236
|
+
};
|
|
1237
|
+
var Segmented = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
1238
|
+
const {
|
|
1239
|
+
prefixCls = "rc-segmented",
|
|
1240
|
+
direction,
|
|
1241
|
+
vertical,
|
|
1242
|
+
options = [],
|
|
1243
|
+
disabled,
|
|
1244
|
+
defaultValue,
|
|
1245
|
+
value,
|
|
1246
|
+
name,
|
|
1247
|
+
onChange,
|
|
1248
|
+
className = "",
|
|
1249
|
+
style,
|
|
1250
|
+
styles,
|
|
1251
|
+
classNames: segmentedClassNames,
|
|
1252
|
+
motionName = "thumb-motion",
|
|
1253
|
+
itemRender,
|
|
1254
|
+
...restProps
|
|
1255
|
+
} = props;
|
|
1256
|
+
const containerRef = useRef(null);
|
|
1257
|
+
const mergedRef = useMemo(() => composeRef(containerRef, ref), [containerRef, ref]);
|
|
1258
|
+
const segmentedOptions = useMemo(() => {
|
|
1259
|
+
return normalizeOptions(options);
|
|
1260
|
+
}, [options]);
|
|
1261
|
+
const [rawValue, setRawValue] = useControlledState(defaultValue ?? segmentedOptions[0]?.value, value);
|
|
1262
|
+
const [thumbShow, setThumbShow] = useState(false);
|
|
1263
|
+
const handleChange = (event, val) => {
|
|
1264
|
+
setRawValue(val);
|
|
1265
|
+
onChange?.(val);
|
|
1266
|
+
};
|
|
1267
|
+
const divProps = omit(restProps, ["children"]);
|
|
1268
|
+
const [isKeyboard, setIsKeyboard] = useState(false);
|
|
1269
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
1270
|
+
const handleFocus = () => {
|
|
1271
|
+
setIsFocused(true);
|
|
1272
|
+
};
|
|
1273
|
+
const handleBlur = () => {
|
|
1274
|
+
setIsFocused(false);
|
|
1275
|
+
};
|
|
1276
|
+
const handleMouseDown = () => {
|
|
1277
|
+
setIsKeyboard(false);
|
|
1278
|
+
};
|
|
1279
|
+
const handleKeyUp = (event) => {
|
|
1280
|
+
if (event.key === "Tab") {
|
|
1281
|
+
setIsKeyboard(true);
|
|
1282
|
+
}
|
|
1283
|
+
};
|
|
1284
|
+
const onOffset = (offset) => {
|
|
1285
|
+
const currentIndex = segmentedOptions.findIndex((option) => option.value === rawValue);
|
|
1286
|
+
const total = segmentedOptions.length;
|
|
1287
|
+
const nextIndex = (currentIndex + offset + total) % total;
|
|
1288
|
+
const nextOption = segmentedOptions[nextIndex];
|
|
1289
|
+
if (nextOption) {
|
|
1290
|
+
setRawValue(nextOption.value);
|
|
1291
|
+
onChange?.(nextOption.value);
|
|
1292
|
+
}
|
|
1293
|
+
};
|
|
1294
|
+
const handleKeyDown = (event) => {
|
|
1295
|
+
switch (event.key) {
|
|
1296
|
+
case "ArrowLeft":
|
|
1297
|
+
case "ArrowUp":
|
|
1298
|
+
onOffset(-1);
|
|
1299
|
+
break;
|
|
1300
|
+
case "ArrowRight":
|
|
1301
|
+
case "ArrowDown":
|
|
1302
|
+
onOffset(1);
|
|
1303
|
+
break;
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
const renderOption = (segmentedOption) => {
|
|
1307
|
+
const {
|
|
1308
|
+
value: optionValue,
|
|
1309
|
+
disabled: optionDisabled
|
|
1310
|
+
} = segmentedOption;
|
|
1311
|
+
return /* @__PURE__ */ createElement(InternalSegmentedOption, _extends({}, segmentedOption, {
|
|
1312
|
+
name,
|
|
1313
|
+
data: segmentedOption,
|
|
1314
|
+
itemRender,
|
|
1315
|
+
key: optionValue,
|
|
1316
|
+
prefixCls,
|
|
1317
|
+
className: clsx(segmentedOption.className, `${prefixCls}-item`, segmentedClassNames?.item, {
|
|
1318
|
+
[`${prefixCls}-item-selected`]: optionValue === rawValue && !thumbShow,
|
|
1319
|
+
[`${prefixCls}-item-focused`]: isFocused && isKeyboard && optionValue === rawValue
|
|
1320
|
+
}),
|
|
1321
|
+
style: styles?.item,
|
|
1322
|
+
classNames: segmentedClassNames,
|
|
1323
|
+
styles,
|
|
1324
|
+
checked: optionValue === rawValue,
|
|
1325
|
+
onChange: handleChange,
|
|
1326
|
+
onFocus: handleFocus,
|
|
1327
|
+
onBlur: handleBlur,
|
|
1328
|
+
onKeyDown: handleKeyDown,
|
|
1329
|
+
onKeyUp: handleKeyUp,
|
|
1330
|
+
onMouseDown: handleMouseDown,
|
|
1331
|
+
disabled: !!disabled || !!optionDisabled
|
|
1332
|
+
}));
|
|
1333
|
+
};
|
|
1334
|
+
return /* @__PURE__ */ createElement("div", _extends({
|
|
1335
|
+
role: "radiogroup",
|
|
1336
|
+
"aria-label": "segmented control",
|
|
1337
|
+
tabIndex: disabled ? void 0 : 0,
|
|
1338
|
+
"aria-orientation": vertical ? "vertical" : "horizontal",
|
|
1339
|
+
style
|
|
1340
|
+
}, divProps, {
|
|
1341
|
+
className: clsx(prefixCls, {
|
|
1342
|
+
[`${prefixCls}-rtl`]: direction === "rtl",
|
|
1343
|
+
[`${prefixCls}-disabled`]: disabled,
|
|
1344
|
+
[`${prefixCls}-vertical`]: vertical
|
|
1345
|
+
}, className),
|
|
1346
|
+
ref: mergedRef
|
|
1347
|
+
}), /* @__PURE__ */ createElement("div", {
|
|
1348
|
+
className: `${prefixCls}-group`
|
|
1349
|
+
}, /* @__PURE__ */ createElement(MotionThumb, {
|
|
1350
|
+
vertical,
|
|
1351
|
+
prefixCls,
|
|
1352
|
+
value: rawValue,
|
|
1353
|
+
containerRef,
|
|
1354
|
+
motionName: `${prefixCls}-${motionName}`,
|
|
1355
|
+
direction,
|
|
1356
|
+
getValueIndex: (val) => segmentedOptions.findIndex((n2) => n2.value === val),
|
|
1357
|
+
onMotionStart: () => {
|
|
1358
|
+
setThumbShow(true);
|
|
1359
|
+
},
|
|
1360
|
+
onMotionEnd: () => {
|
|
1361
|
+
setThumbShow(false);
|
|
1362
|
+
}
|
|
1363
|
+
}), segmentedOptions.map(renderOption)));
|
|
1364
|
+
});
|
|
1365
|
+
if (true) {
|
|
1366
|
+
Segmented.displayName = "Segmented";
|
|
1367
|
+
}
|
|
1368
|
+
var TypedSegmented = Segmented;
|
|
1369
|
+
var es_default3 = TypedSegmented;
|
|
1370
|
+
|
|
1371
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/segmented/style/index.js
|
|
1372
|
+
function getItemDisabledStyle(cls, token) {
|
|
1373
|
+
return {
|
|
1374
|
+
[`${cls}, ${cls}:hover, ${cls}:focus`]: {
|
|
1375
|
+
color: token.colorTextDisabled,
|
|
1376
|
+
cursor: "not-allowed"
|
|
1377
|
+
}
|
|
1378
|
+
};
|
|
1379
|
+
}
|
|
1380
|
+
var getItemSelectedStyle = (token) => {
|
|
1381
|
+
return {
|
|
1382
|
+
background: token.itemSelectedBg,
|
|
1383
|
+
boxShadow: token.boxShadowTertiary
|
|
1384
|
+
};
|
|
1385
|
+
};
|
|
1386
|
+
var segmentedTextEllipsisCss = {
|
|
1387
|
+
overflow: "hidden",
|
|
1388
|
+
// handle text ellipsis
|
|
1389
|
+
...textEllipsis
|
|
1390
|
+
};
|
|
1391
|
+
var genSegmentedStyle = (token) => {
|
|
1392
|
+
const {
|
|
1393
|
+
componentCls,
|
|
1394
|
+
motionDurationSlow,
|
|
1395
|
+
motionEaseInOut,
|
|
1396
|
+
motionDurationMid
|
|
1397
|
+
} = token;
|
|
1398
|
+
const labelHeight = token.calc(token.controlHeight).sub(token.calc(token.trackPadding).mul(2)).equal();
|
|
1399
|
+
const labelHeightLG = token.calc(token.controlHeightLG).sub(token.calc(token.trackPadding).mul(2)).equal();
|
|
1400
|
+
const labelHeightSM = token.calc(token.controlHeightSM).sub(token.calc(token.trackPadding).mul(2)).equal();
|
|
1401
|
+
return {
|
|
1402
|
+
[componentCls]: {
|
|
1403
|
+
...resetComponent(token),
|
|
1404
|
+
display: "inline-block",
|
|
1405
|
+
padding: token.trackPadding,
|
|
1406
|
+
color: token.itemColor,
|
|
1407
|
+
background: token.trackBg,
|
|
1408
|
+
borderRadius: token.borderRadius,
|
|
1409
|
+
transition: `all ${motionDurationMid}`,
|
|
1410
|
+
...genFocusStyle(token),
|
|
1411
|
+
[`${componentCls}-group`]: {
|
|
1412
|
+
position: "relative",
|
|
1413
|
+
display: "flex",
|
|
1414
|
+
alignItems: "stretch",
|
|
1415
|
+
justifyItems: "flex-start",
|
|
1416
|
+
flexDirection: "row",
|
|
1417
|
+
width: "100%"
|
|
1418
|
+
},
|
|
1419
|
+
// RTL styles
|
|
1420
|
+
[`&${componentCls}-rtl`]: {
|
|
1421
|
+
direction: "rtl"
|
|
1422
|
+
},
|
|
1423
|
+
[`&${componentCls}-vertical`]: {
|
|
1424
|
+
[`${componentCls}-group`]: {
|
|
1425
|
+
flexDirection: "column"
|
|
1426
|
+
},
|
|
1427
|
+
[`${componentCls}-thumb`]: {
|
|
1428
|
+
width: "100%",
|
|
1429
|
+
height: 0,
|
|
1430
|
+
padding: `0 ${unit(token.paddingXXS)}`
|
|
1431
|
+
}
|
|
1432
|
+
},
|
|
1433
|
+
// block styles
|
|
1434
|
+
[`&${componentCls}-block`]: {
|
|
1435
|
+
display: "flex"
|
|
1436
|
+
},
|
|
1437
|
+
[`&${componentCls}-block ${componentCls}-item`]: {
|
|
1438
|
+
flex: 1,
|
|
1439
|
+
minWidth: 0
|
|
1440
|
+
},
|
|
1441
|
+
// item styles
|
|
1442
|
+
[`${componentCls}-item`]: {
|
|
1443
|
+
position: "relative",
|
|
1444
|
+
textAlign: "center",
|
|
1445
|
+
cursor: "pointer",
|
|
1446
|
+
transition: `color ${motionDurationMid}`,
|
|
1447
|
+
borderRadius: token.borderRadiusSM,
|
|
1448
|
+
// Fix Safari render bug
|
|
1449
|
+
// https://github.com/ant-design/ant-design/issues/45250
|
|
1450
|
+
transform: "translateZ(0)",
|
|
1451
|
+
"&-selected": {
|
|
1452
|
+
...getItemSelectedStyle(token),
|
|
1453
|
+
color: token.itemSelectedColor
|
|
1454
|
+
},
|
|
1455
|
+
"&-focused": genFocusOutline(token),
|
|
1456
|
+
"&::after": {
|
|
1457
|
+
content: '""',
|
|
1458
|
+
position: "absolute",
|
|
1459
|
+
zIndex: -1,
|
|
1460
|
+
width: "100%",
|
|
1461
|
+
height: "100%",
|
|
1462
|
+
top: 0,
|
|
1463
|
+
insetInlineStart: 0,
|
|
1464
|
+
borderRadius: "inherit",
|
|
1465
|
+
opacity: 0,
|
|
1466
|
+
// This is mandatory to make it not clickable or hoverable
|
|
1467
|
+
// Ref: https://github.com/ant-design/ant-design/issues/40888
|
|
1468
|
+
pointerEvents: "none",
|
|
1469
|
+
transition: ["opacity", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", ")
|
|
1470
|
+
},
|
|
1471
|
+
[`&:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)`]: {
|
|
1472
|
+
"&:hover, &:active": {
|
|
1473
|
+
color: token.itemHoverColor
|
|
1474
|
+
},
|
|
1475
|
+
"&:hover::after": {
|
|
1476
|
+
opacity: 1,
|
|
1477
|
+
backgroundColor: token.itemHoverBg
|
|
1478
|
+
},
|
|
1479
|
+
"&:active::after": {
|
|
1480
|
+
opacity: 1,
|
|
1481
|
+
backgroundColor: token.itemActiveBg
|
|
1482
|
+
}
|
|
1483
|
+
},
|
|
1484
|
+
"&-label": {
|
|
1485
|
+
minHeight: labelHeight,
|
|
1486
|
+
lineHeight: unit(labelHeight),
|
|
1487
|
+
padding: `0 ${unit(token.segmentedPaddingHorizontal)}`,
|
|
1488
|
+
...segmentedTextEllipsisCss
|
|
1489
|
+
},
|
|
1490
|
+
// syntactic sugar to add `icon` for Segmented Item
|
|
1491
|
+
"&-icon + *": {
|
|
1492
|
+
marginInlineStart: token.calc(token.marginSM).div(2).equal()
|
|
1493
|
+
},
|
|
1494
|
+
// Icons from third-party libraries render as a bare `<svg>` inside the icon wrapper,
|
|
1495
|
+
// which the `.anticon` reset never reaches. An `<svg>` has no baseline of its own, so it
|
|
1496
|
+
// is aligned by its bottom margin edge (CSS 2.1 §10.8.1) and rides above the label.
|
|
1497
|
+
// `display: inline-block` keeps it an atomic inline box so `vertical-align` still applies
|
|
1498
|
+
// even under a CSS reset that forces `svg { display: block }` (e.g. Tailwind Preflight),
|
|
1499
|
+
// which would otherwise drop the icon onto its own line. `vertical-align: middle` centres its
|
|
1500
|
+
// margin box on the x-height line; `margin-block-end` then lifts it by half its own value onto
|
|
1501
|
+
// the cap-height centre (capHeight − xHeight ≈ 0.2em across typical fonts), keeping it centred
|
|
1502
|
+
// at any icon size.
|
|
1503
|
+
// Only matches a bare `<svg>`: an `.anticon` keeps its `<svg>` one level deeper.
|
|
1504
|
+
"&-icon > svg": {
|
|
1505
|
+
display: "inline-block",
|
|
1506
|
+
verticalAlign: "middle",
|
|
1507
|
+
marginBlockEnd: "0.2em"
|
|
1508
|
+
},
|
|
1509
|
+
"&-input": {
|
|
1510
|
+
position: "absolute",
|
|
1511
|
+
insetBlockStart: 0,
|
|
1512
|
+
insetInlineStart: 0,
|
|
1513
|
+
width: 0,
|
|
1514
|
+
height: 0,
|
|
1515
|
+
opacity: 0,
|
|
1516
|
+
pointerEvents: "none"
|
|
1517
|
+
}
|
|
1518
|
+
},
|
|
1519
|
+
// thumb styles
|
|
1520
|
+
[`${componentCls}-thumb`]: {
|
|
1521
|
+
...getItemSelectedStyle(token),
|
|
1522
|
+
position: "absolute",
|
|
1523
|
+
insetBlockStart: 0,
|
|
1524
|
+
insetInlineStart: 0,
|
|
1525
|
+
width: 0,
|
|
1526
|
+
height: "100%",
|
|
1527
|
+
padding: `${unit(token.paddingXXS)} 0`,
|
|
1528
|
+
borderRadius: token.borderRadiusSM,
|
|
1529
|
+
[`& ~ ${componentCls}-item:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)::after`]: {
|
|
1530
|
+
backgroundColor: "transparent"
|
|
1531
|
+
}
|
|
1532
|
+
},
|
|
1533
|
+
// size styles
|
|
1534
|
+
[`&${componentCls}-lg`]: {
|
|
1535
|
+
borderRadius: token.borderRadiusLG,
|
|
1536
|
+
[`${componentCls}-item-label`]: {
|
|
1537
|
+
minHeight: labelHeightLG,
|
|
1538
|
+
lineHeight: unit(labelHeightLG),
|
|
1539
|
+
padding: `0 ${unit(token.segmentedPaddingHorizontal)}`,
|
|
1540
|
+
fontSize: token.fontSizeLG
|
|
1541
|
+
},
|
|
1542
|
+
[`${componentCls}-item, ${componentCls}-thumb`]: {
|
|
1543
|
+
borderRadius: token.borderRadius
|
|
1544
|
+
}
|
|
1545
|
+
},
|
|
1546
|
+
[`&${componentCls}-sm`]: {
|
|
1547
|
+
borderRadius: token.borderRadiusSM,
|
|
1548
|
+
[`${componentCls}-item-label`]: {
|
|
1549
|
+
minHeight: labelHeightSM,
|
|
1550
|
+
lineHeight: unit(labelHeightSM),
|
|
1551
|
+
padding: `0 ${unit(token.segmentedPaddingHorizontalSM)}`
|
|
1552
|
+
},
|
|
1553
|
+
[`${componentCls}-item, ${componentCls}-thumb`]: {
|
|
1554
|
+
borderRadius: token.borderRadiusXS
|
|
1555
|
+
}
|
|
1556
|
+
},
|
|
1557
|
+
// disabled styles
|
|
1558
|
+
...getItemDisabledStyle(`&-disabled ${componentCls}-item`, token),
|
|
1559
|
+
...getItemDisabledStyle(`${componentCls}-item-disabled`, token),
|
|
1560
|
+
// transition effect when `appear-active`
|
|
1561
|
+
[`${componentCls}-thumb-motion-appear-active`]: {
|
|
1562
|
+
willChange: "transform, width",
|
|
1563
|
+
transition: [`transform`, `width`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(", ")
|
|
1564
|
+
},
|
|
1565
|
+
[`&${componentCls}-shape-round`]: {
|
|
1566
|
+
borderRadius: 9999,
|
|
1567
|
+
[`${componentCls}-item, ${componentCls}-thumb`]: {
|
|
1568
|
+
borderRadius: 9999
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
};
|
|
1573
|
+
};
|
|
1574
|
+
var prepareComponentToken = (token) => {
|
|
1575
|
+
const {
|
|
1576
|
+
colorTextLabel,
|
|
1577
|
+
colorText,
|
|
1578
|
+
colorFillSecondary,
|
|
1579
|
+
colorBgElevated,
|
|
1580
|
+
colorFill,
|
|
1581
|
+
lineWidthBold,
|
|
1582
|
+
colorBgLayout
|
|
1583
|
+
} = token;
|
|
1584
|
+
return {
|
|
1585
|
+
trackPadding: lineWidthBold,
|
|
1586
|
+
trackBg: colorBgLayout,
|
|
1587
|
+
itemColor: colorTextLabel,
|
|
1588
|
+
itemHoverColor: colorText,
|
|
1589
|
+
itemHoverBg: colorFillSecondary,
|
|
1590
|
+
itemSelectedBg: colorBgElevated,
|
|
1591
|
+
itemActiveBg: colorFill,
|
|
1592
|
+
itemSelectedColor: colorText
|
|
1593
|
+
};
|
|
1594
|
+
};
|
|
1595
|
+
var style_default2 = genStyleHooks("Segmented", (token) => {
|
|
1596
|
+
const {
|
|
1597
|
+
lineWidth,
|
|
1598
|
+
calc
|
|
1599
|
+
} = token;
|
|
1600
|
+
const segmentedToken = merge(token, {
|
|
1601
|
+
segmentedPaddingHorizontal: calc(token.controlPaddingHorizontal).sub(lineWidth).equal(),
|
|
1602
|
+
segmentedPaddingHorizontalSM: calc(token.controlPaddingHorizontalSM).sub(lineWidth).equal()
|
|
1603
|
+
});
|
|
1604
|
+
return genSegmentedStyle(segmentedToken);
|
|
1605
|
+
}, prepareComponentToken);
|
|
1606
|
+
|
|
1607
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/segmented/index.js
|
|
1608
|
+
function isSegmentedLabeledOptionWithIcon(option) {
|
|
1609
|
+
return isPlainObject(option) && !!option?.icon;
|
|
1610
|
+
}
|
|
1611
|
+
var InternalSegmented = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
1612
|
+
const defaultName = useId_default();
|
|
1613
|
+
const {
|
|
1614
|
+
prefixCls: customizePrefixCls,
|
|
1615
|
+
className,
|
|
1616
|
+
rootClassName,
|
|
1617
|
+
block,
|
|
1618
|
+
options = [],
|
|
1619
|
+
size: customSize,
|
|
1620
|
+
style,
|
|
1621
|
+
vertical,
|
|
1622
|
+
orientation,
|
|
1623
|
+
shape = "default",
|
|
1624
|
+
name = defaultName,
|
|
1625
|
+
styles,
|
|
1626
|
+
classNames,
|
|
1627
|
+
...restProps
|
|
1628
|
+
} = props;
|
|
1629
|
+
const {
|
|
1630
|
+
getPrefixCls,
|
|
1631
|
+
direction,
|
|
1632
|
+
className: contextClassName,
|
|
1633
|
+
style: contextStyle,
|
|
1634
|
+
classNames: contextClassNames,
|
|
1635
|
+
styles: contextStyles
|
|
1636
|
+
} = useComponentConfig("segmented");
|
|
1637
|
+
const mergedProps = {
|
|
1638
|
+
...props,
|
|
1639
|
+
options,
|
|
1640
|
+
size: customSize,
|
|
1641
|
+
shape
|
|
1642
|
+
};
|
|
1643
|
+
const contextStyleRoot = useSemanticRootStyle(contextStyle);
|
|
1644
|
+
const styleRoot = useSemanticRootStyle(style);
|
|
1645
|
+
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, contextStyleRoot, styles, styleRoot], {
|
|
1646
|
+
props: mergedProps
|
|
1647
|
+
});
|
|
1648
|
+
const prefixCls = getPrefixCls("segmented", customizePrefixCls);
|
|
1649
|
+
const [hashId, cssVarCls] = style_default2(prefixCls);
|
|
1650
|
+
const mergedSize = useSize_default(customSize);
|
|
1651
|
+
const extendedOptions = useMemo(() => options.map((option) => {
|
|
1652
|
+
if (isSegmentedLabeledOptionWithIcon(option)) {
|
|
1653
|
+
const {
|
|
1654
|
+
icon,
|
|
1655
|
+
label,
|
|
1656
|
+
...restOption
|
|
1657
|
+
} = option;
|
|
1658
|
+
return {
|
|
1659
|
+
...restOption,
|
|
1660
|
+
label: /* @__PURE__ */ createElement(Fragment, null, /* @__PURE__ */ createElement("span", {
|
|
1661
|
+
className: clsx(`${prefixCls}-item-icon`, mergedClassNames.icon),
|
|
1662
|
+
style: mergedStyles.icon
|
|
1663
|
+
}, icon), label && /* @__PURE__ */ createElement("span", null, label))
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
return option;
|
|
1667
|
+
}), [options, prefixCls, mergedClassNames.icon, mergedStyles.icon]);
|
|
1668
|
+
const [, mergedVertical] = useOrientation(orientation, vertical);
|
|
1669
|
+
const cls = clsx(className, rootClassName, contextClassName, mergedClassNames.root, {
|
|
1670
|
+
[`${prefixCls}-block`]: block,
|
|
1671
|
+
[`${prefixCls}-sm`]: mergedSize === "small",
|
|
1672
|
+
[`${prefixCls}-lg`]: mergedSize === "large",
|
|
1673
|
+
[`${prefixCls}-vertical`]: mergedVertical,
|
|
1674
|
+
[`${prefixCls}-shape-${shape}`]: shape === "round"
|
|
1675
|
+
}, hashId, cssVarCls);
|
|
1676
|
+
const itemRender = (node, {
|
|
1677
|
+
item
|
|
1678
|
+
}) => {
|
|
1679
|
+
if (!item.tooltip) {
|
|
1680
|
+
return node;
|
|
1681
|
+
}
|
|
1682
|
+
const tooltipProps = isPlainObject(item.tooltip) ? item.tooltip : {
|
|
1683
|
+
title: item.tooltip
|
|
1684
|
+
};
|
|
1685
|
+
return /* @__PURE__ */ createElement(tooltip_default, {
|
|
1686
|
+
...tooltipProps
|
|
1687
|
+
}, node);
|
|
1688
|
+
};
|
|
1689
|
+
return /* @__PURE__ */ createElement(es_default3, {
|
|
1690
|
+
...restProps,
|
|
1691
|
+
name,
|
|
1692
|
+
className: cls,
|
|
1693
|
+
style: mergedStyles.root,
|
|
1694
|
+
classNames: mergedClassNames,
|
|
1695
|
+
styles: mergedStyles,
|
|
1696
|
+
itemRender,
|
|
1697
|
+
options: extendedOptions,
|
|
1698
|
+
ref,
|
|
1699
|
+
prefixCls,
|
|
1700
|
+
direction,
|
|
1701
|
+
vertical: mergedVertical
|
|
1702
|
+
});
|
|
1703
|
+
});
|
|
1704
|
+
var Segmented2 = InternalSegmented;
|
|
1705
|
+
if (true) {
|
|
1706
|
+
Segmented2.displayName = "Segmented";
|
|
1707
|
+
}
|
|
1708
|
+
var segmented_default = Segmented2;
|
|
1709
|
+
|
|
1710
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/_util/convertToTooltipProps.js
|
|
1711
|
+
var convertToTooltipProps = (tooltip, context) => {
|
|
1712
|
+
if (!isReactRenderable(tooltip)) {
|
|
1713
|
+
return null;
|
|
1714
|
+
}
|
|
1715
|
+
if (isPlainObject(tooltip) && !/* @__PURE__ */ isValidElement(tooltip)) {
|
|
1716
|
+
return {
|
|
1717
|
+
...context,
|
|
1718
|
+
...tooltip
|
|
1719
|
+
};
|
|
1720
|
+
}
|
|
1721
|
+
return {
|
|
1722
|
+
...context,
|
|
1723
|
+
title: tooltip
|
|
1724
|
+
};
|
|
1725
|
+
};
|
|
1726
|
+
var convertToTooltipProps_default = convertToTooltipProps;
|
|
1727
|
+
|
|
1728
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/hooks/useDebounce.js
|
|
1729
|
+
function useDebounce(value) {
|
|
1730
|
+
const [cacheValue, setCacheValue] = useDelayState(value);
|
|
1731
|
+
useEffect(() => {
|
|
1732
|
+
setCacheValue(value, {
|
|
1733
|
+
ms: value.length ? 0 : 10
|
|
1734
|
+
});
|
|
1735
|
+
}, [value]);
|
|
1736
|
+
return cacheValue;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/style/explain.js
|
|
1740
|
+
var genFormValidateMotionStyle = (token) => {
|
|
1741
|
+
const {
|
|
1742
|
+
componentCls,
|
|
1743
|
+
motionDurationFast,
|
|
1744
|
+
motionEaseInOut
|
|
1745
|
+
} = token;
|
|
1746
|
+
const helpCls = `${componentCls}-show-help`;
|
|
1747
|
+
const helpItemCls = `${componentCls}-show-help-item`;
|
|
1748
|
+
return {
|
|
1749
|
+
[helpCls]: {
|
|
1750
|
+
// Explain holder
|
|
1751
|
+
transition: `opacity ${motionDurationFast} ${motionEaseInOut}`,
|
|
1752
|
+
"&-appear, &-enter": {
|
|
1753
|
+
opacity: 0,
|
|
1754
|
+
"&-active": {
|
|
1755
|
+
opacity: 1
|
|
1756
|
+
}
|
|
1757
|
+
},
|
|
1758
|
+
"&-leave": {
|
|
1759
|
+
opacity: 1,
|
|
1760
|
+
"&-active": {
|
|
1761
|
+
opacity: 0
|
|
1762
|
+
}
|
|
1763
|
+
},
|
|
1764
|
+
// Explain
|
|
1765
|
+
[helpItemCls]: {
|
|
1766
|
+
overflow: "hidden",
|
|
1767
|
+
transition: `${["height", "opacity", "transform"].map((prop) => `${prop} ${motionDurationFast} ${motionEaseInOut}`).join(", ")} !important`,
|
|
1768
|
+
[`&${helpItemCls}-appear, &${helpItemCls}-enter`]: {
|
|
1769
|
+
transform: `translateY(-5px)`,
|
|
1770
|
+
opacity: 0,
|
|
1771
|
+
"&-active": {
|
|
1772
|
+
transform: "translateY(0)",
|
|
1773
|
+
opacity: 1
|
|
1774
|
+
}
|
|
1775
|
+
},
|
|
1776
|
+
[`&${helpItemCls}-leave-active`]: {
|
|
1777
|
+
transform: `translateY(-5px)`
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
};
|
|
1782
|
+
};
|
|
1783
|
+
var explain_default = genFormValidateMotionStyle;
|
|
1784
|
+
|
|
1785
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/style/index.js
|
|
1786
|
+
var resetForm = (token) => ({
|
|
1787
|
+
legend: {
|
|
1788
|
+
display: "block",
|
|
1789
|
+
width: "100%",
|
|
1790
|
+
marginBottom: token.marginLG,
|
|
1791
|
+
padding: 0,
|
|
1792
|
+
color: token.colorTextDescription,
|
|
1793
|
+
fontSize: token.fontSizeLG,
|
|
1794
|
+
lineHeight: "inherit",
|
|
1795
|
+
border: 0,
|
|
1796
|
+
borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
|
|
1797
|
+
},
|
|
1798
|
+
'input[type="search"]': {
|
|
1799
|
+
boxSizing: "border-box"
|
|
1800
|
+
},
|
|
1801
|
+
// Position radios and checkboxes better
|
|
1802
|
+
'input[type="radio"], input[type="checkbox"]': {
|
|
1803
|
+
lineHeight: "normal"
|
|
1804
|
+
},
|
|
1805
|
+
'input[type="file"]': {
|
|
1806
|
+
display: "block"
|
|
1807
|
+
},
|
|
1808
|
+
// Make range inputs behave like textual form controls
|
|
1809
|
+
'input[type="range"]': {
|
|
1810
|
+
display: "block",
|
|
1811
|
+
width: "100%"
|
|
1812
|
+
},
|
|
1813
|
+
// Make multiple select elements height not fixed
|
|
1814
|
+
"select[multiple], select[size]": {
|
|
1815
|
+
height: "auto"
|
|
1816
|
+
},
|
|
1817
|
+
// Focus for file, radio, and checkbox
|
|
1818
|
+
"input[type='file']:focus, input[type='radio']:focus, input[type='checkbox']:focus": {
|
|
1819
|
+
outline: 0,
|
|
1820
|
+
boxShadow: `0 0 0 ${unit(token.controlOutlineWidth)} ${token.controlOutline}`
|
|
1821
|
+
},
|
|
1822
|
+
// Adjust output element
|
|
1823
|
+
output: {
|
|
1824
|
+
display: "block",
|
|
1825
|
+
paddingTop: 15,
|
|
1826
|
+
color: token.colorText,
|
|
1827
|
+
fontSize: token.fontSize,
|
|
1828
|
+
lineHeight: token.lineHeight
|
|
1829
|
+
}
|
|
1830
|
+
});
|
|
1831
|
+
var genFormSize = (token, height) => {
|
|
1832
|
+
const {
|
|
1833
|
+
formItemCls
|
|
1834
|
+
} = token;
|
|
1835
|
+
return {
|
|
1836
|
+
[formItemCls]: {
|
|
1837
|
+
[`${formItemCls}-label > label`]: {
|
|
1838
|
+
height
|
|
1839
|
+
},
|
|
1840
|
+
[`${formItemCls}-control-input`]: {
|
|
1841
|
+
minHeight: height
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
};
|
|
1845
|
+
};
|
|
1846
|
+
var genFormStyle = (token) => {
|
|
1847
|
+
const {
|
|
1848
|
+
componentCls
|
|
1849
|
+
} = token;
|
|
1850
|
+
return {
|
|
1851
|
+
[componentCls]: {
|
|
1852
|
+
...resetComponent(token),
|
|
1853
|
+
...resetForm(token),
|
|
1854
|
+
[`${componentCls}-text`]: {
|
|
1855
|
+
display: "inline-block",
|
|
1856
|
+
paddingInlineEnd: token.paddingSM
|
|
1857
|
+
},
|
|
1858
|
+
// ================================================================
|
|
1859
|
+
// = Size =
|
|
1860
|
+
// ================================================================
|
|
1861
|
+
"&-small": {
|
|
1862
|
+
...genFormSize(token, token.controlHeightSM)
|
|
1863
|
+
},
|
|
1864
|
+
"&-large": {
|
|
1865
|
+
...genFormSize(token, token.controlHeightLG)
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
};
|
|
1869
|
+
};
|
|
1870
|
+
var genFormItemStyle = (token) => {
|
|
1871
|
+
const {
|
|
1872
|
+
formItemCls,
|
|
1873
|
+
iconCls,
|
|
1874
|
+
rootPrefixCls,
|
|
1875
|
+
antCls,
|
|
1876
|
+
labelRequiredMarkColor,
|
|
1877
|
+
labelColor,
|
|
1878
|
+
labelFontSize,
|
|
1879
|
+
labelHeight,
|
|
1880
|
+
labelColonMarginInlineStart,
|
|
1881
|
+
labelColonMarginInlineEnd,
|
|
1882
|
+
itemMarginBottom
|
|
1883
|
+
} = token;
|
|
1884
|
+
const [varName] = genCssVar(antCls, "grid");
|
|
1885
|
+
return {
|
|
1886
|
+
[formItemCls]: {
|
|
1887
|
+
...resetComponent(token),
|
|
1888
|
+
marginBottom: itemMarginBottom,
|
|
1889
|
+
verticalAlign: "top",
|
|
1890
|
+
"&-with-help": {
|
|
1891
|
+
transition: "none"
|
|
1892
|
+
},
|
|
1893
|
+
[`&-hidden,
|
|
1894
|
+
&-hidden${antCls}-row`]: {
|
|
1895
|
+
// https://github.com/ant-design/ant-design/issues/26141
|
|
1896
|
+
display: "none"
|
|
1897
|
+
},
|
|
1898
|
+
// ==============================================================
|
|
1899
|
+
// = Label =
|
|
1900
|
+
// ==============================================================
|
|
1901
|
+
[`${formItemCls}-label`]: {
|
|
1902
|
+
flexGrow: 0,
|
|
1903
|
+
overflow: "hidden",
|
|
1904
|
+
whiteSpace: "nowrap",
|
|
1905
|
+
textAlign: "end",
|
|
1906
|
+
verticalAlign: "middle",
|
|
1907
|
+
"&-left": {
|
|
1908
|
+
textAlign: "start"
|
|
1909
|
+
},
|
|
1910
|
+
"&-wrap": {
|
|
1911
|
+
overflow: "unset",
|
|
1912
|
+
lineHeight: token.lineHeight,
|
|
1913
|
+
whiteSpace: "unset",
|
|
1914
|
+
"> label": {
|
|
1915
|
+
verticalAlign: "middle",
|
|
1916
|
+
textWrap: "balance"
|
|
1917
|
+
}
|
|
1918
|
+
},
|
|
1919
|
+
"> label": {
|
|
1920
|
+
position: "relative",
|
|
1921
|
+
display: "inline-flex",
|
|
1922
|
+
alignItems: "center",
|
|
1923
|
+
maxWidth: "100%",
|
|
1924
|
+
height: labelHeight,
|
|
1925
|
+
color: labelColor,
|
|
1926
|
+
fontSize: labelFontSize,
|
|
1927
|
+
[`> ${iconCls}`]: {
|
|
1928
|
+
fontSize: token.fontSize,
|
|
1929
|
+
verticalAlign: "top"
|
|
1930
|
+
},
|
|
1931
|
+
[`&${formItemCls}-required`]: {
|
|
1932
|
+
"&::before": {
|
|
1933
|
+
display: "inline-block",
|
|
1934
|
+
marginInlineEnd: token.marginXXS,
|
|
1935
|
+
color: labelRequiredMarkColor,
|
|
1936
|
+
fontSize: token.fontSize,
|
|
1937
|
+
fontFamily: "sans-serif",
|
|
1938
|
+
lineHeight: 1,
|
|
1939
|
+
content: '"*"'
|
|
1940
|
+
},
|
|
1941
|
+
[`&${formItemCls}-required-mark-hidden, &${formItemCls}-required-mark-optional`]: {
|
|
1942
|
+
"&::before": {
|
|
1943
|
+
display: "none"
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
},
|
|
1947
|
+
// Optional mark
|
|
1948
|
+
[`${formItemCls}-optional`]: {
|
|
1949
|
+
display: "inline-block",
|
|
1950
|
+
marginInlineStart: token.marginXXS,
|
|
1951
|
+
color: token.colorTextDescription,
|
|
1952
|
+
[`&${formItemCls}-required-mark-hidden`]: {
|
|
1953
|
+
display: "none"
|
|
1954
|
+
}
|
|
1955
|
+
},
|
|
1956
|
+
// Optional mark
|
|
1957
|
+
[`${formItemCls}-tooltip`]: {
|
|
1958
|
+
color: token.colorTextDescription,
|
|
1959
|
+
cursor: "help",
|
|
1960
|
+
writingMode: "horizontal-tb",
|
|
1961
|
+
marginInlineStart: token.marginXXS
|
|
1962
|
+
},
|
|
1963
|
+
"&::after": {
|
|
1964
|
+
content: '":"',
|
|
1965
|
+
position: "relative",
|
|
1966
|
+
marginBlock: 0,
|
|
1967
|
+
marginInlineStart: labelColonMarginInlineStart,
|
|
1968
|
+
marginInlineEnd: labelColonMarginInlineEnd
|
|
1969
|
+
},
|
|
1970
|
+
[`&${formItemCls}-no-colon::after`]: {
|
|
1971
|
+
content: '"\\a0"'
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
},
|
|
1975
|
+
// ==============================================================
|
|
1976
|
+
// = Input =
|
|
1977
|
+
// ==============================================================
|
|
1978
|
+
[`${formItemCls}-control`]: {
|
|
1979
|
+
[varName("display")]: "flex",
|
|
1980
|
+
flexDirection: "column",
|
|
1981
|
+
flexGrow: 1,
|
|
1982
|
+
[`&:first-child:not([class^="'${rootPrefixCls}-col-'"]):not([class*="' ${rootPrefixCls}-col-'"])`]: {
|
|
1983
|
+
width: "100%"
|
|
1984
|
+
},
|
|
1985
|
+
"&-input": {
|
|
1986
|
+
position: "relative",
|
|
1987
|
+
display: "flex",
|
|
1988
|
+
alignItems: "center",
|
|
1989
|
+
minHeight: token.controlHeight,
|
|
1990
|
+
"&-content": {
|
|
1991
|
+
flex: "auto",
|
|
1992
|
+
maxWidth: "100%",
|
|
1993
|
+
// Fix https://github.com/ant-design/ant-design/issues/54042
|
|
1994
|
+
// Remove impact of whitespaces
|
|
1995
|
+
[`&:has(> ${antCls}-switch:only-child, > ${antCls}-rate:only-child)`]: {
|
|
1996
|
+
display: "flex",
|
|
1997
|
+
alignItems: "center"
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
},
|
|
2002
|
+
// ==============================================================
|
|
2003
|
+
// = Explain =
|
|
2004
|
+
// ==============================================================
|
|
2005
|
+
[formItemCls]: {
|
|
2006
|
+
"&-additional": {
|
|
2007
|
+
display: "flex",
|
|
2008
|
+
flexDirection: "column"
|
|
2009
|
+
},
|
|
2010
|
+
"&-explain, &-extra": {
|
|
2011
|
+
clear: "both",
|
|
2012
|
+
color: token.colorTextDescription,
|
|
2013
|
+
fontSize: token.fontSize,
|
|
2014
|
+
lineHeight: token.lineHeight
|
|
2015
|
+
},
|
|
2016
|
+
"&-explain-connected": {
|
|
2017
|
+
width: "100%"
|
|
2018
|
+
},
|
|
2019
|
+
"&-extra": {
|
|
2020
|
+
minHeight: token.controlHeightSM,
|
|
2021
|
+
transition: `color ${token.motionDurationMid} ${token.motionEaseOut}`
|
|
2022
|
+
// sync input color transition
|
|
2023
|
+
},
|
|
2024
|
+
"&-explain": {
|
|
2025
|
+
"&-error": {
|
|
2026
|
+
color: token.colorError
|
|
2027
|
+
},
|
|
2028
|
+
"&-warning": {
|
|
2029
|
+
color: token.colorWarning
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
},
|
|
2033
|
+
[`&-with-help ${formItemCls}-explain`]: {
|
|
2034
|
+
height: "auto",
|
|
2035
|
+
opacity: 1
|
|
2036
|
+
},
|
|
2037
|
+
// ==============================================================
|
|
2038
|
+
// = Feedback Icon =
|
|
2039
|
+
// ==============================================================
|
|
2040
|
+
[`${formItemCls}-feedback-icon`]: {
|
|
2041
|
+
fontSize: token.fontSize,
|
|
2042
|
+
textAlign: "center",
|
|
2043
|
+
visibility: "visible",
|
|
2044
|
+
animationName: zoomIn,
|
|
2045
|
+
animationDuration: token.motionDurationMid,
|
|
2046
|
+
animationTimingFunction: token.motionEaseOutBack,
|
|
2047
|
+
pointerEvents: "none",
|
|
2048
|
+
"&-success": {
|
|
2049
|
+
color: token.colorSuccess
|
|
2050
|
+
},
|
|
2051
|
+
"&-error": {
|
|
2052
|
+
color: token.colorError
|
|
2053
|
+
},
|
|
2054
|
+
"&-warning": {
|
|
2055
|
+
color: token.colorWarning
|
|
2056
|
+
},
|
|
2057
|
+
"&-validating": {
|
|
2058
|
+
color: token.colorPrimary
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
};
|
|
2063
|
+
};
|
|
2064
|
+
var makeVerticalLayoutLabelBase = (token) => ({
|
|
2065
|
+
padding: token.verticalLabelPadding,
|
|
2066
|
+
whiteSpace: "initial",
|
|
2067
|
+
textAlign: "start",
|
|
2068
|
+
"> label": {
|
|
2069
|
+
margin: 0,
|
|
2070
|
+
"&::after": {
|
|
2071
|
+
// https://github.com/ant-design/ant-design/issues/43538
|
|
2072
|
+
visibility: "hidden"
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
});
|
|
2076
|
+
var makeVerticalLayoutLabel = (token) => ({
|
|
2077
|
+
...makeVerticalLayoutLabelBase(token),
|
|
2078
|
+
margin: token.verticalLabelMargin
|
|
2079
|
+
});
|
|
2080
|
+
var makeVerticalLayoutLabelWithOffset = (token) => {
|
|
2081
|
+
const [formVarName] = genCssVar(token.antCls, "form");
|
|
2082
|
+
return {
|
|
2083
|
+
...makeVerticalLayoutLabelBase(token),
|
|
2084
|
+
[formVarName("item-label-margin")]: token.verticalLabelMargin
|
|
2085
|
+
};
|
|
2086
|
+
};
|
|
2087
|
+
var genHorizontalStyle = (token) => {
|
|
2088
|
+
const {
|
|
2089
|
+
antCls,
|
|
2090
|
+
formItemCls
|
|
2091
|
+
} = token;
|
|
2092
|
+
return {
|
|
2093
|
+
[`${formItemCls}-horizontal`]: {
|
|
2094
|
+
[`${formItemCls}-label`]: {
|
|
2095
|
+
flexGrow: 0
|
|
2096
|
+
},
|
|
2097
|
+
[`${formItemCls}-control`]: {
|
|
2098
|
+
flex: "1 1 0",
|
|
2099
|
+
// https://github.com/ant-design/ant-design/issues/32777
|
|
2100
|
+
// https://github.com/ant-design/ant-design/issues/33773
|
|
2101
|
+
minWidth: 0
|
|
2102
|
+
},
|
|
2103
|
+
// Do not change this to `ant-col-24`! `-24` match all the responsive rules
|
|
2104
|
+
// https://github.com/ant-design/ant-design/issues/32980
|
|
2105
|
+
// https://github.com/ant-design/ant-design/issues/34903
|
|
2106
|
+
// https://github.com/ant-design/ant-design/issues/44538
|
|
2107
|
+
[`${formItemCls}-label[class$='-24'], ${formItemCls}-label[class*='-24 ']`]: {
|
|
2108
|
+
[`& + ${formItemCls}-control`]: {
|
|
2109
|
+
minWidth: "unset"
|
|
2110
|
+
}
|
|
2111
|
+
},
|
|
2112
|
+
[`> ${formItemCls}-row > ${antCls}-col-24${formItemCls}-label,
|
|
2113
|
+
> ${formItemCls}-row > ${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
|
|
2114
|
+
}
|
|
2115
|
+
};
|
|
2116
|
+
};
|
|
2117
|
+
var genInlineStyle = (token) => {
|
|
2118
|
+
const {
|
|
2119
|
+
componentCls,
|
|
2120
|
+
formItemCls,
|
|
2121
|
+
inlineItemMarginBottom
|
|
2122
|
+
} = token;
|
|
2123
|
+
return {
|
|
2124
|
+
[`${componentCls}-inline`]: {
|
|
2125
|
+
display: "flex",
|
|
2126
|
+
flexWrap: "wrap",
|
|
2127
|
+
[`${formItemCls}-inline`]: {
|
|
2128
|
+
flex: "none",
|
|
2129
|
+
marginInlineEnd: token.margin,
|
|
2130
|
+
marginBottom: inlineItemMarginBottom,
|
|
2131
|
+
"&-row": {
|
|
2132
|
+
flexWrap: "nowrap"
|
|
2133
|
+
},
|
|
2134
|
+
[`> ${formItemCls}-label,
|
|
2135
|
+
> ${formItemCls}-control`]: {
|
|
2136
|
+
display: "inline-block",
|
|
2137
|
+
verticalAlign: "top"
|
|
2138
|
+
},
|
|
2139
|
+
[`> ${formItemCls}-label`]: {
|
|
2140
|
+
flex: "none"
|
|
2141
|
+
},
|
|
2142
|
+
[`${componentCls}-text`]: {
|
|
2143
|
+
display: "inline-block"
|
|
2144
|
+
},
|
|
2145
|
+
[`${formItemCls}-has-feedback`]: {
|
|
2146
|
+
display: "inline-block"
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
};
|
|
2151
|
+
};
|
|
2152
|
+
var makeVerticalLayout = (token) => {
|
|
2153
|
+
const {
|
|
2154
|
+
componentCls,
|
|
2155
|
+
formItemCls,
|
|
2156
|
+
rootPrefixCls
|
|
2157
|
+
} = token;
|
|
2158
|
+
return {
|
|
2159
|
+
[`${formItemCls}:not(${formItemCls}-vertical) > ${formItemCls}-row > ${formItemCls}-label`]: makeVerticalLayoutLabel(token),
|
|
2160
|
+
// ref: https://github.com/ant-design/ant-design/issues/45122
|
|
2161
|
+
[`${componentCls}:not(${componentCls}-inline)`]: {
|
|
2162
|
+
[formItemCls]: {
|
|
2163
|
+
flexWrap: "wrap",
|
|
2164
|
+
[`${formItemCls}-label, ${formItemCls}-control`]: {
|
|
2165
|
+
// When developer pass `xs: { span }`,
|
|
2166
|
+
// It should follow the `xs` screen config
|
|
2167
|
+
// ref: https://github.com/ant-design/ant-design/issues/44386
|
|
2168
|
+
[`&:not([class*=" ${rootPrefixCls}-col-xs"])`]: {
|
|
2169
|
+
flex: "0 0 100%",
|
|
2170
|
+
maxWidth: "100%"
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
};
|
|
2176
|
+
};
|
|
2177
|
+
var genVerticalStyle = (token) => {
|
|
2178
|
+
const {
|
|
2179
|
+
componentCls,
|
|
2180
|
+
formItemCls,
|
|
2181
|
+
antCls,
|
|
2182
|
+
verticalLabelHeight
|
|
2183
|
+
} = token;
|
|
2184
|
+
const [formVarName, formVarRef] = genCssVar(antCls, "form");
|
|
2185
|
+
return {
|
|
2186
|
+
[formItemCls]: {
|
|
2187
|
+
[formVarName("item-label-margin")]: "initial"
|
|
2188
|
+
},
|
|
2189
|
+
[`${formItemCls}-label`]: {
|
|
2190
|
+
margin: formVarRef("item-label-margin")
|
|
2191
|
+
},
|
|
2192
|
+
[`${formItemCls}-vertical`]: {
|
|
2193
|
+
[`${formItemCls}-row`]: {
|
|
2194
|
+
flexDirection: "column"
|
|
2195
|
+
},
|
|
2196
|
+
[`${formItemCls}-label > label`]: {
|
|
2197
|
+
height: verticalLabelHeight
|
|
2198
|
+
},
|
|
2199
|
+
[`${formItemCls}-control`]: {
|
|
2200
|
+
width: "100%"
|
|
2201
|
+
},
|
|
2202
|
+
[`> ${formItemCls}-row > ${formItemCls}-label,
|
|
2203
|
+
> ${formItemCls}-row > ${antCls}-col-24${formItemCls}-label,
|
|
2204
|
+
> ${formItemCls}-row > ${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabelWithOffset(token)
|
|
2205
|
+
},
|
|
2206
|
+
[`@media (max-width: ${unit(token.screenXSMax)})`]: [makeVerticalLayout(token), {
|
|
2207
|
+
[componentCls]: {
|
|
2208
|
+
[`${formItemCls}:not(${formItemCls}-horizontal):not(${formItemCls}-vertical)`]: {
|
|
2209
|
+
[`> ${formItemCls}-row > ${antCls}-col-xs-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
}],
|
|
2213
|
+
[`@media (max-width: ${unit(token.screenSMMax)})`]: {
|
|
2214
|
+
[componentCls]: {
|
|
2215
|
+
[`${formItemCls}:not(${formItemCls}-horizontal):not(${formItemCls}-vertical)`]: {
|
|
2216
|
+
[`> ${formItemCls}-row > ${antCls}-col-sm-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
},
|
|
2220
|
+
[`@media (max-width: ${unit(token.screenMDMax)})`]: {
|
|
2221
|
+
[componentCls]: {
|
|
2222
|
+
[`${formItemCls}:not(${formItemCls}-horizontal):not(${formItemCls}-vertical)`]: {
|
|
2223
|
+
[`> ${formItemCls}-row > ${antCls}-col-md-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
},
|
|
2227
|
+
[`@media (max-width: ${unit(token.screenLGMax)})`]: {
|
|
2228
|
+
[componentCls]: {
|
|
2229
|
+
[`${formItemCls}:not(${formItemCls}-horizontal):not(${formItemCls}-vertical)`]: {
|
|
2230
|
+
[`> ${formItemCls}-row > ${antCls}-col-lg-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
};
|
|
2235
|
+
};
|
|
2236
|
+
var prepareComponentToken2 = (token) => ({
|
|
2237
|
+
labelRequiredMarkColor: token.colorError,
|
|
2238
|
+
labelColor: token.colorTextHeading,
|
|
2239
|
+
labelFontSize: token.fontSize,
|
|
2240
|
+
labelHeight: token.controlHeight,
|
|
2241
|
+
verticalLabelHeight: token.labelHeight ?? "auto",
|
|
2242
|
+
labelColonMarginInlineStart: token.marginXXS / 2,
|
|
2243
|
+
labelColonMarginInlineEnd: token.marginXS,
|
|
2244
|
+
itemMarginBottom: token.marginLG,
|
|
2245
|
+
verticalLabelPadding: `0 0 ${token.paddingXS}px`,
|
|
2246
|
+
verticalLabelMargin: 0,
|
|
2247
|
+
inlineItemMarginBottom: 0
|
|
2248
|
+
});
|
|
2249
|
+
var prepareToken = (token, rootPrefixCls) => {
|
|
2250
|
+
const formToken = merge(token, {
|
|
2251
|
+
formItemCls: `${token.componentCls}-item`,
|
|
2252
|
+
rootPrefixCls
|
|
2253
|
+
});
|
|
2254
|
+
return formToken;
|
|
2255
|
+
};
|
|
2256
|
+
var style_default3 = genStyleHooks("Form", (token, {
|
|
2257
|
+
rootPrefixCls
|
|
2258
|
+
}) => {
|
|
2259
|
+
const formToken = prepareToken(token, rootPrefixCls);
|
|
2260
|
+
return [genFormStyle(formToken), genFormItemStyle(formToken), explain_default(formToken), genHorizontalStyle(formToken), genInlineStyle(formToken), genVerticalStyle(formToken), collapse_default(formToken), zoomIn];
|
|
2261
|
+
}, prepareComponentToken2, {
|
|
2262
|
+
// Let From style before the Grid
|
|
2263
|
+
// ref https://github.com/ant-design/ant-design/issues/44386
|
|
2264
|
+
order: -1e3
|
|
2265
|
+
});
|
|
2266
|
+
|
|
2267
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/ErrorList.js
|
|
2268
|
+
var EMPTY_LIST = [];
|
|
2269
|
+
function toErrorEntity(error, prefix, errorStatus, index = 0) {
|
|
2270
|
+
return {
|
|
2271
|
+
key: typeof error === "string" ? error : `${prefix}-${index}`,
|
|
2272
|
+
error,
|
|
2273
|
+
errorStatus
|
|
2274
|
+
};
|
|
2275
|
+
}
|
|
2276
|
+
var ErrorList = ({
|
|
2277
|
+
help,
|
|
2278
|
+
helpStatus,
|
|
2279
|
+
errors = EMPTY_LIST,
|
|
2280
|
+
warnings = EMPTY_LIST,
|
|
2281
|
+
className: rootClassName,
|
|
2282
|
+
fieldId,
|
|
2283
|
+
onVisibleChanged
|
|
2284
|
+
}) => {
|
|
2285
|
+
const {
|
|
2286
|
+
prefixCls
|
|
2287
|
+
} = useContext(FormItemPrefixContext);
|
|
2288
|
+
const {
|
|
2289
|
+
classNames: contextClassNames,
|
|
2290
|
+
styles: contextStyles
|
|
2291
|
+
} = useContext(FormContext);
|
|
2292
|
+
const baseClassName = `${prefixCls}-item-explain`;
|
|
2293
|
+
const rootCls = useCSSVarCls_default(prefixCls);
|
|
2294
|
+
const [hashId, cssVarCls] = style_default3(prefixCls, rootCls);
|
|
2295
|
+
const collapseMotion = useMemo(() => motion_default(prefixCls), [prefixCls]);
|
|
2296
|
+
const debounceErrors = useDebounce(errors);
|
|
2297
|
+
const debounceWarnings = useDebounce(warnings);
|
|
2298
|
+
const hasHelp = isNonNullable(help);
|
|
2299
|
+
const fullKeyList = useMemo(() => {
|
|
2300
|
+
if (hasHelp) {
|
|
2301
|
+
return [toErrorEntity(help, "help", helpStatus)];
|
|
2302
|
+
}
|
|
2303
|
+
return [].concat(_toConsumableArray(debounceErrors.map((error, index) => toErrorEntity(error, "error", "error", index))), _toConsumableArray(debounceWarnings.map((warning, index) => toErrorEntity(warning, "warning", "warning", index))));
|
|
2304
|
+
}, [help, helpStatus, hasHelp, debounceErrors, debounceWarnings]);
|
|
2305
|
+
const filledKeyFullKeyList = useMemo(() => {
|
|
2306
|
+
const keysCount = {};
|
|
2307
|
+
fullKeyList.forEach(({
|
|
2308
|
+
key
|
|
2309
|
+
}) => {
|
|
2310
|
+
keysCount[key] = (keysCount[key] || 0) + 1;
|
|
2311
|
+
});
|
|
2312
|
+
return fullKeyList.map((entity, index) => ({
|
|
2313
|
+
...entity,
|
|
2314
|
+
key: keysCount[entity.key] > 1 ? `${entity.key}-fallback-${index}` : entity.key
|
|
2315
|
+
}));
|
|
2316
|
+
}, [fullKeyList]);
|
|
2317
|
+
const helpProps = {};
|
|
2318
|
+
if (fieldId) {
|
|
2319
|
+
helpProps.id = `${fieldId}_help`;
|
|
2320
|
+
}
|
|
2321
|
+
return /* @__PURE__ */ createElement(es_default, {
|
|
2322
|
+
motionDeadline: collapseMotion.motionDeadline,
|
|
2323
|
+
motionName: `${prefixCls}-show-help`,
|
|
2324
|
+
visible: !!filledKeyFullKeyList.length,
|
|
2325
|
+
onVisibleChanged
|
|
2326
|
+
}, (holderProps) => {
|
|
2327
|
+
const {
|
|
2328
|
+
className: holderClassName,
|
|
2329
|
+
style: holderStyle
|
|
2330
|
+
} = holderProps;
|
|
2331
|
+
return /* @__PURE__ */ createElement("div", {
|
|
2332
|
+
...helpProps,
|
|
2333
|
+
className: clsx(baseClassName, holderClassName, contextClassNames?.help, cssVarCls, rootCls, rootClassName, hashId),
|
|
2334
|
+
style: {
|
|
2335
|
+
...contextStyles?.help,
|
|
2336
|
+
...holderStyle
|
|
2337
|
+
}
|
|
2338
|
+
}, /* @__PURE__ */ createElement(CSSMotionList_default, {
|
|
2339
|
+
keys: filledKeyFullKeyList,
|
|
2340
|
+
...motion_default(prefixCls),
|
|
2341
|
+
motionName: `${prefixCls}-show-help-item`,
|
|
2342
|
+
component: false
|
|
2343
|
+
}, (itemProps) => {
|
|
2344
|
+
const {
|
|
2345
|
+
key,
|
|
2346
|
+
error,
|
|
2347
|
+
errorStatus,
|
|
2348
|
+
className: itemClassName,
|
|
2349
|
+
style: itemStyle
|
|
2350
|
+
} = itemProps;
|
|
2351
|
+
return /* @__PURE__ */ createElement("div", {
|
|
2352
|
+
key,
|
|
2353
|
+
className: clsx(itemClassName, contextClassNames?.helpItem, {
|
|
2354
|
+
[`${baseClassName}-${errorStatus}`]: errorStatus
|
|
2355
|
+
}),
|
|
2356
|
+
style: {
|
|
2357
|
+
...contextStyles?.helpItem,
|
|
2358
|
+
...itemStyle
|
|
2359
|
+
}
|
|
2360
|
+
}, error);
|
|
2361
|
+
}));
|
|
2362
|
+
});
|
|
2363
|
+
};
|
|
2364
|
+
var ErrorList_default = ErrorList;
|
|
2365
|
+
|
|
2366
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/hooks/useFormWarning.js
|
|
2367
|
+
var names = {};
|
|
2368
|
+
function useFormWarning({
|
|
2369
|
+
name
|
|
2370
|
+
}) {
|
|
2371
|
+
const warning = useDevWarning("Form");
|
|
2372
|
+
useEffect(() => {
|
|
2373
|
+
if (name) {
|
|
2374
|
+
names[name] = (names[name] || 0) + 1;
|
|
2375
|
+
true ? warning(names[name] <= 1, "usage", "There exist multiple Form with same `name`.") : void 0;
|
|
2376
|
+
return () => {
|
|
2377
|
+
names[name] -= 1;
|
|
2378
|
+
};
|
|
2379
|
+
}
|
|
2380
|
+
}, [name]);
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/Form.js
|
|
2384
|
+
var InternalForm = (props, ref) => {
|
|
2385
|
+
const contextDisabled = useContext(DisabledContext_default);
|
|
2386
|
+
const {
|
|
2387
|
+
getPrefixCls,
|
|
2388
|
+
direction,
|
|
2389
|
+
requiredMark: contextRequiredMark,
|
|
2390
|
+
colon: contextColon,
|
|
2391
|
+
scrollToFirstError: contextScrollToFirstError,
|
|
2392
|
+
className: contextClassName,
|
|
2393
|
+
style: contextStyle,
|
|
2394
|
+
styles: contextStyles,
|
|
2395
|
+
classNames: contextClassNames,
|
|
2396
|
+
tooltip: contextTooltip,
|
|
2397
|
+
labelAlign: contextLabelAlign,
|
|
2398
|
+
labelWrap: contextLabelWrap
|
|
2399
|
+
} = useComponentConfig("form");
|
|
2400
|
+
const {
|
|
2401
|
+
prefixCls: customizePrefixCls,
|
|
2402
|
+
className,
|
|
2403
|
+
rootClassName,
|
|
2404
|
+
size,
|
|
2405
|
+
disabled = contextDisabled,
|
|
2406
|
+
form,
|
|
2407
|
+
colon,
|
|
2408
|
+
labelAlign,
|
|
2409
|
+
labelWrap,
|
|
2410
|
+
labelCol,
|
|
2411
|
+
wrapperCol,
|
|
2412
|
+
layout = "horizontal",
|
|
2413
|
+
scrollToFirstError,
|
|
2414
|
+
requiredMark,
|
|
2415
|
+
onFinishFailed,
|
|
2416
|
+
name,
|
|
2417
|
+
style,
|
|
2418
|
+
feedbackIcons,
|
|
2419
|
+
variant,
|
|
2420
|
+
classNames,
|
|
2421
|
+
styles,
|
|
2422
|
+
tooltip,
|
|
2423
|
+
...restFormProps
|
|
2424
|
+
} = props;
|
|
2425
|
+
const mergedSize = useSize_default(size);
|
|
2426
|
+
const contextValidateMessages = useContext(validateMessagesContext_default);
|
|
2427
|
+
if (true) {
|
|
2428
|
+
useFormWarning(props);
|
|
2429
|
+
}
|
|
2430
|
+
const mergedRequiredMark = useMemo(() => {
|
|
2431
|
+
if (requiredMark !== void 0) {
|
|
2432
|
+
return requiredMark;
|
|
2433
|
+
}
|
|
2434
|
+
if (contextRequiredMark !== void 0) {
|
|
2435
|
+
return contextRequiredMark;
|
|
2436
|
+
}
|
|
2437
|
+
return true;
|
|
2438
|
+
}, [requiredMark, contextRequiredMark]);
|
|
2439
|
+
const mergedColon = colon ?? contextColon;
|
|
2440
|
+
const mergedLabelAlign = labelAlign ?? contextLabelAlign;
|
|
2441
|
+
const mergedLabelWrap = labelWrap ?? contextLabelWrap;
|
|
2442
|
+
const mergedTooltip = {
|
|
2443
|
+
...contextTooltip,
|
|
2444
|
+
...tooltip
|
|
2445
|
+
};
|
|
2446
|
+
const prefixCls = getPrefixCls("form", customizePrefixCls);
|
|
2447
|
+
const rootCls = useCSSVarCls_default(prefixCls);
|
|
2448
|
+
const [hashId, cssVarCls] = style_default3(prefixCls, rootCls);
|
|
2449
|
+
const mergedProps = {
|
|
2450
|
+
...props,
|
|
2451
|
+
size: mergedSize,
|
|
2452
|
+
disabled,
|
|
2453
|
+
layout,
|
|
2454
|
+
colon: mergedColon,
|
|
2455
|
+
requiredMark: mergedRequiredMark,
|
|
2456
|
+
labelAlign: mergedLabelAlign,
|
|
2457
|
+
labelWrap: mergedLabelWrap
|
|
2458
|
+
};
|
|
2459
|
+
const contextStyleRoot = useSemanticRootStyle(contextStyle);
|
|
2460
|
+
const styleRoot = useSemanticRootStyle(style);
|
|
2461
|
+
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, contextStyleRoot, styles, styleRoot], {
|
|
2462
|
+
props: mergedProps
|
|
2463
|
+
});
|
|
2464
|
+
const formClassName = clsx(prefixCls, `${prefixCls}-${layout}`, {
|
|
2465
|
+
[`${prefixCls}-hide-required-mark`]: mergedRequiredMark === false,
|
|
2466
|
+
// todo: remove in next major version
|
|
2467
|
+
[`${prefixCls}-rtl`]: direction === "rtl",
|
|
2468
|
+
[`${prefixCls}-large`]: mergedSize === "large",
|
|
2469
|
+
[`${prefixCls}-small`]: mergedSize === "small"
|
|
2470
|
+
}, cssVarCls, rootCls, hashId, contextClassName, className, rootClassName, mergedClassNames.root);
|
|
2471
|
+
const [wrapForm] = useForm(form);
|
|
2472
|
+
const {
|
|
2473
|
+
__INTERNAL__
|
|
2474
|
+
} = wrapForm;
|
|
2475
|
+
__INTERNAL__.name = name;
|
|
2476
|
+
const formContextValue = useMemo(() => ({
|
|
2477
|
+
name,
|
|
2478
|
+
labelAlign: mergedLabelAlign,
|
|
2479
|
+
labelCol,
|
|
2480
|
+
labelWrap: mergedLabelWrap,
|
|
2481
|
+
wrapperCol,
|
|
2482
|
+
layout,
|
|
2483
|
+
colon: mergedColon,
|
|
2484
|
+
requiredMark: mergedRequiredMark,
|
|
2485
|
+
itemRef: __INTERNAL__.itemRef,
|
|
2486
|
+
form: wrapForm,
|
|
2487
|
+
feedbackIcons,
|
|
2488
|
+
tooltip: mergedTooltip,
|
|
2489
|
+
classNames: mergedClassNames,
|
|
2490
|
+
styles: mergedStyles
|
|
2491
|
+
}), [name, mergedLabelAlign, mergedLabelWrap, labelCol, wrapperCol, layout, mergedColon, mergedRequiredMark, wrapForm, feedbackIcons, mergedClassNames, mergedStyles, mergedTooltip]);
|
|
2492
|
+
const nativeElementRef = useRef(null);
|
|
2493
|
+
useImperativeHandle(ref, () => ({
|
|
2494
|
+
...wrapForm,
|
|
2495
|
+
nativeElement: nativeElementRef.current?.nativeElement
|
|
2496
|
+
}));
|
|
2497
|
+
const scrollToField = (options, fieldName) => {
|
|
2498
|
+
if (options) {
|
|
2499
|
+
let defaultScrollToFirstError = {
|
|
2500
|
+
block: "nearest"
|
|
2501
|
+
};
|
|
2502
|
+
if (isPlainObject(options)) {
|
|
2503
|
+
defaultScrollToFirstError = {
|
|
2504
|
+
...defaultScrollToFirstError,
|
|
2505
|
+
...options
|
|
2506
|
+
};
|
|
2507
|
+
}
|
|
2508
|
+
wrapForm.scrollToField(fieldName, defaultScrollToFirstError);
|
|
2509
|
+
}
|
|
2510
|
+
};
|
|
2511
|
+
const onInternalFinishFailed = (errorInfo) => {
|
|
2512
|
+
onFinishFailed?.(errorInfo);
|
|
2513
|
+
if (errorInfo.errorFields.length) {
|
|
2514
|
+
const fieldName = errorInfo.errorFields[0].name;
|
|
2515
|
+
if (scrollToFirstError !== void 0) {
|
|
2516
|
+
scrollToField(scrollToFirstError, fieldName);
|
|
2517
|
+
return;
|
|
2518
|
+
}
|
|
2519
|
+
if (contextScrollToFirstError !== void 0) {
|
|
2520
|
+
scrollToField(contextScrollToFirstError, fieldName);
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
};
|
|
2524
|
+
return /* @__PURE__ */ createElement(VariantContext.Provider, {
|
|
2525
|
+
value: variant
|
|
2526
|
+
}, /* @__PURE__ */ createElement(DisabledContextProvider, {
|
|
2527
|
+
disabled
|
|
2528
|
+
}, /* @__PURE__ */ createElement(SizeContext_default.Provider, {
|
|
2529
|
+
value: mergedSize
|
|
2530
|
+
}, /* @__PURE__ */ createElement(FormProvider, {
|
|
2531
|
+
// This is not list in API, we pass with spread
|
|
2532
|
+
validateMessages: contextValidateMessages
|
|
2533
|
+
}, /* @__PURE__ */ createElement(FormContext.Provider, {
|
|
2534
|
+
value: formContextValue
|
|
2535
|
+
}, /* @__PURE__ */ createElement(NoFormStyle, {
|
|
2536
|
+
status: true
|
|
2537
|
+
}, /* @__PURE__ */ createElement(es_default2, {
|
|
2538
|
+
id: name,
|
|
2539
|
+
...restFormProps,
|
|
2540
|
+
name,
|
|
2541
|
+
onFinishFailed: onInternalFinishFailed,
|
|
2542
|
+
form: wrapForm,
|
|
2543
|
+
ref: nativeElementRef,
|
|
2544
|
+
style: mergedStyles?.root,
|
|
2545
|
+
className: formClassName
|
|
2546
|
+
})))))));
|
|
2547
|
+
};
|
|
2548
|
+
var Form = /* @__PURE__ */ forwardRef(InternalForm);
|
|
2549
|
+
if (true) {
|
|
2550
|
+
Form.displayName = "Form";
|
|
2551
|
+
}
|
|
2552
|
+
var Form_default = Form;
|
|
2553
|
+
|
|
2554
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/hooks/useChildren.js
|
|
2555
|
+
var useChildren = (children) => {
|
|
2556
|
+
if (isFunction(children)) {
|
|
2557
|
+
return children;
|
|
2558
|
+
}
|
|
2559
|
+
const childList = toArray(children);
|
|
2560
|
+
return childList.length <= 1 ? childList[0] : childList;
|
|
2561
|
+
};
|
|
2562
|
+
var useChildren_default = useChildren;
|
|
2563
|
+
|
|
2564
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/hooks/useFormItemStatus.js
|
|
2565
|
+
var useFormItemStatus = () => {
|
|
2566
|
+
const {
|
|
2567
|
+
status,
|
|
2568
|
+
errors = [],
|
|
2569
|
+
warnings = []
|
|
2570
|
+
} = useContext(FormItemInputContext);
|
|
2571
|
+
if (true) {
|
|
2572
|
+
const warning = useDevWarning("Form.Item");
|
|
2573
|
+
true ? warning(status !== void 0, "usage", "Form.Item.useStatus should be used under Form.Item component. For more information: https://u.ant.design/form-item-usestatus") : void 0;
|
|
2574
|
+
}
|
|
2575
|
+
return {
|
|
2576
|
+
status,
|
|
2577
|
+
errors,
|
|
2578
|
+
warnings
|
|
2579
|
+
};
|
|
2580
|
+
};
|
|
2581
|
+
useFormItemStatus.Context = FormItemInputContext;
|
|
2582
|
+
var useFormItemStatus_default = useFormItemStatus;
|
|
2583
|
+
|
|
2584
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/hooks/useFrameState.js
|
|
2585
|
+
function useFrameState(defaultValue) {
|
|
2586
|
+
const [value, setValue] = useState(defaultValue);
|
|
2587
|
+
const frameRef = useRef(null);
|
|
2588
|
+
const batchRef = useRef([]);
|
|
2589
|
+
const destroyRef = useRef(false);
|
|
2590
|
+
useEffect(() => {
|
|
2591
|
+
destroyRef.current = false;
|
|
2592
|
+
return () => {
|
|
2593
|
+
destroyRef.current = true;
|
|
2594
|
+
raf_default.cancel(frameRef.current);
|
|
2595
|
+
frameRef.current = null;
|
|
2596
|
+
};
|
|
2597
|
+
}, []);
|
|
2598
|
+
function setFrameValue(updater) {
|
|
2599
|
+
if (destroyRef.current) {
|
|
2600
|
+
return;
|
|
2601
|
+
}
|
|
2602
|
+
if (frameRef.current === null) {
|
|
2603
|
+
batchRef.current = [];
|
|
2604
|
+
frameRef.current = raf_default(() => {
|
|
2605
|
+
frameRef.current = null;
|
|
2606
|
+
setValue((prevValue) => {
|
|
2607
|
+
let current = prevValue;
|
|
2608
|
+
batchRef.current.forEach((func) => {
|
|
2609
|
+
current = func(current);
|
|
2610
|
+
});
|
|
2611
|
+
return current;
|
|
2612
|
+
});
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
batchRef.current.push(updater);
|
|
2616
|
+
}
|
|
2617
|
+
return [value, setFrameValue];
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/hooks/useItemRef.js
|
|
2621
|
+
var useItemRef = () => {
|
|
2622
|
+
const {
|
|
2623
|
+
itemRef
|
|
2624
|
+
} = useContext(FormContext);
|
|
2625
|
+
const cacheRef = useRef({});
|
|
2626
|
+
const getRef = (name, children) => {
|
|
2627
|
+
const childrenRef = children && isPlainObject(children) && getNodeRef(children);
|
|
2628
|
+
const nameStr = name.join("_");
|
|
2629
|
+
if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {
|
|
2630
|
+
cacheRef.current.name = nameStr;
|
|
2631
|
+
cacheRef.current.originRef = childrenRef;
|
|
2632
|
+
cacheRef.current.ref = composeRef(itemRef(name), childrenRef);
|
|
2633
|
+
}
|
|
2634
|
+
return cacheRef.current.ref;
|
|
2635
|
+
};
|
|
2636
|
+
return getRef;
|
|
2637
|
+
};
|
|
2638
|
+
var useItemRef_default = useItemRef;
|
|
2639
|
+
|
|
2640
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/style/fallbackCmp.js
|
|
2641
|
+
var genFallbackStyle = (token) => {
|
|
2642
|
+
const {
|
|
2643
|
+
formItemCls
|
|
2644
|
+
} = token;
|
|
2645
|
+
return {
|
|
2646
|
+
"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)": {
|
|
2647
|
+
// Fallback for IE, safe to remove we not support it anymore
|
|
2648
|
+
[`${formItemCls}-control`]: {
|
|
2649
|
+
display: "flex"
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
};
|
|
2653
|
+
};
|
|
2654
|
+
var fallbackCmp_default = genSubStyleComponent(["Form", "item-item"], (token, {
|
|
2655
|
+
rootPrefixCls
|
|
2656
|
+
}) => {
|
|
2657
|
+
const formToken = prepareToken(token, rootPrefixCls);
|
|
2658
|
+
return genFallbackStyle(formToken);
|
|
2659
|
+
});
|
|
2660
|
+
|
|
2661
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/FormItemInput.js
|
|
2662
|
+
var GRID_MAX = 24;
|
|
2663
|
+
var FormItemInput = (props) => {
|
|
2664
|
+
const {
|
|
2665
|
+
prefixCls,
|
|
2666
|
+
status,
|
|
2667
|
+
labelCol,
|
|
2668
|
+
wrapperCol,
|
|
2669
|
+
children,
|
|
2670
|
+
errors,
|
|
2671
|
+
warnings,
|
|
2672
|
+
_internalItemRender: formItemRender,
|
|
2673
|
+
extra,
|
|
2674
|
+
help,
|
|
2675
|
+
fieldId,
|
|
2676
|
+
marginBottom,
|
|
2677
|
+
onErrorVisibleChanged,
|
|
2678
|
+
label
|
|
2679
|
+
} = props;
|
|
2680
|
+
const baseClassName = `${prefixCls}-item`;
|
|
2681
|
+
const formContext = useContext(FormContext);
|
|
2682
|
+
const {
|
|
2683
|
+
classNames: contextClassNames,
|
|
2684
|
+
styles: contextStyles
|
|
2685
|
+
} = formContext;
|
|
2686
|
+
const mergedWrapperCol = useMemo(() => {
|
|
2687
|
+
let mergedWrapper = {
|
|
2688
|
+
...wrapperCol || formContext.wrapperCol || {}
|
|
2689
|
+
};
|
|
2690
|
+
if (label === null && !labelCol && !wrapperCol && formContext.labelCol) {
|
|
2691
|
+
const list = [void 0].concat(_toConsumableArray(responsiveArrayReversed));
|
|
2692
|
+
list.forEach((size) => {
|
|
2693
|
+
const _size = size ? [size] : [];
|
|
2694
|
+
const formLabel = get(formContext.labelCol, _size);
|
|
2695
|
+
const formLabelObj = isPlainObject(formLabel) ? formLabel : {};
|
|
2696
|
+
const wrapper = get(mergedWrapper, _size);
|
|
2697
|
+
const wrapperObj = isPlainObject(wrapper) ? wrapper : {};
|
|
2698
|
+
if ("span" in formLabelObj && !("offset" in wrapperObj) && formLabelObj.span < GRID_MAX) {
|
|
2699
|
+
mergedWrapper = set(mergedWrapper, [].concat(_size, ["offset"]), formLabelObj.span);
|
|
2700
|
+
}
|
|
2701
|
+
});
|
|
2702
|
+
}
|
|
2703
|
+
return mergedWrapper;
|
|
2704
|
+
}, [wrapperCol, formContext.wrapperCol, formContext.labelCol, label, labelCol]);
|
|
2705
|
+
const className = clsx(`${baseClassName}-control`, mergedWrapperCol.className);
|
|
2706
|
+
const subFormContext = useMemo(() => {
|
|
2707
|
+
const {
|
|
2708
|
+
labelCol: _labelCol,
|
|
2709
|
+
wrapperCol: _wrapperCol,
|
|
2710
|
+
...rest
|
|
2711
|
+
} = formContext;
|
|
2712
|
+
return rest;
|
|
2713
|
+
}, [formContext]);
|
|
2714
|
+
const extraRef = useRef(null);
|
|
2715
|
+
const [extraHeight, setExtraHeight] = useState(0);
|
|
2716
|
+
useLayoutEffect_default(() => {
|
|
2717
|
+
if (extra && extraRef.current) {
|
|
2718
|
+
setExtraHeight(extraRef.current.clientHeight);
|
|
2719
|
+
} else {
|
|
2720
|
+
setExtraHeight(0);
|
|
2721
|
+
}
|
|
2722
|
+
}, [extra]);
|
|
2723
|
+
const inputDom = /* @__PURE__ */ createElement("div", {
|
|
2724
|
+
className: `${baseClassName}-control-input`
|
|
2725
|
+
}, /* @__PURE__ */ createElement("div", {
|
|
2726
|
+
className: clsx(`${baseClassName}-control-input-content`, contextClassNames?.content),
|
|
2727
|
+
style: contextStyles?.content
|
|
2728
|
+
}, children));
|
|
2729
|
+
const formItemContext = useMemo(() => ({
|
|
2730
|
+
prefixCls,
|
|
2731
|
+
status
|
|
2732
|
+
}), [prefixCls, status]);
|
|
2733
|
+
const errorListDom = marginBottom !== null || errors.length || warnings.length ? /* @__PURE__ */ createElement(FormItemPrefixContext.Provider, {
|
|
2734
|
+
value: formItemContext
|
|
2735
|
+
}, /* @__PURE__ */ createElement(ErrorList_default, {
|
|
2736
|
+
fieldId,
|
|
2737
|
+
errors,
|
|
2738
|
+
warnings,
|
|
2739
|
+
help,
|
|
2740
|
+
helpStatus: status,
|
|
2741
|
+
className: `${baseClassName}-explain-connected`,
|
|
2742
|
+
onVisibleChanged: onErrorVisibleChanged
|
|
2743
|
+
})) : null;
|
|
2744
|
+
const extraProps = {};
|
|
2745
|
+
if (fieldId) {
|
|
2746
|
+
extraProps.id = `${fieldId}_extra`;
|
|
2747
|
+
}
|
|
2748
|
+
const extraDom = extra ? /* @__PURE__ */ createElement("div", {
|
|
2749
|
+
...extraProps,
|
|
2750
|
+
className: clsx(`${baseClassName}-extra`, contextClassNames?.extra),
|
|
2751
|
+
style: contextStyles?.extra,
|
|
2752
|
+
ref: extraRef
|
|
2753
|
+
}, extra) : null;
|
|
2754
|
+
const additionalDom = errorListDom || extraDom ? /* @__PURE__ */ createElement("div", {
|
|
2755
|
+
className: `${baseClassName}-additional`,
|
|
2756
|
+
style: marginBottom ? {
|
|
2757
|
+
minHeight: marginBottom + extraHeight
|
|
2758
|
+
} : {}
|
|
2759
|
+
}, errorListDom, extraDom) : null;
|
|
2760
|
+
const dom = formItemRender && formItemRender.mark === "pro_table_render" && formItemRender.render ? formItemRender.render(props, {
|
|
2761
|
+
input: inputDom,
|
|
2762
|
+
errorList: errorListDom,
|
|
2763
|
+
extra: extraDom
|
|
2764
|
+
}) : /* @__PURE__ */ createElement(Fragment, null, inputDom, additionalDom);
|
|
2765
|
+
return /* @__PURE__ */ createElement(FormContext.Provider, {
|
|
2766
|
+
value: subFormContext
|
|
2767
|
+
}, /* @__PURE__ */ createElement(col_default, {
|
|
2768
|
+
...mergedWrapperCol,
|
|
2769
|
+
className
|
|
2770
|
+
}, dom), /* @__PURE__ */ createElement(fallbackCmp_default, {
|
|
2771
|
+
prefixCls
|
|
2772
|
+
}));
|
|
2773
|
+
};
|
|
2774
|
+
var FormItemInput_default = FormItemInput;
|
|
2775
|
+
|
|
2776
|
+
// ../../node_modules/.pnpm/@ant-design+icons@6.3.2_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@ant-design/icons/es/icons/QuestionCircleOutlined.js
|
|
2777
|
+
var import_QuestionCircleOutlined = __toESM(require_QuestionCircleOutlined());
|
|
2778
|
+
function _extends3() {
|
|
2779
|
+
_extends3 = Object.assign ? Object.assign.bind() : function(target) {
|
|
2780
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2781
|
+
var source = arguments[i];
|
|
2782
|
+
for (var key in source) {
|
|
2783
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2784
|
+
target[key] = source[key];
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
return target;
|
|
2789
|
+
};
|
|
2790
|
+
return _extends3.apply(this, arguments);
|
|
2791
|
+
}
|
|
2792
|
+
var QuestionCircleOutlined = (props, ref) => /* @__PURE__ */ createElement(AntdIconLight_default, _extends3({}, props, {
|
|
2793
|
+
ref,
|
|
2794
|
+
icon: import_QuestionCircleOutlined.default
|
|
2795
|
+
}));
|
|
2796
|
+
var RefIcon2 = /* @__PURE__ */ forwardRef(QuestionCircleOutlined);
|
|
2797
|
+
if (true) {
|
|
2798
|
+
RefIcon2.displayName = "QuestionCircleOutlined";
|
|
2799
|
+
}
|
|
2800
|
+
var QuestionCircleOutlined_default = RefIcon2;
|
|
2801
|
+
|
|
2802
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/FormItemLabel.js
|
|
2803
|
+
var FormItemLabel = ({
|
|
2804
|
+
prefixCls,
|
|
2805
|
+
label,
|
|
2806
|
+
htmlFor,
|
|
2807
|
+
labelCol,
|
|
2808
|
+
labelAlign,
|
|
2809
|
+
colon,
|
|
2810
|
+
required,
|
|
2811
|
+
requiredMark,
|
|
2812
|
+
tooltip,
|
|
2813
|
+
vertical
|
|
2814
|
+
}) => {
|
|
2815
|
+
const [formLocale] = useLocale_default("Form");
|
|
2816
|
+
const {
|
|
2817
|
+
labelAlign: contextLabelAlign,
|
|
2818
|
+
labelCol: contextLabelCol,
|
|
2819
|
+
labelWrap,
|
|
2820
|
+
colon: contextColon,
|
|
2821
|
+
classNames: contextClassNames,
|
|
2822
|
+
styles: contextStyles,
|
|
2823
|
+
tooltip: contextTooltip
|
|
2824
|
+
} = useContext(FormContext);
|
|
2825
|
+
if (!label) {
|
|
2826
|
+
return null;
|
|
2827
|
+
}
|
|
2828
|
+
const mergedLabelCol = labelCol || contextLabelCol || {};
|
|
2829
|
+
const mergedLabelAlign = labelAlign || contextLabelAlign;
|
|
2830
|
+
const labelClsBasic = `${prefixCls}-item-label`;
|
|
2831
|
+
const labelColClassName = clsx(labelClsBasic, mergedLabelAlign === "left" && `${labelClsBasic}-left`, mergedLabelCol.className, {
|
|
2832
|
+
[`${labelClsBasic}-wrap`]: !!labelWrap
|
|
2833
|
+
});
|
|
2834
|
+
let labelChildren = label;
|
|
2835
|
+
const computedColon = colon === true || contextColon !== false && colon !== false;
|
|
2836
|
+
const haveColon = computedColon && !vertical;
|
|
2837
|
+
if (haveColon && typeof label === "string" && label.trim()) {
|
|
2838
|
+
labelChildren = label.replace(/[:|:]\s*$/, "");
|
|
2839
|
+
}
|
|
2840
|
+
const tooltipProps = convertToTooltipProps_default(tooltip, contextTooltip);
|
|
2841
|
+
if (tooltipProps) {
|
|
2842
|
+
const tooltipNode = /* @__PURE__ */ createElement(tooltip_default, {
|
|
2843
|
+
...tooltipProps
|
|
2844
|
+
}, /* @__PURE__ */ createElement("span", {
|
|
2845
|
+
className: `${prefixCls}-item-tooltip`,
|
|
2846
|
+
onClick: (e3) => {
|
|
2847
|
+
e3.preventDefault();
|
|
2848
|
+
},
|
|
2849
|
+
tabIndex: -1
|
|
2850
|
+
}, tooltipProps.icon || tooltipProps.children || /* @__PURE__ */ createElement(QuestionCircleOutlined_default, null)));
|
|
2851
|
+
labelChildren = /* @__PURE__ */ createElement(Fragment, null, labelChildren, tooltipNode);
|
|
2852
|
+
}
|
|
2853
|
+
const isOptionalMark = requiredMark === "optional";
|
|
2854
|
+
const isRenderMark = isFunction(requiredMark);
|
|
2855
|
+
const hideRequiredMark = requiredMark === false;
|
|
2856
|
+
if (isRenderMark) {
|
|
2857
|
+
labelChildren = requiredMark(labelChildren, {
|
|
2858
|
+
required: !!required
|
|
2859
|
+
});
|
|
2860
|
+
} else if (isOptionalMark && !required) {
|
|
2861
|
+
labelChildren = /* @__PURE__ */ createElement(Fragment, null, labelChildren, /* @__PURE__ */ createElement("span", {
|
|
2862
|
+
className: `${prefixCls}-item-optional`
|
|
2863
|
+
}, formLocale?.optional || en_US_default.Form?.optional));
|
|
2864
|
+
}
|
|
2865
|
+
let markType;
|
|
2866
|
+
if (hideRequiredMark) {
|
|
2867
|
+
markType = "hidden";
|
|
2868
|
+
} else if (isOptionalMark || isRenderMark) {
|
|
2869
|
+
markType = "optional";
|
|
2870
|
+
}
|
|
2871
|
+
const labelClassName = clsx(contextClassNames?.label, {
|
|
2872
|
+
[`${prefixCls}-item-required`]: required,
|
|
2873
|
+
[`${prefixCls}-item-required-mark-${markType}`]: markType,
|
|
2874
|
+
[`${prefixCls}-item-no-colon`]: !computedColon
|
|
2875
|
+
});
|
|
2876
|
+
return /* @__PURE__ */ createElement(col_default, {
|
|
2877
|
+
...mergedLabelCol,
|
|
2878
|
+
className: labelColClassName
|
|
2879
|
+
}, /* @__PURE__ */ createElement("label", {
|
|
2880
|
+
htmlFor,
|
|
2881
|
+
className: labelClassName,
|
|
2882
|
+
style: contextStyles?.label,
|
|
2883
|
+
title: typeof label === "string" ? label : void 0
|
|
2884
|
+
}, labelChildren));
|
|
2885
|
+
};
|
|
2886
|
+
var FormItemLabel_default = FormItemLabel;
|
|
2887
|
+
|
|
2888
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/FormItem/StatusProvider.js
|
|
2889
|
+
var iconMap = {
|
|
2890
|
+
success: CheckCircleFilled_default,
|
|
2891
|
+
warning: ExclamationCircleFilled_default,
|
|
2892
|
+
error: CloseCircleFilled_default,
|
|
2893
|
+
validating: LoadingOutlined_default
|
|
2894
|
+
};
|
|
2895
|
+
function StatusProvider({
|
|
2896
|
+
children,
|
|
2897
|
+
errors,
|
|
2898
|
+
warnings,
|
|
2899
|
+
hasFeedback,
|
|
2900
|
+
validateStatus,
|
|
2901
|
+
prefixCls,
|
|
2902
|
+
meta,
|
|
2903
|
+
noStyle,
|
|
2904
|
+
name
|
|
2905
|
+
}) {
|
|
2906
|
+
const itemPrefixCls = `${prefixCls}-item`;
|
|
2907
|
+
const {
|
|
2908
|
+
feedbackIcons
|
|
2909
|
+
} = useContext(FormContext);
|
|
2910
|
+
const mergedValidateStatus = getStatus(errors, warnings, meta, null, !!hasFeedback, validateStatus);
|
|
2911
|
+
const {
|
|
2912
|
+
isFormItemInput: parentIsFormItemInput,
|
|
2913
|
+
status: parentStatus,
|
|
2914
|
+
hasFeedback: parentHasFeedback,
|
|
2915
|
+
feedbackIcon: parentFeedbackIcon,
|
|
2916
|
+
name: parentName
|
|
2917
|
+
} = useContext(FormItemInputContext);
|
|
2918
|
+
const formItemStatusContext = useMemo(() => {
|
|
2919
|
+
let feedbackIcon;
|
|
2920
|
+
if (hasFeedback) {
|
|
2921
|
+
const customIcons = hasFeedback !== true && hasFeedback.icons || feedbackIcons;
|
|
2922
|
+
const customIconNode = mergedValidateStatus && customIcons?.({
|
|
2923
|
+
status: mergedValidateStatus,
|
|
2924
|
+
errors,
|
|
2925
|
+
warnings
|
|
2926
|
+
})?.[mergedValidateStatus];
|
|
2927
|
+
const IconNode = mergedValidateStatus ? iconMap[mergedValidateStatus] : null;
|
|
2928
|
+
feedbackIcon = customIconNode !== false && IconNode ? /* @__PURE__ */ createElement("span", {
|
|
2929
|
+
className: clsx(`${itemPrefixCls}-feedback-icon`, `${itemPrefixCls}-feedback-icon-${mergedValidateStatus}`)
|
|
2930
|
+
}, customIconNode || /* @__PURE__ */ createElement(IconNode, null)) : null;
|
|
2931
|
+
}
|
|
2932
|
+
const context = {
|
|
2933
|
+
status: mergedValidateStatus || "",
|
|
2934
|
+
errors,
|
|
2935
|
+
warnings,
|
|
2936
|
+
hasFeedback: !!hasFeedback,
|
|
2937
|
+
feedbackIcon,
|
|
2938
|
+
isFormItemInput: true,
|
|
2939
|
+
name
|
|
2940
|
+
};
|
|
2941
|
+
if (noStyle) {
|
|
2942
|
+
context.status = (mergedValidateStatus ?? parentStatus) || "";
|
|
2943
|
+
context.isFormItemInput = parentIsFormItemInput;
|
|
2944
|
+
context.hasFeedback = !!(hasFeedback ?? parentHasFeedback);
|
|
2945
|
+
context.feedbackIcon = hasFeedback !== void 0 ? context.feedbackIcon : parentFeedbackIcon;
|
|
2946
|
+
context.name = name ?? parentName;
|
|
2947
|
+
}
|
|
2948
|
+
return context;
|
|
2949
|
+
}, [mergedValidateStatus, errors, warnings, hasFeedback, feedbackIcons, noStyle, name, parentIsFormItemInput, parentStatus, itemPrefixCls, parentHasFeedback, parentFeedbackIcon, parentName]);
|
|
2950
|
+
return /* @__PURE__ */ createElement(FormItemInputContext.Provider, {
|
|
2951
|
+
value: formItemStatusContext
|
|
2952
|
+
}, children);
|
|
2953
|
+
}
|
|
2954
|
+
var StatusProvider_default = StatusProvider;
|
|
2955
|
+
|
|
2956
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/FormItem/ItemHolder.js
|
|
2957
|
+
function ItemHolder(props) {
|
|
2958
|
+
const {
|
|
2959
|
+
prefixCls,
|
|
2960
|
+
className,
|
|
2961
|
+
rootClassName,
|
|
2962
|
+
style,
|
|
2963
|
+
help,
|
|
2964
|
+
errors,
|
|
2965
|
+
warnings,
|
|
2966
|
+
validateStatus,
|
|
2967
|
+
meta,
|
|
2968
|
+
hasFeedback,
|
|
2969
|
+
hidden,
|
|
2970
|
+
children,
|
|
2971
|
+
fieldId,
|
|
2972
|
+
required,
|
|
2973
|
+
isRequired,
|
|
2974
|
+
onSubItemMetaChange,
|
|
2975
|
+
layout: propsLayout,
|
|
2976
|
+
name,
|
|
2977
|
+
...restProps
|
|
2978
|
+
} = props;
|
|
2979
|
+
const itemPrefixCls = `${prefixCls}-item`;
|
|
2980
|
+
const {
|
|
2981
|
+
requiredMark,
|
|
2982
|
+
layout: formLayout
|
|
2983
|
+
} = useContext(FormContext);
|
|
2984
|
+
const layout = propsLayout || formLayout;
|
|
2985
|
+
const vertical = layout === "vertical";
|
|
2986
|
+
const itemRef = useRef(null);
|
|
2987
|
+
const debounceErrors = useDebounce(errors);
|
|
2988
|
+
const debounceWarnings = useDebounce(warnings);
|
|
2989
|
+
const hasHelp = isNonNullable(help);
|
|
2990
|
+
const hasError = !!(hasHelp || debounceErrors.length || debounceWarnings.length);
|
|
2991
|
+
const isOnScreen = !!itemRef.current && isVisible_default(itemRef.current);
|
|
2992
|
+
const [marginBottom, setMarginBottom] = useState(null);
|
|
2993
|
+
useLayoutEffect_default(() => {
|
|
2994
|
+
if (hasError && itemRef.current) {
|
|
2995
|
+
const itemStyle = getComputedStyle(itemRef.current);
|
|
2996
|
+
setMarginBottom(Number.parseInt(itemStyle.marginBottom, 10));
|
|
2997
|
+
}
|
|
2998
|
+
}, [hasError, isOnScreen]);
|
|
2999
|
+
const onErrorVisibleChanged = (nextVisible) => {
|
|
3000
|
+
if (!nextVisible && !hasError) {
|
|
3001
|
+
setMarginBottom(null);
|
|
3002
|
+
}
|
|
3003
|
+
};
|
|
3004
|
+
const getValidateState = (isDebounce = false) => {
|
|
3005
|
+
const _errors = isDebounce ? debounceErrors : meta.errors;
|
|
3006
|
+
const _warnings = isDebounce ? debounceWarnings : meta.warnings;
|
|
3007
|
+
return getStatus(_errors, _warnings, meta, "", !!hasFeedback, validateStatus);
|
|
3008
|
+
};
|
|
3009
|
+
const mergedValidateStatus = getValidateState();
|
|
3010
|
+
const itemClassName = clsx(itemPrefixCls, className, rootClassName, {
|
|
3011
|
+
[`${itemPrefixCls}-with-help`]: hasHelp || debounceErrors.length || debounceWarnings.length,
|
|
3012
|
+
// Status
|
|
3013
|
+
[`${itemPrefixCls}-has-feedback`]: mergedValidateStatus && hasFeedback,
|
|
3014
|
+
[`${itemPrefixCls}-has-success`]: mergedValidateStatus === "success",
|
|
3015
|
+
[`${itemPrefixCls}-has-warning`]: mergedValidateStatus === "warning",
|
|
3016
|
+
[`${itemPrefixCls}-has-error`]: mergedValidateStatus === "error",
|
|
3017
|
+
[`${itemPrefixCls}-is-validating`]: mergedValidateStatus === "validating",
|
|
3018
|
+
[`${itemPrefixCls}-hidden`]: hidden,
|
|
3019
|
+
// Layout
|
|
3020
|
+
[`${itemPrefixCls}-${layout}`]: layout
|
|
3021
|
+
});
|
|
3022
|
+
return /* @__PURE__ */ createElement("div", {
|
|
3023
|
+
className: itemClassName,
|
|
3024
|
+
style,
|
|
3025
|
+
ref: itemRef
|
|
3026
|
+
}, /* @__PURE__ */ createElement(row_default, {
|
|
3027
|
+
className: `${itemPrefixCls}-row`,
|
|
3028
|
+
...omit(restProps, [
|
|
3029
|
+
"_internalItemRender",
|
|
3030
|
+
"colon",
|
|
3031
|
+
"dependencies",
|
|
3032
|
+
"extra",
|
|
3033
|
+
"fieldKey",
|
|
3034
|
+
"getValueFromEvent",
|
|
3035
|
+
"getValueProps",
|
|
3036
|
+
"htmlFor",
|
|
3037
|
+
"id",
|
|
3038
|
+
// It is deprecated because `htmlFor` is its replacement.
|
|
3039
|
+
"initialValue",
|
|
3040
|
+
"isListField",
|
|
3041
|
+
"label",
|
|
3042
|
+
"labelAlign",
|
|
3043
|
+
"labelCol",
|
|
3044
|
+
"labelWrap",
|
|
3045
|
+
"messageVariables",
|
|
3046
|
+
"name",
|
|
3047
|
+
"normalize",
|
|
3048
|
+
"noStyle",
|
|
3049
|
+
"preserve",
|
|
3050
|
+
"requiredMark",
|
|
3051
|
+
"rules",
|
|
3052
|
+
"shouldUpdate",
|
|
3053
|
+
"trigger",
|
|
3054
|
+
"tooltip",
|
|
3055
|
+
"validateFirst",
|
|
3056
|
+
"validateTrigger",
|
|
3057
|
+
"valuePropName",
|
|
3058
|
+
"wrapperCol",
|
|
3059
|
+
"validateDebounce"
|
|
3060
|
+
])
|
|
3061
|
+
}, /* @__PURE__ */ createElement(FormItemLabel_default, {
|
|
3062
|
+
htmlFor: fieldId,
|
|
3063
|
+
...props,
|
|
3064
|
+
requiredMark,
|
|
3065
|
+
required: required ?? isRequired,
|
|
3066
|
+
prefixCls,
|
|
3067
|
+
vertical
|
|
3068
|
+
}), /* @__PURE__ */ createElement(FormItemInput_default, {
|
|
3069
|
+
...props,
|
|
3070
|
+
...meta,
|
|
3071
|
+
errors: debounceErrors,
|
|
3072
|
+
warnings: debounceWarnings,
|
|
3073
|
+
prefixCls,
|
|
3074
|
+
status: mergedValidateStatus,
|
|
3075
|
+
help,
|
|
3076
|
+
marginBottom,
|
|
3077
|
+
onErrorVisibleChanged
|
|
3078
|
+
}, /* @__PURE__ */ createElement(NoStyleItemContext.Provider, {
|
|
3079
|
+
value: onSubItemMetaChange
|
|
3080
|
+
}, /* @__PURE__ */ createElement(StatusProvider_default, {
|
|
3081
|
+
prefixCls,
|
|
3082
|
+
meta,
|
|
3083
|
+
errors: meta.errors,
|
|
3084
|
+
warnings: meta.warnings,
|
|
3085
|
+
hasFeedback,
|
|
3086
|
+
// Already calculated
|
|
3087
|
+
validateStatus: mergedValidateStatus,
|
|
3088
|
+
name
|
|
3089
|
+
}, children)))), !!marginBottom && /* @__PURE__ */ createElement("div", {
|
|
3090
|
+
className: `${itemPrefixCls}-margin-offset`,
|
|
3091
|
+
style: {
|
|
3092
|
+
marginBottom: -marginBottom
|
|
3093
|
+
}
|
|
3094
|
+
}));
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/FormItem/index.js
|
|
3098
|
+
var NAME_SPLIT = "__SPLIT__";
|
|
3099
|
+
function isSimilarControl(a, b) {
|
|
3100
|
+
const keysA = Object.keys(a);
|
|
3101
|
+
const keysB = Object.keys(b);
|
|
3102
|
+
return keysA.length === keysB.length && keysA.every((key) => {
|
|
3103
|
+
const propValueA = a[key];
|
|
3104
|
+
const propValueB = b[key];
|
|
3105
|
+
return propValueA === propValueB || isFunction(propValueA) || isFunction(propValueB);
|
|
3106
|
+
});
|
|
3107
|
+
}
|
|
3108
|
+
var MemoInput = /* @__PURE__ */ memo((props) => props.children, (prev, next) => isSimilarControl(prev.control, next.control) && prev.update === next.update && prev.childProps.length === next.childProps.length && prev.childProps.every((value, index) => value === next.childProps[index]));
|
|
3109
|
+
function genEmptyMeta() {
|
|
3110
|
+
return {
|
|
3111
|
+
errors: [],
|
|
3112
|
+
warnings: [],
|
|
3113
|
+
touched: false,
|
|
3114
|
+
validating: false,
|
|
3115
|
+
name: [],
|
|
3116
|
+
validated: false
|
|
3117
|
+
};
|
|
3118
|
+
}
|
|
3119
|
+
function InternalFormItem(props) {
|
|
3120
|
+
const {
|
|
3121
|
+
name,
|
|
3122
|
+
noStyle,
|
|
3123
|
+
className,
|
|
3124
|
+
dependencies,
|
|
3125
|
+
prefixCls: customizePrefixCls,
|
|
3126
|
+
shouldUpdate,
|
|
3127
|
+
rules,
|
|
3128
|
+
children,
|
|
3129
|
+
required,
|
|
3130
|
+
label,
|
|
3131
|
+
messageVariables,
|
|
3132
|
+
trigger = "onChange",
|
|
3133
|
+
validateTrigger,
|
|
3134
|
+
hidden,
|
|
3135
|
+
help,
|
|
3136
|
+
layout
|
|
3137
|
+
} = props;
|
|
3138
|
+
const {
|
|
3139
|
+
getPrefixCls
|
|
3140
|
+
} = useContext(ConfigContext);
|
|
3141
|
+
const {
|
|
3142
|
+
name: formName
|
|
3143
|
+
} = useContext(FormContext);
|
|
3144
|
+
const mergedChildren = useChildren_default(children);
|
|
3145
|
+
const isRenderProps = isFunction(mergedChildren);
|
|
3146
|
+
const notifyParentMetaChange = useContext(NoStyleItemContext);
|
|
3147
|
+
const {
|
|
3148
|
+
validateTrigger: contextValidateTrigger
|
|
3149
|
+
} = useContext(FieldContext_default);
|
|
3150
|
+
const mergedValidateTrigger = isNonNullable(validateTrigger) ? validateTrigger : contextValidateTrigger;
|
|
3151
|
+
const hasName = isNonNullable(name);
|
|
3152
|
+
const prefixCls = getPrefixCls("form", customizePrefixCls);
|
|
3153
|
+
const rootCls = useCSSVarCls_default(prefixCls);
|
|
3154
|
+
const [hashId, cssVarCls] = style_default3(prefixCls, rootCls);
|
|
3155
|
+
const warning = useDevWarning("Form.Item");
|
|
3156
|
+
if (true) {
|
|
3157
|
+
true ? warning(name !== null, "usage", "`null` is passed as `name` property") : void 0;
|
|
3158
|
+
}
|
|
3159
|
+
const listContext = useContext(ListContext_default);
|
|
3160
|
+
const fieldKeyPathRef = useRef(null);
|
|
3161
|
+
const [subFieldErrors, setSubFieldErrors] = useFrameState({});
|
|
3162
|
+
const [meta, setMeta] = useState_default(() => genEmptyMeta());
|
|
3163
|
+
const onMetaChange = (nextMeta) => {
|
|
3164
|
+
const keyInfo = listContext?.getKey(nextMeta.name);
|
|
3165
|
+
setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta, true);
|
|
3166
|
+
if (noStyle && help !== false && notifyParentMetaChange) {
|
|
3167
|
+
let namePath = nextMeta.name;
|
|
3168
|
+
if (!nextMeta.destroy) {
|
|
3169
|
+
if (keyInfo !== void 0) {
|
|
3170
|
+
const [fieldKey, restPath] = keyInfo;
|
|
3171
|
+
namePath = [fieldKey].concat(_toConsumableArray(restPath));
|
|
3172
|
+
fieldKeyPathRef.current = namePath;
|
|
3173
|
+
}
|
|
3174
|
+
} else {
|
|
3175
|
+
namePath = fieldKeyPathRef.current || namePath;
|
|
3176
|
+
}
|
|
3177
|
+
notifyParentMetaChange(nextMeta, namePath);
|
|
3178
|
+
}
|
|
3179
|
+
};
|
|
3180
|
+
const onSubItemMetaChange = (subMeta, uniqueKeys) => {
|
|
3181
|
+
setSubFieldErrors((prevSubFieldErrors) => {
|
|
3182
|
+
const clone = {
|
|
3183
|
+
...prevSubFieldErrors
|
|
3184
|
+
};
|
|
3185
|
+
const mergedNamePath = [].concat(_toConsumableArray(subMeta.name.slice(0, -1)), _toConsumableArray(uniqueKeys));
|
|
3186
|
+
const mergedNameKey = mergedNamePath.join(NAME_SPLIT);
|
|
3187
|
+
if (subMeta.destroy) {
|
|
3188
|
+
delete clone[mergedNameKey];
|
|
3189
|
+
} else {
|
|
3190
|
+
clone[mergedNameKey] = subMeta;
|
|
3191
|
+
}
|
|
3192
|
+
return clone;
|
|
3193
|
+
});
|
|
3194
|
+
};
|
|
3195
|
+
const [mergedErrors, mergedWarnings] = useMemo(() => {
|
|
3196
|
+
const errorList = _toConsumableArray(meta.errors);
|
|
3197
|
+
const warningList = _toConsumableArray(meta.warnings);
|
|
3198
|
+
Object.values(subFieldErrors).forEach((subFieldError) => {
|
|
3199
|
+
errorList.push.apply(errorList, _toConsumableArray(subFieldError.errors || []));
|
|
3200
|
+
warningList.push.apply(warningList, _toConsumableArray(subFieldError.warnings || []));
|
|
3201
|
+
});
|
|
3202
|
+
return [errorList, warningList];
|
|
3203
|
+
}, [subFieldErrors, meta.errors, meta.warnings]);
|
|
3204
|
+
const getItemRef = useItemRef_default();
|
|
3205
|
+
function renderLayout(baseChildren, fieldId, isRequired) {
|
|
3206
|
+
if (noStyle && !hidden) {
|
|
3207
|
+
return /* @__PURE__ */ createElement(StatusProvider_default, {
|
|
3208
|
+
prefixCls,
|
|
3209
|
+
hasFeedback: props.hasFeedback,
|
|
3210
|
+
validateStatus: props.validateStatus,
|
|
3211
|
+
meta,
|
|
3212
|
+
errors: mergedErrors,
|
|
3213
|
+
warnings: mergedWarnings,
|
|
3214
|
+
noStyle: true,
|
|
3215
|
+
name
|
|
3216
|
+
}, baseChildren);
|
|
3217
|
+
}
|
|
3218
|
+
return /* @__PURE__ */ createElement(ItemHolder, {
|
|
3219
|
+
key: "row",
|
|
3220
|
+
...props,
|
|
3221
|
+
className: clsx(className, cssVarCls, rootCls, hashId),
|
|
3222
|
+
prefixCls,
|
|
3223
|
+
fieldId,
|
|
3224
|
+
isRequired,
|
|
3225
|
+
errors: mergedErrors,
|
|
3226
|
+
warnings: mergedWarnings,
|
|
3227
|
+
meta,
|
|
3228
|
+
onSubItemMetaChange,
|
|
3229
|
+
layout,
|
|
3230
|
+
name
|
|
3231
|
+
}, baseChildren);
|
|
3232
|
+
}
|
|
3233
|
+
if (!hasName && !isRenderProps && !dependencies) {
|
|
3234
|
+
return renderLayout(mergedChildren);
|
|
3235
|
+
}
|
|
3236
|
+
let variables = {};
|
|
3237
|
+
if (typeof label === "string") {
|
|
3238
|
+
variables.label = label;
|
|
3239
|
+
} else if (name) {
|
|
3240
|
+
variables.label = String(name);
|
|
3241
|
+
}
|
|
3242
|
+
if (messageVariables) {
|
|
3243
|
+
variables = {
|
|
3244
|
+
...variables,
|
|
3245
|
+
...messageVariables
|
|
3246
|
+
};
|
|
3247
|
+
}
|
|
3248
|
+
return /* @__PURE__ */ createElement(Field_default, {
|
|
3249
|
+
...props,
|
|
3250
|
+
messageVariables: variables,
|
|
3251
|
+
trigger,
|
|
3252
|
+
validateTrigger: mergedValidateTrigger,
|
|
3253
|
+
onMetaChange
|
|
3254
|
+
}, (control, renderMeta, context) => {
|
|
3255
|
+
const mergedName = toArray2(name).length && renderMeta ? renderMeta.name : [];
|
|
3256
|
+
const fieldId = getFieldId(mergedName, formName);
|
|
3257
|
+
const isRequired = required !== void 0 ? required : rules?.some((rule) => {
|
|
3258
|
+
if (isPlainObject(rule) && rule.required && !rule.warningOnly) {
|
|
3259
|
+
return true;
|
|
3260
|
+
}
|
|
3261
|
+
if (isFunction(rule)) {
|
|
3262
|
+
const ruleEntity = rule(context);
|
|
3263
|
+
return ruleEntity?.required && !ruleEntity?.warningOnly;
|
|
3264
|
+
}
|
|
3265
|
+
return false;
|
|
3266
|
+
});
|
|
3267
|
+
const mergedControl = {
|
|
3268
|
+
...control
|
|
3269
|
+
};
|
|
3270
|
+
let childNode = null;
|
|
3271
|
+
true ? warning(!(shouldUpdate && dependencies), "usage", "`shouldUpdate` and `dependencies` shouldn't be used together. See https://u.ant.design/form-deps.") : void 0;
|
|
3272
|
+
if (Array.isArray(mergedChildren) && hasName) {
|
|
3273
|
+
true ? warning(false, "usage", "A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://u.ant.design/complex-form-item.") : void 0;
|
|
3274
|
+
childNode = mergedChildren;
|
|
3275
|
+
} else if (isRenderProps && (!(shouldUpdate || dependencies) || hasName)) {
|
|
3276
|
+
true ? warning(!!(shouldUpdate || dependencies), "usage", "A `Form.Item` with a render function must have either `shouldUpdate` or `dependencies`.") : void 0;
|
|
3277
|
+
true ? warning(!hasName, "usage", "A `Form.Item` with a render function cannot be a field, and thus cannot have a `name` prop.") : void 0;
|
|
3278
|
+
} else if (dependencies && !isRenderProps && !hasName) {
|
|
3279
|
+
true ? warning(false, "usage", "Must set `name` or use a render function when `dependencies` is set.") : void 0;
|
|
3280
|
+
} else if (/* @__PURE__ */ isValidElement(mergedChildren)) {
|
|
3281
|
+
true ? warning(mergedChildren.props.defaultValue === void 0, "usage", "`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.") : void 0;
|
|
3282
|
+
const childProps = {
|
|
3283
|
+
...mergedChildren.props,
|
|
3284
|
+
...mergedControl
|
|
3285
|
+
};
|
|
3286
|
+
if (!childProps.id) {
|
|
3287
|
+
childProps.id = fieldId;
|
|
3288
|
+
}
|
|
3289
|
+
if (help || mergedErrors.length > 0 || mergedWarnings.length > 0 || props.extra) {
|
|
3290
|
+
const describedbyArr = [];
|
|
3291
|
+
if (help || mergedErrors.length > 0) {
|
|
3292
|
+
describedbyArr.push(`${fieldId}_help`);
|
|
3293
|
+
}
|
|
3294
|
+
if (props.extra) {
|
|
3295
|
+
describedbyArr.push(`${fieldId}_extra`);
|
|
3296
|
+
}
|
|
3297
|
+
childProps["aria-describedby"] = describedbyArr.join(" ");
|
|
3298
|
+
}
|
|
3299
|
+
if (mergedErrors.length > 0) {
|
|
3300
|
+
childProps["aria-invalid"] = "true";
|
|
3301
|
+
}
|
|
3302
|
+
if (isRequired) {
|
|
3303
|
+
childProps["aria-required"] = "true";
|
|
3304
|
+
}
|
|
3305
|
+
if (supportRef(mergedChildren)) {
|
|
3306
|
+
childProps.ref = getItemRef(mergedName, mergedChildren);
|
|
3307
|
+
}
|
|
3308
|
+
const triggers = new Set([].concat(_toConsumableArray(toArray2(trigger)), _toConsumableArray(toArray2(mergedValidateTrigger))));
|
|
3309
|
+
triggers.forEach((eventName) => {
|
|
3310
|
+
childProps[eventName] = (...args) => {
|
|
3311
|
+
mergedControl[eventName]?.(...args);
|
|
3312
|
+
mergedChildren.props[eventName]?.(...args);
|
|
3313
|
+
};
|
|
3314
|
+
});
|
|
3315
|
+
const watchingChildProps = [childProps["aria-required"], childProps["aria-invalid"], childProps["aria-describedby"]];
|
|
3316
|
+
childNode = /* @__PURE__ */ createElement(MemoInput, {
|
|
3317
|
+
control: mergedControl,
|
|
3318
|
+
update: mergedChildren,
|
|
3319
|
+
childProps: watchingChildProps
|
|
3320
|
+
}, cloneElement(mergedChildren, childProps));
|
|
3321
|
+
} else if (isRenderProps && (shouldUpdate || dependencies) && !hasName) {
|
|
3322
|
+
childNode = mergedChildren(context);
|
|
3323
|
+
} else {
|
|
3324
|
+
true ? warning(!mergedName.length || !!noStyle, "usage", "`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead.") : void 0;
|
|
3325
|
+
childNode = mergedChildren;
|
|
3326
|
+
}
|
|
3327
|
+
return renderLayout(childNode, fieldId, isRequired);
|
|
3328
|
+
});
|
|
3329
|
+
}
|
|
3330
|
+
var FormItem = InternalFormItem;
|
|
3331
|
+
FormItem.useStatus = useFormItemStatus_default;
|
|
3332
|
+
var FormItem_default = FormItem;
|
|
3333
|
+
|
|
3334
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/FormList.js
|
|
3335
|
+
var FormList = ({
|
|
3336
|
+
prefixCls: customizePrefixCls,
|
|
3337
|
+
children,
|
|
3338
|
+
...props
|
|
3339
|
+
}) => {
|
|
3340
|
+
if (true) {
|
|
3341
|
+
const warning = useDevWarning("Form.List");
|
|
3342
|
+
true ? warning(isNumber(props.name) || (Array.isArray(props.name) ? !!props.name.length : !!props.name), "usage", "Miss `name` prop.") : void 0;
|
|
3343
|
+
}
|
|
3344
|
+
const {
|
|
3345
|
+
getPrefixCls
|
|
3346
|
+
} = useContext(ConfigContext);
|
|
3347
|
+
const prefixCls = getPrefixCls("form", customizePrefixCls);
|
|
3348
|
+
const contextValue = useMemo(() => ({
|
|
3349
|
+
prefixCls,
|
|
3350
|
+
status: "error"
|
|
3351
|
+
}), [prefixCls]);
|
|
3352
|
+
return /* @__PURE__ */ createElement(List_default, {
|
|
3353
|
+
...props
|
|
3354
|
+
}, (fields, operation, meta) => /* @__PURE__ */ createElement(FormItemPrefixContext.Provider, {
|
|
3355
|
+
value: contextValue
|
|
3356
|
+
}, children(fields.map((field) => ({
|
|
3357
|
+
...field,
|
|
3358
|
+
fieldKey: field.key
|
|
3359
|
+
})), operation, {
|
|
3360
|
+
errors: meta.errors,
|
|
3361
|
+
warnings: meta.warnings
|
|
3362
|
+
})));
|
|
3363
|
+
};
|
|
3364
|
+
var FormList_default = FormList;
|
|
3365
|
+
|
|
3366
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/hooks/useFormInstance.js
|
|
3367
|
+
function useFormInstance() {
|
|
3368
|
+
const {
|
|
3369
|
+
form
|
|
3370
|
+
} = useContext(FormContext);
|
|
3371
|
+
return form;
|
|
3372
|
+
}
|
|
3373
|
+
|
|
3374
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/form/index.js
|
|
3375
|
+
var Form2 = Form_default;
|
|
3376
|
+
Form2.Item = FormItem_default;
|
|
3377
|
+
Form2.List = FormList_default;
|
|
3378
|
+
Form2.ErrorList = ErrorList_default;
|
|
3379
|
+
Form2.useForm = useForm;
|
|
3380
|
+
Form2.useFormInstance = useFormInstance;
|
|
3381
|
+
Form2.useWatch = useWatch_default;
|
|
3382
|
+
Form2.Provider = FormProvider;
|
|
3383
|
+
var form_default = Form2;
|
|
3384
|
+
|
|
3385
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/input/Group.js
|
|
3386
|
+
var Group = (props) => {
|
|
3387
|
+
const {
|
|
3388
|
+
getPrefixCls,
|
|
3389
|
+
direction
|
|
3390
|
+
} = useContext(ConfigContext);
|
|
3391
|
+
const {
|
|
3392
|
+
prefixCls: customizePrefixCls,
|
|
3393
|
+
className
|
|
3394
|
+
} = props;
|
|
3395
|
+
const prefixCls = getPrefixCls("input-group", customizePrefixCls);
|
|
3396
|
+
const inputPrefixCls = getPrefixCls("input");
|
|
3397
|
+
const [hashId, cssVarCls] = style_default(inputPrefixCls);
|
|
3398
|
+
const cls = clsx(prefixCls, cssVarCls, {
|
|
3399
|
+
[`${prefixCls}-lg`]: props.size === "large",
|
|
3400
|
+
[`${prefixCls}-sm`]: props.size === "small",
|
|
3401
|
+
[`${prefixCls}-compact`]: props.compact,
|
|
3402
|
+
[`${prefixCls}-rtl`]: direction === "rtl"
|
|
3403
|
+
}, hashId, className);
|
|
3404
|
+
const formItemContext = useContext(FormItemInputContext);
|
|
3405
|
+
const groupFormItemContext = useMemo(() => ({
|
|
3406
|
+
...formItemContext,
|
|
3407
|
+
isFormItemInput: false
|
|
3408
|
+
}), [formItemContext]);
|
|
3409
|
+
if (true) {
|
|
3410
|
+
const warning = devUseWarning("Input.Group");
|
|
3411
|
+
warning.deprecated(false, "Input.Group", "Space.Compact");
|
|
3412
|
+
}
|
|
3413
|
+
return /* @__PURE__ */ createElement(FormItemInputContext.Provider, {
|
|
3414
|
+
value: groupFormItemContext
|
|
3415
|
+
}, /* @__PURE__ */ createElement(space_default.Compact, {
|
|
3416
|
+
className: cls,
|
|
3417
|
+
style: props.style,
|
|
3418
|
+
onMouseEnter: props.onMouseEnter,
|
|
3419
|
+
onMouseLeave: props.onMouseLeave,
|
|
3420
|
+
onFocus: props.onFocus,
|
|
3421
|
+
onBlur: props.onBlur
|
|
3422
|
+
}, props.children));
|
|
3423
|
+
};
|
|
3424
|
+
var Group_default = Group;
|
|
3425
|
+
|
|
3426
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/input/style/otp.js
|
|
3427
|
+
var genOTPStyle = (token) => {
|
|
3428
|
+
const {
|
|
3429
|
+
componentCls,
|
|
3430
|
+
paddingXS
|
|
3431
|
+
} = token;
|
|
3432
|
+
return {
|
|
3433
|
+
[componentCls]: {
|
|
3434
|
+
display: "inline-flex",
|
|
3435
|
+
alignItems: "center",
|
|
3436
|
+
flexWrap: "nowrap",
|
|
3437
|
+
columnGap: paddingXS,
|
|
3438
|
+
[`${componentCls}-input-wrapper`]: {
|
|
3439
|
+
position: "relative",
|
|
3440
|
+
[`${componentCls}-mask-icon`]: {
|
|
3441
|
+
position: "absolute",
|
|
3442
|
+
zIndex: "1",
|
|
3443
|
+
top: "50%",
|
|
3444
|
+
right: "50%",
|
|
3445
|
+
transform: "translate(50%, -50%)",
|
|
3446
|
+
pointerEvents: "none"
|
|
3447
|
+
},
|
|
3448
|
+
[`${componentCls}-mask-input`]: {
|
|
3449
|
+
color: "transparent",
|
|
3450
|
+
caretColor: token.colorText,
|
|
3451
|
+
"&::selection": {
|
|
3452
|
+
color: "transparent"
|
|
3453
|
+
}
|
|
3454
|
+
},
|
|
3455
|
+
[`${componentCls}-mask-input[type=number]::-webkit-inner-spin-button`]: {
|
|
3456
|
+
"-webkit-appearance": "none",
|
|
3457
|
+
margin: 0
|
|
3458
|
+
},
|
|
3459
|
+
[`${componentCls}-mask-input[type=number]`]: {
|
|
3460
|
+
"-moz-appearance": "textfield"
|
|
3461
|
+
}
|
|
3462
|
+
},
|
|
3463
|
+
"&-rtl": {
|
|
3464
|
+
direction: "rtl"
|
|
3465
|
+
},
|
|
3466
|
+
[`${componentCls}-input`]: {
|
|
3467
|
+
textAlign: "center",
|
|
3468
|
+
paddingInline: token.paddingXXS
|
|
3469
|
+
},
|
|
3470
|
+
// ================= Size =================
|
|
3471
|
+
[`&${componentCls}-sm ${componentCls}-input`]: {
|
|
3472
|
+
paddingInline: token.calc(token.paddingXXS).div(2).equal()
|
|
3473
|
+
},
|
|
3474
|
+
[`&${componentCls}-lg ${componentCls}-input`]: {
|
|
3475
|
+
paddingInline: token.paddingXS
|
|
3476
|
+
}
|
|
3477
|
+
}
|
|
3478
|
+
};
|
|
3479
|
+
};
|
|
3480
|
+
var otp_default = genStyleHooks(["Input", "OTP"], (token) => {
|
|
3481
|
+
const inputToken = merge(token, initInputToken(token));
|
|
3482
|
+
return genOTPStyle(inputToken);
|
|
3483
|
+
}, initComponentToken);
|
|
3484
|
+
|
|
3485
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/input/OTP/OTPInput.js
|
|
3486
|
+
var DEFAULT_MASK_VALUE = "\u2022";
|
|
3487
|
+
var OTPInput = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
3488
|
+
const {
|
|
3489
|
+
className,
|
|
3490
|
+
value,
|
|
3491
|
+
onChange,
|
|
3492
|
+
onActiveChange,
|
|
3493
|
+
index,
|
|
3494
|
+
mask,
|
|
3495
|
+
onFocus,
|
|
3496
|
+
type,
|
|
3497
|
+
...restProps
|
|
3498
|
+
} = props;
|
|
3499
|
+
const {
|
|
3500
|
+
getPrefixCls
|
|
3501
|
+
} = useContext(ConfigContext);
|
|
3502
|
+
const prefixCls = getPrefixCls("otp");
|
|
3503
|
+
const maskValue = typeof mask === "string" ? mask : DEFAULT_MASK_VALUE;
|
|
3504
|
+
const inputRef = useRef(null);
|
|
3505
|
+
useImperativeHandle(ref, () => inputRef.current);
|
|
3506
|
+
const onInternalChange = (e3) => {
|
|
3507
|
+
onChange(index, e3.target.value);
|
|
3508
|
+
};
|
|
3509
|
+
const syncSelection = () => {
|
|
3510
|
+
raf_default(() => {
|
|
3511
|
+
const inputEle = inputRef.current?.input;
|
|
3512
|
+
if (document.activeElement === inputEle && inputEle) {
|
|
3513
|
+
inputEle.select();
|
|
3514
|
+
}
|
|
3515
|
+
});
|
|
3516
|
+
};
|
|
3517
|
+
const onInternalFocus = (e3) => {
|
|
3518
|
+
onFocus?.(e3);
|
|
3519
|
+
syncSelection();
|
|
3520
|
+
};
|
|
3521
|
+
const onInternalKeyDown = (event) => {
|
|
3522
|
+
const {
|
|
3523
|
+
key,
|
|
3524
|
+
ctrlKey,
|
|
3525
|
+
metaKey
|
|
3526
|
+
} = event;
|
|
3527
|
+
if (key === "ArrowLeft") {
|
|
3528
|
+
onActiveChange(index - 1);
|
|
3529
|
+
} else if (key === "ArrowRight") {
|
|
3530
|
+
onActiveChange(index + 1);
|
|
3531
|
+
} else if (key === "z" && (ctrlKey || metaKey)) {
|
|
3532
|
+
event.preventDefault();
|
|
3533
|
+
} else if (key === "Backspace" && !value) {
|
|
3534
|
+
onActiveChange(index - 1);
|
|
3535
|
+
}
|
|
3536
|
+
syncSelection();
|
|
3537
|
+
};
|
|
3538
|
+
return /* @__PURE__ */ createElement("span", {
|
|
3539
|
+
className: `${prefixCls}-input-wrapper`,
|
|
3540
|
+
role: "presentation"
|
|
3541
|
+
}, mask && value !== "" && value !== void 0 && /* @__PURE__ */ createElement("span", {
|
|
3542
|
+
className: `${prefixCls}-mask-icon`,
|
|
3543
|
+
"aria-hidden": "true"
|
|
3544
|
+
}, maskValue), /* @__PURE__ */ createElement(Input_default, {
|
|
3545
|
+
"aria-label": `OTP Input ${index + 1}`,
|
|
3546
|
+
...restProps,
|
|
3547
|
+
type: type ?? (mask ? "password" : "text"),
|
|
3548
|
+
ref: inputRef,
|
|
3549
|
+
value,
|
|
3550
|
+
onInput: onInternalChange,
|
|
3551
|
+
onFocus: onInternalFocus,
|
|
3552
|
+
onKeyDown: onInternalKeyDown,
|
|
3553
|
+
onMouseDown: syncSelection,
|
|
3554
|
+
onMouseUp: syncSelection,
|
|
3555
|
+
className: clsx(className, {
|
|
3556
|
+
[`${prefixCls}-mask-input`]: mask
|
|
3557
|
+
})
|
|
3558
|
+
}));
|
|
3559
|
+
});
|
|
3560
|
+
var OTPInput_default = OTPInput;
|
|
3561
|
+
|
|
3562
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/input/OTP/index.js
|
|
3563
|
+
function strToArr(str) {
|
|
3564
|
+
return (str || "").split("");
|
|
3565
|
+
}
|
|
3566
|
+
var Separator = (props) => {
|
|
3567
|
+
const {
|
|
3568
|
+
index,
|
|
3569
|
+
prefixCls,
|
|
3570
|
+
separator,
|
|
3571
|
+
className: semanticClassName,
|
|
3572
|
+
style: semanticStyle
|
|
3573
|
+
} = props;
|
|
3574
|
+
const separatorNode = isFunction(separator) ? separator(index) : separator;
|
|
3575
|
+
if (!separatorNode) {
|
|
3576
|
+
return null;
|
|
3577
|
+
}
|
|
3578
|
+
return /* @__PURE__ */ createElement("span", {
|
|
3579
|
+
className: clsx(`${prefixCls}-separator`, semanticClassName),
|
|
3580
|
+
style: semanticStyle
|
|
3581
|
+
}, separatorNode);
|
|
3582
|
+
};
|
|
3583
|
+
var OTP = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
3584
|
+
const {
|
|
3585
|
+
prefixCls: customizePrefixCls,
|
|
3586
|
+
length = 6,
|
|
3587
|
+
size: customSize,
|
|
3588
|
+
defaultValue,
|
|
3589
|
+
value,
|
|
3590
|
+
onChange,
|
|
3591
|
+
formatter,
|
|
3592
|
+
separator,
|
|
3593
|
+
variant: customizeVariant,
|
|
3594
|
+
disabled,
|
|
3595
|
+
status: customStatus,
|
|
3596
|
+
autoFocus,
|
|
3597
|
+
mask,
|
|
3598
|
+
type,
|
|
3599
|
+
autoComplete,
|
|
3600
|
+
onInput,
|
|
3601
|
+
onFocus,
|
|
3602
|
+
inputMode,
|
|
3603
|
+
classNames,
|
|
3604
|
+
styles,
|
|
3605
|
+
className,
|
|
3606
|
+
style,
|
|
3607
|
+
...restProps
|
|
3608
|
+
} = props;
|
|
3609
|
+
if (true) {
|
|
3610
|
+
const warning = devUseWarning("Input.OTP");
|
|
3611
|
+
true ? warning(!(typeof mask === "string" && mask.length > 1), "usage", "`mask` prop should be a single character.") : void 0;
|
|
3612
|
+
}
|
|
3613
|
+
const {
|
|
3614
|
+
classNames: contextClassNames,
|
|
3615
|
+
styles: contextStyles,
|
|
3616
|
+
getPrefixCls,
|
|
3617
|
+
direction,
|
|
3618
|
+
style: contextStyle,
|
|
3619
|
+
className: contextClassName
|
|
3620
|
+
} = useComponentConfig("otp");
|
|
3621
|
+
const prefixCls = getPrefixCls("otp", customizePrefixCls);
|
|
3622
|
+
const [variant] = useVariants_default("otp", customizeVariant, void 0, "input");
|
|
3623
|
+
const mergedProps = {
|
|
3624
|
+
...props,
|
|
3625
|
+
length,
|
|
3626
|
+
variant
|
|
3627
|
+
};
|
|
3628
|
+
const contextStyleRoot = useSemanticRootStyle(contextStyle);
|
|
3629
|
+
const styleRoot = useSemanticRootStyle(style);
|
|
3630
|
+
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, contextStyleRoot, styles, styleRoot], {
|
|
3631
|
+
props: mergedProps
|
|
3632
|
+
});
|
|
3633
|
+
const domAttrs = pickAttrs(restProps, {
|
|
3634
|
+
aria: true,
|
|
3635
|
+
data: true,
|
|
3636
|
+
attr: true
|
|
3637
|
+
});
|
|
3638
|
+
const [hashId, cssVarCls] = otp_default(prefixCls);
|
|
3639
|
+
const mergedSize = useSize_default((ctx) => customSize ?? ctx);
|
|
3640
|
+
const formContext = useContext(FormItemInputContext);
|
|
3641
|
+
const mergedStatus = getMergedStatus(formContext.status, customStatus);
|
|
3642
|
+
const proxyFormContext = useMemo(() => ({
|
|
3643
|
+
...formContext,
|
|
3644
|
+
status: mergedStatus,
|
|
3645
|
+
hasFeedback: false,
|
|
3646
|
+
feedbackIcon: null
|
|
3647
|
+
}), [formContext, mergedStatus]);
|
|
3648
|
+
const containerRef = useRef(null);
|
|
3649
|
+
const inputsRef = useRef({});
|
|
3650
|
+
useImperativeHandle(ref, () => ({
|
|
3651
|
+
focus: () => {
|
|
3652
|
+
inputsRef.current[0]?.focus();
|
|
3653
|
+
},
|
|
3654
|
+
blur: () => {
|
|
3655
|
+
for (let i = 0; i < length; i += 1) {
|
|
3656
|
+
inputsRef.current[i]?.blur();
|
|
3657
|
+
}
|
|
3658
|
+
},
|
|
3659
|
+
nativeElement: containerRef.current
|
|
3660
|
+
}));
|
|
3661
|
+
const internalFormatter = (txt) => formatter ? formatter(txt) : txt;
|
|
3662
|
+
const [valueCells, setValueCells] = useState(() => strToArr(internalFormatter(defaultValue || "")));
|
|
3663
|
+
useEffect(() => {
|
|
3664
|
+
if (value !== void 0) {
|
|
3665
|
+
setValueCells(strToArr(value));
|
|
3666
|
+
}
|
|
3667
|
+
}, [value]);
|
|
3668
|
+
const triggerValueCellsChange = useEvent_default((nextValueCells) => {
|
|
3669
|
+
setValueCells(nextValueCells);
|
|
3670
|
+
if (onInput) {
|
|
3671
|
+
onInput(nextValueCells);
|
|
3672
|
+
}
|
|
3673
|
+
if (onChange && nextValueCells.length === length && nextValueCells.every((c) => c) && nextValueCells.some((c, index) => valueCells[index] !== c)) {
|
|
3674
|
+
onChange(nextValueCells.join(""));
|
|
3675
|
+
}
|
|
3676
|
+
});
|
|
3677
|
+
const patchValue = useEvent_default((index, txt) => {
|
|
3678
|
+
let nextCells = _toConsumableArray(valueCells);
|
|
3679
|
+
for (let i = 0; i < index; i += 1) {
|
|
3680
|
+
if (!nextCells[i]) {
|
|
3681
|
+
nextCells[i] = "";
|
|
3682
|
+
}
|
|
3683
|
+
}
|
|
3684
|
+
if (txt.length <= 1) {
|
|
3685
|
+
nextCells[index] = txt;
|
|
3686
|
+
} else {
|
|
3687
|
+
nextCells = nextCells.slice(0, index).concat(strToArr(txt));
|
|
3688
|
+
}
|
|
3689
|
+
nextCells = nextCells.slice(0, length);
|
|
3690
|
+
for (let i = nextCells.length - 1; i >= 0; i -= 1) {
|
|
3691
|
+
if (nextCells[i]) {
|
|
3692
|
+
break;
|
|
3693
|
+
}
|
|
3694
|
+
nextCells.pop();
|
|
3695
|
+
}
|
|
3696
|
+
const formattedValue = internalFormatter(nextCells.map((c) => c || " ").join(""));
|
|
3697
|
+
nextCells = strToArr(formattedValue).map((c, i) => {
|
|
3698
|
+
if (c === " " && !nextCells[i]) {
|
|
3699
|
+
return nextCells[i];
|
|
3700
|
+
}
|
|
3701
|
+
return c;
|
|
3702
|
+
});
|
|
3703
|
+
return nextCells;
|
|
3704
|
+
});
|
|
3705
|
+
const onInputChange = (index, txt) => {
|
|
3706
|
+
const nextCells = patchValue(index, txt);
|
|
3707
|
+
const nextIndex = Math.min(index + txt.length, length - 1);
|
|
3708
|
+
if (nextIndex !== index && nextCells[index] !== void 0) {
|
|
3709
|
+
inputsRef.current[nextIndex]?.focus();
|
|
3710
|
+
}
|
|
3711
|
+
triggerValueCellsChange(nextCells);
|
|
3712
|
+
};
|
|
3713
|
+
const onInputActiveChange = (nextIndex) => {
|
|
3714
|
+
inputsRef.current[nextIndex]?.focus();
|
|
3715
|
+
};
|
|
3716
|
+
const onInputFocus = (event, index) => {
|
|
3717
|
+
for (let i = 0; i < index; i += 1) {
|
|
3718
|
+
if (!inputsRef.current[i]?.input?.value) {
|
|
3719
|
+
inputsRef.current[i]?.focus();
|
|
3720
|
+
break;
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
onFocus?.(event);
|
|
3724
|
+
};
|
|
3725
|
+
const inputSharedProps = {
|
|
3726
|
+
variant,
|
|
3727
|
+
disabled,
|
|
3728
|
+
status: mergedStatus,
|
|
3729
|
+
mask,
|
|
3730
|
+
type,
|
|
3731
|
+
inputMode,
|
|
3732
|
+
autoComplete
|
|
3733
|
+
};
|
|
3734
|
+
return /* @__PURE__ */ createElement("div", {
|
|
3735
|
+
...domAttrs,
|
|
3736
|
+
ref: containerRef,
|
|
3737
|
+
className: clsx(className, prefixCls, {
|
|
3738
|
+
[`${prefixCls}-sm`]: mergedSize === "small",
|
|
3739
|
+
[`${prefixCls}-lg`]: mergedSize === "large",
|
|
3740
|
+
[`${prefixCls}-rtl`]: direction === "rtl"
|
|
3741
|
+
}, cssVarCls, hashId, contextClassName, mergedClassNames.root),
|
|
3742
|
+
style: mergedStyles.root,
|
|
3743
|
+
role: "group"
|
|
3744
|
+
}, /* @__PURE__ */ createElement(FormItemInputContext.Provider, {
|
|
3745
|
+
value: proxyFormContext
|
|
3746
|
+
}, Array.from({
|
|
3747
|
+
length
|
|
3748
|
+
}).map((_, index) => {
|
|
3749
|
+
const key = `otp-${index}`;
|
|
3750
|
+
const singleValue = valueCells[index] || "";
|
|
3751
|
+
return /* @__PURE__ */ createElement(Fragment, {
|
|
3752
|
+
key
|
|
3753
|
+
}, /* @__PURE__ */ createElement(OTPInput_default, {
|
|
3754
|
+
ref: (inputEle) => {
|
|
3755
|
+
inputsRef.current[index] = inputEle;
|
|
3756
|
+
},
|
|
3757
|
+
index,
|
|
3758
|
+
size: mergedSize,
|
|
3759
|
+
htmlSize: 1,
|
|
3760
|
+
className: clsx(mergedClassNames.input, `${prefixCls}-input`),
|
|
3761
|
+
style: mergedStyles.input,
|
|
3762
|
+
onChange: onInputChange,
|
|
3763
|
+
value: singleValue,
|
|
3764
|
+
onActiveChange: onInputActiveChange,
|
|
3765
|
+
autoFocus: index === 0 && autoFocus,
|
|
3766
|
+
onFocus: (event) => onInputFocus(event, index),
|
|
3767
|
+
...inputSharedProps
|
|
3768
|
+
}), index < length - 1 && /* @__PURE__ */ createElement(Separator, {
|
|
3769
|
+
separator,
|
|
3770
|
+
index,
|
|
3771
|
+
prefixCls,
|
|
3772
|
+
className: clsx(mergedClassNames.separator),
|
|
3773
|
+
style: mergedStyles.separator
|
|
3774
|
+
}));
|
|
3775
|
+
})));
|
|
3776
|
+
});
|
|
3777
|
+
var OTP_default = OTP;
|
|
3778
|
+
|
|
3779
|
+
// ../../node_modules/.pnpm/@ant-design+icons@6.3.2_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@ant-design/icons/es/icons/EyeInvisibleOutlined.js
|
|
3780
|
+
var import_EyeInvisibleOutlined = __toESM(require_EyeInvisibleOutlined());
|
|
3781
|
+
function _extends4() {
|
|
3782
|
+
_extends4 = Object.assign ? Object.assign.bind() : function(target) {
|
|
3783
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
3784
|
+
var source = arguments[i];
|
|
3785
|
+
for (var key in source) {
|
|
3786
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3787
|
+
target[key] = source[key];
|
|
3788
|
+
}
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
return target;
|
|
3792
|
+
};
|
|
3793
|
+
return _extends4.apply(this, arguments);
|
|
3794
|
+
}
|
|
3795
|
+
var EyeInvisibleOutlined = (props, ref) => /* @__PURE__ */ createElement(AntdIconLight_default, _extends4({}, props, {
|
|
3796
|
+
ref,
|
|
3797
|
+
icon: import_EyeInvisibleOutlined.default
|
|
3798
|
+
}));
|
|
3799
|
+
var RefIcon3 = /* @__PURE__ */ forwardRef(EyeInvisibleOutlined);
|
|
3800
|
+
if (true) {
|
|
3801
|
+
RefIcon3.displayName = "EyeInvisibleOutlined";
|
|
3802
|
+
}
|
|
3803
|
+
var EyeInvisibleOutlined_default = RefIcon3;
|
|
3804
|
+
|
|
3805
|
+
// ../../node_modules/.pnpm/@ant-design+icons@6.3.2_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@ant-design/icons/es/icons/EyeOutlined.js
|
|
3806
|
+
var import_EyeOutlined = __toESM(require_EyeOutlined());
|
|
3807
|
+
function _extends5() {
|
|
3808
|
+
_extends5 = Object.assign ? Object.assign.bind() : function(target) {
|
|
3809
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
3810
|
+
var source = arguments[i];
|
|
3811
|
+
for (var key in source) {
|
|
3812
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3813
|
+
target[key] = source[key];
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
}
|
|
3817
|
+
return target;
|
|
3818
|
+
};
|
|
3819
|
+
return _extends5.apply(this, arguments);
|
|
3820
|
+
}
|
|
3821
|
+
var EyeOutlined = (props, ref) => /* @__PURE__ */ createElement(AntdIconLight_default, _extends5({}, props, {
|
|
3822
|
+
ref,
|
|
3823
|
+
icon: import_EyeOutlined.default
|
|
3824
|
+
}));
|
|
3825
|
+
var RefIcon4 = /* @__PURE__ */ forwardRef(EyeOutlined);
|
|
3826
|
+
if (true) {
|
|
3827
|
+
RefIcon4.displayName = "EyeOutlined";
|
|
3828
|
+
}
|
|
3829
|
+
var EyeOutlined_default = RefIcon4;
|
|
3830
|
+
|
|
3831
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/input/Password.js
|
|
3832
|
+
var defaultIconRender = (visible) => visible ? /* @__PURE__ */ createElement(EyeOutlined_default, null) : /* @__PURE__ */ createElement(EyeInvisibleOutlined_default, null);
|
|
3833
|
+
var actionMap = {
|
|
3834
|
+
click: "onClick",
|
|
3835
|
+
hover: "onMouseOver"
|
|
3836
|
+
};
|
|
3837
|
+
var Password = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
3838
|
+
const {
|
|
3839
|
+
disabled: customDisabled,
|
|
3840
|
+
action = "click",
|
|
3841
|
+
visibilityToggle = true,
|
|
3842
|
+
iconRender,
|
|
3843
|
+
prefixCls: customizePrefixCls,
|
|
3844
|
+
inputPrefixCls: customizeInputPrefixCls,
|
|
3845
|
+
suffix,
|
|
3846
|
+
className,
|
|
3847
|
+
style,
|
|
3848
|
+
classNames,
|
|
3849
|
+
styles,
|
|
3850
|
+
variant: customizeVariant,
|
|
3851
|
+
...restProps
|
|
3852
|
+
} = props;
|
|
3853
|
+
const {
|
|
3854
|
+
getPrefixCls,
|
|
3855
|
+
className: contextClassName,
|
|
3856
|
+
style: contextStyle,
|
|
3857
|
+
classNames: contextClassNames,
|
|
3858
|
+
styles: contextStyles,
|
|
3859
|
+
iconRender: contextIconRender
|
|
3860
|
+
} = useComponentConfig("inputPassword");
|
|
3861
|
+
const [variant] = useVariants_default("inputPassword", customizeVariant, props.bordered, "input");
|
|
3862
|
+
const [locale] = useLocale_default("global");
|
|
3863
|
+
const disabled = useContext(DisabledContext_default);
|
|
3864
|
+
const mergedDisabled = customDisabled ?? disabled;
|
|
3865
|
+
const mergedProps = {
|
|
3866
|
+
...props,
|
|
3867
|
+
disabled: mergedDisabled,
|
|
3868
|
+
variant
|
|
3869
|
+
};
|
|
3870
|
+
const contextStyleRoot = useSemanticRootStyle(contextStyle);
|
|
3871
|
+
const styleRoot = useSemanticRootStyle(style);
|
|
3872
|
+
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, contextStyleRoot, styles, styleRoot], {
|
|
3873
|
+
props: mergedProps
|
|
3874
|
+
});
|
|
3875
|
+
const visibilityControlled = isPlainObject(visibilityToggle) && visibilityToggle.visible !== void 0;
|
|
3876
|
+
const [visible, setVisible] = useState(() => visibilityControlled ? visibilityToggle.visible : false);
|
|
3877
|
+
const inputRef = useRef(null);
|
|
3878
|
+
useEffect(() => {
|
|
3879
|
+
if (visibilityControlled) {
|
|
3880
|
+
setVisible(visibilityToggle.visible);
|
|
3881
|
+
}
|
|
3882
|
+
}, [visibilityControlled, visibilityToggle]);
|
|
3883
|
+
const removePasswordTimeout = useRemovePasswordTimeout(inputRef);
|
|
3884
|
+
const onVisibleChange = () => {
|
|
3885
|
+
if (mergedDisabled) {
|
|
3886
|
+
return;
|
|
3887
|
+
}
|
|
3888
|
+
if (visible) {
|
|
3889
|
+
removePasswordTimeout();
|
|
3890
|
+
}
|
|
3891
|
+
const nextVisible = !visible;
|
|
3892
|
+
setVisible(nextVisible);
|
|
3893
|
+
if (isPlainObject(visibilityToggle)) {
|
|
3894
|
+
visibilityToggle.onVisibleChange?.(nextVisible);
|
|
3895
|
+
}
|
|
3896
|
+
};
|
|
3897
|
+
const getIcon = (prefixCls2) => {
|
|
3898
|
+
const iconTrigger = actionMap[action] || "";
|
|
3899
|
+
const iconRenderer = iconRender || contextIconRender || defaultIconRender;
|
|
3900
|
+
const icon = iconRenderer(visible);
|
|
3901
|
+
const iconTabIndex = isPlainObject(visibilityToggle) ? visibilityToggle.tabIndex : void 0;
|
|
3902
|
+
return /* @__PURE__ */ createElement("span", {
|
|
3903
|
+
key: "passwordIcon",
|
|
3904
|
+
role: "button",
|
|
3905
|
+
tabIndex: mergedDisabled ? -1 : iconTabIndex ?? 0,
|
|
3906
|
+
className: `${prefixCls2}-icon`,
|
|
3907
|
+
"aria-disabled": mergedDisabled,
|
|
3908
|
+
"aria-pressed": visible,
|
|
3909
|
+
"aria-label": visible ? locale.hide : locale.show,
|
|
3910
|
+
onMouseDown: (e3) => {
|
|
3911
|
+
e3.preventDefault();
|
|
3912
|
+
},
|
|
3913
|
+
onMouseUp: (e3) => {
|
|
3914
|
+
e3.preventDefault();
|
|
3915
|
+
},
|
|
3916
|
+
onKeyDown: (e3) => {
|
|
3917
|
+
if (e3.key === "Enter" || e3.key === " ") {
|
|
3918
|
+
e3.preventDefault();
|
|
3919
|
+
onVisibleChange();
|
|
3920
|
+
}
|
|
3921
|
+
},
|
|
3922
|
+
[iconTrigger]: onVisibleChange
|
|
3923
|
+
}, icon);
|
|
3924
|
+
};
|
|
3925
|
+
const inputPrefixCls = getPrefixCls("input", customizeInputPrefixCls);
|
|
3926
|
+
const prefixCls = getPrefixCls("input-password", customizePrefixCls);
|
|
3927
|
+
const suffixIcon = visibilityToggle && getIcon(prefixCls);
|
|
3928
|
+
const inputClassName = clsx(prefixCls, contextClassName, className, {
|
|
3929
|
+
[`${prefixCls}-${props.size}`]: !!props.size
|
|
3930
|
+
});
|
|
3931
|
+
const inputProps = {
|
|
3932
|
+
...restProps,
|
|
3933
|
+
type: visible ? "text" : "password",
|
|
3934
|
+
prefixCls: inputPrefixCls,
|
|
3935
|
+
suffix: /* @__PURE__ */ createElement(Fragment, null, suffixIcon, suffix),
|
|
3936
|
+
disabled: mergedDisabled,
|
|
3937
|
+
className: inputClassName,
|
|
3938
|
+
classNames: mergedClassNames,
|
|
3939
|
+
styles: mergedStyles,
|
|
3940
|
+
variant
|
|
3941
|
+
};
|
|
3942
|
+
return /* @__PURE__ */ createElement(Input_default, {
|
|
3943
|
+
ref: composeRef(ref, inputRef),
|
|
3944
|
+
...inputProps
|
|
3945
|
+
});
|
|
3946
|
+
});
|
|
3947
|
+
if (true) {
|
|
3948
|
+
Password.displayName = "Input.Password";
|
|
3949
|
+
}
|
|
3950
|
+
var Password_default = Password;
|
|
3951
|
+
|
|
3952
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/input/style/search.js
|
|
3953
|
+
var genSearchStyle = (token) => {
|
|
3954
|
+
const {
|
|
3955
|
+
componentCls,
|
|
3956
|
+
antCls,
|
|
3957
|
+
calc,
|
|
3958
|
+
max
|
|
3959
|
+
} = token;
|
|
3960
|
+
const btnCls = `${componentCls}-btn`;
|
|
3961
|
+
const [varName, varRef] = genCssVar(antCls, "input-search");
|
|
3962
|
+
const inputFontSizeSM = token.inputFontSizeSM ?? token.fontSize;
|
|
3963
|
+
const smallButtonHeight = max(token.controlHeightSM, calc(inputFontSizeSM).mul(token.lineHeight).add(calc(token.paddingBlockSM).mul(2)).add(calc(token.lineWidth).mul(2)).equal());
|
|
3964
|
+
return {
|
|
3965
|
+
[componentCls]: {
|
|
3966
|
+
[varName("btn-height")]: unit(token.controlHeight),
|
|
3967
|
+
width: "100%",
|
|
3968
|
+
// =========================== Button ===========================
|
|
3969
|
+
[btnCls]: {
|
|
3970
|
+
height: varRef("btn-height"),
|
|
3971
|
+
"&:focus-visible": {
|
|
3972
|
+
zIndex: 5
|
|
3973
|
+
},
|
|
3974
|
+
[`&${antCls}-btn-icon-only`]: {
|
|
3975
|
+
width: varRef("btn-height")
|
|
3976
|
+
},
|
|
3977
|
+
"&-filled": {
|
|
3978
|
+
background: token.colorFillTertiary,
|
|
3979
|
+
"&:not(:disabled)": {
|
|
3980
|
+
"&:hover": {
|
|
3981
|
+
background: token.colorFillSecondary
|
|
3982
|
+
},
|
|
3983
|
+
"&:active": {
|
|
3984
|
+
background: token.colorFill
|
|
3985
|
+
}
|
|
3986
|
+
}
|
|
3987
|
+
}
|
|
3988
|
+
},
|
|
3989
|
+
[`&${componentCls}-large`]: {
|
|
3990
|
+
[varName("btn-height")]: unit(token.controlHeightLG)
|
|
3991
|
+
},
|
|
3992
|
+
[`&${componentCls}-small`]: {
|
|
3993
|
+
[varName("btn-height")]: unit(token.controlHeightSM)
|
|
3994
|
+
},
|
|
3995
|
+
[`&${componentCls}-small ${btnCls}`]: {
|
|
3996
|
+
minHeight: smallButtonHeight,
|
|
3997
|
+
[`&${token.antCls}-btn-icon-only`]: {
|
|
3998
|
+
minWidth: smallButtonHeight
|
|
3999
|
+
}
|
|
4000
|
+
}
|
|
4001
|
+
}
|
|
4002
|
+
};
|
|
4003
|
+
};
|
|
4004
|
+
var search_default = genStyleHooks(["Input", "Search"], (token) => {
|
|
4005
|
+
const inputToken = merge(token, initInputToken(token));
|
|
4006
|
+
return genSearchStyle(inputToken);
|
|
4007
|
+
}, initComponentToken);
|
|
4008
|
+
|
|
4009
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/input/Search.js
|
|
4010
|
+
var Search = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
4011
|
+
const {
|
|
4012
|
+
prefixCls: customizePrefixCls,
|
|
4013
|
+
inputPrefixCls: customizeInputPrefixCls,
|
|
4014
|
+
className,
|
|
4015
|
+
size: customizeSize,
|
|
4016
|
+
style,
|
|
4017
|
+
enterButton = false,
|
|
4018
|
+
searchIcon: customizeSearchIcon,
|
|
4019
|
+
addonAfter,
|
|
4020
|
+
loading,
|
|
4021
|
+
disabled,
|
|
4022
|
+
onSearch: customOnSearch,
|
|
4023
|
+
onChange: customOnChange,
|
|
4024
|
+
onCompositionStart,
|
|
4025
|
+
onCompositionEnd,
|
|
4026
|
+
variant: customizeVariant,
|
|
4027
|
+
onPressEnter: customOnPressEnter,
|
|
4028
|
+
classNames,
|
|
4029
|
+
styles,
|
|
4030
|
+
hidden,
|
|
4031
|
+
...restProps
|
|
4032
|
+
} = props;
|
|
4033
|
+
const {
|
|
4034
|
+
direction,
|
|
4035
|
+
getPrefixCls,
|
|
4036
|
+
className: contextClassName,
|
|
4037
|
+
style: contextStyle,
|
|
4038
|
+
classNames: contextClassNames,
|
|
4039
|
+
styles: contextStyles,
|
|
4040
|
+
searchIcon: contextSearchIcon
|
|
4041
|
+
} = useComponentConfig("inputSearch");
|
|
4042
|
+
const contextDisabled = useContext(DisabledContext_default);
|
|
4043
|
+
const mergedDisabled = disabled ?? contextDisabled;
|
|
4044
|
+
const [mergedVariant, , isVariantConfigured] = useVariants_default("inputSearch", customizeVariant, props.bordered);
|
|
4045
|
+
const variant = isVariantConfigured ? mergedVariant : void 0;
|
|
4046
|
+
const [inputVariant] = useVariants_default("inputSearch", customizeVariant, props.bordered, "input");
|
|
4047
|
+
const mergedProps = {
|
|
4048
|
+
...props,
|
|
4049
|
+
enterButton,
|
|
4050
|
+
variant
|
|
4051
|
+
};
|
|
4052
|
+
const contextStyleRoot = useSemanticRootStyle(contextStyle);
|
|
4053
|
+
const styleRoot = useSemanticRootStyle(style);
|
|
4054
|
+
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, contextStyleRoot, styles, styleRoot], {
|
|
4055
|
+
props: mergedProps
|
|
4056
|
+
}, {
|
|
4057
|
+
button: {
|
|
4058
|
+
_default: "root"
|
|
4059
|
+
}
|
|
4060
|
+
});
|
|
4061
|
+
const composedRef = useRef(false);
|
|
4062
|
+
const prefixCls = getPrefixCls("input-search", customizePrefixCls);
|
|
4063
|
+
const inputPrefixCls = getPrefixCls("input", customizeInputPrefixCls);
|
|
4064
|
+
const [hashId, cssVarCls] = search_default(prefixCls);
|
|
4065
|
+
const {
|
|
4066
|
+
compactSize
|
|
4067
|
+
} = useCompactItemContext(prefixCls, direction);
|
|
4068
|
+
const size = useSize_default((ctx) => customizeSize ?? compactSize ?? ctx);
|
|
4069
|
+
const inputRef = useRef(null);
|
|
4070
|
+
const onChange = (e3) => {
|
|
4071
|
+
if (e3?.target && e3.type === "click" && customOnSearch) {
|
|
4072
|
+
customOnSearch(e3.target.value, e3, {
|
|
4073
|
+
source: "clear"
|
|
4074
|
+
});
|
|
4075
|
+
}
|
|
4076
|
+
customOnChange?.(e3);
|
|
4077
|
+
};
|
|
4078
|
+
const onMouseDown = (e3) => {
|
|
4079
|
+
if (document.activeElement === inputRef.current?.input) {
|
|
4080
|
+
e3.preventDefault();
|
|
4081
|
+
}
|
|
4082
|
+
};
|
|
4083
|
+
const onSearch = (e3) => {
|
|
4084
|
+
if (customOnSearch) {
|
|
4085
|
+
customOnSearch(inputRef.current?.input?.value, e3, {
|
|
4086
|
+
source: "input"
|
|
4087
|
+
});
|
|
4088
|
+
}
|
|
4089
|
+
};
|
|
4090
|
+
const onPressEnter = (e3) => {
|
|
4091
|
+
if (composedRef.current || loading) {
|
|
4092
|
+
return;
|
|
4093
|
+
}
|
|
4094
|
+
customOnPressEnter?.(e3);
|
|
4095
|
+
onSearch(e3);
|
|
4096
|
+
};
|
|
4097
|
+
const searchIcon = typeof enterButton === "boolean" ? fallbackProp(customizeSearchIcon, contextSearchIcon, /* @__PURE__ */ createElement(SearchOutlined_default, null)) : null;
|
|
4098
|
+
const btnPrefixCls = `${prefixCls}-btn`;
|
|
4099
|
+
const btnClassName = clsx(btnPrefixCls, {
|
|
4100
|
+
[`${btnPrefixCls}-${variant}`]: variant
|
|
4101
|
+
});
|
|
4102
|
+
let button;
|
|
4103
|
+
const enterButtonAsElement = enterButton || {};
|
|
4104
|
+
const isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
|
|
4105
|
+
if (isAntdButton || enterButtonAsElement.type === "button") {
|
|
4106
|
+
const enterButtonProps = enterButtonAsElement.props;
|
|
4107
|
+
button = cloneElement(enterButtonAsElement, {
|
|
4108
|
+
disabled: mergedDisabled || enterButtonProps.disabled || !isAntdButton && loading,
|
|
4109
|
+
onMouseDown,
|
|
4110
|
+
onClick: (e3) => {
|
|
4111
|
+
enterButtonAsElement?.props?.onClick?.(e3);
|
|
4112
|
+
onSearch(e3);
|
|
4113
|
+
},
|
|
4114
|
+
key: "enterButton",
|
|
4115
|
+
...isAntdButton ? {
|
|
4116
|
+
className: clsx(btnClassName, enterButtonProps.className),
|
|
4117
|
+
loading: loading || enterButtonProps.loading,
|
|
4118
|
+
size
|
|
4119
|
+
} : {}
|
|
4120
|
+
});
|
|
4121
|
+
} else {
|
|
4122
|
+
button = /* @__PURE__ */ createElement(Button_default, {
|
|
4123
|
+
classNames: mergedClassNames.button,
|
|
4124
|
+
styles: mergedStyles.button,
|
|
4125
|
+
className: btnClassName,
|
|
4126
|
+
color: enterButton ? "primary" : "default",
|
|
4127
|
+
size,
|
|
4128
|
+
disabled,
|
|
4129
|
+
key: "enterButton",
|
|
4130
|
+
onMouseDown,
|
|
4131
|
+
onClick: onSearch,
|
|
4132
|
+
loading,
|
|
4133
|
+
icon: searchIcon,
|
|
4134
|
+
variant: variant === "borderless" || variant === "filled" || variant === "underlined" ? "text" : enterButton ? "solid" : void 0
|
|
4135
|
+
}, enterButton);
|
|
4136
|
+
}
|
|
4137
|
+
if (addonAfter) {
|
|
4138
|
+
button = [button, cloneElement(addonAfter, {
|
|
4139
|
+
key: "addonAfter"
|
|
4140
|
+
})];
|
|
4141
|
+
}
|
|
4142
|
+
const mergedClassName = clsx(prefixCls, cssVarCls, {
|
|
4143
|
+
[`${prefixCls}-rtl`]: direction === "rtl",
|
|
4144
|
+
[`${prefixCls}-${size}`]: !!size,
|
|
4145
|
+
[`${prefixCls}-with-button`]: !!enterButton
|
|
4146
|
+
}, className, contextClassName, hashId, mergedClassNames.root);
|
|
4147
|
+
const handleOnCompositionStart = (e3) => {
|
|
4148
|
+
composedRef.current = true;
|
|
4149
|
+
onCompositionStart?.(e3);
|
|
4150
|
+
};
|
|
4151
|
+
const handleOnCompositionEnd = (e3) => {
|
|
4152
|
+
composedRef.current = false;
|
|
4153
|
+
onCompositionEnd?.(e3);
|
|
4154
|
+
};
|
|
4155
|
+
const rootProps = pickAttrs(restProps, {
|
|
4156
|
+
data: true
|
|
4157
|
+
});
|
|
4158
|
+
const inputProps = omit({
|
|
4159
|
+
...restProps,
|
|
4160
|
+
classNames: omit(mergedClassNames, ["button", "root"]),
|
|
4161
|
+
styles: omit(mergedStyles, ["button", "root"]),
|
|
4162
|
+
prefixCls: inputPrefixCls,
|
|
4163
|
+
type: "search",
|
|
4164
|
+
size,
|
|
4165
|
+
variant: inputVariant,
|
|
4166
|
+
onPressEnter,
|
|
4167
|
+
onCompositionStart: handleOnCompositionStart,
|
|
4168
|
+
onCompositionEnd: handleOnCompositionEnd,
|
|
4169
|
+
onChange,
|
|
4170
|
+
disabled
|
|
4171
|
+
}, Object.keys(rootProps));
|
|
4172
|
+
return /* @__PURE__ */ createElement(Compact_default, {
|
|
4173
|
+
className: mergedClassName,
|
|
4174
|
+
style: mergedStyles.root,
|
|
4175
|
+
...rootProps,
|
|
4176
|
+
hidden
|
|
4177
|
+
}, /* @__PURE__ */ createElement(Input_default, {
|
|
4178
|
+
ref: composeRef(inputRef, ref),
|
|
4179
|
+
...inputProps
|
|
4180
|
+
}), button);
|
|
4181
|
+
});
|
|
4182
|
+
if (true) {
|
|
4183
|
+
Search.displayName = "Search";
|
|
4184
|
+
}
|
|
4185
|
+
var Search_default = Search;
|
|
4186
|
+
|
|
4187
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/input/index.js
|
|
4188
|
+
var Input = Input_default;
|
|
4189
|
+
Input.Group = Group_default;
|
|
4190
|
+
Input.Search = Search_default;
|
|
4191
|
+
Input.TextArea = TextArea_default;
|
|
4192
|
+
Input.Password = Password_default;
|
|
4193
|
+
Input.OTP = OTP_default;
|
|
4194
|
+
var input_default = Input;
|
|
4195
|
+
|
|
4196
|
+
// ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/index.js
|
|
4197
|
+
if (true) {
|
|
4198
|
+
const majorVersion = getReactMajorVersion();
|
|
4199
|
+
true ? warning_default(majorVersion >= 18, "version", `antd v6 no longer supports React versions below 18. Please upgrade to React 18 or higher.`) : void 0;
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4202
|
+
// src/plugin/auth-response.ts
|
|
4203
|
+
function parseAuthenticationCompletion(input) {
|
|
4204
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) {
|
|
4205
|
+
throw new Error("\u8BA4\u8BC1\u54CD\u5E94\u65E0\u6548");
|
|
4206
|
+
}
|
|
4207
|
+
const response = input;
|
|
4208
|
+
if (response.status === "verified") return { status: "verified" };
|
|
4209
|
+
if (response.status === "denied") throw new Error("\u8BA4\u8BC1\u4FE1\u606F\u65E0\u6548\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5");
|
|
4210
|
+
if (response.status === "pending") throw new Error("\u8BA4\u8BC1\u4ECD\u5728\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
|
4211
|
+
throw new Error("\u8BA4\u8BC1\u54CD\u5E94\u65E0\u6548");
|
|
4212
|
+
}
|
|
4213
|
+
function parseAuthenticationChallenge(input) {
|
|
4214
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) {
|
|
4215
|
+
throw new Error("\u9A8C\u8BC1\u7801\u54CD\u5E94\u65E0\u6548");
|
|
4216
|
+
}
|
|
4217
|
+
const response = input;
|
|
4218
|
+
if (response.status !== "pending" || !Number.isSafeInteger(response.retryAfterMs) || response.retryAfterMs <= 0 || response.retryAfterMs > 6e4) {
|
|
4219
|
+
throw new Error("\u9A8C\u8BC1\u7801\u54CD\u5E94\u65E0\u6548");
|
|
4220
|
+
}
|
|
4221
|
+
return { retryAfterMs: response.retryAfterMs };
|
|
4222
|
+
}
|
|
4223
|
+
|
|
4224
|
+
// src/plugin/password-form.module.css
|
|
4225
|
+
var password_form_default = {
|
|
4226
|
+
authShell: "password_form_authShell",
|
|
4227
|
+
introduction: "password_form_introduction",
|
|
4228
|
+
eyebrow: "password_form_eyebrow",
|
|
4229
|
+
introductionTitle: "password_form_introductionTitle",
|
|
4230
|
+
introductionCopy: "password_form_introductionCopy",
|
|
4231
|
+
formRegion: "password_form_formRegion",
|
|
4232
|
+
formBody: "password_form_formBody",
|
|
4233
|
+
formNote: "password_form_formNote",
|
|
4234
|
+
codeRow: "password_form_codeRow",
|
|
4235
|
+
changeEmail: "password_form_changeEmail",
|
|
4236
|
+
alternate: "password_form_alternate",
|
|
4237
|
+
alternateLinks: "password_form_alternateLinks"
|
|
4238
|
+
};
|
|
4239
|
+
|
|
4240
|
+
// src/plugin/password-form.tsx
|
|
4241
|
+
function PasswordForm(props) {
|
|
4242
|
+
const [form] = form_default.useForm();
|
|
4243
|
+
const { message } = app_default.useApp();
|
|
4244
|
+
const request = useRequest();
|
|
4245
|
+
const navigation = useRscNavigation();
|
|
4246
|
+
const [transactionId, setTransactionId] = useState(props.transactionId);
|
|
4247
|
+
const [mode, setMode] = useState("password");
|
|
4248
|
+
const [codeSent, setCodeSent] = useState(false);
|
|
4249
|
+
const [countdown, setCountdown] = useState(0);
|
|
4250
|
+
const [submitting, setSubmitting] = useState(false);
|
|
4251
|
+
const [sending, setSending] = useState(false);
|
|
4252
|
+
const pendingSend = useRef(void 0);
|
|
4253
|
+
const usesCode = props.intent !== "login" || mode === "code";
|
|
4254
|
+
const needsPassword = props.intent !== "login" || mode === "password";
|
|
4255
|
+
useEffect(() => {
|
|
4256
|
+
if (countdown <= 0) return;
|
|
4257
|
+
const timer = window.setInterval(() => setCountdown((value) => Math.max(0, value - 1)), 1e3);
|
|
4258
|
+
return () => window.clearInterval(timer);
|
|
4259
|
+
}, [countdown > 0]);
|
|
4260
|
+
async function ensureTransaction() {
|
|
4261
|
+
if (transactionId) return transactionId;
|
|
4262
|
+
const created = await beginTransaction(request, props.intent);
|
|
4263
|
+
setTransactionId(created);
|
|
4264
|
+
return created;
|
|
4265
|
+
}
|
|
4266
|
+
async function sendCode() {
|
|
4267
|
+
try {
|
|
4268
|
+
const { email } = await form.validateFields(["email"]);
|
|
4269
|
+
setSending(true);
|
|
4270
|
+
const currentTransactionId = await ensureTransaction();
|
|
4271
|
+
const requestId = pendingSend.current?.email === email ? pendingSend.current.requestId : crypto.randomUUID();
|
|
4272
|
+
pendingSend.current = { email, requestId };
|
|
4273
|
+
const challenge = await request(
|
|
4274
|
+
`/api/auth/transactions/${encodeURIComponent(currentTransactionId)}/complete`,
|
|
4275
|
+
{
|
|
4276
|
+
method: "POST",
|
|
4277
|
+
headers: { "content-type": "application/json" },
|
|
4278
|
+
credentials: "same-origin",
|
|
4279
|
+
body: JSON.stringify({ input: { action: "send-code", email, requestId } })
|
|
4280
|
+
},
|
|
4281
|
+
{ errorMessage: "\u9A8C\u8BC1\u7801\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5", parse: parseAuthenticationChallenge }
|
|
4282
|
+
);
|
|
4283
|
+
setCodeSent(true);
|
|
4284
|
+
setCountdown(Math.ceil(challenge.retryAfterMs / 1e3));
|
|
4285
|
+
pendingSend.current = void 0;
|
|
4286
|
+
void message.success("\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001");
|
|
4287
|
+
} catch {
|
|
4288
|
+
} finally {
|
|
4289
|
+
setSending(false);
|
|
4290
|
+
}
|
|
4291
|
+
}
|
|
4292
|
+
async function submit(values) {
|
|
4293
|
+
setSubmitting(true);
|
|
4294
|
+
try {
|
|
4295
|
+
const currentTransactionId = await ensureTransaction();
|
|
4296
|
+
const input = usesCode ? {
|
|
4297
|
+
action: "verify-code",
|
|
4298
|
+
email: values.email,
|
|
4299
|
+
code: values.code,
|
|
4300
|
+
...needsPassword ? { password: values.password } : {}
|
|
4301
|
+
} : { action: "password-login", email: values.email, password: values.password };
|
|
4302
|
+
await request(`/api/auth/transactions/${encodeURIComponent(currentTransactionId)}/complete`, {
|
|
4303
|
+
method: "POST",
|
|
4304
|
+
headers: { "content-type": "application/json" },
|
|
4305
|
+
credentials: "same-origin",
|
|
4306
|
+
body: JSON.stringify({ input })
|
|
4307
|
+
}, { errorMessage: "\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165\u540E\u91CD\u8BD5", parse: parseAuthenticationCompletion });
|
|
4308
|
+
if (props.intent === "registration") {
|
|
4309
|
+
navigation.replace(USER_ACCOUNT_HREF);
|
|
4310
|
+
return;
|
|
4311
|
+
}
|
|
4312
|
+
navigation.replace("/");
|
|
4313
|
+
} catch {
|
|
4314
|
+
} finally {
|
|
4315
|
+
setSubmitting(false);
|
|
4316
|
+
}
|
|
4317
|
+
}
|
|
4318
|
+
const copy = pageCopy(props.intent);
|
|
4319
|
+
return /* @__PURE__ */ jsxs(
|
|
4320
|
+
"section",
|
|
4321
|
+
{
|
|
4322
|
+
"aria-labelledby": "password-auth-title",
|
|
4323
|
+
className: password_form_default.authShell,
|
|
4324
|
+
"data-auth-method": "password",
|
|
4325
|
+
"data-flat-auth-layout": true,
|
|
4326
|
+
children: [
|
|
4327
|
+
/* @__PURE__ */ jsxs("div", { className: password_form_default.introduction, children: [
|
|
4328
|
+
/* @__PURE__ */ jsx("p", { className: password_form_default.eyebrow, children: copy.step }),
|
|
4329
|
+
/* @__PURE__ */ jsx("h1", { className: password_form_default.introductionTitle, id: "password-auth-title", children: copy.title }),
|
|
4330
|
+
/* @__PURE__ */ jsx("p", { className: password_form_default.introductionCopy, children: copy.introduction }),
|
|
4331
|
+
/* @__PURE__ */ jsx(AlternateLinks, { intent: props.intent })
|
|
4332
|
+
] }),
|
|
4333
|
+
/* @__PURE__ */ jsxs("div", { className: password_form_default.formRegion, children: [
|
|
4334
|
+
/* @__PURE__ */ jsx("div", { className: password_form_default.formBody, children: /* @__PURE__ */ jsxs(
|
|
4335
|
+
form_default,
|
|
4336
|
+
{
|
|
4337
|
+
form,
|
|
4338
|
+
layout: "vertical",
|
|
4339
|
+
requiredMark: false,
|
|
4340
|
+
scrollToFirstError: { focus: true },
|
|
4341
|
+
validateTrigger: "onBlur",
|
|
4342
|
+
onFinish: submit,
|
|
4343
|
+
children: [
|
|
4344
|
+
props.intent === "login" ? /* @__PURE__ */ jsx(form_default.Item, { children: /* @__PURE__ */ jsx(
|
|
4345
|
+
segmented_default,
|
|
4346
|
+
{
|
|
4347
|
+
"aria-label": "\u9009\u62E9\u767B\u5F55\u65B9\u5F0F",
|
|
4348
|
+
block: true,
|
|
4349
|
+
options: [{ label: "\u5BC6\u7801\u767B\u5F55", value: "password" }, { label: "\u9A8C\u8BC1\u7801\u767B\u5F55", value: "code" }],
|
|
4350
|
+
size: "large",
|
|
4351
|
+
value: mode,
|
|
4352
|
+
onChange: (value) => {
|
|
4353
|
+
setMode(value);
|
|
4354
|
+
setCodeSent(false);
|
|
4355
|
+
setCountdown(0);
|
|
4356
|
+
setTransactionId(props.transactionId);
|
|
4357
|
+
pendingSend.current = void 0;
|
|
4358
|
+
form.resetFields(["code"]);
|
|
4359
|
+
}
|
|
4360
|
+
}
|
|
4361
|
+
) }) : null,
|
|
4362
|
+
/* @__PURE__ */ jsx(form_default.Item, { label: "\u90AE\u7BB1", name: "email", rules: emailRules, children: /* @__PURE__ */ jsx(input_default, { autoComplete: "username", disabled: codeSent, inputMode: "email", maxLength: 320, placeholder: "name@example.com", size: "large", type: "email" }) }),
|
|
4363
|
+
codeSent ? /* @__PURE__ */ jsx(
|
|
4364
|
+
button_default,
|
|
4365
|
+
{
|
|
4366
|
+
className: password_form_default.changeEmail,
|
|
4367
|
+
disabled: sending || submitting,
|
|
4368
|
+
type: "link",
|
|
4369
|
+
onClick: () => {
|
|
4370
|
+
setCodeSent(false);
|
|
4371
|
+
setCountdown(0);
|
|
4372
|
+
setTransactionId(void 0);
|
|
4373
|
+
pendingSend.current = void 0;
|
|
4374
|
+
form.resetFields(["code"]);
|
|
4375
|
+
window.requestAnimationFrame(() => form.focusField("email"));
|
|
4376
|
+
},
|
|
4377
|
+
children: "\u4FEE\u6539\u90AE\u7BB1"
|
|
4378
|
+
}
|
|
4379
|
+
) : null,
|
|
4380
|
+
usesCode ? /* @__PURE__ */ jsx(form_default.Item, { label: "\u9A8C\u8BC1\u7801", required: true, children: /* @__PURE__ */ jsxs("div", { className: password_form_default.codeRow, children: [
|
|
4381
|
+
/* @__PURE__ */ jsx(form_default.Item, { noStyle: true, name: "code", rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801" }, { len: 6, message: "\u9A8C\u8BC1\u7801\u5E94\u4E3A 6 \u4F4D\u6570\u5B57" }, { pattern: /^\d{6}$/, message: "\u9A8C\u8BC1\u7801\u5E94\u4E3A 6 \u4F4D\u6570\u5B57" }], children: /* @__PURE__ */ jsx(input_default, { "aria-label": "\u9A8C\u8BC1\u7801", autoComplete: "one-time-code", inputMode: "numeric", maxLength: 6, placeholder: "6 \u4F4D\u9A8C\u8BC1\u7801", size: "large" }) }),
|
|
4382
|
+
/* @__PURE__ */ jsx(button_default, { disabled: countdown > 0 || submitting, loading: sending, onClick: sendCode, size: "large", children: countdown > 0 ? `${countdown} \u79D2\u540E\u91CD\u53D1` : codeSent ? "\u91CD\u65B0\u53D1\u9001" : "\u53D1\u9001\u9A8C\u8BC1\u7801" })
|
|
4383
|
+
] }) }) : null,
|
|
4384
|
+
needsPassword ? /* @__PURE__ */ jsx(
|
|
4385
|
+
form_default.Item,
|
|
4386
|
+
{
|
|
4387
|
+
extra: props.intent !== "login" ? "\u81F3\u5C11 12 \u4E2A\u5B57\u7B26\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u5BC6\u7801\u7BA1\u7406\u5668\u751F\u6210\u5E76\u4FDD\u5B58\u3002" : void 0,
|
|
4388
|
+
label: props.intent === "recovery" ? "\u65B0\u5BC6\u7801" : "\u5BC6\u7801",
|
|
4389
|
+
name: "password",
|
|
4390
|
+
rules: passwordRules(props.intent !== "login"),
|
|
4391
|
+
children: /* @__PURE__ */ jsx(
|
|
4392
|
+
input_default.Password,
|
|
4393
|
+
{
|
|
4394
|
+
autoComplete: props.intent === "login" ? "current-password" : "new-password",
|
|
4395
|
+
maxLength: 128,
|
|
4396
|
+
placeholder: props.intent === "login" ? "\u8F93\u5165\u5BC6\u7801" : "\u521B\u5EFA\u4E00\u4E2A\u5B89\u5168\u5BC6\u7801",
|
|
4397
|
+
size: "large"
|
|
4398
|
+
}
|
|
4399
|
+
)
|
|
4400
|
+
}
|
|
4401
|
+
) : null,
|
|
4402
|
+
/* @__PURE__ */ jsx(button_default, { block: true, htmlType: "submit", loading: submitting, size: "large", type: "primary", disabled: sending || usesCode && !codeSent, children: copy.submit })
|
|
4403
|
+
]
|
|
4404
|
+
}
|
|
4405
|
+
) }),
|
|
4406
|
+
/* @__PURE__ */ jsxs("aside", { className: password_form_default.formNote, children: [
|
|
4407
|
+
/* @__PURE__ */ jsx("p", { children: copy.description }),
|
|
4408
|
+
/* @__PURE__ */ jsx("span", { children: "\u4F60\u7684\u767B\u5F55\u4FE1\u606F\u53EA\u7528\u4E8E\u8BC6\u522B\u8D26\u6237\u3002" })
|
|
4409
|
+
] })
|
|
4410
|
+
] })
|
|
4411
|
+
]
|
|
4412
|
+
}
|
|
4413
|
+
);
|
|
4414
|
+
}
|
|
4415
|
+
function AlternateLinks({ intent }) {
|
|
4416
|
+
if (intent === "registration") return /* @__PURE__ */ jsxs("p", { className: password_form_default.alternate, children: [
|
|
4417
|
+
"\u5DF2\u7ECF\u6709\u8D26\u53F7\uFF1F",
|
|
4418
|
+
/* @__PURE__ */ jsx(RscLink, { href: "/auth.password/login", children: "\u8FD4\u56DE\u767B\u5F55" })
|
|
4419
|
+
] });
|
|
4420
|
+
if (intent === "recovery") return /* @__PURE__ */ jsxs("p", { className: password_form_default.alternate, children: [
|
|
4421
|
+
"\u60F3\u8D77\u5BC6\u7801\u4E86\uFF1F",
|
|
4422
|
+
/* @__PURE__ */ jsx(RscLink, { href: "/auth.password/login", children: "\u8FD4\u56DE\u767B\u5F55" })
|
|
4423
|
+
] });
|
|
4424
|
+
return /* @__PURE__ */ jsxs("div", { className: password_form_default.alternateLinks, children: [
|
|
4425
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
4426
|
+
/* @__PURE__ */ jsx("span", { children: "\u8FD8\u6CA1\u6709\u8D26\u6237\uFF1F" }),
|
|
4427
|
+
/* @__PURE__ */ jsx(RscLink, { href: "/auth.password/register", children: "\u521B\u5EFA\u8D26\u6237" })
|
|
4428
|
+
] }),
|
|
4429
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
4430
|
+
/* @__PURE__ */ jsx("span", { children: "\u5FD8\u8BB0\u5BC6\u7801\uFF1F" }),
|
|
4431
|
+
/* @__PURE__ */ jsx(RscLink, { href: "/auth.password/recovery", children: "\u627E\u56DE\u5BC6\u7801" })
|
|
4432
|
+
] })
|
|
4433
|
+
] });
|
|
4434
|
+
}
|
|
4435
|
+
async function beginTransaction(request, intent) {
|
|
4436
|
+
return request("/api/auth/transactions", {
|
|
4437
|
+
method: "POST",
|
|
4438
|
+
headers: { "content-type": "application/json" },
|
|
4439
|
+
credentials: "same-origin",
|
|
4440
|
+
body: JSON.stringify({ methodId: "password", intent })
|
|
4441
|
+
}, { errorMessage: "\u6682\u65F6\u65E0\u6CD5\u7EE7\u7EED\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5", parse: parseTransactionId });
|
|
4442
|
+
}
|
|
4443
|
+
function parseTransactionId(data) {
|
|
4444
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) throw new Error("Invalid transaction response");
|
|
4445
|
+
const transactionId = data.transactionId;
|
|
4446
|
+
if (typeof transactionId !== "string" || !UUID.test(transactionId)) {
|
|
4447
|
+
throw new Error("Invalid transaction response");
|
|
4448
|
+
}
|
|
4449
|
+
return transactionId;
|
|
4450
|
+
}
|
|
4451
|
+
var emailRules = [
|
|
4452
|
+
{ required: true, message: "\u8BF7\u8F93\u5165\u90AE\u7BB1", whitespace: true },
|
|
4453
|
+
{ type: "email", message: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1\u5730\u5740" },
|
|
4454
|
+
{ max: 320, message: "\u90AE\u7BB1\u5730\u5740\u4E0D\u80FD\u8D85\u8FC7 320 \u4E2A\u5B57\u7B26" }
|
|
4455
|
+
];
|
|
4456
|
+
function passwordRules(requireMinimum) {
|
|
4457
|
+
return [
|
|
4458
|
+
{ required: true, message: "\u8BF7\u8F93\u5165\u5BC6\u7801" },
|
|
4459
|
+
...requireMinimum ? [{
|
|
4460
|
+
validator: async (_rule, value) => {
|
|
4461
|
+
if (!value) return;
|
|
4462
|
+
if (Array.from(value).length < 12) throw new Error("\u5BC6\u7801\u81F3\u5C11\u9700\u8981 12 \u4E2A\u5B57\u7B26");
|
|
4463
|
+
if (new TextEncoder().encode(value).byteLength > 128) throw new Error("\u5BC6\u7801\u8FC7\u957F\uFF0C\u8BF7\u7F29\u77ED\u540E\u91CD\u8BD5");
|
|
4464
|
+
}
|
|
4465
|
+
}] : [{ max: 128, message: "\u5BC6\u7801\u4E0D\u80FD\u8D85\u8FC7 128 \u4E2A\u5B57\u7B26" }]
|
|
4466
|
+
];
|
|
4467
|
+
}
|
|
4468
|
+
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
4469
|
+
function pageCopy(intent) {
|
|
4470
|
+
if (intent === "registration") return {
|
|
4471
|
+
introduction: "\u9A8C\u8BC1\u90AE\u7BB1\u5E76\u521B\u5EFA\u8D26\u53F7\u540E\uFF0C\u53EF\u4EE5\u7EE7\u7EED\u5B8C\u5584\u8D44\u6599\uFF0C\u6574\u7406\u5C5E\u4E8E\u4F60\u7684\u8BB0\u5F55\u3002",
|
|
4472
|
+
step: "ACCOUNT / REGISTER",
|
|
4473
|
+
title: "\u521B\u5EFA\u8D26\u6237",
|
|
4474
|
+
description: "\u4F7F\u7528\u90AE\u7BB1\u9A8C\u8BC1\u7801\u548C\u5BC6\u7801\u521B\u5EFA\u8D26\u53F7\u3002",
|
|
4475
|
+
submit: "\u521B\u5EFA\u8D26\u53F7"
|
|
4476
|
+
};
|
|
4477
|
+
if (intent === "recovery") return {
|
|
4478
|
+
introduction: "\u9A8C\u8BC1\u6CE8\u518C\u90AE\u7BB1\u540E\u8BBE\u7F6E\u65B0\u5BC6\u7801\uFF0C\u65E7\u8BBE\u5907\u4E0A\u7684\u767B\u5F55\u4F1A\u81EA\u52A8\u9000\u51FA\u3002",
|
|
4479
|
+
step: "ACCOUNT / RECOVERY",
|
|
4480
|
+
title: "\u627E\u56DE\u5BC6\u7801",
|
|
4481
|
+
description: "\u9A8C\u8BC1\u7801\u53EA\u4F1A\u53D1\u9001\u5230\u5DF2\u7ECF\u6CE8\u518C\u7684\u90AE\u7BB1\u3002",
|
|
4482
|
+
submit: "\u66F4\u65B0\u5BC6\u7801\u5E76\u767B\u5F55"
|
|
4483
|
+
};
|
|
4484
|
+
return {
|
|
4485
|
+
introduction: "\u767B\u5F55\u540E\u53EF\u4EE5\u7BA1\u7406\u4E2A\u4EBA\u8D44\u6599\u4E0E\u767B\u5F55\u4F1A\u8BDD\u3002",
|
|
4486
|
+
step: "ACCOUNT / SIGN IN",
|
|
4487
|
+
title: "\u767B\u5F55\u8D26\u6237",
|
|
4488
|
+
description: "\u4F7F\u7528\u5BC6\u7801\u6216\u90AE\u7BB1\u9A8C\u8BC1\u7801\u767B\u5F55\u4F60\u7684\u8D26\u6237\u3002",
|
|
4489
|
+
submit: "\u767B\u5F55"
|
|
4490
|
+
};
|
|
4491
|
+
}
|
|
4492
|
+
export {
|
|
4493
|
+
PasswordForm as default
|
|
4494
|
+
};
|