@deot/vc-components 1.0.25 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9,8 +9,8 @@ import { composedPath, scrollIntoView, prefixStyle, removeClass, addClass, hasCl
9
9
  import { useAttrs, useScrollbar, getInstance } from '@deot/vc-hooks';
10
10
  import { Wheel } from '@deot/helper-wheel';
11
11
  import { Validator } from '@deot/helper-validator';
12
- import { Storage } from '@deot/helper-cache';
13
12
  import PhotoSwipeLightbox from 'photoswipe/lightbox';
13
+ import { Storage } from '@deot/helper-cache';
14
14
  import * as Load from '@deot/helper-load';
15
15
  import { style } from '@deot/helper-load';
16
16
  import { Interrupter } from '@deot/helper-scheduler';
@@ -81,9 +81,9 @@ const props$1q = {
81
81
 
82
82
  /** @jsxImportSource vue */
83
83
 
84
- const COMPONENT_NAME$1$ = 'vc-action-sheet';
84
+ const COMPONENT_NAME$20 = 'vc-action-sheet';
85
85
  const ActionSheet = /* @__PURE__ */ defineComponent({
86
- name: COMPONENT_NAME$1$,
86
+ name: COMPONENT_NAME$20,
87
87
  props: props$1q,
88
88
  setup(props, {
89
89
  slots
@@ -270,9 +270,9 @@ const IconManager = new Manager();
270
270
 
271
271
  /** @jsxImportSource vue */
272
272
 
273
- const COMPONENT_NAME$1_ = 'vc-icon';
273
+ const COMPONENT_NAME$1$ = 'vc-icon';
274
274
  const Icon = /* @__PURE__ */ defineComponent({
275
- name: COMPONENT_NAME$1_,
275
+ name: COMPONENT_NAME$1$,
276
276
  props: props$1o,
277
277
  setup(props) {
278
278
  const viewBox = ref('0 0 1024 1024');
@@ -471,9 +471,9 @@ const useTransition = () => {
471
471
  };
472
472
  };
473
473
 
474
- const COMPONENT_NAME$1Z = "vc-transition";
474
+ const COMPONENT_NAME$1_ = "vc-transition";
475
475
  const Transition = defineComponent({
476
- name: COMPONENT_NAME$1Z,
476
+ name: COMPONENT_NAME$1_,
477
477
  props: props$1n,
478
478
  // 当不声明emits的情况下,事件存在于attrs中
479
479
  inheritAttrs: false,
@@ -494,9 +494,9 @@ const Transition = defineComponent({
494
494
  }
495
495
  });
496
496
 
497
- const COMPONENT_NAME$1Y = "vc-transition-collapse";
497
+ const COMPONENT_NAME$1Z = "vc-transition-collapse";
498
498
  const TransitionCollapse = defineComponent({
499
- name: COMPONENT_NAME$1Y,
499
+ name: COMPONENT_NAME$1Z,
500
500
  props: props$1n,
501
501
  // 当不声明emits的情况下,事件存在于attrs中
502
502
  inheritAttrs: false,
@@ -615,9 +615,9 @@ const TransitionCollapse = defineComponent({
615
615
  }
616
616
  });
617
617
 
618
- const COMPONENT_NAME$1X = "vc-transition-fade";
618
+ const COMPONENT_NAME$1Y = "vc-transition-fade";
619
619
  const TransitionFade = defineComponent({
620
- name: COMPONENT_NAME$1X,
620
+ name: COMPONENT_NAME$1Y,
621
621
  props: {
622
622
  ...props$1n,
623
623
  // inheritAttrs必须是false
@@ -652,9 +652,9 @@ const TransitionFade = defineComponent({
652
652
  }
653
653
  });
654
654
 
655
- const COMPONENT_NAME$1W = "vc-transition-scale";
655
+ const COMPONENT_NAME$1X = "vc-transition-scale";
656
656
  const TransitionScale = defineComponent({
657
- name: COMPONENT_NAME$1W,
657
+ name: COMPONENT_NAME$1X,
658
658
  props: {
659
659
  ...props$1n,
660
660
  mode: {
@@ -694,9 +694,9 @@ const TransitionScale = defineComponent({
694
694
  }
695
695
  });
696
696
 
697
- const COMPONENT_NAME$1V = "vc-transition-slide";
697
+ const COMPONENT_NAME$1W = "vc-transition-slide";
698
698
  const TransitionSlide = defineComponent({
699
- name: COMPONENT_NAME$1V,
699
+ name: COMPONENT_NAME$1W,
700
700
  props: {
701
701
  ...props$1n,
702
702
  mode: {
@@ -736,9 +736,9 @@ const TransitionSlide = defineComponent({
736
736
  }
737
737
  });
738
738
 
739
- const COMPONENT_NAME$1U = "vc-transition-zoom";
739
+ const COMPONENT_NAME$1V = "vc-transition-zoom";
740
740
  const TransitionZoom = defineComponent({
741
- name: COMPONENT_NAME$1U,
741
+ name: COMPONENT_NAME$1V,
742
742
  props: {
743
743
  ...props$1n,
744
744
  mode: {
@@ -780,7 +780,7 @@ const TransitionZoom = defineComponent({
780
780
 
781
781
  /** @jsxImportSource vue */
782
782
 
783
- const COMPONENT_NAME$1T = 'vc-alert';
783
+ const COMPONENT_NAME$1U = 'vc-alert';
784
784
 
785
785
  // [color, borderColor, backgroundColor], -> CSS
786
786
  const THEME_MAP = {
@@ -790,7 +790,7 @@ const THEME_MAP = {
790
790
  warning: ['#ffbf00', '#ffe58f', '#fffbe6']
791
791
  };
792
792
  const Alert = /* @__PURE__ */ defineComponent({
793
- name: COMPONENT_NAME$1T,
793
+ name: COMPONENT_NAME$1U,
794
794
  props: props$1p,
795
795
  setup(props, {
796
796
  slots,
@@ -889,9 +889,9 @@ const props$1m = {
889
889
 
890
890
  /** @jsxImportSource vue */
891
891
 
892
- const COMPONENT_NAME$1S = 'vc-artboard';
892
+ const COMPONENT_NAME$1T = 'vc-artboard';
893
893
  const Artboard = /* @__PURE__ */ defineComponent({
894
- name: COMPONENT_NAME$1S,
894
+ name: COMPONENT_NAME$1T,
895
895
  props: props$1m,
896
896
  setup(props, {
897
897
  slots
@@ -930,9 +930,9 @@ const props$1l = {
930
930
 
931
931
  /** @jsxImportSource vue */
932
932
 
933
- const COMPONENT_NAME$1R = 'vc-spin';
933
+ const COMPONENT_NAME$1S = 'vc-spin';
934
934
  const Spin = /* @__PURE__ */ defineComponent({
935
- name: COMPONENT_NAME$1R,
935
+ name: COMPONENT_NAME$1S,
936
936
  props: props$1l,
937
937
  setup(props, {
938
938
  slots
@@ -983,9 +983,9 @@ const props$1k = {
983
983
  exclude: RegExp
984
984
  };
985
985
 
986
- const COMPONENT_NAME$1Q = "vc-debounce";
986
+ const COMPONENT_NAME$1R = "vc-debounce";
987
987
  const Debounce = defineComponent({
988
- name: COMPONENT_NAME$1Q,
988
+ name: COMPONENT_NAME$1R,
989
989
  props: props$1k,
990
990
  /**
991
991
  * 不声明emits使得事件被透传放入attrs中, 这样可以让所有的事件透传
@@ -1057,9 +1057,9 @@ const props$1j = {
1057
1057
 
1058
1058
  /** @jsxImportSource vue */
1059
1059
 
1060
- const COMPONENT_NAME$1P = 'vc-button';
1060
+ const COMPONENT_NAME$1Q = 'vc-button';
1061
1061
  const Button = /* @__PURE__ */ defineComponent({
1062
- name: COMPONENT_NAME$1P,
1062
+ name: COMPONENT_NAME$1Q,
1063
1063
  emits: ['click'],
1064
1064
  props: props$1j,
1065
1065
  setup(props, {
@@ -1141,9 +1141,9 @@ const props$1i = {
1141
1141
 
1142
1142
  /** @jsxImportSource vue */
1143
1143
 
1144
- const COMPONENT_NAME$1O = 'vc-button-group';
1144
+ const COMPONENT_NAME$1P = 'vc-button-group';
1145
1145
  const ButtonGroup = /* @__PURE__ */ defineComponent({
1146
- name: COMPONENT_NAME$1O,
1146
+ name: COMPONENT_NAME$1P,
1147
1147
  props: props$1i,
1148
1148
  setup(props, {
1149
1149
  slots
@@ -1177,9 +1177,9 @@ const props$1h = {
1177
1177
 
1178
1178
  /** @jsxImportSource vue */
1179
1179
 
1180
- const COMPONENT_NAME$1N = 'vc-calendar';
1180
+ const COMPONENT_NAME$1O = 'vc-calendar';
1181
1181
  const Calendar = /* @__PURE__ */ defineComponent({
1182
- name: COMPONENT_NAME$1N,
1182
+ name: COMPONENT_NAME$1O,
1183
1183
  props: props$1h,
1184
1184
  setup(props, {
1185
1185
  slots
@@ -1217,9 +1217,9 @@ const props$1g = {
1217
1217
 
1218
1218
  /** @jsxImportSource vue */
1219
1219
 
1220
- const COMPONENT_NAME$1M = 'vc-card';
1220
+ const COMPONENT_NAME$1N = 'vc-card';
1221
1221
  const Card = /* @__PURE__ */ defineComponent({
1222
- name: COMPONENT_NAME$1M,
1222
+ name: COMPONENT_NAME$1N,
1223
1223
  props: props$1g,
1224
1224
  setup(props, {
1225
1225
  slots
@@ -1255,9 +1255,9 @@ const props$1f = {
1255
1255
 
1256
1256
  /** @jsxImportSource vue */
1257
1257
 
1258
- const COMPONENT_NAME$1L = 'vc-carousel';
1258
+ const COMPONENT_NAME$1M = 'vc-carousel';
1259
1259
  const Carousel = /* @__PURE__ */ defineComponent({
1260
- name: COMPONENT_NAME$1L,
1260
+ name: COMPONENT_NAME$1M,
1261
1261
  props: props$1f,
1262
1262
  setup(props, {
1263
1263
  slots
@@ -1281,9 +1281,9 @@ const props$1e = {
1281
1281
 
1282
1282
  /** @jsxImportSource vue */
1283
1283
 
1284
- const COMPONENT_NAME$1K = 'vc-cascader';
1284
+ const COMPONENT_NAME$1L = 'vc-cascader';
1285
1285
  const Cascader = /* @__PURE__ */ defineComponent({
1286
- name: COMPONENT_NAME$1K,
1286
+ name: COMPONENT_NAME$1L,
1287
1287
  props: props$1e,
1288
1288
  setup(props, {
1289
1289
  slots
@@ -1352,9 +1352,9 @@ const props$1d = {
1352
1352
 
1353
1353
  /** @jsxImportSource vue */
1354
1354
 
1355
- const COMPONENT_NAME$1J = 'vc-chart';
1355
+ const COMPONENT_NAME$1K = 'vc-chart';
1356
1356
  const Chart = /* @__PURE__ */ defineComponent({
1357
- name: COMPONENT_NAME$1J,
1357
+ name: COMPONENT_NAME$1K,
1358
1358
  props: props$1d,
1359
1359
  emits: [...EVENTS, 'ready'],
1360
1360
  setup(props, {
@@ -1586,9 +1586,9 @@ const useCheckbox = () => {
1586
1586
 
1587
1587
  /** @jsxImportSource vue */
1588
1588
 
1589
- const COMPONENT_NAME$1I = 'vc-checkbox';
1589
+ const COMPONENT_NAME$1J = 'vc-checkbox';
1590
1590
  const Checkbox = /* @__PURE__ */ defineComponent({
1591
- name: COMPONENT_NAME$1I,
1591
+ name: COMPONENT_NAME$1J,
1592
1592
  props: props$1c,
1593
1593
  emits: ['update:modelValue', 'change'],
1594
1594
  setup(props, {
@@ -1675,9 +1675,9 @@ const useCheckboxGroup = () => {
1675
1675
 
1676
1676
  /** @jsxImportSource vue */
1677
1677
 
1678
- const COMPONENT_NAME$1H = 'vc-checkbox-group';
1678
+ const COMPONENT_NAME$1I = 'vc-checkbox-group';
1679
1679
  const CheckboxGroup = /* @__PURE__ */ defineComponent({
1680
- name: COMPONENT_NAME$1H,
1680
+ name: COMPONENT_NAME$1I,
1681
1681
  props: props$1b,
1682
1682
  emits: ['update:modelValue', 'change'],
1683
1683
  setup(props, {
@@ -1695,9 +1695,9 @@ const CheckboxGroup = /* @__PURE__ */ defineComponent({
1695
1695
 
1696
1696
  /** @jsxImportSource vue */
1697
1697
 
1698
- const COMPONENT_NAME$1G = 'vcm-checkbox';
1698
+ const COMPONENT_NAME$1H = 'vcm-checkbox';
1699
1699
  const MCheckbox = /* @__PURE__ */ defineComponent({
1700
- name: COMPONENT_NAME$1G,
1700
+ name: COMPONENT_NAME$1H,
1701
1701
  props: props$1c,
1702
1702
  emits: ['update:modelValue', 'change'],
1703
1703
  setup(props, {
@@ -1737,9 +1737,9 @@ const MCheckbox = /* @__PURE__ */ defineComponent({
1737
1737
 
1738
1738
  /** @jsxImportSource vue */
1739
1739
 
1740
- const COMPONENT_NAME$1F = 'vcm-checkbox-group';
1740
+ const COMPONENT_NAME$1G = 'vcm-checkbox-group';
1741
1741
  const MCheckboxGroup = /* @__PURE__ */ defineComponent({
1742
- name: COMPONENT_NAME$1F,
1742
+ name: COMPONENT_NAME$1G,
1743
1743
  props: props$1b,
1744
1744
  emits: ['update:modelValue', 'change'],
1745
1745
  setup(props, {
@@ -1798,9 +1798,9 @@ const props$19 = {
1798
1798
  }
1799
1799
  };
1800
1800
 
1801
- const COMPONENT_NAME$1E = "vc-customer";
1801
+ const COMPONENT_NAME$1F = "vc-customer";
1802
1802
  const Customer = defineComponent({
1803
- name: COMPONENT_NAME$1E,
1803
+ name: COMPONENT_NAME$1F,
1804
1804
  props: props$19,
1805
1805
  setup(props, context) {
1806
1806
  return () => h(() => {
@@ -1811,9 +1811,9 @@ const Customer = defineComponent({
1811
1811
 
1812
1812
  /** @jsxImportSource vue */
1813
1813
 
1814
- const COMPONENT_NAME$1D = 'vc-message';
1814
+ const COMPONENT_NAME$1E = 'vc-message';
1815
1815
  const MessageView = /* @__PURE__ */ defineComponent({
1816
- name: COMPONENT_NAME$1D,
1816
+ name: COMPONENT_NAME$1E,
1817
1817
  emits: ['before-close', 'close', 'portal-fulfilled'],
1818
1818
  props: props$1a,
1819
1819
  setup(props, {
@@ -1960,7 +1960,7 @@ class PortalLeaf {
1960
1960
  }
1961
1961
  }
1962
1962
 
1963
- const COMPONENT_NAME$1C = "vc-portal";
1963
+ const COMPONENT_NAME$1D = "vc-portal";
1964
1964
  class Portal {
1965
1965
  /**
1966
1966
  * 清理Portals类型组件
@@ -2012,7 +2012,7 @@ class Portal {
2012
2012
  this.wrapper = wrapper;
2013
2013
  this.globalOptions = {
2014
2014
  ...options,
2015
- name: options?.name || wrapper.name || Utils.getUid(COMPONENT_NAME$1C)
2015
+ name: options?.name || wrapper.name || Utils.getUid(COMPONENT_NAME$1D)
2016
2016
  };
2017
2017
  }
2018
2018
  popup(propsData, options) {
@@ -2111,7 +2111,7 @@ class Portal {
2111
2111
  ...rest
2112
2112
  } = options;
2113
2113
  let useAllNodes = fragment;
2114
- const name = multiple ? `${name$}__${Utils.getUid(COMPONENT_NAME$1C)}` : name$;
2114
+ const name = multiple ? `${name$}__${Utils.getUid(COMPONENT_NAME$1D)}` : name$;
2115
2115
  const container = document.createElement(tag);
2116
2116
  const root = typeof el === "object" ? el : document.querySelector(el || "body");
2117
2117
  !alive && Portal.leafs.get(name)?.destroy();
@@ -2145,7 +2145,7 @@ class Portal {
2145
2145
  } else {
2146
2146
  const wrapper = this.wrapper;
2147
2147
  const app = createApp({
2148
- name: COMPONENT_NAME$1C,
2148
+ name: COMPONENT_NAME$1D,
2149
2149
  parent,
2150
2150
  setup() {
2151
2151
  if (alive) {
@@ -2257,13 +2257,13 @@ const props$18 = {
2257
2257
  }
2258
2258
  };
2259
2259
 
2260
- const COMPONENT_NAME$1B = 'vc-portal-view';
2260
+ const COMPONENT_NAME$1C = 'vc-portal-view';
2261
2261
 
2262
2262
  /**
2263
2263
  * 写法不同,但与vue@2.x 保持一致
2264
2264
  */
2265
2265
  const PortalView = /* @__PURE__ */ defineComponent({
2266
- name: COMPONENT_NAME$1B,
2266
+ name: COMPONENT_NAME$1C,
2267
2267
  props: props$18,
2268
2268
  setup(props, {
2269
2269
  slots
@@ -2434,9 +2434,9 @@ const useClipboard = (done) => {
2434
2434
  return () => h(props.tag, { onClick: handleClick, class: "vc-clipboard" }, slots?.default?.());
2435
2435
  };
2436
2436
 
2437
- const COMPONENT_NAME$1A = "vc-clipboard";
2437
+ const COMPONENT_NAME$1B = "vc-clipboard";
2438
2438
  const Clipboard$1 = defineComponent({
2439
- name: COMPONENT_NAME$1A,
2439
+ name: COMPONENT_NAME$1B,
2440
2440
  props: props$17,
2441
2441
  setup() {
2442
2442
  return useClipboard((content) => Message.success({ content }));
@@ -2476,9 +2476,9 @@ const MTransitionZoom = TransitionZoom;
2476
2476
 
2477
2477
  /** @jsxImportSource vue */
2478
2478
 
2479
- const COMPONENT_NAME$1z = 'vcm-toast';
2479
+ const COMPONENT_NAME$1A = 'vcm-toast';
2480
2480
  const MToastView = /* @__PURE__ */ defineComponent({
2481
- name: COMPONENT_NAME$1z,
2481
+ name: COMPONENT_NAME$1A,
2482
2482
  emits: ['close', 'portal-fulfilled'],
2483
2483
  props: props$16,
2484
2484
  setup(props, {
@@ -2580,9 +2580,9 @@ const warning$2 = create$3({ mode: "warning" });
2580
2580
  const error$2 = create$3({ mode: "error" });
2581
2581
  const MToast = Object.assign(MToastView, { destroy: destroy$4, info: info$2, success: success$2, loading, warning: warning$2, error: error$2 });
2582
2582
 
2583
- const COMPONENT_NAME$1y = "vcm-clipboard";
2583
+ const COMPONENT_NAME$1z = "vcm-clipboard";
2584
2584
  const MClipboard$1 = defineComponent({
2585
- name: COMPONENT_NAME$1y,
2585
+ name: COMPONENT_NAME$1z,
2586
2586
  props: props$17,
2587
2587
  setup() {
2588
2588
  return useClipboard((content) => MToast.info({ content }));
@@ -2614,9 +2614,9 @@ const props$15 = {
2614
2614
  }
2615
2615
  };
2616
2616
 
2617
- const COMPONENT_NAME$1x = "vc-collapse";
2617
+ const COMPONENT_NAME$1y = "vc-collapse";
2618
2618
  const Collapse = defineComponent({
2619
- name: COMPONENT_NAME$1x,
2619
+ name: COMPONENT_NAME$1y,
2620
2620
  props: props$15,
2621
2621
  emits: ["update:moodelValue", "change"],
2622
2622
  setup(props, { slots, emit }) {
@@ -2733,9 +2733,9 @@ const props$13 = {
2733
2733
  function _isSlot$3(s) {
2734
2734
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
2735
2735
  }
2736
- const COMPONENT_NAME$1w = 'vc-expand';
2736
+ const COMPONENT_NAME$1x = 'vc-expand';
2737
2737
  const Expand$1 = /* @__PURE__ */ defineComponent({
2738
- name: COMPONENT_NAME$1w,
2738
+ name: COMPONENT_NAME$1x,
2739
2739
  props: props$13,
2740
2740
  setup(props, {
2741
2741
  slots
@@ -2765,9 +2765,9 @@ const Expand$1 = /* @__PURE__ */ defineComponent({
2765
2765
 
2766
2766
  /** @jsxImportSource vue */
2767
2767
 
2768
- const COMPONENT_NAME$1v = 'vc-collapse-item';
2768
+ const COMPONENT_NAME$1w = 'vc-collapse-item';
2769
2769
  const CollapseItem = /* @__PURE__ */ defineComponent({
2770
- name: COMPONENT_NAME$1v,
2770
+ name: COMPONENT_NAME$1w,
2771
2771
  props: props$14,
2772
2772
  setup(props, {
2773
2773
  slots,
@@ -2842,9 +2842,9 @@ const props$12 = {
2842
2842
 
2843
2843
  /** @jsxImportSource vue */
2844
2844
 
2845
- const COMPONENT_NAME$1u = 'vc-color-picker';
2845
+ const COMPONENT_NAME$1v = 'vc-color-picker';
2846
2846
  const ColorPicker = /* @__PURE__ */ defineComponent({
2847
- name: COMPONENT_NAME$1u,
2847
+ name: COMPONENT_NAME$1v,
2848
2848
  props: props$12,
2849
2849
  setup(props, {
2850
2850
  slots
@@ -2868,9 +2868,9 @@ const props$11 = {
2868
2868
 
2869
2869
  /** @jsxImportSource vue */
2870
2870
 
2871
- const COMPONENT_NAME$1t = 'vc-countdown';
2871
+ const COMPONENT_NAME$1u = 'vc-countdown';
2872
2872
  const Countdown = /* @__PURE__ */ defineComponent({
2873
- name: COMPONENT_NAME$1t,
2873
+ name: COMPONENT_NAME$1u,
2874
2874
  props: props$11,
2875
2875
  setup(props, {
2876
2876
  slots
@@ -3320,9 +3320,9 @@ const useNativeEmitter = (input, expose) => {
3320
3320
 
3321
3321
  /** @jsxImportSource vue */
3322
3322
 
3323
- const COMPONENT_NAME$1s = 'vc-input';
3323
+ const COMPONENT_NAME$1t = 'vc-input';
3324
3324
  const Input = /* @__PURE__ */ defineComponent({
3325
- name: COMPONENT_NAME$1s,
3325
+ name: COMPONENT_NAME$1t,
3326
3326
  inheritAttrs: false,
3327
3327
  props: {
3328
3328
  ...props$$,
@@ -3656,9 +3656,9 @@ const useInputNumber = () => {
3656
3656
 
3657
3657
  /** @jsxImportSource vue */
3658
3658
 
3659
- const COMPONENT_NAME$1r = 'vc-input-number';
3659
+ const COMPONENT_NAME$1s = 'vc-input-number';
3660
3660
  const InputNumber = /* @__PURE__ */ defineComponent({
3661
- name: COMPONENT_NAME$1r,
3661
+ name: COMPONENT_NAME$1s,
3662
3662
  props: props$X,
3663
3663
  inheritAttrs: false,
3664
3664
  setup(props, {
@@ -3722,9 +3722,9 @@ const props$W = {
3722
3722
 
3723
3723
  /** @jsxImportSource vue */
3724
3724
 
3725
- const COMPONENT_NAME$1q = 'vc-input-search';
3725
+ const COMPONENT_NAME$1r = 'vc-input-search';
3726
3726
  const InputSearch = /* @__PURE__ */ defineComponent({
3727
- name: COMPONENT_NAME$1q,
3727
+ name: COMPONENT_NAME$1r,
3728
3728
  props: props$W,
3729
3729
  inheritAttrs: false,
3730
3730
  setup(props, {
@@ -4015,9 +4015,9 @@ const usePos = () => {
4015
4015
  function _isSlot$2(s) {
4016
4016
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
4017
4017
  }
4018
- const COMPONENT_NAME$1p = 'vc-popover-wrapper';
4018
+ const COMPONENT_NAME$1q = 'vc-popover-wrapper';
4019
4019
  const PopoverWrapper = /* @__PURE__ */ defineComponent({
4020
- name: COMPONENT_NAME$1p,
4020
+ name: COMPONENT_NAME$1q,
4021
4021
  props: props$_,
4022
4022
  emits: ['portal-fulfilled', 'close'],
4023
4023
  setup(props, {
@@ -4267,9 +4267,9 @@ const PopoverPortal = new Portal(PopoverWrapper);
4267
4267
 
4268
4268
  /** @jsxImportSource vue */
4269
4269
 
4270
- const COMPONENT_NAME$1o = 'vc-popover';
4270
+ const COMPONENT_NAME$1p = 'vc-popover';
4271
4271
  const Popover$1 = /* @__PURE__ */ defineComponent({
4272
- name: COMPONENT_NAME$1o,
4272
+ name: COMPONENT_NAME$1p,
4273
4273
  props: props$Z,
4274
4274
  emits: ['update:modelValue', 'visible-change', 'ready', 'close'],
4275
4275
  setup(props, {
@@ -5370,9 +5370,9 @@ const getTimeType = type => {
5370
5370
  }
5371
5371
  return view;
5372
5372
  };
5373
- const COMPONENT_NAME$1n = 'vc-date-confirm';
5373
+ const COMPONENT_NAME$1o = 'vc-date-confirm';
5374
5374
  const Confirm = /* @__PURE__ */ defineComponent({
5375
- name: COMPONENT_NAME$1n,
5375
+ name: COMPONENT_NAME$1o,
5376
5376
  props: {
5377
5377
  showTime: {
5378
5378
  type: Boolean,
@@ -5436,9 +5436,9 @@ const Confirm = /* @__PURE__ */ defineComponent({
5436
5436
 
5437
5437
  /** @jsxImportSource vue */
5438
5438
 
5439
- const COMPONENT_NAME$1m = 'vc-date-header';
5439
+ const COMPONENT_NAME$1n = 'vc-date-header';
5440
5440
  const DateHeader = /* @__PURE__ */ defineComponent({
5441
- name: COMPONENT_NAME$1m,
5441
+ name: COMPONENT_NAME$1n,
5442
5442
  props: {
5443
5443
  panelDate: Date,
5444
5444
  showNext: {
@@ -5522,9 +5522,9 @@ const DateHeader = /* @__PURE__ */ defineComponent({
5522
5522
 
5523
5523
  /** @jsxImportSource vue */
5524
5524
 
5525
- const COMPONENT_NAME$1l = 'vc-date-table';
5525
+ const COMPONENT_NAME$1m = 'vc-date-table';
5526
5526
  const DateTable = /* @__PURE__ */ defineComponent({
5527
- name: COMPONENT_NAME$1l,
5527
+ name: COMPONENT_NAME$1m,
5528
5528
  props: {
5529
5529
  value: Array,
5530
5530
  firstDayOfWeek: {
@@ -5733,9 +5733,9 @@ const DateTable = /* @__PURE__ */ defineComponent({
5733
5733
 
5734
5734
  /** @jsxImportSource vue */
5735
5735
 
5736
- const COMPONENT_NAME$1k = 'vc-month-table';
5736
+ const COMPONENT_NAME$1l = 'vc-month-table';
5737
5737
  const MonthTable = /* @__PURE__ */ defineComponent({
5738
- name: COMPONENT_NAME$1k,
5738
+ name: COMPONENT_NAME$1l,
5739
5739
  props: {
5740
5740
  value: Array,
5741
5741
  panelDate: Date,
@@ -5867,7 +5867,7 @@ const MonthTable = /* @__PURE__ */ defineComponent({
5867
5867
 
5868
5868
  /** @jsxImportSource vue */
5869
5869
 
5870
- const COMPONENT_NAME$1j = 'vc-quarter-table';
5870
+ const COMPONENT_NAME$1k = 'vc-quarter-table';
5871
5871
 
5872
5872
  /**
5873
5873
  * 获取季度对应的月份范围
@@ -5901,7 +5901,7 @@ const getQuarterRangeByMonth = value => {
5901
5901
  }
5902
5902
  };
5903
5903
  const QuarterTable = /* @__PURE__ */ defineComponent({
5904
- name: COMPONENT_NAME$1j,
5904
+ name: COMPONENT_NAME$1k,
5905
5905
  props: {
5906
5906
  value: Array,
5907
5907
  panelDate: Date,
@@ -6024,9 +6024,9 @@ const QuarterTable = /* @__PURE__ */ defineComponent({
6024
6024
 
6025
6025
  /** @jsxImportSource vue */
6026
6026
 
6027
- const COMPONENT_NAME$1i = 'vc-shortcuts-select';
6027
+ const COMPONENT_NAME$1j = 'vc-shortcuts-select';
6028
6028
  const ShortcutsSelect = /* @__PURE__ */ defineComponent({
6029
- name: COMPONENT_NAME$1i,
6029
+ name: COMPONENT_NAME$1j,
6030
6030
  props: {
6031
6031
  panelDate: Date,
6032
6032
  config: Array,
@@ -6066,9 +6066,9 @@ const ShortcutsSelect = /* @__PURE__ */ defineComponent({
6066
6066
 
6067
6067
  /** @jsxImportSource vue */
6068
6068
 
6069
- const COMPONENT_NAME$1h = 'vc-time-select';
6069
+ const COMPONENT_NAME$1i = 'vc-time-select';
6070
6070
  const TimeSelect = /* @__PURE__ */ defineComponent({
6071
- name: COMPONENT_NAME$1h,
6071
+ name: COMPONENT_NAME$1i,
6072
6072
  props: {
6073
6073
  hours: {
6074
6074
  type: [Number, String],
@@ -6347,9 +6347,9 @@ const TimeSelect = /* @__PURE__ */ defineComponent({
6347
6347
 
6348
6348
  /** @jsxImportSource vue */
6349
6349
 
6350
- const COMPONENT_NAME$1g = 'vc-year-table';
6350
+ const COMPONENT_NAME$1h = 'vc-year-table';
6351
6351
  const YearTable = /* @__PURE__ */ defineComponent({
6352
- name: COMPONENT_NAME$1g,
6352
+ name: COMPONENT_NAME$1h,
6353
6353
  props: {
6354
6354
  value: Array,
6355
6355
  panelDate: Date,
@@ -6472,9 +6472,9 @@ const getDateIsInRange = (value, type, leftPanelDate, rightPanelDate) => {
6472
6472
  }
6473
6473
  return true;
6474
6474
  };
6475
- const COMPONENT_NAME$1f = 'vc-date-range-panel';
6475
+ const COMPONENT_NAME$1g = 'vc-date-range-panel';
6476
6476
  const DateRangePanel = /* @__PURE__ */ defineComponent({
6477
- name: COMPONENT_NAME$1f,
6477
+ name: COMPONENT_NAME$1g,
6478
6478
  props: {
6479
6479
  ...props$V,
6480
6480
  confirm: {
@@ -6853,9 +6853,9 @@ const DateRangePanel = /* @__PURE__ */ defineComponent({
6853
6853
 
6854
6854
  /** @jsxImportSource vue */
6855
6855
 
6856
- const COMPONENT_NAME$1e = 'vc-date-panel';
6856
+ const COMPONENT_NAME$1f = 'vc-date-panel';
6857
6857
  const DatePanel = /* @__PURE__ */ defineComponent({
6858
- name: COMPONENT_NAME$1e,
6858
+ name: COMPONENT_NAME$1f,
6859
6859
  props: {
6860
6860
  ...props$V,
6861
6861
  type: String,
@@ -7063,9 +7063,9 @@ const isEqualYear$1 = value => {
7063
7063
  const endYear = value[1].getFullYear();
7064
7064
  return startYear === endYear;
7065
7065
  };
7066
- const COMPONENT_NAME$1d = 'vc-monthrange-panel';
7066
+ const COMPONENT_NAME$1e = 'vc-monthrange-panel';
7067
7067
  const MonthRangePanel = /* @__PURE__ */ defineComponent({
7068
- name: COMPONENT_NAME$1d,
7068
+ name: COMPONENT_NAME$1e,
7069
7069
  props: {
7070
7070
  ...props$V,
7071
7071
  confirm: {
@@ -7240,9 +7240,9 @@ const isEqualYear = value => {
7240
7240
  const endYear = value[1].getFullYear();
7241
7241
  return startYear === endYear;
7242
7242
  };
7243
- const COMPONENT_NAME$1c = 'vc-quarterrange-panel';
7243
+ const COMPONENT_NAME$1d = 'vc-quarterrange-panel';
7244
7244
  const QuarterRangePanel = /* @__PURE__ */ defineComponent({
7245
- name: COMPONENT_NAME$1c,
7245
+ name: COMPONENT_NAME$1d,
7246
7246
  props: {
7247
7247
  ...props$V,
7248
7248
  confirm: {
@@ -7481,9 +7481,9 @@ const getComparedDate = (leftDate, rightDate) => {
7481
7481
  seconds
7482
7482
  };
7483
7483
  };
7484
- const COMPONENT_NAME$1b = 'vc-timerange-panel';
7484
+ const COMPONENT_NAME$1c = 'vc-timerange-panel';
7485
7485
  const TimeRangePanel = /* @__PURE__ */ defineComponent({
7486
- name: COMPONENT_NAME$1b,
7486
+ name: COMPONENT_NAME$1c,
7487
7487
  props: props$U,
7488
7488
  emits: ['pick', 'clear', 'ok'],
7489
7489
  setup(props, {
@@ -7582,9 +7582,9 @@ const TimeRangePanel = /* @__PURE__ */ defineComponent({
7582
7582
 
7583
7583
  /** @jsxImportSource vue */
7584
7584
 
7585
- const COMPONENT_NAME$1a = 'vc-time-panel';
7585
+ const COMPONENT_NAME$1b = 'vc-time-panel';
7586
7586
  const TimePanel = /* @__PURE__ */ defineComponent({
7587
- name: COMPONENT_NAME$1a,
7587
+ name: COMPONENT_NAME$1b,
7588
7588
  props: props$U,
7589
7589
  emits: ['pick', 'clear', 'ok'],
7590
7590
  setup(props, {
@@ -7639,7 +7639,7 @@ const TimePanel = /* @__PURE__ */ defineComponent({
7639
7639
 
7640
7640
  /** @jsxImportSource vue */
7641
7641
 
7642
- const COMPONENT_NAME$19 = 'vc-date-picker';
7642
+ const COMPONENT_NAME$1a = 'vc-date-picker';
7643
7643
  const getPanel$1 = type => {
7644
7644
  if (['daterange', 'datetimerange'].includes(type)) {
7645
7645
  return DateRangePanel;
@@ -7650,7 +7650,7 @@ const getPanel$1 = type => {
7650
7650
  }
7651
7651
  return DatePanel;
7652
7652
  };
7653
- const DatePicker = createPicker(COMPONENT_NAME$19, props$10, () => {
7653
+ const DatePicker = createPicker(COMPONENT_NAME$1a, props$10, () => {
7654
7654
  const props = getCurrentInstance().props;
7655
7655
  const icon = ref('date');
7656
7656
  const panel = shallowRef({});
@@ -7683,9 +7683,9 @@ const props$T = {
7683
7683
 
7684
7684
  /** @jsxImportSource vue */
7685
7685
 
7686
- const COMPONENT_NAME$18 = 'vc-divider';
7686
+ const COMPONENT_NAME$19 = 'vc-divider';
7687
7687
  const Divider = /* @__PURE__ */ defineComponent({
7688
- name: COMPONENT_NAME$18,
7688
+ name: COMPONENT_NAME$19,
7689
7689
  props: props$T,
7690
7690
  setup(props, {
7691
7691
  slots
@@ -7840,7 +7840,7 @@ const props$Q = {
7840
7840
 
7841
7841
  /** @jsxImportSource vue */
7842
7842
 
7843
- const COMPONENT_NAME$17 = 'vc-scroller-track';
7843
+ const COMPONENT_NAME$18 = 'vc-scroller-track';
7844
7844
  const BAR_MAP = {
7845
7845
  vertical: {
7846
7846
  scroll: 'scrollTop',
@@ -7860,7 +7860,7 @@ const BAR_MAP = {
7860
7860
  }
7861
7861
  };
7862
7862
  const Track = /* @__PURE__ */ defineComponent({
7863
- name: COMPONENT_NAME$17,
7863
+ name: COMPONENT_NAME$18,
7864
7864
  props: props$S,
7865
7865
  emits: ['change'],
7866
7866
  inheritAttrs: false,
@@ -8050,9 +8050,9 @@ const Track = /* @__PURE__ */ defineComponent({
8050
8050
 
8051
8051
  /** @jsxImportSource vue */
8052
8052
 
8053
- const COMPONENT_NAME$16 = 'vc-scroller-bar';
8053
+ const COMPONENT_NAME$17 = 'vc-scroller-bar';
8054
8054
  const Bar = /* @__PURE__ */ defineComponent({
8055
- name: COMPONENT_NAME$16,
8055
+ name: COMPONENT_NAME$17,
8056
8056
  props: props$R,
8057
8057
  emits: ['change'],
8058
8058
  setup(props, {
@@ -8267,7 +8267,7 @@ const useScroller = (expose) => {
8267
8267
 
8268
8268
  /** @jsxImportSource vue */
8269
8269
 
8270
- const COMPONENT_NAME$15 = 'vc-scroller';
8270
+ const COMPONENT_NAME$16 = 'vc-scroller';
8271
8271
 
8272
8272
  /**
8273
8273
  * 作为备选方案,目前推荐使用ScrollerWheel
@@ -8278,7 +8278,7 @@ const COMPONENT_NAME$15 = 'vc-scroller';
8278
8278
  * 2. 增加了一层嵌套
8279
8279
  */
8280
8280
  const Scroller = /* @__PURE__ */ defineComponent({
8281
- name: COMPONENT_NAME$15,
8281
+ name: COMPONENT_NAME$16,
8282
8282
  props: props$Q,
8283
8283
  emits: ['scroll'],
8284
8284
  setup(props, {
@@ -8339,7 +8339,7 @@ const Scroller = /* @__PURE__ */ defineComponent({
8339
8339
 
8340
8340
  /** @jsxImportSource vue */
8341
8341
 
8342
- const COMPONENT_NAME$14 = 'vc-scroller-wheel';
8342
+ const COMPONENT_NAME$15 = 'vc-scroller-wheel';
8343
8343
 
8344
8344
  /**
8345
8345
  * 为减少一层嵌套,为去除滚动bar的抖动,使用wheel模拟
@@ -8361,7 +8361,7 @@ const COMPONENT_NAME$14 = 'vc-scroller-wheel';
8361
8361
  * 设置scrollTop不会reflow和repaint,不需要考虑transfrom来改变content(transform也只在draw完成)
8362
8362
  */
8363
8363
  const ScrollerWheel = /* @__PURE__ */ defineComponent({
8364
- name: COMPONENT_NAME$14,
8364
+ name: COMPONENT_NAME$15,
8365
8365
  props: Object.assign(props$Q, {
8366
8366
  stopPropagation: {
8367
8367
  type: Boolean,
@@ -8550,9 +8550,9 @@ const props$P = {
8550
8550
 
8551
8551
  /** @jsxImportSource vue */
8552
8552
 
8553
- const COMPONENT_NAME$13 = 'vc-drawer';
8553
+ const COMPONENT_NAME$14 = 'vc-drawer';
8554
8554
  const DrawerView = /* @__PURE__ */ defineComponent({
8555
- name: COMPONENT_NAME$13,
8555
+ name: COMPONENT_NAME$14,
8556
8556
  props: props$P,
8557
8557
  emits: ['close', 'update:modelValue', 'visible-change'],
8558
8558
  setup(props, {
@@ -8728,9 +8728,9 @@ const props$O = {
8728
8728
 
8729
8729
  /** @jsxImportSource vue */
8730
8730
 
8731
- const COMPONENT_NAME$12 = 'vc-dropdown';
8731
+ const COMPONENT_NAME$13 = 'vc-dropdown';
8732
8732
  const Dropdown = /* @__PURE__ */ defineComponent({
8733
- name: COMPONENT_NAME$12,
8733
+ name: COMPONENT_NAME$13,
8734
8734
  props: props$O,
8735
8735
  setup(props, {
8736
8736
  slots
@@ -8754,9 +8754,9 @@ const props$N = {
8754
8754
 
8755
8755
  /** @jsxImportSource vue */
8756
8756
 
8757
- const COMPONENT_NAME$11 = 'vc-editor';
8757
+ const COMPONENT_NAME$12 = 'vc-editor';
8758
8758
  const Editor = /* @__PURE__ */ defineComponent({
8759
- name: COMPONENT_NAME$11,
8759
+ name: COMPONENT_NAME$12,
8760
8760
  props: props$N,
8761
8761
  setup(props, {
8762
8762
  slots
@@ -8900,9 +8900,9 @@ const useForm = (expose, options = {}) => {
8900
8900
  });
8901
8901
  };
8902
8902
 
8903
- const COMPONENT_NAME$10 = "vc-form";
8903
+ const COMPONENT_NAME$11 = "vc-form";
8904
8904
  const Form = defineComponent({
8905
- name: COMPONENT_NAME$10,
8905
+ name: COMPONENT_NAME$11,
8906
8906
  props: props$M,
8907
8907
  setup(props, { slots, expose }) {
8908
8908
  useForm(expose);
@@ -9227,9 +9227,9 @@ const useFormItem = (expose) => {
9227
9227
 
9228
9228
  /** @jsxImportSource vue */
9229
9229
 
9230
- const COMPONENT_NAME$$ = 'vc-form-item';
9230
+ const COMPONENT_NAME$10 = 'vc-form-item';
9231
9231
  const FormItem = /* @__PURE__ */ defineComponent({
9232
- name: COMPONENT_NAME$$,
9232
+ name: COMPONENT_NAME$10,
9233
9233
  props: props$L,
9234
9234
  setup(props, {
9235
9235
  slots,
@@ -9294,9 +9294,9 @@ const props$K = {
9294
9294
  }
9295
9295
  };
9296
9296
 
9297
- const COMPONENT_NAME$_ = "vcm-form";
9297
+ const COMPONENT_NAME$$ = "vcm-form";
9298
9298
  const MForm = defineComponent({
9299
- name: COMPONENT_NAME$_,
9299
+ name: COMPONENT_NAME$$,
9300
9300
  props: props$K,
9301
9301
  setup(props, { slots, expose }) {
9302
9302
  useForm(expose, {
@@ -9327,9 +9327,9 @@ const props$J = {
9327
9327
 
9328
9328
  /** @jsxImportSource vue */
9329
9329
 
9330
- const COMPONENT_NAME$Z = 'vcm-form-item';
9330
+ const COMPONENT_NAME$_ = 'vcm-form-item';
9331
9331
  const MFormItem = /* @__PURE__ */ defineComponent({
9332
- name: COMPONENT_NAME$Z,
9332
+ name: COMPONENT_NAME$_,
9333
9333
  props: props$J,
9334
9334
  setup(props, {
9335
9335
  slots,
@@ -9383,9 +9383,9 @@ const MFormItem = /* @__PURE__ */ defineComponent({
9383
9383
  }
9384
9384
  });
9385
9385
 
9386
- const COMPONENT_NAME$Y = "vc-fragment";
9386
+ const COMPONENT_NAME$Z = "vc-fragment";
9387
9387
  const Fragment = defineComponent({
9388
- name: COMPONENT_NAME$Y,
9388
+ name: COMPONENT_NAME$Z,
9389
9389
  setup(_, { slots }) {
9390
9390
  return () => h(Fragment$1, slots.default?.());
9391
9391
  }
@@ -9402,9 +9402,9 @@ const props$I = {
9402
9402
 
9403
9403
  /** @jsxImportSource vue */
9404
9404
 
9405
- const COMPONENT_NAME$X = 'vc-html-to-image';
9405
+ const COMPONENT_NAME$Y = 'vc-html-to-image';
9406
9406
  const HTMLToImage = /* @__PURE__ */ defineComponent({
9407
- name: COMPONENT_NAME$X,
9407
+ name: COMPONENT_NAME$Y,
9408
9408
  props: props$I,
9409
9409
  setup(props, {
9410
9410
  slots
@@ -9422,10 +9422,113 @@ const MHTMLToImage = HTMLToImage;
9422
9422
  const MIcon = Icon;
9423
9423
 
9424
9424
  const props$H = {
9425
+ tag: {
9426
+ type: String,
9427
+ default: "div"
9428
+ }
9429
+ };
9430
+
9431
+ /** @jsxImportSource vue */
9432
+
9433
+ const COMPONENT_NAME$X = 'vc-image-preview';
9434
+ const ImagePreview$1 = /* @__PURE__ */ defineComponent({
9435
+ name: COMPONENT_NAME$X,
9436
+ props: props$H,
9437
+ setup(props, {
9438
+ slots
9439
+ }) {
9440
+ return () => {
9441
+ return createVNode("div", {
9442
+ "class": "vc-image-preview"
9443
+ }, [slots?.default?.()]);
9444
+ };
9445
+ }
9446
+ });
9447
+
9448
+ const MAX_WIDTH = window.innerWidth;
9449
+ const MAX_HEIGHT = window.innerHeight;
9450
+ const getFitSize = (src) => {
9451
+ return new Promise((resolve) => {
9452
+ const img = new Image();
9453
+ let width;
9454
+ let height;
9455
+ img.onload = () => {
9456
+ const owidth = img.naturalWidth || img.width;
9457
+ const oheight = img.naturalHeight || img.height;
9458
+ if (owidth > oheight) {
9459
+ width = Math.min(MAX_WIDTH, owidth);
9460
+ height = width / owidth * oheight;
9461
+ resolve({
9462
+ width,
9463
+ height
9464
+ });
9465
+ } else {
9466
+ height = Math.min(MAX_HEIGHT, oheight);
9467
+ width = height / oheight * owidth;
9468
+ resolve({
9469
+ width,
9470
+ height
9471
+ });
9472
+ }
9473
+ };
9474
+ img.onerror = () => resolve({});
9475
+ img.src = src;
9476
+ });
9477
+ };
9478
+ const open$1 = async (options) => {
9479
+ const e = VcInstance.globalEvent;
9480
+ const data = options.data.map((i) => {
9481
+ if (typeof i === "string") {
9482
+ return {
9483
+ src: i
9484
+ };
9485
+ }
9486
+ return {
9487
+ ...i,
9488
+ src: i.source || i.src
9489
+ };
9490
+ });
9491
+ for (let i = 0; i < data.length; i++) {
9492
+ if (!data[i].width) {
9493
+ data[i] = {
9494
+ ...data[i],
9495
+ ...await getFitSize(data[i].src)
9496
+ };
9497
+ }
9498
+ }
9499
+ const lightbox = new PhotoSwipeLightbox({
9500
+ pswpModule: () => import('photoswipe'),
9501
+ closeTitle: "关闭(Esc)",
9502
+ zoomTitle: "缩放",
9503
+ arrowPrevTitle: "上一张",
9504
+ arrowNextTitle: "下一张",
9505
+ errorMsg: "网络异常 图片加载失败",
9506
+ indexIndicatorSep: " / ",
9507
+ initialZoomLevel: "fit"
9508
+ });
9509
+ lightbox.init();
9510
+ lightbox.loadAndOpen(
9511
+ options.current || 0,
9512
+ data,
9513
+ // 下面无效,需要给官方支持
9514
+ {
9515
+ x: e?.clientX,
9516
+ y: e?.clientY
9517
+ }
9518
+ );
9519
+ };
9520
+
9521
+ const ImagePreview = Object.assign(ImagePreview$1, { open: open$1 });
9522
+
9523
+ const props$G = {
9425
9524
  src: String,
9426
9525
  fit: String,
9427
9526
  lazy: Boolean,
9428
- wrapper: [Object, String]
9527
+ wrapper: [Object, String],
9528
+ previewable: {
9529
+ type: Boolean,
9530
+ default: true
9531
+ }
9429
9532
  };
9430
9533
 
9431
9534
  class IMGStore {
@@ -9495,7 +9598,7 @@ const ObjectFit = {
9495
9598
  const Image$1 = /* @__PURE__ */ defineComponent({
9496
9599
  name: COMPONENT_NAME$W,
9497
9600
  inheritAttrs: false,
9498
- props: props$H,
9601
+ props: props$G,
9499
9602
  setup(props, {
9500
9603
  slots,
9501
9604
  emit
@@ -9644,6 +9747,14 @@ const Image$1 = /* @__PURE__ */ defineComponent({
9644
9747
  const alignCenter = computed(() => {
9645
9748
  return !isSupportObjectFit && props.fit !== ObjectFit.FILL;
9646
9749
  });
9750
+ const handlePreview = () => {
9751
+ if (!props.previewable) return;
9752
+ ImagePreview.open({
9753
+ current: 0,
9754
+ data: [props.src],
9755
+ onClose() {}
9756
+ });
9757
+ };
9647
9758
  watch(() => props.src, v => {
9648
9759
  if (!v && !isLoading.value) {
9649
9760
  isLoading.value = true;
@@ -9664,7 +9775,9 @@ const Image$1 = /* @__PURE__ */ defineComponent({
9664
9775
  return () => {
9665
9776
  return createVNode("div", {
9666
9777
  "style": its.value.style,
9667
- "class": [its.value.class, 'vc-image']
9778
+ "class": [its.value.class, {
9779
+ 'is-allow-preview': props.previewable
9780
+ }, 'vc-image']
9668
9781
  }, [isLoading.value && (slots.placeholder ? slots.placeholder() : createVNode("div", {
9669
9782
  "class": [{
9670
9783
  'is-auto': isAuto.value
@@ -9682,6 +9795,8 @@ const Image$1 = /* @__PURE__ */ defineComponent({
9682
9795
  // 包含所有on*都会被绑定, 且listeners中覆盖将由listener内触发(inheritAttrs: false)
9683
9796
  ...its.value.attrs,
9684
9797
  ...its.value.listeners
9798
+ }, {
9799
+ "onClick": handlePreview
9685
9800
  }), null)]);
9686
9801
  };
9687
9802
  }
@@ -9689,7 +9804,7 @@ const Image$1 = /* @__PURE__ */ defineComponent({
9689
9804
 
9690
9805
  const MImage = Image$1;
9691
9806
 
9692
- const props$G = {
9807
+ const props$F = {
9693
9808
  tag: {
9694
9809
  type: String,
9695
9810
  default: "div"
@@ -9701,7 +9816,7 @@ const props$G = {
9701
9816
  const COMPONENT_NAME$V = 'vc-image-crop';
9702
9817
  const ImageCrop = /* @__PURE__ */ defineComponent({
9703
9818
  name: COMPONENT_NAME$V,
9704
- props: props$G,
9819
+ props: props$F,
9705
9820
  setup(props, {
9706
9821
  slots
9707
9822
  }) {
@@ -9715,105 +9830,6 @@ const ImageCrop = /* @__PURE__ */ defineComponent({
9715
9830
 
9716
9831
  const MImageCrop = ImageCrop;
9717
9832
 
9718
- const props$F = {
9719
- tag: {
9720
- type: String,
9721
- default: "div"
9722
- }
9723
- };
9724
-
9725
- /** @jsxImportSource vue */
9726
-
9727
- const COMPONENT_NAME$U = 'vc-image-preview';
9728
- const ImagePreview$1 = /* @__PURE__ */ defineComponent({
9729
- name: COMPONENT_NAME$U,
9730
- props: props$F,
9731
- setup(props, {
9732
- slots
9733
- }) {
9734
- return () => {
9735
- return createVNode("div", {
9736
- "class": "vc-image-preview"
9737
- }, [slots?.default?.()]);
9738
- };
9739
- }
9740
- });
9741
-
9742
- const MAX_WIDTH = window.innerWidth;
9743
- const MAX_HEIGHT = window.innerHeight;
9744
- const getFitSize = (src) => {
9745
- return new Promise((resolve) => {
9746
- const img = new Image();
9747
- let width;
9748
- let height;
9749
- img.onload = () => {
9750
- const owidth = img.naturalWidth || img.width;
9751
- const oheight = img.naturalHeight || img.height;
9752
- if (owidth > oheight) {
9753
- width = Math.min(MAX_WIDTH, owidth);
9754
- height = width / owidth * oheight;
9755
- resolve({
9756
- width,
9757
- height
9758
- });
9759
- } else {
9760
- height = Math.min(MAX_HEIGHT, oheight);
9761
- width = height / oheight * owidth;
9762
- resolve({
9763
- width,
9764
- height
9765
- });
9766
- }
9767
- };
9768
- img.onerror = () => resolve({});
9769
- img.src = src;
9770
- });
9771
- };
9772
- const open$1 = async (options) => {
9773
- const e = VcInstance.globalEvent;
9774
- const data = options.data.map((i) => {
9775
- if (typeof i === "string") {
9776
- return {
9777
- src: i
9778
- };
9779
- }
9780
- return {
9781
- ...i,
9782
- src: i.source || i.src
9783
- };
9784
- });
9785
- for (let i = 0; i < data.length; i++) {
9786
- if (!data[i].width) {
9787
- data[i] = {
9788
- ...data[i],
9789
- ...await getFitSize(data[i].src)
9790
- };
9791
- }
9792
- }
9793
- const lightbox = new PhotoSwipeLightbox({
9794
- pswpModule: () => import('photoswipe'),
9795
- closeTitle: "关闭(Esc)",
9796
- zoomTitle: "缩放",
9797
- arrowPrevTitle: "上一张",
9798
- arrowNextTitle: "下一张",
9799
- errorMsg: "网络异常 图片加载失败",
9800
- indexIndicatorSep: " / ",
9801
- initialZoomLevel: "fit"
9802
- });
9803
- lightbox.init();
9804
- lightbox.loadAndOpen(
9805
- options.current || 0,
9806
- data,
9807
- // 下面无效,需要给官方支持
9808
- {
9809
- x: e?.clientX,
9810
- y: e?.clientY
9811
- }
9812
- );
9813
- };
9814
-
9815
- const ImagePreview = Object.assign(ImagePreview$1, { open: open$1 });
9816
-
9817
9833
  const MImagePreview = ImagePreview;
9818
9834
 
9819
9835
  const props$E = {
@@ -9825,9 +9841,9 @@ const props$E = {
9825
9841
 
9826
9842
  /** @jsxImportSource vue */
9827
9843
 
9828
- const COMPONENT_NAME$T = 'vc-image-processing';
9844
+ const COMPONENT_NAME$U = 'vc-image-processing';
9829
9845
  const ImageProcessing = /* @__PURE__ */ defineComponent({
9830
- name: COMPONENT_NAME$T,
9846
+ name: COMPONENT_NAME$U,
9831
9847
  props: props$E,
9832
9848
  setup(props, {
9833
9849
  slots
@@ -9844,9 +9860,9 @@ const MImageProcessing = ImageProcessing;
9844
9860
 
9845
9861
  /** @jsxImportSource vue */
9846
9862
 
9847
- const COMPONENT_NAME$S = 'vcm-input';
9863
+ const COMPONENT_NAME$T = 'vcm-input';
9848
9864
  const MInput = /* @__PURE__ */ defineComponent({
9849
- name: COMPONENT_NAME$S,
9865
+ name: COMPONENT_NAME$T,
9850
9866
  inheritAttrs: false,
9851
9867
  props: {
9852
9868
  ...props$$,
@@ -9935,9 +9951,9 @@ const MInput = /* @__PURE__ */ defineComponent({
9935
9951
 
9936
9952
  /** @jsxImportSource vue */
9937
9953
 
9938
- const COMPONENT_NAME$R = 'vcm-input-number';
9954
+ const COMPONENT_NAME$S = 'vcm-input-number';
9939
9955
  const MInputNumber = /* @__PURE__ */ defineComponent({
9940
- name: COMPONENT_NAME$R,
9956
+ name: COMPONENT_NAME$S,
9941
9957
  props: props$X,
9942
9958
  inheritAttrs: false,
9943
9959
  setup(props, {
@@ -9986,9 +10002,9 @@ const MInputNumber = /* @__PURE__ */ defineComponent({
9986
10002
 
9987
10003
  /** @jsxImportSource vue */
9988
10004
 
9989
- const COMPONENT_NAME$Q = 'vcm-input-search';
10005
+ const COMPONENT_NAME$R = 'vcm-input-search';
9990
10006
  const MInputSearch = /* @__PURE__ */ defineComponent({
9991
- name: COMPONENT_NAME$Q,
10007
+ name: COMPONENT_NAME$R,
9992
10008
  props: {
9993
10009
  ...props$W,
9994
10010
  cancelText: {
@@ -10065,9 +10081,9 @@ const props$D = {
10065
10081
  }
10066
10082
  };
10067
10083
 
10068
- const COMPONENT_NAME$P = "vcm-list";
10084
+ const COMPONENT_NAME$Q = "vcm-list";
10069
10085
  const MList = defineComponent({
10070
- name: COMPONENT_NAME$P,
10086
+ name: COMPONENT_NAME$Q,
10071
10087
  props: props$D,
10072
10088
  setup(props, { slots }) {
10073
10089
  provide("vc-list", { props });
@@ -10122,10 +10138,10 @@ const props$C = {
10122
10138
 
10123
10139
  /** @jsxImportSource vue */
10124
10140
 
10125
- const COMPONENT_NAME$O = 'vcm-list-item';
10141
+ const COMPONENT_NAME$P = 'vcm-list-item';
10126
10142
  const HTTP_REGEX = /[a-zA-z]+:\/\/[^\s]*/;
10127
10143
  const MListItem = /* @__PURE__ */ defineComponent({
10128
- name: COMPONENT_NAME$O,
10144
+ name: COMPONENT_NAME$P,
10129
10145
  props: props$C,
10130
10146
  emits: ['click'],
10131
10147
  setup(props, {
@@ -10219,11 +10235,11 @@ const props$B = {
10219
10235
 
10220
10236
  /** @jsxImportSource vue */
10221
10237
 
10222
- const COMPONENT_NAME$N = 'vc-marquee';
10238
+ const COMPONENT_NAME$O = 'vc-marquee';
10223
10239
  const ANIMATION = prefixStyle('animation').camel;
10224
10240
  const TRANSFORM_KEBAB = prefixStyle('transform').kebab;
10225
10241
  const Marquee = /* @__PURE__ */ defineComponent({
10226
- name: COMPONENT_NAME$N,
10242
+ name: COMPONENT_NAME$O,
10227
10243
  props: props$B,
10228
10244
  setup(props, {
10229
10245
  slots
@@ -10291,9 +10307,9 @@ const props$A = {
10291
10307
  }
10292
10308
  };
10293
10309
 
10294
- const COMPONENT_NAME$M = "vc-resizer";
10310
+ const COMPONENT_NAME$N = "vc-resizer";
10295
10311
  const Resizer = defineComponent({
10296
- name: COMPONENT_NAME$M,
10312
+ name: COMPONENT_NAME$N,
10297
10313
  props: props$A,
10298
10314
  emit: ["resize", "change"],
10299
10315
  setup(props, { emit, slots, expose }) {
@@ -10451,10 +10467,10 @@ const props$z = {
10451
10467
 
10452
10468
  /** @jsxImportSource vue */
10453
10469
 
10454
- const COMPONENT_NAME$L = 'vc-modal';
10470
+ const COMPONENT_NAME$M = 'vc-modal';
10455
10471
  let zIndexNumber = 1002;
10456
10472
  const ModalView = /* @__PURE__ */ defineComponent({
10457
- name: COMPONENT_NAME$L,
10473
+ name: COMPONENT_NAME$M,
10458
10474
  emits: ['update:modelValue', 'close', 'portal-fulfilled', 'visible-change', 'ok', 'cancel'],
10459
10475
  props: props$z,
10460
10476
  setup(props, {
@@ -10893,9 +10909,9 @@ const props$y = {
10893
10909
 
10894
10910
  /** @jsxImportSource vue */
10895
10911
 
10896
- const COMPONENT_NAME$K = 'vc-modal';
10912
+ const COMPONENT_NAME$L = 'vc-modal';
10897
10913
  const MModalView = /* @__PURE__ */ defineComponent({
10898
- name: COMPONENT_NAME$K,
10914
+ name: COMPONENT_NAME$L,
10899
10915
  emits: ['update:modelValue', 'portal-fulfilled', 'close', 'ok', 'cancel'],
10900
10916
  props: props$y,
10901
10917
  setup(props, {
@@ -11107,9 +11123,9 @@ const props$x = {
11107
11123
 
11108
11124
  /** @jsxImportSource vue */
11109
11125
 
11110
- const COMPONENT_NAME$J = 'vc-notice';
11126
+ const COMPONENT_NAME$K = 'vc-notice';
11111
11127
  const NoticeView = /* @__PURE__ */ defineComponent({
11112
- name: COMPONENT_NAME$J,
11128
+ name: COMPONENT_NAME$K,
11113
11129
  props: props$x,
11114
11130
  emits: ['portal-fulfilled', 'close', 'before-close'],
11115
11131
  setup(props, {
@@ -11282,9 +11298,9 @@ const props$w = {
11282
11298
 
11283
11299
  /** @jsxImportSource vue */
11284
11300
 
11285
- const COMPONENT_NAME$I = 'vc-option';
11301
+ const COMPONENT_NAME$J = 'vc-option';
11286
11302
  const Option$1 = /* @__PURE__ */ defineComponent({
11287
- name: COMPONENT_NAME$I,
11303
+ name: COMPONENT_NAME$J,
11288
11304
  props: props$w,
11289
11305
  setup(props, {
11290
11306
  slots
@@ -11397,9 +11413,9 @@ const props$u = {
11397
11413
 
11398
11414
  /** @jsxImportSource vue */
11399
11415
 
11400
- const COMPONENT_NAME$H = 'vc-tag';
11416
+ const COMPONENT_NAME$I = 'vc-tag';
11401
11417
  const Tag = /* @__PURE__ */ defineComponent({
11402
- name: COMPONENT_NAME$H,
11418
+ name: COMPONENT_NAME$I,
11403
11419
  props: props$u,
11404
11420
  emits: ['close', 'change'],
11405
11421
  setup(props, {
@@ -11468,9 +11484,9 @@ const props$t = {
11468
11484
 
11469
11485
  /** @jsxImportSource vue */
11470
11486
 
11471
- const COMPONENT_NAME$G = 'vc-select-option';
11487
+ const COMPONENT_NAME$H = 'vc-select-option';
11472
11488
  const Option = /* @__PURE__ */ defineComponent({
11473
- name: COMPONENT_NAME$G,
11489
+ name: COMPONENT_NAME$H,
11474
11490
  props: props$t,
11475
11491
  setup(props, {
11476
11492
  slots
@@ -11543,9 +11559,9 @@ const props$s = {
11543
11559
 
11544
11560
  /** @jsxImportSource vue */
11545
11561
 
11546
- const COMPONENT_NAME$F = 'vc-select-option-group';
11562
+ const COMPONENT_NAME$G = 'vc-select-option-group';
11547
11563
  const OptionGroup = /* @__PURE__ */ defineComponent({
11548
- name: COMPONENT_NAME$F,
11564
+ name: COMPONENT_NAME$G,
11549
11565
  props: props$s,
11550
11566
  setup(props, {
11551
11567
  slots
@@ -11643,9 +11659,9 @@ const props$r = {
11643
11659
  function _isSlot$1(s) {
11644
11660
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
11645
11661
  }
11646
- const COMPONENT_NAME$E = 'vc-select';
11662
+ const COMPONENT_NAME$F = 'vc-select';
11647
11663
  const Select = /* @__PURE__ */ defineComponent({
11648
- name: COMPONENT_NAME$E,
11664
+ name: COMPONENT_NAME$F,
11649
11665
  props: props$r,
11650
11666
  emits: ['ready', 'close', 'visible-change', 'clear', 'change', 'update:modelValue'],
11651
11667
  setup(props, {
@@ -11892,9 +11908,9 @@ const Select = /* @__PURE__ */ defineComponent({
11892
11908
 
11893
11909
  /** @jsxImportSource vue */
11894
11910
 
11895
- const COMPONENT_NAME$D = 'vc-pagination';
11911
+ const COMPONENT_NAME$E = 'vc-pagination';
11896
11912
  const Pagination = /* @__PURE__ */ defineComponent({
11897
- name: COMPONENT_NAME$D,
11913
+ name: COMPONENT_NAME$E,
11898
11914
  props: props$v,
11899
11915
  emits: ['update:current', 'change', 'page-size-change'],
11900
11916
  setup(props, {
@@ -12092,9 +12108,9 @@ const props$q = {
12092
12108
 
12093
12109
  /** @jsxImportSource vue */
12094
12110
 
12095
- const COMPONENT_NAME$C = 'vc-picker';
12111
+ const COMPONENT_NAME$D = 'vc-picker';
12096
12112
  const Picker = /* @__PURE__ */ defineComponent({
12097
- name: COMPONENT_NAME$C,
12113
+ name: COMPONENT_NAME$D,
12098
12114
  props: props$q,
12099
12115
  setup(props, {
12100
12116
  slots
@@ -12118,9 +12134,9 @@ const props$p = {
12118
12134
 
12119
12135
  /** @jsxImportSource vue */
12120
12136
 
12121
- const COMPONENT_NAME$B = 'vc-popconfirm';
12137
+ const COMPONENT_NAME$C = 'vc-popconfirm';
12122
12138
  const Popconfirm = /* @__PURE__ */ defineComponent({
12123
- name: COMPONENT_NAME$B,
12139
+ name: COMPONENT_NAME$C,
12124
12140
  props: props$p,
12125
12141
  setup(props, {
12126
12142
  slots
@@ -12146,9 +12162,9 @@ const props$o = {
12146
12162
 
12147
12163
  /** @jsxImportSource vue */
12148
12164
 
12149
- const COMPONENT_NAME$A = 'vc-popup';
12165
+ const COMPONENT_NAME$B = 'vc-popup';
12150
12166
  const Popup = /* @__PURE__ */ defineComponent({
12151
- name: COMPONENT_NAME$A,
12167
+ name: COMPONENT_NAME$B,
12152
12168
  props: props$o,
12153
12169
  setup(props, {
12154
12170
  slots
@@ -12175,9 +12191,9 @@ const props$n = {
12175
12191
 
12176
12192
  /** @jsxImportSource vue */
12177
12193
 
12178
- const COMPONENT_NAME$z = 'vc-print';
12194
+ const COMPONENT_NAME$A = 'vc-print';
12179
12195
  const Print = /* @__PURE__ */ defineComponent({
12180
- name: COMPONENT_NAME$z,
12196
+ name: COMPONENT_NAME$A,
12181
12197
  props: props$n,
12182
12198
  setup(props, {
12183
12199
  expose,
@@ -12279,9 +12295,9 @@ const props$m = {
12279
12295
 
12280
12296
  /** @jsxImportSource vue */
12281
12297
 
12282
- const COMPONENT_NAME$y = 'vc-progress-circle';
12298
+ const COMPONENT_NAME$z = 'vc-progress-circle';
12283
12299
  const Circle = /* @__PURE__ */ defineComponent({
12284
- name: COMPONENT_NAME$y,
12300
+ name: COMPONENT_NAME$z,
12285
12301
  props: props$m,
12286
12302
  setup(props, {
12287
12303
  slots
@@ -12341,9 +12357,9 @@ const Circle = /* @__PURE__ */ defineComponent({
12341
12357
 
12342
12358
  /** @jsxImportSource vue */
12343
12359
 
12344
- const COMPONENT_NAME$x = 'vc-progress-line';
12360
+ const COMPONENT_NAME$y = 'vc-progress-line';
12345
12361
  const Line = /* @__PURE__ */ defineComponent({
12346
- name: COMPONENT_NAME$x,
12362
+ name: COMPONENT_NAME$y,
12347
12363
  props: props$m,
12348
12364
  setup(props) {
12349
12365
  const colorStyle = computed(() => {
@@ -12390,9 +12406,9 @@ const Line = /* @__PURE__ */ defineComponent({
12390
12406
  function _isSlot(s) {
12391
12407
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
12392
12408
  }
12393
- const COMPONENT_NAME$w = 'vc-progress';
12409
+ const COMPONENT_NAME$x = 'vc-progress';
12394
12410
  const Progress = /* @__PURE__ */ defineComponent({
12395
- name: COMPONENT_NAME$w,
12411
+ name: COMPONENT_NAME$x,
12396
12412
  props: props$m,
12397
12413
  setup(props, {
12398
12414
  slots
@@ -12550,9 +12566,9 @@ const useRadio = () => {
12550
12566
 
12551
12567
  /** @jsxImportSource vue */
12552
12568
 
12553
- const COMPONENT_NAME$v = 'vc-radio';
12569
+ const COMPONENT_NAME$w = 'vc-radio';
12554
12570
  const Radio = /* @__PURE__ */ defineComponent({
12555
- name: COMPONENT_NAME$v,
12571
+ name: COMPONENT_NAME$w,
12556
12572
  props: props$l,
12557
12573
  emits: ['update:modelValue', 'change'],
12558
12574
  setup(props, {
@@ -12663,9 +12679,9 @@ const useRadioGroup = () => {
12663
12679
 
12664
12680
  /** @jsxImportSource vue */
12665
12681
 
12666
- const COMPONENT_NAME$u = 'vc-radio-group';
12682
+ const COMPONENT_NAME$v = 'vc-radio-group';
12667
12683
  const RadioGroup = /* @__PURE__ */ defineComponent({
12668
- name: COMPONENT_NAME$u,
12684
+ name: COMPONENT_NAME$v,
12669
12685
  props: props$k,
12670
12686
  emits: ['update:modelValue', 'change'],
12671
12687
  setup(props, {
@@ -12686,9 +12702,9 @@ const RadioGroup = /* @__PURE__ */ defineComponent({
12686
12702
 
12687
12703
  /** @jsxImportSource vue */
12688
12704
 
12689
- const COMPONENT_NAME$t = 'vcm-radio';
12705
+ const COMPONENT_NAME$u = 'vcm-radio';
12690
12706
  const MRadio = /* @__PURE__ */ defineComponent({
12691
- name: COMPONENT_NAME$t,
12707
+ name: COMPONENT_NAME$u,
12692
12708
  props: props$l,
12693
12709
  emits: ['update:modelValue', 'change'],
12694
12710
  setup(props, {
@@ -12729,9 +12745,9 @@ const MRadio = /* @__PURE__ */ defineComponent({
12729
12745
 
12730
12746
  /** @jsxImportSource vue */
12731
12747
 
12732
- const COMPONENT_NAME$s = 'vcm-radio-group';
12748
+ const COMPONENT_NAME$t = 'vcm-radio-group';
12733
12749
  const MRadioGroup = /* @__PURE__ */ defineComponent({
12734
- name: COMPONENT_NAME$s,
12750
+ name: COMPONENT_NAME$t,
12735
12751
  props: props$k,
12736
12752
  emits: ['update:modelValue', 'change'],
12737
12753
  setup(props, {
@@ -12760,9 +12776,9 @@ const props$j = {
12760
12776
 
12761
12777
  /** @jsxImportSource vue */
12762
12778
 
12763
- const COMPONENT_NAME$r = 'vc-rate';
12779
+ const COMPONENT_NAME$s = 'vc-rate';
12764
12780
  const Rate = /* @__PURE__ */ defineComponent({
12765
- name: COMPONENT_NAME$r,
12781
+ name: COMPONENT_NAME$s,
12766
12782
  props: props$j,
12767
12783
  setup(props, {
12768
12784
  slots
@@ -12830,9 +12846,9 @@ const props$i = {
12830
12846
 
12831
12847
  /** @jsxImportSource vue */
12832
12848
 
12833
- const COMPONENT_NAME$q = 'vc-recycle-list-scroll-state';
12849
+ const COMPONENT_NAME$r = 'vc-recycle-list-scroll-state';
12834
12850
  const ScrollState = /* @__PURE__ */ defineComponent({
12835
- name: COMPONENT_NAME$q,
12851
+ name: COMPONENT_NAME$r,
12836
12852
  setup(_, {
12837
12853
  slots
12838
12854
  }) {
@@ -12962,12 +12978,12 @@ const useDirectionKeys = () => {
12962
12978
 
12963
12979
  /** @jsxImportSource vue */
12964
12980
 
12965
- const COMPONENT_NAME$p = 'vc-recycle-list-container';
12981
+ const COMPONENT_NAME$q = 'vc-recycle-list-container';
12966
12982
 
12967
12983
  // TODO: 抽离
12968
12984
  const transformKey = $.prefixStyle('transform').camel;
12969
12985
  const Container = /* @__PURE__ */ defineComponent({
12970
- name: COMPONENT_NAME$p,
12986
+ name: COMPONENT_NAME$q,
12971
12987
  props: props$h,
12972
12988
  emits: ['refresh'],
12973
12989
  setup(props, {
@@ -13065,9 +13081,9 @@ const Container = /* @__PURE__ */ defineComponent({
13065
13081
 
13066
13082
  /** @jsxImportSource vue */
13067
13083
 
13068
- const COMPONENT_NAME$o = 'vc-recycle-list';
13084
+ const COMPONENT_NAME$p = 'vc-recycle-list';
13069
13085
  const RecycleList = /* @__PURE__ */ defineComponent({
13070
- name: COMPONENT_NAME$o,
13086
+ name: COMPONENT_NAME$p,
13071
13087
  props: props$i,
13072
13088
  emits: ['scroll', 'row-resize'],
13073
13089
  setup(props, {
@@ -13639,9 +13655,9 @@ const props$g = {
13639
13655
 
13640
13656
  /** @jsxImportSource vue */
13641
13657
 
13642
- const COMPONENT_NAME$n = 'vc-slider';
13658
+ const COMPONENT_NAME$o = 'vc-slider';
13643
13659
  const Slider = /* @__PURE__ */ defineComponent({
13644
- name: COMPONENT_NAME$n,
13660
+ name: COMPONENT_NAME$o,
13645
13661
  props: props$g,
13646
13662
  setup(props, {
13647
13663
  slots
@@ -13665,9 +13681,9 @@ const props$f = {
13665
13681
 
13666
13682
  /** @jsxImportSource vue */
13667
13683
 
13668
- const COMPONENT_NAME$m = 'vc-sort-list';
13684
+ const COMPONENT_NAME$n = 'vc-sort-list';
13669
13685
  const SortList = /* @__PURE__ */ defineComponent({
13670
- name: COMPONENT_NAME$m,
13686
+ name: COMPONENT_NAME$n,
13671
13687
  props: props$f,
13672
13688
  setup(props, {
13673
13689
  slots
@@ -13691,9 +13707,9 @@ const props$e = {
13691
13707
 
13692
13708
  /** @jsxImportSource vue */
13693
13709
 
13694
- const COMPONENT_NAME$l = 'vc-steps';
13710
+ const COMPONENT_NAME$m = 'vc-steps';
13695
13711
  const Steps = /* @__PURE__ */ defineComponent({
13696
- name: COMPONENT_NAME$l,
13712
+ name: COMPONENT_NAME$m,
13697
13713
  props: props$e,
13698
13714
  setup(props, {
13699
13715
  slots
@@ -13806,9 +13822,9 @@ const useSwitch = (expose) => {
13806
13822
 
13807
13823
  /** @jsxImportSource vue */
13808
13824
 
13809
- const COMPONENT_NAME$k = 'vc-switch';
13825
+ const COMPONENT_NAME$l = 'vc-switch';
13810
13826
  const Switch = /* @__PURE__ */ defineComponent({
13811
- name: COMPONENT_NAME$k,
13827
+ name: COMPONENT_NAME$l,
13812
13828
  props: props$d,
13813
13829
  // click -> onClick要被拦截,此处不能放置
13814
13830
  emits: ['update:modelValue', 'change', 'click'],
@@ -13845,9 +13861,9 @@ const Switch = /* @__PURE__ */ defineComponent({
13845
13861
 
13846
13862
  /** @jsxImportSource vue */
13847
13863
 
13848
- const COMPONENT_NAME$j = 'vcm-switch';
13864
+ const COMPONENT_NAME$k = 'vcm-switch';
13849
13865
  const MSwitch = /* @__PURE__ */ defineComponent({
13850
- name: COMPONENT_NAME$j,
13866
+ name: COMPONENT_NAME$k,
13851
13867
  props: props$d,
13852
13868
  // click -> onClick要被拦截,此处不能放置
13853
13869
  emits: ['update:modelValue', 'change', 'click'],
@@ -14960,9 +14976,9 @@ const useStates = (mapper, $store) => {
14960
14976
 
14961
14977
  /** @jsxImportSource vue */
14962
14978
 
14963
- const COMPONENT_NAME$i = 'vc-table-normal-list';
14979
+ const COMPONENT_NAME$j = 'vc-table-normal-list';
14964
14980
  const NormalList = /* @__PURE__ */ defineComponent({
14965
- name: COMPONENT_NAME$i,
14981
+ name: COMPONENT_NAME$j,
14966
14982
  props: {
14967
14983
  data: {
14968
14984
  type: Array,
@@ -15802,9 +15818,9 @@ const props$c = {
15802
15818
 
15803
15819
  /** @jsxImportSource vue */
15804
15820
 
15805
- const COMPONENT_NAME$h = 'vc-table';
15821
+ const COMPONENT_NAME$i = 'vc-table';
15806
15822
  const Table = /* @__PURE__ */ defineComponent({
15807
- name: COMPONENT_NAME$h,
15823
+ name: COMPONENT_NAME$i,
15808
15824
  props: props$c,
15809
15825
  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'],
15810
15826
  setup(props, {
@@ -16439,9 +16455,9 @@ const getFitIndex = (options = {}) => {
16439
16455
 
16440
16456
  /** @jsxImportSource vue */
16441
16457
 
16442
- const COMPONENT_NAME$g = 'vc-text';
16458
+ const COMPONENT_NAME$h = 'vc-text';
16443
16459
  const Text = /* @__PURE__ */ defineComponent({
16444
- name: COMPONENT_NAME$g,
16460
+ name: COMPONENT_NAME$h,
16445
16461
  props: props$b,
16446
16462
  setup(props, {
16447
16463
  emit
@@ -17136,9 +17152,9 @@ const useTabs = (options = {}) => {
17136
17152
 
17137
17153
  /** @jsxImportSource vue */
17138
17154
 
17139
- const COMPONENT_NAME$f = 'vc-tabs';
17155
+ const COMPONENT_NAME$g = 'vc-tabs';
17140
17156
  const Tabs = /* @__PURE__ */ defineComponent({
17141
- name: COMPONENT_NAME$f,
17157
+ name: COMPONENT_NAME$g,
17142
17158
  props: props$a,
17143
17159
  emits: ['update:modelValue', 'change', 'click'],
17144
17160
  setup(props, {
@@ -17386,9 +17402,9 @@ const useTabsPane = () => {
17386
17402
 
17387
17403
  /** @jsxImportSource vue */
17388
17404
 
17389
- const COMPONENT_NAME$e = 'vc-tabs-pane';
17405
+ const COMPONENT_NAME$f = 'vc-tabs-pane';
17390
17406
  const TabsPane = /* @__PURE__ */ defineComponent({
17391
- name: COMPONENT_NAME$e,
17407
+ name: COMPONENT_NAME$f,
17392
17408
  props: props$9,
17393
17409
  setup(_, {
17394
17410
  slots
@@ -17443,9 +17459,9 @@ const props$8 = {
17443
17459
 
17444
17460
  /** @jsxImportSource vue */
17445
17461
 
17446
- const COMPONENT_NAME$d = 'vcm-tabs';
17462
+ const COMPONENT_NAME$e = 'vcm-tabs';
17447
17463
  const MTabs = /* @__PURE__ */ defineComponent({
17448
- name: COMPONENT_NAME$d,
17464
+ name: COMPONENT_NAME$e,
17449
17465
  props: props$8,
17450
17466
  emits: ['update:modelValue', 'change', 'click'],
17451
17467
  setup(props, {
@@ -17710,9 +17726,9 @@ const MTabs = /* @__PURE__ */ defineComponent({
17710
17726
 
17711
17727
  /** @jsxImportSource vue */
17712
17728
 
17713
- const COMPONENT_NAME$c = 'vcm-tabs-pane';
17729
+ const COMPONENT_NAME$d = 'vcm-tabs-pane';
17714
17730
  const MTabsPane = /* @__PURE__ */ defineComponent({
17715
- name: COMPONENT_NAME$c,
17731
+ name: COMPONENT_NAME$d,
17716
17732
  props: props$9,
17717
17733
  setup(_, {
17718
17734
  slots
@@ -18013,9 +18029,9 @@ const props$7 = {
18013
18029
 
18014
18030
  /** @jsxImportSource vue */
18015
18031
 
18016
- const COMPONENT_NAME$b = 'vc-textarea';
18032
+ const COMPONENT_NAME$c = 'vc-textarea';
18017
18033
  const Textarea = /* @__PURE__ */ defineComponent({
18018
- name: COMPONENT_NAME$b,
18034
+ name: COMPONENT_NAME$c,
18019
18035
  props: Object.assign(props$7, {
18020
18036
  indicator: {
18021
18037
  type: [Boolean, Object],
@@ -18071,9 +18087,9 @@ const Textarea = /* @__PURE__ */ defineComponent({
18071
18087
 
18072
18088
  /** @jsxImportSource vue */
18073
18089
 
18074
- const COMPONENT_NAME$a = 'vcm-textarea';
18090
+ const COMPONENT_NAME$b = 'vcm-textarea';
18075
18091
  const MTextarea = /* @__PURE__ */ defineComponent({
18076
- name: COMPONENT_NAME$a,
18092
+ name: COMPONENT_NAME$b,
18077
18093
  props: Object.assign(props$7, {
18078
18094
  align: {
18079
18095
  type: String,
@@ -18156,9 +18172,9 @@ const props$6 = {
18156
18172
  }
18157
18173
  };
18158
18174
 
18159
- const COMPONENT_NAME$9 = "vc-theme";
18175
+ const COMPONENT_NAME$a = "vc-theme";
18160
18176
  const Theme = defineComponent({
18161
- name: COMPONENT_NAME$9,
18177
+ name: COMPONENT_NAME$a,
18162
18178
  props: props$6,
18163
18179
  setup(props, { slots }) {
18164
18180
  const themeId = Utils.getUid("vc-theme");
@@ -18244,9 +18260,9 @@ const Theme = defineComponent({
18244
18260
  }
18245
18261
  });
18246
18262
 
18247
- const COMPONENT_NAME$8 = "vc-theme-view";
18263
+ const COMPONENT_NAME$9 = "vc-theme-view";
18248
18264
  const ThemeView = defineComponent({
18249
- name: COMPONENT_NAME$8,
18265
+ name: COMPONENT_NAME$9,
18250
18266
  props: props$6,
18251
18267
  setup(props, { slots }) {
18252
18268
  return () => {
@@ -18262,9 +18278,9 @@ const ThemeView = defineComponent({
18262
18278
  }
18263
18279
  });
18264
18280
 
18265
- const COMPONENT_NAME$7 = "vc-theme-text";
18281
+ const COMPONENT_NAME$8 = "vc-theme-text";
18266
18282
  const ThemeText = defineComponent({
18267
- name: COMPONENT_NAME$7,
18283
+ name: COMPONENT_NAME$8,
18268
18284
  props: props$6,
18269
18285
  setup(props, { slots }) {
18270
18286
  return () => {
@@ -18280,9 +18296,9 @@ const ThemeText = defineComponent({
18280
18296
  }
18281
18297
  });
18282
18298
 
18283
- const COMPONENT_NAME$6 = "vc-theme-image";
18299
+ const COMPONENT_NAME$7 = "vc-theme-image";
18284
18300
  const ThemeImage = defineComponent({
18285
- name: COMPONENT_NAME$6,
18301
+ name: COMPONENT_NAME$7,
18286
18302
  props: props$6,
18287
18303
  setup(props, { slots }) {
18288
18304
  return () => {
@@ -18330,12 +18346,12 @@ const props$5 = {
18330
18346
 
18331
18347
  /** @jsxImportSource vue */
18332
18348
 
18333
- const COMPONENT_NAME$5 = 'vc-time-picker';
18349
+ const COMPONENT_NAME$6 = 'vc-time-picker';
18334
18350
  const getPanel = type => {
18335
18351
  const isRange = type === 'timerange';
18336
18352
  return isRange ? TimeRangePanel : TimePanel;
18337
18353
  };
18338
- const TimePicker = createPicker(COMPONENT_NAME$5, props$5, () => {
18354
+ const TimePicker = createPicker(COMPONENT_NAME$6, props$5, () => {
18339
18355
  const props = getCurrentInstance().props;
18340
18356
  const icon = ref('icon');
18341
18357
  const panel = shallowRef({});
@@ -18370,9 +18386,9 @@ const props$4 = {
18370
18386
 
18371
18387
  /** @jsxImportSource vue */
18372
18388
 
18373
- const COMPONENT_NAME$4 = 'vc-timeline';
18389
+ const COMPONENT_NAME$5 = 'vc-timeline';
18374
18390
  const Timeline = /* @__PURE__ */ defineComponent({
18375
- name: COMPONENT_NAME$4,
18391
+ name: COMPONENT_NAME$5,
18376
18392
  props: props$4,
18377
18393
  setup(props, {
18378
18394
  slots
@@ -18399,9 +18415,9 @@ const props$3 = {
18399
18415
 
18400
18416
  /** @jsxImportSource vue */
18401
18417
 
18402
- const COMPONENT_NAME$3 = 'vc-touch';
18418
+ const COMPONENT_NAME$4 = 'vc-touch';
18403
18419
  const Touch = /* @__PURE__ */ defineComponent({
18404
- name: COMPONENT_NAME$3,
18420
+ name: COMPONENT_NAME$4,
18405
18421
  props: props$3,
18406
18422
  setup(props, {
18407
18423
  slots
@@ -18425,9 +18441,9 @@ const props$2 = {
18425
18441
 
18426
18442
  /** @jsxImportSource vue */
18427
18443
 
18428
- const COMPONENT_NAME$2 = 'vc-tree';
18444
+ const COMPONENT_NAME$3 = 'vc-tree';
18429
18445
  const Tree = /* @__PURE__ */ defineComponent({
18430
- name: COMPONENT_NAME$2,
18446
+ name: COMPONENT_NAME$3,
18431
18447
  props: props$2,
18432
18448
  setup(props, {
18433
18449
  slots
@@ -18537,9 +18553,9 @@ const props$1 = {
18537
18553
  }
18538
18554
  };
18539
18555
 
18540
- const COMPONENT_NAME$1 = "vc-upload";
18556
+ const COMPONENT_NAME$2 = "vc-upload";
18541
18557
  const Upload = defineComponent({
18542
- name: COMPONENT_NAME$1,
18558
+ name: COMPONENT_NAME$2,
18543
18559
  props: props$1,
18544
18560
  emits: [
18545
18561
  "message",
@@ -18925,6 +18941,104 @@ const props = {
18925
18941
  gallery: Boolean
18926
18942
  };
18927
18943
 
18944
+ /** @jsxImportSource vue */
18945
+
18946
+ const COMPONENT_NAME$1 = 'vc-steps';
18947
+ const ImageItem = /* @__PURE__ */ defineComponent({
18948
+ name: COMPONENT_NAME$1,
18949
+ props: {
18950
+ imageClass: [String, Object, Array],
18951
+ disabled: Boolean,
18952
+ row: Object,
18953
+ imagePreviewOptions: {
18954
+ type: Object,
18955
+ default: () => ({})
18956
+ },
18957
+ index: [String, Number],
18958
+ data: {
18959
+ type: Array,
18960
+ default: () => []
18961
+ },
18962
+ keyValue: Object
18963
+ },
18964
+ emits: ['open', 'close', 'delete'],
18965
+ setup(props, {
18966
+ slots,
18967
+ emit
18968
+ }) {
18969
+ const instance = getCurrentInstance();
18970
+ const current = computed(() => {
18971
+ if (props.row?.status === 0) return -1;
18972
+ const v = props.data.filter(i => i.status !== 0);
18973
+ return v.findIndex(i => {
18974
+ const a = i[props.keyValue.value] || i;
18975
+ const b = props.row?.[props.keyValue.value] || props.row;
18976
+ return a === b;
18977
+ });
18978
+ });
18979
+ // 拿到可预览的图片,供预览组件使用
18980
+ const getPreviewData = () => {
18981
+ return props.data.map(i => i?.[props.keyValue.value]);
18982
+ };
18983
+ const previewByPS = (e, index) => {
18984
+ emit('open');
18985
+ ImagePreview.open({
18986
+ current: index,
18987
+ data: getPreviewData(),
18988
+ onClose: () => emit('close')
18989
+ });
18990
+ };
18991
+ const handlePreview = e => {
18992
+ /**
18993
+ * 渐进增强
18994
+ */
18995
+ let {
18996
+ enhancer
18997
+ } = VcInstance.options.ImagePreview || {};
18998
+ enhancer = props.imagePreviewOptions.enhancer || enhancer || (() => false);
18999
+ const images = getPreviewData().map(item => ({
19000
+ src: item
19001
+ }));
19002
+ enhancer(current.value, images, instance) || previewByPS(e, current.value);
19003
+ };
19004
+ const handleDel = () => {
19005
+ emit('delete');
19006
+ };
19007
+ return () => {
19008
+ const row = props.row;
19009
+ return createVNode("div", {
19010
+ "class": [{
19011
+ 'is-error': row.status == 0
19012
+ }, 'vc-upload-image-item']
19013
+ }, [slots.default ? slots.default({
19014
+ it: row,
19015
+ current: current.value
19016
+ }) : createVNode(Fragment$1, null, [!row.errorFlag && typeof row[props.keyValue.value] === 'string' ? createVNode(Image$1, {
19017
+ "src": row[props.keyValue.value],
19018
+ "class": [props.imageClass, 'vc-upload-image-item__content'],
19019
+ "fit": "cover",
19020
+ "previewable": false,
19021
+ "onClick": handlePreview
19022
+ }, null) : createVNode("div", {
19023
+ "class": [props.imageClass, 'vc-upload-image-item__content']
19024
+ }, [row.percent && row.percent != 100 ? createVNode(Progress, {
19025
+ "percent": row.percent,
19026
+ "show-text": false,
19027
+ "status": "normal",
19028
+ "style": "width: 100%;padding: 0 5px"
19029
+ }, null) : !row[props.keyValue.value] && row.percent === 100 && !row.errorFlag ? createVNode("p", {
19030
+ "style": "line-height: 1; padding: 5px"
19031
+ }, [createTextVNode("\u670D\u52A1\u5668\u6B63\u5728\u63A5\u6536...")]) : row.status == 0 ? createVNode("div", {
19032
+ "style": "padding: 5px"
19033
+ }, [createTextVNode("\u4E0A\u4F20\u5931\u8D25")]) : null]), (!props.disabled || row.errorFlag) && createVNode(Icon, {
19034
+ "type": "close-small",
19035
+ "class": "vc-upload-picker__delete",
19036
+ "onClick": handleDel
19037
+ }, null)])]);
19038
+ };
19039
+ }
19040
+ });
19041
+
18928
19042
  const recognizer = (url) => {
18929
19043
  const reg = /\.(jpe?g|png|gif|bmp|webp|image|heic|mp4|mov|avi|mpg|mpeg|rmvb)/ig;
18930
19044
  const result = url.match(reg);
@@ -19176,7 +19290,7 @@ const COMPONENT_NAME = 'vc-upload-picker';
19176
19290
  const UploadPicker = /* @__PURE__ */ defineComponent({
19177
19291
  name: COMPONENT_NAME,
19178
19292
  props: props,
19179
- emits: ['update:modelValue', 'file-success', 'file-start', 'success', 'error', 'complete', 'change', 'remove-before'],
19293
+ emits: ['update:modelValue', 'file-success', 'file-start', 'file-before', 'file-error', 'success', 'error', 'complete', 'change', 'remove-before'],
19180
19294
  setup(props, {
19181
19295
  slots,
19182
19296
  expose
@@ -19188,8 +19302,7 @@ const UploadPicker = /* @__PURE__ */ defineComponent({
19188
19302
  case 'image':
19189
19303
  pre.push({
19190
19304
  type: cur,
19191
- item: 'div'
19192
- // item: ImageItem
19305
+ item: ImageItem
19193
19306
  });
19194
19307
  return pre;
19195
19308
  case 'video':
@@ -19238,7 +19351,7 @@ const UploadPicker = /* @__PURE__ */ defineComponent({
19238
19351
  const Item = picker.item;
19239
19352
  return createVNode(Item, {
19240
19353
  "key": typeof item === 'object' ? item.uid : item,
19241
- "it": item,
19354
+ "row": item,
19242
19355
  "disabled": props.disabled,
19243
19356
  "image-preview-options": props.imagePreviewOptions,
19244
19357
  "imageClass": props.imageClass,
@@ -19246,18 +19359,19 @@ const UploadPicker = /* @__PURE__ */ defineComponent({
19246
19359
  "audioClass": props.audioClass,
19247
19360
  "fileClass": props.fileClass,
19248
19361
  "index": index,
19249
- "data": item,
19362
+ "keyValue": props.keyValue,
19363
+ "data": base.currentValue.value[picker.type],
19250
19364
  "class": "vc-upload-picker__item",
19251
19365
  "onDelete": () => base.handleDelete(index, picker.type)
19252
19366
  }, {
19253
- default: scopeData => {
19254
- return slots.default ? slots.default({
19367
+ default: slots.default ? scopeData => {
19368
+ return slots?.default?.({
19255
19369
  it: scopeData?.it,
19256
19370
  current: scopeData?.current,
19257
19371
  index,
19258
19372
  name: picker.type
19259
- }) : scopeData;
19260
- }
19373
+ });
19374
+ } : null
19261
19375
  });
19262
19376
  }), withDirectives(createVNode(Upload, mergeProps(base.currentUploadOptions.value[picker.type], {
19263
19377
  "max": base.dynamicMax[picker.type],