@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.
@@ -67,9 +67,9 @@
67
67
 
68
68
  /** @jsxImportSource vue */
69
69
 
70
- const COMPONENT_NAME$1$ = 'vc-action-sheet';
70
+ const COMPONENT_NAME$20 = 'vc-action-sheet';
71
71
  const ActionSheet = /* @__PURE__ */ vue.defineComponent({
72
- name: COMPONENT_NAME$1$,
72
+ name: COMPONENT_NAME$20,
73
73
  props: props$1q,
74
74
  setup(props, {
75
75
  slots
@@ -256,9 +256,9 @@
256
256
 
257
257
  /** @jsxImportSource vue */
258
258
 
259
- const COMPONENT_NAME$1_ = 'vc-icon';
259
+ const COMPONENT_NAME$1$ = 'vc-icon';
260
260
  const Icon = /* @__PURE__ */ vue.defineComponent({
261
- name: COMPONENT_NAME$1_,
261
+ name: COMPONENT_NAME$1$,
262
262
  props: props$1o,
263
263
  setup(props) {
264
264
  const viewBox = vue.ref('0 0 1024 1024');
@@ -457,9 +457,9 @@
457
457
  };
458
458
  };
459
459
 
460
- const COMPONENT_NAME$1Z = "vc-transition";
460
+ const COMPONENT_NAME$1_ = "vc-transition";
461
461
  const Transition = vue.defineComponent({
462
- name: COMPONENT_NAME$1Z,
462
+ name: COMPONENT_NAME$1_,
463
463
  props: props$1n,
464
464
  // 当不声明emits的情况下,事件存在于attrs中
465
465
  inheritAttrs: false,
@@ -480,9 +480,9 @@
480
480
  }
481
481
  });
482
482
 
483
- const COMPONENT_NAME$1Y = "vc-transition-collapse";
483
+ const COMPONENT_NAME$1Z = "vc-transition-collapse";
484
484
  const TransitionCollapse = vue.defineComponent({
485
- name: COMPONENT_NAME$1Y,
485
+ name: COMPONENT_NAME$1Z,
486
486
  props: props$1n,
487
487
  // 当不声明emits的情况下,事件存在于attrs中
488
488
  inheritAttrs: false,
@@ -601,9 +601,9 @@
601
601
  }
602
602
  });
603
603
 
604
- const COMPONENT_NAME$1X = "vc-transition-fade";
604
+ const COMPONENT_NAME$1Y = "vc-transition-fade";
605
605
  const TransitionFade = vue.defineComponent({
606
- name: COMPONENT_NAME$1X,
606
+ name: COMPONENT_NAME$1Y,
607
607
  props: {
608
608
  ...props$1n,
609
609
  // inheritAttrs必须是false
@@ -638,9 +638,9 @@
638
638
  }
639
639
  });
640
640
 
641
- const COMPONENT_NAME$1W = "vc-transition-scale";
641
+ const COMPONENT_NAME$1X = "vc-transition-scale";
642
642
  const TransitionScale = vue.defineComponent({
643
- name: COMPONENT_NAME$1W,
643
+ name: COMPONENT_NAME$1X,
644
644
  props: {
645
645
  ...props$1n,
646
646
  mode: {
@@ -680,9 +680,9 @@
680
680
  }
681
681
  });
682
682
 
683
- const COMPONENT_NAME$1V = "vc-transition-slide";
683
+ const COMPONENT_NAME$1W = "vc-transition-slide";
684
684
  const TransitionSlide = vue.defineComponent({
685
- name: COMPONENT_NAME$1V,
685
+ name: COMPONENT_NAME$1W,
686
686
  props: {
687
687
  ...props$1n,
688
688
  mode: {
@@ -722,9 +722,9 @@
722
722
  }
723
723
  });
724
724
 
725
- const COMPONENT_NAME$1U = "vc-transition-zoom";
725
+ const COMPONENT_NAME$1V = "vc-transition-zoom";
726
726
  const TransitionZoom = vue.defineComponent({
727
- name: COMPONENT_NAME$1U,
727
+ name: COMPONENT_NAME$1V,
728
728
  props: {
729
729
  ...props$1n,
730
730
  mode: {
@@ -766,7 +766,7 @@
766
766
 
767
767
  /** @jsxImportSource vue */
768
768
 
769
- const COMPONENT_NAME$1T = 'vc-alert';
769
+ const COMPONENT_NAME$1U = 'vc-alert';
770
770
 
771
771
  // [color, borderColor, backgroundColor], -> CSS
772
772
  const THEME_MAP = {
@@ -776,7 +776,7 @@
776
776
  warning: ['#ffbf00', '#ffe58f', '#fffbe6']
777
777
  };
778
778
  const Alert = /* @__PURE__ */ vue.defineComponent({
779
- name: COMPONENT_NAME$1T,
779
+ name: COMPONENT_NAME$1U,
780
780
  props: props$1p,
781
781
  setup(props, {
782
782
  slots,
@@ -875,9 +875,9 @@
875
875
 
876
876
  /** @jsxImportSource vue */
877
877
 
878
- const COMPONENT_NAME$1S = 'vc-artboard';
878
+ const COMPONENT_NAME$1T = 'vc-artboard';
879
879
  const Artboard = /* @__PURE__ */ vue.defineComponent({
880
- name: COMPONENT_NAME$1S,
880
+ name: COMPONENT_NAME$1T,
881
881
  props: props$1m,
882
882
  setup(props, {
883
883
  slots
@@ -916,9 +916,9 @@
916
916
 
917
917
  /** @jsxImportSource vue */
918
918
 
919
- const COMPONENT_NAME$1R = 'vc-spin';
919
+ const COMPONENT_NAME$1S = 'vc-spin';
920
920
  const Spin = /* @__PURE__ */ vue.defineComponent({
921
- name: COMPONENT_NAME$1R,
921
+ name: COMPONENT_NAME$1S,
922
922
  props: props$1l,
923
923
  setup(props, {
924
924
  slots
@@ -5774,9 +5774,9 @@
5774
5774
  exclude: RegExp
5775
5775
  };
5776
5776
 
5777
- const COMPONENT_NAME$1Q = "vc-debounce";
5777
+ const COMPONENT_NAME$1R = "vc-debounce";
5778
5778
  const Debounce = vue.defineComponent({
5779
- name: COMPONENT_NAME$1Q,
5779
+ name: COMPONENT_NAME$1R,
5780
5780
  props: props$1k,
5781
5781
  /**
5782
5782
  * 不声明emits使得事件被透传放入attrs中, 这样可以让所有的事件透传
@@ -5848,9 +5848,9 @@
5848
5848
 
5849
5849
  /** @jsxImportSource vue */
5850
5850
 
5851
- const COMPONENT_NAME$1P = 'vc-button';
5851
+ const COMPONENT_NAME$1Q = 'vc-button';
5852
5852
  const Button = /* @__PURE__ */ vue.defineComponent({
5853
- name: COMPONENT_NAME$1P,
5853
+ name: COMPONENT_NAME$1Q,
5854
5854
  emits: ['click'],
5855
5855
  props: props$1j,
5856
5856
  setup(props, {
@@ -5932,9 +5932,9 @@
5932
5932
 
5933
5933
  /** @jsxImportSource vue */
5934
5934
 
5935
- const COMPONENT_NAME$1O = 'vc-button-group';
5935
+ const COMPONENT_NAME$1P = 'vc-button-group';
5936
5936
  const ButtonGroup = /* @__PURE__ */ vue.defineComponent({
5937
- name: COMPONENT_NAME$1O,
5937
+ name: COMPONENT_NAME$1P,
5938
5938
  props: props$1i,
5939
5939
  setup(props, {
5940
5940
  slots
@@ -5968,9 +5968,9 @@
5968
5968
 
5969
5969
  /** @jsxImportSource vue */
5970
5970
 
5971
- const COMPONENT_NAME$1N = 'vc-calendar';
5971
+ const COMPONENT_NAME$1O = 'vc-calendar';
5972
5972
  const Calendar$1 = /* @__PURE__ */ vue.defineComponent({
5973
- name: COMPONENT_NAME$1N,
5973
+ name: COMPONENT_NAME$1O,
5974
5974
  props: props$1h,
5975
5975
  setup(props, {
5976
5976
  slots
@@ -6008,9 +6008,9 @@
6008
6008
 
6009
6009
  /** @jsxImportSource vue */
6010
6010
 
6011
- const COMPONENT_NAME$1M = 'vc-card';
6011
+ const COMPONENT_NAME$1N = 'vc-card';
6012
6012
  const Card = /* @__PURE__ */ vue.defineComponent({
6013
- name: COMPONENT_NAME$1M,
6013
+ name: COMPONENT_NAME$1N,
6014
6014
  props: props$1g,
6015
6015
  setup(props, {
6016
6016
  slots
@@ -6046,9 +6046,9 @@
6046
6046
 
6047
6047
  /** @jsxImportSource vue */
6048
6048
 
6049
- const COMPONENT_NAME$1L = 'vc-carousel';
6049
+ const COMPONENT_NAME$1M = 'vc-carousel';
6050
6050
  const Carousel = /* @__PURE__ */ vue.defineComponent({
6051
- name: COMPONENT_NAME$1L,
6051
+ name: COMPONENT_NAME$1M,
6052
6052
  props: props$1f,
6053
6053
  setup(props, {
6054
6054
  slots
@@ -6072,9 +6072,9 @@
6072
6072
 
6073
6073
  /** @jsxImportSource vue */
6074
6074
 
6075
- const COMPONENT_NAME$1K = 'vc-cascader';
6075
+ const COMPONENT_NAME$1L = 'vc-cascader';
6076
6076
  const Cascader = /* @__PURE__ */ vue.defineComponent({
6077
- name: COMPONENT_NAME$1K,
6077
+ name: COMPONENT_NAME$1L,
6078
6078
  props: props$1e,
6079
6079
  setup(props, {
6080
6080
  slots
@@ -6206,9 +6206,9 @@
6206
6206
 
6207
6207
  /** @jsxImportSource vue */
6208
6208
 
6209
- const COMPONENT_NAME$1J = 'vc-chart';
6209
+ const COMPONENT_NAME$1K = 'vc-chart';
6210
6210
  const Chart = /* @__PURE__ */ vue.defineComponent({
6211
- name: COMPONENT_NAME$1J,
6211
+ name: COMPONENT_NAME$1K,
6212
6212
  props: props$1d,
6213
6213
  emits: [...EVENTS, 'ready'],
6214
6214
  setup(props, {
@@ -6440,9 +6440,9 @@
6440
6440
 
6441
6441
  /** @jsxImportSource vue */
6442
6442
 
6443
- const COMPONENT_NAME$1I = 'vc-checkbox';
6443
+ const COMPONENT_NAME$1J = 'vc-checkbox';
6444
6444
  const Checkbox = /* @__PURE__ */ vue.defineComponent({
6445
- name: COMPONENT_NAME$1I,
6445
+ name: COMPONENT_NAME$1J,
6446
6446
  props: props$1c,
6447
6447
  emits: ['update:modelValue', 'change'],
6448
6448
  setup(props, {
@@ -6529,9 +6529,9 @@
6529
6529
 
6530
6530
  /** @jsxImportSource vue */
6531
6531
 
6532
- const COMPONENT_NAME$1H = 'vc-checkbox-group';
6532
+ const COMPONENT_NAME$1I = 'vc-checkbox-group';
6533
6533
  const CheckboxGroup = /* @__PURE__ */ vue.defineComponent({
6534
- name: COMPONENT_NAME$1H,
6534
+ name: COMPONENT_NAME$1I,
6535
6535
  props: props$1b,
6536
6536
  emits: ['update:modelValue', 'change'],
6537
6537
  setup(props, {
@@ -6549,9 +6549,9 @@
6549
6549
 
6550
6550
  /** @jsxImportSource vue */
6551
6551
 
6552
- const COMPONENT_NAME$1G = 'vcm-checkbox';
6552
+ const COMPONENT_NAME$1H = 'vcm-checkbox';
6553
6553
  const MCheckbox = /* @__PURE__ */ vue.defineComponent({
6554
- name: COMPONENT_NAME$1G,
6554
+ name: COMPONENT_NAME$1H,
6555
6555
  props: props$1c,
6556
6556
  emits: ['update:modelValue', 'change'],
6557
6557
  setup(props, {
@@ -6591,9 +6591,9 @@
6591
6591
 
6592
6592
  /** @jsxImportSource vue */
6593
6593
 
6594
- const COMPONENT_NAME$1F = 'vcm-checkbox-group';
6594
+ const COMPONENT_NAME$1G = 'vcm-checkbox-group';
6595
6595
  const MCheckboxGroup = /* @__PURE__ */ vue.defineComponent({
6596
- name: COMPONENT_NAME$1F,
6596
+ name: COMPONENT_NAME$1G,
6597
6597
  props: props$1b,
6598
6598
  emits: ['update:modelValue', 'change'],
6599
6599
  setup(props, {
@@ -6652,9 +6652,9 @@
6652
6652
  }
6653
6653
  };
6654
6654
 
6655
- const COMPONENT_NAME$1E = "vc-customer";
6655
+ const COMPONENT_NAME$1F = "vc-customer";
6656
6656
  const Customer = vue.defineComponent({
6657
- name: COMPONENT_NAME$1E,
6657
+ name: COMPONENT_NAME$1F,
6658
6658
  props: props$19,
6659
6659
  setup(props, context) {
6660
6660
  return () => vue.h(() => {
@@ -6665,9 +6665,9 @@
6665
6665
 
6666
6666
  /** @jsxImportSource vue */
6667
6667
 
6668
- const COMPONENT_NAME$1D = 'vc-message';
6668
+ const COMPONENT_NAME$1E = 'vc-message';
6669
6669
  const MessageView = /* @__PURE__ */ vue.defineComponent({
6670
- name: COMPONENT_NAME$1D,
6670
+ name: COMPONENT_NAME$1E,
6671
6671
  emits: ['before-close', 'close', 'portal-fulfilled'],
6672
6672
  props: props$1a,
6673
6673
  setup(props, {
@@ -7227,7 +7227,7 @@
7227
7227
  }
7228
7228
  }
7229
7229
 
7230
- const COMPONENT_NAME$1C = "vc-portal";
7230
+ const COMPONENT_NAME$1D = "vc-portal";
7231
7231
  class Portal {
7232
7232
  /**
7233
7233
  * 清理Portals类型组件
@@ -7279,7 +7279,7 @@
7279
7279
  this.wrapper = wrapper;
7280
7280
  this.globalOptions = {
7281
7281
  ...options,
7282
- name: options?.name || wrapper.name || getUid(COMPONENT_NAME$1C)
7282
+ name: options?.name || wrapper.name || getUid(COMPONENT_NAME$1D)
7283
7283
  };
7284
7284
  }
7285
7285
  popup(propsData, options) {
@@ -7378,7 +7378,7 @@
7378
7378
  ...rest
7379
7379
  } = options;
7380
7380
  let useAllNodes = fragment;
7381
- const name = multiple ? `${name$}__${getUid(COMPONENT_NAME$1C)}` : name$;
7381
+ const name = multiple ? `${name$}__${getUid(COMPONENT_NAME$1D)}` : name$;
7382
7382
  const container = document.createElement(tag);
7383
7383
  const root = typeof el === "object" ? el : document.querySelector(el || "body");
7384
7384
  !alive && Portal.leafs.get(name)?.destroy();
@@ -7412,7 +7412,7 @@
7412
7412
  } else {
7413
7413
  const wrapper = this.wrapper;
7414
7414
  const app = vue.createApp({
7415
- name: COMPONENT_NAME$1C,
7415
+ name: COMPONENT_NAME$1D,
7416
7416
  parent,
7417
7417
  setup() {
7418
7418
  if (alive) {
@@ -7524,13 +7524,13 @@
7524
7524
  }
7525
7525
  };
7526
7526
 
7527
- const COMPONENT_NAME$1B = 'vc-portal-view';
7527
+ const COMPONENT_NAME$1C = 'vc-portal-view';
7528
7528
 
7529
7529
  /**
7530
7530
  * 写法不同,但与vue@2.x 保持一致
7531
7531
  */
7532
7532
  const PortalView = /* @__PURE__ */ vue.defineComponent({
7533
- name: COMPONENT_NAME$1B,
7533
+ name: COMPONENT_NAME$1C,
7534
7534
  props: props$18,
7535
7535
  setup(props, {
7536
7536
  slots
@@ -7701,9 +7701,9 @@
7701
7701
  return () => vue.h(props.tag, { onClick: handleClick, class: "vc-clipboard" }, slots?.default?.());
7702
7702
  };
7703
7703
 
7704
- const COMPONENT_NAME$1A = "vc-clipboard";
7704
+ const COMPONENT_NAME$1B = "vc-clipboard";
7705
7705
  const Clipboard$1 = vue.defineComponent({
7706
- name: COMPONENT_NAME$1A,
7706
+ name: COMPONENT_NAME$1B,
7707
7707
  props: props$17,
7708
7708
  setup() {
7709
7709
  return useClipboard((content) => Message.success({ content }));
@@ -7743,9 +7743,9 @@
7743
7743
 
7744
7744
  /** @jsxImportSource vue */
7745
7745
 
7746
- const COMPONENT_NAME$1z = 'vcm-toast';
7746
+ const COMPONENT_NAME$1A = 'vcm-toast';
7747
7747
  const MToastView = /* @__PURE__ */ vue.defineComponent({
7748
- name: COMPONENT_NAME$1z,
7748
+ name: COMPONENT_NAME$1A,
7749
7749
  emits: ['close', 'portal-fulfilled'],
7750
7750
  props: props$16,
7751
7751
  setup(props, {
@@ -7847,9 +7847,9 @@
7847
7847
  const error$2 = create$6({ mode: "error" });
7848
7848
  const MToast = Object.assign(MToastView, { destroy: destroy$4, info: info$2, success: success$2, loading, warning: warning$2, error: error$2 });
7849
7849
 
7850
- const COMPONENT_NAME$1y = "vcm-clipboard";
7850
+ const COMPONENT_NAME$1z = "vcm-clipboard";
7851
7851
  const MClipboard$1 = vue.defineComponent({
7852
- name: COMPONENT_NAME$1y,
7852
+ name: COMPONENT_NAME$1z,
7853
7853
  props: props$17,
7854
7854
  setup() {
7855
7855
  return useClipboard((content) => MToast.info({ content }));
@@ -7881,9 +7881,9 @@
7881
7881
  }
7882
7882
  };
7883
7883
 
7884
- const COMPONENT_NAME$1x = "vc-collapse";
7884
+ const COMPONENT_NAME$1y = "vc-collapse";
7885
7885
  const Collapse = vue.defineComponent({
7886
- name: COMPONENT_NAME$1x,
7886
+ name: COMPONENT_NAME$1y,
7887
7887
  props: props$15,
7888
7888
  emits: ["update:moodelValue", "change"],
7889
7889
  setup(props, { slots, emit }) {
@@ -8000,9 +8000,9 @@
8000
8000
  function _isSlot$3(s) {
8001
8001
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
8002
8002
  }
8003
- const COMPONENT_NAME$1w = 'vc-expand';
8003
+ const COMPONENT_NAME$1x = 'vc-expand';
8004
8004
  const Expand$1 = /* @__PURE__ */ vue.defineComponent({
8005
- name: COMPONENT_NAME$1w,
8005
+ name: COMPONENT_NAME$1x,
8006
8006
  props: props$13,
8007
8007
  setup(props, {
8008
8008
  slots
@@ -8032,9 +8032,9 @@
8032
8032
 
8033
8033
  /** @jsxImportSource vue */
8034
8034
 
8035
- const COMPONENT_NAME$1v = 'vc-collapse-item';
8035
+ const COMPONENT_NAME$1w = 'vc-collapse-item';
8036
8036
  const CollapseItem = /* @__PURE__ */ vue.defineComponent({
8037
- name: COMPONENT_NAME$1v,
8037
+ name: COMPONENT_NAME$1w,
8038
8038
  props: props$14,
8039
8039
  setup(props, {
8040
8040
  slots,
@@ -8109,9 +8109,9 @@
8109
8109
 
8110
8110
  /** @jsxImportSource vue */
8111
8111
 
8112
- const COMPONENT_NAME$1u = 'vc-color-picker';
8112
+ const COMPONENT_NAME$1v = 'vc-color-picker';
8113
8113
  const ColorPicker = /* @__PURE__ */ vue.defineComponent({
8114
- name: COMPONENT_NAME$1u,
8114
+ name: COMPONENT_NAME$1v,
8115
8115
  props: props$12,
8116
8116
  setup(props, {
8117
8117
  slots
@@ -8135,9 +8135,9 @@
8135
8135
 
8136
8136
  /** @jsxImportSource vue */
8137
8137
 
8138
- const COMPONENT_NAME$1t = 'vc-countdown';
8138
+ const COMPONENT_NAME$1u = 'vc-countdown';
8139
8139
  const Countdown = /* @__PURE__ */ vue.defineComponent({
8140
- name: COMPONENT_NAME$1t,
8140
+ name: COMPONENT_NAME$1u,
8141
8141
  props: props$11,
8142
8142
  setup(props, {
8143
8143
  slots
@@ -8651,9 +8651,9 @@
8651
8651
 
8652
8652
  /** @jsxImportSource vue */
8653
8653
 
8654
- const COMPONENT_NAME$1s = 'vc-input';
8654
+ const COMPONENT_NAME$1t = 'vc-input';
8655
8655
  const Input = /* @__PURE__ */ vue.defineComponent({
8656
- name: COMPONENT_NAME$1s,
8656
+ name: COMPONENT_NAME$1t,
8657
8657
  inheritAttrs: false,
8658
8658
  props: {
8659
8659
  ...props$$,
@@ -8987,9 +8987,9 @@
8987
8987
 
8988
8988
  /** @jsxImportSource vue */
8989
8989
 
8990
- const COMPONENT_NAME$1r = 'vc-input-number';
8990
+ const COMPONENT_NAME$1s = 'vc-input-number';
8991
8991
  const InputNumber = /* @__PURE__ */ vue.defineComponent({
8992
- name: COMPONENT_NAME$1r,
8992
+ name: COMPONENT_NAME$1s,
8993
8993
  props: props$X,
8994
8994
  inheritAttrs: false,
8995
8995
  setup(props, {
@@ -9053,9 +9053,9 @@
9053
9053
 
9054
9054
  /** @jsxImportSource vue */
9055
9055
 
9056
- const COMPONENT_NAME$1q = 'vc-input-search';
9056
+ const COMPONENT_NAME$1r = 'vc-input-search';
9057
9057
  const InputSearch = /* @__PURE__ */ vue.defineComponent({
9058
- name: COMPONENT_NAME$1q,
9058
+ name: COMPONENT_NAME$1r,
9059
9059
  props: props$W,
9060
9060
  inheritAttrs: false,
9061
9061
  setup(props, {
@@ -9346,9 +9346,9 @@
9346
9346
  function _isSlot$2(s) {
9347
9347
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
9348
9348
  }
9349
- const COMPONENT_NAME$1p = 'vc-popover-wrapper';
9349
+ const COMPONENT_NAME$1q = 'vc-popover-wrapper';
9350
9350
  const PopoverWrapper = /* @__PURE__ */ vue.defineComponent({
9351
- name: COMPONENT_NAME$1p,
9351
+ name: COMPONENT_NAME$1q,
9352
9352
  props: props$_,
9353
9353
  emits: ['portal-fulfilled', 'close'],
9354
9354
  setup(props, {
@@ -9598,9 +9598,9 @@
9598
9598
 
9599
9599
  /** @jsxImportSource vue */
9600
9600
 
9601
- const COMPONENT_NAME$1o = 'vc-popover';
9601
+ const COMPONENT_NAME$1p = 'vc-popover';
9602
9602
  const Popover$1 = /* @__PURE__ */ vue.defineComponent({
9603
- name: COMPONENT_NAME$1o,
9603
+ name: COMPONENT_NAME$1p,
9604
9604
  props: props$Z,
9605
9605
  emits: ['update:modelValue', 'visible-change', 'ready', 'close'],
9606
9606
  setup(props, {
@@ -10701,9 +10701,9 @@
10701
10701
  }
10702
10702
  return view;
10703
10703
  };
10704
- const COMPONENT_NAME$1n = 'vc-date-confirm';
10704
+ const COMPONENT_NAME$1o = 'vc-date-confirm';
10705
10705
  const Confirm = /* @__PURE__ */ vue.defineComponent({
10706
- name: COMPONENT_NAME$1n,
10706
+ name: COMPONENT_NAME$1o,
10707
10707
  props: {
10708
10708
  showTime: {
10709
10709
  type: Boolean,
@@ -10767,9 +10767,9 @@
10767
10767
 
10768
10768
  /** @jsxImportSource vue */
10769
10769
 
10770
- const COMPONENT_NAME$1m = 'vc-date-header';
10770
+ const COMPONENT_NAME$1n = 'vc-date-header';
10771
10771
  const DateHeader = /* @__PURE__ */ vue.defineComponent({
10772
- name: COMPONENT_NAME$1m,
10772
+ name: COMPONENT_NAME$1n,
10773
10773
  props: {
10774
10774
  panelDate: Date,
10775
10775
  showNext: {
@@ -10853,9 +10853,9 @@
10853
10853
 
10854
10854
  /** @jsxImportSource vue */
10855
10855
 
10856
- const COMPONENT_NAME$1l = 'vc-date-table';
10856
+ const COMPONENT_NAME$1m = 'vc-date-table';
10857
10857
  const DateTable = /* @__PURE__ */ vue.defineComponent({
10858
- name: COMPONENT_NAME$1l,
10858
+ name: COMPONENT_NAME$1m,
10859
10859
  props: {
10860
10860
  value: Array,
10861
10861
  firstDayOfWeek: {
@@ -11064,9 +11064,9 @@
11064
11064
 
11065
11065
  /** @jsxImportSource vue */
11066
11066
 
11067
- const COMPONENT_NAME$1k = 'vc-month-table';
11067
+ const COMPONENT_NAME$1l = 'vc-month-table';
11068
11068
  const MonthTable = /* @__PURE__ */ vue.defineComponent({
11069
- name: COMPONENT_NAME$1k,
11069
+ name: COMPONENT_NAME$1l,
11070
11070
  props: {
11071
11071
  value: Array,
11072
11072
  panelDate: Date,
@@ -11198,7 +11198,7 @@
11198
11198
 
11199
11199
  /** @jsxImportSource vue */
11200
11200
 
11201
- const COMPONENT_NAME$1j = 'vc-quarter-table';
11201
+ const COMPONENT_NAME$1k = 'vc-quarter-table';
11202
11202
 
11203
11203
  /**
11204
11204
  * 获取季度对应的月份范围
@@ -11232,7 +11232,7 @@
11232
11232
  }
11233
11233
  };
11234
11234
  const QuarterTable = /* @__PURE__ */ vue.defineComponent({
11235
- name: COMPONENT_NAME$1j,
11235
+ name: COMPONENT_NAME$1k,
11236
11236
  props: {
11237
11237
  value: Array,
11238
11238
  panelDate: Date,
@@ -11355,9 +11355,9 @@
11355
11355
 
11356
11356
  /** @jsxImportSource vue */
11357
11357
 
11358
- const COMPONENT_NAME$1i = 'vc-shortcuts-select';
11358
+ const COMPONENT_NAME$1j = 'vc-shortcuts-select';
11359
11359
  const ShortcutsSelect = /* @__PURE__ */ vue.defineComponent({
11360
- name: COMPONENT_NAME$1i,
11360
+ name: COMPONENT_NAME$1j,
11361
11361
  props: {
11362
11362
  panelDate: Date,
11363
11363
  config: Array,
@@ -11397,9 +11397,9 @@
11397
11397
 
11398
11398
  /** @jsxImportSource vue */
11399
11399
 
11400
- const COMPONENT_NAME$1h = 'vc-time-select';
11400
+ const COMPONENT_NAME$1i = 'vc-time-select';
11401
11401
  const TimeSelect = /* @__PURE__ */ vue.defineComponent({
11402
- name: COMPONENT_NAME$1h,
11402
+ name: COMPONENT_NAME$1i,
11403
11403
  props: {
11404
11404
  hours: {
11405
11405
  type: [Number, String],
@@ -11678,9 +11678,9 @@
11678
11678
 
11679
11679
  /** @jsxImportSource vue */
11680
11680
 
11681
- const COMPONENT_NAME$1g = 'vc-year-table';
11681
+ const COMPONENT_NAME$1h = 'vc-year-table';
11682
11682
  const YearTable = /* @__PURE__ */ vue.defineComponent({
11683
- name: COMPONENT_NAME$1g,
11683
+ name: COMPONENT_NAME$1h,
11684
11684
  props: {
11685
11685
  value: Array,
11686
11686
  panelDate: Date,
@@ -11803,9 +11803,9 @@
11803
11803
  }
11804
11804
  return true;
11805
11805
  };
11806
- const COMPONENT_NAME$1f = 'vc-date-range-panel';
11806
+ const COMPONENT_NAME$1g = 'vc-date-range-panel';
11807
11807
  const DateRangePanel = /* @__PURE__ */ vue.defineComponent({
11808
- name: COMPONENT_NAME$1f,
11808
+ name: COMPONENT_NAME$1g,
11809
11809
  props: {
11810
11810
  ...props$V,
11811
11811
  confirm: {
@@ -12184,9 +12184,9 @@
12184
12184
 
12185
12185
  /** @jsxImportSource vue */
12186
12186
 
12187
- const COMPONENT_NAME$1e = 'vc-date-panel';
12187
+ const COMPONENT_NAME$1f = 'vc-date-panel';
12188
12188
  const DatePanel = /* @__PURE__ */ vue.defineComponent({
12189
- name: COMPONENT_NAME$1e,
12189
+ name: COMPONENT_NAME$1f,
12190
12190
  props: {
12191
12191
  ...props$V,
12192
12192
  type: String,
@@ -12394,9 +12394,9 @@
12394
12394
  const endYear = value[1].getFullYear();
12395
12395
  return startYear === endYear;
12396
12396
  };
12397
- const COMPONENT_NAME$1d = 'vc-monthrange-panel';
12397
+ const COMPONENT_NAME$1e = 'vc-monthrange-panel';
12398
12398
  const MonthRangePanel = /* @__PURE__ */ vue.defineComponent({
12399
- name: COMPONENT_NAME$1d,
12399
+ name: COMPONENT_NAME$1e,
12400
12400
  props: {
12401
12401
  ...props$V,
12402
12402
  confirm: {
@@ -12571,9 +12571,9 @@
12571
12571
  const endYear = value[1].getFullYear();
12572
12572
  return startYear === endYear;
12573
12573
  };
12574
- const COMPONENT_NAME$1c = 'vc-quarterrange-panel';
12574
+ const COMPONENT_NAME$1d = 'vc-quarterrange-panel';
12575
12575
  const QuarterRangePanel = /* @__PURE__ */ vue.defineComponent({
12576
- name: COMPONENT_NAME$1c,
12576
+ name: COMPONENT_NAME$1d,
12577
12577
  props: {
12578
12578
  ...props$V,
12579
12579
  confirm: {
@@ -12812,9 +12812,9 @@
12812
12812
  seconds
12813
12813
  };
12814
12814
  };
12815
- const COMPONENT_NAME$1b = 'vc-timerange-panel';
12815
+ const COMPONENT_NAME$1c = 'vc-timerange-panel';
12816
12816
  const TimeRangePanel = /* @__PURE__ */ vue.defineComponent({
12817
- name: COMPONENT_NAME$1b,
12817
+ name: COMPONENT_NAME$1c,
12818
12818
  props: props$U,
12819
12819
  emits: ['pick', 'clear', 'ok'],
12820
12820
  setup(props, {
@@ -12913,9 +12913,9 @@
12913
12913
 
12914
12914
  /** @jsxImportSource vue */
12915
12915
 
12916
- const COMPONENT_NAME$1a = 'vc-time-panel';
12916
+ const COMPONENT_NAME$1b = 'vc-time-panel';
12917
12917
  const TimePanel = /* @__PURE__ */ vue.defineComponent({
12918
- name: COMPONENT_NAME$1a,
12918
+ name: COMPONENT_NAME$1b,
12919
12919
  props: props$U,
12920
12920
  emits: ['pick', 'clear', 'ok'],
12921
12921
  setup(props, {
@@ -12970,7 +12970,7 @@
12970
12970
 
12971
12971
  /** @jsxImportSource vue */
12972
12972
 
12973
- const COMPONENT_NAME$19 = 'vc-date-picker';
12973
+ const COMPONENT_NAME$1a = 'vc-date-picker';
12974
12974
  const getPanel$1 = type => {
12975
12975
  if (['daterange', 'datetimerange'].includes(type)) {
12976
12976
  return DateRangePanel;
@@ -12981,7 +12981,7 @@
12981
12981
  }
12982
12982
  return DatePanel;
12983
12983
  };
12984
- const DatePicker = createPicker(COMPONENT_NAME$19, props$10, () => {
12984
+ const DatePicker = createPicker(COMPONENT_NAME$1a, props$10, () => {
12985
12985
  const props = vue.getCurrentInstance().props;
12986
12986
  const icon = vue.ref('date');
12987
12987
  const panel = vue.shallowRef({});
@@ -13014,9 +13014,9 @@
13014
13014
 
13015
13015
  /** @jsxImportSource vue */
13016
13016
 
13017
- const COMPONENT_NAME$18 = 'vc-divider';
13017
+ const COMPONENT_NAME$19 = 'vc-divider';
13018
13018
  const Divider = /* @__PURE__ */ vue.defineComponent({
13019
- name: COMPONENT_NAME$18,
13019
+ name: COMPONENT_NAME$19,
13020
13020
  props: props$T,
13021
13021
  setup(props, {
13022
13022
  slots
@@ -13171,7 +13171,7 @@
13171
13171
 
13172
13172
  /** @jsxImportSource vue */
13173
13173
 
13174
- const COMPONENT_NAME$17 = 'vc-scroller-track';
13174
+ const COMPONENT_NAME$18 = 'vc-scroller-track';
13175
13175
  const BAR_MAP = {
13176
13176
  vertical: {
13177
13177
  scroll: 'scrollTop',
@@ -13191,7 +13191,7 @@
13191
13191
  }
13192
13192
  };
13193
13193
  const Track$1 = /* @__PURE__ */ vue.defineComponent({
13194
- name: COMPONENT_NAME$17,
13194
+ name: COMPONENT_NAME$18,
13195
13195
  props: props$S,
13196
13196
  emits: ['change'],
13197
13197
  inheritAttrs: false,
@@ -13381,9 +13381,9 @@
13381
13381
 
13382
13382
  /** @jsxImportSource vue */
13383
13383
 
13384
- const COMPONENT_NAME$16 = 'vc-scroller-bar';
13384
+ const COMPONENT_NAME$17 = 'vc-scroller-bar';
13385
13385
  const Bar = /* @__PURE__ */ vue.defineComponent({
13386
- name: COMPONENT_NAME$16,
13386
+ name: COMPONENT_NAME$17,
13387
13387
  props: props$R,
13388
13388
  emits: ['change'],
13389
13389
  setup(props, {
@@ -13598,7 +13598,7 @@
13598
13598
 
13599
13599
  /** @jsxImportSource vue */
13600
13600
 
13601
- const COMPONENT_NAME$15 = 'vc-scroller';
13601
+ const COMPONENT_NAME$16 = 'vc-scroller';
13602
13602
 
13603
13603
  /**
13604
13604
  * 作为备选方案,目前推荐使用ScrollerWheel
@@ -13609,7 +13609,7 @@
13609
13609
  * 2. 增加了一层嵌套
13610
13610
  */
13611
13611
  const Scroller = /* @__PURE__ */ vue.defineComponent({
13612
- name: COMPONENT_NAME$15,
13612
+ name: COMPONENT_NAME$16,
13613
13613
  props: props$Q,
13614
13614
  emits: ['scroll'],
13615
13615
  setup(props, {
@@ -14559,7 +14559,7 @@
14559
14559
 
14560
14560
  /** @jsxImportSource vue */
14561
14561
 
14562
- const COMPONENT_NAME$14 = 'vc-scroller-wheel';
14562
+ const COMPONENT_NAME$15 = 'vc-scroller-wheel';
14563
14563
 
14564
14564
  /**
14565
14565
  * 为减少一层嵌套,为去除滚动bar的抖动,使用wheel模拟
@@ -14581,7 +14581,7 @@
14581
14581
  * 设置scrollTop不会reflow和repaint,不需要考虑transfrom来改变content(transform也只在draw完成)
14582
14582
  */
14583
14583
  const ScrollerWheel = /* @__PURE__ */ vue.defineComponent({
14584
- name: COMPONENT_NAME$14,
14584
+ name: COMPONENT_NAME$15,
14585
14585
  props: Object.assign(props$Q, {
14586
14586
  stopPropagation: {
14587
14587
  type: Boolean,
@@ -14770,9 +14770,9 @@
14770
14770
 
14771
14771
  /** @jsxImportSource vue */
14772
14772
 
14773
- const COMPONENT_NAME$13 = 'vc-drawer';
14773
+ const COMPONENT_NAME$14 = 'vc-drawer';
14774
14774
  const DrawerView = /* @__PURE__ */ vue.defineComponent({
14775
- name: COMPONENT_NAME$13,
14775
+ name: COMPONENT_NAME$14,
14776
14776
  props: props$P,
14777
14777
  emits: ['close', 'update:modelValue', 'visible-change'],
14778
14778
  setup(props, {
@@ -14948,9 +14948,9 @@
14948
14948
 
14949
14949
  /** @jsxImportSource vue */
14950
14950
 
14951
- const COMPONENT_NAME$12 = 'vc-dropdown';
14951
+ const COMPONENT_NAME$13 = 'vc-dropdown';
14952
14952
  const Dropdown = /* @__PURE__ */ vue.defineComponent({
14953
- name: COMPONENT_NAME$12,
14953
+ name: COMPONENT_NAME$13,
14954
14954
  props: props$O,
14955
14955
  setup(props, {
14956
14956
  slots
@@ -14974,9 +14974,9 @@
14974
14974
 
14975
14975
  /** @jsxImportSource vue */
14976
14976
 
14977
- const COMPONENT_NAME$11 = 'vc-editor';
14977
+ const COMPONENT_NAME$12 = 'vc-editor';
14978
14978
  const Editor = /* @__PURE__ */ vue.defineComponent({
14979
- name: COMPONENT_NAME$11,
14979
+ name: COMPONENT_NAME$12,
14980
14980
  props: props$N,
14981
14981
  setup(props, {
14982
14982
  slots
@@ -15120,9 +15120,9 @@
15120
15120
  });
15121
15121
  };
15122
15122
 
15123
- const COMPONENT_NAME$10 = "vc-form";
15123
+ const COMPONENT_NAME$11 = "vc-form";
15124
15124
  const Form = vue.defineComponent({
15125
- name: COMPONENT_NAME$10,
15125
+ name: COMPONENT_NAME$11,
15126
15126
  props: props$M,
15127
15127
  setup(props, { slots, expose }) {
15128
15128
  useForm(expose);
@@ -15579,9 +15579,9 @@
15579
15579
 
15580
15580
  /** @jsxImportSource vue */
15581
15581
 
15582
- const COMPONENT_NAME$$ = 'vc-form-item';
15582
+ const COMPONENT_NAME$10 = 'vc-form-item';
15583
15583
  const FormItem = /* @__PURE__ */ vue.defineComponent({
15584
- name: COMPONENT_NAME$$,
15584
+ name: COMPONENT_NAME$10,
15585
15585
  props: props$L,
15586
15586
  setup(props, {
15587
15587
  slots,
@@ -15646,9 +15646,9 @@
15646
15646
  }
15647
15647
  };
15648
15648
 
15649
- const COMPONENT_NAME$_ = "vcm-form";
15649
+ const COMPONENT_NAME$$ = "vcm-form";
15650
15650
  const MForm = vue.defineComponent({
15651
- name: COMPONENT_NAME$_,
15651
+ name: COMPONENT_NAME$$,
15652
15652
  props: props$K,
15653
15653
  setup(props, { slots, expose }) {
15654
15654
  useForm(expose, {
@@ -15679,9 +15679,9 @@
15679
15679
 
15680
15680
  /** @jsxImportSource vue */
15681
15681
 
15682
- const COMPONENT_NAME$Z = 'vcm-form-item';
15682
+ const COMPONENT_NAME$_ = 'vcm-form-item';
15683
15683
  const MFormItem = /* @__PURE__ */ vue.defineComponent({
15684
- name: COMPONENT_NAME$Z,
15684
+ name: COMPONENT_NAME$_,
15685
15685
  props: props$J,
15686
15686
  setup(props, {
15687
15687
  slots,
@@ -15735,9 +15735,9 @@
15735
15735
  }
15736
15736
  });
15737
15737
 
15738
- const COMPONENT_NAME$Y = "vc-fragment";
15738
+ const COMPONENT_NAME$Z = "vc-fragment";
15739
15739
  const Fragment = vue.defineComponent({
15740
- name: COMPONENT_NAME$Y,
15740
+ name: COMPONENT_NAME$Z,
15741
15741
  setup(_, { slots }) {
15742
15742
  return () => vue.h(vue.Fragment, slots.default?.());
15743
15743
  }
@@ -15754,9 +15754,9 @@
15754
15754
 
15755
15755
  /** @jsxImportSource vue */
15756
15756
 
15757
- const COMPONENT_NAME$X = 'vc-html-to-image';
15757
+ const COMPONENT_NAME$Y = 'vc-html-to-image';
15758
15758
  const HTMLToImage = /* @__PURE__ */ vue.defineComponent({
15759
- name: COMPONENT_NAME$X,
15759
+ name: COMPONENT_NAME$Y,
15760
15760
  props: props$I,
15761
15761
  setup(props, {
15762
15762
  slots
@@ -15774,804 +15774,128 @@
15774
15774
  const MIcon = Icon;
15775
15775
 
15776
15776
  const props$H = {
15777
- src: String,
15778
- fit: String,
15779
- lazy: Boolean,
15780
- wrapper: [Object, String]
15777
+ tag: {
15778
+ type: String,
15779
+ default: "div"
15780
+ }
15781
15781
  };
15782
15782
 
15783
- class ACache {
15784
- options;
15785
- constructor() {
15786
- this.options = {
15787
- version: "",
15788
- get: (v) => flattenJSONParse(v),
15789
- set: (v) => v
15790
- };
15791
- }
15792
- configure(options) {
15793
- if (typeof window === "undefined")
15794
- return;
15795
- this.options = {
15796
- ...this.options,
15797
- ...options
15783
+ /** @jsxImportSource vue */
15784
+
15785
+ const COMPONENT_NAME$X = 'vc-image-preview';
15786
+ const ImagePreview$1 = /* @__PURE__ */ vue.defineComponent({
15787
+ name: COMPONENT_NAME$X,
15788
+ props: props$H,
15789
+ setup(props, {
15790
+ slots
15791
+ }) {
15792
+ return () => {
15793
+ return vue.createVNode("div", {
15794
+ "class": "vc-image-preview"
15795
+ }, [slots?.default?.()]);
15798
15796
  };
15799
15797
  }
15800
- }
15798
+ });
15801
15799
 
15802
- (() => {
15803
- try {
15804
- document.cookie = "test";
15805
- return true;
15806
- } catch (_) {
15807
- return false;
15808
- }
15809
- })();
15800
+ /*!
15801
+ * PhotoSwipe Lightbox 5.4.4 - https://photoswipe.com
15802
+ * (c) 2024 Dmytro Semenov
15803
+ */
15804
+ /** @typedef {import('../photoswipe.js').Point} Point */
15810
15805
 
15811
- class MemoryStorage {
15812
- store = {};
15813
- getItem(key) {
15814
- return this.store[key] || null;
15806
+ /**
15807
+ * @template {keyof HTMLElementTagNameMap} T
15808
+ * @param {string} className
15809
+ * @param {T} tagName
15810
+ * @param {Node} [appendToEl]
15811
+ * @returns {HTMLElementTagNameMap[T]}
15812
+ */
15813
+ function createElement$2(className, tagName, appendToEl) {
15814
+ const el = document.createElement(tagName);
15815
+
15816
+ if (className) {
15817
+ el.className = className;
15815
15818
  }
15816
- setItem(key, val) {
15817
- this.store[key] = val;
15819
+
15820
+ if (appendToEl) {
15821
+ appendToEl.appendChild(el);
15818
15822
  }
15819
- removeItem(key) {
15820
- delete this.store[key];
15823
+
15824
+ return el;
15825
+ }
15826
+ /**
15827
+ * Get transform string
15828
+ *
15829
+ * @param {number} x
15830
+ * @param {number} [y]
15831
+ * @param {number} [scale]
15832
+ * @returns {string}
15833
+ */
15834
+
15835
+ function toTransformString$1(x, y, scale) {
15836
+ let propValue = `translate3d(${x}px,${0}px,0)`;
15837
+
15838
+ if (scale !== undefined) {
15839
+ propValue += ` scale3d(${scale},${scale},1)`;
15821
15840
  }
15841
+
15842
+ return propValue;
15843
+ }
15844
+ /**
15845
+ * Apply width and height CSS properties to element
15846
+ *
15847
+ * @param {HTMLElement} el
15848
+ * @param {string | number} w
15849
+ * @param {string | number} h
15850
+ */
15851
+
15852
+ function setWidthHeight$1(el, w, h) {
15853
+ el.style.width = typeof w === 'number' ? `${w}px` : w;
15854
+ el.style.height = typeof h === 'number' ? `${h}px` : h;
15822
15855
  }
15856
+ /** @typedef {LOAD_STATE[keyof LOAD_STATE]} LoadState */
15823
15857
 
15824
- const PREFIX_NAME = "@deot/helper/";
15825
- const formatKey = (key, version) => {
15826
- return `${version ? `${PREFIX_NAME}${version}:` : ""}${key}`;
15858
+ /** @type {{ IDLE: 'idle'; LOADING: 'loading'; LOADED: 'loaded'; ERROR: 'error' }} */
15859
+
15860
+ const LOAD_STATE$1 = {
15861
+ IDLE: 'idle',
15862
+ LOADING: 'loading',
15863
+ LOADED: 'loaded',
15864
+ ERROR: 'error'
15827
15865
  };
15828
- const ALLOW$1 = (() => {
15829
- const test = "test";
15830
- try {
15831
- window.localStorage.setItem(test, test);
15832
- window.localStorage.removeItem(test);
15833
- return true;
15834
- } catch (_) {
15835
- return false;
15836
- }
15837
- })();
15838
- class StorageStore extends ACache {
15839
- sessionStorage = new MemoryStorage();
15840
- localStorage = new MemoryStorage();
15841
- getInvoke(options) {
15842
- return options?.session ? "sessionStorage" : "localStorage";
15843
- }
15844
- configure(options) {
15845
- super.configure(options);
15846
- if (!ALLOW$1)
15847
- return;
15848
- const { version } = this.options;
15849
- Object.keys(window.localStorage).forEach((item) => {
15850
- /* istanbul ignore else -- @preserve */
15851
- if (item.includes(PREFIX_NAME) && !item.includes(`${PREFIX_NAME}${version}`)) {
15852
- window.localStorage.removeItem(item);
15853
- }
15854
- });
15855
- }
15856
- /**
15857
- * 设置缓存
15858
- * @param key 保存的键值
15859
- * @param value 保存的内容
15860
- * @param options ~
15861
- */
15862
- set(key, value, options) {
15863
- if (!ALLOW$1)
15864
- return;
15865
- const invoke = this.getInvoke(options);
15866
- key = formatKey(key, this.options.version);
15867
- value = this.options.set(typeof value === "string" ? value : JSON.stringify(value));
15868
- try {
15869
- window[invoke].setItem(key, value);
15870
- } catch (error) {
15871
- this[invoke].setItem(key, value);
15872
- }
15873
- }
15874
- /**
15875
- * 获取缓存
15876
- * @param key 保存的键值
15877
- * @param options ~
15878
- * @returns ~
15879
- */
15880
- get(key, options) {
15881
- if (!ALLOW$1)
15882
- return null;
15883
- const invoke = this.getInvoke(options);
15884
- key = formatKey(key, this.options.version);
15885
- const value = this[invoke].getItem(key) || window[invoke].getItem(key);
15886
- return this.options.get(value);
15887
- }
15888
- /**
15889
- * 删除缓存
15890
- * @param key 键值
15891
- * @param options ~
15892
- */
15893
- remove(key, options) {
15894
- if (!ALLOW$1)
15895
- return;
15896
- const invoke = this.getInvoke(options);
15897
- key = formatKey(key, this.options.version);
15898
- this[invoke].removeItem(key);
15899
- window[invoke].removeItem(key);
15900
- }
15866
+ /**
15867
+ * Check if click or keydown event was dispatched
15868
+ * with a special key or via mouse wheel.
15869
+ *
15870
+ * @param {MouseEvent | KeyboardEvent} e
15871
+ * @returns {boolean}
15872
+ */
15873
+
15874
+ function specialKeyUsed$1(e) {
15875
+ return 'button' in e && e.button === 1 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey;
15901
15876
  }
15902
- const Storage$1 = new StorageStore();
15877
+ /**
15878
+ * Parse `gallery` or `children` options.
15879
+ *
15880
+ * @param {import('../photoswipe.js').ElementProvider} [option]
15881
+ * @param {string} [legacySelector]
15882
+ * @param {HTMLElement | Document} [parent]
15883
+ * @returns HTMLElement[]
15884
+ */
15903
15885
 
15904
- const ALLOW = (() => {
15905
- try {
15906
- window.indexedDB.open;
15907
- return true;
15908
- } catch (_) {
15909
- return false;
15910
- }
15911
- })();
15912
- class IndexedDBStore extends ACache {
15913
- timestramp = (/* @__PURE__ */ new Date()).getTime();
15914
- count = 0;
15915
- db = null;
15916
- pending = [];
15917
- constructor(options) {
15918
- super();
15919
- this.options = {
15920
- ...this.options,
15921
- keyPath: "__id",
15922
- name: "default-db",
15923
- storeName: "default-store",
15924
- version: 1
15925
- };
15926
- options && this.configure(options);
15927
- }
15928
- getUid() {
15929
- return `${this.timestramp}${this.count++}`;
15930
- }
15931
- configure(options) {
15932
- super.configure(options);
15933
- if (typeof this.options.version === "string") {
15934
- this.options.version = parseInt(this.options.version, 10);
15935
- }
15936
- }
15937
- /**
15938
- * 每次操作完要关闭
15939
- * 1. 浏览器上不关闭的话,删库操作会卡一会
15940
- * 2. fake-indexeddb不关闭会卡死
15941
- * @param fn ~
15942
- * @returns ~
15943
- */
15944
- concurrent(fn) {
15945
- const target = new Promise((resolve, reject) => {
15946
- fn().then(resolve).catch(reject);
15947
- });
15948
- this.pending.push(target);
15949
- target.finally(() => this.close(target));
15950
- return target;
15951
- }
15952
- /**
15953
- * 统一处理
15954
- * @param request ~
15955
- * @returns ~
15956
- */
15957
- async task(request) {
15958
- return new Promise((resolve, reject) => {
15959
- request.onsuccess = resolve;
15960
- request.onerror = reject;
15961
- });
15962
- }
15963
- /**
15964
- * @param target ~
15965
- */
15966
- async close(target) {
15967
- if (target) {
15968
- this.pending = this.pending.filter((i) => i !== target);
15969
- } else {
15970
- const done = async (pending) => {
15971
- if (pending.length) {
15972
- await Promise.allSettled(pending);
15973
- await done(this.pending);
15974
- }
15975
- };
15976
- await done(this.pending);
15977
- }
15978
- if (!this.pending.length && this.db) {
15979
- const db = this.db;
15980
- this.db = null;
15981
- (await db).close();
15982
- }
15983
- }
15984
- /**
15985
- * 打开数据库。变更时候更新表
15986
- * @returns ~
15987
- */
15988
- openDatabase() {
15989
- this.db = this.db || (async () => {
15990
- const { name, version, keyPath, storeName } = this.options;
15991
- const poll = () => new Promise((resolve, reject) => {
15992
- const request = window.indexedDB.open(name, version);
15993
- request.onsuccess = () => {
15994
- resolve(request.result);
15995
- };
15996
- request.onerror = /* istanbul ignore next */
15997
- () => {
15998
- reject(new Error("IndexedDB Open Failed. DeleteDatabase first!"));
15999
- };
16000
- request.onupgradeneeded = () => {
16001
- const db2 = request.result;
16002
- if (db2.objectStoreNames.contains(storeName)) {
16003
- db2.deleteObjectStore(storeName);
16004
- }
16005
- db2.createObjectStore(storeName, { keyPath });
16006
- };
16007
- });
16008
- const maxTries = 3;
16009
- let db;
16010
- for (let tries = 0; tries < maxTries; tries++) {
16011
- try {
16012
- db = await poll();
16013
- } catch (_) {
16014
- }
16015
- /* istanbul ignore next -- @preserve */
16016
- if (db || tries === maxTries - 1) {
16017
- break;
16018
- }
16019
- }
16020
- /* istanbul ignore next -- @preserve */
16021
- if (!db) {
16022
- await this.deleteDatabase();
16023
- db = await poll();
16024
- }
16025
- return db;
16026
- })();
16027
- return this.db;
16028
- }
16029
- /**
16030
- * 打开表
16031
- * tip: db.close() 执行后
16032
- * db打开后的表os对象仍可写入(浏览器支持,fake-indexeddb不支持)
16033
- * 不过正常理解也应该操作所有后再关闭,这里不修改`this.db -> this.os`的逻辑
16034
- * @param mode ~
16035
- * @returns ~
16036
- */
16037
- async openObjectStore(mode) {
16038
- const { storeName } = this.options;
16039
- const db = await this.openDatabase();
16040
- const os = db.transaction([storeName], mode || "readwrite").objectStore(storeName);
16041
- return os;
16042
- }
16043
- /**
16044
- * 删库
16045
- */
16046
- async deleteDatabase() {
16047
- const { name } = this.options;
16048
- const request = window.indexedDB.deleteDatabase(name);
16049
- await new Promise((resolve, reject) => {
16050
- request.onsuccess = resolve;
16051
- request.onerror = reject;
16052
- });
16053
- }
16054
- /**
16055
- * 新增数据,通过事务完成。
16056
- * @param data ~
16057
- * @returns ~
16058
- */
16059
- write(data) {
16060
- return this.concurrent(async () => {
16061
- const { keyPath } = this.options;
16062
- const os = await this.openObjectStore();
16063
- const state = {
16064
- [keyPath]: this.getUid(),
16065
- ...data
16066
- };
16067
- const request = os.add(state);
16068
- await new Promise((resolve, reject) => {
16069
- request.onsuccess = resolve;
16070
- request.onerror = reject;
16071
- });
16072
- return state;
16073
- });
16074
- }
16075
- /**
16076
- * 读取数据,通过事务完成。
16077
- * @param id ~
16078
- * @returns ~
16079
- */
16080
- read(id) {
16081
- return this.concurrent(async () => {
16082
- const os = await this.openObjectStore();
16083
- const request = os.get(id);
16084
- await this.task(request);
16085
- return request.result;
16086
- });
16087
- }
16088
- /**
16089
- * 更新数据,通过事务完成。
16090
- * @param id ~
16091
- * @param data ~
16092
- * @returns ~
16093
- */
16094
- update(id, data) {
16095
- return this.concurrent(async () => {
16096
- const { keyPath } = this.options;
16097
- const os = await this.openObjectStore();
16098
- const state = {
16099
- [keyPath]: id,
16100
- ...data
16101
- };
16102
- const request = os.put(state);
16103
- await this.task(request);
16104
- return state;
16105
- });
16106
- }
16107
- /**
16108
- * 删除数据也是通过事务完成。
16109
- * @param id ~
16110
- * @returns ~
16111
- */
16112
- async delete(id) {
16113
- return this.concurrent(async () => {
16114
- const os = await this.openObjectStore();
16115
- const request = os.delete(id);
16116
- await this.task(request);
16117
- });
16118
- }
16119
- /**
16120
- * 搜索数据,通过事务完成。
16121
- * @returns ~
16122
- */
16123
- search() {
16124
- return this.concurrent(async () => {
16125
- const os = await this.openObjectStore();
16126
- const request = os.openCursor();
16127
- const rowData = [];
16128
- await new Promise((resolve, reject) => {
16129
- request.onsuccess = () => {
16130
- const cursor = request.result;
16131
- if (cursor) {
16132
- rowData.push(cursor.value);
16133
- cursor.continue();
16134
- } else {
16135
- resolve(rowData);
16136
- }
16137
- };
16138
- request.onerror = reject;
16139
- });
16140
- return rowData;
16141
- });
16142
- }
16143
- // 同Stoage / Cookie使用api
16144
- async get(key) {
16145
- if (!ALLOW)
16146
- return null;
16147
- const v = await this.read(key);
16148
- return this.options.get(!v ? null : v.data);
16149
- }
16150
- async set(key, value) {
16151
- if (!ALLOW)
16152
- return;
16153
- await this.update(key, {
16154
- data: this.options.set(typeof value === "string" ? value : JSON.stringify(value))
16155
- });
16156
- }
16157
- async remove(key) {
16158
- if (!ALLOW)
16159
- return;
16160
- await this.delete(key);
16161
- }
16162
- }
16163
- new IndexedDBStore();
16164
-
16165
- class IMGStore {
16166
- map;
16167
- constructor() {
16168
- this.map = Storage$1.get("@wya/vc-img:", { session: true }) || {};
16169
- }
16170
- add(src, opts = {}) {
16171
- const { originW, originH } = opts;
16172
- if (this.map[src] && originW && originH) return;
16173
- this.map[src] = {
16174
- originW,
16175
- originH
16176
- };
16177
- Storage$1.set("@wya/vc-img:", this.map, { session: true });
16178
- }
16179
- getSize(src, opts = {}) {
16180
- const { clientW, clientH, style, wrapperW } = opts;
16181
- if (!this.map[src]) return {};
16182
- const { originW, originH } = this.map[src];
16183
- if (style.width && clientW > 1) {
16184
- return {
16185
- w: clientW,
16186
- h: clientW / originW * originH
16187
- };
16188
- } else if (style.height && clientH > 1) {
16189
- return {
16190
- w: clientH / originH * originW,
16191
- h: clientH
16192
- };
16193
- } else if (wrapperW && !style.height && !style.width) {
16194
- if (originW <= wrapperW) {
16195
- return {
16196
- w: originW,
16197
- h: originH
16198
- };
16199
- } else {
16200
- return {
16201
- w: wrapperW / originW * originW,
16202
- h: wrapperW / originW * originH
16203
- };
16204
- }
16205
- } else {
16206
- return {
16207
- w: originW,
16208
- h: originH
16209
- };
16210
- }
16211
- }
16212
- }
16213
- const IMGStore$1 = new IMGStore();
16214
-
16215
- /** @jsxImportSource vue */
16216
-
16217
- const COMPONENT_NAME$W = 'vc-image';
16218
- let isSupportObjectFit = false;
16219
- window.addEventListener('DOMContentLoaded', () => {
16220
- isSupportObjectFit = !IS_SERVER$2 && document.documentElement.style.objectFit !== undefined;
16221
- });
16222
- const ObjectFit = {
16223
- NONE: 'none',
16224
- CONTAIN: 'contain',
16225
- COVER: 'cover',
16226
- FILL: 'fill',
16227
- SCALE_DOWN: 'scale-down'
16228
- };
16229
- const Image$1 = /* @__PURE__ */ vue.defineComponent({
16230
- name: COMPONENT_NAME$W,
16231
- inheritAttrs: false,
16232
- props: props$H,
16233
- setup(props, {
16234
- slots,
16235
- emit
16236
- }) {
16237
- const instance = vue.getCurrentInstance();
16238
- const its = useAttrs({
16239
- merge: false,
16240
- exclude: ['onLoad', 'onError']
16241
- });
16242
- const isLoading = vue.ref(true);
16243
- const isError = vue.ref(false);
16244
- const isActive = vue.ref(!props.lazy);
16245
- const isAuto = vue.ref(false);
16246
- const originW = vue.ref(0);
16247
- const originH = vue.ref(0);
16248
- const pStyle = vue.ref({});
16249
- const scroller = vue.ref(null);
16250
- const setScroller = () => {
16251
- const {
16252
- wrapper
16253
- } = props;
16254
- if (typeof wrapper === 'object') {
16255
- scroller.value = wrapper;
16256
- } else if (typeof wrapper === 'string') {
16257
- scroller.value = document.querySelector(wrapper);
16258
- } else {
16259
- scroller.value = getScroller(instance.vnode.el);
16260
- }
16261
- };
16262
- const initPlaceholder = () => {
16263
- isAuto.value = instance.vnode.el.clientHeight === 1 || instance.vnode.el.clientWidth === 1;
16264
-
16265
- // el上是否有width和height
16266
- const {
16267
- width,
16268
- height
16269
- } = instance.vnode.el.style;
16270
- if (width && height) return;
16271
- const {
16272
- w,
16273
- h
16274
- } = IMGStore$1.getSize(props.src, {
16275
- clientW: instance.vnode.el.clientWidth,
16276
- clientH: instance.vnode.el.clientHeight,
16277
- style: {
16278
- width,
16279
- height
16280
- },
16281
- wrapperW: scroller.value && scroller.value.clientWidth,
16282
- // TODO
16283
- wrapperH: scroller.value && scroller.value.clientHeight
16284
- });
16285
- if (w && h) {
16286
- pStyle.value = {
16287
- width: `${w}px`,
16288
- height: `${h}px`
16289
- };
16290
- }
16291
- };
16292
- let handleLazyLoad;
16293
- const removeLazyLoadListener = () => {
16294
- if (!scroller.value || !handleLazyLoad) return;
16295
- scroller.value.removeEventListener('scroll', handleLazyLoad);
16296
- scroller.value = null;
16297
- handleLazyLoad = null;
16298
- };
16299
- const addLazyLoadListener = () => {
16300
- if (scroller.value) {
16301
- handleLazyLoad = throttle$2(() => {
16302
- if (contains(scroller.value, instance.vnode.el)) {
16303
- isActive.value = true;
16304
- removeLazyLoadListener();
16305
- }
16306
- }, 200);
16307
- scroller.value.addEventListener('scroll', handleLazyLoad);
16308
- handleLazyLoad();
16309
- }
16310
- };
16311
- const handleLoad = (e, img) => {
16312
- originW.value = img.naturalWidth || img.width;
16313
- originH.value = img.naturalHeight || img.height;
16314
- isLoading.value = false;
16315
- emit('load', e, img, instance);
16316
- IMGStore$1.add(props.src, {
16317
- originW: originW.value,
16318
- originH: originH.value
16319
- });
16320
- };
16321
- const handleError = (e, img) => {
16322
- isLoading.value = false;
16323
- isError.value = true;
16324
- emit('error', e, img, instance);
16325
- };
16326
- const loadImage = () => {
16327
- if (!props.src) return;
16328
- // reset status
16329
- isLoading.value = true;
16330
- isError.value = false;
16331
- const img = new window.Image();
16332
- img.onload = e => handleLoad(e, img);
16333
- img.onerror = e => handleError(e, img);
16334
-
16335
- // bind html attrs
16336
- Object.keys(its.value.attrs || {}).forEach(key => img.setAttribute(key, its.value.attrs[key]));
16337
- img.src = props.src;
16338
- };
16339
- const hackFit = fit => {
16340
- const {
16341
- clientWidth: elW,
16342
- clientHeight: elH
16343
- } = instance.vnode.el;
16344
- if (!originW.value || !originH.value || !elW || !elH) return {};
16345
- const vertical = originW.value / originH.value < 1;
16346
- if (fit === ObjectFit.SCALE_DOWN) {
16347
- const isSmaller = originW.value < elW && originH.value < elH;
16348
- fit = isSmaller ? ObjectFit.NONE : ObjectFit.CONTAIN;
16349
- }
16350
- switch (fit) {
16351
- case ObjectFit.NONE:
16352
- return {
16353
- width: 'auto',
16354
- height: 'auto'
16355
- };
16356
- case ObjectFit.CONTAIN:
16357
- return vertical ? {
16358
- width: 'auto'
16359
- } : {
16360
- height: 'auto'
16361
- };
16362
- case ObjectFit.COVER:
16363
- return vertical ? {
16364
- height: 'auto'
16365
- } : {
16366
- width: 'auto'
16367
- };
16368
- default:
16369
- return {};
16370
- }
16371
- };
16372
- const style = vue.computed(() => {
16373
- if (!props.fit) return;
16374
- return isSupportObjectFit ? {
16375
- 'object-fit': props.fit
16376
- } : hackFit(props.fit);
16377
- });
16378
- const alignCenter = vue.computed(() => {
16379
- return !isSupportObjectFit && props.fit !== ObjectFit.FILL;
16380
- });
16381
- vue.watch(() => props.src, v => {
16382
- if (!v && !isLoading.value) {
16383
- isLoading.value = true;
16384
- }
16385
- isActive.value && loadImage();
16386
- });
16387
- vue.watch(() => isActive.value, v => {
16388
- v && loadImage();
16389
- });
16390
- vue.onMounted(() => {
16391
- setScroller();
16392
- initPlaceholder();
16393
- props.lazy ? addLazyLoadListener() : loadImage();
16394
- });
16395
- vue.onBeforeUnmount(() => {
16396
- props.lazy && removeLazyLoadListener();
16397
- });
16398
- return () => {
16399
- return vue.createVNode("div", {
16400
- "style": its.value.style,
16401
- "class": [its.value.class, 'vc-image']
16402
- }, [isLoading.value && (slots.placeholder ? slots.placeholder() : vue.createVNode("div", {
16403
- "class": [{
16404
- 'is-auto': isAuto.value
16405
- }, 'vc-image__placeholder'],
16406
- "style": pStyle.value
16407
- }, null)), !isLoading.value && isError.value && (slots.error ? slots.error() : vue.createVNode("div", {
16408
- "class": "vc-image__error"
16409
- }, [vue.createTextVNode(" \u52A0\u8F7D\u5931\u8D25")])), !isLoading.value && !isError.value && vue.createVNode("img", vue.mergeProps({
16410
- "src": props.src,
16411
- "style": style.value,
16412
- "class": [{
16413
- 'is-center': alignCenter
16414
- }, 'vc-image__inner']
16415
- }, {
16416
- // 包含所有on*都会被绑定, 且listeners中覆盖将由listener内触发(inheritAttrs: false)
16417
- ...its.value.attrs,
16418
- ...its.value.listeners
16419
- }), null)]);
16420
- };
16421
- }
16422
- });
16423
-
16424
- const MImage = Image$1;
16425
-
16426
- const props$G = {
16427
- tag: {
16428
- type: String,
16429
- default: "div"
16430
- }
16431
- };
16432
-
16433
- /** @jsxImportSource vue */
16434
-
16435
- const COMPONENT_NAME$V = 'vc-image-crop';
16436
- const ImageCrop = /* @__PURE__ */ vue.defineComponent({
16437
- name: COMPONENT_NAME$V,
16438
- props: props$G,
16439
- setup(props, {
16440
- slots
16441
- }) {
16442
- return () => {
16443
- return vue.createVNode("div", {
16444
- "class": "vc-image-crop"
16445
- }, [slots?.default?.()]);
16446
- };
16447
- }
16448
- });
16449
-
16450
- const MImageCrop = ImageCrop;
16451
-
16452
- const props$F = {
16453
- tag: {
16454
- type: String,
16455
- default: "div"
16456
- }
16457
- };
16458
-
16459
- /** @jsxImportSource vue */
16460
-
16461
- const COMPONENT_NAME$U = 'vc-image-preview';
16462
- const ImagePreview$1 = /* @__PURE__ */ vue.defineComponent({
16463
- name: COMPONENT_NAME$U,
16464
- props: props$F,
16465
- setup(props, {
16466
- slots
16467
- }) {
16468
- return () => {
16469
- return vue.createVNode("div", {
16470
- "class": "vc-image-preview"
16471
- }, [slots?.default?.()]);
16472
- };
16473
- }
16474
- });
16475
-
16476
- /*!
16477
- * PhotoSwipe Lightbox 5.4.4 - https://photoswipe.com
16478
- * (c) 2024 Dmytro Semenov
16479
- */
16480
- /** @typedef {import('../photoswipe.js').Point} Point */
16481
-
16482
- /**
16483
- * @template {keyof HTMLElementTagNameMap} T
16484
- * @param {string} className
16485
- * @param {T} tagName
16486
- * @param {Node} [appendToEl]
16487
- * @returns {HTMLElementTagNameMap[T]}
16488
- */
16489
- function createElement$2(className, tagName, appendToEl) {
16490
- const el = document.createElement(tagName);
16491
-
16492
- if (className) {
16493
- el.className = className;
16494
- }
16495
-
16496
- if (appendToEl) {
16497
- appendToEl.appendChild(el);
16498
- }
16499
-
16500
- return el;
16501
- }
16502
- /**
16503
- * Get transform string
16504
- *
16505
- * @param {number} x
16506
- * @param {number} [y]
16507
- * @param {number} [scale]
16508
- * @returns {string}
16509
- */
16510
-
16511
- function toTransformString$1(x, y, scale) {
16512
- let propValue = `translate3d(${x}px,${0}px,0)`;
16513
-
16514
- if (scale !== undefined) {
16515
- propValue += ` scale3d(${scale},${scale},1)`;
16516
- }
16517
-
16518
- return propValue;
16519
- }
16520
- /**
16521
- * Apply width and height CSS properties to element
16522
- *
16523
- * @param {HTMLElement} el
16524
- * @param {string | number} w
16525
- * @param {string | number} h
16526
- */
16527
-
16528
- function setWidthHeight$1(el, w, h) {
16529
- el.style.width = typeof w === 'number' ? `${w}px` : w;
16530
- el.style.height = typeof h === 'number' ? `${h}px` : h;
16531
- }
16532
- /** @typedef {LOAD_STATE[keyof LOAD_STATE]} LoadState */
16533
-
16534
- /** @type {{ IDLE: 'idle'; LOADING: 'loading'; LOADED: 'loaded'; ERROR: 'error' }} */
16535
-
16536
- const LOAD_STATE$1 = {
16537
- IDLE: 'idle',
16538
- LOADING: 'loading',
16539
- LOADED: 'loaded',
16540
- ERROR: 'error'
16541
- };
16542
- /**
16543
- * Check if click or keydown event was dispatched
16544
- * with a special key or via mouse wheel.
16545
- *
16546
- * @param {MouseEvent | KeyboardEvent} e
16547
- * @returns {boolean}
16548
- */
16549
-
16550
- function specialKeyUsed$1(e) {
16551
- return 'button' in e && e.button === 1 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey;
16552
- }
16553
- /**
16554
- * Parse `gallery` or `children` options.
16555
- *
16556
- * @param {import('../photoswipe.js').ElementProvider} [option]
16557
- * @param {string} [legacySelector]
16558
- * @param {HTMLElement | Document} [parent]
16559
- * @returns HTMLElement[]
16560
- */
16561
-
16562
- function getElementsFromOption$1(option, legacySelector, parent = document) {
16563
- /** @type {HTMLElement[]} */
16564
- let elements = [];
16565
-
16566
- if (option instanceof Element) {
16567
- elements = [option];
16568
- } else if (option instanceof NodeList || Array.isArray(option)) {
16569
- elements = Array.from(option);
16570
- } else {
16571
- const selector = typeof option === 'string' ? option : legacySelector;
16572
-
16573
- if (selector) {
16574
- elements = Array.from(parent.querySelectorAll(selector));
15886
+ function getElementsFromOption$1(option, legacySelector, parent = document) {
15887
+ /** @type {HTMLElement[]} */
15888
+ let elements = [];
15889
+
15890
+ if (option instanceof Element) {
15891
+ elements = [option];
15892
+ } else if (option instanceof NodeList || Array.isArray(option)) {
15893
+ elements = Array.from(option);
15894
+ } else {
15895
+ const selector = typeof option === 'string' ? option : legacySelector;
15896
+
15897
+ if (selector) {
15898
+ elements = Array.from(parent.querySelectorAll(selector));
16575
15899
  }
16576
15900
  }
16577
15901
 
@@ -18366,145 +17690,837 @@
18366
17690
  if (window.pswp) {
18367
17691
  return;
18368
17692
  }
18369
- /**
18370
- * Pass data to PhotoSwipe and open init
18371
- *
18372
- * @type {PhotoSwipe}
18373
- */
18374
-
18375
-
18376
- const pswp = typeof module === 'object' ? new module.default(this.options) // eslint-disable-line
18377
- : new module(this.options); // eslint-disable-line
18378
-
18379
- this.pswp = pswp;
18380
- window.pswp = pswp; // map listeners from Lightbox to PhotoSwipe Core
17693
+ /**
17694
+ * Pass data to PhotoSwipe and open init
17695
+ *
17696
+ * @type {PhotoSwipe}
17697
+ */
17698
+
17699
+
17700
+ const pswp = typeof module === 'object' ? new module.default(this.options) // eslint-disable-line
17701
+ : new module(this.options); // eslint-disable-line
17702
+
17703
+ this.pswp = pswp;
17704
+ window.pswp = pswp; // map listeners from Lightbox to PhotoSwipe Core
17705
+
17706
+ /** @type {(keyof PhotoSwipeEventsMap)[]} */
17707
+
17708
+ Object.keys(this._listeners).forEach(name => {
17709
+ var _this$_listeners$name;
17710
+
17711
+ (_this$_listeners$name = this._listeners[name]) === null || _this$_listeners$name === void 0 || _this$_listeners$name.forEach(fn => {
17712
+ pswp.on(name,
17713
+ /** @type {EventCallback<typeof name>} */
17714
+ fn);
17715
+ });
17716
+ }); // same with filters
17717
+
17718
+ /** @type {(keyof PhotoSwipeFiltersMap)[]} */
17719
+
17720
+ Object.keys(this._filters).forEach(name => {
17721
+ var _this$_filters$name;
17722
+
17723
+ (_this$_filters$name = this._filters[name]) === null || _this$_filters$name === void 0 || _this$_filters$name.forEach(filter => {
17724
+ pswp.addFilter(name, filter.fn, filter.priority);
17725
+ });
17726
+ });
17727
+
17728
+ if (this._preloadedContent) {
17729
+ pswp.contentLoader.addToCache(this._preloadedContent);
17730
+ this._preloadedContent = undefined;
17731
+ }
17732
+
17733
+ pswp.on('destroy', () => {
17734
+ // clean up public variables
17735
+ this.pswp = undefined;
17736
+ delete window.pswp;
17737
+ });
17738
+ pswp.init();
17739
+ }
17740
+ /**
17741
+ * Unbinds all events, closes PhotoSwipe if it's open.
17742
+ */
17743
+
17744
+
17745
+ destroy() {
17746
+ var _this$pswp;
17747
+
17748
+ (_this$pswp = this.pswp) === null || _this$pswp === void 0 || _this$pswp.destroy();
17749
+ this.shouldOpen = false;
17750
+ this._listeners = {};
17751
+ getElementsFromOption$1(this.options.gallery, this.options.gallerySelector).forEach(galleryElement => {
17752
+ galleryElement.removeEventListener('click', this.onThumbnailsClick, false);
17753
+ });
17754
+ }
17755
+
17756
+ }
17757
+
17758
+ const MAX_WIDTH = window.innerWidth;
17759
+ const MAX_HEIGHT = window.innerHeight;
17760
+ const getFitSize = (src) => {
17761
+ return new Promise((resolve) => {
17762
+ const img = new Image();
17763
+ let width;
17764
+ let height;
17765
+ img.onload = () => {
17766
+ const owidth = img.naturalWidth || img.width;
17767
+ const oheight = img.naturalHeight || img.height;
17768
+ if (owidth > oheight) {
17769
+ width = Math.min(MAX_WIDTH, owidth);
17770
+ height = width / owidth * oheight;
17771
+ resolve({
17772
+ width,
17773
+ height
17774
+ });
17775
+ } else {
17776
+ height = Math.min(MAX_HEIGHT, oheight);
17777
+ width = height / oheight * owidth;
17778
+ resolve({
17779
+ width,
17780
+ height
17781
+ });
17782
+ }
17783
+ };
17784
+ img.onerror = () => resolve({});
17785
+ img.src = src;
17786
+ });
17787
+ };
17788
+ const open$1 = async (options) => {
17789
+ const e = VcInstance.globalEvent;
17790
+ const data = options.data.map((i) => {
17791
+ if (typeof i === "string") {
17792
+ return {
17793
+ src: i
17794
+ };
17795
+ }
17796
+ return {
17797
+ ...i,
17798
+ src: i.source || i.src
17799
+ };
17800
+ });
17801
+ for (let i = 0; i < data.length; i++) {
17802
+ if (!data[i].width) {
17803
+ data[i] = {
17804
+ ...data[i],
17805
+ ...await getFitSize(data[i].src)
17806
+ };
17807
+ }
17808
+ }
17809
+ const lightbox = new PhotoSwipeLightbox({
17810
+ pswpModule: () => Promise.resolve().then(() => photoswipe_esm),
17811
+ closeTitle: "关闭(Esc)",
17812
+ zoomTitle: "缩放",
17813
+ arrowPrevTitle: "上一张",
17814
+ arrowNextTitle: "下一张",
17815
+ errorMsg: "网络异常 图片加载失败",
17816
+ indexIndicatorSep: " / ",
17817
+ initialZoomLevel: "fit"
17818
+ });
17819
+ lightbox.init();
17820
+ lightbox.loadAndOpen(
17821
+ options.current || 0,
17822
+ data,
17823
+ // 下面无效,需要给官方支持
17824
+ {
17825
+ x: e?.clientX,
17826
+ y: e?.clientY
17827
+ }
17828
+ );
17829
+ };
17830
+
17831
+ const ImagePreview = Object.assign(ImagePreview$1, { open: open$1 });
17832
+
17833
+ const props$G = {
17834
+ src: String,
17835
+ fit: String,
17836
+ lazy: Boolean,
17837
+ wrapper: [Object, String],
17838
+ previewable: {
17839
+ type: Boolean,
17840
+ default: true
17841
+ }
17842
+ };
17843
+
17844
+ class ACache {
17845
+ options;
17846
+ constructor() {
17847
+ this.options = {
17848
+ version: "",
17849
+ get: (v) => flattenJSONParse(v),
17850
+ set: (v) => v
17851
+ };
17852
+ }
17853
+ configure(options) {
17854
+ if (typeof window === "undefined")
17855
+ return;
17856
+ this.options = {
17857
+ ...this.options,
17858
+ ...options
17859
+ };
17860
+ }
17861
+ }
17862
+
17863
+ (() => {
17864
+ try {
17865
+ document.cookie = "test";
17866
+ return true;
17867
+ } catch (_) {
17868
+ return false;
17869
+ }
17870
+ })();
17871
+
17872
+ class MemoryStorage {
17873
+ store = {};
17874
+ getItem(key) {
17875
+ return this.store[key] || null;
17876
+ }
17877
+ setItem(key, val) {
17878
+ this.store[key] = val;
17879
+ }
17880
+ removeItem(key) {
17881
+ delete this.store[key];
17882
+ }
17883
+ }
17884
+
17885
+ const PREFIX_NAME = "@deot/helper/";
17886
+ const formatKey = (key, version) => {
17887
+ return `${version ? `${PREFIX_NAME}${version}:` : ""}${key}`;
17888
+ };
17889
+ const ALLOW$1 = (() => {
17890
+ const test = "test";
17891
+ try {
17892
+ window.localStorage.setItem(test, test);
17893
+ window.localStorage.removeItem(test);
17894
+ return true;
17895
+ } catch (_) {
17896
+ return false;
17897
+ }
17898
+ })();
17899
+ class StorageStore extends ACache {
17900
+ sessionStorage = new MemoryStorage();
17901
+ localStorage = new MemoryStorage();
17902
+ getInvoke(options) {
17903
+ return options?.session ? "sessionStorage" : "localStorage";
17904
+ }
17905
+ configure(options) {
17906
+ super.configure(options);
17907
+ if (!ALLOW$1)
17908
+ return;
17909
+ const { version } = this.options;
17910
+ Object.keys(window.localStorage).forEach((item) => {
17911
+ /* istanbul ignore else -- @preserve */
17912
+ if (item.includes(PREFIX_NAME) && !item.includes(`${PREFIX_NAME}${version}`)) {
17913
+ window.localStorage.removeItem(item);
17914
+ }
17915
+ });
17916
+ }
17917
+ /**
17918
+ * 设置缓存
17919
+ * @param key 保存的键值
17920
+ * @param value 保存的内容
17921
+ * @param options ~
17922
+ */
17923
+ set(key, value, options) {
17924
+ if (!ALLOW$1)
17925
+ return;
17926
+ const invoke = this.getInvoke(options);
17927
+ key = formatKey(key, this.options.version);
17928
+ value = this.options.set(typeof value === "string" ? value : JSON.stringify(value));
17929
+ try {
17930
+ window[invoke].setItem(key, value);
17931
+ } catch (error) {
17932
+ this[invoke].setItem(key, value);
17933
+ }
17934
+ }
17935
+ /**
17936
+ * 获取缓存
17937
+ * @param key 保存的键值
17938
+ * @param options ~
17939
+ * @returns ~
17940
+ */
17941
+ get(key, options) {
17942
+ if (!ALLOW$1)
17943
+ return null;
17944
+ const invoke = this.getInvoke(options);
17945
+ key = formatKey(key, this.options.version);
17946
+ const value = this[invoke].getItem(key) || window[invoke].getItem(key);
17947
+ return this.options.get(value);
17948
+ }
17949
+ /**
17950
+ * 删除缓存
17951
+ * @param key 键值
17952
+ * @param options ~
17953
+ */
17954
+ remove(key, options) {
17955
+ if (!ALLOW$1)
17956
+ return;
17957
+ const invoke = this.getInvoke(options);
17958
+ key = formatKey(key, this.options.version);
17959
+ this[invoke].removeItem(key);
17960
+ window[invoke].removeItem(key);
17961
+ }
17962
+ }
17963
+ const Storage$1 = new StorageStore();
17964
+
17965
+ const ALLOW = (() => {
17966
+ try {
17967
+ window.indexedDB.open;
17968
+ return true;
17969
+ } catch (_) {
17970
+ return false;
17971
+ }
17972
+ })();
17973
+ class IndexedDBStore extends ACache {
17974
+ timestramp = (/* @__PURE__ */ new Date()).getTime();
17975
+ count = 0;
17976
+ db = null;
17977
+ pending = [];
17978
+ constructor(options) {
17979
+ super();
17980
+ this.options = {
17981
+ ...this.options,
17982
+ keyPath: "__id",
17983
+ name: "default-db",
17984
+ storeName: "default-store",
17985
+ version: 1
17986
+ };
17987
+ options && this.configure(options);
17988
+ }
17989
+ getUid() {
17990
+ return `${this.timestramp}${this.count++}`;
17991
+ }
17992
+ configure(options) {
17993
+ super.configure(options);
17994
+ if (typeof this.options.version === "string") {
17995
+ this.options.version = parseInt(this.options.version, 10);
17996
+ }
17997
+ }
17998
+ /**
17999
+ * 每次操作完要关闭
18000
+ * 1. 浏览器上不关闭的话,删库操作会卡一会
18001
+ * 2. fake-indexeddb不关闭会卡死
18002
+ * @param fn ~
18003
+ * @returns ~
18004
+ */
18005
+ concurrent(fn) {
18006
+ const target = new Promise((resolve, reject) => {
18007
+ fn().then(resolve).catch(reject);
18008
+ });
18009
+ this.pending.push(target);
18010
+ target.finally(() => this.close(target));
18011
+ return target;
18012
+ }
18013
+ /**
18014
+ * 统一处理
18015
+ * @param request ~
18016
+ * @returns ~
18017
+ */
18018
+ async task(request) {
18019
+ return new Promise((resolve, reject) => {
18020
+ request.onsuccess = resolve;
18021
+ request.onerror = reject;
18022
+ });
18023
+ }
18024
+ /**
18025
+ * @param target ~
18026
+ */
18027
+ async close(target) {
18028
+ if (target) {
18029
+ this.pending = this.pending.filter((i) => i !== target);
18030
+ } else {
18031
+ const done = async (pending) => {
18032
+ if (pending.length) {
18033
+ await Promise.allSettled(pending);
18034
+ await done(this.pending);
18035
+ }
18036
+ };
18037
+ await done(this.pending);
18038
+ }
18039
+ if (!this.pending.length && this.db) {
18040
+ const db = this.db;
18041
+ this.db = null;
18042
+ (await db).close();
18043
+ }
18044
+ }
18045
+ /**
18046
+ * 打开数据库。变更时候更新表
18047
+ * @returns ~
18048
+ */
18049
+ openDatabase() {
18050
+ this.db = this.db || (async () => {
18051
+ const { name, version, keyPath, storeName } = this.options;
18052
+ const poll = () => new Promise((resolve, reject) => {
18053
+ const request = window.indexedDB.open(name, version);
18054
+ request.onsuccess = () => {
18055
+ resolve(request.result);
18056
+ };
18057
+ request.onerror = /* istanbul ignore next */
18058
+ () => {
18059
+ reject(new Error("IndexedDB Open Failed. DeleteDatabase first!"));
18060
+ };
18061
+ request.onupgradeneeded = () => {
18062
+ const db2 = request.result;
18063
+ if (db2.objectStoreNames.contains(storeName)) {
18064
+ db2.deleteObjectStore(storeName);
18065
+ }
18066
+ db2.createObjectStore(storeName, { keyPath });
18067
+ };
18068
+ });
18069
+ const maxTries = 3;
18070
+ let db;
18071
+ for (let tries = 0; tries < maxTries; tries++) {
18072
+ try {
18073
+ db = await poll();
18074
+ } catch (_) {
18075
+ }
18076
+ /* istanbul ignore next -- @preserve */
18077
+ if (db || tries === maxTries - 1) {
18078
+ break;
18079
+ }
18080
+ }
18081
+ /* istanbul ignore next -- @preserve */
18082
+ if (!db) {
18083
+ await this.deleteDatabase();
18084
+ db = await poll();
18085
+ }
18086
+ return db;
18087
+ })();
18088
+ return this.db;
18089
+ }
18090
+ /**
18091
+ * 打开表
18092
+ * tip: db.close() 执行后
18093
+ * db打开后的表os对象仍可写入(浏览器支持,fake-indexeddb不支持)
18094
+ * 不过正常理解也应该操作所有后再关闭,这里不修改`this.db -> this.os`的逻辑
18095
+ * @param mode ~
18096
+ * @returns ~
18097
+ */
18098
+ async openObjectStore(mode) {
18099
+ const { storeName } = this.options;
18100
+ const db = await this.openDatabase();
18101
+ const os = db.transaction([storeName], mode || "readwrite").objectStore(storeName);
18102
+ return os;
18103
+ }
18104
+ /**
18105
+ * 删库
18106
+ */
18107
+ async deleteDatabase() {
18108
+ const { name } = this.options;
18109
+ const request = window.indexedDB.deleteDatabase(name);
18110
+ await new Promise((resolve, reject) => {
18111
+ request.onsuccess = resolve;
18112
+ request.onerror = reject;
18113
+ });
18114
+ }
18115
+ /**
18116
+ * 新增数据,通过事务完成。
18117
+ * @param data ~
18118
+ * @returns ~
18119
+ */
18120
+ write(data) {
18121
+ return this.concurrent(async () => {
18122
+ const { keyPath } = this.options;
18123
+ const os = await this.openObjectStore();
18124
+ const state = {
18125
+ [keyPath]: this.getUid(),
18126
+ ...data
18127
+ };
18128
+ const request = os.add(state);
18129
+ await new Promise((resolve, reject) => {
18130
+ request.onsuccess = resolve;
18131
+ request.onerror = reject;
18132
+ });
18133
+ return state;
18134
+ });
18135
+ }
18136
+ /**
18137
+ * 读取数据,通过事务完成。
18138
+ * @param id ~
18139
+ * @returns ~
18140
+ */
18141
+ read(id) {
18142
+ return this.concurrent(async () => {
18143
+ const os = await this.openObjectStore();
18144
+ const request = os.get(id);
18145
+ await this.task(request);
18146
+ return request.result;
18147
+ });
18148
+ }
18149
+ /**
18150
+ * 更新数据,通过事务完成。
18151
+ * @param id ~
18152
+ * @param data ~
18153
+ * @returns ~
18154
+ */
18155
+ update(id, data) {
18156
+ return this.concurrent(async () => {
18157
+ const { keyPath } = this.options;
18158
+ const os = await this.openObjectStore();
18159
+ const state = {
18160
+ [keyPath]: id,
18161
+ ...data
18162
+ };
18163
+ const request = os.put(state);
18164
+ await this.task(request);
18165
+ return state;
18166
+ });
18167
+ }
18168
+ /**
18169
+ * 删除数据也是通过事务完成。
18170
+ * @param id ~
18171
+ * @returns ~
18172
+ */
18173
+ async delete(id) {
18174
+ return this.concurrent(async () => {
18175
+ const os = await this.openObjectStore();
18176
+ const request = os.delete(id);
18177
+ await this.task(request);
18178
+ });
18179
+ }
18180
+ /**
18181
+ * 搜索数据,通过事务完成。
18182
+ * @returns ~
18183
+ */
18184
+ search() {
18185
+ return this.concurrent(async () => {
18186
+ const os = await this.openObjectStore();
18187
+ const request = os.openCursor();
18188
+ const rowData = [];
18189
+ await new Promise((resolve, reject) => {
18190
+ request.onsuccess = () => {
18191
+ const cursor = request.result;
18192
+ if (cursor) {
18193
+ rowData.push(cursor.value);
18194
+ cursor.continue();
18195
+ } else {
18196
+ resolve(rowData);
18197
+ }
18198
+ };
18199
+ request.onerror = reject;
18200
+ });
18201
+ return rowData;
18202
+ });
18203
+ }
18204
+ // 同Stoage / Cookie使用api
18205
+ async get(key) {
18206
+ if (!ALLOW)
18207
+ return null;
18208
+ const v = await this.read(key);
18209
+ return this.options.get(!v ? null : v.data);
18210
+ }
18211
+ async set(key, value) {
18212
+ if (!ALLOW)
18213
+ return;
18214
+ await this.update(key, {
18215
+ data: this.options.set(typeof value === "string" ? value : JSON.stringify(value))
18216
+ });
18217
+ }
18218
+ async remove(key) {
18219
+ if (!ALLOW)
18220
+ return;
18221
+ await this.delete(key);
18222
+ }
18223
+ }
18224
+ new IndexedDBStore();
18225
+
18226
+ class IMGStore {
18227
+ map;
18228
+ constructor() {
18229
+ this.map = Storage$1.get("@wya/vc-img:", { session: true }) || {};
18230
+ }
18231
+ add(src, opts = {}) {
18232
+ const { originW, originH } = opts;
18233
+ if (this.map[src] && originW && originH) return;
18234
+ this.map[src] = {
18235
+ originW,
18236
+ originH
18237
+ };
18238
+ Storage$1.set("@wya/vc-img:", this.map, { session: true });
18239
+ }
18240
+ getSize(src, opts = {}) {
18241
+ const { clientW, clientH, style, wrapperW } = opts;
18242
+ if (!this.map[src]) return {};
18243
+ const { originW, originH } = this.map[src];
18244
+ if (style.width && clientW > 1) {
18245
+ return {
18246
+ w: clientW,
18247
+ h: clientW / originW * originH
18248
+ };
18249
+ } else if (style.height && clientH > 1) {
18250
+ return {
18251
+ w: clientH / originH * originW,
18252
+ h: clientH
18253
+ };
18254
+ } else if (wrapperW && !style.height && !style.width) {
18255
+ if (originW <= wrapperW) {
18256
+ return {
18257
+ w: originW,
18258
+ h: originH
18259
+ };
18260
+ } else {
18261
+ return {
18262
+ w: wrapperW / originW * originW,
18263
+ h: wrapperW / originW * originH
18264
+ };
18265
+ }
18266
+ } else {
18267
+ return {
18268
+ w: originW,
18269
+ h: originH
18270
+ };
18271
+ }
18272
+ }
18273
+ }
18274
+ const IMGStore$1 = new IMGStore();
18381
18275
 
18382
- /** @type {(keyof PhotoSwipeEventsMap)[]} */
18276
+ /** @jsxImportSource vue */
18383
18277
 
18384
- Object.keys(this._listeners).forEach(name => {
18385
- var _this$_listeners$name;
18278
+ const COMPONENT_NAME$W = 'vc-image';
18279
+ let isSupportObjectFit = false;
18280
+ window.addEventListener('DOMContentLoaded', () => {
18281
+ isSupportObjectFit = !IS_SERVER$2 && document.documentElement.style.objectFit !== undefined;
18282
+ });
18283
+ const ObjectFit = {
18284
+ NONE: 'none',
18285
+ CONTAIN: 'contain',
18286
+ COVER: 'cover',
18287
+ FILL: 'fill',
18288
+ SCALE_DOWN: 'scale-down'
18289
+ };
18290
+ const Image$1 = /* @__PURE__ */ vue.defineComponent({
18291
+ name: COMPONENT_NAME$W,
18292
+ inheritAttrs: false,
18293
+ props: props$G,
18294
+ setup(props, {
18295
+ slots,
18296
+ emit
18297
+ }) {
18298
+ const instance = vue.getCurrentInstance();
18299
+ const its = useAttrs({
18300
+ merge: false,
18301
+ exclude: ['onLoad', 'onError']
18302
+ });
18303
+ const isLoading = vue.ref(true);
18304
+ const isError = vue.ref(false);
18305
+ const isActive = vue.ref(!props.lazy);
18306
+ const isAuto = vue.ref(false);
18307
+ const originW = vue.ref(0);
18308
+ const originH = vue.ref(0);
18309
+ const pStyle = vue.ref({});
18310
+ const scroller = vue.ref(null);
18311
+ const setScroller = () => {
18312
+ const {
18313
+ wrapper
18314
+ } = props;
18315
+ if (typeof wrapper === 'object') {
18316
+ scroller.value = wrapper;
18317
+ } else if (typeof wrapper === 'string') {
18318
+ scroller.value = document.querySelector(wrapper);
18319
+ } else {
18320
+ scroller.value = getScroller(instance.vnode.el);
18321
+ }
18322
+ };
18323
+ const initPlaceholder = () => {
18324
+ isAuto.value = instance.vnode.el.clientHeight === 1 || instance.vnode.el.clientWidth === 1;
18386
18325
 
18387
- (_this$_listeners$name = this._listeners[name]) === null || _this$_listeners$name === void 0 || _this$_listeners$name.forEach(fn => {
18388
- pswp.on(name,
18389
- /** @type {EventCallback<typeof name>} */
18390
- fn);
18326
+ // el上是否有width和height
18327
+ const {
18328
+ width,
18329
+ height
18330
+ } = instance.vnode.el.style;
18331
+ if (width && height) return;
18332
+ const {
18333
+ w,
18334
+ h
18335
+ } = IMGStore$1.getSize(props.src, {
18336
+ clientW: instance.vnode.el.clientWidth,
18337
+ clientH: instance.vnode.el.clientHeight,
18338
+ style: {
18339
+ width,
18340
+ height
18341
+ },
18342
+ wrapperW: scroller.value && scroller.value.clientWidth,
18343
+ // TODO
18344
+ wrapperH: scroller.value && scroller.value.clientHeight
18391
18345
  });
18392
- }); // same with filters
18393
-
18394
- /** @type {(keyof PhotoSwipeFiltersMap)[]} */
18395
-
18396
- Object.keys(this._filters).forEach(name => {
18397
- var _this$_filters$name;
18346
+ if (w && h) {
18347
+ pStyle.value = {
18348
+ width: `${w}px`,
18349
+ height: `${h}px`
18350
+ };
18351
+ }
18352
+ };
18353
+ let handleLazyLoad;
18354
+ const removeLazyLoadListener = () => {
18355
+ if (!scroller.value || !handleLazyLoad) return;
18356
+ scroller.value.removeEventListener('scroll', handleLazyLoad);
18357
+ scroller.value = null;
18358
+ handleLazyLoad = null;
18359
+ };
18360
+ const addLazyLoadListener = () => {
18361
+ if (scroller.value) {
18362
+ handleLazyLoad = throttle$2(() => {
18363
+ if (contains(scroller.value, instance.vnode.el)) {
18364
+ isActive.value = true;
18365
+ removeLazyLoadListener();
18366
+ }
18367
+ }, 200);
18368
+ scroller.value.addEventListener('scroll', handleLazyLoad);
18369
+ handleLazyLoad();
18370
+ }
18371
+ };
18372
+ const handleLoad = (e, img) => {
18373
+ originW.value = img.naturalWidth || img.width;
18374
+ originH.value = img.naturalHeight || img.height;
18375
+ isLoading.value = false;
18376
+ emit('load', e, img, instance);
18377
+ IMGStore$1.add(props.src, {
18378
+ originW: originW.value,
18379
+ originH: originH.value
18380
+ });
18381
+ };
18382
+ const handleError = (e, img) => {
18383
+ isLoading.value = false;
18384
+ isError.value = true;
18385
+ emit('error', e, img, instance);
18386
+ };
18387
+ const loadImage = () => {
18388
+ if (!props.src) return;
18389
+ // reset status
18390
+ isLoading.value = true;
18391
+ isError.value = false;
18392
+ const img = new window.Image();
18393
+ img.onload = e => handleLoad(e, img);
18394
+ img.onerror = e => handleError(e, img);
18398
18395
 
18399
- (_this$_filters$name = this._filters[name]) === null || _this$_filters$name === void 0 || _this$_filters$name.forEach(filter => {
18400
- pswp.addFilter(name, filter.fn, filter.priority);
18396
+ // bind html attrs
18397
+ Object.keys(its.value.attrs || {}).forEach(key => img.setAttribute(key, its.value.attrs[key]));
18398
+ img.src = props.src;
18399
+ };
18400
+ const hackFit = fit => {
18401
+ const {
18402
+ clientWidth: elW,
18403
+ clientHeight: elH
18404
+ } = instance.vnode.el;
18405
+ if (!originW.value || !originH.value || !elW || !elH) return {};
18406
+ const vertical = originW.value / originH.value < 1;
18407
+ if (fit === ObjectFit.SCALE_DOWN) {
18408
+ const isSmaller = originW.value < elW && originH.value < elH;
18409
+ fit = isSmaller ? ObjectFit.NONE : ObjectFit.CONTAIN;
18410
+ }
18411
+ switch (fit) {
18412
+ case ObjectFit.NONE:
18413
+ return {
18414
+ width: 'auto',
18415
+ height: 'auto'
18416
+ };
18417
+ case ObjectFit.CONTAIN:
18418
+ return vertical ? {
18419
+ width: 'auto'
18420
+ } : {
18421
+ height: 'auto'
18422
+ };
18423
+ case ObjectFit.COVER:
18424
+ return vertical ? {
18425
+ height: 'auto'
18426
+ } : {
18427
+ width: 'auto'
18428
+ };
18429
+ default:
18430
+ return {};
18431
+ }
18432
+ };
18433
+ const style = vue.computed(() => {
18434
+ if (!props.fit) return;
18435
+ return isSupportObjectFit ? {
18436
+ 'object-fit': props.fit
18437
+ } : hackFit(props.fit);
18438
+ });
18439
+ const alignCenter = vue.computed(() => {
18440
+ return !isSupportObjectFit && props.fit !== ObjectFit.FILL;
18441
+ });
18442
+ const handlePreview = () => {
18443
+ if (!props.previewable) return;
18444
+ ImagePreview.open({
18445
+ current: 0,
18446
+ data: [props.src],
18447
+ onClose() {}
18401
18448
  });
18449
+ };
18450
+ vue.watch(() => props.src, v => {
18451
+ if (!v && !isLoading.value) {
18452
+ isLoading.value = true;
18453
+ }
18454
+ isActive.value && loadImage();
18402
18455
  });
18403
-
18404
- if (this._preloadedContent) {
18405
- pswp.contentLoader.addToCache(this._preloadedContent);
18406
- this._preloadedContent = undefined;
18407
- }
18408
-
18409
- pswp.on('destroy', () => {
18410
- // clean up public variables
18411
- this.pswp = undefined;
18412
- delete window.pswp;
18456
+ vue.watch(() => isActive.value, v => {
18457
+ v && loadImage();
18413
18458
  });
18414
- pswp.init();
18459
+ vue.onMounted(() => {
18460
+ setScroller();
18461
+ initPlaceholder();
18462
+ props.lazy ? addLazyLoadListener() : loadImage();
18463
+ });
18464
+ vue.onBeforeUnmount(() => {
18465
+ props.lazy && removeLazyLoadListener();
18466
+ });
18467
+ return () => {
18468
+ return vue.createVNode("div", {
18469
+ "style": its.value.style,
18470
+ "class": [its.value.class, {
18471
+ 'is-allow-preview': props.previewable
18472
+ }, 'vc-image']
18473
+ }, [isLoading.value && (slots.placeholder ? slots.placeholder() : vue.createVNode("div", {
18474
+ "class": [{
18475
+ 'is-auto': isAuto.value
18476
+ }, 'vc-image__placeholder'],
18477
+ "style": pStyle.value
18478
+ }, null)), !isLoading.value && isError.value && (slots.error ? slots.error() : vue.createVNode("div", {
18479
+ "class": "vc-image__error"
18480
+ }, [vue.createTextVNode(" \u52A0\u8F7D\u5931\u8D25")])), !isLoading.value && !isError.value && vue.createVNode("img", vue.mergeProps({
18481
+ "src": props.src,
18482
+ "style": style.value,
18483
+ "class": [{
18484
+ 'is-center': alignCenter
18485
+ }, 'vc-image__inner']
18486
+ }, {
18487
+ // 包含所有on*都会被绑定, 且listeners中覆盖将由listener内触发(inheritAttrs: false)
18488
+ ...its.value.attrs,
18489
+ ...its.value.listeners
18490
+ }, {
18491
+ "onClick": handlePreview
18492
+ }), null)]);
18493
+ };
18415
18494
  }
18416
- /**
18417
- * Unbinds all events, closes PhotoSwipe if it's open.
18418
- */
18419
-
18495
+ });
18420
18496
 
18421
- destroy() {
18422
- var _this$pswp;
18497
+ const MImage = Image$1;
18423
18498
 
18424
- (_this$pswp = this.pswp) === null || _this$pswp === void 0 || _this$pswp.destroy();
18425
- this.shouldOpen = false;
18426
- this._listeners = {};
18427
- getElementsFromOption$1(this.options.gallery, this.options.gallerySelector).forEach(galleryElement => {
18428
- galleryElement.removeEventListener('click', this.onThumbnailsClick, false);
18429
- });
18499
+ const props$F = {
18500
+ tag: {
18501
+ type: String,
18502
+ default: "div"
18430
18503
  }
18504
+ };
18431
18505
 
18432
- }
18506
+ /** @jsxImportSource vue */
18433
18507
 
18434
- const MAX_WIDTH = window.innerWidth;
18435
- const MAX_HEIGHT = window.innerHeight;
18436
- const getFitSize = (src) => {
18437
- return new Promise((resolve) => {
18438
- const img = new Image();
18439
- let width;
18440
- let height;
18441
- img.onload = () => {
18442
- const owidth = img.naturalWidth || img.width;
18443
- const oheight = img.naturalHeight || img.height;
18444
- if (owidth > oheight) {
18445
- width = Math.min(MAX_WIDTH, owidth);
18446
- height = width / owidth * oheight;
18447
- resolve({
18448
- width,
18449
- height
18450
- });
18451
- } else {
18452
- height = Math.min(MAX_HEIGHT, oheight);
18453
- width = height / oheight * owidth;
18454
- resolve({
18455
- width,
18456
- height
18457
- });
18458
- }
18459
- };
18460
- img.onerror = () => resolve({});
18461
- img.src = src;
18462
- });
18463
- };
18464
- const open$1 = async (options) => {
18465
- const e = VcInstance.globalEvent;
18466
- const data = options.data.map((i) => {
18467
- if (typeof i === "string") {
18468
- return {
18469
- src: i
18470
- };
18471
- }
18472
- return {
18473
- ...i,
18474
- src: i.source || i.src
18508
+ const COMPONENT_NAME$V = 'vc-image-crop';
18509
+ const ImageCrop = /* @__PURE__ */ vue.defineComponent({
18510
+ name: COMPONENT_NAME$V,
18511
+ props: props$F,
18512
+ setup(props, {
18513
+ slots
18514
+ }) {
18515
+ return () => {
18516
+ return vue.createVNode("div", {
18517
+ "class": "vc-image-crop"
18518
+ }, [slots?.default?.()]);
18475
18519
  };
18476
- });
18477
- for (let i = 0; i < data.length; i++) {
18478
- if (!data[i].width) {
18479
- data[i] = {
18480
- ...data[i],
18481
- ...await getFitSize(data[i].src)
18482
- };
18483
- }
18484
18520
  }
18485
- const lightbox = new PhotoSwipeLightbox({
18486
- pswpModule: () => Promise.resolve().then(() => photoswipe_esm),
18487
- closeTitle: "关闭(Esc)",
18488
- zoomTitle: "缩放",
18489
- arrowPrevTitle: "上一张",
18490
- arrowNextTitle: "下一张",
18491
- errorMsg: "网络异常 图片加载失败",
18492
- indexIndicatorSep: " / ",
18493
- initialZoomLevel: "fit"
18494
- });
18495
- lightbox.init();
18496
- lightbox.loadAndOpen(
18497
- options.current || 0,
18498
- data,
18499
- // 下面无效,需要给官方支持
18500
- {
18501
- x: e?.clientX,
18502
- y: e?.clientY
18503
- }
18504
- );
18505
- };
18521
+ });
18506
18522
 
18507
- const ImagePreview = Object.assign(ImagePreview$1, { open: open$1 });
18523
+ const MImageCrop = ImageCrop;
18508
18524
 
18509
18525
  const MImagePreview = ImagePreview;
18510
18526
 
@@ -18517,9 +18533,9 @@
18517
18533
 
18518
18534
  /** @jsxImportSource vue */
18519
18535
 
18520
- const COMPONENT_NAME$T = 'vc-image-processing';
18536
+ const COMPONENT_NAME$U = 'vc-image-processing';
18521
18537
  const ImageProcessing = /* @__PURE__ */ vue.defineComponent({
18522
- name: COMPONENT_NAME$T,
18538
+ name: COMPONENT_NAME$U,
18523
18539
  props: props$E,
18524
18540
  setup(props, {
18525
18541
  slots
@@ -18536,9 +18552,9 @@
18536
18552
 
18537
18553
  /** @jsxImportSource vue */
18538
18554
 
18539
- const COMPONENT_NAME$S = 'vcm-input';
18555
+ const COMPONENT_NAME$T = 'vcm-input';
18540
18556
  const MInput = /* @__PURE__ */ vue.defineComponent({
18541
- name: COMPONENT_NAME$S,
18557
+ name: COMPONENT_NAME$T,
18542
18558
  inheritAttrs: false,
18543
18559
  props: {
18544
18560
  ...props$$,
@@ -18627,9 +18643,9 @@
18627
18643
 
18628
18644
  /** @jsxImportSource vue */
18629
18645
 
18630
- const COMPONENT_NAME$R = 'vcm-input-number';
18646
+ const COMPONENT_NAME$S = 'vcm-input-number';
18631
18647
  const MInputNumber = /* @__PURE__ */ vue.defineComponent({
18632
- name: COMPONENT_NAME$R,
18648
+ name: COMPONENT_NAME$S,
18633
18649
  props: props$X,
18634
18650
  inheritAttrs: false,
18635
18651
  setup(props, {
@@ -18678,9 +18694,9 @@
18678
18694
 
18679
18695
  /** @jsxImportSource vue */
18680
18696
 
18681
- const COMPONENT_NAME$Q = 'vcm-input-search';
18697
+ const COMPONENT_NAME$R = 'vcm-input-search';
18682
18698
  const MInputSearch = /* @__PURE__ */ vue.defineComponent({
18683
- name: COMPONENT_NAME$Q,
18699
+ name: COMPONENT_NAME$R,
18684
18700
  props: {
18685
18701
  ...props$W,
18686
18702
  cancelText: {
@@ -18757,9 +18773,9 @@
18757
18773
  }
18758
18774
  };
18759
18775
 
18760
- const COMPONENT_NAME$P = "vcm-list";
18776
+ const COMPONENT_NAME$Q = "vcm-list";
18761
18777
  const MList = vue.defineComponent({
18762
- name: COMPONENT_NAME$P,
18778
+ name: COMPONENT_NAME$Q,
18763
18779
  props: props$D,
18764
18780
  setup(props, { slots }) {
18765
18781
  vue.provide("vc-list", { props });
@@ -18814,10 +18830,10 @@
18814
18830
 
18815
18831
  /** @jsxImportSource vue */
18816
18832
 
18817
- const COMPONENT_NAME$O = 'vcm-list-item';
18833
+ const COMPONENT_NAME$P = 'vcm-list-item';
18818
18834
  const HTTP_REGEX = /[a-zA-z]+:\/\/[^\s]*/;
18819
18835
  const MListItem = /* @__PURE__ */ vue.defineComponent({
18820
- name: COMPONENT_NAME$O,
18836
+ name: COMPONENT_NAME$P,
18821
18837
  props: props$C,
18822
18838
  emits: ['click'],
18823
18839
  setup(props, {
@@ -18950,11 +18966,11 @@
18950
18966
 
18951
18967
  /** @jsxImportSource vue */
18952
18968
 
18953
- const COMPONENT_NAME$N = 'vc-marquee';
18969
+ const COMPONENT_NAME$O = 'vc-marquee';
18954
18970
  const ANIMATION = prefixStyle('animation').camel;
18955
18971
  const TRANSFORM_KEBAB = prefixStyle('transform').kebab;
18956
18972
  const Marquee = /* @__PURE__ */ vue.defineComponent({
18957
- name: COMPONENT_NAME$N,
18973
+ name: COMPONENT_NAME$O,
18958
18974
  props: props$B,
18959
18975
  setup(props, {
18960
18976
  slots
@@ -19022,9 +19038,9 @@
19022
19038
  }
19023
19039
  };
19024
19040
 
19025
- const COMPONENT_NAME$M = "vc-resizer";
19041
+ const COMPONENT_NAME$N = "vc-resizer";
19026
19042
  const Resizer = vue.defineComponent({
19027
- name: COMPONENT_NAME$M,
19043
+ name: COMPONENT_NAME$N,
19028
19044
  props: props$A,
19029
19045
  emit: ["resize", "change"],
19030
19046
  setup(props, { emit, slots, expose }) {
@@ -19182,10 +19198,10 @@
19182
19198
 
19183
19199
  /** @jsxImportSource vue */
19184
19200
 
19185
- const COMPONENT_NAME$L = 'vc-modal';
19201
+ const COMPONENT_NAME$M = 'vc-modal';
19186
19202
  let zIndexNumber = 1002;
19187
19203
  const ModalView = /* @__PURE__ */ vue.defineComponent({
19188
- name: COMPONENT_NAME$L,
19204
+ name: COMPONENT_NAME$M,
19189
19205
  emits: ['update:modelValue', 'close', 'portal-fulfilled', 'visible-change', 'ok', 'cancel'],
19190
19206
  props: props$z,
19191
19207
  setup(props, {
@@ -19624,9 +19640,9 @@
19624
19640
 
19625
19641
  /** @jsxImportSource vue */
19626
19642
 
19627
- const COMPONENT_NAME$K = 'vc-modal';
19643
+ const COMPONENT_NAME$L = 'vc-modal';
19628
19644
  const MModalView = /* @__PURE__ */ vue.defineComponent({
19629
- name: COMPONENT_NAME$K,
19645
+ name: COMPONENT_NAME$L,
19630
19646
  emits: ['update:modelValue', 'portal-fulfilled', 'close', 'ok', 'cancel'],
19631
19647
  props: props$y,
19632
19648
  setup(props, {
@@ -19838,9 +19854,9 @@
19838
19854
 
19839
19855
  /** @jsxImportSource vue */
19840
19856
 
19841
- const COMPONENT_NAME$J = 'vc-notice';
19857
+ const COMPONENT_NAME$K = 'vc-notice';
19842
19858
  const NoticeView = /* @__PURE__ */ vue.defineComponent({
19843
- name: COMPONENT_NAME$J,
19859
+ name: COMPONENT_NAME$K,
19844
19860
  props: props$x,
19845
19861
  emits: ['portal-fulfilled', 'close', 'before-close'],
19846
19862
  setup(props, {
@@ -20013,9 +20029,9 @@
20013
20029
 
20014
20030
  /** @jsxImportSource vue */
20015
20031
 
20016
- const COMPONENT_NAME$I = 'vc-option';
20032
+ const COMPONENT_NAME$J = 'vc-option';
20017
20033
  const Option$1 = /* @__PURE__ */ vue.defineComponent({
20018
- name: COMPONENT_NAME$I,
20034
+ name: COMPONENT_NAME$J,
20019
20035
  props: props$w,
20020
20036
  setup(props, {
20021
20037
  slots
@@ -20128,9 +20144,9 @@
20128
20144
 
20129
20145
  /** @jsxImportSource vue */
20130
20146
 
20131
- const COMPONENT_NAME$H = 'vc-tag';
20147
+ const COMPONENT_NAME$I = 'vc-tag';
20132
20148
  const Tag = /* @__PURE__ */ vue.defineComponent({
20133
- name: COMPONENT_NAME$H,
20149
+ name: COMPONENT_NAME$I,
20134
20150
  props: props$u,
20135
20151
  emits: ['close', 'change'],
20136
20152
  setup(props, {
@@ -20199,9 +20215,9 @@
20199
20215
 
20200
20216
  /** @jsxImportSource vue */
20201
20217
 
20202
- const COMPONENT_NAME$G = 'vc-select-option';
20218
+ const COMPONENT_NAME$H = 'vc-select-option';
20203
20219
  const Option = /* @__PURE__ */ vue.defineComponent({
20204
- name: COMPONENT_NAME$G,
20220
+ name: COMPONENT_NAME$H,
20205
20221
  props: props$t,
20206
20222
  setup(props, {
20207
20223
  slots
@@ -20274,9 +20290,9 @@
20274
20290
 
20275
20291
  /** @jsxImportSource vue */
20276
20292
 
20277
- const COMPONENT_NAME$F = 'vc-select-option-group';
20293
+ const COMPONENT_NAME$G = 'vc-select-option-group';
20278
20294
  const OptionGroup = /* @__PURE__ */ vue.defineComponent({
20279
- name: COMPONENT_NAME$F,
20295
+ name: COMPONENT_NAME$G,
20280
20296
  props: props$s,
20281
20297
  setup(props, {
20282
20298
  slots
@@ -20374,9 +20390,9 @@
20374
20390
  function _isSlot$1(s) {
20375
20391
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
20376
20392
  }
20377
- const COMPONENT_NAME$E = 'vc-select';
20393
+ const COMPONENT_NAME$F = 'vc-select';
20378
20394
  const Select = /* @__PURE__ */ vue.defineComponent({
20379
- name: COMPONENT_NAME$E,
20395
+ name: COMPONENT_NAME$F,
20380
20396
  props: props$r,
20381
20397
  emits: ['ready', 'close', 'visible-change', 'clear', 'change', 'update:modelValue'],
20382
20398
  setup(props, {
@@ -20623,9 +20639,9 @@
20623
20639
 
20624
20640
  /** @jsxImportSource vue */
20625
20641
 
20626
- const COMPONENT_NAME$D = 'vc-pagination';
20642
+ const COMPONENT_NAME$E = 'vc-pagination';
20627
20643
  const Pagination = /* @__PURE__ */ vue.defineComponent({
20628
- name: COMPONENT_NAME$D,
20644
+ name: COMPONENT_NAME$E,
20629
20645
  props: props$v,
20630
20646
  emits: ['update:current', 'change', 'page-size-change'],
20631
20647
  setup(props, {
@@ -20823,9 +20839,9 @@
20823
20839
 
20824
20840
  /** @jsxImportSource vue */
20825
20841
 
20826
- const COMPONENT_NAME$C = 'vc-picker';
20842
+ const COMPONENT_NAME$D = 'vc-picker';
20827
20843
  const Picker = /* @__PURE__ */ vue.defineComponent({
20828
- name: COMPONENT_NAME$C,
20844
+ name: COMPONENT_NAME$D,
20829
20845
  props: props$q,
20830
20846
  setup(props, {
20831
20847
  slots
@@ -20849,9 +20865,9 @@
20849
20865
 
20850
20866
  /** @jsxImportSource vue */
20851
20867
 
20852
- const COMPONENT_NAME$B = 'vc-popconfirm';
20868
+ const COMPONENT_NAME$C = 'vc-popconfirm';
20853
20869
  const Popconfirm = /* @__PURE__ */ vue.defineComponent({
20854
- name: COMPONENT_NAME$B,
20870
+ name: COMPONENT_NAME$C,
20855
20871
  props: props$p,
20856
20872
  setup(props, {
20857
20873
  slots
@@ -20877,9 +20893,9 @@
20877
20893
 
20878
20894
  /** @jsxImportSource vue */
20879
20895
 
20880
- const COMPONENT_NAME$A = 'vc-popup';
20896
+ const COMPONENT_NAME$B = 'vc-popup';
20881
20897
  const Popup = /* @__PURE__ */ vue.defineComponent({
20882
- name: COMPONENT_NAME$A,
20898
+ name: COMPONENT_NAME$B,
20883
20899
  props: props$o,
20884
20900
  setup(props, {
20885
20901
  slots
@@ -20906,9 +20922,9 @@
20906
20922
 
20907
20923
  /** @jsxImportSource vue */
20908
20924
 
20909
- const COMPONENT_NAME$z = 'vc-print';
20925
+ const COMPONENT_NAME$A = 'vc-print';
20910
20926
  const Print = /* @__PURE__ */ vue.defineComponent({
20911
- name: COMPONENT_NAME$z,
20927
+ name: COMPONENT_NAME$A,
20912
20928
  props: props$n,
20913
20929
  setup(props, {
20914
20930
  expose,
@@ -21010,9 +21026,9 @@
21010
21026
 
21011
21027
  /** @jsxImportSource vue */
21012
21028
 
21013
- const COMPONENT_NAME$y = 'vc-progress-circle';
21029
+ const COMPONENT_NAME$z = 'vc-progress-circle';
21014
21030
  const Circle$1 = /* @__PURE__ */ vue.defineComponent({
21015
- name: COMPONENT_NAME$y,
21031
+ name: COMPONENT_NAME$z,
21016
21032
  props: props$m,
21017
21033
  setup(props, {
21018
21034
  slots
@@ -21072,9 +21088,9 @@
21072
21088
 
21073
21089
  /** @jsxImportSource vue */
21074
21090
 
21075
- const COMPONENT_NAME$x = 'vc-progress-line';
21091
+ const COMPONENT_NAME$y = 'vc-progress-line';
21076
21092
  const Line$2 = /* @__PURE__ */ vue.defineComponent({
21077
- name: COMPONENT_NAME$x,
21093
+ name: COMPONENT_NAME$y,
21078
21094
  props: props$m,
21079
21095
  setup(props) {
21080
21096
  const colorStyle = vue.computed(() => {
@@ -21121,9 +21137,9 @@
21121
21137
  function _isSlot(s) {
21122
21138
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
21123
21139
  }
21124
- const COMPONENT_NAME$w = 'vc-progress';
21140
+ const COMPONENT_NAME$x = 'vc-progress';
21125
21141
  const Progress = /* @__PURE__ */ vue.defineComponent({
21126
- name: COMPONENT_NAME$w,
21142
+ name: COMPONENT_NAME$x,
21127
21143
  props: props$m,
21128
21144
  setup(props, {
21129
21145
  slots
@@ -21281,9 +21297,9 @@
21281
21297
 
21282
21298
  /** @jsxImportSource vue */
21283
21299
 
21284
- const COMPONENT_NAME$v = 'vc-radio';
21300
+ const COMPONENT_NAME$w = 'vc-radio';
21285
21301
  const Radio = /* @__PURE__ */ vue.defineComponent({
21286
- name: COMPONENT_NAME$v,
21302
+ name: COMPONENT_NAME$w,
21287
21303
  props: props$l,
21288
21304
  emits: ['update:modelValue', 'change'],
21289
21305
  setup(props, {
@@ -21394,9 +21410,9 @@
21394
21410
 
21395
21411
  /** @jsxImportSource vue */
21396
21412
 
21397
- const COMPONENT_NAME$u = 'vc-radio-group';
21413
+ const COMPONENT_NAME$v = 'vc-radio-group';
21398
21414
  const RadioGroup = /* @__PURE__ */ vue.defineComponent({
21399
- name: COMPONENT_NAME$u,
21415
+ name: COMPONENT_NAME$v,
21400
21416
  props: props$k,
21401
21417
  emits: ['update:modelValue', 'change'],
21402
21418
  setup(props, {
@@ -21417,9 +21433,9 @@
21417
21433
 
21418
21434
  /** @jsxImportSource vue */
21419
21435
 
21420
- const COMPONENT_NAME$t = 'vcm-radio';
21436
+ const COMPONENT_NAME$u = 'vcm-radio';
21421
21437
  const MRadio = /* @__PURE__ */ vue.defineComponent({
21422
- name: COMPONENT_NAME$t,
21438
+ name: COMPONENT_NAME$u,
21423
21439
  props: props$l,
21424
21440
  emits: ['update:modelValue', 'change'],
21425
21441
  setup(props, {
@@ -21460,9 +21476,9 @@
21460
21476
 
21461
21477
  /** @jsxImportSource vue */
21462
21478
 
21463
- const COMPONENT_NAME$s = 'vcm-radio-group';
21479
+ const COMPONENT_NAME$t = 'vcm-radio-group';
21464
21480
  const MRadioGroup = /* @__PURE__ */ vue.defineComponent({
21465
- name: COMPONENT_NAME$s,
21481
+ name: COMPONENT_NAME$t,
21466
21482
  props: props$k,
21467
21483
  emits: ['update:modelValue', 'change'],
21468
21484
  setup(props, {
@@ -21491,9 +21507,9 @@
21491
21507
 
21492
21508
  /** @jsxImportSource vue */
21493
21509
 
21494
- const COMPONENT_NAME$r = 'vc-rate';
21510
+ const COMPONENT_NAME$s = 'vc-rate';
21495
21511
  const Rate = /* @__PURE__ */ vue.defineComponent({
21496
- name: COMPONENT_NAME$r,
21512
+ name: COMPONENT_NAME$s,
21497
21513
  props: props$j,
21498
21514
  setup(props, {
21499
21515
  slots
@@ -21675,9 +21691,9 @@
21675
21691
 
21676
21692
  /** @jsxImportSource vue */
21677
21693
 
21678
- const COMPONENT_NAME$q = 'vc-recycle-list-scroll-state';
21694
+ const COMPONENT_NAME$r = 'vc-recycle-list-scroll-state';
21679
21695
  const ScrollState = /* @__PURE__ */ vue.defineComponent({
21680
- name: COMPONENT_NAME$q,
21696
+ name: COMPONENT_NAME$r,
21681
21697
  setup(_, {
21682
21698
  slots
21683
21699
  }) {
@@ -21807,12 +21823,12 @@
21807
21823
 
21808
21824
  /** @jsxImportSource vue */
21809
21825
 
21810
- const COMPONENT_NAME$p = 'vc-recycle-list-container';
21826
+ const COMPONENT_NAME$q = 'vc-recycle-list-container';
21811
21827
 
21812
21828
  // TODO: 抽离
21813
21829
  const transformKey = prefixStyle('transform').camel;
21814
21830
  const Container = /* @__PURE__ */ vue.defineComponent({
21815
- name: COMPONENT_NAME$p,
21831
+ name: COMPONENT_NAME$q,
21816
21832
  props: props$h,
21817
21833
  emits: ['refresh'],
21818
21834
  setup(props, {
@@ -21910,9 +21926,9 @@
21910
21926
 
21911
21927
  /** @jsxImportSource vue */
21912
21928
 
21913
- const COMPONENT_NAME$o = 'vc-recycle-list';
21929
+ const COMPONENT_NAME$p = 'vc-recycle-list';
21914
21930
  const RecycleList = /* @__PURE__ */ vue.defineComponent({
21915
- name: COMPONENT_NAME$o,
21931
+ name: COMPONENT_NAME$p,
21916
21932
  props: props$i,
21917
21933
  emits: ['scroll', 'row-resize'],
21918
21934
  setup(props, {
@@ -22484,9 +22500,9 @@
22484
22500
 
22485
22501
  /** @jsxImportSource vue */
22486
22502
 
22487
- const COMPONENT_NAME$n = 'vc-slider';
22503
+ const COMPONENT_NAME$o = 'vc-slider';
22488
22504
  const Slider = /* @__PURE__ */ vue.defineComponent({
22489
- name: COMPONENT_NAME$n,
22505
+ name: COMPONENT_NAME$o,
22490
22506
  props: props$g,
22491
22507
  setup(props, {
22492
22508
  slots
@@ -22510,9 +22526,9 @@
22510
22526
 
22511
22527
  /** @jsxImportSource vue */
22512
22528
 
22513
- const COMPONENT_NAME$m = 'vc-sort-list';
22529
+ const COMPONENT_NAME$n = 'vc-sort-list';
22514
22530
  const SortList = /* @__PURE__ */ vue.defineComponent({
22515
- name: COMPONENT_NAME$m,
22531
+ name: COMPONENT_NAME$n,
22516
22532
  props: props$f,
22517
22533
  setup(props, {
22518
22534
  slots
@@ -22536,9 +22552,9 @@
22536
22552
 
22537
22553
  /** @jsxImportSource vue */
22538
22554
 
22539
- const COMPONENT_NAME$l = 'vc-steps';
22555
+ const COMPONENT_NAME$m = 'vc-steps';
22540
22556
  const Steps = /* @__PURE__ */ vue.defineComponent({
22541
- name: COMPONENT_NAME$l,
22557
+ name: COMPONENT_NAME$m,
22542
22558
  props: props$e,
22543
22559
  setup(props, {
22544
22560
  slots
@@ -22651,9 +22667,9 @@
22651
22667
 
22652
22668
  /** @jsxImportSource vue */
22653
22669
 
22654
- const COMPONENT_NAME$k = 'vc-switch';
22670
+ const COMPONENT_NAME$l = 'vc-switch';
22655
22671
  const Switch = /* @__PURE__ */ vue.defineComponent({
22656
- name: COMPONENT_NAME$k,
22672
+ name: COMPONENT_NAME$l,
22657
22673
  props: props$d,
22658
22674
  // click -> onClick要被拦截,此处不能放置
22659
22675
  emits: ['update:modelValue', 'change', 'click'],
@@ -22690,9 +22706,9 @@
22690
22706
 
22691
22707
  /** @jsxImportSource vue */
22692
22708
 
22693
- const COMPONENT_NAME$j = 'vcm-switch';
22709
+ const COMPONENT_NAME$k = 'vcm-switch';
22694
22710
  const MSwitch = /* @__PURE__ */ vue.defineComponent({
22695
- name: COMPONENT_NAME$j,
22711
+ name: COMPONENT_NAME$k,
22696
22712
  props: props$d,
22697
22713
  // click -> onClick要被拦截,此处不能放置
22698
22714
  emits: ['update:modelValue', 'change', 'click'],
@@ -41016,9 +41032,9 @@
41016
41032
 
41017
41033
  /** @jsxImportSource vue */
41018
41034
 
41019
- const COMPONENT_NAME$i = 'vc-table-normal-list';
41035
+ const COMPONENT_NAME$j = 'vc-table-normal-list';
41020
41036
  const NormalList = /* @__PURE__ */ vue.defineComponent({
41021
- name: COMPONENT_NAME$i,
41037
+ name: COMPONENT_NAME$j,
41022
41038
  props: {
41023
41039
  data: {
41024
41040
  type: Array,
@@ -41858,9 +41874,9 @@
41858
41874
 
41859
41875
  /** @jsxImportSource vue */
41860
41876
 
41861
- const COMPONENT_NAME$h = 'vc-table';
41877
+ const COMPONENT_NAME$i = 'vc-table';
41862
41878
  const Table = /* @__PURE__ */ vue.defineComponent({
41863
- name: COMPONENT_NAME$h,
41879
+ name: COMPONENT_NAME$i,
41864
41880
  props: props$c,
41865
41881
  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'],
41866
41882
  setup(props, {
@@ -42495,9 +42511,9 @@
42495
42511
 
42496
42512
  /** @jsxImportSource vue */
42497
42513
 
42498
- const COMPONENT_NAME$g = 'vc-text';
42514
+ const COMPONENT_NAME$h = 'vc-text';
42499
42515
  const Text = /* @__PURE__ */ vue.defineComponent({
42500
- name: COMPONENT_NAME$g,
42516
+ name: COMPONENT_NAME$h,
42501
42517
  props: props$b,
42502
42518
  setup(props, {
42503
42519
  emit
@@ -43192,9 +43208,9 @@
43192
43208
 
43193
43209
  /** @jsxImportSource vue */
43194
43210
 
43195
- const COMPONENT_NAME$f = 'vc-tabs';
43211
+ const COMPONENT_NAME$g = 'vc-tabs';
43196
43212
  const Tabs = /* @__PURE__ */ vue.defineComponent({
43197
- name: COMPONENT_NAME$f,
43213
+ name: COMPONENT_NAME$g,
43198
43214
  props: props$a,
43199
43215
  emits: ['update:modelValue', 'change', 'click'],
43200
43216
  setup(props, {
@@ -43442,9 +43458,9 @@
43442
43458
 
43443
43459
  /** @jsxImportSource vue */
43444
43460
 
43445
- const COMPONENT_NAME$e = 'vc-tabs-pane';
43461
+ const COMPONENT_NAME$f = 'vc-tabs-pane';
43446
43462
  const TabsPane = /* @__PURE__ */ vue.defineComponent({
43447
- name: COMPONENT_NAME$e,
43463
+ name: COMPONENT_NAME$f,
43448
43464
  props: props$9,
43449
43465
  setup(_, {
43450
43466
  slots
@@ -43499,9 +43515,9 @@
43499
43515
 
43500
43516
  /** @jsxImportSource vue */
43501
43517
 
43502
- const COMPONENT_NAME$d = 'vcm-tabs';
43518
+ const COMPONENT_NAME$e = 'vcm-tabs';
43503
43519
  const MTabs = /* @__PURE__ */ vue.defineComponent({
43504
- name: COMPONENT_NAME$d,
43520
+ name: COMPONENT_NAME$e,
43505
43521
  props: props$8,
43506
43522
  emits: ['update:modelValue', 'change', 'click'],
43507
43523
  setup(props, {
@@ -43766,9 +43782,9 @@
43766
43782
 
43767
43783
  /** @jsxImportSource vue */
43768
43784
 
43769
- const COMPONENT_NAME$c = 'vcm-tabs-pane';
43785
+ const COMPONENT_NAME$d = 'vcm-tabs-pane';
43770
43786
  const MTabsPane = /* @__PURE__ */ vue.defineComponent({
43771
- name: COMPONENT_NAME$c,
43787
+ name: COMPONENT_NAME$d,
43772
43788
  props: props$9,
43773
43789
  setup(_, {
43774
43790
  slots
@@ -44069,9 +44085,9 @@
44069
44085
 
44070
44086
  /** @jsxImportSource vue */
44071
44087
 
44072
- const COMPONENT_NAME$b = 'vc-textarea';
44088
+ const COMPONENT_NAME$c = 'vc-textarea';
44073
44089
  const Textarea = /* @__PURE__ */ vue.defineComponent({
44074
- name: COMPONENT_NAME$b,
44090
+ name: COMPONENT_NAME$c,
44075
44091
  props: Object.assign(props$7, {
44076
44092
  indicator: {
44077
44093
  type: [Boolean, Object],
@@ -44127,9 +44143,9 @@
44127
44143
 
44128
44144
  /** @jsxImportSource vue */
44129
44145
 
44130
- const COMPONENT_NAME$a = 'vcm-textarea';
44146
+ const COMPONENT_NAME$b = 'vcm-textarea';
44131
44147
  const MTextarea = /* @__PURE__ */ vue.defineComponent({
44132
- name: COMPONENT_NAME$a,
44148
+ name: COMPONENT_NAME$b,
44133
44149
  props: Object.assign(props$7, {
44134
44150
  align: {
44135
44151
  type: String,
@@ -44212,9 +44228,9 @@
44212
44228
  }
44213
44229
  };
44214
44230
 
44215
- const COMPONENT_NAME$9 = "vc-theme";
44231
+ const COMPONENT_NAME$a = "vc-theme";
44216
44232
  const Theme = vue.defineComponent({
44217
- name: COMPONENT_NAME$9,
44233
+ name: COMPONENT_NAME$a,
44218
44234
  props: props$6,
44219
44235
  setup(props, { slots }) {
44220
44236
  const themeId = getUid("vc-theme");
@@ -44300,9 +44316,9 @@
44300
44316
  }
44301
44317
  });
44302
44318
 
44303
- const COMPONENT_NAME$8 = "vc-theme-view";
44319
+ const COMPONENT_NAME$9 = "vc-theme-view";
44304
44320
  const ThemeView = vue.defineComponent({
44305
- name: COMPONENT_NAME$8,
44321
+ name: COMPONENT_NAME$9,
44306
44322
  props: props$6,
44307
44323
  setup(props, { slots }) {
44308
44324
  return () => {
@@ -44318,9 +44334,9 @@
44318
44334
  }
44319
44335
  });
44320
44336
 
44321
- const COMPONENT_NAME$7 = "vc-theme-text";
44337
+ const COMPONENT_NAME$8 = "vc-theme-text";
44322
44338
  const ThemeText = vue.defineComponent({
44323
- name: COMPONENT_NAME$7,
44339
+ name: COMPONENT_NAME$8,
44324
44340
  props: props$6,
44325
44341
  setup(props, { slots }) {
44326
44342
  return () => {
@@ -44336,9 +44352,9 @@
44336
44352
  }
44337
44353
  });
44338
44354
 
44339
- const COMPONENT_NAME$6 = "vc-theme-image";
44355
+ const COMPONENT_NAME$7 = "vc-theme-image";
44340
44356
  const ThemeImage = vue.defineComponent({
44341
- name: COMPONENT_NAME$6,
44357
+ name: COMPONENT_NAME$7,
44342
44358
  props: props$6,
44343
44359
  setup(props, { slots }) {
44344
44360
  return () => {
@@ -44386,12 +44402,12 @@
44386
44402
 
44387
44403
  /** @jsxImportSource vue */
44388
44404
 
44389
- const COMPONENT_NAME$5 = 'vc-time-picker';
44405
+ const COMPONENT_NAME$6 = 'vc-time-picker';
44390
44406
  const getPanel = type => {
44391
44407
  const isRange = type === 'timerange';
44392
44408
  return isRange ? TimeRangePanel : TimePanel;
44393
44409
  };
44394
- const TimePicker = createPicker(COMPONENT_NAME$5, props$5, () => {
44410
+ const TimePicker = createPicker(COMPONENT_NAME$6, props$5, () => {
44395
44411
  const props = vue.getCurrentInstance().props;
44396
44412
  const icon = vue.ref('icon');
44397
44413
  const panel = vue.shallowRef({});
@@ -44426,9 +44442,9 @@
44426
44442
 
44427
44443
  /** @jsxImportSource vue */
44428
44444
 
44429
- const COMPONENT_NAME$4 = 'vc-timeline';
44445
+ const COMPONENT_NAME$5 = 'vc-timeline';
44430
44446
  const Timeline = /* @__PURE__ */ vue.defineComponent({
44431
- name: COMPONENT_NAME$4,
44447
+ name: COMPONENT_NAME$5,
44432
44448
  props: props$4,
44433
44449
  setup(props, {
44434
44450
  slots
@@ -44455,9 +44471,9 @@
44455
44471
 
44456
44472
  /** @jsxImportSource vue */
44457
44473
 
44458
- const COMPONENT_NAME$3 = 'vc-touch';
44474
+ const COMPONENT_NAME$4 = 'vc-touch';
44459
44475
  const Touch = /* @__PURE__ */ vue.defineComponent({
44460
- name: COMPONENT_NAME$3,
44476
+ name: COMPONENT_NAME$4,
44461
44477
  props: props$3,
44462
44478
  setup(props, {
44463
44479
  slots
@@ -44481,9 +44497,9 @@
44481
44497
 
44482
44498
  /** @jsxImportSource vue */
44483
44499
 
44484
- const COMPONENT_NAME$2 = 'vc-tree';
44500
+ const COMPONENT_NAME$3 = 'vc-tree';
44485
44501
  const Tree$1 = /* @__PURE__ */ vue.defineComponent({
44486
- name: COMPONENT_NAME$2,
44502
+ name: COMPONENT_NAME$3,
44487
44503
  props: props$2,
44488
44504
  setup(props, {
44489
44505
  slots
@@ -44593,9 +44609,9 @@
44593
44609
  }
44594
44610
  };
44595
44611
 
44596
- const COMPONENT_NAME$1 = "vc-upload";
44612
+ const COMPONENT_NAME$2 = "vc-upload";
44597
44613
  const Upload = vue.defineComponent({
44598
- name: COMPONENT_NAME$1,
44614
+ name: COMPONENT_NAME$2,
44599
44615
  props: props$1,
44600
44616
  emits: [
44601
44617
  "message",
@@ -44981,6 +44997,104 @@
44981
44997
  gallery: Boolean
44982
44998
  };
44983
44999
 
45000
+ /** @jsxImportSource vue */
45001
+
45002
+ const COMPONENT_NAME$1 = 'vc-steps';
45003
+ const ImageItem = /* @__PURE__ */ vue.defineComponent({
45004
+ name: COMPONENT_NAME$1,
45005
+ props: {
45006
+ imageClass: [String, Object, Array],
45007
+ disabled: Boolean,
45008
+ row: Object,
45009
+ imagePreviewOptions: {
45010
+ type: Object,
45011
+ default: () => ({})
45012
+ },
45013
+ index: [String, Number],
45014
+ data: {
45015
+ type: Array,
45016
+ default: () => []
45017
+ },
45018
+ keyValue: Object
45019
+ },
45020
+ emits: ['open', 'close', 'delete'],
45021
+ setup(props, {
45022
+ slots,
45023
+ emit
45024
+ }) {
45025
+ const instance = vue.getCurrentInstance();
45026
+ const current = vue.computed(() => {
45027
+ if (props.row?.status === 0) return -1;
45028
+ const v = props.data.filter(i => i.status !== 0);
45029
+ return v.findIndex(i => {
45030
+ const a = i[props.keyValue.value] || i;
45031
+ const b = props.row?.[props.keyValue.value] || props.row;
45032
+ return a === b;
45033
+ });
45034
+ });
45035
+ // 拿到可预览的图片,供预览组件使用
45036
+ const getPreviewData = () => {
45037
+ return props.data.map(i => i?.[props.keyValue.value]);
45038
+ };
45039
+ const previewByPS = (e, index) => {
45040
+ emit('open');
45041
+ ImagePreview.open({
45042
+ current: index,
45043
+ data: getPreviewData(),
45044
+ onClose: () => emit('close')
45045
+ });
45046
+ };
45047
+ const handlePreview = e => {
45048
+ /**
45049
+ * 渐进增强
45050
+ */
45051
+ let {
45052
+ enhancer
45053
+ } = VcInstance.options.ImagePreview || {};
45054
+ enhancer = props.imagePreviewOptions.enhancer || enhancer || (() => false);
45055
+ const images = getPreviewData().map(item => ({
45056
+ src: item
45057
+ }));
45058
+ enhancer(current.value, images, instance) || previewByPS(e, current.value);
45059
+ };
45060
+ const handleDel = () => {
45061
+ emit('delete');
45062
+ };
45063
+ return () => {
45064
+ const row = props.row;
45065
+ return vue.createVNode("div", {
45066
+ "class": [{
45067
+ 'is-error': row.status == 0
45068
+ }, 'vc-upload-image-item']
45069
+ }, [slots.default ? slots.default({
45070
+ it: row,
45071
+ current: current.value
45072
+ }) : vue.createVNode(vue.Fragment, null, [!row.errorFlag && typeof row[props.keyValue.value] === 'string' ? vue.createVNode(Image$1, {
45073
+ "src": row[props.keyValue.value],
45074
+ "class": [props.imageClass, 'vc-upload-image-item__content'],
45075
+ "fit": "cover",
45076
+ "previewable": false,
45077
+ "onClick": handlePreview
45078
+ }, null) : vue.createVNode("div", {
45079
+ "class": [props.imageClass, 'vc-upload-image-item__content']
45080
+ }, [row.percent && row.percent != 100 ? vue.createVNode(Progress, {
45081
+ "percent": row.percent,
45082
+ "show-text": false,
45083
+ "status": "normal",
45084
+ "style": "width: 100%;padding: 0 5px"
45085
+ }, null) : !row[props.keyValue.value] && row.percent === 100 && !row.errorFlag ? vue.createVNode("p", {
45086
+ "style": "line-height: 1; padding: 5px"
45087
+ }, [vue.createTextVNode("\u670D\u52A1\u5668\u6B63\u5728\u63A5\u6536...")]) : row.status == 0 ? vue.createVNode("div", {
45088
+ "style": "padding: 5px"
45089
+ }, [vue.createTextVNode("\u4E0A\u4F20\u5931\u8D25")]) : null]), (!props.disabled || row.errorFlag) && vue.createVNode(Icon, {
45090
+ "type": "close-small",
45091
+ "class": "vc-upload-picker__delete",
45092
+ "onClick": handleDel
45093
+ }, null)])]);
45094
+ };
45095
+ }
45096
+ });
45097
+
44984
45098
  const recognizer = (url) => {
44985
45099
  const reg = /\.(jpe?g|png|gif|bmp|webp|image|heic|mp4|mov|avi|mpg|mpeg|rmvb)/ig;
44986
45100
  const result = url.match(reg);
@@ -45232,7 +45346,7 @@
45232
45346
  const UploadPicker = /* @__PURE__ */ vue.defineComponent({
45233
45347
  name: COMPONENT_NAME,
45234
45348
  props: props,
45235
- emits: ['update:modelValue', 'file-success', 'file-start', 'success', 'error', 'complete', 'change', 'remove-before'],
45349
+ emits: ['update:modelValue', 'file-success', 'file-start', 'file-before', 'file-error', 'success', 'error', 'complete', 'change', 'remove-before'],
45236
45350
  setup(props, {
45237
45351
  slots,
45238
45352
  expose
@@ -45244,8 +45358,7 @@
45244
45358
  case 'image':
45245
45359
  pre.push({
45246
45360
  type: cur,
45247
- item: 'div'
45248
- // item: ImageItem
45361
+ item: ImageItem
45249
45362
  });
45250
45363
  return pre;
45251
45364
  case 'video':
@@ -45294,7 +45407,7 @@
45294
45407
  const Item = picker.item;
45295
45408
  return vue.createVNode(Item, {
45296
45409
  "key": typeof item === 'object' ? item.uid : item,
45297
- "it": item,
45410
+ "row": item,
45298
45411
  "disabled": props.disabled,
45299
45412
  "image-preview-options": props.imagePreviewOptions,
45300
45413
  "imageClass": props.imageClass,
@@ -45302,18 +45415,19 @@
45302
45415
  "audioClass": props.audioClass,
45303
45416
  "fileClass": props.fileClass,
45304
45417
  "index": index,
45305
- "data": item,
45418
+ "keyValue": props.keyValue,
45419
+ "data": base.currentValue.value[picker.type],
45306
45420
  "class": "vc-upload-picker__item",
45307
45421
  "onDelete": () => base.handleDelete(index, picker.type)
45308
45422
  }, {
45309
- default: scopeData => {
45310
- return slots.default ? slots.default({
45423
+ default: slots.default ? scopeData => {
45424
+ return slots?.default?.({
45311
45425
  it: scopeData?.it,
45312
45426
  current: scopeData?.current,
45313
45427
  index,
45314
45428
  name: picker.type
45315
- }) : scopeData;
45316
- }
45429
+ });
45430
+ } : null
45317
45431
  });
45318
45432
  }), vue.withDirectives(vue.createVNode(Upload, vue.mergeProps(base.currentUploadOptions.value[picker.type], {
45319
45433
  "max": base.dynamicMax[picker.type],