@deot/vc 1.0.25 → 1.0.27

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.
@@ -6367,388 +6367,6 @@ var Vc = (function (exports, vue) {
6367
6367
  }
6368
6368
  }
6369
6369
 
6370
- class ACache {
6371
- options;
6372
- constructor() {
6373
- this.options = {
6374
- version: "",
6375
- get: (v) => flattenJSONParse(v),
6376
- set: (v) => v
6377
- };
6378
- }
6379
- configure(options) {
6380
- if (typeof window === "undefined")
6381
- return;
6382
- this.options = {
6383
- ...this.options,
6384
- ...options
6385
- };
6386
- }
6387
- }
6388
-
6389
- (() => {
6390
- try {
6391
- document.cookie = "test";
6392
- return true;
6393
- } catch (_) {
6394
- return false;
6395
- }
6396
- })();
6397
-
6398
- class MemoryStorage {
6399
- store = {};
6400
- getItem(key) {
6401
- return this.store[key] || null;
6402
- }
6403
- setItem(key, val) {
6404
- this.store[key] = val;
6405
- }
6406
- removeItem(key) {
6407
- delete this.store[key];
6408
- }
6409
- }
6410
-
6411
- const PREFIX_NAME = "@deot/helper/";
6412
- const formatKey = (key, version) => {
6413
- return `${version ? `${PREFIX_NAME}${version}:` : ""}${key}`;
6414
- };
6415
- const ALLOW$1 = (() => {
6416
- const test = "test";
6417
- try {
6418
- window.localStorage.setItem(test, test);
6419
- window.localStorage.removeItem(test);
6420
- return true;
6421
- } catch (_) {
6422
- return false;
6423
- }
6424
- })();
6425
- class StorageStore extends ACache {
6426
- sessionStorage = new MemoryStorage();
6427
- localStorage = new MemoryStorage();
6428
- getInvoke(options) {
6429
- return options?.session ? "sessionStorage" : "localStorage";
6430
- }
6431
- configure(options) {
6432
- super.configure(options);
6433
- if (!ALLOW$1)
6434
- return;
6435
- const { version } = this.options;
6436
- Object.keys(window.localStorage).forEach((item) => {
6437
- /* istanbul ignore else -- @preserve */
6438
- if (item.includes(PREFIX_NAME) && !item.includes(`${PREFIX_NAME}${version}`)) {
6439
- window.localStorage.removeItem(item);
6440
- }
6441
- });
6442
- }
6443
- /**
6444
- * 设置缓存
6445
- * @param key 保存的键值
6446
- * @param value 保存的内容
6447
- * @param options ~
6448
- */
6449
- set(key, value, options) {
6450
- if (!ALLOW$1)
6451
- return;
6452
- const invoke = this.getInvoke(options);
6453
- key = formatKey(key, this.options.version);
6454
- value = this.options.set(typeof value === "string" ? value : JSON.stringify(value));
6455
- try {
6456
- window[invoke].setItem(key, value);
6457
- } catch (error) {
6458
- this[invoke].setItem(key, value);
6459
- }
6460
- }
6461
- /**
6462
- * 获取缓存
6463
- * @param key 保存的键值
6464
- * @param options ~
6465
- * @returns ~
6466
- */
6467
- get(key, options) {
6468
- if (!ALLOW$1)
6469
- return null;
6470
- const invoke = this.getInvoke(options);
6471
- key = formatKey(key, this.options.version);
6472
- const value = this[invoke].getItem(key) || window[invoke].getItem(key);
6473
- return this.options.get(value);
6474
- }
6475
- /**
6476
- * 删除缓存
6477
- * @param key 键值
6478
- * @param options ~
6479
- */
6480
- remove(key, options) {
6481
- if (!ALLOW$1)
6482
- return;
6483
- const invoke = this.getInvoke(options);
6484
- key = formatKey(key, this.options.version);
6485
- this[invoke].removeItem(key);
6486
- window[invoke].removeItem(key);
6487
- }
6488
- }
6489
- const Storage$1 = new StorageStore();
6490
-
6491
- const ALLOW = (() => {
6492
- try {
6493
- window.indexedDB.open;
6494
- return true;
6495
- } catch (_) {
6496
- return false;
6497
- }
6498
- })();
6499
- class IndexedDBStore extends ACache {
6500
- timestramp = (/* @__PURE__ */ new Date()).getTime();
6501
- count = 0;
6502
- db = null;
6503
- pending = [];
6504
- constructor(options) {
6505
- super();
6506
- this.options = {
6507
- ...this.options,
6508
- keyPath: "__id",
6509
- name: "default-db",
6510
- storeName: "default-store",
6511
- version: 1
6512
- };
6513
- options && this.configure(options);
6514
- }
6515
- getUid() {
6516
- return `${this.timestramp}${this.count++}`;
6517
- }
6518
- configure(options) {
6519
- super.configure(options);
6520
- if (typeof this.options.version === "string") {
6521
- this.options.version = parseInt(this.options.version, 10);
6522
- }
6523
- }
6524
- /**
6525
- * 每次操作完要关闭
6526
- * 1. 浏览器上不关闭的话,删库操作会卡一会
6527
- * 2. fake-indexeddb不关闭会卡死
6528
- * @param fn ~
6529
- * @returns ~
6530
- */
6531
- concurrent(fn) {
6532
- const target = new Promise((resolve, reject) => {
6533
- fn().then(resolve).catch(reject);
6534
- });
6535
- this.pending.push(target);
6536
- target.finally(() => this.close(target));
6537
- return target;
6538
- }
6539
- /**
6540
- * 统一处理
6541
- * @param request ~
6542
- * @returns ~
6543
- */
6544
- async task(request) {
6545
- return new Promise((resolve, reject) => {
6546
- request.onsuccess = resolve;
6547
- request.onerror = reject;
6548
- });
6549
- }
6550
- /**
6551
- * @param target ~
6552
- */
6553
- async close(target) {
6554
- if (target) {
6555
- this.pending = this.pending.filter((i) => i !== target);
6556
- } else {
6557
- const done = async (pending) => {
6558
- if (pending.length) {
6559
- await Promise.allSettled(pending);
6560
- await done(this.pending);
6561
- }
6562
- };
6563
- await done(this.pending);
6564
- }
6565
- if (!this.pending.length && this.db) {
6566
- const db = this.db;
6567
- this.db = null;
6568
- (await db).close();
6569
- }
6570
- }
6571
- /**
6572
- * 打开数据库。变更时候更新表
6573
- * @returns ~
6574
- */
6575
- openDatabase() {
6576
- this.db = this.db || (async () => {
6577
- const { name, version, keyPath, storeName } = this.options;
6578
- const poll = () => new Promise((resolve, reject) => {
6579
- const request = window.indexedDB.open(name, version);
6580
- request.onsuccess = () => {
6581
- resolve(request.result);
6582
- };
6583
- request.onerror = /* istanbul ignore next */
6584
- () => {
6585
- reject(new Error("IndexedDB Open Failed. DeleteDatabase first!"));
6586
- };
6587
- request.onupgradeneeded = () => {
6588
- const db2 = request.result;
6589
- if (db2.objectStoreNames.contains(storeName)) {
6590
- db2.deleteObjectStore(storeName);
6591
- }
6592
- db2.createObjectStore(storeName, { keyPath });
6593
- };
6594
- });
6595
- const maxTries = 3;
6596
- let db;
6597
- for (let tries = 0; tries < maxTries; tries++) {
6598
- try {
6599
- db = await poll();
6600
- } catch (_) {
6601
- }
6602
- /* istanbul ignore next -- @preserve */
6603
- if (db || tries === maxTries - 1) {
6604
- break;
6605
- }
6606
- }
6607
- /* istanbul ignore next -- @preserve */
6608
- if (!db) {
6609
- await this.deleteDatabase();
6610
- db = await poll();
6611
- }
6612
- return db;
6613
- })();
6614
- return this.db;
6615
- }
6616
- /**
6617
- * 打开表
6618
- * tip: db.close() 执行后
6619
- * db打开后的表os对象仍可写入(浏览器支持,fake-indexeddb不支持)
6620
- * 不过正常理解也应该操作所有后再关闭,这里不修改`this.db -> this.os`的逻辑
6621
- * @param mode ~
6622
- * @returns ~
6623
- */
6624
- async openObjectStore(mode) {
6625
- const { storeName } = this.options;
6626
- const db = await this.openDatabase();
6627
- const os = db.transaction([storeName], mode || "readwrite").objectStore(storeName);
6628
- return os;
6629
- }
6630
- /**
6631
- * 删库
6632
- */
6633
- async deleteDatabase() {
6634
- const { name } = this.options;
6635
- const request = window.indexedDB.deleteDatabase(name);
6636
- await new Promise((resolve, reject) => {
6637
- request.onsuccess = resolve;
6638
- request.onerror = reject;
6639
- });
6640
- }
6641
- /**
6642
- * 新增数据,通过事务完成。
6643
- * @param data ~
6644
- * @returns ~
6645
- */
6646
- write(data) {
6647
- return this.concurrent(async () => {
6648
- const { keyPath } = this.options;
6649
- const os = await this.openObjectStore();
6650
- const state = {
6651
- [keyPath]: this.getUid(),
6652
- ...data
6653
- };
6654
- const request = os.add(state);
6655
- await new Promise((resolve, reject) => {
6656
- request.onsuccess = resolve;
6657
- request.onerror = reject;
6658
- });
6659
- return state;
6660
- });
6661
- }
6662
- /**
6663
- * 读取数据,通过事务完成。
6664
- * @param id ~
6665
- * @returns ~
6666
- */
6667
- read(id) {
6668
- return this.concurrent(async () => {
6669
- const os = await this.openObjectStore();
6670
- const request = os.get(id);
6671
- await this.task(request);
6672
- return request.result;
6673
- });
6674
- }
6675
- /**
6676
- * 更新数据,通过事务完成。
6677
- * @param id ~
6678
- * @param data ~
6679
- * @returns ~
6680
- */
6681
- update(id, data) {
6682
- return this.concurrent(async () => {
6683
- const { keyPath } = this.options;
6684
- const os = await this.openObjectStore();
6685
- const state = {
6686
- [keyPath]: id,
6687
- ...data
6688
- };
6689
- const request = os.put(state);
6690
- await this.task(request);
6691
- return state;
6692
- });
6693
- }
6694
- /**
6695
- * 删除数据也是通过事务完成。
6696
- * @param id ~
6697
- * @returns ~
6698
- */
6699
- async delete(id) {
6700
- return this.concurrent(async () => {
6701
- const os = await this.openObjectStore();
6702
- const request = os.delete(id);
6703
- await this.task(request);
6704
- });
6705
- }
6706
- /**
6707
- * 搜索数据,通过事务完成。
6708
- * @returns ~
6709
- */
6710
- search() {
6711
- return this.concurrent(async () => {
6712
- const os = await this.openObjectStore();
6713
- const request = os.openCursor();
6714
- const rowData = [];
6715
- await new Promise((resolve, reject) => {
6716
- request.onsuccess = () => {
6717
- const cursor = request.result;
6718
- if (cursor) {
6719
- rowData.push(cursor.value);
6720
- cursor.continue();
6721
- } else {
6722
- resolve(rowData);
6723
- }
6724
- };
6725
- request.onerror = reject;
6726
- });
6727
- return rowData;
6728
- });
6729
- }
6730
- // 同Stoage / Cookie使用api
6731
- async get(key) {
6732
- if (!ALLOW)
6733
- return null;
6734
- const v = await this.read(key);
6735
- return this.options.get(!v ? null : v.data);
6736
- }
6737
- async set(key, value) {
6738
- if (!ALLOW)
6739
- return;
6740
- await this.update(key, {
6741
- data: this.options.set(typeof value === "string" ? value : JSON.stringify(value))
6742
- });
6743
- }
6744
- async remove(key) {
6745
- if (!ALLOW)
6746
- return;
6747
- await this.delete(key);
6748
- }
6749
- }
6750
- new IndexedDBStore();
6751
-
6752
6370
  /*!
6753
6371
  * PhotoSwipe Lightbox 5.4.4 - https://photoswipe.com
6754
6372
  * (c) 2024 Dmytro Semenov
@@ -8707,6 +8325,388 @@ var Vc = (function (exports, vue) {
8707
8325
 
8708
8326
  }
8709
8327
 
8328
+ class ACache {
8329
+ options;
8330
+ constructor() {
8331
+ this.options = {
8332
+ version: "",
8333
+ get: (v) => flattenJSONParse(v),
8334
+ set: (v) => v
8335
+ };
8336
+ }
8337
+ configure(options) {
8338
+ if (typeof window === "undefined")
8339
+ return;
8340
+ this.options = {
8341
+ ...this.options,
8342
+ ...options
8343
+ };
8344
+ }
8345
+ }
8346
+
8347
+ (() => {
8348
+ try {
8349
+ document.cookie = "test";
8350
+ return true;
8351
+ } catch (_) {
8352
+ return false;
8353
+ }
8354
+ })();
8355
+
8356
+ class MemoryStorage {
8357
+ store = {};
8358
+ getItem(key) {
8359
+ return this.store[key] || null;
8360
+ }
8361
+ setItem(key, val) {
8362
+ this.store[key] = val;
8363
+ }
8364
+ removeItem(key) {
8365
+ delete this.store[key];
8366
+ }
8367
+ }
8368
+
8369
+ const PREFIX_NAME = "@deot/helper/";
8370
+ const formatKey = (key, version) => {
8371
+ return `${version ? `${PREFIX_NAME}${version}:` : ""}${key}`;
8372
+ };
8373
+ const ALLOW$1 = (() => {
8374
+ const test = "test";
8375
+ try {
8376
+ window.localStorage.setItem(test, test);
8377
+ window.localStorage.removeItem(test);
8378
+ return true;
8379
+ } catch (_) {
8380
+ return false;
8381
+ }
8382
+ })();
8383
+ class StorageStore extends ACache {
8384
+ sessionStorage = new MemoryStorage();
8385
+ localStorage = new MemoryStorage();
8386
+ getInvoke(options) {
8387
+ return options?.session ? "sessionStorage" : "localStorage";
8388
+ }
8389
+ configure(options) {
8390
+ super.configure(options);
8391
+ if (!ALLOW$1)
8392
+ return;
8393
+ const { version } = this.options;
8394
+ Object.keys(window.localStorage).forEach((item) => {
8395
+ /* istanbul ignore else -- @preserve */
8396
+ if (item.includes(PREFIX_NAME) && !item.includes(`${PREFIX_NAME}${version}`)) {
8397
+ window.localStorage.removeItem(item);
8398
+ }
8399
+ });
8400
+ }
8401
+ /**
8402
+ * 设置缓存
8403
+ * @param key 保存的键值
8404
+ * @param value 保存的内容
8405
+ * @param options ~
8406
+ */
8407
+ set(key, value, options) {
8408
+ if (!ALLOW$1)
8409
+ return;
8410
+ const invoke = this.getInvoke(options);
8411
+ key = formatKey(key, this.options.version);
8412
+ value = this.options.set(typeof value === "string" ? value : JSON.stringify(value));
8413
+ try {
8414
+ window[invoke].setItem(key, value);
8415
+ } catch (error) {
8416
+ this[invoke].setItem(key, value);
8417
+ }
8418
+ }
8419
+ /**
8420
+ * 获取缓存
8421
+ * @param key 保存的键值
8422
+ * @param options ~
8423
+ * @returns ~
8424
+ */
8425
+ get(key, options) {
8426
+ if (!ALLOW$1)
8427
+ return null;
8428
+ const invoke = this.getInvoke(options);
8429
+ key = formatKey(key, this.options.version);
8430
+ const value = this[invoke].getItem(key) || window[invoke].getItem(key);
8431
+ return this.options.get(value);
8432
+ }
8433
+ /**
8434
+ * 删除缓存
8435
+ * @param key 键值
8436
+ * @param options ~
8437
+ */
8438
+ remove(key, options) {
8439
+ if (!ALLOW$1)
8440
+ return;
8441
+ const invoke = this.getInvoke(options);
8442
+ key = formatKey(key, this.options.version);
8443
+ this[invoke].removeItem(key);
8444
+ window[invoke].removeItem(key);
8445
+ }
8446
+ }
8447
+ const Storage$1 = new StorageStore();
8448
+
8449
+ const ALLOW = (() => {
8450
+ try {
8451
+ window.indexedDB.open;
8452
+ return true;
8453
+ } catch (_) {
8454
+ return false;
8455
+ }
8456
+ })();
8457
+ class IndexedDBStore extends ACache {
8458
+ timestramp = (/* @__PURE__ */ new Date()).getTime();
8459
+ count = 0;
8460
+ db = null;
8461
+ pending = [];
8462
+ constructor(options) {
8463
+ super();
8464
+ this.options = {
8465
+ ...this.options,
8466
+ keyPath: "__id",
8467
+ name: "default-db",
8468
+ storeName: "default-store",
8469
+ version: 1
8470
+ };
8471
+ options && this.configure(options);
8472
+ }
8473
+ getUid() {
8474
+ return `${this.timestramp}${this.count++}`;
8475
+ }
8476
+ configure(options) {
8477
+ super.configure(options);
8478
+ if (typeof this.options.version === "string") {
8479
+ this.options.version = parseInt(this.options.version, 10);
8480
+ }
8481
+ }
8482
+ /**
8483
+ * 每次操作完要关闭
8484
+ * 1. 浏览器上不关闭的话,删库操作会卡一会
8485
+ * 2. fake-indexeddb不关闭会卡死
8486
+ * @param fn ~
8487
+ * @returns ~
8488
+ */
8489
+ concurrent(fn) {
8490
+ const target = new Promise((resolve, reject) => {
8491
+ fn().then(resolve).catch(reject);
8492
+ });
8493
+ this.pending.push(target);
8494
+ target.finally(() => this.close(target));
8495
+ return target;
8496
+ }
8497
+ /**
8498
+ * 统一处理
8499
+ * @param request ~
8500
+ * @returns ~
8501
+ */
8502
+ async task(request) {
8503
+ return new Promise((resolve, reject) => {
8504
+ request.onsuccess = resolve;
8505
+ request.onerror = reject;
8506
+ });
8507
+ }
8508
+ /**
8509
+ * @param target ~
8510
+ */
8511
+ async close(target) {
8512
+ if (target) {
8513
+ this.pending = this.pending.filter((i) => i !== target);
8514
+ } else {
8515
+ const done = async (pending) => {
8516
+ if (pending.length) {
8517
+ await Promise.allSettled(pending);
8518
+ await done(this.pending);
8519
+ }
8520
+ };
8521
+ await done(this.pending);
8522
+ }
8523
+ if (!this.pending.length && this.db) {
8524
+ const db = this.db;
8525
+ this.db = null;
8526
+ (await db).close();
8527
+ }
8528
+ }
8529
+ /**
8530
+ * 打开数据库。变更时候更新表
8531
+ * @returns ~
8532
+ */
8533
+ openDatabase() {
8534
+ this.db = this.db || (async () => {
8535
+ const { name, version, keyPath, storeName } = this.options;
8536
+ const poll = () => new Promise((resolve, reject) => {
8537
+ const request = window.indexedDB.open(name, version);
8538
+ request.onsuccess = () => {
8539
+ resolve(request.result);
8540
+ };
8541
+ request.onerror = /* istanbul ignore next */
8542
+ () => {
8543
+ reject(new Error("IndexedDB Open Failed. DeleteDatabase first!"));
8544
+ };
8545
+ request.onupgradeneeded = () => {
8546
+ const db2 = request.result;
8547
+ if (db2.objectStoreNames.contains(storeName)) {
8548
+ db2.deleteObjectStore(storeName);
8549
+ }
8550
+ db2.createObjectStore(storeName, { keyPath });
8551
+ };
8552
+ });
8553
+ const maxTries = 3;
8554
+ let db;
8555
+ for (let tries = 0; tries < maxTries; tries++) {
8556
+ try {
8557
+ db = await poll();
8558
+ } catch (_) {
8559
+ }
8560
+ /* istanbul ignore next -- @preserve */
8561
+ if (db || tries === maxTries - 1) {
8562
+ break;
8563
+ }
8564
+ }
8565
+ /* istanbul ignore next -- @preserve */
8566
+ if (!db) {
8567
+ await this.deleteDatabase();
8568
+ db = await poll();
8569
+ }
8570
+ return db;
8571
+ })();
8572
+ return this.db;
8573
+ }
8574
+ /**
8575
+ * 打开表
8576
+ * tip: db.close() 执行后
8577
+ * db打开后的表os对象仍可写入(浏览器支持,fake-indexeddb不支持)
8578
+ * 不过正常理解也应该操作所有后再关闭,这里不修改`this.db -> this.os`的逻辑
8579
+ * @param mode ~
8580
+ * @returns ~
8581
+ */
8582
+ async openObjectStore(mode) {
8583
+ const { storeName } = this.options;
8584
+ const db = await this.openDatabase();
8585
+ const os = db.transaction([storeName], mode || "readwrite").objectStore(storeName);
8586
+ return os;
8587
+ }
8588
+ /**
8589
+ * 删库
8590
+ */
8591
+ async deleteDatabase() {
8592
+ const { name } = this.options;
8593
+ const request = window.indexedDB.deleteDatabase(name);
8594
+ await new Promise((resolve, reject) => {
8595
+ request.onsuccess = resolve;
8596
+ request.onerror = reject;
8597
+ });
8598
+ }
8599
+ /**
8600
+ * 新增数据,通过事务完成。
8601
+ * @param data ~
8602
+ * @returns ~
8603
+ */
8604
+ write(data) {
8605
+ return this.concurrent(async () => {
8606
+ const { keyPath } = this.options;
8607
+ const os = await this.openObjectStore();
8608
+ const state = {
8609
+ [keyPath]: this.getUid(),
8610
+ ...data
8611
+ };
8612
+ const request = os.add(state);
8613
+ await new Promise((resolve, reject) => {
8614
+ request.onsuccess = resolve;
8615
+ request.onerror = reject;
8616
+ });
8617
+ return state;
8618
+ });
8619
+ }
8620
+ /**
8621
+ * 读取数据,通过事务完成。
8622
+ * @param id ~
8623
+ * @returns ~
8624
+ */
8625
+ read(id) {
8626
+ return this.concurrent(async () => {
8627
+ const os = await this.openObjectStore();
8628
+ const request = os.get(id);
8629
+ await this.task(request);
8630
+ return request.result;
8631
+ });
8632
+ }
8633
+ /**
8634
+ * 更新数据,通过事务完成。
8635
+ * @param id ~
8636
+ * @param data ~
8637
+ * @returns ~
8638
+ */
8639
+ update(id, data) {
8640
+ return this.concurrent(async () => {
8641
+ const { keyPath } = this.options;
8642
+ const os = await this.openObjectStore();
8643
+ const state = {
8644
+ [keyPath]: id,
8645
+ ...data
8646
+ };
8647
+ const request = os.put(state);
8648
+ await this.task(request);
8649
+ return state;
8650
+ });
8651
+ }
8652
+ /**
8653
+ * 删除数据也是通过事务完成。
8654
+ * @param id ~
8655
+ * @returns ~
8656
+ */
8657
+ async delete(id) {
8658
+ return this.concurrent(async () => {
8659
+ const os = await this.openObjectStore();
8660
+ const request = os.delete(id);
8661
+ await this.task(request);
8662
+ });
8663
+ }
8664
+ /**
8665
+ * 搜索数据,通过事务完成。
8666
+ * @returns ~
8667
+ */
8668
+ search() {
8669
+ return this.concurrent(async () => {
8670
+ const os = await this.openObjectStore();
8671
+ const request = os.openCursor();
8672
+ const rowData = [];
8673
+ await new Promise((resolve, reject) => {
8674
+ request.onsuccess = () => {
8675
+ const cursor = request.result;
8676
+ if (cursor) {
8677
+ rowData.push(cursor.value);
8678
+ cursor.continue();
8679
+ } else {
8680
+ resolve(rowData);
8681
+ }
8682
+ };
8683
+ request.onerror = reject;
8684
+ });
8685
+ return rowData;
8686
+ });
8687
+ }
8688
+ // 同Stoage / Cookie使用api
8689
+ async get(key) {
8690
+ if (!ALLOW)
8691
+ return null;
8692
+ const v = await this.read(key);
8693
+ return this.options.get(!v ? null : v.data);
8694
+ }
8695
+ async set(key, value) {
8696
+ if (!ALLOW)
8697
+ return;
8698
+ await this.update(key, {
8699
+ data: this.options.set(typeof value === "string" ? value : JSON.stringify(value))
8700
+ });
8701
+ }
8702
+ async remove(key) {
8703
+ if (!ALLOW)
8704
+ return;
8705
+ await this.delete(key);
8706
+ }
8707
+ }
8708
+ new IndexedDBStore();
8709
+
8710
8710
  const IS_SERVER$1 = typeof window === "undefined";
