yd-admin 0.1.10 → 0.1.12
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/README.md +26 -0
- package/dist/index.js +948 -349
- package/dist/style.css +710 -332
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Fragment, Teleport, Transition, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, isRef, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onMounted, onUnmounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useCssVars, useSlots, vModelCheckbox, vModelDynamic, vModelText, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
2
|
+
import { marked } from "marked";
|
|
3
|
+
import hljs from "highlight.js";
|
|
2
4
|
import AsyncValidator from "async-validator";
|
|
3
5
|
import { createI18n } from "vue-i18n";
|
|
4
6
|
import { createMemoryHistory, createRouter as createVueRouter, createWebHashHistory, createWebHistory } from "vue-router";
|
|
@@ -25,7 +27,8 @@ var __exportAll = (all, no_symbols) => {
|
|
|
25
27
|
*/
|
|
26
28
|
const encoder = new TextEncoder();
|
|
27
29
|
const decoder = new TextDecoder();
|
|
28
|
-
const CRYPTO_SALT = import.meta.env.VITE_CRYPTO_SALT
|
|
30
|
+
const CRYPTO_SALT = import.meta.env.VITE_CRYPTO_SALT;
|
|
31
|
+
if (!CRYPTO_SALT) throw new Error("[crypto] VITE_CRYPTO_SALT 环境变量未配置。请在 .env 文件中设置 VITE_CRYPTO_SALT");
|
|
29
32
|
/**
|
|
30
33
|
* 密钥派生缓存
|
|
31
34
|
* 避免每次加密/解密都重新派生密钥 (PBKDF2 100000 次迭代开销较大)
|
|
@@ -110,11 +113,33 @@ async function decrypt(base64Data, key) {
|
|
|
110
113
|
return null;
|
|
111
114
|
}
|
|
112
115
|
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/utils/secure-storage.ts
|
|
118
|
+
/**
|
|
119
|
+
* 安全存储工具
|
|
120
|
+
* 混合加密策略:
|
|
121
|
+
* - sessionStorage: 使用动态会话密钥 (内存中,刷新即焚)
|
|
122
|
+
* - localStorage: 使用 Vite 环境变量密钥 (防普通篡改)
|
|
123
|
+
*
|
|
124
|
+
* 密钥来源优先级:
|
|
125
|
+
* localStorage: 配置文件 → 运行时 → init配置 → 环境变量 VITE_STORAGE_KEY
|
|
126
|
+
* sessionStorage: 运行时 → init配置 → 动态生成(每次会话)
|
|
127
|
+
*/
|
|
128
|
+
/**
|
|
129
|
+
* 全局密钥存储(用于运行时/API注入)
|
|
130
|
+
*/
|
|
131
|
+
let globalLocalStorageKey = null;
|
|
132
|
+
let globalSessionStorageKey = null;
|
|
113
133
|
/**
|
|
114
134
|
* 配置文件中的密钥缓存
|
|
115
135
|
*/
|
|
116
136
|
let configLocalStorageKey;
|
|
117
137
|
let configSessionStorageKey;
|
|
138
|
+
/**
|
|
139
|
+
* 密钥来源追踪
|
|
140
|
+
*/
|
|
141
|
+
let localKeySource = "default";
|
|
142
|
+
let sessionKeySource = "dynamic";
|
|
118
143
|
let sessionKey = null;
|
|
119
144
|
let sessionKeyIsString = false;
|
|
120
145
|
let storageReadyResolve = null;
|
|
@@ -122,8 +147,57 @@ const storageReady = new Promise((resolve) => {
|
|
|
122
147
|
storageReadyResolve = resolve;
|
|
123
148
|
});
|
|
124
149
|
let localStorageKey = null;
|
|
125
|
-
const ENV_KEY = import.meta.env.VITE_STORAGE_KEY
|
|
126
|
-
const ENV_SESSION_KEY = import.meta.env.VITE_SESSION_STORAGE_KEY
|
|
150
|
+
const ENV_KEY = import.meta.env.VITE_STORAGE_KEY;
|
|
151
|
+
const ENV_SESSION_KEY = import.meta.env.VITE_SESSION_STORAGE_KEY;
|
|
152
|
+
if (import.meta.env.PROD) {
|
|
153
|
+
if (!ENV_KEY) throw new Error("[secure-storage] 生产环境必须配置 VITE_STORAGE_KEY 环境变量");
|
|
154
|
+
if (!ENV_SESSION_KEY) throw new Error("[secure-storage] 生产环境必须配置 VITE_SESSION_STORAGE_KEY 环境变量");
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* 设置 localStorage 运行时密钥
|
|
158
|
+
* @param key 加密密钥
|
|
159
|
+
*/
|
|
160
|
+
function setStorageEncryptionKey(key) {
|
|
161
|
+
globalLocalStorageKey = key;
|
|
162
|
+
localKeySource = "runtime";
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* 设置 sessionStorage 运行时密钥
|
|
166
|
+
* @param key 加密密钥
|
|
167
|
+
*/
|
|
168
|
+
function setSessionStorageEncryptionKey(key) {
|
|
169
|
+
globalSessionStorageKey = key;
|
|
170
|
+
sessionKeySource = "runtime";
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* 获取密钥来源
|
|
174
|
+
* @param type 存储类型
|
|
175
|
+
* @returns 密钥来源
|
|
176
|
+
*/
|
|
177
|
+
function getKeySource(type) {
|
|
178
|
+
return type === "local" ? localKeySource : sessionKeySource;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* 重置密钥
|
|
182
|
+
* @param type 存储类型
|
|
183
|
+
*/
|
|
184
|
+
function resetStorageKey(type) {
|
|
185
|
+
if (type === "local") {
|
|
186
|
+
globalLocalStorageKey = null;
|
|
187
|
+
localKeySource = "dynamic";
|
|
188
|
+
} else {
|
|
189
|
+
globalSessionStorageKey = null;
|
|
190
|
+
sessionKeySource = "dynamic";
|
|
191
|
+
sessionKey = null;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* 检查存储是否就绪
|
|
196
|
+
* @returns 是否就绪
|
|
197
|
+
*/
|
|
198
|
+
function isStorageReady() {
|
|
199
|
+
return !!localStorageKey || !!sessionKey || !!globalLocalStorageKey || !!globalSessionStorageKey;
|
|
200
|
+
}
|
|
127
201
|
/**
|
|
128
202
|
* 从配置文件加载密钥
|
|
129
203
|
* @param filePath 配置文件路径,默认 config/storage.json
|
|
@@ -153,6 +227,10 @@ async function loadKeyFromConfig(filePath) {
|
|
|
153
227
|
* 解析 localStorage 密钥(按优先级)
|
|
154
228
|
*/
|
|
155
229
|
async function resolveLocalKey(config) {
|
|
230
|
+
if (globalLocalStorageKey) return {
|
|
231
|
+
key: globalLocalStorageKey,
|
|
232
|
+
source: "runtime"
|
|
233
|
+
};
|
|
156
234
|
if (config?.localStorageKey || config?.storageKey) return {
|
|
157
235
|
key: config.localStorageKey || config.storageKey,
|
|
158
236
|
source: "init"
|
|
@@ -168,7 +246,7 @@ async function resolveLocalKey(config) {
|
|
|
168
246
|
source: "env"
|
|
169
247
|
};
|
|
170
248
|
return {
|
|
171
|
-
key: ENV_KEY,
|
|
249
|
+
key: (import.meta.env.DEV ? "yd-admin-dev-local-key" : "") || ENV_KEY,
|
|
172
250
|
source: "default"
|
|
173
251
|
};
|
|
174
252
|
}
|
|
@@ -176,6 +254,10 @@ async function resolveLocalKey(config) {
|
|
|
176
254
|
* 解析 sessionStorage 密钥(按优先级)
|
|
177
255
|
*/
|
|
178
256
|
async function resolveSessionKey(config) {
|
|
257
|
+
if (globalSessionStorageKey) return {
|
|
258
|
+
key: globalSessionStorageKey,
|
|
259
|
+
source: "runtime"
|
|
260
|
+
};
|
|
179
261
|
if (config?.sessionStorageKey || config?.storageKey) return {
|
|
180
262
|
key: config.sessionStorageKey || config.storageKey,
|
|
181
263
|
source: "init"
|
|
@@ -192,7 +274,7 @@ async function resolveSessionKey(config) {
|
|
|
192
274
|
source: "env"
|
|
193
275
|
};
|
|
194
276
|
return {
|
|
195
|
-
key: ENV_SESSION_KEY,
|
|
277
|
+
key: (import.meta.env.DEV ? "yd-admin-dev-session-key" : "") || ENV_SESSION_KEY,
|
|
196
278
|
source: "dynamic"
|
|
197
279
|
};
|
|
198
280
|
}
|
|
@@ -202,14 +284,18 @@ async function resolveSessionKey(config) {
|
|
|
202
284
|
* @param config 可选的初始化配置
|
|
203
285
|
*/
|
|
204
286
|
async function initSecureStorage(config) {
|
|
205
|
-
|
|
206
|
-
|
|
287
|
+
const localResolved = await resolveLocalKey(config);
|
|
288
|
+
localStorageKey = localResolved.key;
|
|
289
|
+
localKeySource = localResolved.source;
|
|
290
|
+
const sessionResolved = await resolveSessionKey(config);
|
|
291
|
+
if (sessionResolved.source === "dynamic") {
|
|
207
292
|
sessionKey = await generateSessionKey();
|
|
208
293
|
sessionKeyIsString = false;
|
|
209
294
|
} else {
|
|
210
295
|
sessionKey = null;
|
|
211
296
|
sessionKeyIsString = true;
|
|
212
297
|
}
|
|
298
|
+
sessionKeySource = sessionResolved.source;
|
|
213
299
|
if (storageReadyResolve) {
|
|
214
300
|
storageReadyResolve();
|
|
215
301
|
storageReadyResolve = null;
|
|
@@ -235,7 +321,7 @@ var SecureStorage = class {
|
|
|
235
321
|
* 是否就绪
|
|
236
322
|
*/
|
|
237
323
|
get ready() {
|
|
238
|
-
return this.storageType === "session" ? !!sessionKey || !!ENV_SESSION_KEY : !!localStorageKey || !!ENV_KEY;
|
|
324
|
+
return this.storageType === "session" ? !!sessionKey || !!globalSessionStorageKey || !!ENV_SESSION_KEY : !!localStorageKey || !!ENV_KEY;
|
|
239
325
|
}
|
|
240
326
|
/**
|
|
241
327
|
* 获取密钥(根据存储类型)
|
|
@@ -245,6 +331,7 @@ var SecureStorage = class {
|
|
|
245
331
|
if (this.storageType === "session") {
|
|
246
332
|
if (sessionKey) return sessionKey;
|
|
247
333
|
if (sessionKeyIsString) {
|
|
334
|
+
if (globalSessionStorageKey) return globalSessionStorageKey;
|
|
248
335
|
if (import.meta.env.VITE_SESSION_STORAGE_KEY) return import.meta.env.VITE_SESSION_STORAGE_KEY;
|
|
249
336
|
}
|
|
250
337
|
return ENV_SESSION_KEY;
|
|
@@ -259,7 +346,7 @@ var SecureStorage = class {
|
|
|
259
346
|
*/
|
|
260
347
|
async setItem(key, value, options) {
|
|
261
348
|
const currentKey = this.getCurrentKey();
|
|
262
|
-
if (this.storageType === "session" && !sessionKey &&
|
|
349
|
+
if (this.storageType === "session" && !sessionKey && !globalSessionStorageKey) {
|
|
263
350
|
console.warn(`[secureStorage] sessionStorage key not ready, write "${key}" skipped`);
|
|
264
351
|
return;
|
|
265
352
|
}
|
|
@@ -355,8 +442,90 @@ var SecureStorage = class {
|
|
|
355
442
|
this.storage.clear();
|
|
356
443
|
}
|
|
357
444
|
};
|
|
445
|
+
/**
|
|
446
|
+
* 创建独立的 SecureStorage 实例
|
|
447
|
+
* @param type 存储类型
|
|
448
|
+
* @param key 可选的独立密钥
|
|
449
|
+
* @returns SecureStorage 实例
|
|
450
|
+
*/
|
|
451
|
+
function createSecureStorage(type, key) {
|
|
452
|
+
const instance = new SecureStorage(type);
|
|
453
|
+
if (key) if (type === "local") setStorageEncryptionKey(key);
|
|
454
|
+
else setSessionStorageEncryptionKey(key);
|
|
455
|
+
return instance;
|
|
456
|
+
}
|
|
358
457
|
const secureLocal = new SecureStorage("local");
|
|
359
458
|
const secureSession = new SecureStorage("session");
|
|
459
|
+
/**
|
|
460
|
+
* 密钥轮换
|
|
461
|
+
* @param type 存储类型
|
|
462
|
+
* @param newKey 新密钥
|
|
463
|
+
*/
|
|
464
|
+
async function rotateStorageKey(type, newKey) {
|
|
465
|
+
const storage = type === "local" ? localStorage : sessionStorage;
|
|
466
|
+
const keys = [];
|
|
467
|
+
for (let i = 0; i < storage.length; i++) keys.push(storage.key(i));
|
|
468
|
+
if (type === "local") {
|
|
469
|
+
const oldKey = globalLocalStorageKey || localStorageKey || ENV_KEY;
|
|
470
|
+
globalLocalStorageKey = newKey;
|
|
471
|
+
localKeySource = "runtime";
|
|
472
|
+
for (const key of keys) try {
|
|
473
|
+
const encrypted = storage.getItem(key);
|
|
474
|
+
if (!encrypted) continue;
|
|
475
|
+
const decrypted = await decrypt(encrypted, oldKey);
|
|
476
|
+
if (!decrypted) continue;
|
|
477
|
+
const reEncrypted = await encrypt(decrypted, newKey);
|
|
478
|
+
storage.setItem(key, reEncrypted);
|
|
479
|
+
} catch {}
|
|
480
|
+
} else {
|
|
481
|
+
const oldKey = globalSessionStorageKey || ENV_SESSION_KEY;
|
|
482
|
+
globalSessionStorageKey = newKey;
|
|
483
|
+
sessionKeySource = "runtime";
|
|
484
|
+
for (const key of keys) try {
|
|
485
|
+
const encrypted = storage.getItem(key);
|
|
486
|
+
if (!encrypted) continue;
|
|
487
|
+
const decrypted = await decrypt(encrypted, oldKey);
|
|
488
|
+
if (!decrypted) continue;
|
|
489
|
+
const reEncrypted = await encrypt(decrypted, newKey);
|
|
490
|
+
storage.setItem(key, reEncrypted);
|
|
491
|
+
} catch {}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* 生成 HMAC 签名
|
|
496
|
+
* @param data 数据字符串
|
|
497
|
+
* @param key 密钥
|
|
498
|
+
* @returns 签名
|
|
499
|
+
*/
|
|
500
|
+
async function signData(data, key) {
|
|
501
|
+
const encoder = new TextEncoder();
|
|
502
|
+
const keyData = await crypto.subtle.importKey("raw", encoder.encode(key), {
|
|
503
|
+
name: "HMAC",
|
|
504
|
+
hash: "SHA-256"
|
|
505
|
+
}, false, ["sign"]);
|
|
506
|
+
const signature = await crypto.subtle.sign("HMAC", keyData, encoder.encode(data));
|
|
507
|
+
return btoa(String.fromCharCode(...new Uint8Array(signature)));
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* 验证签名
|
|
511
|
+
* @param data 数据字符串
|
|
512
|
+
* @param signature 签名
|
|
513
|
+
* @param key 密钥
|
|
514
|
+
* @returns 是否有效
|
|
515
|
+
*/
|
|
516
|
+
async function verifyData(data, signature, key) {
|
|
517
|
+
try {
|
|
518
|
+
const encoder = new TextEncoder();
|
|
519
|
+
const keyData = await crypto.subtle.importKey("raw", encoder.encode(key), {
|
|
520
|
+
name: "HMAC",
|
|
521
|
+
hash: "SHA-256"
|
|
522
|
+
}, false, ["verify"]);
|
|
523
|
+
const signatureBytes = Uint8Array.from(atob(signature), (c) => c.charCodeAt(0));
|
|
524
|
+
return crypto.subtle.verify("HMAC", keyData, signatureBytes, encoder.encode(data));
|
|
525
|
+
} catch {
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
360
529
|
//#endregion
|
|
361
530
|
//#region src/utils/router.ts
|
|
362
531
|
/**
|
|
@@ -490,11 +659,10 @@ var DynamicRouter = class {
|
|
|
490
659
|
return result;
|
|
491
660
|
}
|
|
492
661
|
/**
|
|
493
|
-
* 路径匹配
|
|
662
|
+
* 路径匹配 (复用 isPathMatch 函数)
|
|
494
663
|
*/
|
|
495
664
|
matchPath(path, pattern) {
|
|
496
|
-
|
|
497
|
-
return pattern.test(path);
|
|
665
|
+
return isPathMatch(path, pattern);
|
|
498
666
|
}
|
|
499
667
|
/**
|
|
500
668
|
* 查找路由名称
|
|
@@ -680,12 +848,12 @@ var export_helper_default = (sfc, props) => {
|
|
|
680
848
|
};
|
|
681
849
|
//#endregion
|
|
682
850
|
//#region src/components/base/button/button.vue
|
|
683
|
-
const _hoisted_1$
|
|
684
|
-
const _hoisted_2$
|
|
851
|
+
const _hoisted_1$58 = ["disabled", "type"];
|
|
852
|
+
const _hoisted_2$38 = {
|
|
685
853
|
key: 0,
|
|
686
854
|
class: "yd-button__loading"
|
|
687
855
|
};
|
|
688
|
-
const _hoisted_3$
|
|
856
|
+
const _hoisted_3$29 = { class: "yd-button__content" };
|
|
689
857
|
var button_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
690
858
|
name: "YdButton",
|
|
691
859
|
__name: "button",
|
|
@@ -730,7 +898,7 @@ var button_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
730
898
|
disabled: __props.disabled || __props.loading,
|
|
731
899
|
type: __props.nativeType,
|
|
732
900
|
onClick: handleClick
|
|
733
|
-
}, [__props.loading ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
901
|
+
}, [__props.loading ? (openBlock(), createElementBlock("span", _hoisted_2$38, [..._cache[0] || (_cache[0] = [createElementVNode("svg", {
|
|
734
902
|
class: "yd-button__spinner",
|
|
735
903
|
viewBox: "0 0 24 24"
|
|
736
904
|
}, [createElementVNode("circle", {
|
|
@@ -742,7 +910,7 @@ var button_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
742
910
|
"stroke-width": "3",
|
|
743
911
|
"stroke-dasharray": "31.4 31.4",
|
|
744
912
|
"stroke-linecap": "round"
|
|
745
|
-
})], -1)])])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_3$
|
|
913
|
+
})], -1)])])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_3$29, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 10, _hoisted_1$58);
|
|
746
914
|
};
|
|
747
915
|
}
|
|
748
916
|
}), [["__scopeId", "data-v-08fa2dc1"]]);
|
|
@@ -775,7 +943,7 @@ function getIconRegistry() {
|
|
|
775
943
|
}
|
|
776
944
|
//#endregion
|
|
777
945
|
//#region src/components/base/icon/icon.vue
|
|
778
|
-
const _hoisted_1$
|
|
946
|
+
const _hoisted_1$57 = ["innerHTML"];
|
|
779
947
|
var icon_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
780
948
|
name: "YdIcon",
|
|
781
949
|
inheritAttrs: false,
|
|
@@ -797,9 +965,20 @@ var icon_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
797
965
|
function e(element) {
|
|
798
966
|
return `yd-icon__${element}`;
|
|
799
967
|
}
|
|
968
|
+
/**
|
|
969
|
+
* 清理 SVG 内容以防止 XSS 攻击
|
|
970
|
+
* 移除 script 标签、事件处理器等危险内容
|
|
971
|
+
*/
|
|
972
|
+
function sanitizeSvg(svg) {
|
|
973
|
+
let cleaned = svg.replace(/<script[\s\S]*?<\/script>/gi, "");
|
|
974
|
+
cleaned = cleaned.replace(/\s*on\w+\s*=\s*(["'])[^"']*\1/gi, "");
|
|
975
|
+
cleaned = cleaned.replace(/javascript:/gi, "");
|
|
976
|
+
cleaned = cleaned.replace(/data:/gi, "");
|
|
977
|
+
return cleaned;
|
|
978
|
+
}
|
|
800
979
|
const svgContent = computed(() => {
|
|
801
980
|
if (!props.name) return "";
|
|
802
|
-
if (props.name.includes("<svg") || props.name.includes("<path")) return props.name;
|
|
981
|
+
if (props.name.includes("<svg") || props.name.includes("<path")) return sanitizeSvg(props.name);
|
|
803
982
|
return getIcon(props.name) || "";
|
|
804
983
|
});
|
|
805
984
|
const iconStyle = computed(() => {
|
|
@@ -825,13 +1004,13 @@ var icon_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
825
1004
|
fill: "none",
|
|
826
1005
|
xmlns: "http://www.w3.org/2000/svg",
|
|
827
1006
|
innerHTML: svgContent.value
|
|
828
|
-
}, null, 10, _hoisted_1$
|
|
1007
|
+
}, null, 10, _hoisted_1$57)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Slot Fallback "), renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2112))], 16);
|
|
829
1008
|
};
|
|
830
1009
|
}
|
|
831
|
-
}), [["__scopeId", "data-v-
|
|
1010
|
+
}), [["__scopeId", "data-v-bb6b8302"]]);
|
|
832
1011
|
//#endregion
|
|
833
1012
|
//#region src/components/base/input/input.vue
|
|
834
|
-
const _hoisted_1$
|
|
1013
|
+
const _hoisted_1$56 = [
|
|
835
1014
|
"type",
|
|
836
1015
|
"value",
|
|
837
1016
|
"placeholder",
|
|
@@ -940,7 +1119,7 @@ var input_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
940
1119
|
onFocus: handleFocus,
|
|
941
1120
|
onBlur: handleBlur,
|
|
942
1121
|
onKeydown: handleKeydown
|
|
943
|
-
}, null, 42, _hoisted_1$
|
|
1122
|
+
}, null, 42, _hoisted_1$56),
|
|
944
1123
|
__props.clearable && __props.modelValue && !__props.disabled ? (openBlock(), createElementBlock("span", {
|
|
945
1124
|
key: 1,
|
|
946
1125
|
class: normalizeClass(e("clear")),
|
|
@@ -963,7 +1142,7 @@ var input_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
963
1142
|
}), [["__scopeId", "data-v-5c21184f"]]);
|
|
964
1143
|
//#endregion
|
|
965
1144
|
//#region src/components/base/textarea/textarea.vue
|
|
966
|
-
const _hoisted_1$
|
|
1145
|
+
const _hoisted_1$55 = [
|
|
967
1146
|
"value",
|
|
968
1147
|
"placeholder",
|
|
969
1148
|
"disabled",
|
|
@@ -1057,7 +1236,7 @@ var textarea_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
1057
1236
|
onChange: handleChange,
|
|
1058
1237
|
onFocus: handleFocus,
|
|
1059
1238
|
onBlur: handleBlur
|
|
1060
|
-
}, null, 42, _hoisted_1$
|
|
1239
|
+
}, null, 42, _hoisted_1$55), __props.showWordLimit && __props.maxlength ? (openBlock(), createElementBlock("span", {
|
|
1061
1240
|
key: 0,
|
|
1062
1241
|
class: normalizeClass(e("word-limit"))
|
|
1063
1242
|
}, toDisplayString(String(__props.modelValue).length) + "/" + toDisplayString(__props.maxlength), 3)) : createCommentVNode("v-if", true)], 2);
|
|
@@ -1066,9 +1245,9 @@ var textarea_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
1066
1245
|
}), [["__scopeId", "data-v-13af2da6"]]);
|
|
1067
1246
|
//#endregion
|
|
1068
1247
|
//#region src/components/base/input-number/input-number.vue
|
|
1069
|
-
const _hoisted_1$
|
|
1070
|
-
const _hoisted_2$
|
|
1071
|
-
const _hoisted_3$
|
|
1248
|
+
const _hoisted_1$54 = ["disabled"];
|
|
1249
|
+
const _hoisted_2$37 = ["value", "disabled"];
|
|
1250
|
+
const _hoisted_3$28 = ["disabled"];
|
|
1072
1251
|
var input_number_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1073
1252
|
name: "YdInputNumber",
|
|
1074
1253
|
__name: "input-number",
|
|
@@ -1163,7 +1342,7 @@ var input_number_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
1163
1342
|
y1: "12",
|
|
1164
1343
|
x2: "19",
|
|
1165
1344
|
y2: "12"
|
|
1166
|
-
})], -1)])], 10, _hoisted_1$
|
|
1345
|
+
})], -1)])], 10, _hoisted_1$54),
|
|
1167
1346
|
createElementVNode("input", {
|
|
1168
1347
|
ref_key: "inputRef",
|
|
1169
1348
|
ref: inputRef,
|
|
@@ -1174,7 +1353,7 @@ var input_number_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
1174
1353
|
onInput: handleInput,
|
|
1175
1354
|
onBlur: handleBlur,
|
|
1176
1355
|
onKeydown: handleKeydown
|
|
1177
|
-
}, null, 42, _hoisted_2$
|
|
1356
|
+
}, null, 42, _hoisted_2$37),
|
|
1178
1357
|
createElementVNode("button", {
|
|
1179
1358
|
class: normalizeClass(e("btn")),
|
|
1180
1359
|
disabled: __props.disabled || __props.modelValue >= __props.max,
|
|
@@ -1199,7 +1378,7 @@ var input_number_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
1199
1378
|
y1: "12",
|
|
1200
1379
|
x2: "19",
|
|
1201
1380
|
y2: "12"
|
|
1202
|
-
})], -1)])], 10, _hoisted_3$
|
|
1381
|
+
})], -1)])], 10, _hoisted_3$28)
|
|
1203
1382
|
], 2)], 2);
|
|
1204
1383
|
};
|
|
1205
1384
|
}
|
|
@@ -1251,13 +1430,13 @@ var empty_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
1251
1430
|
}), [["__scopeId", "data-v-ed413d74"]]);
|
|
1252
1431
|
//#endregion
|
|
1253
1432
|
//#region src/components/base/select/select.vue
|
|
1254
|
-
const _hoisted_1$
|
|
1433
|
+
const _hoisted_1$53 = [
|
|
1255
1434
|
"value",
|
|
1256
1435
|
"placeholder",
|
|
1257
1436
|
"disabled"
|
|
1258
1437
|
];
|
|
1259
|
-
const _hoisted_2$
|
|
1260
|
-
const _hoisted_3$
|
|
1438
|
+
const _hoisted_2$36 = ["onClick"];
|
|
1439
|
+
const _hoisted_3$27 = ["onClick"];
|
|
1261
1440
|
var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1262
1441
|
name: "YdSelect",
|
|
1263
1442
|
inheritAttrs: false,
|
|
@@ -1308,7 +1487,7 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
1308
1487
|
"blur",
|
|
1309
1488
|
"search"
|
|
1310
1489
|
],
|
|
1311
|
-
setup(__props, { emit: __emit }) {
|
|
1490
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1312
1491
|
const props = __props;
|
|
1313
1492
|
const emit = __emit;
|
|
1314
1493
|
const selectRef = ref();
|
|
@@ -1459,6 +1638,22 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
1459
1638
|
window.removeEventListener("scroll", handleWindowScroll, true);
|
|
1460
1639
|
window.removeEventListener("resize", handleWindowResize);
|
|
1461
1640
|
});
|
|
1641
|
+
__expose({
|
|
1642
|
+
focus: () => {
|
|
1643
|
+
(selectRef.value?.querySelector("input"))?.focus();
|
|
1644
|
+
},
|
|
1645
|
+
blur: () => {
|
|
1646
|
+
(selectRef.value?.querySelector("input"))?.blur();
|
|
1647
|
+
},
|
|
1648
|
+
getValue: () => props.modelValue,
|
|
1649
|
+
getLabel: () => selectedLabel.value,
|
|
1650
|
+
open: () => {
|
|
1651
|
+
visible.value = true;
|
|
1652
|
+
},
|
|
1653
|
+
close: () => {
|
|
1654
|
+
visible.value = false;
|
|
1655
|
+
}
|
|
1656
|
+
});
|
|
1462
1657
|
return (_ctx, _cache) => {
|
|
1463
1658
|
return openBlock(), createElementBlock("div", {
|
|
1464
1659
|
ref_key: "selectRef",
|
|
@@ -1484,7 +1679,7 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
1484
1679
|
onFocus: handleFocus,
|
|
1485
1680
|
onBlur: handleBlur,
|
|
1486
1681
|
onKeydown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
|
|
1487
|
-
}, null, 42, _hoisted_1$
|
|
1682
|
+
}, null, 42, _hoisted_1$53)) : (openBlock(), createElementBlock("div", {
|
|
1488
1683
|
key: 1,
|
|
1489
1684
|
class: normalizeClass([e("display"), { [e("display--placeholder")]: !selectedLabel.value }])
|
|
1490
1685
|
}, toDisplayString(selectedLabel.value || __props.placeholder), 3)),
|
|
@@ -1537,7 +1732,7 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
1537
1732
|
}, [createElementVNode("span", null, toDisplayString(opt.label), 1), isSelected(opt.value) ? (openBlock(), createElementBlock("span", {
|
|
1538
1733
|
key: 0,
|
|
1539
1734
|
class: normalizeClass(e("check"))
|
|
1540
|
-
}, "✓", 2)) : createCommentVNode("v-if", true)], 10, _hoisted_2$
|
|
1735
|
+
}, "✓", 2)) : createCommentVNode("v-if", true)], 10, _hoisted_2$36);
|
|
1541
1736
|
}), 128))], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Option "), createElementVNode("div", {
|
|
1542
1737
|
class: normalizeClass([e("option"), {
|
|
1543
1738
|
[e("option--active")]: isSelected(option.value),
|
|
@@ -1547,17 +1742,17 @@ var select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
1547
1742
|
}, [createElementVNode("span", null, toDisplayString(option.label), 1), isSelected(option.value) ? (openBlock(), createElementBlock("span", {
|
|
1548
1743
|
key: 0,
|
|
1549
1744
|
class: normalizeClass(e("check"))
|
|
1550
|
-
}, "✓", 2)) : createCommentVNode("v-if", true)], 10, _hoisted_3$
|
|
1745
|
+
}, "✓", 2)) : createCommentVNode("v-if", true)], 10, _hoisted_3$27)], 2112))], 64);
|
|
1551
1746
|
}), 128))], 6))], 6)) : createCommentVNode("v-if", true)]),
|
|
1552
1747
|
_: 1
|
|
1553
1748
|
})]))
|
|
1554
1749
|
], 2);
|
|
1555
1750
|
};
|
|
1556
1751
|
}
|
|
1557
|
-
}), [["__scopeId", "data-v-
|
|
1752
|
+
}), [["__scopeId", "data-v-8cade129"]]);
|
|
1558
1753
|
//#endregion
|
|
1559
1754
|
//#region src/components/base/switch/switch.vue
|
|
1560
|
-
const _hoisted_1$
|
|
1755
|
+
const _hoisted_1$52 = ["aria-checked", "disabled"];
|
|
1561
1756
|
var switch_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1562
1757
|
name: "YdSwitch",
|
|
1563
1758
|
__name: "switch",
|
|
@@ -1593,13 +1788,13 @@ var switch_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
1593
1788
|
class: normalizeClass(switchClasses.value),
|
|
1594
1789
|
disabled: __props.disabled,
|
|
1595
1790
|
onClick: toggle
|
|
1596
|
-
}, [createElementVNode("span", { class: normalizeClass(e("thumb")) }, null, 2)], 10, _hoisted_1$
|
|
1791
|
+
}, [createElementVNode("span", { class: normalizeClass(e("thumb")) }, null, 2)], 10, _hoisted_1$52);
|
|
1597
1792
|
};
|
|
1598
1793
|
}
|
|
1599
1794
|
}), [["__scopeId", "data-v-178da0de"]]);
|
|
1600
1795
|
//#endregion
|
|
1601
1796
|
//#region src/components/base/checkbox/checkbox.vue
|
|
1602
|
-
const _hoisted_1$
|
|
1797
|
+
const _hoisted_1$51 = [
|
|
1603
1798
|
"checked",
|
|
1604
1799
|
"disabled",
|
|
1605
1800
|
"value"
|
|
@@ -1652,7 +1847,7 @@ var checkbox_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
1652
1847
|
disabled: __props.disabled,
|
|
1653
1848
|
value: __props.value,
|
|
1654
1849
|
onChange: handleChange
|
|
1655
|
-
}, null, 42, _hoisted_1$
|
|
1850
|
+
}, null, 42, _hoisted_1$51),
|
|
1656
1851
|
createElementVNode("span", { class: normalizeClass(e("box")) }, [__props.modelValue ? (openBlock(), createElementBlock("svg", {
|
|
1657
1852
|
key: 0,
|
|
1658
1853
|
class: normalizeClass(e("icon")),
|
|
@@ -1719,7 +1914,7 @@ var checkbox_group_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
|
|
|
1719
1914
|
}), [["__scopeId", "data-v-3dce3e2c"]]);
|
|
1720
1915
|
//#endregion
|
|
1721
1916
|
//#region src/components/base/radio/radio.vue
|
|
1722
|
-
const _hoisted_1$
|
|
1917
|
+
const _hoisted_1$50 = [
|
|
1723
1918
|
"checked",
|
|
1724
1919
|
"disabled",
|
|
1725
1920
|
"value",
|
|
@@ -1775,7 +1970,7 @@ var radio_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
1775
1970
|
value: __props.value,
|
|
1776
1971
|
name: __props.name,
|
|
1777
1972
|
onChange: handleChange
|
|
1778
|
-
}, null, 42, _hoisted_1$
|
|
1973
|
+
}, null, 42, _hoisted_1$50),
|
|
1779
1974
|
createElementVNode("span", { class: normalizeClass(e("dot")) }, null, 2),
|
|
1780
1975
|
_ctx.$slots.default || __props.label ? (openBlock(), createElementBlock("span", {
|
|
1781
1976
|
key: 0,
|
|
@@ -1895,7 +2090,7 @@ var tag_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineCo
|
|
|
1895
2090
|
}), [["__scopeId", "data-v-ae4235fd"]]);
|
|
1896
2091
|
//#endregion
|
|
1897
2092
|
//#region src/components/base/avatar/avatar.vue
|
|
1898
|
-
const _hoisted_1$
|
|
2093
|
+
const _hoisted_1$49 = ["src", "alt"];
|
|
1899
2094
|
var avatar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1900
2095
|
name: "YdAvatar",
|
|
1901
2096
|
__name: "avatar",
|
|
@@ -1923,7 +2118,7 @@ var avatar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
1923
2118
|
src: __props.src,
|
|
1924
2119
|
alt: __props.alt,
|
|
1925
2120
|
onError: handleError
|
|
1926
|
-
}, null, 40, _hoisted_1$
|
|
2121
|
+
}, null, 40, _hoisted_1$49)) : _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
|
|
1927
2122
|
key: 1,
|
|
1928
2123
|
class: normalizeClass(e("text"))
|
|
1929
2124
|
}, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2)) : (openBlock(), createElementBlock("span", {
|
|
@@ -1983,7 +2178,7 @@ var badge_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
1983
2178
|
}), [["__scopeId", "data-v-9b63f1ae"]]);
|
|
1984
2179
|
//#endregion
|
|
1985
2180
|
//#region src/components/base/rate/rate.vue
|
|
1986
|
-
const _hoisted_1$
|
|
2181
|
+
const _hoisted_1$48 = ["onClick", "onMouseenter"];
|
|
1987
2182
|
var rate_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1988
2183
|
name: "YdRate",
|
|
1989
2184
|
__name: "rate",
|
|
@@ -2048,7 +2243,7 @@ var rate_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
2048
2243
|
viewBox: "0 0 24 24",
|
|
2049
2244
|
fill: "currentColor",
|
|
2050
2245
|
stroke: "none"
|
|
2051
|
-
}, [..._cache[1] || (_cache[1] = [createElementVNode("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }, null, -1)])], 2))], 42, _hoisted_1$
|
|
2246
|
+
}, [..._cache[1] || (_cache[1] = [createElementVNode("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }, null, -1)])], 2))], 42, _hoisted_1$48);
|
|
2052
2247
|
}), 128)), __props.showText ? (openBlock(), createElementBlock("span", {
|
|
2053
2248
|
key: 0,
|
|
2054
2249
|
class: normalizeClass(e("text"))
|
|
@@ -2137,14 +2332,14 @@ var slider_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
2137
2332
|
}), [["__scopeId", "data-v-51e82523"]]);
|
|
2138
2333
|
//#endregion
|
|
2139
2334
|
//#region src/components/base/date-picker/date-picker.vue
|
|
2140
|
-
const _hoisted_1$
|
|
2335
|
+
const _hoisted_1$47 = [
|
|
2141
2336
|
"value",
|
|
2142
2337
|
"placeholder",
|
|
2143
2338
|
"disabled"
|
|
2144
2339
|
];
|
|
2145
|
-
const _hoisted_2$
|
|
2146
|
-
const _hoisted_3$
|
|
2147
|
-
const _hoisted_4$
|
|
2340
|
+
const _hoisted_2$35 = ["onClick"];
|
|
2341
|
+
const _hoisted_3$26 = ["onClick"];
|
|
2342
|
+
const _hoisted_4$24 = ["disabled", "onClick"];
|
|
2148
2343
|
var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2149
2344
|
name: "YdDatePicker",
|
|
2150
2345
|
__name: "date-picker",
|
|
@@ -2158,7 +2353,7 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
2158
2353
|
type: { default: "date" }
|
|
2159
2354
|
},
|
|
2160
2355
|
emits: ["update:modelValue", "change"],
|
|
2161
|
-
setup(__props, { emit: __emit }) {
|
|
2356
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2162
2357
|
const props = __props;
|
|
2163
2358
|
const emit = __emit;
|
|
2164
2359
|
const visible = ref(false);
|
|
@@ -2335,6 +2530,17 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
2335
2530
|
document.removeEventListener("click", handleClickOutside);
|
|
2336
2531
|
window.removeEventListener("scroll", debouncedScrollHandler, true);
|
|
2337
2532
|
});
|
|
2533
|
+
__expose({
|
|
2534
|
+
open: () => {
|
|
2535
|
+
visible.value = true;
|
|
2536
|
+
},
|
|
2537
|
+
close: () => {
|
|
2538
|
+
visible.value = false;
|
|
2539
|
+
},
|
|
2540
|
+
focus: () => {
|
|
2541
|
+
triggerRef.value?.querySelector("input")?.focus();
|
|
2542
|
+
}
|
|
2543
|
+
});
|
|
2338
2544
|
return (_ctx, _cache) => {
|
|
2339
2545
|
return openBlock(), createElementBlock("div", {
|
|
2340
2546
|
class: normalizeClass(unref(cn)("yd-date-picker")),
|
|
@@ -2348,7 +2554,7 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
2348
2554
|
disabled: __props.disabled,
|
|
2349
2555
|
readonly: "",
|
|
2350
2556
|
onClick: withModifiers(togglePicker, ["stop"])
|
|
2351
|
-
}, null, 10, _hoisted_1$
|
|
2557
|
+
}, null, 10, _hoisted_1$47),
|
|
2352
2558
|
createElementVNode("span", {
|
|
2353
2559
|
class: normalizeClass(e("icon")),
|
|
2354
2560
|
onClick: withModifiers(togglePicker, ["stop"])
|
|
@@ -2372,13 +2578,13 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
2372
2578
|
key: y,
|
|
2373
2579
|
class: normalizeClass([e("year"), { [e("year--selected")]: selectedYear.value === y }]),
|
|
2374
2580
|
onClick: withModifiers(($event) => selectYear(y), ["stop"])
|
|
2375
|
-
}, toDisplayString(y), 11, _hoisted_2$
|
|
2581
|
+
}, toDisplayString(y), 11, _hoisted_2$35);
|
|
2376
2582
|
}), 128))], 2)], 2)) : view.value === "month" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Month selection "), createElementVNode("div", { class: normalizeClass(e("view")) }, [createElementVNode("div", { class: normalizeClass(e("view-header")) }, [createElementVNode("button", { onClick: _cache[0] || (_cache[0] = withModifiers(($event) => view.value = "year", ["stop"])) }, toDisplayString(selectedYear.value), 1)], 2), createElementVNode("div", { class: normalizeClass(e("months")) }, [(openBlock(), createElementBlock(Fragment, null, renderList(months, (m, i) => {
|
|
2377
2583
|
return createElementVNode("button", {
|
|
2378
2584
|
key: i,
|
|
2379
2585
|
class: normalizeClass([e("month"), { [e("month--selected")]: selectedMonth.value === i }]),
|
|
2380
2586
|
onClick: withModifiers(($event) => selectMonth(i), ["stop"])
|
|
2381
|
-
}, toDisplayString(m), 11, _hoisted_3$
|
|
2587
|
+
}, toDisplayString(m), 11, _hoisted_3$26);
|
|
2382
2588
|
}), 64))], 2)], 2)], 2112)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" Date selection "), createElementVNode("div", { class: normalizeClass(e("view")) }, [
|
|
2383
2589
|
createElementVNode("div", { class: normalizeClass(e("header")) }, [
|
|
2384
2590
|
createElementVNode("button", { onClick: withModifiers(prevMonth, ["stop"]) }, "‹"),
|
|
@@ -2409,21 +2615,21 @@ var date_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
2409
2615
|
}]),
|
|
2410
2616
|
disabled: !day.current,
|
|
2411
2617
|
onClick: withModifiers(($event) => selectDate(day), ["stop"])
|
|
2412
|
-
}, toDisplayString(day.date.getDate()), 11, _hoisted_4$
|
|
2618
|
+
}, toDisplayString(day.date.getDate()), 11, _hoisted_4$24);
|
|
2413
2619
|
}), 128))], 2)
|
|
2414
2620
|
], 2)], 2112))], 38)) : createCommentVNode("v-if", true)]))
|
|
2415
2621
|
], 2);
|
|
2416
2622
|
};
|
|
2417
2623
|
}
|
|
2418
|
-
}), [["__scopeId", "data-v-
|
|
2624
|
+
}), [["__scopeId", "data-v-23f9364e"]]);
|
|
2419
2625
|
//#endregion
|
|
2420
2626
|
//#region src/components/base/date-picker/date-range-picker.vue
|
|
2421
|
-
const _hoisted_1$
|
|
2627
|
+
const _hoisted_1$46 = [
|
|
2422
2628
|
"value",
|
|
2423
2629
|
"placeholder",
|
|
2424
2630
|
"disabled"
|
|
2425
2631
|
];
|
|
2426
|
-
const _hoisted_2$
|
|
2632
|
+
const _hoisted_2$34 = [
|
|
2427
2633
|
"disabled",
|
|
2428
2634
|
"onClick",
|
|
2429
2635
|
"onMouseenter"
|
|
@@ -2589,7 +2795,7 @@ var date_range_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE
|
|
|
2589
2795
|
placeholder: __props.placeholder,
|
|
2590
2796
|
disabled: __props.disabled,
|
|
2591
2797
|
readonly: ""
|
|
2592
|
-
}, null, 10, _hoisted_1$
|
|
2798
|
+
}, null, 10, _hoisted_1$46),
|
|
2593
2799
|
createElementVNode("span", { class: normalizeClass(e("icon")) }, "📅", 2),
|
|
2594
2800
|
(openBlock(), createBlock(Teleport, { to: "body" }, [visible.value ? (openBlock(), createElementBlock("div", {
|
|
2595
2801
|
key: 0,
|
|
@@ -2627,7 +2833,7 @@ var date_range_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE
|
|
|
2627
2833
|
onClick: withModifiers(($event) => selectDate(day), ["stop"]),
|
|
2628
2834
|
onMouseenter: ($event) => hoverDate.value = formatDate(day.date),
|
|
2629
2835
|
onMouseleave: _cache[0] || (_cache[0] = ($event) => hoverDate.value = "")
|
|
2630
|
-
}, toDisplayString(day.date.getDate()), 43, _hoisted_2$
|
|
2836
|
+
}, toDisplayString(day.date.getDate()), 43, _hoisted_2$34);
|
|
2631
2837
|
}), 128))], 2)
|
|
2632
2838
|
], 6)) : createCommentVNode("v-if", true)]))
|
|
2633
2839
|
], 2);
|
|
@@ -2636,14 +2842,14 @@ var date_range_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE
|
|
|
2636
2842
|
}), [["__scopeId", "data-v-c307df48"]]);
|
|
2637
2843
|
//#endregion
|
|
2638
2844
|
//#region src/components/base/time-picker/time-picker.vue
|
|
2639
|
-
const _hoisted_1$
|
|
2845
|
+
const _hoisted_1$45 = [
|
|
2640
2846
|
"value",
|
|
2641
2847
|
"placeholder",
|
|
2642
2848
|
"disabled"
|
|
2643
2849
|
];
|
|
2644
|
-
const _hoisted_2$
|
|
2645
|
-
const _hoisted_3$
|
|
2646
|
-
const _hoisted_4$
|
|
2850
|
+
const _hoisted_2$33 = ["onClick"];
|
|
2851
|
+
const _hoisted_3$25 = ["onClick"];
|
|
2852
|
+
const _hoisted_4$23 = ["onClick"];
|
|
2647
2853
|
var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2648
2854
|
name: "YdTimePicker",
|
|
2649
2855
|
__name: "time-picker",
|
|
@@ -2720,7 +2926,7 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
2720
2926
|
placeholder: __props.placeholder,
|
|
2721
2927
|
disabled: __props.disabled,
|
|
2722
2928
|
readonly: ""
|
|
2723
|
-
}, null, 10, _hoisted_1$
|
|
2929
|
+
}, null, 10, _hoisted_1$45), (openBlock(), createBlock(Teleport, { to: "body" }, [visible.value ? (openBlock(), createElementBlock("div", {
|
|
2724
2930
|
key: 0,
|
|
2725
2931
|
class: normalizeClass(e("panel")),
|
|
2726
2932
|
style: normalizeStyle(panelStyle.value)
|
|
@@ -2730,14 +2936,14 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
2730
2936
|
key: h - 1,
|
|
2731
2937
|
class: normalizeClass([e("item"), { [e("item--active")]: selectedHour.value === h - 1 }]),
|
|
2732
2938
|
onClick: ($event) => selectHour(h - 1)
|
|
2733
|
-
}, toDisplayString(String(h - 1).padStart(2, "0")), 11, _hoisted_2$
|
|
2939
|
+
}, toDisplayString(String(h - 1).padStart(2, "0")), 11, _hoisted_2$33);
|
|
2734
2940
|
}), 64))], 2),
|
|
2735
2941
|
createElementVNode("div", { class: normalizeClass(e("column")) }, [(openBlock(), createElementBlock(Fragment, null, renderList(60, (m) => {
|
|
2736
2942
|
return createElementVNode("div", {
|
|
2737
2943
|
key: m - 1,
|
|
2738
2944
|
class: normalizeClass([e("item"), { [e("item--active")]: selectedMinute.value === m - 1 }]),
|
|
2739
2945
|
onClick: ($event) => selectMinute(m - 1)
|
|
2740
|
-
}, toDisplayString(String(m - 1).padStart(2, "0")), 11, _hoisted_3$
|
|
2946
|
+
}, toDisplayString(String(m - 1).padStart(2, "0")), 11, _hoisted_3$25);
|
|
2741
2947
|
}), 64))], 2),
|
|
2742
2948
|
__props.showSeconds ? (openBlock(), createElementBlock("div", {
|
|
2743
2949
|
key: 0,
|
|
@@ -2747,7 +2953,7 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
2747
2953
|
key: s - 1,
|
|
2748
2954
|
class: normalizeClass([e("item"), { [e("item--active")]: selectedSecond.value === s - 1 }]),
|
|
2749
2955
|
onClick: ($event) => selectSecond(s - 1)
|
|
2750
|
-
}, toDisplayString(String(s - 1).padStart(2, "0")), 11, _hoisted_4$
|
|
2956
|
+
}, toDisplayString(String(s - 1).padStart(2, "0")), 11, _hoisted_4$23);
|
|
2751
2957
|
}), 64))], 2)) : createCommentVNode("v-if", true)
|
|
2752
2958
|
], 2)], 6)) : createCommentVNode("v-if", true)]))], 2);
|
|
2753
2959
|
};
|
|
@@ -2755,15 +2961,15 @@ var time_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
2755
2961
|
}), [["__scopeId", "data-v-a6fe401a"]]);
|
|
2756
2962
|
//#endregion
|
|
2757
2963
|
//#region src/components/base/cascader/cascader.vue
|
|
2758
|
-
const _hoisted_1$
|
|
2964
|
+
const _hoisted_1$44 = [
|
|
2759
2965
|
"value",
|
|
2760
2966
|
"placeholder",
|
|
2761
2967
|
"disabled",
|
|
2762
2968
|
"readonly"
|
|
2763
2969
|
];
|
|
2764
|
-
const _hoisted_2$
|
|
2765
|
-
const _hoisted_3$
|
|
2766
|
-
const _hoisted_4$
|
|
2970
|
+
const _hoisted_2$32 = ["onClick"];
|
|
2971
|
+
const _hoisted_3$24 = ["onClick"];
|
|
2972
|
+
const _hoisted_4$22 = ["onClick"];
|
|
2767
2973
|
var cascader_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2768
2974
|
name: "YdCascader",
|
|
2769
2975
|
__name: "cascader",
|
|
@@ -2976,7 +3182,7 @@ var cascader_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
2976
3182
|
onInput: handleSearch,
|
|
2977
3183
|
onFocus: handleFocus,
|
|
2978
3184
|
onBlur: handleBlur
|
|
2979
|
-
}, null, 42, _hoisted_1$
|
|
3185
|
+
}, null, 42, _hoisted_1$44), (openBlock(), createBlock(Teleport, { to: "body" }, [visible.value ? (openBlock(), createElementBlock("div", {
|
|
2980
3186
|
key: 0,
|
|
2981
3187
|
class: normalizeClass(e("dropdown")),
|
|
2982
3188
|
style: normalizeStyle(dropdownStyle.value),
|
|
@@ -2999,7 +3205,7 @@ var cascader_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
2999
3205
|
}), 128)), __props.multiple ? (openBlock(), createElementBlock("span", {
|
|
3000
3206
|
key: 0,
|
|
3001
3207
|
class: normalizeClass(e("checkmark"))
|
|
3002
|
-
}, toDisplayString(isPathSelected(item.path) ? "✓" : ""), 3)) : createCommentVNode("v-if", true)], 10, _hoisted_2$
|
|
3208
|
+
}, toDisplayString(isPathSelected(item.path) ? "✓" : ""), 3)) : createCommentVNode("v-if", true)], 10, _hoisted_2$32);
|
|
3003
3209
|
}), 128)), searchResults.value.length === 0 ? (openBlock(), createElementBlock("div", {
|
|
3004
3210
|
key: 0,
|
|
3005
3211
|
class: normalizeClass(e("empty"))
|
|
@@ -3011,7 +3217,7 @@ var cascader_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
3011
3217
|
}, [createTextVNode(toDisplayString(option.label) + " ", 1), option.children?.length ? (openBlock(), createElementBlock("span", {
|
|
3012
3218
|
key: 0,
|
|
3013
3219
|
class: normalizeClass(e("arrow"))
|
|
3014
|
-
}, "›", 2)) : createCommentVNode("v-if", true)], 10, _hoisted_3$
|
|
3220
|
+
}, "›", 2)) : createCommentVNode("v-if", true)], 10, _hoisted_3$24);
|
|
3015
3221
|
}), 128))], 2), (openBlock(true), createElementBlock(Fragment, null, renderList(activePath.value.length, (level) => {
|
|
3016
3222
|
return openBlock(), createElementBlock(Fragment, { key: level }, [activePath.value[level - 1]?.children?.length ? (openBlock(), createElementBlock("div", {
|
|
3017
3223
|
key: 0,
|
|
@@ -3024,7 +3230,7 @@ var cascader_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
3024
3230
|
}, [createTextVNode(toDisplayString(option.label) + " ", 1), option.children?.length ? (openBlock(), createElementBlock("span", {
|
|
3025
3231
|
key: 0,
|
|
3026
3232
|
class: normalizeClass(e("arrow"))
|
|
3027
|
-
}, "›", 2)) : createCommentVNode("v-if", true)], 10, _hoisted_4$
|
|
3233
|
+
}, "›", 2)) : createCommentVNode("v-if", true)], 10, _hoisted_4$22);
|
|
3028
3234
|
}), 128))], 2)) : createCommentVNode("v-if", true)], 64);
|
|
3029
3235
|
}), 128))], 2)], 2112))], 38)) : createCommentVNode("v-if", true)]))], 2);
|
|
3030
3236
|
};
|
|
@@ -3032,7 +3238,7 @@ var cascader_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
3032
3238
|
}), [["__scopeId", "data-v-01225c10"]]);
|
|
3033
3239
|
//#endregion
|
|
3034
3240
|
//#region src/components/base/auto-complete/auto-complete.vue
|
|
3035
|
-
const _hoisted_1$
|
|
3241
|
+
const _hoisted_1$43 = ["onClick", "onMouseenter"];
|
|
3036
3242
|
var auto_complete_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
3037
3243
|
name: "YdAutoComplete",
|
|
3038
3244
|
__name: "auto-complete",
|
|
@@ -3116,15 +3322,15 @@ var auto_complete_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ *
|
|
|
3116
3322
|
class: normalizeClass([e("option"), { [e("option--active")]: index === activeIndex.value }]),
|
|
3117
3323
|
onClick: ($event) => selectOption(option),
|
|
3118
3324
|
onMouseenter: ($event) => activeIndex.value = index
|
|
3119
|
-
}, toDisplayString(option.label), 43, _hoisted_1$
|
|
3325
|
+
}, toDisplayString(option.label), 43, _hoisted_1$43);
|
|
3120
3326
|
}), 128))], 6)) : createCommentVNode("v-if", true)]))], 2);
|
|
3121
3327
|
};
|
|
3122
3328
|
}
|
|
3123
3329
|
}), [["__scopeId", "data-v-0251e526"]]);
|
|
3124
3330
|
//#endregion
|
|
3125
3331
|
//#region src/components/base/transfer/transfer.vue
|
|
3126
|
-
const _hoisted_1$
|
|
3127
|
-
const _hoisted_2$
|
|
3332
|
+
const _hoisted_1$42 = ["onClick"];
|
|
3333
|
+
const _hoisted_2$31 = ["onClick"];
|
|
3128
3334
|
var transfer_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
3129
3335
|
name: "YdTransfer",
|
|
3130
3336
|
__name: "transfer",
|
|
@@ -3199,7 +3405,7 @@ var transfer_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
3199
3405
|
"model-value",
|
|
3200
3406
|
"disabled",
|
|
3201
3407
|
"onChange"
|
|
3202
|
-
])], 10, _hoisted_1$
|
|
3408
|
+
])], 10, _hoisted_1$42);
|
|
3203
3409
|
}), 128)), sourceOptions.value.length === 0 ? (openBlock(), createBlock(empty_default, {
|
|
3204
3410
|
key: 0,
|
|
3205
3411
|
description: "暂无数据"
|
|
@@ -3247,7 +3453,7 @@ var transfer_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
3247
3453
|
"model-value",
|
|
3248
3454
|
"disabled",
|
|
3249
3455
|
"onChange"
|
|
3250
|
-
])], 10, _hoisted_2$
|
|
3456
|
+
])], 10, _hoisted_2$31);
|
|
3251
3457
|
}), 128)), targetOptions.value.length === 0 ? (openBlock(), createBlock(empty_default, {
|
|
3252
3458
|
key: 0,
|
|
3253
3459
|
description: "暂无数据"
|
|
@@ -3258,7 +3464,7 @@ var transfer_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
3258
3464
|
}), [["__scopeId", "data-v-a2e1ecd2"]]);
|
|
3259
3465
|
//#endregion
|
|
3260
3466
|
//#region src/components/feedback/spin/spin.vue
|
|
3261
|
-
const _hoisted_1$
|
|
3467
|
+
const _hoisted_1$41 = ["width", "height"];
|
|
3262
3468
|
var spin_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
3263
3469
|
name: "YdSpin",
|
|
3264
3470
|
__name: "spin",
|
|
@@ -3296,7 +3502,7 @@ var spin_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
3296
3502
|
"stroke-width": "2",
|
|
3297
3503
|
"stroke-linecap": "round",
|
|
3298
3504
|
"stroke-linejoin": "round"
|
|
3299
|
-
}, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }, null, -1)])], 8, _hoisted_1$
|
|
3505
|
+
}, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }, null, -1)])], 8, _hoisted_1$41))], true)], 6), _ctx.$slots.default || __props.tip ? (openBlock(), createElementBlock("div", {
|
|
3300
3506
|
key: 0,
|
|
3301
3507
|
class: normalizeClass(e("text"))
|
|
3302
3508
|
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.tip), 1)], true)], 2)) : createCommentVNode("v-if", true)], 2);
|
|
@@ -3305,8 +3511,8 @@ var spin_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
3305
3511
|
}), [["__scopeId", "data-v-f72fb3d9"]]);
|
|
3306
3512
|
//#endregion
|
|
3307
3513
|
//#region src/components/base/upload/upload.vue
|
|
3308
|
-
const _hoisted_1$
|
|
3309
|
-
const _hoisted_2$
|
|
3514
|
+
const _hoisted_1$40 = ["onClick"];
|
|
3515
|
+
const _hoisted_2$30 = [
|
|
3310
3516
|
"multiple",
|
|
3311
3517
|
"accept",
|
|
3312
3518
|
"disabled"
|
|
@@ -3336,7 +3542,7 @@ var upload_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
3336
3542
|
"remove",
|
|
3337
3543
|
"exceed"
|
|
3338
3544
|
],
|
|
3339
|
-
setup(__props, { emit: __emit }) {
|
|
3545
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
3340
3546
|
const props = __props;
|
|
3341
3547
|
const emit = __emit;
|
|
3342
3548
|
const inputRef = ref();
|
|
@@ -3415,6 +3621,14 @@ var upload_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
3415
3621
|
emit("update:fileList", newFileList);
|
|
3416
3622
|
emit("remove", file, newFileList);
|
|
3417
3623
|
}
|
|
3624
|
+
__expose({
|
|
3625
|
+
triggerBrowse: () => {
|
|
3626
|
+
inputRef.value?.click();
|
|
3627
|
+
},
|
|
3628
|
+
clearFiles: () => {
|
|
3629
|
+
emit("update:fileList", []);
|
|
3630
|
+
}
|
|
3631
|
+
});
|
|
3418
3632
|
return (_ctx, _cache) => {
|
|
3419
3633
|
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("yd-upload")) }, [
|
|
3420
3634
|
createElementVNode("div", { class: normalizeClass(e("list")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.fileList, (file, index) => {
|
|
@@ -3438,7 +3652,7 @@ var upload_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
3438
3652
|
key: 3,
|
|
3439
3653
|
class: normalizeClass(e("file-remove")),
|
|
3440
3654
|
onClick: ($event) => handleRemove(index)
|
|
3441
|
-
}, "✕", 10, _hoisted_1$
|
|
3655
|
+
}, "✕", 10, _hoisted_1$40)) : createCommentVNode("v-if", true)
|
|
3442
3656
|
], 2);
|
|
3443
3657
|
}), 128))], 2),
|
|
3444
3658
|
createElementVNode("div", {
|
|
@@ -3459,7 +3673,7 @@ var upload_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
3459
3673
|
disabled: __props.disabled,
|
|
3460
3674
|
hidden: "",
|
|
3461
3675
|
onChange: handleFileChange
|
|
3462
|
-
}, null, 40, _hoisted_2$
|
|
3676
|
+
}, null, 40, _hoisted_2$30), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", { class: normalizeClass(e("trigger-content")) }, [_cache[2] || (_cache[2] = createElementVNode("svg", {
|
|
3463
3677
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3464
3678
|
width: "32",
|
|
3465
3679
|
height: "32",
|
|
@@ -3486,11 +3700,11 @@ var upload_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
3486
3700
|
], 2);
|
|
3487
3701
|
};
|
|
3488
3702
|
}
|
|
3489
|
-
}), [["__scopeId", "data-v-
|
|
3703
|
+
}), [["__scopeId", "data-v-6c5ae5fc"]]);
|
|
3490
3704
|
//#endregion
|
|
3491
3705
|
//#region src/components/base/captcha/captcha.vue
|
|
3492
|
-
const _hoisted_1$
|
|
3493
|
-
const _hoisted_2$
|
|
3706
|
+
const _hoisted_1$39 = ["width", "height"];
|
|
3707
|
+
const _hoisted_2$29 = [
|
|
3494
3708
|
"src",
|
|
3495
3709
|
"alt",
|
|
3496
3710
|
"width",
|
|
@@ -3608,26 +3822,26 @@ var captcha_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defi
|
|
|
3608
3822
|
class: normalizeClass(e("canvas")),
|
|
3609
3823
|
width: __props.width,
|
|
3610
3824
|
height: __props.height
|
|
3611
|
-
}, null, 10, _hoisted_1$
|
|
3825
|
+
}, null, 10, _hoisted_1$39)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" 后端提供的图片验证码 "), createElementVNode("img", {
|
|
3612
3826
|
class: normalizeClass(e("image")),
|
|
3613
3827
|
src: __props.src,
|
|
3614
3828
|
alt: __props.code || "验证码",
|
|
3615
3829
|
width: __props.width,
|
|
3616
3830
|
height: __props.height
|
|
3617
|
-
}, null, 10, _hoisted_2$
|
|
3831
|
+
}, null, 10, _hoisted_2$29)], 2112))], 2);
|
|
3618
3832
|
};
|
|
3619
3833
|
}
|
|
3620
3834
|
}), [["__scopeId", "data-v-0ad64f93"]]);
|
|
3621
3835
|
//#endregion
|
|
3622
3836
|
//#region src/components/base/login/login.vue
|
|
3623
|
-
const _hoisted_1$
|
|
3624
|
-
const _hoisted_2$
|
|
3625
|
-
const _hoisted_3$
|
|
3626
|
-
const _hoisted_4$
|
|
3627
|
-
const _hoisted_5$
|
|
3628
|
-
const _hoisted_6$
|
|
3629
|
-
const _hoisted_7$
|
|
3630
|
-
const _hoisted_8$
|
|
3837
|
+
const _hoisted_1$38 = ["onClick"];
|
|
3838
|
+
const _hoisted_2$28 = ["placeholder"];
|
|
3839
|
+
const _hoisted_3$23 = ["type", "placeholder"];
|
|
3840
|
+
const _hoisted_4$21 = ["placeholder"];
|
|
3841
|
+
const _hoisted_5$15 = ["placeholder"];
|
|
3842
|
+
const _hoisted_6$14 = ["placeholder"];
|
|
3843
|
+
const _hoisted_7$13 = ["disabled"];
|
|
3844
|
+
const _hoisted_8$12 = ["placeholder"];
|
|
3631
3845
|
const _hoisted_9$11 = ["disabled"];
|
|
3632
3846
|
const _hoisted_10$10 = ["title", "onClick"];
|
|
3633
3847
|
var login_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -3859,7 +4073,7 @@ var login_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
3859
4073
|
key: tab.key,
|
|
3860
4074
|
class: normalizeClass([e("tab"), { [e("tab--active")]: activeTab.value === tab.key }]),
|
|
3861
4075
|
onClick: ($event) => activeTab.value = tab.key
|
|
3862
|
-
}, toDisplayString(tab.label), 11, _hoisted_1$
|
|
4076
|
+
}, toDisplayString(tab.label), 11, _hoisted_1$38);
|
|
3863
4077
|
}), 128))], 2)) : createCommentVNode("v-if", true),
|
|
3864
4078
|
createElementVNode("form", {
|
|
3865
4079
|
class: normalizeClass(e("form")),
|
|
@@ -3872,7 +4086,7 @@ var login_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
3872
4086
|
class: normalizeClass(e("input")),
|
|
3873
4087
|
placeholder: __props.usernamePlaceholder,
|
|
3874
4088
|
autocomplete: "username"
|
|
3875
|
-
}, null, 10, _hoisted_2$
|
|
4089
|
+
}, null, 10, _hoisted_2$28), [[vModelText, formData.username]])], 2)], 2),
|
|
3876
4090
|
createElementVNode("div", { class: normalizeClass(e("field")) }, [createElementVNode("div", { class: normalizeClass(e("input-wrapper")) }, [
|
|
3877
4091
|
createElementVNode("span", { class: normalizeClass(e("input-icon")) }, "🔒", 2),
|
|
3878
4092
|
withDirectives(createElementVNode("input", {
|
|
@@ -3881,7 +4095,7 @@ var login_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
3881
4095
|
class: normalizeClass(e("input")),
|
|
3882
4096
|
placeholder: __props.passwordPlaceholder,
|
|
3883
4097
|
autocomplete: "current-password"
|
|
3884
|
-
}, null, 10, _hoisted_3$
|
|
4098
|
+
}, null, 10, _hoisted_3$23), [[vModelDynamic, formData.password]]),
|
|
3885
4099
|
createElementVNode("button", {
|
|
3886
4100
|
type: "button",
|
|
3887
4101
|
class: normalizeClass(e("toggle-pwd")),
|
|
@@ -3901,7 +4115,7 @@ var login_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
3901
4115
|
type: "text",
|
|
3902
4116
|
maxlength: "4",
|
|
3903
4117
|
autocomplete: "off"
|
|
3904
|
-
}, null, 10, _hoisted_4$
|
|
4118
|
+
}, null, 10, _hoisted_4$21), [[vModelText, formData.captchaCode]])], 2), (openBlock(), createBlock(captcha_default, {
|
|
3905
4119
|
class: normalizeClass(e("captcha-img")),
|
|
3906
4120
|
src: __props.captchaSrc,
|
|
3907
4121
|
code: captchaCode.value,
|
|
@@ -3939,7 +4153,7 @@ var login_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
3939
4153
|
type: "tel",
|
|
3940
4154
|
maxlength: "11",
|
|
3941
4155
|
autocomplete: "tel"
|
|
3942
|
-
}, null, 10, _hoisted_5$
|
|
4156
|
+
}, null, 10, _hoisted_5$15), [[vModelText, formData.phone]])], 2)], 2),
|
|
3943
4157
|
createElementVNode("div", { class: normalizeClass(e("field")) }, [createElementVNode("div", { class: normalizeClass(e("input-wrapper")) }, [
|
|
3944
4158
|
createElementVNode("span", { class: normalizeClass(e("input-icon")) }, "🔑", 2),
|
|
3945
4159
|
withDirectives(createElementVNode("input", {
|
|
@@ -3949,13 +4163,13 @@ var login_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
3949
4163
|
type: "text",
|
|
3950
4164
|
maxlength: "6",
|
|
3951
4165
|
autocomplete: "one-time-code"
|
|
3952
|
-
}, null, 10, _hoisted_6$
|
|
4166
|
+
}, null, 10, _hoisted_6$14), [[vModelText, formData.code]]),
|
|
3953
4167
|
createElementVNode("button", {
|
|
3954
4168
|
type: "button",
|
|
3955
4169
|
class: normalizeClass([e("send-code"), { [e("send-code--disabled")]: countdown.value > 0 }]),
|
|
3956
4170
|
disabled: countdown.value > 0,
|
|
3957
4171
|
onClick: handleSendCode
|
|
3958
|
-
}, toDisplayString(countdown.value > 0 ? `${countdown.value}s` : __props.sendCodeText), 11, _hoisted_7$
|
|
4172
|
+
}, toDisplayString(countdown.value > 0 ? `${countdown.value}s` : __props.sendCodeText), 11, _hoisted_7$13)
|
|
3959
4173
|
], 2)], 2),
|
|
3960
4174
|
__props.showCaptcha ? (openBlock(), createElementBlock("div", {
|
|
3961
4175
|
key: 0,
|
|
@@ -3970,7 +4184,7 @@ var login_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
3970
4184
|
type: "text",
|
|
3971
4185
|
maxlength: "4",
|
|
3972
4186
|
autocomplete: "off"
|
|
3973
|
-
}, null, 10, _hoisted_8$
|
|
4187
|
+
}, null, 10, _hoisted_8$12), [[vModelText, formData.captchaCode]])], 2), (openBlock(), createBlock(captcha_default, {
|
|
3974
4188
|
class: normalizeClass(e("captcha-img")),
|
|
3975
4189
|
src: __props.captchaSrc,
|
|
3976
4190
|
code: captchaCode.value,
|
|
@@ -4034,11 +4248,11 @@ var login_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
4034
4248
|
}), [["__scopeId", "data-v-6981722d"]]);
|
|
4035
4249
|
//#endregion
|
|
4036
4250
|
//#region src/components/base/login/login-centered.vue
|
|
4037
|
-
const _hoisted_1$
|
|
4038
|
-
const _hoisted_2$
|
|
4039
|
-
const _hoisted_3$
|
|
4040
|
-
const _hoisted_4$
|
|
4041
|
-
const _hoisted_5$
|
|
4251
|
+
const _hoisted_1$37 = ["fill"];
|
|
4252
|
+
const _hoisted_2$27 = ["onClick"];
|
|
4253
|
+
const _hoisted_3$22 = ["placeholder"];
|
|
4254
|
+
const _hoisted_4$20 = ["type", "placeholder"];
|
|
4255
|
+
const _hoisted_5$14 = {
|
|
4042
4256
|
key: 0,
|
|
4043
4257
|
width: "18",
|
|
4044
4258
|
height: "18",
|
|
@@ -4047,7 +4261,7 @@ const _hoisted_5$13 = {
|
|
|
4047
4261
|
stroke: "currentColor",
|
|
4048
4262
|
"stroke-width": "2"
|
|
4049
4263
|
};
|
|
4050
|
-
const _hoisted_6$
|
|
4264
|
+
const _hoisted_6$13 = {
|
|
4051
4265
|
key: 1,
|
|
4052
4266
|
width: "18",
|
|
4053
4267
|
height: "18",
|
|
@@ -4056,8 +4270,8 @@ const _hoisted_6$12 = {
|
|
|
4056
4270
|
stroke: "currentColor",
|
|
4057
4271
|
"stroke-width": "2"
|
|
4058
4272
|
};
|
|
4059
|
-
const _hoisted_7$
|
|
4060
|
-
const _hoisted_8$
|
|
4273
|
+
const _hoisted_7$12 = ["placeholder"];
|
|
4274
|
+
const _hoisted_8$11 = ["placeholder"];
|
|
4061
4275
|
const _hoisted_9$10 = ["disabled"];
|
|
4062
4276
|
const _hoisted_10$9 = ["placeholder"];
|
|
4063
4277
|
const _hoisted_11$9 = ["disabled"];
|
|
@@ -4275,7 +4489,7 @@ var login_centered_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
|
|
|
4275
4489
|
height: "40",
|
|
4276
4490
|
rx: "8",
|
|
4277
4491
|
fill: __props.theme === "dark" ? "#6366f1" : "#4f46e5"
|
|
4278
|
-
}, null, 8, _hoisted_1$
|
|
4492
|
+
}, null, 8, _hoisted_1$37), _cache[8] || (_cache[8] = createElementVNode("path", {
|
|
4279
4493
|
d: "M12 20L18 26L28 14",
|
|
4280
4494
|
stroke: "#fff",
|
|
4281
4495
|
"stroke-width": "3",
|
|
@@ -4293,7 +4507,7 @@ var login_centered_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
|
|
|
4293
4507
|
key: tab.key,
|
|
4294
4508
|
class: normalizeClass([e("tab"), { [e("tab--active")]: activeTab.value === tab.key }]),
|
|
4295
4509
|
onClick: ($event) => activeTab.value = tab.key
|
|
4296
|
-
}, toDisplayString(tab.label), 11, _hoisted_2$
|
|
4510
|
+
}, toDisplayString(tab.label), 11, _hoisted_2$27);
|
|
4297
4511
|
}), 128))], 2)) : createCommentVNode("v-if", true),
|
|
4298
4512
|
createElementVNode("form", {
|
|
4299
4513
|
class: normalizeClass(e("form")),
|
|
@@ -4316,7 +4530,7 @@ var login_centered_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
|
|
|
4316
4530
|
class: normalizeClass(e("input")),
|
|
4317
4531
|
placeholder: __props.usernamePlaceholder,
|
|
4318
4532
|
autocomplete: "username"
|
|
4319
|
-
}, null, 10, _hoisted_3$
|
|
4533
|
+
}, null, 10, _hoisted_3$22), [[vModelText, formData.username]])], 2)], 2), createElementVNode("div", { class: normalizeClass(e("field")) }, [createElementVNode("label", { class: normalizeClass(e("label")) }, toDisplayString(__props.passwordLabel), 3), createElementVNode("div", { class: normalizeClass(e("input-group")) }, [
|
|
4320
4534
|
createElementVNode("span", { class: normalizeClass(e("input-prefix")) }, [..._cache[10] || (_cache[10] = [createElementVNode("svg", {
|
|
4321
4535
|
width: "18",
|
|
4322
4536
|
height: "18",
|
|
@@ -4338,16 +4552,16 @@ var login_centered_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
|
|
|
4338
4552
|
class: normalizeClass(e("input")),
|
|
4339
4553
|
placeholder: __props.passwordPlaceholder,
|
|
4340
4554
|
autocomplete: "current-password"
|
|
4341
|
-
}, null, 10, _hoisted_4$
|
|
4555
|
+
}, null, 10, _hoisted_4$20), [[vModelDynamic, formData.password]]),
|
|
4342
4556
|
createElementVNode("button", {
|
|
4343
4557
|
type: "button",
|
|
4344
4558
|
class: normalizeClass(e("input-suffix")),
|
|
4345
4559
|
onClick: _cache[2] || (_cache[2] = ($event) => showPassword.value = !showPassword.value)
|
|
4346
|
-
}, [!showPassword.value ? (openBlock(), createElementBlock("svg", _hoisted_5$
|
|
4560
|
+
}, [!showPassword.value ? (openBlock(), createElementBlock("svg", _hoisted_5$14, [..._cache[11] || (_cache[11] = [createElementVNode("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }, null, -1), createElementVNode("circle", {
|
|
4347
4561
|
cx: "12",
|
|
4348
4562
|
cy: "12",
|
|
4349
4563
|
r: "3"
|
|
4350
|
-
}, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_6$
|
|
4564
|
+
}, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_6$13, [..._cache[12] || (_cache[12] = [createElementVNode("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }, null, -1), createElementVNode("line", {
|
|
4351
4565
|
x1: "1",
|
|
4352
4566
|
y1: "1",
|
|
4353
4567
|
x2: "23",
|
|
@@ -4381,7 +4595,7 @@ var login_centered_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
|
|
|
4381
4595
|
type: "tel",
|
|
4382
4596
|
maxlength: "11",
|
|
4383
4597
|
autocomplete: "tel"
|
|
4384
|
-
}, null, 10, _hoisted_7$
|
|
4598
|
+
}, null, 10, _hoisted_7$12), [[vModelText, formData.phone]])], 2)], 2), createElementVNode("div", { class: normalizeClass(e("field")) }, [createElementVNode("label", { class: normalizeClass(e("label")) }, toDisplayString(__props.codeLabel), 3), createElementVNode("div", { class: normalizeClass(e("input-group")) }, [
|
|
4385
4599
|
createElementVNode("span", { class: normalizeClass(e("input-prefix")) }, [..._cache[14] || (_cache[14] = [createElementVNode("svg", {
|
|
4386
4600
|
width: "18",
|
|
4387
4601
|
height: "18",
|
|
@@ -4404,7 +4618,7 @@ var login_centered_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
|
|
|
4404
4618
|
type: "text",
|
|
4405
4619
|
maxlength: "6",
|
|
4406
4620
|
autocomplete: "one-time-code"
|
|
4407
|
-
}, null, 10, _hoisted_8$
|
|
4621
|
+
}, null, 10, _hoisted_8$11), [[vModelText, formData.code]]),
|
|
4408
4622
|
createElementVNode("button", {
|
|
4409
4623
|
type: "button",
|
|
4410
4624
|
class: normalizeClass([e("send-code"), { [e("send-code--disabled")]: countdown.value > 0 }]),
|
|
@@ -4504,7 +4718,7 @@ var login_centered_default = /* @__PURE__ */ export_helper_default(/* @__PURE__
|
|
|
4504
4718
|
}), [["__scopeId", "data-v-267a78de"]]);
|
|
4505
4719
|
//#endregion
|
|
4506
4720
|
//#region src/components/base/pin-input/pin-input.vue
|
|
4507
|
-
const _hoisted_1$
|
|
4721
|
+
const _hoisted_1$36 = [
|
|
4508
4722
|
"value",
|
|
4509
4723
|
"disabled",
|
|
4510
4724
|
"onInput",
|
|
@@ -4614,7 +4828,7 @@ var pin_input_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ de
|
|
|
4614
4828
|
onFocus: ($event) => focusedIndex.value = i - 1,
|
|
4615
4829
|
onBlur: _cache[0] || (_cache[0] = ($event) => focusedIndex.value = -1),
|
|
4616
4830
|
onPaste: handlePaste
|
|
4617
|
-
}, null, 42, _hoisted_1$
|
|
4831
|
+
}, null, 42, _hoisted_1$36);
|
|
4618
4832
|
}), 128))], 2), __props.error ? (openBlock(), createElementBlock("div", {
|
|
4619
4833
|
key: 0,
|
|
4620
4834
|
class: normalizeClass(e("error"))
|
|
@@ -4624,22 +4838,22 @@ var pin_input_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ de
|
|
|
4624
4838
|
}), [["__scopeId", "data-v-fd187d50"]]);
|
|
4625
4839
|
//#endregion
|
|
4626
4840
|
//#region src/components/base/tree-select/tree-select.vue
|
|
4627
|
-
const _hoisted_1$
|
|
4841
|
+
const _hoisted_1$35 = [
|
|
4628
4842
|
"value",
|
|
4629
4843
|
"placeholder",
|
|
4630
4844
|
"disabled"
|
|
4631
4845
|
];
|
|
4632
|
-
const _hoisted_2$
|
|
4633
|
-
const _hoisted_3$
|
|
4634
|
-
const _hoisted_4$
|
|
4635
|
-
const _hoisted_5$
|
|
4846
|
+
const _hoisted_2$26 = ["onClick"];
|
|
4847
|
+
const _hoisted_3$21 = ["onClick"];
|
|
4848
|
+
const _hoisted_4$19 = ["onClick"];
|
|
4849
|
+
const _hoisted_5$13 = [
|
|
4636
4850
|
"checked",
|
|
4637
4851
|
"indeterminate",
|
|
4638
4852
|
"disabled"
|
|
4639
4853
|
];
|
|
4640
|
-
const _hoisted_6$
|
|
4641
|
-
const _hoisted_7$
|
|
4642
|
-
const _hoisted_8$
|
|
4854
|
+
const _hoisted_6$12 = ["onClick"];
|
|
4855
|
+
const _hoisted_7$11 = ["onClick"];
|
|
4856
|
+
const _hoisted_8$10 = ["onClick"];
|
|
4643
4857
|
const _hoisted_9$9 = [
|
|
4644
4858
|
"checked",
|
|
4645
4859
|
"indeterminate",
|
|
@@ -4959,7 +5173,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
4959
5173
|
onFocus: handleFocus,
|
|
4960
5174
|
onBlur: handleBlur,
|
|
4961
5175
|
onKeydown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
|
|
4962
|
-
}, null, 42, _hoisted_1$
|
|
5176
|
+
}, null, 42, _hoisted_1$35)) : (openBlock(), createElementBlock("div", {
|
|
4963
5177
|
key: 1,
|
|
4964
5178
|
class: normalizeClass([e("display"), { [e("display--placeholder")]: !selectedTitle.value }])
|
|
4965
5179
|
}, toDisplayString(selectedTitle.value || __props.placeholder), 3)),
|
|
@@ -5035,7 +5249,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5035
5249
|
key: 0,
|
|
5036
5250
|
class: normalizeClass(e("node-toggle")),
|
|
5037
5251
|
onClick: withModifiers(($event) => handleToggle(node), ["stop"])
|
|
5038
|
-
}, toDisplayString(expandedKeys.value.includes(node.key) ? "▾" : "▸"), 11, _hoisted_3$
|
|
5252
|
+
}, toDisplayString(expandedKeys.value.includes(node.key) ? "▾" : "▸"), 11, _hoisted_3$21)) : (openBlock(), createElementBlock("span", {
|
|
5039
5253
|
key: 1,
|
|
5040
5254
|
class: normalizeClass(e("node-leaf"))
|
|
5041
5255
|
}, "•", 2)),
|
|
@@ -5048,9 +5262,9 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5048
5262
|
checked: checkedKeys.value.includes(node.key),
|
|
5049
5263
|
indeterminate: indeterminateKeys.value.includes(node.key),
|
|
5050
5264
|
disabled: node.disabled
|
|
5051
|
-
}, null, 8, _hoisted_5$
|
|
5265
|
+
}, null, 8, _hoisted_5$13)], 10, _hoisted_4$19)) : createCommentVNode("v-if", true),
|
|
5052
5266
|
createElementVNode("span", { class: normalizeClass(e("node-title")) }, toDisplayString(node.title), 3)
|
|
5053
|
-
], 14, _hoisted_2$
|
|
5267
|
+
], 14, _hoisted_2$26);
|
|
5054
5268
|
}), 128))], 38)], 6)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Normal mode "), createElementVNode("div", { class: normalizeClass(e("tree-container")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredNodes.value, (node) => {
|
|
5055
5269
|
return openBlock(), createElementBlock("div", {
|
|
5056
5270
|
key: node.key,
|
|
@@ -5061,7 +5275,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5061
5275
|
key: 0,
|
|
5062
5276
|
class: normalizeClass(e("node-toggle")),
|
|
5063
5277
|
onClick: withModifiers(($event) => handleToggle(node), ["stop"])
|
|
5064
|
-
}, toDisplayString(expandedKeys.value.includes(node.key) ? "▾" : "▸"), 11, _hoisted_7$
|
|
5278
|
+
}, toDisplayString(expandedKeys.value.includes(node.key) ? "▾" : "▸"), 11, _hoisted_7$11)) : (openBlock(), createElementBlock("span", {
|
|
5065
5279
|
key: 1,
|
|
5066
5280
|
class: normalizeClass(e("node-leaf"))
|
|
5067
5281
|
}, "•", 2)),
|
|
@@ -5074,7 +5288,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5074
5288
|
checked: checkedKeys.value.includes(node.key),
|
|
5075
5289
|
indeterminate: indeterminateKeys.value.includes(node.key),
|
|
5076
5290
|
disabled: node.disabled
|
|
5077
|
-
}, null, 8, _hoisted_9$9)], 10, _hoisted_8$
|
|
5291
|
+
}, null, 8, _hoisted_9$9)], 10, _hoisted_8$10)) : createCommentVNode("v-if", true),
|
|
5078
5292
|
createElementVNode("span", { class: normalizeClass(e("node-title")) }, toDisplayString(node.title), 3),
|
|
5079
5293
|
hasChildren(node) && expandedKeys.value.includes(node.key) ? (openBlock(), createElementBlock("div", {
|
|
5080
5294
|
key: 3,
|
|
@@ -5106,7 +5320,7 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5106
5320
|
createElementVNode("span", { class: normalizeClass(e("node-title")) }, toDisplayString(child.title), 3)
|
|
5107
5321
|
], 10, _hoisted_10$8);
|
|
5108
5322
|
}), 128))], 2)) : createCommentVNode("v-if", true)
|
|
5109
|
-
], 10, _hoisted_6$
|
|
5323
|
+
], 10, _hoisted_6$12);
|
|
5110
5324
|
}), 128)), filteredNodes.value.length === 0 ? (openBlock(), createBlock(empty_default, {
|
|
5111
5325
|
key: 0,
|
|
5112
5326
|
description: "暂无数据"
|
|
@@ -5119,12 +5333,12 @@ var tree_select_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5119
5333
|
}), [["__scopeId", "data-v-f36bc312"]]);
|
|
5120
5334
|
//#endregion
|
|
5121
5335
|
//#region src/components/base/color-picker/color-picker.vue
|
|
5122
|
-
const _hoisted_1$
|
|
5336
|
+
const _hoisted_1$34 = [
|
|
5123
5337
|
"value",
|
|
5124
5338
|
"placeholder",
|
|
5125
5339
|
"disabled"
|
|
5126
5340
|
];
|
|
5127
|
-
const _hoisted_2$
|
|
5341
|
+
const _hoisted_2$25 = {
|
|
5128
5342
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5129
5343
|
width: "14",
|
|
5130
5344
|
height: "14",
|
|
@@ -5133,12 +5347,12 @@ const _hoisted_2$24 = {
|
|
|
5133
5347
|
stroke: "currentColor",
|
|
5134
5348
|
"stroke-width": "2"
|
|
5135
5349
|
};
|
|
5136
|
-
const _hoisted_3$
|
|
5137
|
-
const _hoisted_4$
|
|
5138
|
-
const _hoisted_5$
|
|
5139
|
-
const _hoisted_6$
|
|
5140
|
-
const _hoisted_7$
|
|
5141
|
-
const _hoisted_8$
|
|
5350
|
+
const _hoisted_3$20 = ["fill"];
|
|
5351
|
+
const _hoisted_4$18 = ["value"];
|
|
5352
|
+
const _hoisted_5$12 = ["value"];
|
|
5353
|
+
const _hoisted_6$11 = ["value"];
|
|
5354
|
+
const _hoisted_7$10 = ["value"];
|
|
5355
|
+
const _hoisted_8$9 = ["value"];
|
|
5142
5356
|
const _hoisted_9$8 = ["onClick"];
|
|
5143
5357
|
var color_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
5144
5358
|
name: "YdColorPicker",
|
|
@@ -5560,7 +5774,7 @@ var color_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5560
5774
|
onInput: handleInput,
|
|
5561
5775
|
onFocus: handleFocus,
|
|
5562
5776
|
onBlur: handleBlur
|
|
5563
|
-
}, null, 42, _hoisted_1$
|
|
5777
|
+
}, null, 42, _hoisted_1$34)) : createCommentVNode("v-if", true),
|
|
5564
5778
|
createCommentVNode(" Clear button "),
|
|
5565
5779
|
__props.clearable && __props.modelValue && !__props.disabled ? (openBlock(), createElementBlock("span", {
|
|
5566
5780
|
key: 2,
|
|
@@ -5588,14 +5802,14 @@ var color_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5588
5802
|
y2: "18"
|
|
5589
5803
|
})], -1)])], 2)) : createCommentVNode("v-if", true),
|
|
5590
5804
|
createCommentVNode(" Trigger button "),
|
|
5591
|
-
createElementVNode("span", { class: normalizeClass(e("trigger")) }, [(openBlock(), createElementBlock("svg", _hoisted_2$
|
|
5805
|
+
createElementVNode("span", { class: normalizeClass(e("trigger")) }, [(openBlock(), createElementBlock("svg", _hoisted_2$25, [_cache[5] || (_cache[5] = createElementVNode("circle", {
|
|
5592
5806
|
cx: "12",
|
|
5593
5807
|
cy: "12",
|
|
5594
5808
|
r: "10"
|
|
5595
5809
|
}, null, -1)), createElementVNode("path", {
|
|
5596
5810
|
d: "M12 2a10 10 0 0 1 0 20",
|
|
5597
5811
|
fill: __props.modelValue || "#ffffff"
|
|
5598
|
-
}, null, 8, _hoisted_3$
|
|
5812
|
+
}, null, 8, _hoisted_3$20)]))], 2)
|
|
5599
5813
|
], 2),
|
|
5600
5814
|
__props.error || __props.hint ? (openBlock(), createElementBlock("div", {
|
|
5601
5815
|
key: 1,
|
|
@@ -5664,7 +5878,7 @@ var color_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5664
5878
|
class: normalizeClass(e("value-input")),
|
|
5665
5879
|
value: hexValue.value,
|
|
5666
5880
|
onInput: handleHexInput
|
|
5667
|
-
}, null, 42, _hoisted_4$
|
|
5881
|
+
}, null, 42, _hoisted_4$18)], 2),
|
|
5668
5882
|
createElementVNode("div", { class: normalizeClass(e("value-item")) }, [createElementVNode("span", { class: normalizeClass(e("value-label")) }, "R", 2), createElementVNode("input", {
|
|
5669
5883
|
class: normalizeClass(e("value-input")),
|
|
5670
5884
|
type: "number",
|
|
@@ -5672,7 +5886,7 @@ var color_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5672
5886
|
max: 255,
|
|
5673
5887
|
value: rgbValue.value.r,
|
|
5674
5888
|
onInput: _cache[0] || (_cache[0] = (e) => handleRgbInput("r", e))
|
|
5675
|
-
}, null, 42, _hoisted_5$
|
|
5889
|
+
}, null, 42, _hoisted_5$12)], 2),
|
|
5676
5890
|
createElementVNode("div", { class: normalizeClass(e("value-item")) }, [createElementVNode("span", { class: normalizeClass(e("value-label")) }, "G", 2), createElementVNode("input", {
|
|
5677
5891
|
class: normalizeClass(e("value-input")),
|
|
5678
5892
|
type: "number",
|
|
@@ -5680,7 +5894,7 @@ var color_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5680
5894
|
max: 255,
|
|
5681
5895
|
value: rgbValue.value.g,
|
|
5682
5896
|
onInput: _cache[1] || (_cache[1] = (e) => handleRgbInput("g", e))
|
|
5683
|
-
}, null, 42, _hoisted_6$
|
|
5897
|
+
}, null, 42, _hoisted_6$11)], 2),
|
|
5684
5898
|
createElementVNode("div", { class: normalizeClass(e("value-item")) }, [createElementVNode("span", { class: normalizeClass(e("value-label")) }, "B", 2), createElementVNode("input", {
|
|
5685
5899
|
class: normalizeClass(e("value-input")),
|
|
5686
5900
|
type: "number",
|
|
@@ -5688,7 +5902,7 @@ var color_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5688
5902
|
max: 255,
|
|
5689
5903
|
value: rgbValue.value.b,
|
|
5690
5904
|
onInput: _cache[2] || (_cache[2] = (e) => handleRgbInput("b", e))
|
|
5691
|
-
}, null, 42, _hoisted_7$
|
|
5905
|
+
}, null, 42, _hoisted_7$10)], 2),
|
|
5692
5906
|
__props.showAlpha ? (openBlock(), createElementBlock("div", {
|
|
5693
5907
|
key: 0,
|
|
5694
5908
|
class: normalizeClass(e("value-item"))
|
|
@@ -5699,7 +5913,7 @@ var color_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5699
5913
|
max: 100,
|
|
5700
5914
|
value: Math.round(alphaValue.value * 100),
|
|
5701
5915
|
onInput: handleAlphaInput
|
|
5702
|
-
}, null, 42, _hoisted_8$
|
|
5916
|
+
}, null, 42, _hoisted_8$9)], 2)) : createCommentVNode("v-if", true)
|
|
5703
5917
|
], 2),
|
|
5704
5918
|
createCommentVNode(" Preset colors "),
|
|
5705
5919
|
__props.showPreset ? (openBlock(), createElementBlock("div", {
|
|
@@ -5722,9 +5936,9 @@ var color_picker_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */
|
|
|
5722
5936
|
}), [["__scopeId", "data-v-24772c45"]]);
|
|
5723
5937
|
//#endregion
|
|
5724
5938
|
//#region src/components/base/calendar/calendar.vue
|
|
5725
|
-
const _hoisted_1$
|
|
5726
|
-
const _hoisted_2$
|
|
5727
|
-
const _hoisted_3$
|
|
5939
|
+
const _hoisted_1$33 = ["onClick"];
|
|
5940
|
+
const _hoisted_2$24 = ["onClick"];
|
|
5941
|
+
const _hoisted_3$19 = ["onClick"];
|
|
5728
5942
|
var calendar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
5729
5943
|
name: "YdCalendar",
|
|
5730
5944
|
__name: "calendar",
|
|
@@ -5936,7 +6150,7 @@ var calendar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
5936
6150
|
[e("year-cell--today")]: y === currentYear.value
|
|
5937
6151
|
}]),
|
|
5938
6152
|
onClick: ($event) => selectYear(y)
|
|
5939
|
-
}, toDisplayString(y), 11, _hoisted_1$
|
|
6153
|
+
}, toDisplayString(y), 11, _hoisted_1$33);
|
|
5940
6154
|
}), 128))], 2)], 2)) : view.value === "month" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Month View "), createElementVNode("div", { class: normalizeClass(e("view")) }, [createElementVNode("div", { class: normalizeClass(e("month-grid")) }, [(openBlock(), createElementBlock(Fragment, null, renderList(months, (m, i) => {
|
|
5941
6155
|
return createElementVNode("button", {
|
|
5942
6156
|
key: i,
|
|
@@ -5945,7 +6159,7 @@ var calendar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
5945
6159
|
[e("month-cell--today")]: selectedYear.value === currentYear.value && i === currentMonth.value
|
|
5946
6160
|
}]),
|
|
5947
6161
|
onClick: ($event) => selectMonth(i)
|
|
5948
|
-
}, toDisplayString(m) + "月 ", 11, _hoisted_2$
|
|
6162
|
+
}, toDisplayString(m) + "月 ", 11, _hoisted_2$24);
|
|
5949
6163
|
}), 64))], 2)], 2)], 2112)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" Month View (Calendar) "), createElementVNode("div", { class: normalizeClass(e("view")) }, [
|
|
5950
6164
|
createCommentVNode(" Weekdays header "),
|
|
5951
6165
|
createElementVNode("div", { class: normalizeClass(e("weekdays")) }, [(openBlock(), createElementBlock(Fragment, null, renderList(weekdays, (w) => {
|
|
@@ -5966,7 +6180,7 @@ var calendar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
5966
6180
|
}, [renderSlot(_ctx.$slots, "date-cell", {
|
|
5967
6181
|
day,
|
|
5968
6182
|
currentMonth: day.currentMonth
|
|
5969
|
-
}, () => [createTextVNode(toDisplayString(day.date.getDate()), 1)], true)], 14, _hoisted_3$
|
|
6183
|
+
}, () => [createTextVNode(toDisplayString(day.date.getDate()), 1)], true)], 14, _hoisted_3$19);
|
|
5970
6184
|
}), 128))], 2)
|
|
5971
6185
|
], 2)], 2112)),
|
|
5972
6186
|
createCommentVNode(" Footer "),
|
|
@@ -5982,6 +6196,150 @@ var calendar_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
5982
6196
|
}
|
|
5983
6197
|
}), [["__scopeId", "data-v-b7db4b77"]]);
|
|
5984
6198
|
//#endregion
|
|
6199
|
+
//#region src/components/base/markdown/markdown.vue
|
|
6200
|
+
const _hoisted_1$32 = {
|
|
6201
|
+
key: 0,
|
|
6202
|
+
class: "yd-markdown__editor"
|
|
6203
|
+
};
|
|
6204
|
+
const _hoisted_2$23 = ["placeholder"];
|
|
6205
|
+
const _hoisted_3$18 = ["innerHTML"];
|
|
6206
|
+
const _hoisted_4$17 = {
|
|
6207
|
+
key: 2,
|
|
6208
|
+
class: "yd-markdown__toolbar"
|
|
6209
|
+
};
|
|
6210
|
+
const _hoisted_5$11 = {
|
|
6211
|
+
key: 3,
|
|
6212
|
+
class: "yd-markdown__split"
|
|
6213
|
+
};
|
|
6214
|
+
const _hoisted_6$10 = { class: "yd-markdown__split-editor" };
|
|
6215
|
+
const _hoisted_7$9 = ["placeholder"];
|
|
6216
|
+
const _hoisted_8$8 = ["innerHTML"];
|
|
6217
|
+
var markdown_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
6218
|
+
name: "YdMarkdown",
|
|
6219
|
+
__name: "markdown",
|
|
6220
|
+
props: {
|
|
6221
|
+
modelValue: { default: "" },
|
|
6222
|
+
editable: {
|
|
6223
|
+
type: Boolean,
|
|
6224
|
+
default: false
|
|
6225
|
+
},
|
|
6226
|
+
showToolbar: {
|
|
6227
|
+
type: Boolean,
|
|
6228
|
+
default: true
|
|
6229
|
+
},
|
|
6230
|
+
size: {},
|
|
6231
|
+
placeholder: { default: "输入Markdown..." },
|
|
6232
|
+
highlight: {
|
|
6233
|
+
type: Boolean,
|
|
6234
|
+
default: true
|
|
6235
|
+
}
|
|
6236
|
+
},
|
|
6237
|
+
emits: ["update:modelValue", "change"],
|
|
6238
|
+
setup(__props, { emit: __emit }) {
|
|
6239
|
+
const props = __props;
|
|
6240
|
+
const emit = __emit;
|
|
6241
|
+
const { size: configSize } = useConfig();
|
|
6242
|
+
const textareaRef = ref(null);
|
|
6243
|
+
const mode = ref("edit");
|
|
6244
|
+
const resolvedSize = computed(() => props.size ?? configSize.value);
|
|
6245
|
+
const localValue = ref(props.modelValue);
|
|
6246
|
+
watch(() => props.modelValue, (val) => {
|
|
6247
|
+
localValue.value = val;
|
|
6248
|
+
});
|
|
6249
|
+
marked.setOptions({
|
|
6250
|
+
gfm: true,
|
|
6251
|
+
breaks: true
|
|
6252
|
+
});
|
|
6253
|
+
const renderer = new marked.Renderer();
|
|
6254
|
+
renderer.code = ({ text, lang }) => {
|
|
6255
|
+
if (props.highlight && lang && hljs.getLanguage(lang)) return `<pre><code class="hljs language-${lang}">${hljs.highlight(text, { language: lang }).value}</code></pre>`;
|
|
6256
|
+
return `<pre><code class="hljs">${text}</code></pre>`;
|
|
6257
|
+
};
|
|
6258
|
+
marked.use({ renderer });
|
|
6259
|
+
const renderedHtml = computed(() => {
|
|
6260
|
+
if (!localValue.value) return "";
|
|
6261
|
+
try {
|
|
6262
|
+
return marked.parse(localValue.value);
|
|
6263
|
+
} catch (e) {
|
|
6264
|
+
console.error("Markdown parse error:", e);
|
|
6265
|
+
return localValue.value;
|
|
6266
|
+
}
|
|
6267
|
+
});
|
|
6268
|
+
const classes = computed(() => cn("yd-markdown", `yd-markdown--${resolvedSize.value}`));
|
|
6269
|
+
const textareaClasses = computed(() => cn("yd-markdown__textarea", props.editable && "yd-markdown__textarea--editable"));
|
|
6270
|
+
const contentClasses = computed(() => cn("yd-markdown__content"));
|
|
6271
|
+
function handleInput(e) {
|
|
6272
|
+
const value = e.target.value;
|
|
6273
|
+
localValue.value = value;
|
|
6274
|
+
emit("update:modelValue", value);
|
|
6275
|
+
emit("change", value);
|
|
6276
|
+
}
|
|
6277
|
+
function handleKeydown(e) {
|
|
6278
|
+
if (e.key === "Tab") {
|
|
6279
|
+
e.preventDefault();
|
|
6280
|
+
const textarea = textareaRef.value;
|
|
6281
|
+
if (textarea) {
|
|
6282
|
+
const start = textarea.selectionStart;
|
|
6283
|
+
const end = textarea.selectionEnd;
|
|
6284
|
+
const value = textarea.value;
|
|
6285
|
+
localValue.value = value.substring(0, start) + " " + value.substring(end);
|
|
6286
|
+
emit("update:modelValue", localValue.value);
|
|
6287
|
+
setTimeout(() => {
|
|
6288
|
+
textarea.selectionStart = textarea.selectionEnd = start + 2;
|
|
6289
|
+
}, 0);
|
|
6290
|
+
}
|
|
6291
|
+
}
|
|
6292
|
+
}
|
|
6293
|
+
onMounted(() => {
|
|
6294
|
+
if (props.editable && textareaRef.value) textareaRef.value.focus();
|
|
6295
|
+
});
|
|
6296
|
+
return (_ctx, _cache) => {
|
|
6297
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(classes.value) }, [
|
|
6298
|
+
createCommentVNode(" 编辑模式 "),
|
|
6299
|
+
__props.editable ? (openBlock(), createElementBlock("div", _hoisted_1$32, [withDirectives(createElementVNode("textarea", {
|
|
6300
|
+
ref_key: "textareaRef",
|
|
6301
|
+
ref: textareaRef,
|
|
6302
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => localValue.value = $event),
|
|
6303
|
+
class: normalizeClass(textareaClasses.value),
|
|
6304
|
+
placeholder: __props.placeholder,
|
|
6305
|
+
onInput: handleInput,
|
|
6306
|
+
onKeydown: handleKeydown
|
|
6307
|
+
}, null, 42, _hoisted_2$23), [[vModelText, localValue.value]])])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" 预览模式 / 只读模式 "), createElementVNode("div", {
|
|
6308
|
+
class: normalizeClass(contentClasses.value),
|
|
6309
|
+
innerHTML: renderedHtml.value
|
|
6310
|
+
}, null, 10, _hoisted_3$18)], 2112)),
|
|
6311
|
+
createCommentVNode(" 工具栏 "),
|
|
6312
|
+
__props.showToolbar && __props.editable ? (openBlock(), createElementBlock("div", _hoisted_4$17, [
|
|
6313
|
+
createElementVNode("button", {
|
|
6314
|
+
type: "button",
|
|
6315
|
+
class: normalizeClass(["yd-markdown__tool", { "yd-markdown__tool--active": mode.value === "edit" }]),
|
|
6316
|
+
onClick: _cache[1] || (_cache[1] = ($event) => mode.value = "edit")
|
|
6317
|
+
}, " 编辑 ", 2),
|
|
6318
|
+
createElementVNode("button", {
|
|
6319
|
+
type: "button",
|
|
6320
|
+
class: normalizeClass(["yd-markdown__tool", { "yd-markdown__tool--active": mode.value === "preview" }]),
|
|
6321
|
+
onClick: _cache[2] || (_cache[2] = ($event) => mode.value = "preview")
|
|
6322
|
+
}, " 预览 ", 2),
|
|
6323
|
+
createElementVNode("button", {
|
|
6324
|
+
type: "button",
|
|
6325
|
+
class: normalizeClass(["yd-markdown__tool", { "yd-markdown__tool--active": mode.value === "split" }]),
|
|
6326
|
+
onClick: _cache[3] || (_cache[3] = ($event) => mode.value = "split")
|
|
6327
|
+
}, " 分屏 ", 2)
|
|
6328
|
+
])) : createCommentVNode("v-if", true),
|
|
6329
|
+
createCommentVNode(" 分屏模式 "),
|
|
6330
|
+
mode.value === "split" && __props.editable ? (openBlock(), createElementBlock("div", _hoisted_5$11, [createElementVNode("div", _hoisted_6$10, [withDirectives(createElementVNode("textarea", {
|
|
6331
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => localValue.value = $event),
|
|
6332
|
+
placeholder: __props.placeholder,
|
|
6333
|
+
onInput: handleInput
|
|
6334
|
+
}, null, 40, _hoisted_7$9), [[vModelText, localValue.value]])]), createElementVNode("div", {
|
|
6335
|
+
class: "yd-markdown__split-preview",
|
|
6336
|
+
innerHTML: renderedHtml.value
|
|
6337
|
+
}, null, 8, _hoisted_8$8)])) : createCommentVNode("v-if", true)
|
|
6338
|
+
], 2);
|
|
6339
|
+
};
|
|
6340
|
+
}
|
|
6341
|
+
}), [["__scopeId", "data-v-068d968a"]]);
|
|
6342
|
+
//#endregion
|
|
5985
6343
|
//#region src/components/base/chat-page/chat-page.vue
|
|
5986
6344
|
const _hoisted_1$31 = { class: "yd-chat-page__header" };
|
|
5987
6345
|
const _hoisted_2$22 = { class: "yd-chat-page__header-left" };
|
|
@@ -6015,37 +6373,43 @@ const _hoisted_20$1 = {
|
|
|
6015
6373
|
key: 0,
|
|
6016
6374
|
class: "yd-chat-page__reasoning"
|
|
6017
6375
|
};
|
|
6018
|
-
const _hoisted_21 = { class: "yd-chat-
|
|
6019
|
-
const _hoisted_22 = {
|
|
6376
|
+
const _hoisted_21 = { class: "yd-chat-page__reasoning-content" };
|
|
6377
|
+
const _hoisted_22 = { class: "yd-chat-page__message-bubble" };
|
|
6378
|
+
const _hoisted_23 = { class: "yd-chat-page__message-actions" };
|
|
6379
|
+
const _hoisted_24 = ["onClick", "title"];
|
|
6380
|
+
const _hoisted_25 = {
|
|
6381
|
+
key: 0,
|
|
6382
|
+
viewBox: "0 0 24 24",
|
|
6383
|
+
fill: "currentColor",
|
|
6384
|
+
width: "16",
|
|
6385
|
+
height: "16"
|
|
6386
|
+
};
|
|
6387
|
+
const _hoisted_26 = {
|
|
6388
|
+
key: 1,
|
|
6389
|
+
viewBox: "0 0 24 24",
|
|
6390
|
+
fill: "currentColor",
|
|
6391
|
+
width: "16",
|
|
6392
|
+
height: "16"
|
|
6393
|
+
};
|
|
6394
|
+
const _hoisted_27 = ["onClick"];
|
|
6395
|
+
const _hoisted_28 = {
|
|
6020
6396
|
key: 2,
|
|
6021
6397
|
class: "yd-chat-page__loading"
|
|
6022
6398
|
};
|
|
6023
|
-
const
|
|
6024
|
-
const
|
|
6025
|
-
const
|
|
6026
|
-
var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
6399
|
+
const _hoisted_29 = { class: "yd-chat-page__input-area" };
|
|
6400
|
+
const _hoisted_30 = { class: "yd-chat-page__input-wrapper" };
|
|
6401
|
+
const _hoisted_31 = ["placeholder", "disabled"];
|
|
6402
|
+
var chat_page_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
6027
6403
|
__name: "chat-page",
|
|
6028
6404
|
props: {
|
|
6029
|
-
size: {
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
},
|
|
6037
|
-
model: {
|
|
6038
|
-
type: String,
|
|
6039
|
-
default: "GPT-4"
|
|
6040
|
-
},
|
|
6041
|
-
models: {
|
|
6042
|
-
type: Array,
|
|
6043
|
-
default: () => [
|
|
6044
|
-
"GPT-4",
|
|
6045
|
-
"GPT-3.5",
|
|
6046
|
-
"Claude-3"
|
|
6047
|
-
]
|
|
6048
|
-
},
|
|
6405
|
+
size: { default: "md" },
|
|
6406
|
+
title: { default: "AI Assistant" },
|
|
6407
|
+
model: { default: "GPT-4" },
|
|
6408
|
+
models: { default: () => [
|
|
6409
|
+
"GPT-4",
|
|
6410
|
+
"GPT-3.5",
|
|
6411
|
+
"Claude-3"
|
|
6412
|
+
] },
|
|
6049
6413
|
showModelSelector: {
|
|
6050
6414
|
type: Boolean,
|
|
6051
6415
|
default: true
|
|
@@ -6054,45 +6418,24 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6054
6418
|
type: Boolean,
|
|
6055
6419
|
default: true
|
|
6056
6420
|
},
|
|
6057
|
-
sidebarWidth: {
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
},
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
},
|
|
6065
|
-
conversations: {
|
|
6066
|
-
type: Array,
|
|
6067
|
-
default: () => []
|
|
6068
|
-
},
|
|
6069
|
-
currentConversationId: {
|
|
6070
|
-
type: String,
|
|
6071
|
-
default: ""
|
|
6072
|
-
},
|
|
6073
|
-
userInfo: {
|
|
6074
|
-
type: Object,
|
|
6075
|
-
default: () => ({
|
|
6076
|
-
name: "User",
|
|
6077
|
-
avatar: ""
|
|
6078
|
-
})
|
|
6079
|
-
},
|
|
6421
|
+
sidebarWidth: { default: 280 },
|
|
6422
|
+
messages: { default: () => [] },
|
|
6423
|
+
conversations: { default: () => [] },
|
|
6424
|
+
currentConversationId: { default: "" },
|
|
6425
|
+
userInfo: { default: () => ({
|
|
6426
|
+
name: "User",
|
|
6427
|
+
avatar: ""
|
|
6428
|
+
}) },
|
|
6080
6429
|
streaming: {
|
|
6081
6430
|
type: Boolean,
|
|
6082
6431
|
default: false
|
|
6083
6432
|
},
|
|
6084
|
-
streamingContent: {
|
|
6085
|
-
type: String,
|
|
6086
|
-
default: ""
|
|
6087
|
-
},
|
|
6433
|
+
streamingContent: { default: "" },
|
|
6088
6434
|
showReasoning: {
|
|
6089
6435
|
type: Boolean,
|
|
6090
6436
|
default: true
|
|
6091
6437
|
},
|
|
6092
|
-
placeholder: {
|
|
6093
|
-
type: String,
|
|
6094
|
-
default: "Send a message..."
|
|
6095
|
-
},
|
|
6438
|
+
placeholder: { default: "Send a message..." },
|
|
6096
6439
|
disabled: {
|
|
6097
6440
|
type: Boolean,
|
|
6098
6441
|
default: false
|
|
@@ -6106,13 +6449,26 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6106
6449
|
"update-conversation",
|
|
6107
6450
|
"select-model",
|
|
6108
6451
|
"logout",
|
|
6109
|
-
"settings"
|
|
6452
|
+
"settings",
|
|
6453
|
+
"regenerate",
|
|
6454
|
+
"toggle-sidebar"
|
|
6110
6455
|
],
|
|
6111
6456
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
6112
6457
|
const props = __props;
|
|
6113
6458
|
const emit = __emit;
|
|
6114
6459
|
const inputValue = ref("");
|
|
6115
6460
|
const conversationRef = ref(null);
|
|
6461
|
+
const copiedId = ref(null);
|
|
6462
|
+
function handleCopyMessage(content, id) {
|
|
6463
|
+
navigator.clipboard.writeText(content);
|
|
6464
|
+
copiedId.value = id;
|
|
6465
|
+
setTimeout(() => {
|
|
6466
|
+
copiedId.value = null;
|
|
6467
|
+
}, 2e3);
|
|
6468
|
+
}
|
|
6469
|
+
function handleRegenerate(messageId) {
|
|
6470
|
+
emit("regenerate", messageId);
|
|
6471
|
+
}
|
|
6116
6472
|
const classes = computed(() => `yd-chat-page yd-chat-page--${props.size}`);
|
|
6117
6473
|
const sidebarStyle = computed(() => {
|
|
6118
6474
|
return { width: typeof props.sidebarWidth === "number" ? `${props.sidebarWidth}px` : props.sidebarWidth };
|
|
@@ -6143,6 +6499,11 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6143
6499
|
function scrollToBottom() {
|
|
6144
6500
|
if (conversationRef.value) conversationRef.value.scrollToBottom();
|
|
6145
6501
|
}
|
|
6502
|
+
function autoResize(event) {
|
|
6503
|
+
const textarea = event.target;
|
|
6504
|
+
textarea.style.height = "auto";
|
|
6505
|
+
textarea.style.height = Math.min(textarea.scrollHeight, 120) + "px";
|
|
6506
|
+
}
|
|
6146
6507
|
__expose({ scrollToBottom });
|
|
6147
6508
|
return (_ctx, _cache) => {
|
|
6148
6509
|
return openBlock(), createElementBlock("div", { class: normalizeClass(classes.value) }, [
|
|
@@ -6151,14 +6512,14 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6151
6512
|
key: 0,
|
|
6152
6513
|
class: "yd-chat-page__menu-btn",
|
|
6153
6514
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("toggle-sidebar"))
|
|
6154
|
-
}, [..._cache[
|
|
6515
|
+
}, [..._cache[10] || (_cache[10] = [createElementVNode("svg", {
|
|
6155
6516
|
viewBox: "0 0 24 24",
|
|
6156
6517
|
fill: "currentColor",
|
|
6157
6518
|
width: "20",
|
|
6158
6519
|
height: "20"
|
|
6159
6520
|
}, [createElementVNode("path", { d: "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" })], -1)])])) : createCommentVNode("v-if", true), createElementVNode("h1", _hoisted_3$17, toDisplayString(__props.title), 1)]), createElementVNode("div", _hoisted_4$16, [
|
|
6160
6521
|
createCommentVNode(" Model Selector "),
|
|
6161
|
-
__props.showModelSelector ? (openBlock(), createElementBlock("div", _hoisted_5$10, [createElementVNode("button", _hoisted_6$9, [_cache[
|
|
6522
|
+
__props.showModelSelector ? (openBlock(), createElementBlock("div", _hoisted_5$10, [createElementVNode("button", _hoisted_6$9, [_cache[11] || (_cache[11] = createElementVNode("svg", {
|
|
6162
6523
|
viewBox: "0 0 24 24",
|
|
6163
6524
|
fill: "currentColor",
|
|
6164
6525
|
width: "16",
|
|
@@ -6168,7 +6529,7 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6168
6529
|
createElementVNode("div", _hoisted_7$8, [createElementVNode("button", {
|
|
6169
6530
|
class: "yd-chat-page__user-btn",
|
|
6170
6531
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("settings"))
|
|
6171
|
-
}, [..._cache[
|
|
6532
|
+
}, [..._cache[12] || (_cache[12] = [createElementVNode("svg", {
|
|
6172
6533
|
viewBox: "0 0 24 24",
|
|
6173
6534
|
fill: "currentColor",
|
|
6174
6535
|
width: "20",
|
|
@@ -6176,7 +6537,7 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6176
6537
|
}, [createElementVNode("path", { d: "M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" })], -1)])]), createElementVNode("button", {
|
|
6177
6538
|
class: "yd-chat-page__user-btn",
|
|
6178
6539
|
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("logout"))
|
|
6179
|
-
}, [..._cache[
|
|
6540
|
+
}, [..._cache[13] || (_cache[13] = [createElementVNode("svg", {
|
|
6180
6541
|
viewBox: "0 0 24 24",
|
|
6181
6542
|
fill: "currentColor",
|
|
6182
6543
|
width: "20",
|
|
@@ -6195,7 +6556,7 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6195
6556
|
block: "",
|
|
6196
6557
|
onClick: handleNewConversation
|
|
6197
6558
|
}, {
|
|
6198
|
-
default: withCtx(() => [..._cache[
|
|
6559
|
+
default: withCtx(() => [..._cache[14] || (_cache[14] = [createElementVNode("svg", {
|
|
6199
6560
|
viewBox: "0 0 24 24",
|
|
6200
6561
|
fill: "currentColor",
|
|
6201
6562
|
width: "16",
|
|
@@ -6208,7 +6569,7 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6208
6569
|
class: normalizeClass(["yd-chat-page__conversation-item", conv.id === __props.currentConversationId && "active"]),
|
|
6209
6570
|
onClick: ($event) => handleSelectConversation(conv.id)
|
|
6210
6571
|
}, [
|
|
6211
|
-
_cache[
|
|
6572
|
+
_cache[16] || (_cache[16] = createElementVNode("div", { class: "yd-chat-page__conv-icon" }, [createElementVNode("svg", {
|
|
6212
6573
|
viewBox: "0 0 24 24",
|
|
6213
6574
|
fill: "currentColor",
|
|
6214
6575
|
width: "18",
|
|
@@ -6218,7 +6579,7 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6218
6579
|
createElementVNode("button", {
|
|
6219
6580
|
class: "yd-chat-page__conv-delete",
|
|
6220
6581
|
onClick: ($event) => handleDeleteConversation(conv.id, $event)
|
|
6221
|
-
}, [..._cache[
|
|
6582
|
+
}, [..._cache[15] || (_cache[15] = [createElementVNode("svg", {
|
|
6222
6583
|
viewBox: "0 0 24 24",
|
|
6223
6584
|
fill: "currentColor",
|
|
6224
6585
|
width: "14",
|
|
@@ -6236,33 +6597,24 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6236
6597
|
}, [
|
|
6237
6598
|
createCommentVNode(" Welcome Screen "),
|
|
6238
6599
|
allMessages.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_16$2, [
|
|
6239
|
-
_cache[
|
|
6600
|
+
_cache[20] || (_cache[20] = createElementVNode("div", { class: "yd-chat-page__welcome-icon" }, [createElementVNode("svg", {
|
|
6240
6601
|
viewBox: "0 0 24 24",
|
|
6241
6602
|
fill: "currentColor",
|
|
6242
6603
|
width: "64",
|
|
6243
6604
|
height: "64"
|
|
6244
6605
|
}, [createElementVNode("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" })])], -1)),
|
|
6245
|
-
_cache[
|
|
6606
|
+
_cache[21] || (_cache[21] = createElementVNode("h2", { class: "yd-chat-page__welcome-title" }, "How can I help you today?", -1)),
|
|
6246
6607
|
createElementVNode("div", _hoisted_17$1, [
|
|
6247
|
-
createVNode(button_default, {
|
|
6248
|
-
|
|
6249
|
-
onClick: _cache[3] || (_cache[3] = ($event) => handleSend("Help me write a poem", []))
|
|
6250
|
-
}, {
|
|
6251
|
-
default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode("Help me write a poem", -1)])]),
|
|
6608
|
+
createVNode(button_default, { onClick: _cache[3] || (_cache[3] = ($event) => handleSend("Help me write a poem", [])) }, {
|
|
6609
|
+
default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode("Help me write a poem", -1)])]),
|
|
6252
6610
|
_: 1
|
|
6253
6611
|
}),
|
|
6254
|
-
createVNode(button_default, {
|
|
6255
|
-
|
|
6256
|
-
onClick: _cache[4] || (_cache[4] = ($event) => handleSend("Explain quantum computing", []))
|
|
6257
|
-
}, {
|
|
6258
|
-
default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode("Explain quantum computing", -1)])]),
|
|
6612
|
+
createVNode(button_default, { onClick: _cache[4] || (_cache[4] = ($event) => handleSend("Explain quantum computing", [])) }, {
|
|
6613
|
+
default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode("Explain quantum computing", -1)])]),
|
|
6259
6614
|
_: 1
|
|
6260
6615
|
}),
|
|
6261
|
-
createVNode(button_default, {
|
|
6262
|
-
|
|
6263
|
-
onClick: _cache[5] || (_cache[5] = ($event) => handleSend("Write a code snippet", []))
|
|
6264
|
-
}, {
|
|
6265
|
-
default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode("Write a code snippet", -1)])]),
|
|
6616
|
+
createVNode(button_default, { onClick: _cache[5] || (_cache[5] = ($event) => handleSend("Write a code snippet", [])) }, {
|
|
6617
|
+
default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode("Write a code snippet", -1)])]),
|
|
6266
6618
|
_: 1
|
|
6267
6619
|
})
|
|
6268
6620
|
])
|
|
@@ -6270,42 +6622,97 @@ var chat_page_default = /* @__PURE__ */ export_helper_default({
|
|
|
6270
6622
|
return openBlock(), createElementBlock("div", {
|
|
6271
6623
|
key: msg.id,
|
|
6272
6624
|
class: normalizeClass(["yd-chat-page__message", `yd-chat-page__message--${msg.role}`])
|
|
6273
|
-
}, [
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6625
|
+
}, [
|
|
6626
|
+
createCommentVNode(" AI Avatar "),
|
|
6627
|
+
msg.role === "assistant" ? (openBlock(), createElementBlock("div", _hoisted_18$1, [..._cache[22] || (_cache[22] = [createElementVNode("svg", {
|
|
6628
|
+
viewBox: "0 0 24 24",
|
|
6629
|
+
fill: "currentColor",
|
|
6630
|
+
width: "24",
|
|
6631
|
+
height: "24"
|
|
6632
|
+
}, [createElementVNode("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" })], -1)])])) : createCommentVNode("v-if", true),
|
|
6633
|
+
createElementVNode("div", _hoisted_19$1, [
|
|
6634
|
+
createCommentVNode(" Reasoning Display "),
|
|
6635
|
+
__props.showReasoning && msg.reasoning ? (openBlock(), createElementBlock("div", _hoisted_20$1, [_cache[23] || (_cache[23] = createElementVNode("div", { class: "yd-chat-page__reasoning-header" }, [createElementVNode("svg", {
|
|
6636
|
+
viewBox: "0 0 24 24",
|
|
6637
|
+
fill: "currentColor",
|
|
6638
|
+
width: "14",
|
|
6639
|
+
height: "14"
|
|
6640
|
+
}, [createElementVNode("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm0-4h-2V7h2v8z" })]), createElementVNode("span", null, "思考中")], -1)), createElementVNode("div", _hoisted_21, toDisplayString(msg.reasoning), 1)])) : createCommentVNode("v-if", true),
|
|
6641
|
+
createCommentVNode(" Message Content with Markdown "),
|
|
6642
|
+
createElementVNode("div", _hoisted_22, [
|
|
6643
|
+
createVNode(markdown_default, {
|
|
6644
|
+
"model-value": msg.content,
|
|
6645
|
+
editable: false,
|
|
6646
|
+
"show-toolbar": false
|
|
6647
|
+
}, null, 8, ["model-value"]),
|
|
6648
|
+
createCommentVNode(" Message Actions "),
|
|
6649
|
+
createElementVNode("div", _hoisted_23, [createElementVNode("button", {
|
|
6650
|
+
class: "yd-chat-page__action-btn",
|
|
6651
|
+
onClick: ($event) => handleCopyMessage(msg.content, msg.id),
|
|
6652
|
+
title: copiedId.value === msg.id ? "已复制" : "复制"
|
|
6653
|
+
}, [copiedId.value !== msg.id ? (openBlock(), createElementBlock("svg", _hoisted_25, [..._cache[24] || (_cache[24] = [createElementVNode("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" }, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_26, [..._cache[25] || (_cache[25] = [createElementVNode("path", { d: "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" }, null, -1)])]))], 8, _hoisted_24), msg.role === "assistant" ? (openBlock(), createElementBlock("button", {
|
|
6654
|
+
key: 0,
|
|
6655
|
+
class: "yd-chat-page__action-btn",
|
|
6656
|
+
onClick: ($event) => handleRegenerate(msg.id),
|
|
6657
|
+
title: "重新生成"
|
|
6658
|
+
}, [..._cache[26] || (_cache[26] = [createElementVNode("svg", {
|
|
6659
|
+
viewBox: "0 0 24 24",
|
|
6660
|
+
fill: "currentColor",
|
|
6661
|
+
width: "16",
|
|
6662
|
+
height: "16"
|
|
6663
|
+
}, [createElementVNode("path", { d: "M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z" })], -1)])], 8, _hoisted_27)) : createCommentVNode("v-if", true)])
|
|
6664
|
+
])
|
|
6665
|
+
])
|
|
6666
|
+
], 2);
|
|
6279
6667
|
}), 128))], 64)),
|
|
6280
6668
|
createCommentVNode(" Streaming Indicator "),
|
|
6281
|
-
__props.streaming && !__props.streamingContent ? (openBlock(), createElementBlock("div",
|
|
6669
|
+
__props.streaming && !__props.streamingContent ? (openBlock(), createElementBlock("div", _hoisted_28, [..._cache[27] || (_cache[27] = [createElementVNode("span", null, "AI is thinking...", -1)])])) : createCommentVNode("v-if", true)
|
|
6282
6670
|
], 512),
|
|
6283
6671
|
createCommentVNode(" Input Area "),
|
|
6284
|
-
createElementVNode("div",
|
|
6285
|
-
"
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6672
|
+
createElementVNode("div", _hoisted_29, [
|
|
6673
|
+
createElementVNode("div", _hoisted_30, [
|
|
6674
|
+
createCommentVNode(" Input Actions "),
|
|
6675
|
+
_cache[29] || (_cache[29] = createElementVNode("div", { class: "yd-chat-page__input-actions" }, [createElementVNode("button", {
|
|
6676
|
+
class: "yd-chat-page__input-action",
|
|
6677
|
+
title: "添加附件"
|
|
6678
|
+
}, [createElementVNode("svg", {
|
|
6679
|
+
viewBox: "0 0 24 24",
|
|
6680
|
+
fill: "currentColor",
|
|
6681
|
+
width: "18",
|
|
6682
|
+
height: "18"
|
|
6683
|
+
}, [createElementVNode("path", { d: "M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z" })])])], -1)),
|
|
6684
|
+
withDirectives(createElementVNode("textarea", {
|
|
6685
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => inputValue.value = $event),
|
|
6686
|
+
class: "yd-chat-page__input",
|
|
6687
|
+
placeholder: __props.placeholder,
|
|
6688
|
+
disabled: __props.disabled,
|
|
6689
|
+
rows: "1",
|
|
6690
|
+
onKeydown: _cache[7] || (_cache[7] = withKeys(withModifiers(($event) => handleSend(inputValue.value, []), ["exact", "prevent"]), ["enter"])),
|
|
6691
|
+
onInput: _cache[8] || (_cache[8] = ($event) => autoResize($event))
|
|
6692
|
+
}, null, 40, _hoisted_31), [[vModelText, inputValue.value]]),
|
|
6693
|
+
createVNode(button_default, {
|
|
6694
|
+
type: "primary",
|
|
6695
|
+
disabled: __props.disabled || __props.streaming || !inputValue.value.trim(),
|
|
6696
|
+
onClick: _cache[9] || (_cache[9] = ($event) => handleSend(inputValue.value, []))
|
|
6697
|
+
}, {
|
|
6698
|
+
default: withCtx(() => [..._cache[28] || (_cache[28] = [createElementVNode("svg", {
|
|
6699
|
+
viewBox: "0 0 24 24",
|
|
6700
|
+
fill: "currentColor",
|
|
6701
|
+
width: "20",
|
|
6702
|
+
height: "20"
|
|
6703
|
+
}, [createElementVNode("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" })], -1)])]),
|
|
6704
|
+
_: 1
|
|
6705
|
+
}, 8, ["disabled"])
|
|
6706
|
+
]),
|
|
6707
|
+
createCommentVNode(" Input Hint "),
|
|
6708
|
+
_cache[30] || (_cache[30] = createElementVNode("div", { class: "yd-chat-page__input-hint" }, [createElementVNode("span", null, "按 Enter 发送,Shift + Enter 换行")], -1))
|
|
6709
|
+
])
|
|
6303
6710
|
])
|
|
6304
6711
|
])
|
|
6305
6712
|
], 2);
|
|
6306
6713
|
};
|
|
6307
6714
|
}
|
|
6308
|
-
}, [["__scopeId", "data-v-
|
|
6715
|
+
}), [["__scopeId", "data-v-35629158"]]);
|
|
6309
6716
|
//#endregion
|
|
6310
6717
|
//#region src/components/base/chat-bubble/chat-bubble.vue
|
|
6311
6718
|
const _hoisted_1$30 = {
|
|
@@ -9095,12 +9502,14 @@ var tabs_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
9095
9502
|
"context-menu",
|
|
9096
9503
|
"reorder",
|
|
9097
9504
|
"drag-start",
|
|
9098
|
-
"drag-end"
|
|
9505
|
+
"drag-end",
|
|
9506
|
+
"refresh"
|
|
9099
9507
|
],
|
|
9100
|
-
setup(__props, { emit: __emit }) {
|
|
9508
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
9101
9509
|
const slots = useSlots();
|
|
9102
9510
|
/**
|
|
9103
|
-
*
|
|
9511
|
+
* YdTabs Props
|
|
9512
|
+
* @description 标签页组件,支持多种样式和拖拽排序
|
|
9104
9513
|
*/
|
|
9105
9514
|
const props = __props;
|
|
9106
9515
|
const hasContent = computed(() => !!slots.default);
|
|
@@ -9228,17 +9637,38 @@ var tabs_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
9228
9637
|
contextMenuVisible.value = true;
|
|
9229
9638
|
}
|
|
9230
9639
|
function handleCtxClose() {
|
|
9231
|
-
if (contextTab.value)
|
|
9640
|
+
if (contextTab.value) {
|
|
9641
|
+
emit("context-menu", "close", contextTab.value);
|
|
9642
|
+
emit("edit", "remove", contextTab.value);
|
|
9643
|
+
}
|
|
9644
|
+
contextMenuVisible.value = false;
|
|
9645
|
+
}
|
|
9646
|
+
function handleCtxRefresh() {
|
|
9647
|
+
if (contextTab.value) {
|
|
9648
|
+
emit("context-menu", "refresh", contextTab.value);
|
|
9649
|
+
emit("refresh", contextTab.value);
|
|
9650
|
+
}
|
|
9651
|
+
contextMenuVisible.value = false;
|
|
9652
|
+
}
|
|
9653
|
+
function handleCtxCloseRight() {
|
|
9654
|
+
if (contextTab.value) {
|
|
9655
|
+
emit("context-menu", "closeRight", contextTab.value);
|
|
9656
|
+
closeRight(contextTab.value.key);
|
|
9657
|
+
}
|
|
9232
9658
|
contextMenuVisible.value = false;
|
|
9233
9659
|
}
|
|
9234
9660
|
function handleCtxCloseOthers() {
|
|
9235
9661
|
if (contextTab.value) {
|
|
9236
|
-
|
|
9662
|
+
emit("context-menu", "closeOthers", contextTab.value);
|
|
9663
|
+
const currentTabs = mergedTabs.value;
|
|
9664
|
+
for (const item of currentTabs) if (item.key !== contextTab.value.key && item.closable !== false) emit("edit", "remove", item);
|
|
9237
9665
|
}
|
|
9238
9666
|
contextMenuVisible.value = false;
|
|
9239
9667
|
}
|
|
9240
9668
|
function handleCtxCloseAll() {
|
|
9241
|
-
|
|
9669
|
+
emit("context-menu", "closeAll", contextTab.value);
|
|
9670
|
+
const currentTabs = mergedTabs.value;
|
|
9671
|
+
for (const item of currentTabs) if (item.closable !== false) emit("edit", "remove", item);
|
|
9242
9672
|
contextMenuVisible.value = false;
|
|
9243
9673
|
}
|
|
9244
9674
|
function handleClickOutside() {
|
|
@@ -9268,6 +9698,14 @@ var tabs_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
9268
9698
|
tooltipVisible.value = false;
|
|
9269
9699
|
hoveredTab.value = null;
|
|
9270
9700
|
}
|
|
9701
|
+
function handleTooltipRefresh() {
|
|
9702
|
+
if (hoveredTab.value) emit("refresh", hoveredTab.value);
|
|
9703
|
+
hideTooltip();
|
|
9704
|
+
}
|
|
9705
|
+
function handleTooltipClose() {
|
|
9706
|
+
if (hoveredTab.value) emit("edit", "remove", hoveredTab.value);
|
|
9707
|
+
hideTooltip();
|
|
9708
|
+
}
|
|
9271
9709
|
function handleDragStart(index, event) {
|
|
9272
9710
|
dragIndex.value = index;
|
|
9273
9711
|
if (event.dataTransfer) {
|
|
@@ -9484,6 +9922,111 @@ var tabs_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
9484
9922
|
watch(() => props.items, () => {
|
|
9485
9923
|
setTimeout(checkScroll, 0);
|
|
9486
9924
|
}, { deep: true });
|
|
9925
|
+
/**
|
|
9926
|
+
* 添加 Tab
|
|
9927
|
+
* @param tab - 新 Tab 配置
|
|
9928
|
+
*/
|
|
9929
|
+
function addTab(tab) {
|
|
9930
|
+
const newTab = {
|
|
9931
|
+
label: tab.label,
|
|
9932
|
+
key: tab.key,
|
|
9933
|
+
closable: tab.closable ?? true,
|
|
9934
|
+
disabled: tab.disabled ?? false,
|
|
9935
|
+
icon: tab.icon,
|
|
9936
|
+
description: tab.description
|
|
9937
|
+
};
|
|
9938
|
+
if (mergedTabs.value.some((t) => t.key === newTab.key)) {
|
|
9939
|
+
console.warn(`[YdTabs] Tab with key "${newTab.key}" already exists`);
|
|
9940
|
+
return;
|
|
9941
|
+
}
|
|
9942
|
+
if (props.modelTabs.length > 0) emit("update:modelTabs", [...props.modelTabs, newTab]);
|
|
9943
|
+
else internalTabs.value = [...internalTabs.value, newTab];
|
|
9944
|
+
emit("update:modelValue", newTab.key);
|
|
9945
|
+
emit("edit", "add", newTab);
|
|
9946
|
+
saveToStorage(props.modelTabs.length > 0 ? [...props.modelTabs, newTab] : [...internalTabs.value, newTab]);
|
|
9947
|
+
}
|
|
9948
|
+
/**
|
|
9949
|
+
* 关闭 Tab
|
|
9950
|
+
* @param key - Tab 的 key
|
|
9951
|
+
*/
|
|
9952
|
+
function closeTab(key) {
|
|
9953
|
+
const tab = mergedTabs.value.find((t) => t.key === key);
|
|
9954
|
+
if (!tab) {
|
|
9955
|
+
console.warn(`[YdTabs] Tab with key "${key}" not found`);
|
|
9956
|
+
return;
|
|
9957
|
+
}
|
|
9958
|
+
if (props.modelTabs.length > 0) emit("update:modelTabs", props.modelTabs.filter((t) => t.key !== key));
|
|
9959
|
+
else internalTabs.value = internalTabs.value.filter((t) => t.key !== key);
|
|
9960
|
+
emit("edit", "remove", tab);
|
|
9961
|
+
if (props.modelValue === key) {
|
|
9962
|
+
const remainingTabs = mergedTabs.value.filter((t) => t.key !== key);
|
|
9963
|
+
if (remainingTabs.length > 0) emit("update:modelValue", remainingTabs[remainingTabs.length - 1].key);
|
|
9964
|
+
}
|
|
9965
|
+
saveToStorage(props.modelTabs.length > 0 ? props.modelTabs.filter((t) => t.key !== key) : internalTabs.value);
|
|
9966
|
+
}
|
|
9967
|
+
/**
|
|
9968
|
+
* 刷新 Tab(触发 refresh 事件)
|
|
9969
|
+
* @param key - Tab 的 key,不传则刷新当前激活的 Tab
|
|
9970
|
+
*/
|
|
9971
|
+
function refreshTab(key) {
|
|
9972
|
+
const targetKey = key || props.modelValue;
|
|
9973
|
+
const tab = mergedTabs.value.find((t) => t.key === targetKey);
|
|
9974
|
+
if (!tab) {
|
|
9975
|
+
console.warn(`[YdTabs] Tab with key "${targetKey}" not found`);
|
|
9976
|
+
return;
|
|
9977
|
+
}
|
|
9978
|
+
emit("refresh", tab);
|
|
9979
|
+
}
|
|
9980
|
+
/**
|
|
9981
|
+
* 获取所有 Tabs
|
|
9982
|
+
*/
|
|
9983
|
+
function getTabs() {
|
|
9984
|
+
return [...mergedTabs.value];
|
|
9985
|
+
}
|
|
9986
|
+
/**
|
|
9987
|
+
* 设置激活 Tab
|
|
9988
|
+
* @param key - Tab 的 key
|
|
9989
|
+
*/
|
|
9990
|
+
function setActiveTab(key) {
|
|
9991
|
+
const tab = mergedTabs.value.find((t) => t.key === key);
|
|
9992
|
+
if (!tab) {
|
|
9993
|
+
console.warn(`[YdTabs] Tab with key "${key}" not found`);
|
|
9994
|
+
return;
|
|
9995
|
+
}
|
|
9996
|
+
if (tab.disabled) {
|
|
9997
|
+
console.warn(`[YdTabs] Tab with key "${key}" is disabled`);
|
|
9998
|
+
return;
|
|
9999
|
+
}
|
|
10000
|
+
emit("update:modelValue", key);
|
|
10001
|
+
}
|
|
10002
|
+
/**
|
|
10003
|
+
* 关闭右侧所有 Tab
|
|
10004
|
+
* @param key - 基准 Tab 的 key
|
|
10005
|
+
*/
|
|
10006
|
+
function closeRight(key) {
|
|
10007
|
+
const index = mergedTabs.value.findIndex((t) => t.key === key);
|
|
10008
|
+
if (index === -1) {
|
|
10009
|
+
console.warn(`[YdTabs] Tab with key "${key}" not found`);
|
|
10010
|
+
return;
|
|
10011
|
+
}
|
|
10012
|
+
const rightTabs = mergedTabs.value.slice(index + 1).filter((t) => t.closable !== false);
|
|
10013
|
+
if (rightTabs.length === 0) return;
|
|
10014
|
+
const rightKeys = rightTabs.map((t) => t.key);
|
|
10015
|
+
if (props.modelTabs.length > 0) emit("update:modelTabs", props.modelTabs.filter((t) => !rightKeys.includes(t.key)));
|
|
10016
|
+
else internalTabs.value = internalTabs.value.filter((t) => !rightKeys.includes(t.key));
|
|
10017
|
+
rightTabs.forEach((tab) => emit("edit", "remove", tab));
|
|
10018
|
+
saveToStorage(props.modelTabs.length > 0 ? props.modelTabs.filter((t) => !rightKeys.includes(t.key)) : internalTabs.value);
|
|
10019
|
+
}
|
|
10020
|
+
__expose({
|
|
10021
|
+
addTab,
|
|
10022
|
+
closeTab,
|
|
10023
|
+
refreshTab,
|
|
10024
|
+
getTabs,
|
|
10025
|
+
setActiveTab,
|
|
10026
|
+
closeRight,
|
|
10027
|
+
scrollLeft,
|
|
10028
|
+
scrollRight
|
|
10029
|
+
});
|
|
9487
10030
|
onMounted(() => {
|
|
9488
10031
|
document.addEventListener("click", handleClickOutside);
|
|
9489
10032
|
setTimeout(checkScroll, 0);
|
|
@@ -9501,7 +10044,7 @@ var tabs_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
9501
10044
|
key: 0,
|
|
9502
10045
|
class: normalizeClass([e("arrow"), e("arrow--left")]),
|
|
9503
10046
|
onClick: scrollLeft
|
|
9504
|
-
}, [..._cache[
|
|
10047
|
+
}, [..._cache[3] || (_cache[3] = [createElementVNode("svg", {
|
|
9505
10048
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9506
10049
|
width: "14",
|
|
9507
10050
|
height: "14",
|
|
@@ -9562,7 +10105,7 @@ var tabs_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
9562
10105
|
key: 1,
|
|
9563
10106
|
class: normalizeClass(e("close")),
|
|
9564
10107
|
onClick: withModifiers(($event) => handleTabClose(tab), ["stop"])
|
|
9565
|
-
}, [..._cache[
|
|
10108
|
+
}, [..._cache[4] || (_cache[4] = [createElementVNode("svg", {
|
|
9566
10109
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9567
10110
|
width: "12",
|
|
9568
10111
|
height: "12",
|
|
@@ -9589,7 +10132,7 @@ var tabs_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
9589
10132
|
key: 1,
|
|
9590
10133
|
class: normalizeClass(e("add")),
|
|
9591
10134
|
onClick: handleAdd
|
|
9592
|
-
}, [..._cache[
|
|
10135
|
+
}, [..._cache[5] || (_cache[5] = [createElementVNode("svg", {
|
|
9593
10136
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9594
10137
|
width: "14",
|
|
9595
10138
|
height: "14",
|
|
@@ -9616,7 +10159,7 @@ var tabs_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
9616
10159
|
key: 1,
|
|
9617
10160
|
class: normalizeClass([e("arrow"), e("arrow--right")]),
|
|
9618
10161
|
onClick: scrollRight
|
|
9619
|
-
}, [..._cache[
|
|
10162
|
+
}, [..._cache[6] || (_cache[6] = [createElementVNode("svg", {
|
|
9620
10163
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9621
10164
|
width: "14",
|
|
9622
10165
|
height: "14",
|
|
@@ -9638,10 +10181,18 @@ var tabs_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
9638
10181
|
style: normalizeStyle(contextMenuStyle.value),
|
|
9639
10182
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
|
|
9640
10183
|
}, [
|
|
10184
|
+
createElementVNode("div", {
|
|
10185
|
+
class: normalizeClass(e("ctx-item")),
|
|
10186
|
+
onClick: handleCtxRefresh
|
|
10187
|
+
}, "刷新", 2),
|
|
9641
10188
|
createElementVNode("div", {
|
|
9642
10189
|
class: normalizeClass(e("ctx-item")),
|
|
9643
10190
|
onClick: handleCtxClose
|
|
9644
10191
|
}, "关闭", 2),
|
|
10192
|
+
createElementVNode("div", {
|
|
10193
|
+
class: normalizeClass(e("ctx-item")),
|
|
10194
|
+
onClick: handleCtxCloseRight
|
|
10195
|
+
}, "关闭右侧", 2),
|
|
9645
10196
|
createElementVNode("div", {
|
|
9646
10197
|
class: normalizeClass(e("ctx-item")),
|
|
9647
10198
|
onClick: handleCtxCloseOthers
|
|
@@ -9659,15 +10210,61 @@ var tabs_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineC
|
|
|
9659
10210
|
e("tooltip--visible"),
|
|
9660
10211
|
effectiveTheme.value === "dark" ? e("tooltip--dark") : ""
|
|
9661
10212
|
]),
|
|
9662
|
-
style: normalizeStyle(tooltipStyle.value)
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
class: normalizeClass(e("tooltip-
|
|
9666
|
-
|
|
10213
|
+
style: normalizeStyle(tooltipStyle.value),
|
|
10214
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"]))
|
|
10215
|
+
}, [
|
|
10216
|
+
createElementVNode("div", { class: normalizeClass(e("tooltip-title")) }, toDisplayString(hoveredTab.value?.label), 3),
|
|
10217
|
+
hoveredTab.value?.description ? (openBlock(), createElementBlock("div", {
|
|
10218
|
+
key: 0,
|
|
10219
|
+
class: normalizeClass(e("tooltip-desc"))
|
|
10220
|
+
}, toDisplayString(hoveredTab.value.description), 3)) : createCommentVNode("v-if", true),
|
|
10221
|
+
createElementVNode("div", { class: normalizeClass(e("tooltip-actions")) }, [createElementVNode("span", {
|
|
10222
|
+
class: normalizeClass(e("tooltip-action")),
|
|
10223
|
+
onClick: handleTooltipRefresh
|
|
10224
|
+
}, [..._cache[7] || (_cache[7] = [createElementVNode("svg", {
|
|
10225
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10226
|
+
width: "12",
|
|
10227
|
+
height: "12",
|
|
10228
|
+
viewBox: "0 0 24 24",
|
|
10229
|
+
fill: "none",
|
|
10230
|
+
stroke: "currentColor",
|
|
10231
|
+
"stroke-width": "2",
|
|
10232
|
+
"stroke-linecap": "round",
|
|
10233
|
+
"stroke-linejoin": "round"
|
|
10234
|
+
}, [
|
|
10235
|
+
createElementVNode("polyline", { points: "23 4 23 10 17 10" }),
|
|
10236
|
+
createElementVNode("polyline", { points: "1 20 1 14 7 14" }),
|
|
10237
|
+
createElementVNode("path", { d: "M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" })
|
|
10238
|
+
], -1), createTextVNode(" 刷新 ", -1)])], 2), hoveredTab.value?.closable ? (openBlock(), createElementBlock("span", {
|
|
10239
|
+
key: 0,
|
|
10240
|
+
class: normalizeClass(e("tooltip-action")),
|
|
10241
|
+
onClick: handleTooltipClose
|
|
10242
|
+
}, [..._cache[8] || (_cache[8] = [createElementVNode("svg", {
|
|
10243
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10244
|
+
width: "12",
|
|
10245
|
+
height: "12",
|
|
10246
|
+
viewBox: "0 0 24 24",
|
|
10247
|
+
fill: "none",
|
|
10248
|
+
stroke: "currentColor",
|
|
10249
|
+
"stroke-width": "2",
|
|
10250
|
+
"stroke-linecap": "round",
|
|
10251
|
+
"stroke-linejoin": "round"
|
|
10252
|
+
}, [createElementVNode("line", {
|
|
10253
|
+
x1: "18",
|
|
10254
|
+
y1: "6",
|
|
10255
|
+
x2: "6",
|
|
10256
|
+
y2: "18"
|
|
10257
|
+
}), createElementVNode("line", {
|
|
10258
|
+
x1: "6",
|
|
10259
|
+
y1: "6",
|
|
10260
|
+
x2: "18",
|
|
10261
|
+
y2: "18"
|
|
10262
|
+
})], -1), createTextVNode(" 关闭 ", -1)])], 2)) : createCommentVNode("v-if", true)], 2)
|
|
10263
|
+
], 6)) : createCommentVNode("v-if", true)]))
|
|
9667
10264
|
], 2);
|
|
9668
10265
|
};
|
|
9669
10266
|
}
|
|
9670
|
-
}), [["__scopeId", "data-v-
|
|
10267
|
+
}), [["__scopeId", "data-v-c08e5670"]]);
|
|
9671
10268
|
//#endregion
|
|
9672
10269
|
//#region src/components/navigation/dropdown/dropdown.vue
|
|
9673
10270
|
const _hoisted_1$19 = [
|
|
@@ -9691,7 +10288,7 @@ var dropdown_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
9691
10288
|
triggerLabel: { default: "打开菜单" }
|
|
9692
10289
|
},
|
|
9693
10290
|
emits: ["select"],
|
|
9694
|
-
setup(__props, { emit: __emit }) {
|
|
10291
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
9695
10292
|
const props = __props;
|
|
9696
10293
|
const emit = __emit;
|
|
9697
10294
|
const visible = ref(false);
|
|
@@ -9799,6 +10396,14 @@ var dropdown_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
9799
10396
|
document.removeEventListener("click", handleClickOutside);
|
|
9800
10397
|
window.removeEventListener("scroll", debouncedScrollHandler, true);
|
|
9801
10398
|
});
|
|
10399
|
+
__expose({
|
|
10400
|
+
open: () => {
|
|
10401
|
+
visible.value = true;
|
|
10402
|
+
},
|
|
10403
|
+
close: () => {
|
|
10404
|
+
visible.value = false;
|
|
10405
|
+
}
|
|
10406
|
+
});
|
|
9802
10407
|
return (_ctx, _cache) => {
|
|
9803
10408
|
return openBlock(), createElementBlock("div", {
|
|
9804
10409
|
ref_key: "triggerRef",
|
|
@@ -9839,7 +10444,7 @@ var dropdown_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ def
|
|
|
9839
10444
|
})]))], 42, _hoisted_1$19);
|
|
9840
10445
|
};
|
|
9841
10446
|
}
|
|
9842
|
-
}), [["__scopeId", "data-v-
|
|
10447
|
+
}), [["__scopeId", "data-v-eeb76db2"]]);
|
|
9843
10448
|
//#endregion
|
|
9844
10449
|
//#region src/components/layout/layout/layout-header.vue
|
|
9845
10450
|
const _hoisted_1$18 = ["title"];
|
|
@@ -10435,7 +11040,7 @@ var drawer_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
10435
11040
|
"open",
|
|
10436
11041
|
"close"
|
|
10437
11042
|
],
|
|
10438
|
-
setup(__props, { emit: __emit }) {
|
|
11043
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
10439
11044
|
/**
|
|
10440
11045
|
* YdDrawer Props
|
|
10441
11046
|
* @description 抽屉组件,从一侧滑入的对话框
|
|
@@ -10479,6 +11084,14 @@ var drawer_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
10479
11084
|
document.body.style.overflow = "";
|
|
10480
11085
|
previousFocus.value?.focus();
|
|
10481
11086
|
}
|
|
11087
|
+
__expose({
|
|
11088
|
+
open: () => {
|
|
11089
|
+
visibleValue.value = true;
|
|
11090
|
+
},
|
|
11091
|
+
close: () => {
|
|
11092
|
+
visibleValue.value = false;
|
|
11093
|
+
}
|
|
11094
|
+
});
|
|
10482
11095
|
return (_ctx, _cache) => {
|
|
10483
11096
|
return openBlock(), createBlock(Teleport, {
|
|
10484
11097
|
to: "body",
|
|
@@ -10543,7 +11156,7 @@ var drawer_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defin
|
|
|
10543
11156
|
})], 8, ["disabled"]);
|
|
10544
11157
|
};
|
|
10545
11158
|
}
|
|
10546
|
-
}), [["__scopeId", "data-v-
|
|
11159
|
+
}), [["__scopeId", "data-v-6c73aaee"]]);
|
|
10547
11160
|
//#endregion
|
|
10548
11161
|
//#region src/components/layout/layout/layout-types.ts
|
|
10549
11162
|
/** 默认尺寸 */
|
|
@@ -13514,7 +14127,7 @@ var modal_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
13514
14127
|
"confirm",
|
|
13515
14128
|
"cancel"
|
|
13516
14129
|
],
|
|
13517
|
-
setup(__props, { emit: __emit }) {
|
|
14130
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
13518
14131
|
/**
|
|
13519
14132
|
* YdModal Props
|
|
13520
14133
|
* @description 模态对话框组件,支持聚焦管理、ARIA 属性和键盘导航
|
|
@@ -13564,6 +14177,14 @@ var modal_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
13564
14177
|
document.body.style.overflow = "";
|
|
13565
14178
|
previousFocus.value?.focus();
|
|
13566
14179
|
}
|
|
14180
|
+
__expose({
|
|
14181
|
+
open: () => {
|
|
14182
|
+
visibleValue.value = true;
|
|
14183
|
+
},
|
|
14184
|
+
close: () => {
|
|
14185
|
+
visibleValue.value = false;
|
|
14186
|
+
}
|
|
14187
|
+
});
|
|
13567
14188
|
return (_ctx, _cache) => {
|
|
13568
14189
|
return openBlock(), createBlock(Teleport, {
|
|
13569
14190
|
to: "body",
|
|
@@ -13641,7 +14262,7 @@ var modal_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ define
|
|
|
13641
14262
|
})], 8, ["disabled"]);
|
|
13642
14263
|
};
|
|
13643
14264
|
}
|
|
13644
|
-
}), [["__scopeId", "data-v-
|
|
14265
|
+
}), [["__scopeId", "data-v-23e0a13d"]]);
|
|
13645
14266
|
var message_default = /* @__PURE__ */ export_helper_default(/* @__PURE__ */ defineComponent({
|
|
13646
14267
|
name: "YdMessage",
|
|
13647
14268
|
__name: "message",
|
|
@@ -14988,6 +15609,18 @@ const themes = {
|
|
|
14988
15609
|
} }
|
|
14989
15610
|
};
|
|
14990
15611
|
//#endregion
|
|
15612
|
+
//#region src/styles/tokens.ts
|
|
15613
|
+
/** z-index层级常量 (供外部使用) */
|
|
15614
|
+
const Z_INDEX = {
|
|
15615
|
+
DROPDOWN: 1e3,
|
|
15616
|
+
STICKY: 1020,
|
|
15617
|
+
FIXED: 1030,
|
|
15618
|
+
MODAL_BACKDROP: 1040,
|
|
15619
|
+
MODAL: 1050,
|
|
15620
|
+
POPOVER: 1060,
|
|
15621
|
+
TOOLTIP: 1070
|
|
15622
|
+
};
|
|
15623
|
+
//#endregion
|
|
14991
15624
|
//#region src/constants/index.ts
|
|
14992
15625
|
/**
|
|
14993
15626
|
* Application constants
|
|
@@ -14999,20 +15632,6 @@ const COMPONENT_PREFIX = "Yd";
|
|
|
14999
15632
|
const CSS_PREFIX = "yd";
|
|
15000
15633
|
/** 默认动画时长 (ms) */
|
|
15001
15634
|
const ANIMATION_DURATION = 200;
|
|
15002
|
-
/** 默认防抖延迟 (ms) */
|
|
15003
|
-
const DEBOUNCE_DELAY = 300;
|
|
15004
|
-
/** 默认节流间隔 (ms) */
|
|
15005
|
-
const THROTTLE_DELAY = 300;
|
|
15006
|
-
/** z-index 层级 */
|
|
15007
|
-
const Z_INDEX = {
|
|
15008
|
-
DROPDOWN: 1e3,
|
|
15009
|
-
STICKY: 1020,
|
|
15010
|
-
FIXED: 1030,
|
|
15011
|
-
MODAL_BACKDROP: 1040,
|
|
15012
|
-
MODAL: 1050,
|
|
15013
|
-
POPOVER: 1060,
|
|
15014
|
-
TOOLTIP: 1070
|
|
15015
|
-
};
|
|
15016
15635
|
//#endregion
|
|
15017
15636
|
//#region src/stores/plugins/secure-storage.ts
|
|
15018
15637
|
const CONFIG = {
|
|
@@ -15795,17 +16414,19 @@ function createPermissionGuard(options) {
|
|
|
15795
16414
|
* @returns 角色守卫函数
|
|
15796
16415
|
*/
|
|
15797
16416
|
function createRoleGuard(options) {
|
|
15798
|
-
const { checker, forbiddenPath = "/403" } = options;
|
|
16417
|
+
const { checker, forbiddenPath = "/403", getUserPermissions } = options;
|
|
15799
16418
|
return async (to, _from, next) => {
|
|
15800
16419
|
const requiredRoles = to.meta?.roles;
|
|
15801
16420
|
if (!requiredRoles || requiredRoles.length === 0) {
|
|
15802
16421
|
next();
|
|
15803
16422
|
return;
|
|
15804
16423
|
}
|
|
15805
|
-
|
|
16424
|
+
let userPermissions = {
|
|
15806
16425
|
roles: [],
|
|
15807
16426
|
permissions: []
|
|
15808
|
-
}
|
|
16427
|
+
};
|
|
16428
|
+
if (getUserPermissions) userPermissions = await getUserPermissions() ?? userPermissions;
|
|
16429
|
+
if (!await checker(requiredRoles, userPermissions)) {
|
|
15809
16430
|
next({ path: forbiddenPath });
|
|
15810
16431
|
return;
|
|
15811
16432
|
}
|
|
@@ -15928,51 +16549,29 @@ function replace(path) {
|
|
|
15928
16549
|
//#endregion
|
|
15929
16550
|
//#region src/router/utils/route-helpers.ts
|
|
15930
16551
|
/**
|
|
15931
|
-
*
|
|
16552
|
+
* 过滤菜单项(根据权限)- 委托给 composables 实现
|
|
15932
16553
|
* @param items 菜单项数组
|
|
15933
16554
|
* @param permissions 用户权限
|
|
15934
16555
|
* @returns 过滤后的菜单项
|
|
15935
16556
|
*/
|
|
15936
16557
|
function filterMenuItems$1(items, permissions) {
|
|
15937
|
-
|
|
15938
|
-
const { roles = [], permissions: perms = [] } = permissions;
|
|
15939
|
-
return items.filter((item) => {
|
|
15940
|
-
if (item.roles && item.roles.length > 0) {
|
|
15941
|
-
if (!item.roles.some((role) => roles.includes(role))) return false;
|
|
15942
|
-
}
|
|
15943
|
-
if (item.permission) {
|
|
15944
|
-
if (!(Array.isArray(item.permission) ? item.permission : [item.permission]).some((p) => perms.includes(p))) return false;
|
|
15945
|
-
}
|
|
15946
|
-
if (item.children && item.children.length > 0) item.children = filterMenuItems$1(item.children, permissions);
|
|
15947
|
-
return true;
|
|
15948
|
-
});
|
|
16558
|
+
return filterMenuItems(items, permissions);
|
|
15949
16559
|
}
|
|
15950
16560
|
/**
|
|
15951
|
-
* 将 MenuItem 数组转换为路由记录
|
|
16561
|
+
* 将 MenuItem 数组转换为路由记录 - 委托给 composables 实现
|
|
15952
16562
|
* @param items 菜单项数组
|
|
15953
16563
|
* @param options 选项
|
|
15954
16564
|
* @returns 路由记录数组
|
|
15955
16565
|
*/
|
|
15956
16566
|
function menuToRoutes$1(items, options = {}) {
|
|
15957
16567
|
const { basePath = "", userPermissions } = options;
|
|
15958
|
-
return (userPermissions ? filterMenuItems$1(items, userPermissions) : items).map((
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
|
|
15962
|
-
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
permission: item.permission,
|
|
15966
|
-
roles: item.roles,
|
|
15967
|
-
keepAlive: true
|
|
15968
|
-
}
|
|
15969
|
-
};
|
|
15970
|
-
if (item.children && item.children.length > 0) route.children = menuToRoutes$1(item.children, {
|
|
15971
|
-
basePath: `${basePath}/${route.path}`,
|
|
15972
|
-
userPermissions
|
|
15973
|
-
});
|
|
15974
|
-
return route;
|
|
15975
|
-
});
|
|
16568
|
+
return menuToRoutes(userPermissions ? filterMenuItems$1(items, userPermissions) : items, basePath).map((route) => ({
|
|
16569
|
+
...route,
|
|
16570
|
+
meta: {
|
|
16571
|
+
...route.meta,
|
|
16572
|
+
keepAlive: true
|
|
16573
|
+
}
|
|
16574
|
+
}));
|
|
15976
16575
|
}
|
|
15977
16576
|
/**
|
|
15978
16577
|
* 检查路由是否需要认证
|
|
@@ -16057,4 +16656,4 @@ var router_exports = /* @__PURE__ */ __exportAll({
|
|
|
16057
16656
|
setRouter: () => setRouter
|
|
16058
16657
|
});
|
|
16059
16658
|
//#endregion
|
|
16060
|
-
export { ANIMATION_DURATION, COMPONENT_PREFIX, CSS_PREFIX, DEBOUNCE_DEFAULTS,
|
|
16659
|
+
export { ANIMATION_DURATION, COMPONENT_PREFIX, CSS_PREFIX, DEBOUNCE_DEFAULTS, DEFAULT_LAYOUT_SIZE, Message, Notification, THROTTLE_DEFAULTS, YdAdminResolver, ai_loader_default as YdAiLoader, anchor_default as YdAnchor, auto_complete_default as YdAutoComplete, avatar_default as YdAvatar, badge_default as YdBadge, breadcrumb_default as YdBreadcrumb, button_default as YdButton, calendar_default as YdCalendar, captcha_default as YdCaptcha, card_default as YdCard, cascader_default as YdCascader, chat_bubble_default as YdChatBubble, chat_page_default as YdChatPage, checkbox_default as YdCheckbox, checkbox_group_default as YdCheckboxGroup, code_block_default as YdCodeBlock, collapse_default as YdCollapse, color_picker_default as YdColorPicker, config_provider_default as YdConfigProvider, context_menu_default as YdContextMenu, conversation_default as YdConversation, crud_page_default as YdCrudPage, date_picker_default as YdDatePicker, date_range_picker_default as YdDateRangePicker, divider_default as YdDivider, drawer_default as YdDrawer, dropdown_default as YdDropdown, empty_default as YdEmpty, flow_chart_default as YdFlowChart, form_default as YdForm, form_item_default as YdFormItem, icon_default as YdIcon, image_default as YdImage, image_preview_group_default as YdImagePreviewGroup, input_default as YdInput, input_number_default as YdInputNumber, layout_default as YdLayout, layout_content_default as YdLayoutContent, layout_header_default as YdLayoutHeader, layout_sidebar_default as YdLayoutSidebar, list_default as YdList, loading_bar_default as YdLoadingBar, login_default as YdLogin, login_centered_default as YdLoginCentered, markdown_default as YdMarkdown, menu_default as YdMenu, modal_default as YdModal, model_selector_default as YdModelSelector, pagination_default as YdPagination, pin_input_default as YdPinInput, popconfirm_default as YdPopconfirm, progress_default as YdProgress, prompt_input_default as YdPromptInput, radio_default as YdRadio, radio_group_default as YdRadioGroup, rate_default as YdRate, reasoning_default as YdReasoning, result_default as YdResult, router_exports as YdRouter, SchemaForm_default as YdSchemaForm, select_default as YdSelect, skeleton_default as YdSkeleton, slider_default as YdSlider, sources_default as YdSources, space_default as YdSpace, spin_default as YdSpin, statistic_default as YdStatistic, stepper_default as YdStepper, steps_default as YdSteps, streaming_text_default as YdStreamingText, suggestion_default as YdSuggestion, switch_default as YdSwitch, table_default as YdTable, tabs_default as YdTabs, tag_default as YdTag, textarea_default as YdTextarea, time_picker_default as YdTimePicker, timeline_default as YdTimeline, tooltip_default as YdTooltip, transfer_default as YdTransfer, tree_default as YdTree, tree_select_default as YdTreeSelect, upload_default as YdUpload, watermark_default as YdWatermark, Z_INDEX, buildBreadcrumb, changeLocale, checkRoutePermission, clearKeyCache, cn, convertToSimpleRoute, createSecureStorage, createWatermark, debounce, decrypt, deepClone, dt, dynamicRouter, encrypt, filterMenuItems, findMenuItem, findMenuPath, flattenMenuItems, generateId, generateRouteTitle, generateSessionKey, getBreadcrumbPaths, getCurrentLocale, getIcon, getIconRegistry, getKeySource, i18n, initSecureStorage, isArray, isDate, isEmpty, isEmptyObject, isFunction, isObject, isPathMatch, isPromise, isStorageReady, joinPath, loadingBar, menuToRoutes, nf, normalizePath, registerIcon, registerLazyLocale, removeWatermark, resetStorageKey, rotateStorageKey, searchMenuItems, secureLocal, secureSession, secureStoragePlugin, setLocale, setSessionStorageEncryptionKey, setStorageEncryptionKey, setupI18n, signData, storageReady, supportedLocales, t, tc, themes, throttle, useConfig, useFormSchema, useFormValidate, useLoading, useLoadingBar, useLoginForm, useNamespace, verifyData };
|