@yoka-ui/ui 1.0.5 → 1.0.6

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.
Files changed (41) hide show
  1. package/@Docs-yoka/exports.generated.md +6 -9
  2. package/README.md +39 -12
  3. package/dist/es/business/YkLoginModule/SmsLoginForm.d.ts +25 -0
  4. package/dist/es/business/YkLoginModule/SmsLoginForm.js +178 -0
  5. package/dist/es/business/YkLoginModule/SmsLoginForm.js.map +7 -0
  6. package/dist/es/business/YkLoginModule/index.d.ts +48 -0
  7. package/dist/es/business/YkLoginModule/index.js +198 -0
  8. package/dist/es/business/YkLoginModule/index.js.map +7 -0
  9. package/dist/es/business/YkLoginModule/styles.module.less +169 -0
  10. package/dist/es/business/YkSqlEdit/code-mirror-custom.module.less +154 -0
  11. package/dist/es/business/YkSqlEdit/index.d.ts +20 -0
  12. package/dist/es/business/YkSqlEdit/index.js +180 -0
  13. package/dist/es/business/YkSqlEdit/index.js.map +7 -0
  14. package/dist/es/business/YkSqlEdit/sql-language.d.ts +11 -0
  15. package/dist/es/business/YkSqlEdit/sql-language.js +1460 -0
  16. package/dist/es/business/YkSqlEdit/sql-language.js.map +7 -0
  17. package/dist/es/creative/GlassSegmentedRadio/index.d.ts +1 -1
  18. package/dist/es/index.d.ts +4 -2
  19. package/dist/es/index.js +80 -76
  20. package/dist/es/index.js.map +2 -2
  21. package/dist/es/index.less +2 -0
  22. package/dist/lib/business/YkLoginModule/SmsLoginForm.d.ts +25 -0
  23. package/dist/lib/business/YkLoginModule/SmsLoginForm.js +171 -0
  24. package/dist/lib/business/YkLoginModule/SmsLoginForm.js.map +7 -0
  25. package/dist/lib/business/YkLoginModule/index.d.ts +48 -0
  26. package/dist/lib/business/YkLoginModule/index.js +206 -0
  27. package/dist/lib/business/YkLoginModule/index.js.map +7 -0
  28. package/dist/lib/business/YkLoginModule/styles.module.less +169 -0
  29. package/dist/lib/business/YkSqlEdit/code-mirror-custom.module.less +154 -0
  30. package/dist/lib/business/YkSqlEdit/index.d.ts +20 -0
  31. package/dist/lib/business/YkSqlEdit/index.js +202 -0
  32. package/dist/lib/business/YkSqlEdit/index.js.map +7 -0
  33. package/dist/lib/business/YkSqlEdit/sql-language.d.ts +11 -0
  34. package/dist/lib/business/YkSqlEdit/sql-language.js +1493 -0
  35. package/dist/lib/business/YkSqlEdit/sql-language.js.map +7 -0
  36. package/dist/lib/creative/GlassSegmentedRadio/index.d.ts +1 -1
  37. package/dist/lib/index.d.ts +4 -2
  38. package/dist/lib/index.js +6 -0
  39. package/dist/lib/index.js.map +2 -2
  40. package/dist/lib/index.less +2 -0
  41. package/package.json +143 -138
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import { type SmsLoginFormApi } from './SmsLoginForm';
3
+ export type LoginType = 'qrcode' | 'sms';
4
+ export type LoginTabItem = {
5
+ key: LoginType;
6
+ label: React.ReactNode;
7
+ };
8
+ export type QrcodeApi = {
9
+ getQrcode: () => Promise<{
10
+ qrcode: string;
11
+ url: string;
12
+ }>;
13
+ scanLogin: (qrcode: string) => Promise<{
14
+ code: number;
15
+ data?: {
16
+ status?: number;
17
+ msg?: string;
18
+ };
19
+ }>;
20
+ };
21
+ export type LoginModuleProps = {
22
+ title: React.ReactNode;
23
+ tabs: LoginTabItem[];
24
+ defaultLoginType: LoginType;
25
+ containerStyle?: React.CSSProperties;
26
+ actions?: React.ReactNode | ((loginType: LoginType) => React.ReactNode);
27
+ className?: string;
28
+ formClassName?: string;
29
+ tabsClassName?: string;
30
+ inputClassName?: string;
31
+ qrcodeClassName?: string;
32
+ qrcodeBoxClassName?: string;
33
+ onFinish: (values: Record<string, unknown>) => Promise<void>;
34
+ qrcode?: {
35
+ api: QrcodeApi;
36
+ icon: string;
37
+ iconSize?: number;
38
+ size?: number;
39
+ wrapStyle?: React.CSSProperties;
40
+ onSuccess: () => void | Promise<void>;
41
+ };
42
+ sms?: {
43
+ api: SmsLoginFormApi;
44
+ appKey: string;
45
+ };
46
+ };
47
+ declare const LoginModule: React.FC<LoginModuleProps>;
48
+ export default LoginModule;
@@ -0,0 +1,206 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/business/YkLoginModule/index.tsx
30
+ var YkLoginModule_exports = {};
31
+ __export(YkLoginModule_exports, {
32
+ default: () => YkLoginModule_default
33
+ });
34
+ module.exports = __toCommonJS(YkLoginModule_exports);
35
+ var import_pro_form = require("@ant-design/pro-form");
36
+ var import_antd = require("antd");
37
+ var import_react = __toESM(require("react"));
38
+ var import_SmsLoginForm = __toESM(require("./SmsLoginForm"));
39
+ var import_styles_module = __toESM(require("./styles.module.less"));
40
+ var DEFAULT_QRCODE_WRAP_STYLE = {
41
+ padding: 10,
42
+ display: "flex",
43
+ justifyContent: "center"
44
+ };
45
+ var LoginModule = (props) => {
46
+ const {
47
+ title,
48
+ tabs,
49
+ defaultLoginType,
50
+ containerStyle,
51
+ actions,
52
+ onFinish,
53
+ qrcode,
54
+ className = import_styles_module.default.root,
55
+ formClassName = import_styles_module.default.form,
56
+ tabsClassName = import_styles_module.default.tabs,
57
+ inputClassName,
58
+ qrcodeClassName = import_styles_module.default.qrcode,
59
+ qrcodeBoxClassName = import_styles_module.default.qrcodeBox,
60
+ sms
61
+ } = props;
62
+ const [loginType, setLoginType] = (0, import_react.useState)(defaultLoginType);
63
+ const [qrcodeStatus, setQrcodeStatus] = (0, import_react.useState)("active");
64
+ const [qrcodeUrl, setQrcodeUrl] = (0, import_react.useState)("-");
65
+ const [qrcodeValue, setQrcodeValue] = (0, import_react.useState)("");
66
+ const pollIntervalRef = (0, import_react.useRef)(null);
67
+ const pollTimeoutRef = (0, import_react.useRef)(null);
68
+ const shouldShowSubmitter = loginType !== "qrcode";
69
+ const resolvedActions = (0, import_react.useMemo)(() => {
70
+ if (!actions)
71
+ return void 0;
72
+ return typeof actions === "function" ? actions(loginType) : actions;
73
+ }, [actions, loginType]);
74
+ const safeClearTimers = (0, import_react.useCallback)(() => {
75
+ if (pollIntervalRef.current)
76
+ clearInterval(pollIntervalRef.current);
77
+ if (pollTimeoutRef.current)
78
+ clearTimeout(pollTimeoutRef.current);
79
+ pollIntervalRef.current = null;
80
+ pollTimeoutRef.current = null;
81
+ }, []);
82
+ const handleQrcodeRefresh = (0, import_react.useCallback)(async () => {
83
+ if (!qrcode)
84
+ return;
85
+ setQrcodeStatus("loading");
86
+ try {
87
+ const res = await qrcode.api.getQrcode();
88
+ setQrcodeUrl(res.url);
89
+ setQrcodeValue(res.qrcode);
90
+ setQrcodeStatus("active");
91
+ } catch {
92
+ setQrcodeStatus("expired");
93
+ import_antd.message.error("获取二维码失败,请稍后重试");
94
+ }
95
+ }, [qrcode]);
96
+ const enabledTabKeys = (0, import_react.useMemo)(() => new Set(tabs.map((t) => t.key)), [tabs]);
97
+ (0, import_react.useEffect)(() => {
98
+ var _a;
99
+ if (enabledTabKeys.has(defaultLoginType)) {
100
+ setLoginType(defaultLoginType);
101
+ return;
102
+ }
103
+ const fallback = (_a = tabs[0]) == null ? void 0 : _a.key;
104
+ if (fallback)
105
+ setLoginType(fallback);
106
+ }, [defaultLoginType, enabledTabKeys, tabs]);
107
+ (0, import_react.useEffect)(() => {
108
+ var _a;
109
+ if (enabledTabKeys.has(loginType))
110
+ return;
111
+ const fallback = (_a = tabs[0]) == null ? void 0 : _a.key;
112
+ if (fallback)
113
+ setLoginType(fallback);
114
+ }, [enabledTabKeys, loginType, tabs]);
115
+ (0, import_react.useEffect)(() => {
116
+ safeClearTimers();
117
+ if (loginType !== "qrcode") {
118
+ setQrcodeStatus("expired");
119
+ return;
120
+ }
121
+ if (!qrcode) {
122
+ setQrcodeStatus("expired");
123
+ return;
124
+ }
125
+ void handleQrcodeRefresh();
126
+ return safeClearTimers;
127
+ }, [handleQrcodeRefresh, loginType, qrcode, safeClearTimers]);
128
+ (0, import_react.useEffect)(() => {
129
+ safeClearTimers();
130
+ if (!qrcode)
131
+ return;
132
+ if (loginType !== "qrcode")
133
+ return;
134
+ if (qrcodeStatus !== "active")
135
+ return;
136
+ if (!qrcodeValue)
137
+ return;
138
+ pollIntervalRef.current = setInterval(() => {
139
+ void qrcode.api.scanLogin(qrcodeValue).then((res) => {
140
+ var _a, _b;
141
+ if (res.code !== 200)
142
+ return;
143
+ const status = (_a = res.data) == null ? void 0 : _a.status;
144
+ const msg = ((_b = res.data) == null ? void 0 : _b.msg) ?? "扫码遇到问题,稍后重试";
145
+ if (status === -1)
146
+ return;
147
+ if (status !== 1) {
148
+ safeClearTimers();
149
+ setQrcodeStatus("expired");
150
+ import_antd.message.error(msg, 3);
151
+ return;
152
+ }
153
+ safeClearTimers();
154
+ void qrcode.onSuccess();
155
+ }).catch(() => {
156
+ });
157
+ }, 1e3);
158
+ pollTimeoutRef.current = setTimeout(() => {
159
+ setQrcodeStatus("expired");
160
+ safeClearTimers();
161
+ }, 3e4);
162
+ return safeClearTimers;
163
+ }, [loginType, qrcode, qrcodeStatus, qrcodeValue, safeClearTimers]);
164
+ const tabItems = (0, import_react.useMemo)(() => tabs.map((t) => ({ key: t.key, label: t.label })), [tabs]);
165
+ return /* @__PURE__ */ import_react.default.createElement("div", { className, style: { maxWidth: "500px" } }, /* @__PURE__ */ import_react.default.createElement(
166
+ import_pro_form.LoginForm,
167
+ {
168
+ className: formClassName,
169
+ onFinish: async (values) => {
170
+ await onFinish(values);
171
+ },
172
+ title: typeof title === "string" ? /* @__PURE__ */ import_react.default.createElement("div", { className: import_styles_module.default.title }, title) : title,
173
+ containerStyle,
174
+ submitter: shouldShowSubmitter ? void 0 : false,
175
+ actions: resolvedActions
176
+ },
177
+ /* @__PURE__ */ import_react.default.createElement(
178
+ import_antd.Tabs,
179
+ {
180
+ className: tabsClassName,
181
+ centered: true,
182
+ activeKey: loginType,
183
+ onChange: (activeKey) => {
184
+ const next = activeKey;
185
+ setLoginType(next);
186
+ },
187
+ items: tabItems
188
+ }
189
+ ),
190
+ enabledTabKeys.has("qrcode") && loginType === "qrcode" && qrcode && /* @__PURE__ */ import_react.default.createElement("div", { style: qrcode.wrapStyle ?? DEFAULT_QRCODE_WRAP_STYLE }, /* @__PURE__ */ import_react.default.createElement("div", { className: qrcodeBoxClassName }, /* @__PURE__ */ import_react.default.createElement(import_antd.Flex, { justify: "center", align: "center" }, /* @__PURE__ */ import_react.default.createElement("i", { className: "iconfont icon-saoyisao", style: { color: "#999999", marginRight: 10, fontSize: 14 } }), "请使用", /* @__PURE__ */ import_react.default.createElement("span", { style: { color: "#0A6BFD" } }, "小闪扫码"), "登录"), /* @__PURE__ */ import_react.default.createElement(
191
+ import_antd.QRCode,
192
+ {
193
+ icon: qrcode.icon,
194
+ iconSize: qrcode.iconSize ?? 50,
195
+ className: qrcodeClassName,
196
+ size: qrcode.size ?? 240,
197
+ value: qrcodeUrl,
198
+ status: qrcodeStatus,
199
+ onRefresh: handleQrcodeRefresh
200
+ }
201
+ ))),
202
+ enabledTabKeys.has("sms") && loginType === "sms" && sms && /* @__PURE__ */ import_react.default.createElement(import_SmsLoginForm.default, { inputClassName: inputClassName ?? "", api: sms.api, appKey: sms.appKey })
203
+ ));
204
+ };
205
+ var YkLoginModule_default = LoginModule;
206
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/business/YkLoginModule/index.tsx"],
4
+ "sourcesContent": ["import { LoginForm } from '@ant-design/pro-form';\nimport { Flex, message, QRCode, Tabs } from 'antd';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport SmsLoginForm, { type SmsLoginFormApi } from './SmsLoginForm';\nimport styles from './styles.module.less';\n\nexport type LoginType = 'qrcode' | 'sms';\n\nexport type LoginTabItem = {\n key: LoginType;\n label: React.ReactNode;\n};\n\nexport type QrcodeApi = {\n getQrcode: () => Promise<{ qrcode: string; url: string }>;\n scanLogin: (qrcode: string) => Promise<{\n code: number;\n data?: {\n status?: number;\n msg?: string;\n };\n }>;\n};\n\nexport type LoginModuleProps = {\n title: React.ReactNode;\n tabs: LoginTabItem[];\n defaultLoginType: LoginType;\n containerStyle?: React.CSSProperties;\n actions?: React.ReactNode | ((loginType: LoginType) => React.ReactNode);\n className?: string;\n formClassName?: string;\n tabsClassName?: string;\n inputClassName?: string;\n qrcodeClassName?: string;\n qrcodeBoxClassName?: string;\n\n onFinish: (values: Record<string, unknown>) => Promise<void>;\n\n qrcode?: {\n api: QrcodeApi;\n icon: string;\n iconSize?: number;\n size?: number;\n wrapStyle?: React.CSSProperties;\n onSuccess: () => void | Promise<void>;\n };\n\n sms?: {\n api: SmsLoginFormApi;\n appKey: string;\n };\n};\n\nconst DEFAULT_QRCODE_WRAP_STYLE: React.CSSProperties = {\n padding: 10,\n display: 'flex',\n justifyContent: 'center',\n};\n\nconst LoginModule: React.FC<LoginModuleProps> = (props) => {\n const {\n title,\n tabs,\n defaultLoginType,\n containerStyle,\n actions,\n onFinish,\n qrcode,\n className = styles.root,\n formClassName = styles.form,\n tabsClassName = styles.tabs,\n inputClassName,\n qrcodeClassName = styles.qrcode,\n qrcodeBoxClassName = styles.qrcodeBox,\n sms,\n } = props;\n\n const [loginType, setLoginType] = useState<LoginType>(defaultLoginType);\n\n const [qrcodeStatus, setQrcodeStatus] = useState<'active' | 'expired' | 'loading'>('active');\n const [qrcodeUrl, setQrcodeUrl] = useState<string>('-');\n const [qrcodeValue, setQrcodeValue] = useState<string>('');\n const pollIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null);\n const pollTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const shouldShowSubmitter = loginType !== 'qrcode';\n\n const resolvedActions = useMemo(() => {\n if (!actions) return undefined;\n return typeof actions === 'function' ? actions(loginType) : actions;\n }, [actions, loginType]);\n\n const safeClearTimers = useCallback(() => {\n if (pollIntervalRef.current) clearInterval(pollIntervalRef.current);\n if (pollTimeoutRef.current) clearTimeout(pollTimeoutRef.current);\n pollIntervalRef.current = null;\n pollTimeoutRef.current = null;\n }, []);\n\n const handleQrcodeRefresh = useCallback(async () => {\n if (!qrcode) return;\n setQrcodeStatus('loading');\n try {\n const res = await qrcode.api.getQrcode();\n setQrcodeUrl(res.url);\n setQrcodeValue(res.qrcode);\n setQrcodeStatus('active');\n } catch {\n setQrcodeStatus('expired');\n message.error('获取二维码失败,请稍后重试');\n }\n }, [qrcode]);\n\n const enabledTabKeys = useMemo(() => new Set(tabs.map((t) => t.key)), [tabs]);\n\n useEffect(() => {\n if (enabledTabKeys.has(defaultLoginType)) {\n setLoginType(defaultLoginType);\n return;\n }\n const fallback = tabs[0]?.key;\n if (fallback) setLoginType(fallback);\n }, [defaultLoginType, enabledTabKeys, tabs]);\n\n useEffect(() => {\n if (enabledTabKeys.has(loginType)) return;\n const fallback = tabs[0]?.key;\n if (fallback) setLoginType(fallback);\n }, [enabledTabKeys, loginType, tabs]);\n\n // 切到扫码登录时刷新二维码;离开扫码登录时停止轮询并标记过期\n useEffect(() => {\n safeClearTimers();\n if (loginType !== 'qrcode') {\n setQrcodeStatus('expired');\n return;\n }\n if (!qrcode) {\n setQrcodeStatus('expired');\n return;\n }\n void handleQrcodeRefresh();\n return safeClearTimers;\n }, [handleQrcodeRefresh, loginType, qrcode, safeClearTimers]);\n\n // 扫码轮询:仅在二维码“激活 + 有值 + 在扫码 Tab”时启动\n useEffect(() => {\n safeClearTimers();\n if (!qrcode) return;\n if (loginType !== 'qrcode') return;\n if (qrcodeStatus !== 'active') return;\n if (!qrcodeValue) return;\n\n pollIntervalRef.current = setInterval(() => {\n void qrcode.api\n .scanLogin(qrcodeValue)\n .then((res) => {\n if (res.code !== 200) return;\n\n const status = res.data?.status;\n const msg = res.data?.msg ?? '扫码遇到问题,稍后重试';\n\n if (status === -1) return;\n if (status !== 1) {\n safeClearTimers();\n setQrcodeStatus('expired');\n message.error(msg, 3);\n return;\n }\n safeClearTimers();\n void qrcode.onSuccess();\n })\n .catch(() => {\n // 忽略轮询中的偶发网络错误,保持继续轮询直到超时/成功\n });\n }, 1000);\n\n pollTimeoutRef.current = setTimeout(() => {\n setQrcodeStatus('expired');\n safeClearTimers();\n }, 30000);\n\n return safeClearTimers;\n }, [loginType, qrcode, qrcodeStatus, qrcodeValue, safeClearTimers]);\n\n const tabItems = useMemo(() => tabs.map((t) => ({ key: t.key, label: t.label })), [tabs]);\n\n return (\n <div className={className} style={{ maxWidth: '500px' }}>\n <LoginForm\n className={formClassName}\n onFinish={async (values) => {\n await onFinish(values);\n }}\n title={typeof title === 'string' ? <div className={styles.title}>{title}</div> : title}\n containerStyle={containerStyle}\n submitter={shouldShowSubmitter ? undefined : (false as const)}\n actions={resolvedActions}\n >\n <Tabs\n className={tabsClassName}\n centered\n activeKey={loginType}\n onChange={(activeKey) => {\n const next = activeKey as LoginType;\n setLoginType(next);\n }}\n items={tabItems}\n />\n\n {enabledTabKeys.has('qrcode') && loginType === 'qrcode' && qrcode && (\n <div style={qrcode.wrapStyle ?? DEFAULT_QRCODE_WRAP_STYLE}>\n <div className={qrcodeBoxClassName}>\n <Flex justify='center' align='center'>\n <i className='iconfont icon-saoyisao' style={{ color: '#999999', marginRight: 10, fontSize: 14 }}></i>\n 请使用<span style={{ color: '#0A6BFD' }}>小闪扫码</span>登录\n </Flex>\n <QRCode\n icon={qrcode.icon}\n iconSize={qrcode.iconSize ?? 50}\n className={qrcodeClassName}\n size={qrcode.size ?? 240}\n value={qrcodeUrl}\n status={qrcodeStatus}\n onRefresh={handleQrcodeRefresh}\n />\n </div>\n </div>\n )}\n\n {enabledTabKeys.has('sms') && loginType === 'sms' && sms && (\n <SmsLoginForm inputClassName={inputClassName ?? ''} api={sms.api} appKey={sms.appKey} />\n )}\n </LoginForm>\n </div>\n );\n};\n\nexport default LoginModule;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA0B;AAC1B,kBAA4C;AAC5C,mBAAyE;AACzE,0BAAmD;AACnD,2BAAmB;AAkDnB,IAAM,4BAAiD;AAAA,EACrD,SAAS;AAAA,EACT,SAAS;AAAA,EACT,gBAAgB;AAClB;AAEA,IAAM,cAA0C,CAAC,UAAU;AACzD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,qBAAAA,QAAO;AAAA,IACnB,gBAAgB,qBAAAA,QAAO;AAAA,IACvB,gBAAgB,qBAAAA,QAAO;AAAA,IACvB;AAAA,IACA,kBAAkB,qBAAAA,QAAO;AAAA,IACzB,qBAAqB,qBAAAA,QAAO;AAAA,IAC5B;AAAA,EACF,IAAI;AAEJ,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAoB,gBAAgB;AAEtE,QAAM,CAAC,cA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QACP,QAAQ;AAAA,QACR,WAAW;AAAA;AAAA,IACb,CACF,CACF;AAAA,IAGD,eAAe,IAAI,KAAK,KAAK,cAAc,SAAS,OACnD,6BAAAA,QAAA,cAAC,oBAAAC,SAAA,EAAa,gBAAgB,kBAAkB,IAAI,KAAK,IAAI,KAAK,QAAQ,IAAI,QAAQ;AAAA,EAE1F,CACF;AAEJ;AAEA,IAAO,wBAAQ;",
6
+ "names": ["styles", "React", "SmsLoginForm"]
7
+ }
@@ -0,0 +1,169 @@
1
+ .root {
2
+ display: flex;
3
+ flex: 1;
4
+ align-items: center;
5
+ justify-content: center;
6
+
7
+ :global {
8
+ @media (max-width: 768px) {
9
+ .ant-pro-form-login-container {
10
+ padding: 20px !important;
11
+ padding-inline: 0;
12
+ padding-block: 0;
13
+ }
14
+ }
15
+
16
+ .ant-pro-form-login-container {
17
+ border: 1px solid #ececec;
18
+ border-radius: 12px;
19
+ background: #ffffff;
20
+
21
+ .ant-pro-form-login-top {
22
+ margin-bottom: 54px;
23
+
24
+ .ant-pro-form-login-header {
25
+ justify-content: flex-start;
26
+ height: 33px;
27
+ line-height: 33px;
28
+ }
29
+ }
30
+
31
+ .ant-pro-form-login-main {
32
+ width: 100% !important;
33
+ max-width: 500px !important;
34
+ }
35
+
36
+ @media (max-width: 768px) {
37
+ .ant-pro-form-login-main {
38
+ width: 100% !important;
39
+ }
40
+
41
+ .ant-form-item-control-input {
42
+ .ant-input-affix-wrapper {
43
+ width: 100% !important;
44
+ }
45
+ }
46
+ }
47
+
48
+ .ant-pro-form-login-main-other {
49
+ margin-top: 0;
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ .title {
56
+ height: 33px;
57
+ color: #333333;
58
+ font-weight: 600;
59
+ font-size: 24px;
60
+ line-height: 33px;
61
+ }
62
+
63
+ .tabs {
64
+ :global {
65
+ .ant-tabs-nav {
66
+ margin: 0 0 30px 0;
67
+
68
+ .ant-tabs-nav-wrap {
69
+ justify-content: left;
70
+ border-bottom: 1px solid #eeeeee;
71
+
72
+ .ant-tabs-nav-list {
73
+ .ant-tabs-tab {
74
+ padding: 0 0 15px 0;
75
+
76
+ .ant-tabs-tab-btn {
77
+ color: #666666;
78
+ font-weight: 400;
79
+ font-size: 18px;
80
+ line-height: 25px;
81
+ }
82
+
83
+ &.ant-tabs-tab-active {
84
+ .ant-tabs-tab-btn {
85
+ color: #333333;
86
+ font-weight: 600;
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ .form {
97
+ :global {
98
+ width: 100%;
99
+
100
+ .ant-form-item {
101
+ margin-bottom: 20px;
102
+
103
+ .ant-form-item-row {
104
+ .ant-form-item-explain-error {
105
+ font-size: 12px;
106
+ }
107
+
108
+ .ant-form-item-control-input {
109
+ .ant-input-affix-wrapper {
110
+ width: 100%;
111
+ height: 50px;
112
+ background: #fcfcfc;
113
+ border: 1px solid #ececec;
114
+ border-radius: 4px;
115
+
116
+ .ant-input-prefix {
117
+ margin-right: 15px;
118
+ color: #666;
119
+ font-size: 20px;
120
+ }
121
+
122
+ input {
123
+ background: #fcfcfc;
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }
129
+
130
+ .ant-btn-primary {
131
+ width: 100%;
132
+ height: 50px;
133
+ margin-top: 37px;
134
+ margin-bottom: 46px;
135
+ padding: 0;
136
+ color: #ffffff;
137
+ font-weight: 600;
138
+ font-size: 18px;
139
+ line-height: 50px;
140
+ background: linear-gradient(131deg, #1d93ff 0%, #0a6bfd 100%);
141
+ border-radius: 4px;
142
+ }
143
+ }
144
+ }
145
+
146
+ .actions {
147
+ color: #666666;
148
+ font-weight: 400;
149
+ font-size: 14px;
150
+ line-height: 25px;
151
+ }
152
+
153
+ .qrcodeBox {
154
+ padding: 20px 24px;
155
+ border: 1px solid #ececec;
156
+ border-radius: 12px;
157
+ }
158
+
159
+ .qrcode {
160
+ :global {
161
+ border: none !important;
162
+ }
163
+ }
164
+
165
+ .captchaBtn {
166
+ padding: 0;
167
+ color: #0a6bfd;
168
+ }
169
+
@@ -0,0 +1,154 @@
1
+ .codeMirrorCustom {
2
+ width: 100%;
3
+ height: 100%;
4
+ border: 0.5px solid #ecedf1;
5
+
6
+ &.disabled {
7
+ :global {
8
+ .cm-activeLine,
9
+ .cm-activeLineGutter {
10
+ background-color: transparent !important;
11
+ }
12
+ }
13
+ }
14
+
15
+ // CodeMirror 语法高亮样式覆盖
16
+ :global {
17
+ color: #888d9d;
18
+ // 关键字 - 蓝色
19
+ .ͼb {
20
+ color: #997bbf !important;
21
+ font-weight: 400;
22
+ }
23
+
24
+ // 类型名 - 紫色
25
+ .ͼi {
26
+ color: #997bbf !important;
27
+ font-weight: 400;
28
+ }
29
+
30
+ // 字符串 - 绿色
31
+ .ͼc,
32
+ .ͼf,
33
+ .ͼe {
34
+ color: #9dbd93 !important;
35
+ }
36
+
37
+ // 数字 - 橙色
38
+ .ͼd {
39
+ color: #e57271 !important;
40
+ }
41
+
42
+ // 注释 - 灰色
43
+ .ͼm {
44
+ color: #999999 !important;
45
+ font-style: italic;
46
+ }
47
+
48
+ // 变量名 - 黑色
49
+ .ͼg {
50
+ color: #000000 !important;
51
+ }
52
+
53
+ // 表名、列名 - 深绿色
54
+ .ͼh {
55
+ color: #006633 !important;
56
+ }
57
+
58
+ .cm-dynamic-param {
59
+ color: #4484d2 !important;
60
+
61
+ .ͼi,
62
+ .ͼb,
63
+ .ͼc,
64
+ .ͼd,
65
+ .ͼe,
66
+ .ͼf,
67
+ .ͼg,
68
+ .ͼh {
69
+ color: #4484d2 !important;
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ // 自定义关键词高亮样式
76
+ :global {
77
+ .cm-custom-keyword {
78
+ color: #997bbf !important;
79
+ }
80
+
81
+ .cm-editor {
82
+ outline: none !important;
83
+ }
84
+
85
+ .cm-activeLine {
86
+ background-color: rgb(204 238 255 / 60%) !important;
87
+ }
88
+
89
+ // 确保自定义关键词在语法高亮之上
90
+ .cm-editor .cm-line .cm-custom-keyword {
91
+ position: relative;
92
+ z-index: 10;
93
+ }
94
+ }
95
+
96
+ :global {
97
+ .cm-scroller {
98
+ font-size: 12px;
99
+ background-color: #f9fbfc;
100
+ }
101
+
102
+ .cm-gutters {
103
+ background-color: #f6f6f9 !important;
104
+ border: none !important;
105
+ }
106
+
107
+ .cm-gutterElement {
108
+ color: #999 !important;
109
+
110
+ span[title='Fold line'] {
111
+ display: inline-block;
112
+ transform: translateY(-5px);
113
+ }
114
+ }
115
+
116
+ .cm-tooltip {
117
+ padding: 10px !important;
118
+ background-color: #fff !important;
119
+ border: none !important;
120
+ border-radius: 4px !important;
121
+ box-shadow: 0 0 10px 0 rgba(154, 153, 153, 0.2);
122
+
123
+ .cm-completionLabel {
124
+ color: #666 !important;
125
+ }
126
+
127
+ .cm-completionMatchedText {
128
+ color: #ff9600 !important;
129
+ text-decoration: none !important;
130
+ }
131
+ }
132
+
133
+ .cm-tooltip-autocomplete ul li {
134
+ display: flex !important;
135
+ margin-bottom: 5px !important;
136
+ line-height: 30px !important;
137
+ border-radius: 4px !important;
138
+
139
+ .cm-completionDetail {
140
+ margin-left: auto !important;
141
+ padding-right: 10px !important;
142
+ color: #999 !important;
143
+ }
144
+ }
145
+
146
+ .cm-tooltip.cm-tooltip-autocomplete > ul {
147
+ max-height: 220px !important;
148
+ }
149
+
150
+ .cm-tooltip-autocomplete ul li[aria-selected] {
151
+ background-color: #f1f8ff !important;
152
+ }
153
+ }
154
+
@@ -0,0 +1,20 @@
1
+ import { type ReactCodeMirrorRef } from '@uiw/react-codemirror';
2
+ import React from 'react';
3
+ import { type SqlDialectType } from './sql-language';
4
+ export type YkSqlEditProps = {
5
+ value: string;
6
+ previewValue?: string;
7
+ preview?: boolean;
8
+ placeholder?: string;
9
+ height?: string;
10
+ width?: string;
11
+ onChange: (value: string) => void;
12
+ datasourceType?: SqlDialectType;
13
+ keywordOptions?: {
14
+ keywords: string[];
15
+ functions: string[];
16
+ };
17
+ dataTestId?: string;
18
+ };
19
+ declare const YkSqlEdit: React.ForwardRefExoticComponent<YkSqlEditProps & React.RefAttributes<ReactCodeMirrorRef>>;
20
+ export default YkSqlEdit;