8711
8711
 
8712
8712
  const style = (value, options) => {
@@ -26127,9 +26127,9 @@ var Vc = (function (exports, vue) {
26127
26127
  default: "div"
26128
26128
  }
26129
26129
  };
26130
- const COMPONENT_NAME$1$ = "vc-action-sheet";
26130
+ const COMPONENT_NAME$20 = "vc-action-sheet";
26131
26131
  const ActionSheet = /* @__PURE__ */ vue.defineComponent({
26132
- name: COMPONENT_NAME$1$,
26132
+ name: COMPONENT_NAME$20,
26133
26133
  props: props$1q,
26134
26134
  setup(props2, {
26135
26135
  slots
@@ -26309,9 +26309,9 @@ var Vc = (function (exports, vue) {
26309
26309
  }
26310
26310
  }
26311
26311
  const IconManager = new Manager();
26312
- const COMPONENT_NAME$1_ = "vc-icon";
26312
+ const COMPONENT_NAME$1$ = "vc-icon";
26313
26313
  const Icon = /* @__PURE__ */ vue.defineComponent({
26314
- name: COMPONENT_NAME$1_,
26314
+ name: COMPONENT_NAME$1$,
26315
26315
  props: props$1o,
26316
26316
  setup(props2) {
26317
26317
  const viewBox = vue.ref("0 0 1024 1024");
@@ -26507,9 +26507,9 @@ var Vc = (function (exports, vue) {
26507
26507
  }
26508
26508
  };
26509
26509
  };
26510
- const COMPONENT_NAME$1Z = "vc-transition";
26510
+ const COMPONENT_NAME$1_ = "vc-transition";
26511
26511
  const Transition = vue.defineComponent({
26512
- name: COMPONENT_NAME$1Z,
26512
+ name: COMPONENT_NAME$1_,
26513
26513
  props: props$1n,
26514
26514
  // 当不声明emits的情况下,事件存在于attrs中
26515
26515
  inheritAttrs: false,
@@ -26529,9 +26529,9 @@ var Vc = (function (exports, vue) {
26529
26529
  };
26530
26530
  }
26531
26531
  });
26532
- const COMPONENT_NAME$1Y = "vc-transition-collapse";
26532
+ const COMPONENT_NAME$1Z = "vc-transition-collapse";
26533
26533
  const TransitionCollapse = vue.defineComponent({
26534
- name: COMPONENT_NAME$1Y,
26534
+ name: COMPONENT_NAME$1Z,
26535
26535
  props: props$1n,
26536
26536
  // 当不声明emits的情况下,事件存在于attrs中
26537
26537
  inheritAttrs: false,
@@ -26649,9 +26649,9 @@ var Vc = (function (exports, vue) {
26649
26649
  };
26650
26650
  }
26651
26651
  });
26652
- const COMPONENT_NAME$1X = "vc-transition-fade";
26652
+ const COMPONENT_NAME$1Y = "vc-transition-fade";
26653
26653
  const TransitionFade = vue.defineComponent({
26654
- name: COMPONENT_NAME$1X,
26654
+ name: COMPONENT_NAME$1Y,
26655
26655
  props: {
26656
26656
  ...props$1n,
26657
26657
  // inheritAttrs必须是false
@@ -26685,9 +26685,9 @@ var Vc = (function (exports, vue) {
26685
26685
  };
26686
26686
  }
26687
26687
  });
26688
- const COMPONENT_NAME$1W = "vc-transition-scale";
26688
+ const COMPONENT_NAME$1X = "vc-transition-scale";
26689
26689
  const TransitionScale = vue.defineComponent({
26690
- name: COMPONENT_NAME$1W,
26690
+ name: COMPONENT_NAME$1X,
26691
26691
  props: {
26692
26692
  ...props$1n,
26693
26693
  mode: {
@@ -26726,9 +26726,9 @@ var Vc = (function (exports, vue) {
26726
26726
  };
26727
26727
  }
26728
26728
  });
26729
- const COMPONENT_NAME$1V = "vc-transition-slide";
26729
+ const COMPONENT_NAME$1W = "vc-transition-slide";
26730
26730
  const TransitionSlide = vue.defineComponent({
26731
- name: COMPONENT_NAME$1V,
26731
+ name: COMPONENT_NAME$1W,
26732
26732
  props: {
26733
26733
  ...props$1n,
26734
26734
  mode: {
@@ -26767,9 +26767,9 @@ var Vc = (function (exports, vue) {
26767
26767
  };
26768
26768
  }
26769
26769
  });
26770
- const COMPONENT_NAME$1U = "vc-transition-zoom";
26770
+ const COMPONENT_NAME$1V = "vc-transition-zoom";
26771
26771
  const TransitionZoom = vue.defineComponent({
26772
- name: COMPONENT_NAME$1U,
26772
+ name: COMPONENT_NAME$1V,
26773
26773
  props: {
26774
26774
  ...props$1n,
26775
26775
  mode: {
@@ -26808,7 +26808,7 @@ var Vc = (function (exports, vue) {
26808
26808
  };
26809
26809
  }
26810
26810
  });
26811
- const COMPONENT_NAME$1T = "vc-alert";
26811
+ const COMPONENT_NAME$1U = "vc-alert";
26812
26812
  const THEME_MAP = {
26813
26813
  info: ["#2B72FD", "#91d5ff", "#e6f7ff"],
26814
26814
  success: ["#52c41a", "#b7eb8f", "#f6ffed"],
@@ -26816,7 +26816,7 @@ var Vc = (function (exports, vue) {
26816
26816
  warning: ["#ffbf00", "#ffe58f", "#fffbe6"]
26817
26817
  };
26818
26818
  const Alert = /* @__PURE__ */ vue.defineComponent({
26819
- name: COMPONENT_NAME$1T,
26819
+ name: COMPONENT_NAME$1U,
26820
26820
  props: props$1p,
26821
26821
  setup(props2, {
26822
26822
  slots,
@@ -26909,9 +26909,9 @@ var Vc = (function (exports, vue) {
26909
26909
  default: "div"
26910
26910
  }
26911
26911
  };
26912
- const COMPONENT_NAME$1S = "vc-artboard";
26912
+ const COMPONENT_NAME$1T = "vc-artboard";
26913
26913
  const Artboard = /* @__PURE__ */ vue.defineComponent({
26914
- name: COMPONENT_NAME$1S,
26914
+ name: COMPONENT_NAME$1T,
26915
26915
  props: props$1m,
26916
26916
  setup(props2, {
26917
26917
  slots
@@ -26945,9 +26945,9 @@ var Vc = (function (exports, vue) {
26945
26945
  default: false
26946
26946
  }
26947
26947
  };
26948
- const COMPONENT_NAME$1R = "vc-spin";
26948
+ const COMPONENT_NAME$1S = "vc-spin";
26949
26949
  const Spin = /* @__PURE__ */ vue.defineComponent({
26950
- name: COMPONENT_NAME$1R,
26950
+ name: COMPONENT_NAME$1S,
26951
26951
  props: props$1l,
26952
26952
  setup(props2, {
26953
26953
  slots
@@ -26996,9 +26996,9 @@ var Vc = (function (exports, vue) {
26996
26996
  },
26997
26997
  exclude: RegExp
26998
26998
  };
26999
- const COMPONENT_NAME$1Q = "vc-debounce";
26999
+ const COMPONENT_NAME$1R = "vc-debounce";
27000
27000
  const Debounce = vue.defineComponent({
27001
- name: COMPONENT_NAME$1Q,
27001
+ name: COMPONENT_NAME$1R,
27002
27002
  props: props$1k,
27003
27003
  /**
27004
27004
  * 不声明emits使得事件被透传放入attrs中, 这样可以让所有的事件透传
@@ -27066,9 +27066,9 @@ var Vc = (function (exports, vue) {
27066
27066
  default: "button"
27067
27067
  }
27068
27068
  };
27069
- const COMPONENT_NAME$1P = "vc-button";
27069
+ const COMPONENT_NAME$1Q = "vc-button";
27070
27070
  const Button = /* @__PURE__ */ vue.defineComponent({
27071
- name: COMPONENT_NAME$1P,
27071
+ name: COMPONENT_NAME$1Q,
27072
27072
  emits: ["click"],
27073
27073
  props: props$1j,
27074
27074
  setup(props2, {
@@ -27146,9 +27146,9 @@ var Vc = (function (exports, vue) {
27146
27146
  default: false
27147
27147
  }
27148
27148
  };
27149
- const COMPONENT_NAME$1O = "vc-button-group";
27149
+ const COMPONENT_NAME$1P = "vc-button-group";
27150
27150
  const ButtonGroup = /* @__PURE__ */ vue.defineComponent({
27151
- name: COMPONENT_NAME$1O,
27151
+ name: COMPONENT_NAME$1P,
27152
27152
  props: props$1i,
27153
27153
  setup(props2, {
27154
27154
  slots
@@ -27177,9 +27177,9 @@ var Vc = (function (exports, vue) {
27177
27177
  default: "div"
27178
27178
  }
27179
27179
  };
27180
- const COMPONENT_NAME$1N = "vc-calendar";
27180
+ const COMPONENT_NAME$1O = "vc-calendar";
27181
27181
  const Calendar$1 = /* @__PURE__ */ vue.defineComponent({
27182
- name: COMPONENT_NAME$1N,
27182
+ name: COMPONENT_NAME$1O,
27183
27183
  props: props$1h,
27184
27184
  setup(props2, {
27185
27185
  slots
@@ -27212,9 +27212,9 @@ var Vc = (function (exports, vue) {
27212
27212
  type: String
27213
27213
  }
27214
27214
  };
27215
- const COMPONENT_NAME$1M = "vc-card";
27215
+ const COMPONENT_NAME$1N = "vc-card";
27216
27216
  const Card = /* @__PURE__ */ vue.defineComponent({
27217
- name: COMPONENT_NAME$1M,
27217
+ name: COMPONENT_NAME$1N,
27218
27218
  props: props$1g,
27219
27219
  setup(props2, {
27220
27220
  slots
@@ -27245,9 +27245,9 @@ var Vc = (function (exports, vue) {
27245
27245
  default: "div"
27246
27246
  }
27247
27247
  };
27248
- const COMPONENT_NAME$1L = "vc-carousel";
27248
+ const COMPONENT_NAME$1M = "vc-carousel";
27249
27249
  const Carousel = /* @__PURE__ */ vue.defineComponent({
27250
- name: COMPONENT_NAME$1L,
27250
+ name: COMPONENT_NAME$1M,
27251
27251
  props: props$1f,
27252
27252
  setup(props2, {
27253
27253
  slots
@@ -27266,9 +27266,9 @@ var Vc = (function (exports, vue) {
27266
27266
  default: "div"
27267
27267
  }
27268
27268
  };
27269
- const COMPONENT_NAME$1K = "vc-cascader";
27269
+ const COMPONENT_NAME$1L = "vc-cascader";
27270
27270
  const Cascader = /* @__PURE__ */ vue.defineComponent({
27271
- name: COMPONENT_NAME$1K,
27271
+ name: COMPONENT_NAME$1L,
27272
27272
  props: props$1e,
27273
27273
  setup(props2, {
27274
27274
  slots
@@ -27331,9 +27331,9 @@ var Vc = (function (exports, vue) {
27331
27331
  watchShallow: Boolean,
27332
27332
  manualUpdate: Boolean
27333
27333
  };
27334
- const COMPONENT_NAME$1J = "vc-chart";
27334
+ const COMPONENT_NAME$1K = "vc-chart";
27335
27335
  const Chart = /* @__PURE__ */ vue.defineComponent({
27336
- name: COMPONENT_NAME$1J,
27336
+ name: COMPONENT_NAME$1K,
27337
27337
  props: props$1d,
27338
27338
  emits: [...EVENTS, "ready"],
27339
27339
  setup(props2, {
@@ -27555,9 +27555,9 @@ var Vc = (function (exports, vue) {
27555
27555
  computedLabel
27556
27556
  };
27557
27557
  };
27558
- const COMPONENT_NAME$1I = "vc-checkbox";
27558
+ const COMPONENT_NAME$1J = "vc-checkbox";
27559
27559
  const Checkbox = /* @__PURE__ */ vue.defineComponent({
27560
- name: COMPONENT_NAME$1I,
27560
+ name: COMPONENT_NAME$1J,
27561
27561
  props: props$1c,
27562
27562
  emits: ["update:modelValue", "change"],
27563
27563
  setup(props2, {
@@ -27639,9 +27639,9 @@ var Vc = (function (exports, vue) {
27639
27639
  reset
27640
27640
  };
27641
27641
  };
27642
- const COMPONENT_NAME$1H = "vc-checkbox-group";
27642
+ const COMPONENT_NAME$1I = "vc-checkbox-group";
27643
27643
  const CheckboxGroup = /* @__PURE__ */ vue.defineComponent({
27644
- name: COMPONENT_NAME$1H,
27644
+ name: COMPONENT_NAME$1I,
27645
27645
  props: props$1b,
27646
27646
  emits: ["update:modelValue", "change"],
27647
27647
  setup(props2, {
@@ -27656,9 +27656,9 @@ var Vc = (function (exports, vue) {
27656
27656
  };
27657
27657
  }
27658
27658
  });
27659
- const COMPONENT_NAME$1G = "vcm-checkbox";
27659
+ const COMPONENT_NAME$1H = "vcm-checkbox";
27660
27660
  const MCheckbox = /* @__PURE__ */ vue.defineComponent({
27661
- name: COMPONENT_NAME$1G,
27661
+ name: COMPONENT_NAME$1H,
27662
27662
  props: props$1c,
27663
27663
  emits: ["update:modelValue", "change"],
27664
27664
  setup(props2, {
@@ -27695,9 +27695,9 @@ var Vc = (function (exports, vue) {
27695
27695
  };
27696
27696
  }
27697
27697
  });
27698
- const COMPONENT_NAME$1F = "vcm-checkbox-group";
27698
+ const COMPONENT_NAME$1G = "vcm-checkbox-group";
27699
27699
  const MCheckboxGroup = /* @__PURE__ */ vue.defineComponent({
27700
- name: COMPONENT_NAME$1F,
27700
+ name: COMPONENT_NAME$1G,
27701
27701
  props: props$1b,
27702
27702
  emits: ["update:modelValue", "change"],
27703
27703
  setup(props2, {
@@ -27753,9 +27753,9 @@ var Vc = (function (exports, vue) {
27753
27753
  default: () => null
27754
27754
  }
27755
27755
  };
27756
- const COMPONENT_NAME$1E = "vc-customer";
27756
+ const COMPONENT_NAME$1F = "vc-customer";
27757
27757
  const Customer = vue.defineComponent({
27758
- name: COMPONENT_NAME$1E,
27758
+ name: COMPONENT_NAME$1F,
27759
27759
  props: props$19,
27760
27760
  setup(props2, context) {
27761
27761
  return () => vue.h(() => {
@@ -27763,9 +27763,9 @@ var Vc = (function (exports, vue) {
27763
27763
  });
27764
27764
  }
27765
27765
  });
27766
- const COMPONENT_NAME$1D = "vc-message";
27766
+ const COMPONENT_NAME$1E = "vc-message";
27767
27767
  const MessageView = /* @__PURE__ */ vue.defineComponent({
27768
- name: COMPONENT_NAME$1D,
27768
+ name: COMPONENT_NAME$1E,
27769
27769
  emits: ["before-close", "close", "portal-fulfilled"],
27770
27770
  props: props$1a,
27771
27771
  setup(props2, {
@@ -27908,7 +27908,7 @@ var Vc = (function (exports, vue) {
27908
27908
  return this.target.finally(callback);
27909
27909
  }
27910
27910
  }
27911
- const COMPONENT_NAME$1C = "vc-portal";
27911
+ const COMPONENT_NAME$1D = "vc-portal";
27912
27912
  class Portal {
27913
27913
  /**
27914
27914
  * 清理Portals类型组件
@@ -27960,7 +27960,7 @@ var Vc = (function (exports, vue) {
27960
27960
  this.wrapper = wrapper;
27961
27961
  this.globalOptions = {
27962
27962
  ...options,
27963
- name: options?.name || wrapper.name || getUid(COMPONENT_NAME$1C)
27963
+ name: options?.name || wrapper.name || getUid(COMPONENT_NAME$1D)
27964
27964
  };
27965
27965
  }
27966
27966
  popup(propsData, options) {
@@ -28059,7 +28059,7 @@ var Vc = (function (exports, vue) {
28059
28059
  ...rest
28060
28060
  } = options;
28061
28061
  let useAllNodes = fragment;
28062
- const name = multiple ? `${name$}__${getUid(COMPONENT_NAME$1C)}` : name$;
28062
+ const name = multiple ? `${name$}__${getUid(COMPONENT_NAME$1D)}` : name$;
28063
28063
  const container = document.createElement(tag);
28064
28064
  const root = typeof el2 === "object" ? el2 : document.querySelector(el2 || "body");
28065
28065
  !alive && Portal.leafs.get(name)?.destroy();
@@ -28093,7 +28093,7 @@ var Vc = (function (exports, vue) {
28093
28093
  } else {
28094
28094
  const wrapper = this.wrapper;
28095
28095
  const app = vue.createApp({
28096
- name: COMPONENT_NAME$1C,
28096
+ name: COMPONENT_NAME$1D,
28097
28097
  parent,
28098
28098
  setup() {
28099
28099
  if (alive) {
@@ -28203,9 +28203,9 @@ var Vc = (function (exports, vue) {
28203
28203
  default: "div"
28204
28204
  }
28205
28205
  };
28206
- const COMPONENT_NAME$1B = "vc-portal-view";
28206
+ const COMPONENT_NAME$1C = "vc-portal-view";
28207
28207
  const PortalView = /* @__PURE__ */ vue.defineComponent({
28208
- name: COMPONENT_NAME$1B,
28208
+ name: COMPONENT_NAME$1C,
28209
28209
  props: props$18,
28210
28210
  setup(props2, {
28211
28211
  slots
@@ -28368,9 +28368,9 @@ var Vc = (function (exports, vue) {
28368
28368
  };
28369
28369
  return () => vue.h(props2.tag, { onClick: handleClick, class: "vc-clipboard" }, slots?.default?.());
28370
28370
  };
28371
- const COMPONENT_NAME$1A = "vc-clipboard";
28371
+ const COMPONENT_NAME$1B = "vc-clipboard";
28372
28372
  const Clipboard$1 = vue.defineComponent({
28373
- name: COMPONENT_NAME$1A,
28373
+ name: COMPONENT_NAME$1B,
28374
28374
  props: props$17,
28375
28375
  setup() {
28376
28376
  return useClipboard((content) => Message.success({ content }));
@@ -28402,9 +28402,9 @@ var Vc = (function (exports, vue) {
28402
28402
  const MTransitionScale = TransitionScale;
28403
28403
  const MTransitionSlide = TransitionSlide;
28404
28404
  const MTransitionZoom = TransitionZoom;
28405
- const COMPONENT_NAME$1z = "vcm-toast";
28405
+ const COMPONENT_NAME$1A = "vcm-toast";
28406
28406
  const MToastView = /* @__PURE__ */ vue.defineComponent({
28407
- name: COMPONENT_NAME$1z,
28407
+ name: COMPONENT_NAME$1A,
28408
28408
  emits: ["close", "portal-fulfilled"],
28409
28409
  props: props$16,
28410
28410
  setup(props2, {
@@ -28503,9 +28503,9 @@ var Vc = (function (exports, vue) {
28503
28503
  const warning$2 = create$3({ mode: "warning" });
28504
28504
  const error$2 = create$3({ mode: "error" });
28505
28505
  const MToast = Object.assign(MToastView, { destroy: destroy$4, info: info$2, success: success$2, loading, warning: warning$2, error: error$2 });
28506
- const COMPONENT_NAME$1y = "vcm-clipboard";
28506
+ const COMPONENT_NAME$1z = "vcm-clipboard";
28507
28507
  const MClipboard$1 = vue.defineComponent({
28508
- name: COMPONENT_NAME$1y,
28508
+ name: COMPONENT_NAME$1z,
28509
28509
  props: props$17,
28510
28510
  setup() {
28511
28511
  return useClipboard((content) => MToast.info({ content }));
@@ -28534,9 +28534,9 @@ var Vc = (function (exports, vue) {
28534
28534
  default: false
28535
28535
  }
28536
28536
  };
28537
- const COMPONENT_NAME$1x = "vc-collapse";
28537
+ const COMPONENT_NAME$1y = "vc-collapse";
28538
28538
  const Collapse = vue.defineComponent({
28539
- name: COMPONENT_NAME$1x,
28539
+ name: COMPONENT_NAME$1y,
28540
28540
  props: props$15,
28541
28541
  emits: ["update:moodelValue", "change"],
28542
28542
  setup(props2, { slots, emit }) {
@@ -28648,9 +28648,9 @@ var Vc = (function (exports, vue) {
28648
28648
  function _isSlot$3(s) {
28649
28649
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
28650
28650
  }
28651
- const COMPONENT_NAME$1w = "vc-expand";
28651
+ const COMPONENT_NAME$1x = "vc-expand";
28652
28652
  const Expand$1 = /* @__PURE__ */ vue.defineComponent({
28653
- name: COMPONENT_NAME$1w,
28653
+ name: COMPONENT_NAME$1x,
28654
28654
  props: props$13,
28655
28655
  setup(props2, {
28656
28656
  slots
@@ -28677,9 +28677,9 @@ var Vc = (function (exports, vue) {
28677
28677
  };
28678
28678
  }
28679
28679
  });
28680
- const COMPONENT_NAME$1v = "vc-collapse-item";
28680
+ const COMPONENT_NAME$1w = "vc-collapse-item";
28681
28681
  const CollapseItem = /* @__PURE__ */ vue.defineComponent({
28682
- name: COMPONENT_NAME$1v,
28682
+ name: COMPONENT_NAME$1w,
28683
28683
  props: props$14,
28684
28684
  setup(props2, {
28685
28685
  slots,
@@ -28749,9 +28749,9 @@ var Vc = (function (exports, vue) {
28749
28749
  default: "div"
28750
28750
  }
28751
28751
  };
28752
- const COMPONENT_NAME$1u = "vc-color-picker";
28752
+ const COMPONENT_NAME$1v = "vc-color-picker";
28753
28753
  const ColorPicker = /* @__PURE__ */ vue.defineComponent({
28754
- name: COMPONENT_NAME$1u,
28754
+ name: COMPONENT_NAME$1v,
28755
28755
  props: props$12,
28756
28756
  setup(props2, {
28757
28757
  slots
@@ -28770,9 +28770,9 @@ var Vc = (function (exports, vue) {
28770
28770
  default: "div"
28771
28771
  }
28772
28772
  };
28773
- const COMPONENT_NAME$1t = "vc-countdown";
28773
+ const COMPONENT_NAME$1u = "vc-countdown";
28774
28774
  const Countdown = /* @__PURE__ */ vue.defineComponent({
28775
- name: COMPONENT_NAME$1t,
28775
+ name: COMPONENT_NAME$1u,
28776
28776
  props: props$11,
28777
28777
  setup(props2, {
28778
28778
  slots
@@ -29210,9 +29210,9 @@ var Vc = (function (exports, vue) {
29210
29210
  expose?.(exposed);
29211
29211
  return exposed;
29212
29212
  };
29213
- const COMPONENT_NAME$1s = "vc-input";
29213
+ const COMPONENT_NAME$1t = "vc-input";
29214
29214
  const Input = /* @__PURE__ */ vue.defineComponent({
29215
- name: COMPONENT_NAME$1s,
29215
+ name: COMPONENT_NAME$1t,
29216
29216
  inheritAttrs: false,
29217
29217
  props: {
29218
29218
  ...props$$,
@@ -29542,9 +29542,9 @@ var Vc = (function (exports, vue) {
29542
29542
  handleStepper
29543
29543
  };
29544
29544
  };
29545
- const COMPONENT_NAME$1r = "vc-input-number";
29545
+ const COMPONENT_NAME$1s = "vc-input-number";
29546
29546
  const InputNumber = /* @__PURE__ */ vue.defineComponent({
29547
- name: COMPONENT_NAME$1r,
29547
+ name: COMPONENT_NAME$1s,
29548
29548
  props: props$X,
29549
29549
  inheritAttrs: false,
29550
29550
  setup(props2, {
@@ -29604,9 +29604,9 @@ var Vc = (function (exports, vue) {
29604
29604
  default: true
29605
29605
  }
29606
29606
  };
29607
- const COMPONENT_NAME$1q = "vc-input-search";
29607
+ const COMPONENT_NAME$1r = "vc-input-search";
29608
29608
  const InputSearch = /* @__PURE__ */ vue.defineComponent({
29609
- name: COMPONENT_NAME$1q,
29609
+ name: COMPONENT_NAME$1r,
29610
29610
  props: props$W,
29611
29611
  inheritAttrs: false,
29612
29612
  setup(props2, {
@@ -29893,9 +29893,9 @@ var Vc = (function (exports, vue) {
29893
29893
  function _isSlot$2(s) {
29894
29894
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
29895
29895
  }
29896
- const COMPONENT_NAME$1p = "vc-popover-wrapper";
29896
+ const COMPONENT_NAME$1q = "vc-popover-wrapper";
29897
29897
  const PopoverWrapper = /* @__PURE__ */ vue.defineComponent({
29898
- name: COMPONENT_NAME$1p,
29898
+ name: COMPONENT_NAME$1q,
29899
29899
  props: props$_,
29900
29900
  emits: ["portal-fulfilled", "close"],
29901
29901
  setup(props2, {
@@ -30113,9 +30113,9 @@ var Vc = (function (exports, vue) {
30113
30113
  }
30114
30114
  });
30115
30115
  const PopoverPortal = new Portal(PopoverWrapper);
30116
- const COMPONENT_NAME$1o = "vc-popover";
30116
+ const COMPONENT_NAME$1p = "vc-popover";
30117
30117
  const Popover$1 = /* @__PURE__ */ vue.defineComponent({
30118
- name: COMPONENT_NAME$1o,
30118
+ name: COMPONENT_NAME$1p,
30119
30119
  props: props$Z,
30120
30120
  emits: ["update:modelValue", "visible-change", "ready", "close"],
30121
30121
  setup(props2, {
@@ -31191,9 +31191,9 @@ var Vc = (function (exports, vue) {
31191
31191
  }
31192
31192
  return view;
31193
31193
  };
31194
- const COMPONENT_NAME$1n = "vc-date-confirm";
31194
+ const COMPONENT_NAME$1o = "vc-date-confirm";
31195
31195
  const Confirm = /* @__PURE__ */ vue.defineComponent({
31196
- name: COMPONENT_NAME$1n,
31196
+ name: COMPONENT_NAME$1o,
31197
31197
  props: {
31198
31198
  showTime: {
31199
31199
  type: Boolean,
@@ -31254,9 +31254,9 @@ var Vc = (function (exports, vue) {
31254
31254
  };
31255
31255
  }
31256
31256
  });
31257
- const COMPONENT_NAME$1m = "vc-date-header";
31257
+ const COMPONENT_NAME$1n = "vc-date-header";
31258
31258
  const DateHeader = /* @__PURE__ */ vue.defineComponent({
31259
- name: COMPONENT_NAME$1m,
31259
+ name: COMPONENT_NAME$1n,
31260
31260
  props: {
31261
31261
  panelDate: Date,
31262
31262
  showNext: {
@@ -31337,9 +31337,9 @@ var Vc = (function (exports, vue) {
31337
31337
  };
31338
31338
  }
31339
31339
  });
31340
- const COMPONENT_NAME$1l = "vc-date-table";
31340
+ const COMPONENT_NAME$1m = "vc-date-table";
31341
31341
  const DateTable = /* @__PURE__ */ vue.defineComponent({
31342
- name: COMPONENT_NAME$1l,
31342
+ name: COMPONENT_NAME$1m,
31343
31343
  props: {
31344
31344
  value: Array,
31345
31345
  firstDayOfWeek: {
@@ -31539,9 +31539,9 @@ var Vc = (function (exports, vue) {
31539
31539
  };
31540
31540
  }
31541
31541
  });
31542
- const COMPONENT_NAME$1k = "vc-month-table";
31542
+ const COMPONENT_NAME$1l = "vc-month-table";
31543
31543
  const MonthTable = /* @__PURE__ */ vue.defineComponent({
31544
- name: COMPONENT_NAME$1k,
31544
+ name: COMPONENT_NAME$1l,
31545
31545
  props: {
31546
31546
  value: Array,
31547
31547
  panelDate: Date,
@@ -31667,7 +31667,7 @@ var Vc = (function (exports, vue) {
31667
31667
  };
31668
31668
  }
31669
31669
  });
31670
- const COMPONENT_NAME$1j = "vc-quarter-table";
31670
+ const COMPONENT_NAME$1k = "vc-quarter-table";
31671
31671
  const getMonthRange = (panelDate, quarter) => {
31672
31672
  const year = panelDate.getFullYear();
31673
31673
  const [startMonth, endMonth] = [quarter * 3, quarter * 3 + 2];
@@ -31694,7 +31694,7 @@ var Vc = (function (exports, vue) {
31694
31694
  }
31695
31695
  };
31696
31696
  const QuarterTable = /* @__PURE__ */ vue.defineComponent({
31697
- name: COMPONENT_NAME$1j,
31697
+ name: COMPONENT_NAME$1k,
31698
31698
  props: {
31699
31699
  value: Array,
31700
31700
  panelDate: Date,
@@ -31812,9 +31812,9 @@ var Vc = (function (exports, vue) {
31812
31812
  };
31813
31813
  }
31814
31814
  });
31815
- const COMPONENT_NAME$1i = "vc-shortcuts-select";
31815
+ const COMPONENT_NAME$1j = "vc-shortcuts-select";
31816
31816
  const ShortcutsSelect = /* @__PURE__ */ vue.defineComponent({
31817
- name: COMPONENT_NAME$1i,
31817
+ name: COMPONENT_NAME$1j,
31818
31818
  props: {
31819
31819
  panelDate: Date,
31820
31820
  config: Array,
@@ -31851,9 +31851,9 @@ var Vc = (function (exports, vue) {
31851
31851
  };
31852
31852
  }
31853
31853
  });
31854
- const COMPONENT_NAME$1h = "vc-time-select";
31854
+ const COMPONENT_NAME$1i = "vc-time-select";
31855
31855
  const TimeSelect = /* @__PURE__ */ vue.defineComponent({
31856
- name: COMPONENT_NAME$1h,
31856
+ name: COMPONENT_NAME$1i,
31857
31857
  props: {
31858
31858
  hours: {
31859
31859
  type: [Number, String],
@@ -32128,9 +32128,9 @@ var Vc = (function (exports, vue) {
32128
32128
  };
32129
32129
  }
32130
32130
  });
32131
- const COMPONENT_NAME$1g = "vc-year-table";
32131
+ const COMPONENT_NAME$1h = "vc-year-table";
32132
32132
  const YearTable = /* @__PURE__ */ vue.defineComponent({
32133
- name: COMPONENT_NAME$1g,
32133
+ name: COMPONENT_NAME$1h,
32134
32134
  props: {
32135
32135
  value: Array,
32136
32136
  panelDate: Date,
@@ -32246,9 +32246,9 @@ var Vc = (function (exports, vue) {
32246
32246
  }
32247
32247
  return true;
32248
32248
  };
32249
- const COMPONENT_NAME$1f = "vc-date-range-panel";
32249
+ const COMPONENT_NAME$1g = "vc-date-range-panel";
32250
32250
  const DateRangePanel = /* @__PURE__ */ vue.defineComponent({
32251
- name: COMPONENT_NAME$1f,
32251
+ name: COMPONENT_NAME$1g,
32252
32252
  props: {
32253
32253
  ...props$V,
32254
32254
  confirm: {
@@ -32609,9 +32609,9 @@ var Vc = (function (exports, vue) {
32609
32609
  };
32610
32610
  }
32611
32611
  });
32612
- const COMPONENT_NAME$1e = "vc-date-panel";
32612
+ const COMPONENT_NAME$1f = "vc-date-panel";
32613
32613
  const DatePanel = /* @__PURE__ */ vue.defineComponent({
32614
- name: COMPONENT_NAME$1e,
32614
+ name: COMPONENT_NAME$1f,
32615
32615
  props: {
32616
32616
  ...props$V,
32617
32617
  type: String,
@@ -32810,9 +32810,9 @@ var Vc = (function (exports, vue) {
32810
32810
  const endYear = value[1].getFullYear();
32811
32811
  return startYear === endYear;
32812
32812
  };
32813
- const COMPONENT_NAME$1d = "vc-monthrange-panel";
32813
+ const COMPONENT_NAME$1e = "vc-monthrange-panel";
32814
32814
  const MonthRangePanel = /* @__PURE__ */ vue.defineComponent({
32815
- name: COMPONENT_NAME$1d,
32815
+ name: COMPONENT_NAME$1e,
32816
32816
  props: {
32817
32817
  ...props$V,
32818
32818
  confirm: {
@@ -32982,9 +32982,9 @@ var Vc = (function (exports, vue) {
32982
32982
  const endYear = value[1].getFullYear();
32983
32983
  return startYear === endYear;
32984
32984
  };
32985
- const COMPONENT_NAME$1c = "vc-quarterrange-panel";
32985
+ const COMPONENT_NAME$1d = "vc-quarterrange-panel";
32986
32986
  const QuarterRangePanel = /* @__PURE__ */ vue.defineComponent({
32987
- name: COMPONENT_NAME$1c,
32987
+ name: COMPONENT_NAME$1d,
32988
32988
  props: {
32989
32989
  ...props$V,
32990
32990
  confirm: {
@@ -33215,9 +33215,9 @@ var Vc = (function (exports, vue) {
33215
33215
  seconds
33216
33216
  };
33217
33217
  };
33218
- const COMPONENT_NAME$1b = "vc-timerange-panel";
33218
+ const COMPONENT_NAME$1c = "vc-timerange-panel";
33219
33219
  const TimeRangePanel = /* @__PURE__ */ vue.defineComponent({
33220
- name: COMPONENT_NAME$1b,
33220
+ name: COMPONENT_NAME$1c,
33221
33221
  props: props$U,
33222
33222
  emits: ["pick", "clear", "ok"],
33223
33223
  setup(props2, {
@@ -33313,9 +33313,9 @@ var Vc = (function (exports, vue) {
33313
33313
  };
33314
33314
  }
33315
33315
  });
33316
- const COMPONENT_NAME$1a = "vc-time-panel";
33316
+ const COMPONENT_NAME$1b = "vc-time-panel";
33317
33317
  const TimePanel = /* @__PURE__ */ vue.defineComponent({
33318
- name: COMPONENT_NAME$1a,
33318
+ name: COMPONENT_NAME$1b,
33319
33319
  props: props$U,
33320
33320
  emits: ["pick", "clear", "ok"],
33321
33321
  setup(props2, {
@@ -33366,7 +33366,7 @@ var Vc = (function (exports, vue) {
33366
33366
  };
33367
33367
  }
33368
33368
  });
33369
- const COMPONENT_NAME$19 = "vc-date-picker";
33369
+ const COMPONENT_NAME$1a = "vc-date-picker";
33370
33370
  const getPanel$1 = (type) => {
33371
33371
  if (["daterange", "datetimerange"].includes(type)) {
33372
33372
  return DateRangePanel;
@@ -33377,7 +33377,7 @@ var Vc = (function (exports, vue) {
33377
33377
  }
33378
33378
  return DatePanel;
33379
33379
  };
33380
- const DatePicker = createPicker(COMPONENT_NAME$19, props$10, () => {
33380
+ const DatePicker = createPicker(COMPONENT_NAME$1a, props$10, () => {
33381
33381
  const props2 = vue.getCurrentInstance().props;
33382
33382
  const icon = vue.ref("date");
33383
33383
  const panel = vue.shallowRef({});
@@ -33405,9 +33405,9 @@ var Vc = (function (exports, vue) {
33405
33405
  default: "div"
33406
33406
  }
33407
33407
  };
33408
- const COMPONENT_NAME$18 = "vc-divider";
33408
+ const COMPONENT_NAME$19 = "vc-divider";
33409
33409
  const Divider = /* @__PURE__ */ vue.defineComponent({
33410
- name: COMPONENT_NAME$18,
33410
+ name: COMPONENT_NAME$19,
33411
33411
  props: props$T,
33412
33412
  setup(props2, {
33413
33413
  slots
@@ -33554,7 +33554,7 @@ var Vc = (function (exports, vue) {
33554
33554
  barTo: props$R.to,
33555
33555
  ...pick(props$R, barKeys)
33556
33556
  };
33557
- const COMPONENT_NAME$17 = "vc-scroller-track";
33557
+ const COMPONENT_NAME$18 = "vc-scroller-track";
33558
33558
  const BAR_MAP = {
33559
33559
  vertical: {
33560
33560
  scroll: "scrollTop",
@@ -33574,7 +33574,7 @@ var Vc = (function (exports, vue) {
33574
33574
  }
33575
33575
  };
33576
33576
  const Track$1 = /* @__PURE__ */ vue.defineComponent({
33577
- name: COMPONENT_NAME$17,
33577
+ name: COMPONENT_NAME$18,
33578
33578
  props: props$S,
33579
33579
  emits: ["change"],
33580
33580
  inheritAttrs: false,
@@ -33736,9 +33736,9 @@ var Vc = (function (exports, vue) {
33736
33736
  };
33737
33737
  }
33738
33738
  });
33739
- const COMPONENT_NAME$16 = "vc-scroller-bar";
33739
+ const COMPONENT_NAME$17 = "vc-scroller-bar";
33740
33740
  const Bar = /* @__PURE__ */ vue.defineComponent({
33741
- name: COMPONENT_NAME$16,
33741
+ name: COMPONENT_NAME$17,
33742
33742
  props: props$R,
33743
33743
  emits: ["change"],
33744
33744
  setup(props2, {
@@ -33949,9 +33949,9 @@ var Vc = (function (exports, vue) {
33949
33949
  refreshPosition
33950
33950
  };
33951
33951
  };
33952
- const COMPONENT_NAME$15 = "vc-scroller";
33952
+ const COMPONENT_NAME$16 = "vc-scroller";
33953
33953
  const Scroller = /* @__PURE__ */ vue.defineComponent({
33954
- name: COMPONENT_NAME$15,
33954
+ name: COMPONENT_NAME$16,
33955
33955
  props: props$Q,
33956
33956
  emits: ["scroll"],
33957
33957
  setup(props2, {
@@ -34009,9 +34009,9 @@ var Vc = (function (exports, vue) {
34009
34009
  };
34010
34010
  }
34011
34011
  });
34012
- const COMPONENT_NAME$14 = "vc-scroller-wheel";
34012
+ const COMPONENT_NAME$15 = "vc-scroller-wheel";
34013
34013
  const ScrollerWheel = /* @__PURE__ */ vue.defineComponent({
34014
- name: COMPONENT_NAME$14,
34014
+ name: COMPONENT_NAME$15,
34015
34015
  props: Object.assign(props$Q, {
34016
34016
  stopPropagation: {
34017
34017
  type: Boolean,
@@ -34192,9 +34192,9 @@ var Vc = (function (exports, vue) {
34192
34192
  type: Function
34193
34193
  }
34194
34194
  };
34195
- const COMPONENT_NAME$13 = "vc-drawer";
34195
+ const COMPONENT_NAME$14 = "vc-drawer";
34196
34196
  const DrawerView = /* @__PURE__ */ vue.defineComponent({
34197
- name: COMPONENT_NAME$13,
34197
+ name: COMPONENT_NAME$14,
34198
34198
  props: props$P,
34199
34199
  emits: ["close", "update:modelValue", "visible-change"],
34200
34200
  setup(props2, {
@@ -34353,9 +34353,9 @@ var Vc = (function (exports, vue) {
34353
34353
  default: "div"
34354
34354
  }
34355
34355
  };
34356
- const COMPONENT_NAME$12 = "vc-dropdown";
34356
+ const COMPONENT_NAME$13 = "vc-dropdown";
34357
34357
  const Dropdown = /* @__PURE__ */ vue.defineComponent({
34358
- name: COMPONENT_NAME$12,
34358
+ name: COMPONENT_NAME$13,
34359
34359
  props: props$O,
34360
34360
  setup(props2, {
34361
34361
  slots
@@ -34374,9 +34374,9 @@ var Vc = (function (exports, vue) {
34374
34374
  default: "div"
34375
34375
  }
34376
34376
  };
34377
- const COMPONENT_NAME$11 = "vc-editor";
34377
+ const COMPONENT_NAME$12 = "vc-editor";
34378
34378
  const Editor = /* @__PURE__ */ vue.defineComponent({
34379
- name: COMPONENT_NAME$11,
34379
+ name: COMPONENT_NAME$12,
34380
34380
  props: props$N,
34381
34381
  setup(props2, {
34382
34382
  slots
@@ -34515,9 +34515,9 @@ var Vc = (function (exports, vue) {
34515
34515
  validateField
34516
34516
  });
34517
34517
  };
34518
- const COMPONENT_NAME$10 = "vc-form";
34518
+ const COMPONENT_NAME$11 = "vc-form";
34519
34519
  const Form = vue.defineComponent({
34520
- name: COMPONENT_NAME$10,
34520
+ name: COMPONENT_NAME$11,
34521
34521
  props: props$M,
34522
34522
  setup(props2, { slots, expose }) {
34523
34523
  useForm(expose);
@@ -34837,9 +34837,9 @@ var Vc = (function (exports, vue) {
34837
34837
  labelPosition
34838
34838
  };
34839
34839
  };
34840
- const COMPONENT_NAME$$ = "vc-form-item";
34840
+ const COMPONENT_NAME$10 = "vc-form-item";
34841
34841
  const FormItem = /* @__PURE__ */ vue.defineComponent({
34842
- name: COMPONENT_NAME$$,
34842
+ name: COMPONENT_NAME$10,
34843
34843
  props: props$L,
34844
34844
  setup(props2, {
34845
34845
  slots,
@@ -34902,9 +34902,9 @@ var Vc = (function (exports, vue) {
34902
34902
  default: false
34903
34903
  }
34904
34904
  };
34905
- const COMPONENT_NAME$_ = "vcm-form";
34905
+ const COMPONENT_NAME$$ = "vcm-form";
34906
34906
  const MForm = vue.defineComponent({
34907
- name: COMPONENT_NAME$_,
34907
+ name: COMPONENT_NAME$$,
34908
34908
  props: props$K,
34909
34909
  setup(props2, { slots, expose }) {
34910
34910
  useForm(expose, {
@@ -34931,9 +34931,9 @@ var Vc = (function (exports, vue) {
34931
34931
  default: 12
34932
34932
  }
34933
34933
  };
34934
- const COMPONENT_NAME$Z = "vcm-form-item";
34934
+ const COMPONENT_NAME$_ = "vcm-form-item";
34935
34935
  const MFormItem = /* @__PURE__ */ vue.defineComponent({
34936
- name: COMPONENT_NAME$Z,
34936
+ name: COMPONENT_NAME$_,
34937
34937
  props: props$J,
34938
34938
  setup(props2, {
34939
34939
  slots,
@@ -34986,9 +34986,9 @@ var Vc = (function (exports, vue) {
34986
34986
  };
34987
34987
  }
34988
34988
  });
34989
- const COMPONENT_NAME$Y = "vc-fragment";
34989
+ const COMPONENT_NAME$Z = "vc-fragment";
34990
34990
  const Fragment = vue.defineComponent({
34991
- name: COMPONENT_NAME$Y,
34991
+ name: COMPONENT_NAME$Z,
34992
34992
  setup(_, { slots }) {
34993
34993
  return () => vue.h(vue.Fragment, slots.default?.());
34994
34994
  }
@@ -35000,9 +35000,9 @@ var Vc = (function (exports, vue) {
35000
35000
  default: "div"
35001
35001
  }
35002
35002
  };
35003
- const COMPONENT_NAME$X = "vc-html-to-image";
35003
+ const COMPONENT_NAME$Y = "vc-html-to-image";
35004
35004
  const HTMLToImage = /* @__PURE__ */ vue.defineComponent({
35005
- name: COMPONENT_NAME$X,
35005
+ name: COMPONENT_NAME$Y,
35006
35006
  props: props$I,
35007
35007
  setup(props2, {
35008
35008
  slots
@@ -35017,10 +35017,107 @@ var Vc = (function (exports, vue) {
35017
35017
  const MHTMLToImage = HTMLToImage;
35018
35018
  const MIcon = Icon;
35019
35019
  const props$H = {
35020
+ tag: {
35021
+ type: String,
35022
+ default: "div"
35023
+ }
35024
+ };
35025
+ const COMPONENT_NAME$X = "vc-image-preview";
35026
+ const ImagePreview$1 = /* @__PURE__ */ vue.defineComponent({
35027
+ name: COMPONENT_NAME$X,
35028
+ props: props$H,
35029
+ setup(props2, {
35030
+ slots
35031
+ }) {
35032
+ return () => {
35033
+ return vue.createVNode("div", {
35034
+ "class": "vc-image-preview"
35035
+ }, [slots?.default?.()]);
35036
+ };
35037
+ }
35038
+ });
35039
+ const MAX_WIDTH = window.innerWidth;
35040
+ const MAX_HEIGHT = window.innerHeight;
35041
+ const getFitSize = (src) => {
35042
+ return new Promise((resolve) => {
35043
+ const img = new Image();
35044
+ let width;
35045
+ let height;
35046
+ img.onload = () => {
35047
+ const owidth = img.naturalWidth || img.width;
35048
+ const oheight = img.naturalHeight || img.height;
35049
+ if (owidth > oheight) {
35050
+ width = Math.min(MAX_WIDTH, owidth);
35051
+ height = width / owidth * oheight;
35052
+ resolve({
35053
+ width,
35054
+ height
35055
+ });
35056
+ } else {
35057
+ height = Math.min(MAX_HEIGHT, oheight);
35058
+ width = height / oheight * owidth;
35059
+ resolve({
35060
+ width,
35061
+ height
35062
+ });
35063
+ }
35064
+ };
35065
+ img.onerror = () => resolve({});
35066
+ img.src = src;
35067
+ });
35068
+ };
35069
+ const open$1 = async (options) => {
35070
+ const e = VcInstance.globalEvent;
35071
+ const data = options.data.map((i) => {
35072
+ if (typeof i === "string") {
35073
+ return {
35074
+ src: i
35075
+ };
35076
+ }
35077
+ return {
35078
+ ...i,
35079
+ src: i.source || i.src
35080
+ };
35081
+ });
35082
+ for (let i = 0; i < data.length; i++) {
35083
+ if (!data[i].width) {
35084
+ data[i] = {
35085
+ ...data[i],
35086
+ ...await getFitSize(data[i].src)
35087
+ };
35088
+ }
35089
+ }
35090
+ const lightbox = new PhotoSwipeLightbox({
35091
+ pswpModule: () => Promise.resolve().then(() => photoswipe_esm),
35092
+ closeTitle: "关闭(Esc)",
35093
+ zoomTitle: "缩放",
35094
+ arrowPrevTitle: "上一张",
35095
+ arrowNextTitle: "下一张",
35096
+ errorMsg: "网络异常 图片加载失败",
35097
+ indexIndicatorSep: " / ",
35098
+ initialZoomLevel: "fit"
35099
+ });
35100
+ lightbox.init();
35101
+ lightbox.loadAndOpen(
35102
+ options.current || 0,
35103
+ data,
35104
+ // 下面无效,需要给官方支持
35105
+ {
35106
+ x: e?.clientX,
35107
+ y: e?.clientY
35108
+ }
35109
+ );
35110
+ };
35111
+ const ImagePreview = Object.assign(ImagePreview$1, { open: open$1 });
35112
+ const props$G = {
35020
35113
  src: String,
35021
35114
  fit: String,
35022
35115
  lazy: Boolean,
35023
- wrapper: [Object, String]
35116
+ wrapper: [Object, String],
35117
+ previewable: {
35118
+ type: Boolean,
35119
+ default: true
35120
+ }
35024
35121
  };
35025
35122
  class IMGStore {
35026
35123
  map;
@@ -35086,7 +35183,7 @@ var Vc = (function (exports, vue) {
35086
35183
  const Image$1 = /* @__PURE__ */ vue.defineComponent({
35087
35184
  name: COMPONENT_NAME$W,
35088
35185
  inheritAttrs: false,
35089
- props: props$H,
35186
+ props: props$G,
35090
35187
  setup(props2, {
35091
35188
  slots,
35092
35189
  emit
@@ -35230,6 +35327,15 @@ var Vc = (function (exports, vue) {
35230
35327
  const alignCenter = vue.computed(() => {
35231
35328
  return !isSupportObjectFit && props2.fit !== ObjectFit.FILL;
35232
35329
  });
35330
+ const handlePreview = () => {
35331
+ if (!props2.previewable) return;
35332
+ ImagePreview.open({
35333
+ current: 0,
35334
+ data: [props2.src],
35335
+ onClose() {
35336
+ }
35337
+ });
35338
+ };
35233
35339
  vue.watch(() => props2.src, (v) => {
35234
35340
  if (!v && !isLoading.value) {
35235
35341
  isLoading.value = true;
@@ -35250,7 +35356,9 @@ var Vc = (function (exports, vue) {
35250
35356
  return () => {
35251
35357
  return vue.createVNode("div", {
35252
35358
  "style": its.value.style,
35253
- "class": [its.value.class, "vc-image"]
35359
+ "class": [its.value.class, {
35360
+ "is-allow-preview": props2.previewable
35361
+ }, "vc-image"]
35254
35362
  }, [isLoading.value && (slots.placeholder ? slots.placeholder() : vue.createVNode("div", {
35255
35363
  "class": [{
35256
35364
  "is-auto": isAuto.value
@@ -35268,12 +35376,14 @@ var Vc = (function (exports, vue) {
35268
35376
  // 包含所有on*都会被绑定, 且listeners中覆盖将由listener内触发(inheritAttrs: false)
35269
35377
  ...its.value.attrs,
35270
35378
  ...its.value.listeners
35379
+ }, {
35380
+ "onClick": handlePreview
35271
35381
  }), null)]);
35272
35382
  };
35273
35383
  }
35274
35384
  });
35275
35385
  const MImage = Image$1;
35276
- const props$G = {
35386
+ const props$F = {
35277
35387
  tag: {
35278
35388
  type: String,
35279
35389
  default: "div"
@@ -35282,7 +35392,7 @@ var Vc = (function (exports, vue) {
35282
35392
  const COMPONENT_NAME$V = "vc-image-crop";
35283
35393
  const ImageCrop = /* @__PURE__ */ vue.defineComponent({
35284
35394
  name: COMPONENT_NAME$V,
35285
- props: props$G,
35395
+ props: props$F,
35286
35396
  setup(props2, {
35287
35397
  slots
35288
35398
  }) {
@@ -35294,99 +35404,6 @@ var Vc = (function (exports, vue) {
35294
35404
  }
35295
35405
  });
35296
35406
  const MImageCrop = ImageCrop;
35297
- const props$F = {
35298
- tag: {
35299
- type: String,
35300
- default: "div"
35301
- }
35302
- };
35303
- const COMPONENT_NAME$U = "vc-image-preview";
35304
- const ImagePreview$1 = /* @__PURE__ */ vue.defineComponent({
35305
- name: COMPONENT_NAME$U,
35306
- props: props$F,
35307
- setup(props2, {
35308
- slots
35309
- }) {
35310
- return () => {
35311
- return vue.createVNode("div", {
35312
- "class": "vc-image-preview"
35313
- }, [slots?.default?.()]);
35314
- };
35315
- }
35316
- });
35317
- const MAX_WIDTH = window.innerWidth;
35318
- const MAX_HEIGHT = window.innerHeight;
35319
- const getFitSize = (src) => {
35320
- return new Promise((resolve) => {
35321
- const img = new Image();
35322
- let width;
35323
- let height;
35324
- img.onload = () => {
35325
- const owidth = img.naturalWidth || img.width;
35326
- const oheight = img.naturalHeight || img.height;
35327
- if (owidth > oheight) {
35328
- width = Math.min(MAX_WIDTH, owidth);
35329
- height = width / owidth * oheight;
35330
- resolve({
35331
- width,
35332
- height
35333
- });
35334
- } else {
35335
- height = Math.min(MAX_HEIGHT, oheight);
35336
- width = height / oheight * owidth;
35337
- resolve({
35338
- width,
35339
- height
35340
- });
35341
- }
35342
- };
35343
- img.onerror = () => resolve({});
35344
- img.src = src;
35345
- });
35346
- };
35347
- const open$1 = async (options) => {
35348
- const e = VcInstance.globalEvent;
35349
- const data = options.data.map((i) => {
35350
- if (typeof i === "string") {
35351
- return {
35352
- src: i
35353
- };
35354
- }
35355
- return {
35356
- ...i,
35357
- src: i.source || i.src
35358
- };
35359
- });
35360
- for (let i = 0; i < data.length; i++) {
35361
- if (!data[i].width) {
35362
- data[i] = {
35363
- ...data[i],
35364
- ...await getFitSize(data[i].src)
35365
- };
35366
- }
35367
- }
35368
- const lightbox = new PhotoSwipeLightbox({
35369
- pswpModule: () => Promise.resolve().then(() => photoswipe_esm),
35370
- closeTitle: "关闭(Esc)",
35371
- zoomTitle: "缩放",
35372
- arrowPrevTitle: "上一张",
35373
- arrowNextTitle: "下一张",
35374
- errorMsg: "网络异常 图片加载失败",
35375
- indexIndicatorSep: " / ",
35376
- initialZoomLevel: "fit"
35377
- });
35378
- lightbox.init();
35379
- lightbox.loadAndOpen(
35380
- options.current || 0,
35381
- data,
35382
- // 下面无效,需要给官方支持
35383
- {
35384
- x: e?.clientX,
35385
- y: e?.clientY
35386
- }
35387
- );
35388
- };
35389
- const ImagePreview = Object.assign(ImagePreview$1, { open: open$1 });
35390
35407
  const MImagePreview = ImagePreview;
35391
35408
  const props$E = {
35392
35409
  tag: {
@@ -35394,9 +35411,9 @@ var Vc = (function (exports, vue) {
35394
35411
  default: "div"
35395
35412
  }
35396
35413
  };
35397
- const COMPONENT_NAME$T = "vc-image-processing";
35414
+ const COMPONENT_NAME$U = "vc-image-processing";
35398
35415
  const ImageProcessing = /* @__PURE__ */ vue.defineComponent({
35399
- name: COMPONENT_NAME$T,
35416
+ name: COMPONENT_NAME$U,
35400
35417
  props: props$E,
35401
35418
  setup(props2, {
35402
35419
  slots
@@ -35409,9 +35426,9 @@ var Vc = (function (exports, vue) {
35409
35426
  }
35410
35427
  });
35411
35428
  const MImageProcessing = ImageProcessing;
35412
- const COMPONENT_NAME$S = "vcm-input";
35429
+ const COMPONENT_NAME$T = "vcm-input";
35413
35430
  const MInput = /* @__PURE__ */ vue.defineComponent({
35414
- name: COMPONENT_NAME$S,
35431
+ name: COMPONENT_NAME$T,
35415
35432
  inheritAttrs: false,
35416
35433
  props: {
35417
35434
  ...props$$,
@@ -35498,9 +35515,9 @@ var Vc = (function (exports, vue) {
35498
35515
  };
35499
35516
  }
35500
35517
  });
35501
- const COMPONENT_NAME$R = "vcm-input-number";
35518
+ const COMPONENT_NAME$S = "vcm-input-number";
35502
35519
  const MInputNumber = /* @__PURE__ */ vue.defineComponent({
35503
- name: COMPONENT_NAME$R,
35520
+ name: COMPONENT_NAME$S,
35504
35521
  props: props$X,
35505
35522
  inheritAttrs: false,
35506
35523
  setup(props2, {
@@ -35546,9 +35563,9 @@ var Vc = (function (exports, vue) {
35546
35563
  };
35547
35564
  }
35548
35565
  });
35549
- const COMPONENT_NAME$Q = "vcm-input-search";
35566
+ const COMPONENT_NAME$R = "vcm-input-search";
35550
35567
  const MInputSearch = /* @__PURE__ */ vue.defineComponent({
35551
- name: COMPONENT_NAME$Q,
35568
+ name: COMPONENT_NAME$R,
35552
35569
  props: {
35553
35570
  ...props$W,
35554
35571
  cancelText: {
@@ -35622,9 +35639,9 @@ var Vc = (function (exports, vue) {
35622
35639
  default: true
35623
35640
  }
35624
35641
  };
35625
- const COMPONENT_NAME$P = "vcm-list";
35642
+ const COMPONENT_NAME$Q = "vcm-list";
35626
35643
  const MList = vue.defineComponent({
35627
- name: COMPONENT_NAME$P,
35644
+ name: COMPONENT_NAME$Q,
35628
35645
  props: props$D,
35629
35646
  setup(props2, { slots }) {
35630
35647
  vue.provide("vc-list", { props: props2 });
@@ -35675,10 +35692,10 @@ var Vc = (function (exports, vue) {
35675
35692
  // MListItem是否独立存在
35676
35693
  alone: Boolean
35677
35694
  };
35678
- const COMPONENT_NAME$O = "vcm-list-item";
35695
+ const COMPONENT_NAME$P = "vcm-list-item";
35679
35696
  const HTTP_REGEX = /[a-zA-z]+:\/\/[^\s]*/;
35680
35697
  const MListItem = /* @__PURE__ */ vue.defineComponent({
35681
- name: COMPONENT_NAME$O,
35698
+ name: COMPONENT_NAME$P,
35682
35699
  props: props$C,
35683
35700
  emits: ["click"],
35684
35701
  setup(props2, {
@@ -35762,11 +35779,11 @@ var Vc = (function (exports, vue) {
35762
35779
  default: false
35763
35780
  }
35764
35781
  };
35765
- const COMPONENT_NAME$N = "vc-marquee";
35782
+ const COMPONENT_NAME$O = "vc-marquee";
35766
35783
  const ANIMATION = prefixStyle("animation").camel;
35767
35784
  const TRANSFORM_KEBAB = prefixStyle("transform").kebab;
35768
35785
  const Marquee = /* @__PURE__ */ vue.defineComponent({
35769
- name: COMPONENT_NAME$N,
35786
+ name: COMPONENT_NAME$O,
35770
35787
  props: props$B,
35771
35788
  setup(props2, {
35772
35789
  slots
@@ -35827,9 +35844,9 @@ var Vc = (function (exports, vue) {
35827
35844
  default: true
35828
35845
  }
35829
35846
  };
35830
- const COMPONENT_NAME$M = "vc-resizer";
35847
+ const COMPONENT_NAME$N = "vc-resizer";
35831
35848
  const Resizer = vue.defineComponent({
35832
- name: COMPONENT_NAME$M,
35849
+ name: COMPONENT_NAME$N,
35833
35850
  props: props$A,
35834
35851
  emit: ["resize", "change"],
35835
35852
  setup(props2, { emit, slots, expose }) {
@@ -35983,10 +36000,10 @@ var Vc = (function (exports, vue) {
35983
36000
  type: Function
35984
36001
  }
35985
36002
  };
35986
- const COMPONENT_NAME$L = "vc-modal";
36003
+ const COMPONENT_NAME$M = "vc-modal";
35987
36004
  let zIndexNumber = 1002;
35988
36005
  const ModalView = /* @__PURE__ */ vue.defineComponent({
35989
- name: COMPONENT_NAME$L,
36006
+ name: COMPONENT_NAME$M,
35990
36007
  emits: ["update:modelValue", "close", "portal-fulfilled", "visible-change", "ok", "cancel"],
35991
36008
  props: props$z,
35992
36009
  setup(props2, {
@@ -36376,9 +36393,9 @@ var Vc = (function (exports, vue) {
36376
36393
  type: Function
36377
36394
  }
36378
36395
  };
36379
- const COMPONENT_NAME$K = "vc-modal";
36396
+ const COMPONENT_NAME$L = "vc-modal";
36380
36397
  const MModalView = /* @__PURE__ */ vue.defineComponent({
36381
- name: COMPONENT_NAME$K,
36398
+ name: COMPONENT_NAME$L,
36382
36399
  emits: ["update:modelValue", "portal-fulfilled", "close", "ok", "cancel"],
36383
36400
  props: props$y,
36384
36401
  setup(props2, {
@@ -36573,9 +36590,9 @@ var Vc = (function (exports, vue) {
36573
36590
  // 这个相当于Modal中的onCancel,支持Promise
36574
36591
  onBeforeClose: Function
36575
36592
  };
36576
- const COMPONENT_NAME$J = "vc-notice";
36593
+ const COMPONENT_NAME$K = "vc-notice";
36577
36594
  const NoticeView = /* @__PURE__ */ vue.defineComponent({
36578
- name: COMPONENT_NAME$J,
36595
+ name: COMPONENT_NAME$K,
36579
36596
  props: props$x,
36580
36597
  emits: ["portal-fulfilled", "close", "before-close"],
36581
36598
  setup(props2, {
@@ -36741,9 +36758,9 @@ var Vc = (function (exports, vue) {
36741
36758
  default: "div"
36742
36759
  }
36743
36760
  };
36744
- const COMPONENT_NAME$I = "vc-option";
36761
+ const COMPONENT_NAME$J = "vc-option";
36745
36762
  const Option$1 = /* @__PURE__ */ vue.defineComponent({
36746
- name: COMPONENT_NAME$I,
36763
+ name: COMPONENT_NAME$J,
36747
36764
  props: props$w,
36748
36765
  setup(props2, {
36749
36766
  slots
@@ -36849,9 +36866,9 @@ var Vc = (function (exports, vue) {
36849
36866
  type: [String, Number]
36850
36867
  }
36851
36868
  };
36852
- const COMPONENT_NAME$H = "vc-tag";
36869
+ const COMPONENT_NAME$I = "vc-tag";
36853
36870
  const Tag = /* @__PURE__ */ vue.defineComponent({
36854
- name: COMPONENT_NAME$H,
36871
+ name: COMPONENT_NAME$I,
36855
36872
  props: props$u,
36856
36873
  emits: ["close", "change"],
36857
36874
  setup(props2, {
@@ -36916,9 +36933,9 @@ var Vc = (function (exports, vue) {
36916
36933
  default: true
36917
36934
  }
36918
36935
  };
36919
- const COMPONENT_NAME$G = "vc-select-option";
36936
+ const COMPONENT_NAME$H = "vc-select-option";
36920
36937
  const Option = /* @__PURE__ */ vue.defineComponent({
36921
- name: COMPONENT_NAME$G,
36938
+ name: COMPONENT_NAME$H,
36922
36939
  props: props$t,
36923
36940
  setup(props2, {
36924
36941
  slots
@@ -36985,9 +37002,9 @@ var Vc = (function (exports, vue) {
36985
37002
  type: [String, Number]
36986
37003
  }
36987
37004
  };
36988
- const COMPONENT_NAME$F = "vc-select-option-group";
37005
+ const COMPONENT_NAME$G = "vc-select-option-group";
36989
37006
  const OptionGroup = /* @__PURE__ */ vue.defineComponent({
36990
- name: COMPONENT_NAME$F,
37007
+ name: COMPONENT_NAME$G,
36991
37008
  props: props$s,
36992
37009
  setup(props2, {
36993
37010
  slots
@@ -37081,9 +37098,9 @@ var Vc = (function (exports, vue) {
37081
37098
  function _isSlot$1(s) {
37082
37099
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
37083
37100
  }
37084
- const COMPONENT_NAME$E = "vc-select";
37101
+ const COMPONENT_NAME$F = "vc-select";
37085
37102
  const Select = /* @__PURE__ */ vue.defineComponent({
37086
- name: COMPONENT_NAME$E,
37103
+ name: COMPONENT_NAME$F,
37087
37104
  props: props$r,
37088
37105
  emits: ["ready", "close", "visible-change", "clear", "change", "update:modelValue"],
37089
37106
  setup(props2, {
@@ -37316,9 +37333,9 @@ var Vc = (function (exports, vue) {
37316
37333
  };
37317
37334
  }
37318
37335
  });
37319
- const COMPONENT_NAME$D = "vc-pagination";
37336
+ const COMPONENT_NAME$E = "vc-pagination";
37320
37337
  const Pagination = /* @__PURE__ */ vue.defineComponent({
37321
- name: COMPONENT_NAME$D,
37338
+ name: COMPONENT_NAME$E,
37322
37339
  props: props$v,
37323
37340
  emits: ["update:current", "change", "page-size-change"],
37324
37341
  setup(props2, {
@@ -37509,9 +37526,9 @@ var Vc = (function (exports, vue) {
37509
37526
  default: "div"
37510
37527
  }
37511
37528
  };
37512
- const COMPONENT_NAME$C = "vc-picker";
37529
+ const COMPONENT_NAME$D = "vc-picker";
37513
37530
  const Picker = /* @__PURE__ */ vue.defineComponent({
37514
- name: COMPONENT_NAME$C,
37531
+ name: COMPONENT_NAME$D,
37515
37532
  props: props$q,
37516
37533
  setup(props2, {
37517
37534
  slots
@@ -37530,9 +37547,9 @@ var Vc = (function (exports, vue) {
37530
37547
  default: "div"
37531
37548
  }
37532
37549
  };
37533
- const COMPONENT_NAME$B = "vc-popconfirm";
37550
+ const COMPONENT_NAME$C = "vc-popconfirm";
37534
37551
  const Popconfirm = /* @__PURE__ */ vue.defineComponent({
37535
- name: COMPONENT_NAME$B,
37552
+ name: COMPONENT_NAME$C,
37536
37553
  props: props$p,
37537
37554
  setup(props2, {
37538
37555
  slots
@@ -37552,9 +37569,9 @@ var Vc = (function (exports, vue) {
37552
37569
  default: "div"
37553
37570
  }
37554
37571
  };
37555
- const COMPONENT_NAME$A = "vc-popup";
37572
+ const COMPONENT_NAME$B = "vc-popup";
37556
37573
  const Popup = /* @__PURE__ */ vue.defineComponent({
37557
- name: COMPONENT_NAME$A,
37574
+ name: COMPONENT_NAME$B,
37558
37575
  props: props$o,
37559
37576
  setup(props2, {
37560
37577
  slots
@@ -37575,9 +37592,9 @@ var Vc = (function (exports, vue) {
37575
37592
  default: "div"
37576
37593
  }
37577
37594
  };
37578
- const COMPONENT_NAME$z = "vc-print";
37595
+ const COMPONENT_NAME$A = "vc-print";
37579
37596
  const Print = /* @__PURE__ */ vue.defineComponent({
37580
- name: COMPONENT_NAME$z,
37597
+ name: COMPONENT_NAME$A,
37581
37598
  props: props$n,
37582
37599
  setup(props2, {
37583
37600
  expose,
@@ -37667,9 +37684,9 @@ var Vc = (function (exports, vue) {
37667
37684
  })
37668
37685
  }
37669
37686
  };
37670
- const COMPONENT_NAME$y = "vc-progress-circle";
37687
+ const COMPONENT_NAME$z = "vc-progress-circle";
37671
37688
  const Circle$1 = /* @__PURE__ */ vue.defineComponent({
37672
- name: COMPONENT_NAME$y,
37689
+ name: COMPONENT_NAME$z,
37673
37690
  props: props$m,
37674
37691
  setup(props2, {
37675
37692
  slots
@@ -37726,9 +37743,9 @@ var Vc = (function (exports, vue) {
37726
37743
  };
37727
37744
  }
37728
37745
  });
37729
- const COMPONENT_NAME$x = "vc-progress-line";
37746
+ const COMPONENT_NAME$y = "vc-progress-line";
37730
37747
  const Line$2 = /* @__PURE__ */ vue.defineComponent({
37731
- name: COMPONENT_NAME$x,
37748
+ name: COMPONENT_NAME$y,
37732
37749
  props: props$m,
37733
37750
  setup(props2) {
37734
37751
  const colorStyle = vue.computed(() => {
@@ -37772,9 +37789,9 @@ var Vc = (function (exports, vue) {
37772
37789
  function _isSlot(s) {
37773
37790
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
37774
37791
  }
37775
- const COMPONENT_NAME$w = "vc-progress";
37792
+ const COMPONENT_NAME$x = "vc-progress";
37776
37793
  const Progress = /* @__PURE__ */ vue.defineComponent({
37777
- name: COMPONENT_NAME$w,
37794
+ name: COMPONENT_NAME$x,
37778
37795
  props: props$m,
37779
37796
  setup(props2, {
37780
37797
  slots
@@ -37926,9 +37943,9 @@ var Vc = (function (exports, vue) {
37926
37943
  computedLabel
37927
37944
  };
37928
37945
  };
37929
- const COMPONENT_NAME$v = "vc-radio";
37946
+ const COMPONENT_NAME$w = "vc-radio";
37930
37947
  const Radio = /* @__PURE__ */ vue.defineComponent({
37931
- name: COMPONENT_NAME$v,
37948
+ name: COMPONENT_NAME$w,
37932
37949
  props: props$l,
37933
37950
  emits: ["update:modelValue", "change"],
37934
37951
  setup(props2, {
@@ -38034,9 +38051,9 @@ var Vc = (function (exports, vue) {
38034
38051
  reset
38035
38052
  };
38036
38053
  };
38037
- const COMPONENT_NAME$u = "vc-radio-group";
38054
+ const COMPONENT_NAME$v = "vc-radio-group";
38038
38055
  const RadioGroup = /* @__PURE__ */ vue.defineComponent({
38039
- name: COMPONENT_NAME$u,
38056
+ name: COMPONENT_NAME$v,
38040
38057
  props: props$k,
38041
38058
  emits: ["update:modelValue", "change"],
38042
38059
  setup(props2, {
@@ -38054,9 +38071,9 @@ var Vc = (function (exports, vue) {
38054
38071
  };
38055
38072
  }
38056
38073
  });
38057
- const COMPONENT_NAME$t = "vcm-radio";
38074
+ const COMPONENT_NAME$u = "vcm-radio";
38058
38075
  const MRadio = /* @__PURE__ */ vue.defineComponent({
38059
- name: COMPONENT_NAME$t,
38076
+ name: COMPONENT_NAME$u,
38060
38077
  props: props$l,
38061
38078
  emits: ["update:modelValue", "change"],
38062
38079
  setup(props2, {
@@ -38094,9 +38111,9 @@ var Vc = (function (exports, vue) {
38094
38111
  };
38095
38112
  }
38096
38113
  });
38097
- const COMPONENT_NAME$s = "vcm-radio-group";
38114
+ const COMPONENT_NAME$t = "vcm-radio-group";
38098
38115
  const MRadioGroup = /* @__PURE__ */ vue.defineComponent({
38099
- name: COMPONENT_NAME$s,
38116
+ name: COMPONENT_NAME$t,
38100
38117
  props: props$k,
38101
38118
  emits: ["update:modelValue", "change"],
38102
38119
  setup(props2, {
@@ -38121,9 +38138,9 @@ var Vc = (function (exports, vue) {
38121
38138
  default: "div"
38122
38139
  }
38123
38140
  };
38124
- const COMPONENT_NAME$r = "vc-rate";
38141
+ const COMPONENT_NAME$s = "vc-rate";
38125
38142
  const Rate = /* @__PURE__ */ vue.defineComponent({
38126
- name: COMPONENT_NAME$r,
38143
+ name: COMPONENT_NAME$s,
38127
38144
  props: props$j,
38128
38145
  setup(props2, {
38129
38146
  slots
@@ -38186,9 +38203,9 @@ var Vc = (function (exports, vue) {
38186
38203
  renderPlaceholder: Function,
38187
38204
  renderRefresh: Function
38188
38205
  };
38189
- const COMPONENT_NAME$q = "vc-recycle-list-scroll-state";
38206
+ const COMPONENT_NAME$r = "vc-recycle-list-scroll-state";
38190
38207
  const ScrollState = /* @__PURE__ */ vue.defineComponent({
38191
- name: COMPONENT_NAME$q,
38208
+ name: COMPONENT_NAME$r,
38192
38209
  setup(_, {
38193
38210
  slots
38194
38211
  }) {
@@ -38312,10 +38329,10 @@ var Vc = (function (exports, vue) {
38312
38329
  );
38313
38330
  return keys;
38314
38331
  };
38315
- const COMPONENT_NAME$p = "vc-recycle-list-container";
38332
+ const COMPONENT_NAME$q = "vc-recycle-list-container";
38316
38333
  const transformKey = prefixStyle("transform").camel;
38317
38334
  const Container = /* @__PURE__ */ vue.defineComponent({
38318
- name: COMPONENT_NAME$p,
38335
+ name: COMPONENT_NAME$q,
38319
38336
  props: props$h,
38320
38337
  emits: ["refresh"],
38321
38338
  setup(props2, {
@@ -38408,9 +38425,9 @@ var Vc = (function (exports, vue) {
38408
38425
  };
38409
38426
  }
38410
38427
  });
38411
- const COMPONENT_NAME$o = "vc-recycle-list";
38428
+ const COMPONENT_NAME$p = "vc-recycle-list";
38412
38429
  const RecycleList = /* @__PURE__ */ vue.defineComponent({
38413
- name: COMPONENT_NAME$o,
38430
+ name: COMPONENT_NAME$p,
38414
38431
  props: props$i,
38415
38432
  emits: ["scroll", "row-resize"],
38416
38433
  setup(props2, {
@@ -38931,9 +38948,9 @@ var Vc = (function (exports, vue) {
38931
38948
  default: "div"
38932
38949
  }
38933
38950
  };
38934
- const COMPONENT_NAME$n = "vc-slider";
38951
+ const COMPONENT_NAME$o = "vc-slider";
38935
38952
  const Slider = /* @__PURE__ */ vue.defineComponent({
38936
- name: COMPONENT_NAME$n,
38953
+ name: COMPONENT_NAME$o,
38937
38954
  props: props$g,
38938
38955
  setup(props2, {
38939
38956
  slots
@@ -38952,9 +38969,9 @@ var Vc = (function (exports, vue) {
38952
38969
  default: "div"
38953
38970
  }
38954
38971
  };
38955
- const COMPONENT_NAME$m = "vc-sort-list";
38972
+ const COMPONENT_NAME$n = "vc-sort-list";
38956
38973
  const SortList = /* @__PURE__ */ vue.defineComponent({
38957
- name: COMPONENT_NAME$m,
38974
+ name: COMPONENT_NAME$n,
38958
38975
  props: props$f,
38959
38976
  setup(props2, {
38960
38977
  slots
@@ -38973,9 +38990,9 @@ var Vc = (function (exports, vue) {
38973
38990
  default: "div"
38974
38991
  }
38975
38992
  };
38976
- const COMPONENT_NAME$l = "vc-steps";
38993
+ const COMPONENT_NAME$m = "vc-steps";
38977
38994
  const Steps = /* @__PURE__ */ vue.defineComponent({
38978
- name: COMPONENT_NAME$l,
38995
+ name: COMPONENT_NAME$m,
38979
38996
  props: props$e,
38980
38997
  setup(props2, {
38981
38998
  slots
@@ -39082,9 +39099,9 @@ var Vc = (function (exports, vue) {
39082
39099
  reset
39083
39100
  };
39084
39101
  };
39085
- const COMPONENT_NAME$k = "vc-switch";
39102
+ const COMPONENT_NAME$l = "vc-switch";
39086
39103
  const Switch = /* @__PURE__ */ vue.defineComponent({
39087
- name: COMPONENT_NAME$k,
39104
+ name: COMPONENT_NAME$l,
39088
39105
  props: props$d,
39089
39106
  // click -> onClick要被拦截,此处不能放置
39090
39107
  emits: ["update:modelValue", "change", "click"],
@@ -39118,9 +39135,9 @@ var Vc = (function (exports, vue) {
39118
39135
  };
39119
39136
  }
39120
39137
  });
39121
- const COMPONENT_NAME$j = "vcm-switch";
39138
+ const COMPONENT_NAME$k = "vcm-switch";
39122
39139
  const MSwitch = /* @__PURE__ */ vue.defineComponent({
39123
- name: COMPONENT_NAME$j,
39140
+ name: COMPONENT_NAME$k,
39124
39141
  props: props$d,
39125
39142
  // click -> onClick要被拦截,此处不能放置
39126
39143
  emits: ["update:modelValue", "change", "click"],
@@ -40221,9 +40238,9 @@ var Vc = (function (exports, vue) {
40221
40238
  });
40222
40239
  return states;
40223
40240
  };
40224
- const COMPONENT_NAME$i = "vc-table-normal-list";
40241
+ const COMPONENT_NAME$j = "vc-table-normal-list";
40225
40242
  const NormalList = /* @__PURE__ */ vue.defineComponent({
40226
- name: COMPONENT_NAME$i,
40243
+ name: COMPONENT_NAME$j,
40227
40244
  props: {
40228
40245
  data: {
40229
40246
  type: Array,
@@ -41059,9 +41076,9 @@ var Vc = (function (exports, vue) {
41059
41076
  // 用于延迟渲染,用于计算高度
41060
41077
  delay: Number
41061
41078
  };
41062
- const COMPONENT_NAME$h = "vc-table";
41079
+ const COMPONENT_NAME$i = "vc-table";
41063
41080
  const Table = /* @__PURE__ */ vue.defineComponent({
41064
- name: COMPONENT_NAME$h,
41081
+ name: COMPONENT_NAME$i,
41065
41082
  props: props$c,
41066
41083
  emits: ["select", "select-all", "selection-change", "cell-mouse-enter", "cell-mouse-leave", "cell-click", "cell-dblclick", "row-click", "row-contextmenu", "row-dblclick", "header-click", "header-contextmenu", "current-change", "header-dragend ", "expand-change", "sort-change"],
41067
41084
  setup(props2, {
@@ -41668,9 +41685,9 @@ var Vc = (function (exports, vue) {
41668
41685
  });
41669
41686
  return endIndex;
41670
41687
  };
41671
- const COMPONENT_NAME$g = "vc-text";
41688
+ const COMPONENT_NAME$h = "vc-text";
41672
41689
  const Text = /* @__PURE__ */ vue.defineComponent({
41673
- name: COMPONENT_NAME$g,
41690
+ name: COMPONENT_NAME$h,
41674
41691
  props: props$b,
41675
41692
  setup(props2, {
41676
41693
  emit
@@ -42299,9 +42316,9 @@ var Vc = (function (exports, vue) {
42299
42316
  handleChange
42300
42317
  };
42301
42318
  };
42302
- const COMPONENT_NAME$f = "vc-tabs";
42319
+ const COMPONENT_NAME$g = "vc-tabs";
42303
42320
  const Tabs = /* @__PURE__ */ vue.defineComponent({
42304
- name: COMPONENT_NAME$f,
42321
+ name: COMPONENT_NAME$g,
42305
42322
  props: props$a,
42306
42323
  emits: ["update:modelValue", "change", "click"],
42307
42324
  setup(props2, {
@@ -42525,9 +42542,9 @@ var Vc = (function (exports, vue) {
42525
42542
  currentValue
42526
42543
  };
42527
42544
  };
42528
- const COMPONENT_NAME$e = "vc-tabs-pane";
42545
+ const COMPONENT_NAME$f = "vc-tabs-pane";
42529
42546
  const TabsPane = /* @__PURE__ */ vue.defineComponent({
42530
- name: COMPONENT_NAME$e,
42547
+ name: COMPONENT_NAME$f,
42531
42548
  props: props$9,
42532
42549
  setup(_, {
42533
42550
  slots
@@ -42578,9 +42595,9 @@ var Vc = (function (exports, vue) {
42578
42595
  default: false
42579
42596
  }
42580
42597
  };
42581
- const COMPONENT_NAME$d = "vcm-tabs";
42598
+ const COMPONENT_NAME$e = "vcm-tabs";
42582
42599
  const MTabs = /* @__PURE__ */ vue.defineComponent({
42583
- name: COMPONENT_NAME$d,
42600
+ name: COMPONENT_NAME$e,
42584
42601
  props: props$8,
42585
42602
  emits: ["update:modelValue", "change", "click"],
42586
42603
  setup(props2, {
@@ -42808,9 +42825,9 @@ var Vc = (function (exports, vue) {
42808
42825
  };
42809
42826
  }
42810
42827
  });
42811
- const COMPONENT_NAME$c = "vcm-tabs-pane";
42828
+ const COMPONENT_NAME$d = "vcm-tabs-pane";
42812
42829
  const MTabsPane = /* @__PURE__ */ vue.defineComponent({
42813
- name: COMPONENT_NAME$c,
42830
+ name: COMPONENT_NAME$d,
42814
42831
  props: props$9,
42815
42832
  setup(_, {
42816
42833
  slots
@@ -43103,9 +43120,9 @@ var Vc = (function (exports, vue) {
43103
43120
  type: [Object, Array]
43104
43121
  }
43105
43122
  };
43106
- const COMPONENT_NAME$b = "vc-textarea";
43123
+ const COMPONENT_NAME$c = "vc-textarea";
43107
43124
  const Textarea = /* @__PURE__ */ vue.defineComponent({
43108
- name: COMPONENT_NAME$b,
43125
+ name: COMPONENT_NAME$c,
43109
43126
  props: Object.assign(props$7, {
43110
43127
  indicator: {
43111
43128
  type: [Boolean, Object],
@@ -43158,9 +43175,9 @@ var Vc = (function (exports, vue) {
43158
43175
  };
43159
43176
  }
43160
43177
  });
43161
- const COMPONENT_NAME$a = "vcm-textarea";
43178
+ const COMPONENT_NAME$b = "vcm-textarea";
43162
43179
  const MTextarea = /* @__PURE__ */ vue.defineComponent({
43163
- name: COMPONENT_NAME$a,
43180
+ name: COMPONENT_NAME$b,
43164
43181
  props: Object.assign(props$7, {
43165
43182
  align: {
43166
43183
  type: String,
@@ -43241,9 +43258,9 @@ var Vc = (function (exports, vue) {
43241
43258
  type: [String, Object]
43242
43259
  }
43243
43260
  };
43244
- const COMPONENT_NAME$9 = "vc-theme";
43261
+ const COMPONENT_NAME$a = "vc-theme";
43245
43262
  const Theme = vue.defineComponent({
43246
- name: COMPONENT_NAME$9,
43263
+ name: COMPONENT_NAME$a,
43247
43264
  props: props$6,
43248
43265
  setup(props2, { slots }) {
43249
43266
  const themeId = getUid("vc-theme");
@@ -43328,9 +43345,9 @@ var Vc = (function (exports, vue) {
43328
43345
  };
43329
43346
  }
43330
43347
  });
43331
- const COMPONENT_NAME$8 = "vc-theme-view";
43348
+ const COMPONENT_NAME$9 = "vc-theme-view";
43332
43349
  const ThemeView = vue.defineComponent({
43333
- name: COMPONENT_NAME$8,
43350
+ name: COMPONENT_NAME$9,
43334
43351
  props: props$6,
43335
43352
  setup(props2, { slots }) {
43336
43353
  return () => {
@@ -43345,9 +43362,9 @@ var Vc = (function (exports, vue) {
43345
43362
  };
43346
43363
  }
43347
43364
  });
43348
- const COMPONENT_NAME$7 = "vc-theme-text";
43365
+ const COMPONENT_NAME$8 = "vc-theme-text";
43349
43366
  const ThemeText = vue.defineComponent({
43350
- name: COMPONENT_NAME$7,
43367
+ name: COMPONENT_NAME$8,
43351
43368
  props: props$6,
43352
43369
  setup(props2, { slots }) {
43353
43370
  return () => {
@@ -43362,9 +43379,9 @@ var Vc = (function (exports, vue) {
43362
43379
  };
43363
43380
  }
43364
43381
  });
43365
- const COMPONENT_NAME$6 = "vc-theme-image";
43382
+ const COMPONENT_NAME$7 = "vc-theme-image";
43366
43383
  const ThemeImage = vue.defineComponent({
43367
- name: COMPONENT_NAME$6,
43384
+ name: COMPONENT_NAME$7,
43368
43385
  props: props$6,
43369
43386
  setup(props2, { slots }) {
43370
43387
  return () => {
@@ -43408,12 +43425,12 @@ var Vc = (function (exports, vue) {
43408
43425
  default: false
43409
43426
  }
43410
43427
  };
43411
- const COMPONENT_NAME$5 = "vc-time-picker";
43428
+ const COMPONENT_NAME$6 = "vc-time-picker";
43412
43429
  const getPanel = (type) => {
43413
43430
  const isRange = type === "timerange";
43414
43431
  return isRange ? TimeRangePanel : TimePanel;
43415
43432
  };
43416
- const TimePicker = createPicker(COMPONENT_NAME$5, props$5, () => {
43433
+ const TimePicker = createPicker(COMPONENT_NAME$6, props$5, () => {
43417
43434
  const props2 = vue.getCurrentInstance().props;
43418
43435
  const icon = vue.ref("icon");
43419
43436
  const panel = vue.shallowRef({});
@@ -43443,9 +43460,9 @@ var Vc = (function (exports, vue) {
43443
43460
  default: "div"
43444
43461
  }
43445
43462
  };
43446
- const COMPONENT_NAME$4 = "vc-timeline";
43463
+ const COMPONENT_NAME$5 = "vc-timeline";
43447
43464
  const Timeline = /* @__PURE__ */ vue.defineComponent({
43448
- name: COMPONENT_NAME$4,
43465
+ name: COMPONENT_NAME$5,
43449
43466
  props: props$4,
43450
43467
  setup(props2, {
43451
43468
  slots
@@ -43466,9 +43483,9 @@ var Vc = (function (exports, vue) {
43466
43483
  default: "div"
43467
43484
  }
43468
43485
  };
43469
- const COMPONENT_NAME$3 = "vc-touch";
43486
+ const COMPONENT_NAME$4 = "vc-touch";
43470
43487
  const Touch = /* @__PURE__ */ vue.defineComponent({
43471
- name: COMPONENT_NAME$3,
43488
+ name: COMPONENT_NAME$4,
43472
43489
  props: props$3,
43473
43490
  setup(props2, {
43474
43491
  slots
@@ -43487,9 +43504,9 @@ var Vc = (function (exports, vue) {
43487
43504
  default: "div"
43488
43505
  }
43489
43506
  };
43490
- const COMPONENT_NAME$2 = "vc-tree";
43507
+ const COMPONENT_NAME$3 = "vc-tree";
43491
43508
  const Tree2 = /* @__PURE__ */ vue.defineComponent({
43492
- name: COMPONENT_NAME$2,
43509
+ name: COMPONENT_NAME$3,
43493
43510
  props: props$2,
43494
43511
  setup(props2, {
43495
43512
  slots
@@ -43595,9 +43612,9 @@ var Vc = (function (exports, vue) {
43595
43612
  default: false
43596
43613
  }
43597
43614
  };
43598
- const COMPONENT_NAME$1 = "vc-upload";
43615
+ const COMPONENT_NAME$2 = "vc-upload";
43599
43616
  const Upload = vue.defineComponent({
43600
- name: COMPONENT_NAME$1,
43617
+ name: COMPONENT_NAME$2,
43601
43618
  props: props$1,
43602
43619
  emits: [
43603
43620
  "message",
@@ -43980,6 +43997,97 @@ var Vc = (function (exports, vue) {
43980
43997
  showMessage: Boolean,
43981
43998
  gallery: Boolean
43982
43999
  };
44000
+ const COMPONENT_NAME$1 = "vc-steps";
44001
+ const ImageItem = /* @__PURE__ */ vue.defineComponent({
44002
+ name: COMPONENT_NAME$1,
44003
+ props: {
44004
+ imageClass: [String, Object, Array],
44005
+ disabled: Boolean,
44006
+ row: Object,
44007
+ imagePreviewOptions: {
44008
+ type: Object,
44009
+ default: () => ({})
44010
+ },
44011
+ index: [String, Number],
44012
+ data: {
44013
+ type: Array,
44014
+ default: () => []
44015
+ },
44016
+ keyValue: Object
44017
+ },
44018
+ emits: ["open", "close", "delete"],
44019
+ setup(props2, {
44020
+ slots,
44021
+ emit
44022
+ }) {
44023
+ const instance = vue.getCurrentInstance();
44024
+ const current = vue.computed(() => {
44025
+ if (props2.row?.status === 0) return -1;
44026
+ const v = props2.data.filter((i) => i.status !== 0);
44027
+ return v.findIndex((i) => {
44028
+ const a = i[props2.keyValue.value] || i;
44029
+ const b = props2.row?.[props2.keyValue.value] || props2.row;
44030
+ return a === b;
44031
+ });
44032
+ });
44033
+ const getPreviewData = () => {
44034
+ return props2.data.map((i) => i?.[props2.keyValue.value]);
44035
+ };
44036
+ const previewByPS = (e, index) => {
44037
+ emit("open");
44038
+ ImagePreview.open({
44039
+ current: index,
44040
+ data: getPreviewData(),
44041
+ onClose: () => emit("close")
44042
+ });
44043
+ };
44044
+ const handlePreview = (e) => {
44045
+ let {
44046
+ enhancer
44047
+ } = VcInstance.options.ImagePreview || {};
44048
+ enhancer = props2.imagePreviewOptions.enhancer || enhancer || (() => false);
44049
+ const images = getPreviewData().map((item) => ({
44050
+ src: item
44051
+ }));
44052
+ enhancer(current.value, images, instance) || previewByPS(e, current.value);
44053
+ };
44054
+ const handleDel = () => {
44055
+ emit("delete");
44056
+ };
44057
+ return () => {
44058
+ const row = props2.row;
44059
+ return vue.createVNode("div", {
44060
+ "class": [{
44061
+ "is-error": row.status == 0
44062
+ }, "vc-upload-image-item"]
44063
+ }, [slots.default ? slots.default({
44064
+ it: row,
44065
+ current: current.value
44066
+ }) : vue.createVNode(vue.Fragment, null, [!row.errorFlag && typeof row[props2.keyValue.value] === "string" ? vue.createVNode(Image$1, {
44067
+ "src": row[props2.keyValue.value],
44068
+ "class": [props2.imageClass, "vc-upload-image-item__content"],
44069
+ "fit": "cover",
44070
+ "previewable": false,
44071
+ "onClick": handlePreview
44072
+ }, null) : vue.createVNode("div", {
44073
+ "class": [props2.imageClass, "vc-upload-image-item__content"]
44074
+ }, [row.percent && row.percent != 100 ? vue.createVNode(Progress, {
44075
+ "percent": row.percent,
44076
+ "show-text": false,
44077
+ "status": "normal",
44078
+ "style": "width: 100%;padding: 0 5px"
44079
+ }, null) : !row[props2.keyValue.value] && row.percent === 100 && !row.errorFlag ? vue.createVNode("p", {
44080
+ "style": "line-height: 1; padding: 5px"
44081
+ }, [vue.createTextVNode("服务器正在接收...")]) : row.status == 0 ? vue.createVNode("div", {
44082
+ "style": "padding: 5px"
44083
+ }, [vue.createTextVNode("上传失败")]) : null]), (!props2.disabled || row.errorFlag) && vue.createVNode(Icon, {
44084
+ "type": "close-small",
44085
+ "class": "vc-upload-picker__delete",
44086
+ "onClick": handleDel
44087
+ }, null)])]);
44088
+ };
44089
+ }
44090
+ });
43983
44091
  const recognizer = (url) => {
43984
44092
  const reg = /\.(jpe?g|png|gif|bmp|webp|image|heic|mp4|mov|avi|mpg|mpeg|rmvb)/ig;
43985
44093
  const result = url.match(reg);
@@ -44227,7 +44335,7 @@ var Vc = (function (exports, vue) {
44227
44335
  const UploadPicker = /* @__PURE__ */ vue.defineComponent({
44228
44336
  name: COMPONENT_NAME,
44229
44337
  props,
44230
- emits: ["update:modelValue", "file-success", "file-start", "success", "error", "complete", "change", "remove-before"],
44338
+ emits: ["update:modelValue", "file-success", "file-start", "file-before", "file-error", "success", "error", "complete", "change", "remove-before"],
44231
44339
  setup(props2, {
44232
44340
  slots,
44233
44341
  expose
@@ -44239,8 +44347,7 @@ var Vc = (function (exports, vue) {
44239
44347
  case "image":
44240
44348
  pre.push({
44241
44349
  type: cur,
44242
- item: "div"
44243
- // item: ImageItem
44350
+ item: ImageItem
44244
44351
  });
44245
44352
  return pre;
44246
44353
  case "video":
@@ -44287,7 +44394,7 @@ var Vc = (function (exports, vue) {
44287
44394
  const Item = picker.item;
44288
44395
  return vue.createVNode(Item, {
44289
44396
  "key": typeof item === "object" ? item.uid : item,
44290
- "it": item,
44397
+ "row": item,
44291
44398
  "disabled": props2.disabled,
44292
44399
  "image-preview-options": props2.imagePreviewOptions,
44293
44400
  "imageClass": props2.imageClass,
@@ -44295,18 +44402,19 @@ var Vc = (function (exports, vue) {
44295
44402
  "audioClass": props2.audioClass,
44296
44403
  "fileClass": props2.fileClass,
44297
44404
  "index": index,
44298
- "data": item,
44405
+ "keyValue": props2.keyValue,
44406
+ "data": base.currentValue.value[picker.type],
44299
44407
  "class": "vc-upload-picker__item",
44300
44408
  "onDelete": () => base.handleDelete(index, picker.type)
44301
44409
  }, {
44302
- default: (scopeData) => {
44303
- return slots.default ? slots.default({
44410
+ default: slots.default ? (scopeData) => {
44411
+ return slots?.default?.({
44304
44412
  it: scopeData?.it,
44305
44413
  current: scopeData?.current,
44306
44414
  index,
44307
44415
  name: picker.type
44308
- }) : scopeData;
44309
- }
44416
+ });
44417
+ } : null
44310
44418
  });
44311
44419
  }), vue.withDirectives(vue.createVNode(Upload, vue.mergeProps(base.currentUploadOptions.value[picker.type], {
44312
44420
  "max": base.dynamicMax[picker.type],