@deot/vc-components 1.0.25 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,9 +64,9 @@ var VcComponents = (function (exports, vue) {
64
64
 
65
65
  /** @jsxImportSource vue */
66
66
 
67
- const COMPONENT_NAME$1$ = 'vc-action-sheet';
67
+ const COMPONENT_NAME$20 = 'vc-action-sheet';
68
68
  const ActionSheet = /* @__PURE__ */ vue.defineComponent({
69
- name: COMPONENT_NAME$1$,
69
+ name: COMPONENT_NAME$20,
70
70
  props: props$1q,
71
71
  setup(props, {
72
72
  slots
@@ -253,9 +253,9 @@ var VcComponents = (function (exports, vue) {
253
253
 
254
254
  /** @jsxImportSource vue */
255
255
 
256
- const COMPONENT_NAME$1_ = 'vc-icon';
256
+ const COMPONENT_NAME$1$ = 'vc-icon';
257
257
  const Icon = /* @__PURE__ */ vue.defineComponent({
258
- name: COMPONENT_NAME$1_,
258
+ name: COMPONENT_NAME$1$,
259
259
  props: props$1o,
260
260
  setup(props) {
261
261
  const viewBox = vue.ref('0 0 1024 1024');
@@ -454,9 +454,9 @@ var VcComponents = (function (exports, vue) {
454
454
  };
455
455
  };
456
456
 
457
- const COMPONENT_NAME$1Z = "vc-transition";
457
+ const COMPONENT_NAME$1_ = "vc-transition";
458
458
  const Transition = vue.defineComponent({
459
- name: COMPONENT_NAME$1Z,
459
+ name: COMPONENT_NAME$1_,
460
460
  props: props$1n,
461
461
  // 当不声明emits的情况下,事件存在于attrs中
462
462
  inheritAttrs: false,
@@ -477,9 +477,9 @@ var VcComponents = (function (exports, vue) {
477
477
  }
478
478
  });
479
479
 
480
- const COMPONENT_NAME$1Y = "vc-transition-collapse";
480
+ const COMPONENT_NAME$1Z = "vc-transition-collapse";
481
481
  const TransitionCollapse = vue.defineComponent({
482
- name: COMPONENT_NAME$1Y,
482
+ name: COMPONENT_NAME$1Z,
483
483
  props: props$1n,
484
484
  // 当不声明emits的情况下,事件存在于attrs中
485
485
  inheritAttrs: false,
@@ -598,9 +598,9 @@ var VcComponents = (function (exports, vue) {
598
598
  }
599
599
  });
600
600
 
601
- const COMPONENT_NAME$1X = "vc-transition-fade";
601
+ const COMPONENT_NAME$1Y = "vc-transition-fade";
602
602
  const TransitionFade = vue.defineComponent({
603
- name: COMPONENT_NAME$1X,
603
+ name: COMPONENT_NAME$1Y,
604
604
  props: {
605
605
  ...props$1n,
606
606
  // inheritAttrs必须是false
@@ -635,9 +635,9 @@ var VcComponents = (function (exports, vue) {
635
635
  }
636
636
  });
637
637
 
638
- const COMPONENT_NAME$1W = "vc-transition-scale";
638
+ const COMPONENT_NAME$1X = "vc-transition-scale";
639
639
  const TransitionScale = vue.defineComponent({
640
- name: COMPONENT_NAME$1W,
640
+ name: COMPONENT_NAME$1X,
641
641
  props: {
642
642
  ...props$1n,
643
643
  mode: {
@@ -677,9 +677,9 @@ var VcComponents = (function (exports, vue) {
677
677
  }
678
678
  });
679
679
 
680
- const COMPONENT_NAME$1V = "vc-transition-slide";
680
+ const COMPONENT_NAME$1W = "vc-transition-slide";
681
681
  const TransitionSlide = vue.defineComponent({
682
- name: COMPONENT_NAME$1V,
682
+ name: COMPONENT_NAME$1W,
683
683
  props: {
684
684
  ...props$1n,
685
685
  mode: {
@@ -719,9 +719,9 @@ var VcComponents = (function (exports, vue) {
719
719
  }
720
720
  });
721
721
 
722
- const COMPONENT_NAME$1U = "vc-transition-zoom";
722
+ const COMPONENT_NAME$1V = "vc-transition-zoom";
723
723
  const TransitionZoom = vue.defineComponent({
724
- name: COMPONENT_NAME$1U,
724
+ name: COMPONENT_NAME$1V,
725
725
  props: {
726
726
  ...props$1n,
727
727
  mode: {
@@ -763,7 +763,7 @@ var VcComponents = (function (exports, vue) {
763
763
 
764
764
  /** @jsxImportSource vue */
765
765
 
766
- const COMPONENT_NAME$1T = 'vc-alert';
766
+ const COMPONENT_NAME$1U = 'vc-alert';
767
767
 
768
768
  // [color, borderColor, backgroundColor], -> CSS
769
769
  const THEME_MAP = {
@@ -773,7 +773,7 @@ var VcComponents = (function (exports, vue) {
773
773
  warning: ['#ffbf00', '#ffe58f', '#fffbe6']
774
774
  };
775
775
  const Alert = /* @__PURE__ */ vue.defineComponent({
776
- name: COMPONENT_NAME$1T,
776
+ name: COMPONENT_NAME$1U,
777
777
  props: props$1p,
778
778
  setup(props, {
779
779
  slots,
@@ -872,9 +872,9 @@ var VcComponents = (function (exports, vue) {
872
872
 
873
873
  /** @jsxImportSource vue */
874
874
 
875
- const COMPONENT_NAME$1S = 'vc-artboard';
875
+ const COMPONENT_NAME$1T = 'vc-artboard';
876
876
  const Artboard = /* @__PURE__ */ vue.defineComponent({
877
- name: COMPONENT_NAME$1S,
877
+ name: COMPONENT_NAME$1T,
878
878
  props: props$1m,
879
879
  setup(props, {
880
880
  slots
@@ -913,9 +913,9 @@ var VcComponents = (function (exports, vue) {
913
913
 
914
914
  /** @jsxImportSource vue */
915
915
 
916
- const COMPONENT_NAME$1R = 'vc-spin';
916
+ const COMPONENT_NAME$1S = 'vc-spin';
917
917
  const Spin = /* @__PURE__ */ vue.defineComponent({
918
- name: COMPONENT_NAME$1R,
918
+ name: COMPONENT_NAME$1S,
919
919
  props: props$1l,
920
920
  setup(props, {
921
921
  slots
@@ -5771,9 +5771,9 @@ var VcComponents = (function (exports, vue) {
5771
5771
  exclude: RegExp
5772
5772
  };
5773
5773
 
5774
- const COMPONENT_NAME$1Q = "vc-debounce";
5774
+ const COMPONENT_NAME$1R = "vc-debounce";
5775
5775
  const Debounce = vue.defineComponent({
5776
- name: COMPONENT_NAME$1Q,
5776
+ name: COMPONENT_NAME$1R,
5777
5777
  props: props$1k,
5778
5778
  /**
5779
5779
  * 不声明emits使得事件被透传放入attrs中, 这样可以让所有的事件透传
@@ -5845,9 +5845,9 @@ var VcComponents = (function (exports, vue) {
5845
5845
 
5846
5846
  /** @jsxImportSource vue */
5847
5847
 
5848
- const COMPONENT_NAME$1P = 'vc-button';
5848
+ const COMPONENT_NAME$1Q = 'vc-button';
5849
5849
  const Button = /* @__PURE__ */ vue.defineComponent({
5850
- name: COMPONENT_NAME$1P,
5850
+ name: COMPONENT_NAME$1Q,
5851
5851
  emits: ['click'],
5852
5852
  props: props$1j,
5853
5853
  setup(props, {
@@ -5929,9 +5929,9 @@ var VcComponents = (function (exports, vue) {
5929
5929
 
5930
5930
  /** @jsxImportSource vue */
5931
5931
 
5932
- const COMPONENT_NAME$1O = 'vc-button-group';
5932
+ const COMPONENT_NAME$1P = 'vc-button-group';
5933
5933
  const ButtonGroup = /* @__PURE__ */ vue.defineComponent({
5934
- name: COMPONENT_NAME$1O,
5934
+ name: COMPONENT_NAME$1P,
5935
5935
  props: props$1i,
5936
5936
  setup(props, {
5937
5937
  slots
@@ -5965,9 +5965,9 @@ var VcComponents = (function (exports, vue) {
5965
5965
 
5966
5966
  /** @jsxImportSource vue */
5967
5967
 
5968
- const COMPONENT_NAME$1N = 'vc-calendar';
5968
+ const COMPONENT_NAME$1O = 'vc-calendar';
5969
5969
  const Calendar$1 = /* @__PURE__ */ vue.defineComponent({
5970
- name: COMPONENT_NAME$1N,
5970
+ name: COMPONENT_NAME$1O,
5971
5971
  props: props$1h,
5972
5972
  setup(props, {
5973
5973
  slots
@@ -6005,9 +6005,9 @@ var VcComponents = (function (exports, vue) {
6005
6005
 
6006
6006
  /** @jsxImportSource vue */
6007
6007
 
6008
- const COMPONENT_NAME$1M = 'vc-card';
6008
+ const COMPONENT_NAME$1N = 'vc-card';
6009
6009
  const Card = /* @__PURE__ */ vue.defineComponent({
6010
- name: COMPONENT_NAME$1M,
6010
+ name: COMPONENT_NAME$1N,
6011
6011
  props: props$1g,
6012
6012
  setup(props, {
6013
6013
  slots
@@ -6043,9 +6043,9 @@ var VcComponents = (function (exports, vue) {
6043
6043
 
6044
6044
  /** @jsxImportSource vue */
6045
6045
 
6046
- const COMPONENT_NAME$1L = 'vc-carousel';
6046
+ const COMPONENT_NAME$1M = 'vc-carousel';
6047
6047
  const Carousel = /* @__PURE__ */ vue.defineComponent({
6048
- name: COMPONENT_NAME$1L,
6048
+ name: COMPONENT_NAME$1M,
6049
6049
  props: props$1f,
6050
6050
  setup(props, {
6051
6051
  slots
@@ -6069,9 +6069,9 @@ var VcComponents = (function (exports, vue) {
6069
6069
 
6070
6070
  /** @jsxImportSource vue */
6071
6071
 
6072
- const COMPONENT_NAME$1K = 'vc-cascader';
6072
+ const COMPONENT_NAME$1L = 'vc-cascader';
6073
6073
  const Cascader = /* @__PURE__ */ vue.defineComponent({
6074
- name: COMPONENT_NAME$1K,
6074
+ name: COMPONENT_NAME$1L,
6075
6075
  props: props$1e,
6076
6076
  setup(props, {
6077
6077
  slots
@@ -6203,9 +6203,9 @@ var VcComponents = (function (exports, vue) {
6203
6203
 
6204
6204
  /** @jsxImportSource vue */
6205
6205
 
6206
- const COMPONENT_NAME$1J = 'vc-chart';
6206
+ const COMPONENT_NAME$1K = 'vc-chart';
6207
6207
  const Chart = /* @__PURE__ */ vue.defineComponent({
6208
- name: COMPONENT_NAME$1J,
6208
+ name: COMPONENT_NAME$1K,
6209
6209
  props: props$1d,
6210
6210
  emits: [...EVENTS, 'ready'],
6211
6211
  setup(props, {
@@ -6437,9 +6437,9 @@ var VcComponents = (function (exports, vue) {
6437
6437
 
6438
6438
  /** @jsxImportSource vue */
6439
6439
 
6440
- const COMPONENT_NAME$1I = 'vc-checkbox';
6440
+ const COMPONENT_NAME$1J = 'vc-checkbox';
6441
6441
  const Checkbox = /* @__PURE__ */ vue.defineComponent({
6442
- name: COMPONENT_NAME$1I,
6442
+ name: COMPONENT_NAME$1J,
6443
6443
  props: props$1c,
6444
6444
  emits: ['update:modelValue', 'change'],
6445
6445
  setup(props, {
@@ -6526,9 +6526,9 @@ var VcComponents = (function (exports, vue) {
6526
6526
 
6527
6527
  /** @jsxImportSource vue */
6528
6528
 
6529
- const COMPONENT_NAME$1H = 'vc-checkbox-group';
6529
+ const COMPONENT_NAME$1I = 'vc-checkbox-group';
6530
6530
  const CheckboxGroup = /* @__PURE__ */ vue.defineComponent({
6531
- name: COMPONENT_NAME$1H,
6531
+ name: COMPONENT_NAME$1I,
6532
6532
  props: props$1b,
6533
6533
  emits: ['update:modelValue', 'change'],
6534
6534
  setup(props, {
@@ -6546,9 +6546,9 @@ var VcComponents = (function (exports, vue) {
6546
6546
 
6547
6547
  /** @jsxImportSource vue */
6548
6548
 
6549
- const COMPONENT_NAME$1G = 'vcm-checkbox';
6549
+ const COMPONENT_NAME$1H = 'vcm-checkbox';
6550
6550
  const MCheckbox = /* @__PURE__ */ vue.defineComponent({
6551
- name: COMPONENT_NAME$1G,
6551
+ name: COMPONENT_NAME$1H,
6552
6552
  props: props$1c,
6553
6553
  emits: ['update:modelValue', 'change'],
6554
6554
  setup(props, {
@@ -6588,9 +6588,9 @@ var VcComponents = (function (exports, vue) {
6588
6588
 
6589
6589
  /** @jsxImportSource vue */
6590
6590
 
6591
- const COMPONENT_NAME$1F = 'vcm-checkbox-group';
6591
+ const COMPONENT_NAME$1G = 'vcm-checkbox-group';
6592
6592
  const MCheckboxGroup = /* @__PURE__ */ vue.defineComponent({
6593
- name: COMPONENT_NAME$1F,
6593
+ name: COMPONENT_NAME$1G,
6594
6594
  props: props$1b,
6595
6595
  emits: ['update:modelValue', 'change'],
6596
6596
  setup(props, {
@@ -6649,9 +6649,9 @@ var VcComponents = (function (exports, vue) {
6649
6649
  }
6650
6650
  };
6651
6651
 
6652
- const COMPONENT_NAME$1E = "vc-customer";
6652
+ const COMPONENT_NAME$1F = "vc-customer";
6653
6653
  const Customer = vue.defineComponent({
6654
- name: COMPONENT_NAME$1E,
6654
+ name: COMPONENT_NAME$1F,
6655
6655
  props: props$19,
6656
6656
  setup(props, context) {
6657
6657
  return () => vue.h(() => {
@@ -6662,9 +6662,9 @@ var VcComponents = (function (exports, vue) {
6662
6662
 
6663
6663
  /** @jsxImportSource vue */
6664
6664
 
6665
- const COMPONENT_NAME$1D = 'vc-message';
6665
+ const COMPONENT_NAME$1E = 'vc-message';
6666
6666
  const MessageView = /* @__PURE__ */ vue.defineComponent({
6667
- name: COMPONENT_NAME$1D,
6667
+ name: COMPONENT_NAME$1E,
6668
6668
  emits: ['before-close', 'close', 'portal-fulfilled'],
6669
6669
  props: props$1a,
6670
6670
  setup(props, {
@@ -7224,7 +7224,7 @@ var VcComponents = (function (exports, vue) {
7224
7224
  }
7225
7225
  }
7226
7226
 
7227
- const COMPONENT_NAME$1C = "vc-portal";
7227
+ const COMPONENT_NAME$1D = "vc-portal";
7228
7228
  class Portal {
7229
7229
  /**
7230
7230
  * 清理Portals类型组件
@@ -7276,7 +7276,7 @@ var VcComponents = (function (exports, vue) {
7276
7276
  this.wrapper = wrapper;
7277
7277
  this.globalOptions = {
7278
7278
  ...options,
7279
- name: options?.name || wrapper.name || getUid(COMPONENT_NAME$1C)
7279
+ name: options?.name || wrapper.name || getUid(COMPONENT_NAME$1D)
7280
7280
  };
7281
7281
  }
7282
7282
  popup(propsData, options) {
@@ -7375,7 +7375,7 @@ var VcComponents = (function (exports, vue) {
7375
7375
  ...rest
7376
7376
  } = options;
7377
7377
  let useAllNodes = fragment;
7378
- const name = multiple ? `${name$}__${getUid(COMPONENT_NAME$1C)}` : name$;
7378
+ const name = multiple ? `${name$}__${getUid(COMPONENT_NAME$1D)}` : name$;
7379
7379
  const container = document.createElement(tag);
7380
7380
  const root = typeof el === "object" ? el : document.querySelector(el || "body");
7381
7381
  !alive && Portal.leafs.get(name)?.destroy();
@@ -7409,7 +7409,7 @@ var VcComponents = (function (exports, vue) {
7409
7409
  } else {
7410
7410
  const wrapper = this.wrapper;
7411
7411
  const app = vue.createApp({
7412
- name: COMPONENT_NAME$1C,
7412
+ name: COMPONENT_NAME$1D,
7413
7413
  parent,
7414
7414
  setup() {
7415
7415
  if (alive) {
@@ -7521,13 +7521,13 @@ var VcComponents = (function (exports, vue) {
7521
7521
  }
7522
7522
  };
7523
7523
 
7524
- const COMPONENT_NAME$1B = 'vc-portal-view';
7524
+ const COMPONENT_NAME$1C = 'vc-portal-view';
7525
7525
 
7526
7526
  /**
7527
7527
  * 写法不同,但与vue@2.x 保持一致
7528
7528
  */
7529
7529
  const PortalView = /* @__PURE__ */ vue.defineComponent({
7530
- name: COMPONENT_NAME$1B,
7530
+ name: COMPONENT_NAME$1C,
7531
7531
  props: props$18,
7532
7532
  setup(props, {
7533
7533
  slots
@@ -7698,9 +7698,9 @@ var VcComponents = (function (exports, vue) {
7698
7698
  return () => vue.h(props.tag, { onClick: handleClick, class: "vc-clipboard" }, slots?.default?.());
7699
7699
  };
7700
7700
 
7701
- const COMPONENT_NAME$1A = "vc-clipboard";
7701
+ const COMPONENT_NAME$1B = "vc-clipboard";
7702
7702
  const Clipboard$1 = vue.defineComponent({
7703
- name: COMPONENT_NAME$1A,
7703
+ name: COMPONENT_NAME$1B,
7704
7704
  props: props$17,
7705
7705
  setup() {
7706
7706
  return useClipboard((content) => Message.success({ content }));
@@ -7740,9 +7740,9 @@ var VcComponents = (function (exports, vue) {
7740
7740
 
7741
7741
  /** @jsxImportSource vue */
7742
7742
 
7743
- const COMPONENT_NAME$1z = 'vcm-toast';
7743
+ const COMPONENT_NAME$1A = 'vcm-toast';
7744
7744
  const MToastView = /* @__PURE__ */ vue.defineComponent({
7745
- name: COMPONENT_NAME$1z,
7745
+ name: COMPONENT_NAME$1A,
7746
7746
  emits: ['close', 'portal-fulfilled'],
7747
7747
  props: props$16,
7748
7748
  setup(props, {
@@ -7844,9 +7844,9 @@ var VcComponents = (function (exports, vue) {
7844
7844
  const error$2 = create$6({ mode: "error" });
7845
7845
  const MToast = Object.assign(MToastView, { destroy: destroy$4, info: info$2, success: success$2, loading, warning: warning$2, error: error$2 });
7846
7846
 
7847
- const COMPONENT_NAME$1y = "vcm-clipboard";
7847
+ const COMPONENT_NAME$1z = "vcm-clipboard";
7848
7848
  const MClipboard$1 = vue.defineComponent({
7849
- name: COMPONENT_NAME$1y,
7849
+ name: COMPONENT_NAME$1z,
7850
7850
  props: props$17,
7851
7851
  setup() {
7852
7852
  return useClipboard((content) => MToast.info({ content }));
@@ -7878,9 +7878,9 @@ var VcComponents = (function (exports, vue) {
7878
7878
  }
7879
7879
  };
7880
7880
 
7881
- const COMPONENT_NAME$1x = "vc-collapse";
7881
+ const COMPONENT_NAME$1y = "vc-collapse";
7882
7882
  const Collapse = vue.defineComponent({
7883
- name: COMPONENT_NAME$1x,
7883
+ name: COMPONENT_NAME$1y,
7884
7884
  props: props$15,
7885
7885
  emits: ["update:moodelValue", "change"],
7886
7886
  setup(props, { slots, emit }) {
@@ -7997,9 +7997,9 @@ var VcComponents = (function (exports, vue) {
7997
7997
  function _isSlot$3(s) {
7998
7998
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
7999
7999
  }
8000
- const COMPONENT_NAME$1w = 'vc-expand';
8000
+ const COMPONENT_NAME$1x = 'vc-expand';
8001
8001
  const Expand$1 = /* @__PURE__ */ vue.defineComponent({
8002
- name: COMPONENT_NAME$1w,
8002
+ name: COMPONENT_NAME$1x,
8003
8003
  props: props$13,
8004
8004
  setup(props, {
8005
8005
  slots
@@ -8029,9 +8029,9 @@ var VcComponents = (function (exports, vue) {
8029
8029
 
8030
8030
  /** @jsxImportSource vue */
8031
8031
 
8032
- const COMPONENT_NAME$1v = 'vc-collapse-item';
8032
+ const COMPONENT_NAME$1w = 'vc-collapse-item';
8033
8033
  const CollapseItem = /* @__PURE__ */ vue.defineComponent({
8034
- name: COMPONENT_NAME$1v,
8034
+ name: COMPONENT_NAME$1w,
8035
8035
  props: props$14,
8036
8036
  setup(props, {
8037
8037
  slots,
@@ -8106,9 +8106,9 @@ var VcComponents = (function (exports, vue) {
8106
8106
 
8107
8107
  /** @jsxImportSource vue */
8108
8108
 
8109
- const COMPONENT_NAME$1u = 'vc-color-picker';
8109
+ const COMPONENT_NAME$1v = 'vc-color-picker';
8110
8110
  const ColorPicker = /* @__PURE__ */ vue.defineComponent({
8111
- name: COMPONENT_NAME$1u,
8111
+ name: COMPONENT_NAME$1v,
8112
8112
  props: props$12,
8113
8113
  setup(props, {
8114
8114
  slots
@@ -8132,9 +8132,9 @@ var VcComponents = (function (exports, vue) {
8132
8132
 
8133
8133
  /** @jsxImportSource vue */
8134
8134
 
8135
- const COMPONENT_NAME$1t = 'vc-countdown';
8135
+ const COMPONENT_NAME$1u = 'vc-countdown';
8136
8136
  const Countdown = /* @__PURE__ */ vue.defineComponent({
8137
- name: COMPONENT_NAME$1t,
8137
+ name: COMPONENT_NAME$1u,
8138
8138
  props: props$11,
8139
8139
  setup(props, {
8140
8140
  slots
@@ -8648,9 +8648,9 @@ var VcComponents = (function (exports, vue) {
8648
8648
 
8649
8649
  /** @jsxImportSource vue */
8650
8650
 
8651
- const COMPONENT_NAME$1s = 'vc-input';
8651
+ const COMPONENT_NAME$1t = 'vc-input';
8652
8652
  const Input = /* @__PURE__ */ vue.defineComponent({
8653
- name: COMPONENT_NAME$1s,
8653
+ name: COMPONENT_NAME$1t,
8654
8654
  inheritAttrs: false,
8655
8655
  props: {
8656
8656
  ...props$$,
@@ -8984,9 +8984,9 @@ var VcComponents = (function (exports, vue) {
8984
8984
 
8985
8985
  /** @jsxImportSource vue */
8986
8986
 
8987
- const COMPONENT_NAME$1r = 'vc-input-number';
8987
+ const COMPONENT_NAME$1s = 'vc-input-number';
8988
8988
  const InputNumber = /* @__PURE__ */ vue.defineComponent({
8989
- name: COMPONENT_NAME$1r,
8989
+ name: COMPONENT_NAME$1s,
8990
8990
  props: props$X,
8991
8991
  inheritAttrs: false,
8992
8992
  setup(props, {
@@ -9050,9 +9050,9 @@ var VcComponents = (function (exports, vue) {
9050
9050
 
9051
9051
  /** @jsxImportSource vue */
9052
9052
 
9053
- const COMPONENT_NAME$1q = 'vc-input-search';
9053
+ const COMPONENT_NAME$1r = 'vc-input-search';
9054
9054
  const InputSearch = /* @__PURE__ */ vue.defineComponent({
9055
- name: COMPONENT_NAME$1q,
9055
+ name: COMPONENT_NAME$1r,
9056
9056
  props: props$W,
9057
9057
  inheritAttrs: false,
9058
9058
  setup(props, {
@@ -9343,9 +9343,9 @@ var VcComponents = (function (exports, vue) {
9343
9343
  function _isSlot$2(s) {
9344
9344
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
9345
9345
  }
9346
- const COMPONENT_NAME$1p = 'vc-popover-wrapper';
9346
+ const COMPONENT_NAME$1q = 'vc-popover-wrapper';
9347
9347
  const PopoverWrapper = /* @__PURE__ */ vue.defineComponent({
9348
- name: COMPONENT_NAME$1p,
9348
+ name: COMPONENT_NAME$1q,
9349
9349
  props: props$_,
9350
9350
  emits: ['portal-fulfilled', 'close'],
9351
9351
  setup(props, {
@@ -9595,9 +9595,9 @@ var VcComponents = (function (exports, vue) {
9595
9595
 
9596
9596
  /** @jsxImportSource vue */
9597
9597
 
9598
- const COMPONENT_NAME$1o = 'vc-popover';
9598
+ const COMPONENT_NAME$1p = 'vc-popover';
9599
9599
  const Popover$1 = /* @__PURE__ */ vue.defineComponent({
9600
- name: COMPONENT_NAME$1o,
9600
+ name: COMPONENT_NAME$1p,
9601
9601
  props: props$Z,
9602
9602
  emits: ['update:modelValue', 'visible-change', 'ready', 'close'],
9603
9603
  setup(props, {
@@ -10698,9 +10698,9 @@ var VcComponents = (function (exports, vue) {
10698
10698
  }
10699
10699
  return view;
10700
10700
  };
10701
- const COMPONENT_NAME$1n = 'vc-date-confirm';
10701
+ const COMPONENT_NAME$1o = 'vc-date-confirm';
10702
10702
  const Confirm = /* @__PURE__ */ vue.defineComponent({
10703
- name: COMPONENT_NAME$1n,
10703
+ name: COMPONENT_NAME$1o,
10704
10704
  props: {
10705
10705
  showTime: {
10706
10706
  type: Boolean,
@@ -10764,9 +10764,9 @@ var VcComponents = (function (exports, vue) {
10764
10764
 
10765
10765
  /** @jsxImportSource vue */
10766
10766
 
10767
- const COMPONENT_NAME$1m = 'vc-date-header';
10767
+ const COMPONENT_NAME$1n = 'vc-date-header';
10768
10768
  const DateHeader = /* @__PURE__ */ vue.defineComponent({
10769
- name: COMPONENT_NAME$1m,
10769
+ name: COMPONENT_NAME$1n,
10770
10770
  props: {
10771
10771
  panelDate: Date,
10772
10772
  showNext: {
@@ -10850,9 +10850,9 @@ var VcComponents = (function (exports, vue) {
10850
10850
 
10851
10851
  /** @jsxImportSource vue */
10852
10852
 
10853
- const COMPONENT_NAME$1l = 'vc-date-table';
10853
+ const COMPONENT_NAME$1m = 'vc-date-table';
10854
10854
  const DateTable = /* @__PURE__ */ vue.defineComponent({
10855
- name: COMPONENT_NAME$1l,
10855
+ name: COMPONENT_NAME$1m,
10856
10856
  props: {
10857
10857
  value: Array,
10858
10858
  firstDayOfWeek: {
@@ -11061,9 +11061,9 @@ var VcComponents = (function (exports, vue) {
11061
11061
 
11062
11062
  /** @jsxImportSource vue */
11063
11063
 
11064
- const COMPONENT_NAME$1k = 'vc-month-table';
11064
+ const COMPONENT_NAME$1l = 'vc-month-table';
11065
11065
  const MonthTable = /* @__PURE__ */ vue.defineComponent({
11066
- name: COMPONENT_NAME$1k,
11066
+ name: COMPONENT_NAME$1l,
11067
11067
  props: {
11068
11068
  value: Array,
11069
11069
  panelDate: Date,
@@ -11195,7 +11195,7 @@ var VcComponents = (function (exports, vue) {
11195
11195
 
11196
11196
  /** @jsxImportSource vue */
11197
11197
 
11198
- const COMPONENT_NAME$1j = 'vc-quarter-table';
11198
+ const COMPONENT_NAME$1k = 'vc-quarter-table';
11199
11199
 
11200
11200
  /**
11201
11201
  * 获取季度对应的月份范围
@@ -11229,7 +11229,7 @@ var VcComponents = (function (exports, vue) {
11229
11229
  }
11230
11230
  };
11231
11231
  const QuarterTable = /* @__PURE__ */ vue.defineComponent({
11232
- name: COMPONENT_NAME$1j,
11232
+ name: COMPONENT_NAME$1k,
11233
11233
  props: {
11234
11234
  value: Array,
11235
11235
  panelDate: Date,
@@ -11352,9 +11352,9 @@ var VcComponents = (function (exports, vue) {
11352
11352
 
11353
11353
  /** @jsxImportSource vue */
11354
11354
 
11355
- const COMPONENT_NAME$1i = 'vc-shortcuts-select';
11355
+ const COMPONENT_NAME$1j = 'vc-shortcuts-select';
11356
11356
  const ShortcutsSelect = /* @__PURE__ */ vue.defineComponent({
11357
- name: COMPONENT_NAME$1i,
11357
+ name: COMPONENT_NAME$1j,
11358
11358
  props: {
11359
11359
  panelDate: Date,
11360
11360
  config: Array,
@@ -11394,9 +11394,9 @@ var VcComponents = (function (exports, vue) {
11394
11394
 
11395
11395
  /** @jsxImportSource vue */
11396
11396
 
11397
- const COMPONENT_NAME$1h = 'vc-time-select';
11397
+ const COMPONENT_NAME$1i = 'vc-time-select';
11398
11398
  const TimeSelect = /* @__PURE__ */ vue.defineComponent({
11399
- name: COMPONENT_NAME$1h,
11399
+ name: COMPONENT_NAME$1i,
11400
11400
  props: {
11401
11401
  hours: {
11402
11402
  type: [Number, String],
@@ -11675,9 +11675,9 @@ var VcComponents = (function (exports, vue) {
11675
11675
 
11676
11676
  /** @jsxImportSource vue */
11677
11677
 
11678
- const COMPONENT_NAME$1g = 'vc-year-table';
11678
+ const COMPONENT_NAME$1h = 'vc-year-table';
11679
11679
  const YearTable = /* @__PURE__ */ vue.defineComponent({
11680
- name: COMPONENT_NAME$1g,
11680
+ name: COMPONENT_NAME$1h,
11681
11681
  props: {
11682
11682
  value: Array,
11683
11683
  panelDate: Date,
@@ -11800,9 +11800,9 @@ var VcComponents = (function (exports, vue) {
11800
11800
  }
11801
11801
  return true;
11802
11802
  };
11803
- const COMPONENT_NAME$1f = 'vc-date-range-panel';
11803
+ const COMPONENT_NAME$1g = 'vc-date-range-panel';
11804
11804
  const DateRangePanel = /* @__PURE__ */ vue.defineComponent({
11805
- name: COMPONENT_NAME$1f,
11805
+ name: COMPONENT_NAME$1g,
11806
11806
  props: {
11807
11807
  ...props$V,
11808
11808
  confirm: {
@@ -12181,9 +12181,9 @@ var VcComponents = (function (exports, vue) {
12181
12181
 
12182
12182
  /** @jsxImportSource vue */
12183
12183
 
12184
- const COMPONENT_NAME$1e = 'vc-date-panel';
12184
+ const COMPONENT_NAME$1f = 'vc-date-panel';
12185
12185
  const DatePanel = /* @__PURE__ */ vue.defineComponent({
12186
- name: COMPONENT_NAME$1e,
12186
+ name: COMPONENT_NAME$1f,
12187
12187
  props: {
12188
12188
  ...props$V,
12189
12189
  type: String,
@@ -12391,9 +12391,9 @@ var VcComponents = (function (exports, vue) {
12391
12391
  const endYear = value[1].getFullYear();
12392
12392
  return startYear === endYear;
12393
12393
  };
12394
- const COMPONENT_NAME$1d = 'vc-monthrange-panel';
12394
+ const COMPONENT_NAME$1e = 'vc-monthrange-panel';
12395
12395
  const MonthRangePanel = /* @__PURE__ */ vue.defineComponent({
12396
- name: COMPONENT_NAME$1d,
12396
+ name: COMPONENT_NAME$1e,
12397
12397
  props: {
12398
12398
  ...props$V,
12399
12399
  confirm: {
@@ -12568,9 +12568,9 @@ var VcComponents = (function (exports, vue) {
12568
12568
  const endYear = value[1].getFullYear();
12569
12569
  return startYear === endYear;
12570
12570
  };
12571
- const COMPONENT_NAME$1c = 'vc-quarterrange-panel';
12571
+ const COMPONENT_NAME$1d = 'vc-quarterrange-panel';
12572
12572
  const QuarterRangePanel = /* @__PURE__ */ vue.defineComponent({
12573
- name: COMPONENT_NAME$1c,
12573
+ name: COMPONENT_NAME$1d,
12574
12574
  props: {
12575
12575
  ...props$V,
12576
12576
  confirm: {
@@ -12809,9 +12809,9 @@ var VcComponents = (function (exports, vue) {
12809
12809
  seconds
12810
12810
  };
12811
12811
  };
12812
- const COMPONENT_NAME$1b = 'vc-timerange-panel';
12812
+ const COMPONENT_NAME$1c = 'vc-timerange-panel';
12813
12813
  const TimeRangePanel = /* @__PURE__ */ vue.defineComponent({
12814
- name: COMPONENT_NAME$1b,
12814
+ name: COMPONENT_NAME$1c,
12815
12815
  props: props$U,
12816
12816
  emits: ['pick', 'clear', 'ok'],
12817
12817
  setup(props, {
@@ -12910,9 +12910,9 @@ var VcComponents = (function (exports, vue) {
12910
12910
 
12911
12911
  /** @jsxImportSource vue */
12912
12912
 
12913
- const COMPONENT_NAME$1a = 'vc-time-panel';
12913
+ const COMPONENT_NAME$1b = 'vc-time-panel';
12914
12914
  const TimePanel = /* @__PURE__ */ vue.defineComponent({
12915
- name: COMPONENT_NAME$1a,
12915
+ name: COMPONENT_NAME$1b,
12916
12916
  props: props$U,
12917
12917
  emits: ['pick', 'clear', 'ok'],
12918
12918
  setup(props, {
@@ -12967,7 +12967,7 @@ var VcComponents = (function (exports, vue) {
12967
12967
 
12968
12968
  /** @jsxImportSource vue */
12969
12969
 
12970
- const COMPONENT_NAME$19 = 'vc-date-picker';
12970
+ const COMPONENT_NAME$1a = 'vc-date-picker';
12971
12971
  const getPanel$1 = type => {
12972
12972
  if (['daterange', 'datetimerange'].includes(type)) {
12973
12973
  return DateRangePanel;
@@ -12978,7 +12978,7 @@ var VcComponents = (function (exports, vue) {
12978
12978
  }
12979
12979
  return DatePanel;
12980
12980
  };
12981
- const DatePicker = createPicker(COMPONENT_NAME$19, props$10, () => {
12981
+ const DatePicker = createPicker(COMPONENT_NAME$1a, props$10, () => {
12982
12982
  const props = vue.getCurrentInstance().props;
12983
12983
  const icon = vue.ref('date');
12984
12984
  const panel = vue.shallowRef({});
@@ -13011,9 +13011,9 @@ var VcComponents = (function (exports, vue) {
13011
13011
 
13012
13012
  /** @jsxImportSource vue */
13013
13013
 
13014
- const COMPONENT_NAME$18 = 'vc-divider';
13014
+ const COMPONENT_NAME$19 = 'vc-divider';
13015
13015
  const Divider = /* @__PURE__ */ vue.defineComponent({
13016
- name: COMPONENT_NAME$18,
13016
+ name: COMPONENT_NAME$19,
13017
13017
  props: props$T,
13018
13018
  setup(props, {
13019
13019
  slots
@@ -13168,7 +13168,7 @@ var VcComponents = (function (exports, vue) {
13168
13168
 
13169
13169
  /** @jsxImportSource vue */
13170
13170
 
13171
- const COMPONENT_NAME$17 = 'vc-scroller-track';
13171
+ const COMPONENT_NAME$18 = 'vc-scroller-track';
13172
13172
  const BAR_MAP = {
13173
13173
  vertical: {
13174
13174
  scroll: 'scrollTop',
@@ -13188,7 +13188,7 @@ var VcComponents = (function (exports, vue) {
13188
13188
  }
13189
13189
  };
13190
13190
  const Track$1 = /* @__PURE__ */ vue.defineComponent({
13191
- name: COMPONENT_NAME$17,
13191
+ name: COMPONENT_NAME$18,
13192
13192
  props: props$S,
13193
13193
  emits: ['change'],
13194
13194
  inheritAttrs: false,
@@ -13378,9 +13378,9 @@ var VcComponents = (function (exports, vue) {
13378
13378
 
13379
13379
  /** @jsxImportSource vue */
13380
13380
 
13381
- const COMPONENT_NAME$16 = 'vc-scroller-bar';
13381
+ const COMPONENT_NAME$17 = 'vc-scroller-bar';
13382
13382
  const Bar = /* @__PURE__ */ vue.defineComponent({
13383
- name: COMPONENT_NAME$16,
13383
+ name: COMPONENT_NAME$17,
13384
13384
  props: props$R,
13385
13385
  emits: ['change'],
13386
13386
  setup(props, {
@@ -13595,7 +13595,7 @@ var VcComponents = (function (exports, vue) {
13595
13595
 
13596
13596
  /** @jsxImportSource vue */
13597
13597
 
13598
- const COMPONENT_NAME$15 = 'vc-scroller';
13598
+ const COMPONENT_NAME$16 = 'vc-scroller';
13599
13599
 
13600
13600
  /**
13601
13601
  * 作为备选方案,目前推荐使用ScrollerWheel
@@ -13606,7 +13606,7 @@ var VcComponents = (function (exports, vue) {
13606
13606
  * 2. 增加了一层嵌套
13607
13607
  */
13608
13608
  const Scroller = /* @__PURE__ */ vue.defineComponent({
13609
- name: COMPONENT_NAME$15,
13609
+ name: COMPONENT_NAME$16,
13610
13610
  props: props$Q,
13611
13611
  emits: ['scroll'],
13612
13612
  setup(props, {
@@ -14556,7 +14556,7 @@ var VcComponents = (function (exports, vue) {
14556
14556
 
14557
14557
  /** @jsxImportSource vue */
14558
14558
 
14559
- const COMPONENT_NAME$14 = 'vc-scroller-wheel';
14559
+ const COMPONENT_NAME$15 = 'vc-scroller-wheel';
14560
14560
 
14561
14561
  /**
14562
14562
  * 为减少一层嵌套,为去除滚动bar的抖动,使用wheel模拟
@@ -14578,7 +14578,7 @@ var VcComponents = (function (exports, vue) {
14578
14578
  * 设置scrollTop不会reflow和repaint,不需要考虑transfrom来改变content(transform也只在draw完成)
14579
14579
  */
14580
14580
  const ScrollerWheel = /* @__PURE__ */ vue.defineComponent({
14581
- name: COMPONENT_NAME$14,
14581
+ name: COMPONENT_NAME$15,
14582
14582
  props: Object.assign(props$Q, {
14583
14583
  stopPropagation: {
14584
14584
  type: Boolean,
@@ -14767,9 +14767,9 @@ var VcComponents = (function (exports, vue) {
14767
14767
 
14768
14768
  /** @jsxImportSource vue */
14769
14769
 
14770
- const COMPONENT_NAME$13 = 'vc-drawer';
14770
+ const COMPONENT_NAME$14 = 'vc-drawer';
14771
14771
  const DrawerView = /* @__PURE__ */ vue.defineComponent({
14772
- name: COMPONENT_NAME$13,
14772
+ name: COMPONENT_NAME$14,
14773
14773
  props: props$P,
14774
14774
  emits: ['close', 'update:modelValue', 'visible-change'],
14775
14775
  setup(props, {
@@ -14945,9 +14945,9 @@ var VcComponents = (function (exports, vue) {
14945
14945
 
14946
14946
  /** @jsxImportSource vue */
14947
14947
 
14948
- const COMPONENT_NAME$12 = 'vc-dropdown';
14948
+ const COMPONENT_NAME$13 = 'vc-dropdown';
14949
14949
  const Dropdown = /* @__PURE__ */ vue.defineComponent({
14950
- name: COMPONENT_NAME$12,
14950
+ name: COMPONENT_NAME$13,
14951
14951
  props: props$O,
14952
14952
  setup(props, {
14953
14953
  slots
@@ -14971,9 +14971,9 @@ var VcComponents = (function (exports, vue) {
14971
14971
 
14972
14972
  /** @jsxImportSource vue */
14973
14973
 
14974
- const COMPONENT_NAME$11 = 'vc-editor';
14974
+ const COMPONENT_NAME$12 = 'vc-editor';
14975
14975
  const Editor = /* @__PURE__ */ vue.defineComponent({
14976
- name: COMPONENT_NAME$11,
14976
+ name: COMPONENT_NAME$12,
14977
14977
  props: props$N,
14978
14978
  setup(props, {
14979
14979
  slots
@@ -15117,9 +15117,9 @@ var VcComponents = (function (exports, vue) {
15117
15117
  });
15118
15118
  };
15119
15119
 
15120
- const COMPONENT_NAME$10 = "vc-form";
15120
+ const COMPONENT_NAME$11 = "vc-form";
15121
15121
  const Form = vue.defineComponent({
15122
- name: COMPONENT_NAME$10,
15122
+ name: COMPONENT_NAME$11,
15123
15123
  props: props$M,
15124
15124
  setup(props, { slots, expose }) {
15125
15125
  useForm(expose);
@@ -15576,9 +15576,9 @@ var VcComponents = (function (exports, vue) {
15576
15576
 
15577
15577
  /** @jsxImportSource vue */
15578
15578
 
15579
- const COMPONENT_NAME$$ = 'vc-form-item';
15579
+ const COMPONENT_NAME$10 = 'vc-form-item';
15580
15580
  const FormItem = /* @__PURE__ */ vue.defineComponent({
15581
- name: COMPONENT_NAME$$,
15581
+ name: COMPONENT_NAME$10,
15582
15582
  props: props$L,
15583
15583
  setup(props, {
15584
15584
  slots,
@@ -15643,9 +15643,9 @@ var VcComponents = (function (exports, vue) {
15643
15643
  }
15644
15644
  };
15645
15645
 
15646
- const COMPONENT_NAME$_ = "vcm-form";
15646
+ const COMPONENT_NAME$$ = "vcm-form";
15647
15647
  const MForm = vue.defineComponent({
15648
- name: COMPONENT_NAME$_,
15648
+ name: COMPONENT_NAME$$,
15649
15649
  props: props$K,
15650
15650
  setup(props, { slots, expose }) {
15651
15651
  useForm(expose, {
@@ -15676,9 +15676,9 @@ var VcComponents = (function (exports, vue) {
15676
15676
 
15677
15677
  /** @jsxImportSource vue */
15678
15678
 
15679
- const COMPONENT_NAME$Z = 'vcm-form-item';
15679
+ const COMPONENT_NAME$_ = 'vcm-form-item';
15680
15680
  const MFormItem = /* @__PURE__ */ vue.defineComponent({
15681
- name: COMPONENT_NAME$Z,
15681
+ name: COMPONENT_NAME$_,
15682
15682
  props: props$J,
15683
15683
  setup(props, {
15684
15684
  slots,
@@ -15732,9 +15732,9 @@ var VcComponents = (function (exports, vue) {
15732
15732
  }
15733
15733
  });
15734
15734
 
15735
- const COMPONENT_NAME$Y = "vc-fragment";
15735
+ const COMPONENT_NAME$Z = "vc-fragment";
15736
15736
  const Fragment = vue.defineComponent({
15737
- name: COMPONENT_NAME$Y,
15737
+ name: COMPONENT_NAME$Z,
15738
15738
  setup(_, { slots }) {
15739
15739
  return () => vue.h(vue.Fragment, slots.default?.());
15740
15740
  }
@@ -15751,9 +15751,9 @@ var VcComponents = (function (exports, vue) {
15751
15751
 
15752
15752
  /** @jsxImportSource vue */
15753
15753
 
15754
- const COMPONENT_NAME$X = 'vc-html-to-image';
15754
+ const COMPONENT_NAME$Y = 'vc-html-to-image';
15755
15755
  const HTMLToImage = /* @__PURE__ */ vue.defineComponent({
15756
- name: COMPONENT_NAME$X,
15756
+ name: COMPONENT_NAME$Y,
15757
15757
  props: props$I,
15758
15758
  setup(props, {
15759
15759
  slots
@@ -15771,804 +15771,128 @@ var VcComponents = (function (exports, vue) {
15771
15771
  const MIcon = Icon;
15772
15772
 
15773
15773
  const props$H = {
15774
- src: String,
15775
- fit: String,
15776
- lazy: Boolean,
15777
- wrapper: [Object, String]
15774
+ tag: {
15775
+ type: String,
15776
+ default: "div"
15777
+ }
15778
15778
  };
15779
15779
 
15780
- class ACache {
15781
- options;
15782
- constructor() {
15783
- this.options = {
15784
- version: "",
15785
- get: (v) => flattenJSONParse(v),
15786
- set: (v) => v
15787
- };
15788
- }
15789
- configure(options) {
15790
- if (typeof window === "undefined")
15791
- return;
15792
- this.options = {
15793
- ...this.options,
15794
- ...options
15780
+ /** @jsxImportSource vue */
15781
+
15782
+ const COMPONENT_NAME$X = 'vc-image-preview';
15783
+ const ImagePreview$1 = /* @__PURE__ */ vue.defineComponent({
15784
+ name: COMPONENT_NAME$X,
15785
+ props: props$H,
15786
+ setup(props, {
15787
+ slots
15788
+ }) {
15789
+ return () => {
15790
+ return vue.createVNode("div", {
15791
+ "class": "vc-image-preview"
15792
+ }, [slots?.default?.()]);
15795
15793
  };
15796
15794
  }
15797
- }
15795
+ });
15798
15796
 
15799
- (() => {
15800
- try {
15801
- document.cookie = "test";
15802
- return true;
15803
- } catch (_) {
15804
- return false;
15805
- }
15806
- })();
15797
+ /*!
15798
+ * PhotoSwipe Lightbox 5.4.4 - https://photoswipe.com
15799
+ * (c) 2024 Dmytro Semenov
15800
+ */
15801
+ /** @typedef {import('../photoswipe.js').Point} Point */
15807
15802
 
15808
- class MemoryStorage {
15809
- store = {};
15810
- getItem(key) {
15811
- return this.store[key] || null;
15803
+ /**
15804
+ * @template {keyof HTMLElementTagNameMap} T
15805
+ * @param {string} className
15806
+ * @param {T} tagName
15807
+ * @param {Node} [appendToEl]
15808
+ * @returns {HTMLElementTagNameMap[T]}
15809
+ */
15810
+ function createElement$2(className, tagName, appendToEl) {
15811
+ const el = document.createElement(tagName);
15812
+
15813
+ if (className) {
15814
+ el.className = className;
15812
15815
  }
15813
- setItem(key, val) {
15814
- this.store[key] = val;
15816
+
15817
+ if (appendToEl) {
15818
+ appendToEl.appendChild(el);
15815
15819
  }
15816
- removeItem(key) {
15817
- delete this.store[key];
15820
+
15821
+ return el;
15822
+ }
15823
+ /**
15824
+ * Get transform string
15825
+ *
15826
+ * @param {number} x
15827
+ * @param {number} [y]
15828
+ * @param {number} [scale]
15829
+ * @returns {string}
15830
+ */
15831
+
15832
+ function toTransformString$1(x, y, scale) {
15833
+ let propValue = `translate3d(${x}px,${0}px,0)`;
15834
+
15835
+ if (scale !== undefined) {
15836
+ propValue += ` scale3d(${scale},${scale},1)`;
15818
15837
  }
15838
+
15839
+ return propValue;
15840
+ }
15841
+ /**
15842
+ * Apply width and height CSS properties to element
15843
+ *
15844
+ * @param {HTMLElement} el
15845
+ * @param {string | number} w
15846
+ * @param {string | number} h
15847
+ */
15848
+
15849
+ function setWidthHeight$1(el, w, h) {
15850
+ el.style.width = typeof w === 'number' ? `${w}px` : w;
15851
+ el.style.height = typeof h === 'number' ? `${h}px` : h;
15819
15852
  }
15853
+ /** @typedef {LOAD_STATE[keyof LOAD_STATE]} LoadState */
15820
15854
 
15821
- const PREFIX_NAME = "@deot/helper/";
15822
- const formatKey = (key, version) => {
15823
- return `${version ? `${PREFIX_NAME}${version}:` : ""}${key}`;
15855
+ /** @type {{ IDLE: 'idle'; LOADING: 'loading'; LOADED: 'loaded'; ERROR: 'error' }} */
15856
+
15857
+ const LOAD_STATE$1 = {
15858
+ IDLE: 'idle',
15859
+ LOADING: 'loading',
15860
+ LOADED: 'loaded',
15861
+ ERROR: 'error'
15824
15862
  };
15825
- const ALLOW$1 = (() => {
15826
- const test = "test";
15827
- try {
15828
- window.localStorage.setItem(test, test);
15829
- window.localStorage.removeItem(test);
15830
- return true;
15831
- } catch (_) {
15832
- return false;
15833
- }
15834
- })();
15835
- class StorageStore extends ACache {
15836
- sessionStorage = new MemoryStorage();
15837
- localStorage = new MemoryStorage();
15838
- getInvoke(options) {
15839
- return options?.session ? "sessionStorage" : "localStorage";
15840
- }
15841
- configure(options) {
15842
- super.configure(options);
15843
- if (!ALLOW$1)
15844
- return;
15845
- const { version } = this.options;
15846
- Object.keys(window.localStorage).forEach((item) => {
15847
- /* istanbul ignore else -- @preserve */
15848
- if (item.includes(PREFIX_NAME) && !item.includes(`${PREFIX_NAME}${version}`)) {
15849
- window.localStorage.removeItem(item);
15850
- }
15851
- });
15852
- }
15853
- /**
15854
- * 设置缓存
15855
- * @param key 保存的键值
15856
- * @param value 保存的内容
15857
- * @param options ~
15858
- */
15859
- set(key, value, options) {
15860
- if (!ALLOW$1)
15861
- return;
15862
- const invoke = this.getInvoke(options);
15863
- key = formatKey(key, this.options.version);
15864
- value = this.options.set(typeof value === "string" ? value : JSON.stringify(value));
15865
- try {
15866
- window[invoke].setItem(key, value);
15867
- } catch (error) {
15868
- this[invoke].setItem(key, value);
15869
- }
15870
- }
15871
- /**
15872
- * 获取缓存
15873
- * @param key 保存的键值
15874
- * @param options ~
15875
- * @returns ~
15876
- */
15877
- get(key, options) {
15878
- if (!ALLOW$1)
15879
- return null;
15880
- const invoke = this.getInvoke(options);
15881
- key = formatKey(key, this.options.version);
15882
- const value = this[invoke].getItem(key) || window[invoke].getItem(key);
15883
- return this.options.get(value);
15884
- }
15885
- /**
15886
- * 删除缓存
15887
- * @param key 键值
15888
- * @param options ~
15889
- */
15890
- remove(key, options) {
15891
- if (!ALLOW$1)
15892
- return;
15893
- const invoke = this.getInvoke(options);
15894
- key = formatKey(key, this.options.version);
15895
- this[invoke].removeItem(key);
15896
- window[invoke].removeItem(key);
15897
- }
15863
+ /**
15864
+ * Check if click or keydown event was dispatched
15865
+ * with a special key or via mouse wheel.
15866
+ *
15867
+ * @param {MouseEvent | KeyboardEvent} e
15868
+ * @returns {boolean}
15869
+ */
15870
+
15871
+ function specialKeyUsed$1(e) {
15872
+ return 'button' in e && e.button === 1 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey;
15898
15873
  }
15899
- const Storage$1 = new StorageStore();
15874
+ /**
15875
+ * Parse `gallery` or `children` options.
15876
+ *
15877
+ * @param {import('../photoswipe.js').ElementProvider} [option]
15878
+ * @param {string} [legacySelector]
15879
+ * @param {HTMLElement | Document} [parent]
15880
+ * @returns HTMLElement[]
15881
+ */
15900
15882
 
15901
- const ALLOW = (() => {
15902
- try {
15903
- window.indexedDB.open;
15904
- return true;
15905
- } catch (_) {
15906
- return false;
15907
- }
15908
- })();
15909
- class IndexedDBStore extends ACache {
15910
- timestramp = (/* @__PURE__ */ new Date()).getTime();
15911
- count = 0;
15912
- db = null;
15913
- pending = [];
15914
- constructor(options) {
15915
- super();
15916
- this.options = {
15917
- ...this.options,
15918
- keyPath: "__id",
15919
- name: "default-db",
15920
- storeName: "default-store",
15921
- version: 1
15922
- };
15923
- options && this.configure(options);
15924
- }
15925
- getUid() {
15926
- return `${this.timestramp}${this.count++}`;
15927
- }
15928
- configure(options) {
15929
- super.configure(options);
15930
- if (typeof this.options.version === "string") {
15931
- this.options.version = parseInt(this.options.version, 10);
15932
- }
15933
- }
15934
- /**
15935
- * 每次操作完要关闭
15936
- * 1. 浏览器上不关闭的话,删库操作会卡一会
15937
- * 2. fake-indexeddb不关闭会卡死
15938
- * @param fn ~
15939
- * @returns ~
15940
- */
15941
- concurrent(fn) {
15942
- const target = new Promise((resolve, reject) => {
15943
- fn().then(resolve).catch(reject);
15944
- });
15945
- this.pending.push(target);
15946
- target.finally(() => this.close(target));
15947
- return target;
15948
- }
15949
- /**
15950
- * 统一处理
15951
- * @param request ~
15952
- * @returns ~
15953
- */
15954
- async task(request) {
15955
- return new Promise((resolve, reject) => {
15956
- request.onsuccess = resolve;
15957
- request.onerror = reject;
15958
- });
15959
- }
15960
- /**
15961
- * @param target ~
15962
- */
15963
- async close(target) {
15964
- if (target) {
15965
- this.pending = this.pending.filter((i) => i !== target);
15966
- } else {
15967
- const done = async (pending) => {
15968
- if (pending.length) {
15969
- await Promise.allSettled(pending);
15970
- await done(this.pending);
15971
- }
15972
- };
15973
- await done(this.pending);
15974
- }
15975
- if (!this.pending.length && this.db) {
15976
- const db = this.db;
15977
- this.db = null;
15978
- (await db).close();
15979
- }
15980
- }
15981
- /**
15982
- * 打开数据库。变更时候更新表
15983
- * @returns ~
15984
- */
15985
- openDatabase() {
15986
- this.db = this.db || (async () => {
15987
- const { name, version, keyPath, storeName } = this.options;
15988
- const poll = () => new Promise((resolve, reject) => {
15989
- const request = window.indexedDB.open(name, version);
15990
- request.onsuccess = () => {
15991
- resolve(request.result);
15992
- };
15993
- request.onerror = /* istanbul ignore next */
15994
- () => {
15995
- reject(new Error("IndexedDB Open Failed. DeleteDatabase first!"));
15996
- };
15997
- request.onupgradeneeded = () => {
15998
- const db2 = request.result;
15999
- if (db2.objectStoreNames.contains(storeName)) {
16000
- db2.deleteObjectStore(storeName);
16001
- }
16002
- db2.createObjectStore(storeName, { keyPath });
16003
- };
16004
- });
16005
- const maxTries = 3;
16006
- let db;
16007
- for (let tries = 0; tries < maxTries; tries++) {
16008
- try {
16009
- db = await poll();
16010
- } catch (_) {
16011
- }
16012
- /* istanbul ignore next -- @preserve */
16013
- if (db || tries === maxTries - 1) {
16014
- break;
16015
- }
16016
- }
16017
- /* istanbul ignore next -- @preserve */
16018
- if (!db) {
16019
- await this.deleteDatabase();
16020
- db = await poll();
16021
- }
16022
- return db;
16023
- })();
16024
- return this.db;
16025
- }
16026
- /**
16027
- * 打开表
16028
- * tip: db.close() 执行后
16029
- * db打开后的表os对象仍可写入(浏览器支持,fake-indexeddb不支持)
16030
- * 不过正常理解也应该操作所有后再关闭,这里不修改`this.db -> this.os`的逻辑
16031
- * @param mode ~
16032
- * @returns ~
16033
- */
16034
- async openObjectStore(mode) {
16035
- const { storeName } = this.options;
16036
- const db = await this.openDatabase();
16037
- const os = db.transaction([storeName], mode || "readwrite").objectStore(storeName);
16038
- return os;
16039
- }
16040
- /**
16041
- * 删库
16042
- */
16043
- async deleteDatabase() {
16044
- const { name } = this.options;
16045
- const request = window.indexedDB.deleteDatabase(name);
16046
- await new Promise((resolve, reject) => {
16047
- request.onsuccess = resolve;
16048
- request.onerror = reject;
16049
- });
16050
- }
16051
- /**
16052
- * 新增数据,通过事务完成。
16053
- * @param data ~
16054
- * @returns ~
16055
- */
16056
- write(data) {
16057
- return this.concurrent(async () => {
16058
- const { keyPath } = this.options;
16059
- const os = await this.openObjectStore();
16060
- const state = {
16061
- [keyPath]: this.getUid(),
16062
- ...data
16063
- };
16064
- const request = os.add(state);
16065
- await new Promise((resolve, reject) => {
16066
- request.onsuccess = resolve;
16067
- request.onerror = reject;
16068
- });
16069
- return state;
16070
- });
16071
- }
16072
- /**
16073
- * 读取数据,通过事务完成。
16074
- * @param id ~
16075
- * @returns ~
16076
- */
16077
- read(id) {
16078
- return this.concurrent(async () => {
16079
- const os = await this.openObjectStore();
16080
- const request = os.get(id);
16081
- await this.task(request);
16082
- return request.result;
16083
- });
16084
- }
16085
- /**
16086
- * 更新数据,通过事务完成。
16087
- * @param id ~
16088
- * @param data ~
16089
- * @returns ~
16090
- */
16091
- update(id, data) {
16092
- return this.concurrent(async () => {
16093
- const { keyPath } = this.options;
16094
- const os = await this.openObjectStore();
16095
- const state = {
16096
- [keyPath]: id,
16097
- ...data
16098
- };
16099
- const request = os.put(state);
16100
- await this.task(request);
16101
- return state;
16102
- });
16103
- }
16104
- /**
16105
- * 删除数据也是通过事务完成。
16106
- * @param id ~
16107
- * @returns ~
16108
- */
16109
- async delete(id) {
16110
- return this.concurrent(async () => {
16111
- const os = await this.openObjectStore();
16112
- const request = os.delete(id);
16113
- await this.task(request);
16114
- });
16115
- }
16116
- /**
16117
- * 搜索数据,通过事务完成。
16118
- * @returns ~
16119
- */
16120
- search() {
16121
- return this.concurrent(async () => {
16122
- const os = await this.openObjectStore();
16123
- const request = os.openCursor();
16124
- const rowData = [];
16125
- await new Promise((resolve, reject) => {
16126
- request.onsuccess = () => {
16127
- const cursor = request.result;
16128
- if (cursor) {
16129
- rowData.push(cursor.value);
16130
- cursor.continue();
16131
- } else {
16132
- resolve(rowData);
16133
- }
16134
- };
16135
- request.onerror = reject;
16136
- });
16137
- return rowData;
16138
- });
16139
- }
16140
- // 同Stoage / Cookie使用api
16141
- async get(key) {
16142
- if (!ALLOW)
16143
- return null;
16144
- const v = await this.read(key);
16145
- return this.options.get(!v ? null : v.data);
16146
- }
16147
- async set(key, value) {
16148
- if (!ALLOW)
16149
- return;
16150
- await this.update(key, {
16151
- data: this.options.set(typeof value === "string" ? value : JSON.stringify(value))
16152
- });
16153
- }
16154
- async remove(key) {
16155
- if (!ALLOW)
16156
- return;
16157
- await this.delete(key);
16158
- }
16159
- }
16160
- new IndexedDBStore();
16161
-
16162
- class IMGStore {
16163
- map;
16164
- constructor() {
16165
- this.map = Storage$1.get("@wya/vc-img:", { session: true }) || {};
16166
- }
16167
- add(src, opts = {}) {
16168
- const { originW, originH } = opts;
16169
- if (this.map[src] && originW && originH) return;
16170
- this.map[src] = {
16171
- originW,
16172
- originH
16173
- };
16174
- Storage$1.set("@wya/vc-img:", this.map, { session: true });
16175
- }
16176
- getSize(src, opts = {}) {
16177
- const { clientW, clientH, style, wrapperW } = opts;
16178
- if (!this.map[src]) return {};
16179
- const { originW, originH } = this.map[src];
16180
- if (style.width && clientW > 1) {
16181
- return {
16182
- w: clientW,
16183
- h: clientW / originW * originH
16184
- };
16185
- } else if (style.height && clientH > 1) {
16186
- return {
16187
- w: clientH / originH * originW,
16188
- h: clientH
16189
- };
16190
- } else if (wrapperW && !style.height && !style.width) {
16191
- if (originW <= wrapperW) {
16192
- return {
16193
- w: originW,
16194
- h: originH
16195
- };
16196
- } else {
16197
- return {
16198
- w: wrapperW / originW * originW,
16199
- h: wrapperW / originW * originH
16200
- };
16201
- }
16202
- } else {
16203
- return {
16204
- w: originW,
16205
- h: originH
16206
- };
16207
- }
16208
- }
16209
- }
16210
- const IMGStore$1 = new IMGStore();
16211
-
16212
- /** @jsxImportSource vue */
16213
-
16214
- const COMPONENT_NAME$W = 'vc-image';
16215
- let isSupportObjectFit = false;
16216
- window.addEventListener('DOMContentLoaded', () => {
16217
- isSupportObjectFit = !IS_SERVER$2 && document.documentElement.style.objectFit !== undefined;
16218
- });
16219
- const ObjectFit = {
16220
- NONE: 'none',
16221
- CONTAIN: 'contain',
16222
- COVER: 'cover',
16223
- FILL: 'fill',
16224
- SCALE_DOWN: 'scale-down'
16225
- };
16226
- const Image$1 = /* @__PURE__ */ vue.defineComponent({
16227
- name: COMPONENT_NAME$W,
16228
- inheritAttrs: false,
16229
- props: props$H,
16230
- setup(props, {
16231
- slots,
16232
- emit
16233
- }) {
16234
- const instance = vue.getCurrentInstance();
16235
- const its = useAttrs({
16236
- merge: false,
16237
- exclude: ['onLoad', 'onError']
16238
- });
16239
- const isLoading = vue.ref(true);
16240
- const isError = vue.ref(false);
16241
- const isActive = vue.ref(!props.lazy);
16242
- const isAuto = vue.ref(false);
16243
- const originW = vue.ref(0);
16244
- const originH = vue.ref(0);
16245
- const pStyle = vue.ref({});
16246
- const scroller = vue.ref(null);
16247
- const setScroller = () => {
16248
- const {
16249
- wrapper
16250
- } = props;
16251
- if (typeof wrapper === 'object') {
16252
- scroller.value = wrapper;
16253
- } else if (typeof wrapper === 'string') {
16254
- scroller.value = document.querySelector(wrapper);
16255
- } else {
16256
- scroller.value = getScroller(instance.vnode.el);
16257
- }
16258
- };
16259
- const initPlaceholder = () => {
16260
- isAuto.value = instance.vnode.el.clientHeight === 1 || instance.vnode.el.clientWidth === 1;
16261
-
16262
- // el上是否有width和height
16263
- const {
16264
- width,
16265
- height
16266
- } = instance.vnode.el.style;
16267
- if (width && height) return;
16268
- const {
16269
- w,
16270
- h
16271
- } = IMGStore$1.getSize(props.src, {
16272
- clientW: instance.vnode.el.clientWidth,
16273
- clientH: instance.vnode.el.clientHeight,
16274
- style: {
16275
- width,
16276
- height
16277
- },
16278
- wrapperW: scroller.value && scroller.value.clientWidth,
16279
- // TODO
16280
- wrapperH: scroller.value && scroller.value.clientHeight
16281
- });
16282
- if (w && h) {
16283
- pStyle.value = {
16284
- width: `${w}px`,
16285
- height: `${h}px`
16286
- };
16287
- }
16288
- };
16289
- let handleLazyLoad;
16290
- const removeLazyLoadListener = () => {
16291
- if (!scroller.value || !handleLazyLoad) return;
16292
- scroller.value.removeEventListener('scroll', handleLazyLoad);
16293
- scroller.value = null;
16294
- handleLazyLoad = null;
16295
- };
16296
- const addLazyLoadListener = () => {
16297
- if (scroller.value) {
16298
- handleLazyLoad = throttle$2(() => {
16299
- if (contains(scroller.value, instance.vnode.el)) {
16300
- isActive.value = true;
16301
- removeLazyLoadListener();
16302
- }
16303
- }, 200);
16304
- scroller.value.addEventListener('scroll', handleLazyLoad);
16305
- handleLazyLoad();
16306
- }
16307
- };
16308
- const handleLoad = (e, img) => {
16309
- originW.value = img.naturalWidth || img.width;
16310
- originH.value = img.naturalHeight || img.height;
16311
- isLoading.value = false;
16312
- emit('load', e, img, instance);
16313
- IMGStore$1.add(props.src, {
16314
- originW: originW.value,
16315
- originH: originH.value
16316
- });
16317
- };
16318
- const handleError = (e, img) => {
16319
- isLoading.value = false;
16320
- isError.value = true;
16321
- emit('error', e, img, instance);
16322
- };
16323
- const loadImage = () => {
16324
- if (!props.src) return;
16325
- // reset status
16326
- isLoading.value = true;
16327
- isError.value = false;
16328
- const img = new window.Image();
16329
- img.onload = e => handleLoad(e, img);
16330
- img.onerror = e => handleError(e, img);
16331
-
16332
- // bind html attrs
16333
- Object.keys(its.value.attrs || {}).forEach(key => img.setAttribute(key, its.value.attrs[key]));
16334
- img.src = props.src;
16335
- };
16336
- const hackFit = fit => {
16337
- const {
16338
- clientWidth: elW,
16339
- clientHeight: elH
16340
- } = instance.vnode.el;
16341
- if (!originW.value || !originH.value || !elW || !elH) return {};
16342
- const vertical = originW.value / originH.value < 1;
16343
- if (fit === ObjectFit.SCALE_DOWN) {
16344
- const isSmaller = originW.value < elW && originH.value < elH;
16345
- fit = isSmaller ? ObjectFit.NONE : ObjectFit.CONTAIN;
16346
- }
16347
- switch (fit) {
16348
- case ObjectFit.NONE:
16349
- return {
16350
- width: 'auto',
16351
- height: 'auto'
16352
- };
16353
- case ObjectFit.CONTAIN:
16354
- return vertical ? {
16355
- width: 'auto'
16356
- } : {
16357
- height: 'auto'
16358
- };
16359
- case ObjectFit.COVER:
16360
- return vertical ? {
16361
- height: 'auto'
16362
- } : {
16363
- width: 'auto'
16364
- };
16365
- default:
16366
- return {};
16367
- }
16368
- };
16369
- const style = vue.computed(() => {
16370
- if (!props.fit) return;
16371
- return isSupportObjectFit ? {
16372
- 'object-fit': props.fit
16373
- } : hackFit(props.fit);
16374
- });
16375
- const alignCenter = vue.computed(() => {
16376
- return !isSupportObjectFit && props.fit !== ObjectFit.FILL;
16377
- });
16378
- vue.watch(() => props.src, v => {
16379
- if (!v && !isLoading.value) {
16380
- isLoading.value = true;
16381
- }
16382
- isActive.value && loadImage();
16383
- });
16384
- vue.watch(() => isActive.value, v => {
16385
- v && loadImage();
16386
- });
16387
- vue.onMounted(() => {
16388
- setScroller();
16389
- initPlaceholder();
16390
- props.lazy ? addLazyLoadListener() : loadImage();
16391
- });
16392
- vue.onBeforeUnmount(() => {
16393
- props.lazy && removeLazyLoadListener();
16394
- });
16395
- return () => {
16396
- return vue.createVNode("div", {
16397
- "style": its.value.style,
16398
- "class": [its.value.class, 'vc-image']
16399
- }, [isLoading.value && (slots.placeholder ? slots.placeholder() : vue.createVNode("div", {
16400
- "class": [{
16401
- 'is-auto': isAuto.value
16402
- }, 'vc-image__placeholder'],
16403
- "style": pStyle.value
16404
- }, null)), !isLoading.value && isError.value && (slots.error ? slots.error() : vue.createVNode("div", {
16405
- "class": "vc-image__error"
16406
- }, [vue.createTextVNode(" \u52A0\u8F7D\u5931\u8D25")])), !isLoading.value && !isError.value && vue.createVNode("img", vue.mergeProps({
16407
- "src": props.src,
16408
- "style": style.value,
16409
- "class": [{
16410
- 'is-center': alignCenter
16411
- }, 'vc-image__inner']
16412
- }, {
16413
- // 包含所有on*都会被绑定, 且listeners中覆盖将由listener内触发(inheritAttrs: false)
16414
- ...its.value.attrs,
16415
- ...its.value.listeners
16416
- }), null)]);
16417
- };
16418
- }
16419
- });
16420
-
16421
- const MImage = Image$1;
16422
-
16423
- const props$G = {
16424
- tag: {
16425
- type: String,
16426
- default: "div"
16427
- }
16428
- };
16429
-
16430
- /** @jsxImportSource vue */
16431
-
16432
- const COMPONENT_NAME$V = 'vc-image-crop';
16433
- const ImageCrop = /* @__PURE__ */ vue.defineComponent({
16434
- name: COMPONENT_NAME$V,
16435
- props: props$G,
16436
- setup(props, {
16437
- slots
16438
- }) {
16439
- return () => {
16440
- return vue.createVNode("div", {
16441
- "class": "vc-image-crop"
16442
- }, [slots?.default?.()]);
16443
- };
16444
- }
16445
- });
16446
-
16447
- const MImageCrop = ImageCrop;
16448
-
16449
- const props$F = {
16450
- tag: {
16451
- type: String,
16452
- default: "div"
16453
- }
16454
- };
16455
-
16456
- /** @jsxImportSource vue */
16457
-
16458
- const COMPONENT_NAME$U = 'vc-image-preview';
16459
- const ImagePreview$1 = /* @__PURE__ */ vue.defineComponent({
16460
- name: COMPONENT_NAME$U,
16461
- props: props$F,
16462
- setup(props, {
16463
- slots
16464
- }) {
16465
- return () => {
16466
- return vue.createVNode("div", {
16467
- "class": "vc-image-preview"
16468
- }, [slots?.default?.()]);
16469
- };
16470
- }
16471
- });
16472
-
16473
- /*!
16474
- * PhotoSwipe Lightbox 5.4.4 - https://photoswipe.com
16475
- * (c) 2024 Dmytro Semenov
16476
- */
16477
- /** @typedef {import('../photoswipe.js').Point} Point */
16478
-
16479
- /**
16480
- * @template {keyof HTMLElementTagNameMap} T
16481
- * @param {string} className
16482
- * @param {T} tagName
16483
- * @param {Node} [appendToEl]
16484
- * @returns {HTMLElementTagNameMap[T]}
16485
- */
16486
- function createElement$2(className, tagName, appendToEl) {
16487
- const el = document.createElement(tagName);
16488
-
16489
- if (className) {
16490
- el.className = className;
16491
- }
16492
-
16493
- if (appendToEl) {
16494
- appendToEl.appendChild(el);
16495
- }
16496
-
16497
- return el;
16498
- }
16499
- /**
16500
- * Get transform string
16501
- *
16502
- * @param {number} x
16503
- * @param {number} [y]
16504
- * @param {number} [scale]
16505
- * @returns {string}
16506
- */
16507
-
16508
- function toTransformString$1(x, y, scale) {
16509
- let propValue = `translate3d(${x}px,${0}px,0)`;
16510
-
16511
- if (scale !== undefined) {
16512
- propValue += ` scale3d(${scale},${scale},1)`;
16513
- }
16514
-
16515
- return propValue;
16516
- }
16517
- /**
16518
- * Apply width and height CSS properties to element
16519
- *
16520
- * @param {HTMLElement} el
16521
- * @param {string | number} w
16522
- * @param {string | number} h
16523
- */
16524
-
16525
- function setWidthHeight$1(el, w, h) {
16526
- el.style.width = typeof w === 'number' ? `${w}px` : w;
16527
- el.style.height = typeof h === 'number' ? `${h}px` : h;
16528
- }
16529
- /** @typedef {LOAD_STATE[keyof LOAD_STATE]} LoadState */
16530
-
16531
- /** @type {{ IDLE: 'idle'; LOADING: 'loading'; LOADED: 'loaded'; ERROR: 'error' }} */
16532
-
16533
- const LOAD_STATE$1 = {
16534
- IDLE: 'idle',
16535
- LOADING: 'loading',
16536
- LOADED: 'loaded',
16537
- ERROR: 'error'
16538
- };
16539
- /**
16540
- * Check if click or keydown event was dispatched
16541
- * with a special key or via mouse wheel.
16542
- *
16543
- * @param {MouseEvent | KeyboardEvent} e
16544
- * @returns {boolean}
16545
- */
16546
-
16547
- function specialKeyUsed$1(e) {
16548
- return 'button' in e && e.button === 1 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey;
16549
- }
16550
- /**
16551
- * Parse `gallery` or `children` options.
16552
- *
16553
- * @param {import('../photoswipe.js').ElementProvider} [option]
16554
- * @param {string} [legacySelector]
16555
- * @param {HTMLElement | Document} [parent]
16556
- * @returns HTMLElement[]
16557
- */
16558
-
16559
- function getElementsFromOption$1(option, legacySelector, parent = document) {
16560
- /** @type {HTMLElement[]} */
16561
- let elements = [];
16562
-
16563
- if (option instanceof Element) {
16564
- elements = [option];
16565
- } else if (option instanceof NodeList || Array.isArray(option)) {
16566
- elements = Array.from(option);
16567
- } else {
16568
- const selector = typeof option === 'string' ? option : legacySelector;
16569
-
16570
- if (selector) {
16571
- elements = Array.from(parent.querySelectorAll(selector));
15883
+ function getElementsFromOption$1(option, legacySelector, parent = document) {
15884
+ /** @type {HTMLElement[]} */
15885
+ let elements = [];
15886
+
15887
+ if (option instanceof Element) {
15888
+ elements = [option];
15889
+ } else if (option instanceof NodeList || Array.isArray(option)) {
15890
+ elements = Array.from(option);
15891
+ } else {
15892
+ const selector = typeof option === 'string' ? option : legacySelector;
15893
+
15894
+ if (selector) {
15895
+ elements = Array.from(parent.querySelectorAll(selector));
16572
15896
  }
16573
15897
  }
16574
15898
 
@@ -18363,145 +17687,837 @@ var VcComponents = (function (exports, vue) {
18363
17687
  if (window.pswp) {
18364
17688
  return;
18365
17689
  }
18366
- /**
18367
- * Pass data to PhotoSwipe and open init
18368
- *
18369
- * @type {PhotoSwipe}
18370
- */
18371
-
18372
-
18373
- const pswp = typeof module === 'object' ? new module.default(this.options) // eslint-disable-line
18374
- : new module(this.options); // eslint-disable-line
18375
-
18376
- this.pswp = pswp;
18377
- window.pswp = pswp; // map listeners from Lightbox to PhotoSwipe Core
17690
+ /**
17691
+ * Pass data to PhotoSwipe and open init
17692
+ *
17693
+ * @type {PhotoSwipe}
17694
+ */
17695
+
17696
+
17697
+ const pswp = typeof module === 'object' ? new module.default(this.options) // eslint-disable-line
17698
+ : new module(this.options); // eslint-disable-line
17699
+
17700
+ this.pswp = pswp;
17701
+ window.pswp = pswp; // map listeners from Lightbox to PhotoSwipe Core
17702
+
17703
+ /** @type {(keyof PhotoSwipeEventsMap)[]} */
17704
+
17705
+ Object.keys(this._listeners).forEach(name => {
17706
+ var _this$_listeners$name;
17707
+
17708
+ (_this$_listeners$name = this._listeners[name]) === null || _this$_listeners$name === void 0 || _this$_listeners$name.forEach(fn => {
17709
+ pswp.on(name,
17710
+ /** @type {EventCallback<typeof name>} */
17711
+ fn);
17712
+ });
17713
+ }); // same with filters
17714
+
17715
+ /** @type {(keyof PhotoSwipeFiltersMap)[]} */
17716
+
17717
+ Object.keys(this._filters).forEach(name => {
17718
+ var _this$_filters$name;
17719
+
17720
+ (_this$_filters$name = this._filters[name]) === null || _this$_filters$name === void 0 || _this$_filters$name.forEach(filter => {
17721
+ pswp.addFilter(name, filter.fn, filter.priority);
17722
+ });
17723
+ });
17724
+
17725
+ if (this._preloadedContent) {
17726
+ pswp.contentLoader.addToCache(this._preloadedContent);
17727
+ this._preloadedContent = undefined;
17728
+ }
17729
+
17730
+ pswp.on('destroy', () => {
17731
+ // clean up public variables
17732
+ this.pswp = undefined;
17733
+ delete window.pswp;
17734
+ });
17735
+ pswp.init();
17736
+ }
17737
+ /**
17738
+ * Unbinds all events, closes PhotoSwipe if it's open.
17739
+ */
17740
+
17741
+
17742
+ destroy() {
17743
+ var _this$pswp;
17744
+
17745
+ (_this$pswp = this.pswp) === null || _this$pswp === void 0 || _this$pswp.destroy();
17746
+ this.shouldOpen = false;
17747
+ this._listeners = {};
17748
+ getElementsFromOption$1(this.options.gallery, this.options.gallerySelector).forEach(galleryElement => {
17749
+ galleryElement.removeEventListener('click', this.onThumbnailsClick, false);
17750
+ });
17751
+ }
17752
+
17753
+ }
17754
+
17755
+ const MAX_WIDTH = window.innerWidth;
17756
+ const MAX_HEIGHT = window.innerHeight;
17757
+ const getFitSize = (src) => {
17758
+ return new Promise((resolve) => {
17759
+ const img = new Image();
17760
+ let width;
17761
+ let height;
17762
+ img.onload = () => {
17763
+ const owidth = img.naturalWidth || img.width;
17764
+ const oheight = img.naturalHeight || img.height;
17765
+ if (owidth > oheight) {
17766
+ width = Math.min(MAX_WIDTH, owidth);
17767
+ height = width / owidth * oheight;
17768
+ resolve({
17769
+ width,
17770
+ height
17771
+ });
17772
+ } else {
17773
+ height = Math.min(MAX_HEIGHT, oheight);
17774
+ width = height / oheight * owidth;
17775
+ resolve({
17776
+ width,
17777
+ height
17778
+ });
17779
+ }
17780
+ };
17781
+ img.onerror = () => resolve({});
17782
+ img.src = src;
17783
+ });
17784
+ };
17785
+ const open$1 = async (options) => {
17786
+ const e = VcInstance.globalEvent;
17787
+ const data = options.data.map((i) => {
17788
+ if (typeof i === "string") {
17789
+ return {
17790
+ src: i
17791
+ };
17792
+ }
17793
+ return {
17794
+ ...i,
17795
+ src: i.source || i.src
17796
+ };
17797
+ });
17798
+ for (let i = 0; i < data.length; i++) {
17799
+ if (!data[i].width) {
17800
+ data[i] = {
17801
+ ...data[i],
17802
+ ...await getFitSize(data[i].src)
17803
+ };
17804
+ }
17805
+ }
17806
+ const lightbox = new PhotoSwipeLightbox({
17807
+ pswpModule: () => Promise.resolve().then(() => photoswipe_esm),
17808
+ closeTitle: "关闭(Esc)",
17809
+ zoomTitle: "缩放",
17810
+ arrowPrevTitle: "上一张",
17811
+ arrowNextTitle: "下一张",
17812
+ errorMsg: "网络异常 图片加载失败",
17813
+ indexIndicatorSep: " / ",
17814
+ initialZoomLevel: "fit"
17815
+ });
17816
+ lightbox.init();
17817
+ lightbox.loadAndOpen(
17818
+ options.current || 0,
17819
+ data,
17820
+ // 下面无效,需要给官方支持
17821
+ {
17822
+ x: e?.clientX,
17823
+ y: e?.clientY
17824
+ }
17825
+ );
17826
+ };
17827
+
17828
+ const ImagePreview = Object.assign(ImagePreview$1, { open: open$1 });
17829
+
17830
+ const props$G = {
17831
+ src: String,
17832
+ fit: String,
17833
+ lazy: Boolean,
17834
+ wrapper: [Object, String],
17835
+ previewable: {
17836
+ type: Boolean,
17837
+ default: true
17838
+ }
17839
+ };
17840
+
17841
+ class ACache {
17842
+ options;
17843
+ constructor() {
17844
+ this.options = {
17845
+ version: "",
17846
+ get: (v) => flattenJSONParse(v),
17847
+ set: (v) => v
17848
+ };
17849
+ }
17850
+ configure(options) {
17851
+ if (typeof window === "undefined")
17852
+ return;
17853
+ this.options = {
17854
+ ...this.options,
17855
+ ...options
17856
+ };
17857
+ }
17858
+ }
17859
+
17860
+ (() => {
17861
+ try {
17862
+ document.cookie = "test";
17863
+ return true;
17864
+ } catch (_) {
17865
+ return false;
17866
+ }
17867
+ })();
17868
+
17869
+ class MemoryStorage {
17870
+ store = {};
17871
+ getItem(key) {
17872
+ return this.store[key] || null;
17873
+ }
17874
+ setItem(key, val) {
17875
+ this.store[key] = val;
17876
+ }
17877
+ removeItem(key) {
17878
+ delete this.store[key];
17879
+ }
17880
+ }
17881
+
17882
+ const PREFIX_NAME = "@deot/helper/";
17883
+ const formatKey = (key, version) => {
17884
+ return `${version ? `${PREFIX_NAME}${version}:` : ""}${key}`;
17885
+ };
17886
+ const ALLOW$1 = (() => {
17887
+ const test = "test";
17888
+ try {
17889
+ window.localStorage.setItem(test, test);
17890
+ window.localStorage.removeItem(test);
17891
+ return true;
17892
+ } catch (_) {
17893
+ return false;
17894
+ }
17895
+ })();
17896
+ class StorageStore extends ACache {
17897
+ sessionStorage = new MemoryStorage();
17898
+ localStorage = new MemoryStorage();
17899
+ getInvoke(options) {
17900
+ return options?.session ? "sessionStorage" : "localStorage";
17901
+ }
17902
+ configure(options) {
17903
+ super.configure(options);
17904
+ if (!ALLOW$1)
17905
+ return;
17906
+ const { version } = this.options;
17907
+ Object.keys(window.localStorage).forEach((item) => {
17908
+ /* istanbul ignore else -- @preserve */
17909
+ if (item.includes(PREFIX_NAME) && !item.includes(`${PREFIX_NAME}${version}`)) {
17910
+ window.localStorage.removeItem(item);
17911
+ }
17912
+ });
17913
+ }
17914
+ /**
17915
+ * 设置缓存
17916
+ * @param key 保存的键值
17917
+ * @param value 保存的内容
17918
+ * @param options ~
17919
+ */
17920
+ set(key, value, options) {
17921
+ if (!ALLOW$1)
17922
+ return;
17923
+ const invoke = this.getInvoke(options);
17924
+ key = formatKey(key, this.options.version);
17925
+ value = this.options.set(typeof value === "string" ? value : JSON.stringify(value));
17926
+ try {
17927
+ window[invoke].setItem(key, value);
17928
+ } catch (error) {
17929
+ this[invoke].setItem(key, value);
17930
+ }
17931
+ }
17932
+ /**
17933
+ * 获取缓存
17934
+ * @param key 保存的键值
17935
+ * @param options ~
17936
+ * @returns ~
17937
+ */
17938
+ get(key, options) {
17939
+ if (!ALLOW$1)
17940
+ return null;
17941
+ const invoke = this.getInvoke(options);
17942
+ key = formatKey(key, this.options.version);
17943
+ const value = this[invoke].getItem(key) || window[invoke].getItem(key);
17944
+ return this.options.get(value);
17945
+ }
17946
+ /**
17947
+ * 删除缓存
17948
+ * @param key 键值
17949
+ * @param options ~
17950
+ */
17951
+ remove(key, options) {
17952
+ if (!ALLOW$1)
17953
+ return;
17954
+ const invoke = this.getInvoke(options);
17955
+ key = formatKey(key, this.options.version);
17956
+ this[invoke].removeItem(key);
17957
+ window[invoke].removeItem(key);
17958
+ }
17959
+ }
17960
+ const Storage$1 = new StorageStore();
17961
+
17962
+ const ALLOW = (() => {
17963
+ try {
17964
+ window.indexedDB.open;
17965
+ return true;
17966
+ } catch (_) {
17967
+ return false;
17968
+ }
17969
+ })();
17970
+ class IndexedDBStore extends ACache {
17971
+ timestramp = (/* @__PURE__ */ new Date()).getTime();
17972
+ count = 0;
17973
+ db = null;
17974
+ pending = [];
17975
+ constructor(options) {
17976
+ super();
17977
+ this.options = {
17978
+ ...this.options,
17979
+ keyPath: "__id",
17980
+ name: "default-db",
17981
+ storeName: "default-store",
17982
+ version: 1
17983
+ };
17984
+ options && this.configure(options);
17985
+ }
17986
+ getUid() {
17987
+ return `${this.timestramp}${this.count++}`;
17988
+ }
17989
+ configure(options) {
17990
+ super.configure(options);
17991
+ if (typeof this.options.version === "string") {
17992
+ this.options.version = parseInt(this.options.version, 10);
17993
+ }
17994
+ }
17995
+ /**
17996
+ * 每次操作完要关闭
17997
+ * 1. 浏览器上不关闭的话,删库操作会卡一会
17998
+ * 2. fake-indexeddb不关闭会卡死
17999
+ * @param fn ~
18000
+ * @returns ~
18001
+ */
18002
+ concurrent(fn) {
18003
+ const target = new Promise((resolve, reject) => {
18004
+ fn().then(resolve).catch(reject);
18005
+ });
18006
+ this.pending.push(target);
18007
+ target.finally(() => this.close(target));
18008
+ return target;
18009
+ }
18010
+ /**
18011
+ * 统一处理
18012
+ * @param request ~
18013
+ * @returns ~
18014
+ */
18015
+ async task(request) {
18016
+ return new Promise((resolve, reject) => {
18017
+ request.onsuccess = resolve;
18018
+ request.onerror = reject;
18019
+ });
18020
+ }
18021
+ /**
18022
+ * @param target ~
18023
+ */
18024
+ async close(target) {
18025
+ if (target) {
18026
+ this.pending = this.pending.filter((i) => i !== target);
18027
+ } else {
18028
+ const done = async (pending) => {
18029
+ if (pending.length) {
18030
+ await Promise.allSettled(pending);
18031
+ await done(this.pending);
18032
+ }
18033
+ };
18034
+ await done(this.pending);
18035
+ }
18036
+ if (!this.pending.length && this.db) {
18037
+ const db = this.db;
18038
+ this.db = null;
18039
+ (await db).close();
18040
+ }
18041
+ }
18042
+ /**
18043
+ * 打开数据库。变更时候更新表
18044
+ * @returns ~
18045
+ */
18046
+ openDatabase() {
18047
+ this.db = this.db || (async () => {
18048
+ const { name, version, keyPath, storeName } = this.options;
18049
+ const poll = () => new Promise((resolve, reject) => {
18050
+ const request = window.indexedDB.open(name, version);
18051
+ request.onsuccess = () => {
18052
+ resolve(request.result);
18053
+ };
18054
+ request.onerror = /* istanbul ignore next */
18055
+ () => {
18056
+ reject(new Error("IndexedDB Open Failed. DeleteDatabase first!"));
18057
+ };
18058
+ request.onupgradeneeded = () => {
18059
+ const db2 = request.result;
18060
+ if (db2.objectStoreNames.contains(storeName)) {
18061
+ db2.deleteObjectStore(storeName);
18062
+ }
18063
+ db2.createObjectStore(storeName, { keyPath });
18064
+ };
18065
+ });
18066
+ const maxTries = 3;
18067
+ let db;
18068
+ for (let tries = 0; tries < maxTries; tries++) {
18069
+ try {
18070
+ db = await poll();
18071
+ } catch (_) {
18072
+ }
18073
+ /* istanbul ignore next -- @preserve */
18074
+ if (db || tries === maxTries - 1) {
18075
+ break;
18076
+ }
18077
+ }
18078
+ /* istanbul ignore next -- @preserve */
18079
+ if (!db) {
18080
+ await this.deleteDatabase();
18081
+ db = await poll();
18082
+ }
18083
+ return db;
18084
+ })();
18085
+ return this.db;
18086
+ }
18087
+ /**
18088
+ * 打开表
18089
+ * tip: db.close() 执行后
18090
+ * db打开后的表os对象仍可写入(浏览器支持,fake-indexeddb不支持)
18091
+ * 不过正常理解也应该操作所有后再关闭,这里不修改`this.db -> this.os`的逻辑
18092
+ * @param mode ~
18093
+ * @returns ~
18094
+ */
18095
+ async openObjectStore(mode) {
18096
+ const { storeName } = this.options;
18097
+ const db = await this.openDatabase();
18098
+ const os = db.transaction([storeName], mode || "readwrite").objectStore(storeName);
18099
+ return os;
18100
+ }
18101
+ /**
18102
+ * 删库
18103
+ */
18104
+ async deleteDatabase() {
18105
+ const { name } = this.options;
18106
+ const request = window.indexedDB.deleteDatabase(name);
18107
+ await new Promise((resolve, reject) => {
18108
+ request.onsuccess = resolve;
18109
+ request.onerror = reject;
18110
+ });
18111
+ }
18112
+ /**
18113
+ * 新增数据,通过事务完成。
18114
+ * @param data ~
18115
+ * @returns ~
18116
+ */
18117
+ write(data) {
18118
+ return this.concurrent(async () => {
18119
+ const { keyPath } = this.options;
18120
+ const os = await this.openObjectStore();
18121
+ const state = {
18122
+ [keyPath]: this.getUid(),
18123
+ ...data
18124
+ };
18125
+ const request = os.add(state);
18126
+ await new Promise((resolve, reject) => {
18127
+ request.onsuccess = resolve;
18128
+ request.onerror = reject;
18129
+ });
18130
+ return state;
18131
+ });
18132
+ }
18133
+ /**
18134
+ * 读取数据,通过事务完成。
18135
+ * @param id ~
18136
+ * @returns ~
18137
+ */
18138
+ read(id) {
18139
+ return this.concurrent(async () => {
18140
+ const os = await this.openObjectStore();
18141
+ const request = os.get(id);
18142
+ await this.task(request);
18143
+ return request.result;
18144
+ });
18145
+ }
18146
+ /**
18147
+ * 更新数据,通过事务完成。
18148
+ * @param id ~
18149
+ * @param data ~
18150
+ * @returns ~
18151
+ */
18152
+ update(id, data) {
18153
+ return this.concurrent(async () => {
18154
+ const { keyPath } = this.options;
18155
+ const os = await this.openObjectStore();
18156
+ const state = {
18157
+ [keyPath]: id,
18158
+ ...data
18159
+ };
18160
+ const request = os.put(state);
18161
+ await this.task(request);
18162
+ return state;
18163
+ });
18164
+ }
18165
+ /**
18166
+ * 删除数据也是通过事务完成。
18167
+ * @param id ~
18168
+ * @returns ~
18169
+ */
18170
+ async delete(id) {
18171
+ return this.concurrent(async () => {
18172
+ const os = await this.openObjectStore();
18173
+ const request = os.delete(id);
18174
+ await this.task(request);
18175
+ });
18176
+ }
18177
+ /**
18178
+ * 搜索数据,通过事务完成。
18179
+ * @returns ~
18180
+ */
18181
+ search() {
18182
+ return this.concurrent(async () => {
18183
+ const os = await this.openObjectStore();
18184
+ const request = os.openCursor();
18185
+ const rowData = [];
18186
+ await new Promise((resolve, reject) => {
18187
+ request.onsuccess = () => {
18188
+ const cursor = request.result;
18189
+ if (cursor) {
18190
+ rowData.push(cursor.value);
18191
+ cursor.continue();
18192
+ } else {
18193
+ resolve(rowData);
18194
+ }
18195
+ };
18196
+ request.onerror = reject;
18197
+ });
18198
+ return rowData;
18199
+ });
18200
+ }
18201
+ // 同Stoage / Cookie使用api
18202
+ async get(key) {
18203
+ if (!ALLOW)
18204
+ return null;
18205
+ const v = await this.read(key);
18206
+ return this.options.get(!v ? null : v.data);
18207
+ }
18208
+ async set(key, value) {
18209
+ if (!ALLOW)
18210
+ return;
18211
+ await this.update(key, {
18212
+ data: this.options.set(typeof value === "string" ? value : JSON.stringify(value))
18213
+ });
18214
+ }
18215
+ async remove(key) {
18216
+ if (!ALLOW)
18217
+ return;
18218
+ await this.delete(key);
18219
+ }
18220
+ }
18221
+ new IndexedDBStore();
18222
+
18223
+ class IMGStore {
18224
+ map;
18225
+ constructor() {
18226
+ this.map = Storage$1.get("@wya/vc-img:", { session: true }) || {};
18227
+ }
18228
+ add(src, opts = {}) {
18229
+ const { originW, originH } = opts;
18230
+ if (this.map[src] && originW && originH) return;
18231
+ this.map[src] = {
18232
+ originW,
18233
+ originH
18234
+ };
18235
+ Storage$1.set("@wya/vc-img:", this.map, { session: true });
18236
+ }
18237
+ getSize(src, opts = {}) {
18238
+ const { clientW, clientH, style, wrapperW } = opts;
18239
+ if (!this.map[src]) return {};
18240
+ const { originW, originH } = this.map[src];
18241
+ if (style.width && clientW > 1) {
18242
+ return {
18243
+ w: clientW,
18244
+ h: clientW / originW * originH
18245
+ };
18246
+ } else if (style.height && clientH > 1) {
18247
+ return {
18248
+ w: clientH / originH * originW,
18249
+ h: clientH
18250
+ };
18251
+ } else if (wrapperW && !style.height && !style.width) {
18252
+ if (originW <= wrapperW) {
18253
+ return {
18254
+ w: originW,
18255
+ h: originH
18256
+ };
18257
+ } else {
18258
+ return {
18259
+ w: wrapperW / originW * originW,
18260
+ h: wrapperW / originW * originH
18261
+ };
18262
+ }
18263
+ } else {
18264
+ return {
18265
+ w: originW,
18266
+ h: originH
18267
+ };
18268
+ }
18269
+ }
18270
+ }
18271
+ const IMGStore$1 = new IMGStore();
18378
18272
 
18379
- /** @type {(keyof PhotoSwipeEventsMap)[]} */
18273
+ /** @jsxImportSource vue */
18380
18274
 
18381
- Object.keys(this._listeners).forEach(name => {
18382
- var _this$_listeners$name;
18275
+ const COMPONENT_NAME$W = 'vc-image';
18276
+ let isSupportObjectFit = false;
18277
+ window.addEventListener('DOMContentLoaded', () => {
18278
+ isSupportObjectFit = !IS_SERVER$2 && document.documentElement.style.objectFit !== undefined;
18279
+ });
18280
+ const ObjectFit = {
18281
+ NONE: 'none',
18282
+ CONTAIN: 'contain',
18283
+ COVER: 'cover',
18284
+ FILL: 'fill',
18285
+ SCALE_DOWN: 'scale-down'
18286
+ };
18287
+ const Image$1 = /* @__PURE__ */ vue.defineComponent({
18288
+ name: COMPONENT_NAME$W,
18289
+ inheritAttrs: false,
18290
+ props: props$G,
18291
+ setup(props, {
18292
+ slots,
18293
+ emit
18294
+ }) {
18295
+ const instance = vue.getCurrentInstance();
18296
+ const its = useAttrs({
18297
+ merge: false,
18298
+ exclude: ['onLoad', 'onError']
18299
+ });
18300
+ const isLoading = vue.ref(true);
18301
+ const isError = vue.ref(false);
18302
+ const isActive = vue.ref(!props.lazy);
18303
+ const isAuto = vue.ref(false);
18304
+ const originW = vue.ref(0);
18305
+ const originH = vue.ref(0);
18306
+ const pStyle = vue.ref({});
18307
+ const scroller = vue.ref(null);
18308
+ const setScroller = () => {
18309
+ const {
18310
+ wrapper
18311
+ } = props;
18312
+ if (typeof wrapper === 'object') {
18313
+ scroller.value = wrapper;
18314
+ } else if (typeof wrapper === 'string') {
18315
+ scroller.value = document.querySelector(wrapper);
18316
+ } else {
18317
+ scroller.value = getScroller(instance.vnode.el);
18318
+ }
18319
+ };
18320
+ const initPlaceholder = () => {
18321
+ isAuto.value = instance.vnode.el.clientHeight === 1 || instance.vnode.el.clientWidth === 1;
18383
18322
 
18384
- (_this$_listeners$name = this._listeners[name]) === null || _this$_listeners$name === void 0 || _this$_listeners$name.forEach(fn => {
18385
- pswp.on(name,
18386
- /** @type {EventCallback<typeof name>} */
18387
- fn);
18323
+ // el上是否有width和height
18324
+ const {
18325
+ width,
18326
+ height
18327
+ } = instance.vnode.el.style;
18328
+ if (width && height) return;
18329
+ const {
18330
+ w,
18331
+ h
18332
+ } = IMGStore$1.getSize(props.src, {
18333
+ clientW: instance.vnode.el.clientWidth,
18334
+ clientH: instance.vnode.el.clientHeight,
18335
+ style: {
18336
+ width,
18337
+ height
18338
+ },
18339
+ wrapperW: scroller.value && scroller.value.clientWidth,
18340
+ // TODO
18341
+ wrapperH: scroller.value && scroller.value.clientHeight
18388
18342
  });
18389
- }); // same with filters
18390
-
18391
- /** @type {(keyof PhotoSwipeFiltersMap)[]} */
18392
-
18393
- Object.keys(this._filters).forEach(name => {
18394
- var _this$_filters$name;
18343
+ if (w && h) {
18344
+ pStyle.value = {
18345
+ width: `${w}px`,
18346
+ height: `${h}px`
18347
+ };
18348
+ }
18349
+ };
18350
+ let handleLazyLoad;
18351
+ const removeLazyLoadListener = () => {
18352
+ if (!scroller.value || !handleLazyLoad) return;
18353
+ scroller.value.removeEventListener('scroll', handleLazyLoad);
18354
+ scroller.value = null;
18355
+ handleLazyLoad = null;
18356
+ };
18357
+ const addLazyLoadListener = () => {
18358
+ if (scroller.value) {
18359
+ handleLazyLoad = throttle$2(() => {
18360
+ if (contains(scroller.value, instance.vnode.el)) {
18361
+ isActive.value = true;
18362
+ removeLazyLoadListener();
18363
+ }
18364
+ }, 200);
18365
+ scroller.value.addEventListener('scroll', handleLazyLoad);
18366
+ handleLazyLoad();
18367
+ }
18368
+ };
18369
+ const handleLoad = (e, img) => {
18370
+ originW.value = img.naturalWidth || img.width;
18371
+ originH.value = img.naturalHeight || img.height;
18372
+ isLoading.value = false;
18373
+ emit('load', e, img, instance);
18374
+ IMGStore$1.add(props.src, {
18375
+ originW: originW.value,
18376
+ originH: originH.value
18377
+ });
18378
+ };
18379
+ const handleError = (e, img) => {
18380
+ isLoading.value = false;
18381
+ isError.value = true;
18382
+ emit('error', e, img, instance);
18383
+ };
18384
+ const loadImage = () => {
18385
+ if (!props.src) return;
18386
+ // reset status
18387
+ isLoading.value = true;
18388
+ isError.value = false;
18389
+ const img = new window.Image();
18390
+ img.onload = e => handleLoad(e, img);
18391
+ img.onerror = e => handleError(e, img);
18395
18392
 
18396
- (_this$_filters$name = this._filters[name]) === null || _this$_filters$name === void 0 || _this$_filters$name.forEach(filter => {
18397
- pswp.addFilter(name, filter.fn, filter.priority);
18393
+ // bind html attrs
18394
+ Object.keys(its.value.attrs || {}).forEach(key => img.setAttribute(key, its.value.attrs[key]));
18395
+ img.src = props.src;
18396
+ };
18397
+ const hackFit = fit => {
18398
+ const {
18399
+ clientWidth: elW,
18400
+ clientHeight: elH
18401
+ } = instance.vnode.el;
18402
+ if (!originW.value || !originH.value || !elW || !elH) return {};
18403
+ const vertical = originW.value / originH.value < 1;
18404
+ if (fit === ObjectFit.SCALE_DOWN) {
18405
+ const isSmaller = originW.value < elW && originH.value < elH;
18406
+ fit = isSmaller ? ObjectFit.NONE : ObjectFit.CONTAIN;
18407
+ }
18408
+ switch (fit) {
18409
+ case ObjectFit.NONE:
18410
+ return {
18411
+ width: 'auto',
18412
+ height: 'auto'
18413
+ };
18414
+ case ObjectFit.CONTAIN:
18415
+ return vertical ? {
18416
+ width: 'auto'
18417
+ } : {
18418
+ height: 'auto'
18419
+ };
18420
+ case ObjectFit.COVER:
18421
+ return vertical ? {
18422
+ height: 'auto'
18423
+ } : {
18424
+ width: 'auto'
18425
+ };
18426
+ default:
18427
+ return {};
18428
+ }
18429
+ };
18430
+ const style = vue.computed(() => {
18431
+ if (!props.fit) return;
18432
+ return isSupportObjectFit ? {
18433
+ 'object-fit': props.fit
18434
+ } : hackFit(props.fit);
18435
+ });
18436
+ const alignCenter = vue.computed(() => {
18437
+ return !isSupportObjectFit && props.fit !== ObjectFit.FILL;
18438
+ });
18439
+ const handlePreview = () => {
18440
+ if (!props.previewable) return;
18441
+ ImagePreview.open({
18442
+ current: 0,
18443
+ data: [props.src],
18444
+ onClose() {}
18398
18445
  });
18446
+ };
18447
+ vue.watch(() => props.src, v => {
18448
+ if (!v && !isLoading.value) {
18449
+ isLoading.value = true;
18450
+ }
18451
+ isActive.value && loadImage();
18399
18452
  });
18400
-
18401
- if (this._preloadedContent) {
18402
- pswp.contentLoader.addToCache(this._preloadedContent);
18403
- this._preloadedContent = undefined;
18404
- }
18405
-
18406
- pswp.on('destroy', () => {
18407
- // clean up public variables
18408
- this.pswp = undefined;
18409
- delete window.pswp;
18453
+ vue.watch(() => isActive.value, v => {
18454
+ v && loadImage();
18410
18455
  });
18411
- pswp.init();
18456
+ vue.onMounted(() => {
18457
+ setScroller();
18458
+ initPlaceholder();
18459
+ props.lazy ? addLazyLoadListener() : loadImage();
18460
+ });
18461
+ vue.onBeforeUnmount(() => {
18462
+ props.lazy && removeLazyLoadListener();
18463
+ });
18464
+ return () => {
18465
+ return vue.createVNode("div", {
18466
+ "style": its.value.style,
18467
+ "class": [its.value.class, {
18468
+ 'is-allow-preview': props.previewable
18469
+ }, 'vc-image']
18470
+ }, [isLoading.value && (slots.placeholder ? slots.placeholder() : vue.createVNode("div", {
18471
+ "class": [{
18472
+ 'is-auto': isAuto.value
18473
+ }, 'vc-image__placeholder'],
18474
+ "style": pStyle.value
18475
+ }, null)), !isLoading.value && isError.value && (slots.error ? slots.error() : vue.createVNode("div", {
18476
+ "class": "vc-image__error"
18477
+ }, [vue.createTextVNode(" \u52A0\u8F7D\u5931\u8D25")])), !isLoading.value && !isError.value && vue.createVNode("img", vue.mergeProps({
18478
+ "src": props.src,
18479
+ "style": style.value,
18480
+ "class": [{
18481
+ 'is-center': alignCenter
18482
+ }, 'vc-image__inner']
18483
+ }, {
18484
+ // 包含所有on*都会被绑定, 且listeners中覆盖将由listener内触发(inheritAttrs: false)
18485
+ ...its.value.attrs,
18486
+ ...its.value.listeners
18487
+ }, {
18488
+ "onClick": handlePreview
18489
+ }), null)]);
18490
+ };
18412
18491
  }
18413
- /**
18414
- * Unbinds all events, closes PhotoSwipe if it's open.
18415
- */
18416
-
18492
+ });
18417
18493
 
18418
- destroy() {
18419
- var _this$pswp;
18494
+ const MImage = Image$1;
18420
18495
 
18421
- (_this$pswp = this.pswp) === null || _this$pswp === void 0 || _this$pswp.destroy();
18422
- this.shouldOpen = false;
18423
- this._listeners = {};
18424
- getElementsFromOption$1(this.options.gallery, this.options.gallerySelector).forEach(galleryElement => {
18425
- galleryElement.removeEventListener('click', this.onThumbnailsClick, false);
18426
- });
18496
+ const props$F = {
18497
+ tag: {
18498
+ type: String,
18499
+ default: "div"
18427
18500
  }
18501
+ };
18428
18502
 
18429
- }
18503
+ /** @jsxImportSource vue */
18430
18504
 
18431
- const MAX_WIDTH = window.innerWidth;
18432
- const MAX_HEIGHT = window.innerHeight;
18433
- const getFitSize = (src) => {
18434
- return new Promise((resolve) => {
18435
- const img = new Image();
18436
- let width;
18437
- let height;
18438
- img.onload = () => {
18439
- const owidth = img.naturalWidth || img.width;
18440
- const oheight = img.naturalHeight || img.height;
18441
- if (owidth > oheight) {
18442
- width = Math.min(MAX_WIDTH, owidth);
18443
- height = width / owidth * oheight;
18444
- resolve({
18445
- width,
18446
- height
18447
- });
18448
- } else {
18449
- height = Math.min(MAX_HEIGHT, oheight);
18450
- width = height / oheight * owidth;
18451
- resolve({
18452
- width,
18453
- height
18454
- });
18455
- }
18456
- };
18457
- img.onerror = () => resolve({});
18458
- img.src = src;
18459
- });
18460
- };
18461
- const open$1 = async (options) => {
18462
- const e = VcInstance.globalEvent;
18463
- const data = options.data.map((i) => {
18464
- if (typeof i === "string") {
18465
- return {
18466
- src: i
18467
- };
18468
- }
18469
- return {
18470
- ...i,
18471
- src: i.source || i.src
18505
+ const COMPONENT_NAME$V = 'vc-image-crop';
18506
+ const ImageCrop = /* @__PURE__ */ vue.defineComponent({
18507
+ name: COMPONENT_NAME$V,
18508
+ props: props$F,
18509
+ setup(props, {
18510
+ slots
18511
+ }) {
18512
+ return () => {
18513
+ return vue.createVNode("div", {
18514
+ "class": "vc-image-crop"
18515
+ }, [slots?.default?.()]);
18472
18516
  };
18473
- });
18474
- for (let i = 0; i < data.length; i++) {
18475
- if (!data[i].width) {
18476
- data[i] = {
18477
- ...data[i],
18478
- ...await getFitSize(data[i].src)
18479
- };
18480
- }
18481
18517
  }
18482
- const lightbox = new PhotoSwipeLightbox({
18483
- pswpModule: () => Promise.resolve().then(() => photoswipe_esm),
18484
- closeTitle: "关闭(Esc)",
18485
- zoomTitle: "缩放",
18486
- arrowPrevTitle: "上一张",
18487
- arrowNextTitle: "下一张",
18488
- errorMsg: "网络异常 图片加载失败",
18489
- indexIndicatorSep: " / ",
18490
- initialZoomLevel: "fit"
18491
- });
18492
- lightbox.init();
18493
- lightbox.loadAndOpen(
18494
- options.current || 0,
18495
- data,
18496
- // 下面无效,需要给官方支持
18497
- {
18498
- x: e?.clientX,
18499
- y: e?.clientY
18500
- }
18501
- );
18502
- };
18518
+ });
18503
18519
 
18504
- const ImagePreview = Object.assign(ImagePreview$1, { open: open$1 });
18520
+ const MImageCrop = ImageCrop;
18505
18521
 
18506
18522
  const MImagePreview = ImagePreview;
18507
18523
 
@@ -18514,9 +18530,9 @@ var VcComponents = (function (exports, vue) {
18514
18530
 
18515
18531
  /** @jsxImportSource vue */
18516
18532
 
18517
- const COMPONENT_NAME$T = 'vc-image-processing';
18533
+ const COMPONENT_NAME$U = 'vc-image-processing';
18518
18534
  const ImageProcessing = /* @__PURE__ */ vue.defineComponent({
18519
- name: COMPONENT_NAME$T,
18535
+ name: COMPONENT_NAME$U,
18520
18536
  props: props$E,
18521
18537
  setup(props, {
18522
18538
  slots
@@ -18533,9 +18549,9 @@ var VcComponents = (function (exports, vue) {
18533
18549
 
18534
18550
  /** @jsxImportSource vue */
18535
18551
 
18536
- const COMPONENT_NAME$S = 'vcm-input';
18552
+ const COMPONENT_NAME$T = 'vcm-input';
18537
18553
  const MInput = /* @__PURE__ */ vue.defineComponent({
18538
- name: COMPONENT_NAME$S,
18554
+ name: COMPONENT_NAME$T,
18539
18555
  inheritAttrs: false,
18540
18556
  props: {
18541
18557
  ...props$$,
@@ -18624,9 +18640,9 @@ var VcComponents = (function (exports, vue) {
18624
18640
 
18625
18641
  /** @jsxImportSource vue */
18626
18642
 
18627
- const COMPONENT_NAME$R = 'vcm-input-number';
18643
+ const COMPONENT_NAME$S = 'vcm-input-number';
18628
18644
  const MInputNumber = /* @__PURE__ */ vue.defineComponent({
18629
- name: COMPONENT_NAME$R,
18645
+ name: COMPONENT_NAME$S,
18630
18646
  props: props$X,
18631
18647
  inheritAttrs: false,
18632
18648
  setup(props, {
@@ -18675,9 +18691,9 @@ var VcComponents = (function (exports, vue) {
18675
18691
 
18676
18692
  /** @jsxImportSource vue */
18677
18693
 
18678
- const COMPONENT_NAME$Q = 'vcm-input-search';
18694
+ const COMPONENT_NAME$R = 'vcm-input-search';
18679
18695
  const MInputSearch = /* @__PURE__ */ vue.defineComponent({
18680
- name: COMPONENT_NAME$Q,
18696
+ name: COMPONENT_NAME$R,
18681
18697
  props: {
18682
18698
  ...props$W,
18683
18699
  cancelText: {
@@ -18754,9 +18770,9 @@ var VcComponents = (function (exports, vue) {
18754
18770
  }
18755
18771
  };
18756
18772
 
18757
- const COMPONENT_NAME$P = "vcm-list";
18773
+ const COMPONENT_NAME$Q = "vcm-list";
18758
18774
  const MList = vue.defineComponent({
18759
- name: COMPONENT_NAME$P,
18775
+ name: COMPONENT_NAME$Q,
18760
18776
  props: props$D,
18761
18777
  setup(props, { slots }) {
18762
18778
  vue.provide("vc-list", { props });
@@ -18811,10 +18827,10 @@ var VcComponents = (function (exports, vue) {
18811
18827
 
18812
18828
  /** @jsxImportSource vue */
18813
18829
 
18814
- const COMPONENT_NAME$O = 'vcm-list-item';
18830
+ const COMPONENT_NAME$P = 'vcm-list-item';
18815
18831
  const HTTP_REGEX = /[a-zA-z]+:\/\/[^\s]*/;
18816
18832
  const MListItem = /* @__PURE__ */ vue.defineComponent({
18817
- name: COMPONENT_NAME$O,
18833
+ name: COMPONENT_NAME$P,
18818
18834
  props: props$C,
18819
18835
  emits: ['click'],
18820
18836
  setup(props, {
@@ -18947,11 +18963,11 @@ var VcComponents = (function (exports, vue) {
18947
18963
 
18948
18964
  /** @jsxImportSource vue */
18949
18965
 
18950
- const COMPONENT_NAME$N = 'vc-marquee';
18966
+ const COMPONENT_NAME$O = 'vc-marquee';
18951
18967
  const ANIMATION = prefixStyle('animation').camel;
18952
18968
  const TRANSFORM_KEBAB = prefixStyle('transform').kebab;
18953
18969
  const Marquee = /* @__PURE__ */ vue.defineComponent({
18954
- name: COMPONENT_NAME$N,
18970
+ name: COMPONENT_NAME$O,
18955
18971
  props: props$B,
18956
18972
  setup(props, {
18957
18973
  slots
@@ -19019,9 +19035,9 @@ var VcComponents = (function (exports, vue) {
19019
19035
  }
19020
19036
  };
19021
19037
 
19022
- const COMPONENT_NAME$M = "vc-resizer";
19038
+ const COMPONENT_NAME$N = "vc-resizer";
19023
19039
  const Resizer = vue.defineComponent({
19024
- name: COMPONENT_NAME$M,
19040
+ name: COMPONENT_NAME$N,
19025
19041
  props: props$A,
19026
19042
  emit: ["resize", "change"],
19027
19043
  setup(props, { emit, slots, expose }) {
@@ -19179,10 +19195,10 @@ var VcComponents = (function (exports, vue) {
19179
19195
 
19180
19196
  /** @jsxImportSource vue */
19181
19197
 
19182
- const COMPONENT_NAME$L = 'vc-modal';
19198
+ const COMPONENT_NAME$M = 'vc-modal';
19183
19199
  let zIndexNumber = 1002;
19184
19200
  const ModalView = /* @__PURE__ */ vue.defineComponent({
19185
- name: COMPONENT_NAME$L,
19201
+ name: COMPONENT_NAME$M,
19186
19202
  emits: ['update:modelValue', 'close', 'portal-fulfilled', 'visible-change', 'ok', 'cancel'],
19187
19203
  props: props$z,
19188
19204
  setup(props, {
@@ -19621,9 +19637,9 @@ var VcComponents = (function (exports, vue) {
19621
19637
 
19622
19638
  /** @jsxImportSource vue */
19623
19639
 
19624
- const COMPONENT_NAME$K = 'vc-modal';
19640
+ const COMPONENT_NAME$L = 'vc-modal';
19625
19641
  const MModalView = /* @__PURE__ */ vue.defineComponent({
19626
- name: COMPONENT_NAME$K,
19642
+ name: COMPONENT_NAME$L,
19627
19643
  emits: ['update:modelValue', 'portal-fulfilled', 'close', 'ok', 'cancel'],
19628
19644
  props: props$y,
19629
19645
  setup(props, {
@@ -19835,9 +19851,9 @@ var VcComponents = (function (exports, vue) {
19835
19851
 
19836
19852
  /** @jsxImportSource vue */
19837
19853
 
19838
- const COMPONENT_NAME$J = 'vc-notice';
19854
+ const COMPONENT_NAME$K = 'vc-notice';
19839
19855
  const NoticeView = /* @__PURE__ */ vue.defineComponent({
19840
- name: COMPONENT_NAME$J,
19856
+ name: COMPONENT_NAME$K,
19841
19857
  props: props$x,
19842
19858
  emits: ['portal-fulfilled', 'close', 'before-close'],
19843
19859
  setup(props, {
@@ -20010,9 +20026,9 @@ var VcComponents = (function (exports, vue) {
20010
20026
 
20011
20027
  /** @jsxImportSource vue */
20012
20028
 
20013
- const COMPONENT_NAME$I = 'vc-option';
20029
+ const COMPONENT_NAME$J = 'vc-option';
20014
20030
  const Option$1 = /* @__PURE__ */ vue.defineComponent({
20015
- name: COMPONENT_NAME$I,
20031
+ name: COMPONENT_NAME$J,
20016
20032
  props: props$w,
20017
20033
  setup(props, {
20018
20034
  slots
@@ -20125,9 +20141,9 @@ var VcComponents = (function (exports, vue) {
20125
20141
 
20126
20142
  /** @jsxImportSource vue */
20127
20143
 
20128
- const COMPONENT_NAME$H = 'vc-tag';
20144
+ const COMPONENT_NAME$I = 'vc-tag';
20129
20145
  const Tag = /* @__PURE__ */ vue.defineComponent({
20130
- name: COMPONENT_NAME$H,
20146
+ name: COMPONENT_NAME$I,
20131
20147
  props: props$u,
20132
20148
  emits: ['close', 'change'],
20133
20149
  setup(props, {
@@ -20196,9 +20212,9 @@ var VcComponents = (function (exports, vue) {
20196
20212
 
20197
20213
  /** @jsxImportSource vue */
20198
20214
 
20199
- const COMPONENT_NAME$G = 'vc-select-option';
20215
+ const COMPONENT_NAME$H = 'vc-select-option';
20200
20216
  const Option = /* @__PURE__ */ vue.defineComponent({
20201
- name: COMPONENT_NAME$G,
20217
+ name: COMPONENT_NAME$H,
20202
20218
  props: props$t,
20203
20219
  setup(props, {
20204
20220
  slots
@@ -20271,9 +20287,9 @@ var VcComponents = (function (exports, vue) {
20271
20287
 
20272
20288
  /** @jsxImportSource vue */
20273
20289
 
20274
- const COMPONENT_NAME$F = 'vc-select-option-group';
20290
+ const COMPONENT_NAME$G = 'vc-select-option-group';
20275
20291
  const OptionGroup = /* @__PURE__ */ vue.defineComponent({
20276
- name: COMPONENT_NAME$F,
20292
+ name: COMPONENT_NAME$G,
20277
20293
  props: props$s,
20278
20294
  setup(props, {
20279
20295
  slots
@@ -20371,9 +20387,9 @@ var VcComponents = (function (exports, vue) {
20371
20387
  function _isSlot$1(s) {
20372
20388
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
20373
20389
  }
20374
- const COMPONENT_NAME$E = 'vc-select';
20390
+ const COMPONENT_NAME$F = 'vc-select';
20375
20391
  const Select = /* @__PURE__ */ vue.defineComponent({
20376
- name: COMPONENT_NAME$E,
20392
+ name: COMPONENT_NAME$F,
20377
20393
  props: props$r,
20378
20394
  emits: ['ready', 'close', 'visible-change', 'clear', 'change', 'update:modelValue'],
20379
20395
  setup(props, {
@@ -20620,9 +20636,9 @@ var VcComponents = (function (exports, vue) {
20620
20636
 
20621
20637
  /** @jsxImportSource vue */
20622
20638
 
20623
- const COMPONENT_NAME$D = 'vc-pagination';
20639
+ const COMPONENT_NAME$E = 'vc-pagination';
20624
20640
  const Pagination = /* @__PURE__ */ vue.defineComponent({
20625
- name: COMPONENT_NAME$D,
20641
+ name: COMPONENT_NAME$E,
20626
20642
  props: props$v,
20627
20643
  emits: ['update:current', 'change', 'page-size-change'],
20628
20644
  setup(props, {
@@ -20820,9 +20836,9 @@ var VcComponents = (function (exports, vue) {
20820
20836
 
20821
20837
  /** @jsxImportSource vue */
20822
20838
 
20823
- const COMPONENT_NAME$C = 'vc-picker';
20839
+ const COMPONENT_NAME$D = 'vc-picker';
20824
20840
  const Picker = /* @__PURE__ */ vue.defineComponent({
20825
- name: COMPONENT_NAME$C,
20841
+ name: COMPONENT_NAME$D,
20826
20842
  props: props$q,
20827
20843
  setup(props, {
20828
20844
  slots
@@ -20846,9 +20862,9 @@ var VcComponents = (function (exports, vue) {
20846
20862
 
20847
20863
  /** @jsxImportSource vue */
20848
20864
 
20849
- const COMPONENT_NAME$B = 'vc-popconfirm';
20865
+ const COMPONENT_NAME$C = 'vc-popconfirm';
20850
20866
  const Popconfirm = /* @__PURE__ */ vue.defineComponent({
20851
- name: COMPONENT_NAME$B,
20867
+ name: COMPONENT_NAME$C,
20852
20868
  props: props$p,
20853
20869
  setup(props, {
20854
20870
  slots
@@ -20874,9 +20890,9 @@ var VcComponents = (function (exports, vue) {
20874
20890
 
20875
20891
  /** @jsxImportSource vue */
20876
20892
 
20877
- const COMPONENT_NAME$A = 'vc-popup';
20893
+ const COMPONENT_NAME$B = 'vc-popup';
20878
20894
  const Popup = /* @__PURE__ */ vue.defineComponent({
20879
- name: COMPONENT_NAME$A,
20895
+ name: COMPONENT_NAME$B,
20880
20896
  props: props$o,
20881
20897
  setup(props, {
20882
20898
  slots
@@ -20903,9 +20919,9 @@ var VcComponents = (function (exports, vue) {
20903
20919
 
20904
20920
  /** @jsxImportSource vue */
20905
20921
 
20906
- const COMPONENT_NAME$z = 'vc-print';
20922
+ const COMPONENT_NAME$A = 'vc-print';
20907
20923
  const Print = /* @__PURE__ */ vue.defineComponent({
20908
- name: COMPONENT_NAME$z,
20924
+ name: COMPONENT_NAME$A,
20909
20925
  props: props$n,
20910
20926
  setup(props, {
20911
20927
  expose,
@@ -21007,9 +21023,9 @@ var VcComponents = (function (exports, vue) {
21007
21023
 
21008
21024
  /** @jsxImportSource vue */
21009
21025
 
21010
- const COMPONENT_NAME$y = 'vc-progress-circle';
21026
+ const COMPONENT_NAME$z = 'vc-progress-circle';
21011
21027
  const Circle$1 = /* @__PURE__ */ vue.defineComponent({
21012
- name: COMPONENT_NAME$y,
21028
+ name: COMPONENT_NAME$z,
21013
21029
  props: props$m,
21014
21030
  setup(props, {
21015
21031
  slots
@@ -21069,9 +21085,9 @@ var VcComponents = (function (exports, vue) {
21069
21085
 
21070
21086
  /** @jsxImportSource vue */
21071
21087
 
21072
- const COMPONENT_NAME$x = 'vc-progress-line';
21088
+ const COMPONENT_NAME$y = 'vc-progress-line';
21073
21089
  const Line$2 = /* @__PURE__ */ vue.defineComponent({
21074
- name: COMPONENT_NAME$x,
21090
+ name: COMPONENT_NAME$y,
21075
21091
  props: props$m,
21076
21092
  setup(props) {
21077
21093
  const colorStyle = vue.computed(() => {
@@ -21118,9 +21134,9 @@ var VcComponents = (function (exports, vue) {
21118
21134
  function _isSlot(s) {
21119
21135
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
21120
21136
  }
21121
- const COMPONENT_NAME$w = 'vc-progress';
21137
+ const COMPONENT_NAME$x = 'vc-progress';
21122
21138
  const Progress = /* @__PURE__ */ vue.defineComponent({
21123
- name: COMPONENT_NAME$w,
21139
+ name: COMPONENT_NAME$x,
21124
21140
  props: props$m,
21125
21141
  setup(props, {
21126
21142
  slots
@@ -21278,9 +21294,9 @@ var VcComponents = (function (exports, vue) {
21278
21294
 
21279
21295
  /** @jsxImportSource vue */
21280
21296
 
21281
- const COMPONENT_NAME$v = 'vc-radio';
21297
+ const COMPONENT_NAME$w = 'vc-radio';
21282
21298
  const Radio = /* @__PURE__ */ vue.defineComponent({
21283
- name: COMPONENT_NAME$v,
21299
+ name: COMPONENT_NAME$w,
21284
21300
  props: props$l,
21285
21301
  emits: ['update:modelValue', 'change'],
21286
21302
  setup(props, {
@@ -21391,9 +21407,9 @@ var VcComponents = (function (exports, vue) {
21391
21407
 
21392
21408
  /** @jsxImportSource vue */
21393
21409
 
21394
- const COMPONENT_NAME$u = 'vc-radio-group';
21410
+ const COMPONENT_NAME$v = 'vc-radio-group';
21395
21411
  const RadioGroup = /* @__PURE__ */ vue.defineComponent({
21396
- name: COMPONENT_NAME$u,
21412
+ name: COMPONENT_NAME$v,
21397
21413
  props: props$k,
21398
21414
  emits: ['update:modelValue', 'change'],
21399
21415
  setup(props, {
@@ -21414,9 +21430,9 @@ var VcComponents = (function (exports, vue) {
21414
21430
 
21415
21431
  /** @jsxImportSource vue */
21416
21432
 
21417
- const COMPONENT_NAME$t = 'vcm-radio';
21433
+ const COMPONENT_NAME$u = 'vcm-radio';
21418
21434
  const MRadio = /* @__PURE__ */ vue.defineComponent({
21419
- name: COMPONENT_NAME$t,
21435
+ name: COMPONENT_NAME$u,
21420
21436
  props: props$l,
21421
21437
  emits: ['update:modelValue', 'change'],
21422
21438
  setup(props, {
@@ -21457,9 +21473,9 @@ var VcComponents = (function (exports, vue) {
21457
21473
 
21458
21474
  /** @jsxImportSource vue */
21459
21475
 
21460
- const COMPONENT_NAME$s = 'vcm-radio-group';
21476
+ const COMPONENT_NAME$t = 'vcm-radio-group';
21461
21477
  const MRadioGroup = /* @__PURE__ */ vue.defineComponent({
21462
- name: COMPONENT_NAME$s,
21478
+ name: COMPONENT_NAME$t,
21463
21479
  props: props$k,
21464
21480
  emits: ['update:modelValue', 'change'],
21465
21481
  setup(props, {
@@ -21488,9 +21504,9 @@ var VcComponents = (function (exports, vue) {
21488
21504
 
21489
21505
  /** @jsxImportSource vue */
21490
21506
 
21491
- const COMPONENT_NAME$r = 'vc-rate';
21507
+ const COMPONENT_NAME$s = 'vc-rate';
21492
21508
  const Rate = /* @__PURE__ */ vue.defineComponent({
21493
- name: COMPONENT_NAME$r,
21509
+ name: COMPONENT_NAME$s,
21494
21510
  props: props$j,
21495
21511
  setup(props, {
21496
21512
  slots
@@ -21672,9 +21688,9 @@ var VcComponents = (function (exports, vue) {
21672
21688
 
21673
21689
  /** @jsxImportSource vue */
21674
21690
 
21675
- const COMPONENT_NAME$q = 'vc-recycle-list-scroll-state';
21691
+ const COMPONENT_NAME$r = 'vc-recycle-list-scroll-state';
21676
21692
  const ScrollState = /* @__PURE__ */ vue.defineComponent({
21677
- name: COMPONENT_NAME$q,
21693
+ name: COMPONENT_NAME$r,
21678
21694
  setup(_, {
21679
21695
  slots
21680
21696
  }) {
@@ -21804,12 +21820,12 @@ var VcComponents = (function (exports, vue) {
21804
21820
 
21805
21821
  /** @jsxImportSource vue */
21806
21822
 
21807
- const COMPONENT_NAME$p = 'vc-recycle-list-container';
21823
+ const COMPONENT_NAME$q = 'vc-recycle-list-container';
21808
21824
 
21809
21825
  // TODO: 抽离
21810
21826
  const transformKey = prefixStyle('transform').camel;
21811
21827
  const Container = /* @__PURE__ */ vue.defineComponent({
21812
- name: COMPONENT_NAME$p,
21828
+ name: COMPONENT_NAME$q,
21813
21829
  props: props$h,
21814
21830
  emits: ['refresh'],
21815
21831
  setup(props, {
@@ -21907,9 +21923,9 @@ var VcComponents = (function (exports, vue) {
21907
21923
 
21908
21924
  /** @jsxImportSource vue */
21909
21925
 
21910
- const COMPONENT_NAME$o = 'vc-recycle-list';
21926
+ const COMPONENT_NAME$p = 'vc-recycle-list';
21911
21927
  const RecycleList = /* @__PURE__ */ vue.defineComponent({
21912
- name: COMPONENT_NAME$o,
21928
+ name: COMPONENT_NAME$p,
21913
21929
  props: props$i,
21914
21930
  emits: ['scroll', 'row-resize'],
21915
21931
  setup(props, {
@@ -22481,9 +22497,9 @@ var VcComponents = (function (exports, vue) {
22481
22497
 
22482
22498
  /** @jsxImportSource vue */
22483
22499
 
22484
- const COMPONENT_NAME$n = 'vc-slider';
22500
+ const COMPONENT_NAME$o = 'vc-slider';
22485
22501
  const Slider = /* @__PURE__ */ vue.defineComponent({
22486
- name: COMPONENT_NAME$n,
22502
+ name: COMPONENT_NAME$o,
22487
22503
  props: props$g,
22488
22504
  setup(props, {
22489
22505
  slots
@@ -22507,9 +22523,9 @@ var VcComponents = (function (exports, vue) {
22507
22523
 
22508
22524
  /** @jsxImportSource vue */
22509
22525
 
22510
- const COMPONENT_NAME$m = 'vc-sort-list';
22526
+ const COMPONENT_NAME$n = 'vc-sort-list';
22511
22527
  const SortList = /* @__PURE__ */ vue.defineComponent({
22512
- name: COMPONENT_NAME$m,
22528
+ name: COMPONENT_NAME$n,
22513
22529
  props: props$f,
22514
22530
  setup(props, {
22515
22531
  slots
@@ -22533,9 +22549,9 @@ var VcComponents = (function (exports, vue) {
22533
22549
 
22534
22550
  /** @jsxImportSource vue */
22535
22551
 
22536
- const COMPONENT_NAME$l = 'vc-steps';
22552
+ const COMPONENT_NAME$m = 'vc-steps';
22537
22553
  const Steps = /* @__PURE__ */ vue.defineComponent({
22538
- name: COMPONENT_NAME$l,
22554
+ name: COMPONENT_NAME$m,
22539
22555
  props: props$e,
22540
22556
  setup(props, {
22541
22557
  slots
@@ -22648,9 +22664,9 @@ var VcComponents = (function (exports, vue) {
22648
22664
 
22649
22665
  /** @jsxImportSource vue */
22650
22666
 
22651
- const COMPONENT_NAME$k = 'vc-switch';
22667
+ const COMPONENT_NAME$l = 'vc-switch';
22652
22668
  const Switch = /* @__PURE__ */ vue.defineComponent({
22653
- name: COMPONENT_NAME$k,
22669
+ name: COMPONENT_NAME$l,
22654
22670
  props: props$d,
22655
22671
  // click -> onClick要被拦截,此处不能放置
22656
22672
  emits: ['update:modelValue', 'change', 'click'],
@@ -22687,9 +22703,9 @@ var VcComponents = (function (exports, vue) {
22687
22703
 
22688
22704
  /** @jsxImportSource vue */
22689
22705
 
22690
- const COMPONENT_NAME$j = 'vcm-switch';
22706
+ const COMPONENT_NAME$k = 'vcm-switch';
22691
22707
  const MSwitch = /* @__PURE__ */ vue.defineComponent({
22692
- name: COMPONENT_NAME$j,
22708
+ name: COMPONENT_NAME$k,
22693
22709
  props: props$d,
22694
22710
  // click -> onClick要被拦截,此处不能放置
22695
22711
  emits: ['update:modelValue', 'change', 'click'],
@@ -41013,9 +41029,9 @@ var VcComponents = (function (exports, vue) {
41013
41029
 
41014
41030
  /** @jsxImportSource vue */
41015
41031
 
41016
- const COMPONENT_NAME$i = 'vc-table-normal-list';
41032
+ const COMPONENT_NAME$j = 'vc-table-normal-list';
41017
41033
  const NormalList = /* @__PURE__ */ vue.defineComponent({
41018
- name: COMPONENT_NAME$i,
41034
+ name: COMPONENT_NAME$j,
41019
41035
  props: {
41020
41036
  data: {
41021
41037
  type: Array,
@@ -41855,9 +41871,9 @@ var VcComponents = (function (exports, vue) {
41855
41871
 
41856
41872
  /** @jsxImportSource vue */
41857
41873
 
41858
- const COMPONENT_NAME$h = 'vc-table';
41874
+ const COMPONENT_NAME$i = 'vc-table';
41859
41875
  const Table = /* @__PURE__ */ vue.defineComponent({
41860
- name: COMPONENT_NAME$h,
41876
+ name: COMPONENT_NAME$i,
41861
41877
  props: props$c,
41862
41878
  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'],
41863
41879
  setup(props, {
@@ -42492,9 +42508,9 @@ var VcComponents = (function (exports, vue) {
42492
42508
 
42493
42509
  /** @jsxImportSource vue */
42494
42510
 
42495
- const COMPONENT_NAME$g = 'vc-text';
42511
+ const COMPONENT_NAME$h = 'vc-text';
42496
42512
  const Text = /* @__PURE__ */ vue.defineComponent({
42497
- name: COMPONENT_NAME$g,
42513
+ name: COMPONENT_NAME$h,
42498
42514
  props: props$b,
42499
42515
  setup(props, {
42500
42516
  emit
@@ -43189,9 +43205,9 @@ var VcComponents = (function (exports, vue) {
43189
43205
 
43190
43206
  /** @jsxImportSource vue */
43191
43207
 
43192
- const COMPONENT_NAME$f = 'vc-tabs';
43208
+ const COMPONENT_NAME$g = 'vc-tabs';
43193
43209
  const Tabs = /* @__PURE__ */ vue.defineComponent({
43194
- name: COMPONENT_NAME$f,
43210
+ name: COMPONENT_NAME$g,
43195
43211
  props: props$a,
43196
43212
  emits: ['update:modelValue', 'change', 'click'],
43197
43213
  setup(props, {
@@ -43439,9 +43455,9 @@ var VcComponents = (function (exports, vue) {
43439
43455
 
43440
43456
  /** @jsxImportSource vue */
43441
43457
 
43442
- const COMPONENT_NAME$e = 'vc-tabs-pane';
43458
+ const COMPONENT_NAME$f = 'vc-tabs-pane';
43443
43459
  const TabsPane = /* @__PURE__ */ vue.defineComponent({
43444
- name: COMPONENT_NAME$e,
43460
+ name: COMPONENT_NAME$f,
43445
43461
  props: props$9,
43446
43462
  setup(_, {
43447
43463
  slots
@@ -43496,9 +43512,9 @@ var VcComponents = (function (exports, vue) {
43496
43512
 
43497
43513
  /** @jsxImportSource vue */
43498
43514
 
43499
- const COMPONENT_NAME$d = 'vcm-tabs';
43515
+ const COMPONENT_NAME$e = 'vcm-tabs';
43500
43516
  const MTabs = /* @__PURE__ */ vue.defineComponent({
43501
- name: COMPONENT_NAME$d,
43517
+ name: COMPONENT_NAME$e,
43502
43518
  props: props$8,
43503
43519
  emits: ['update:modelValue', 'change', 'click'],
43504
43520
  setup(props, {
@@ -43763,9 +43779,9 @@ var VcComponents = (function (exports, vue) {
43763
43779
 
43764
43780
  /** @jsxImportSource vue */
43765
43781
 
43766
- const COMPONENT_NAME$c = 'vcm-tabs-pane';
43782
+ const COMPONENT_NAME$d = 'vcm-tabs-pane';
43767
43783
  const MTabsPane = /* @__PURE__ */ vue.defineComponent({
43768
- name: COMPONENT_NAME$c,
43784
+ name: COMPONENT_NAME$d,
43769
43785
  props: props$9,
43770
43786
  setup(_, {
43771
43787
  slots
@@ -44066,9 +44082,9 @@ var VcComponents = (function (exports, vue) {
44066
44082
 
44067
44083
  /** @jsxImportSource vue */
44068
44084
 
44069
- const COMPONENT_NAME$b = 'vc-textarea';
44085
+ const COMPONENT_NAME$c = 'vc-textarea';
44070
44086
  const Textarea = /* @__PURE__ */ vue.defineComponent({
44071
- name: COMPONENT_NAME$b,
44087
+ name: COMPONENT_NAME$c,
44072
44088
  props: Object.assign(props$7, {
44073
44089
  indicator: {
44074
44090
  type: [Boolean, Object],
@@ -44124,9 +44140,9 @@ var VcComponents = (function (exports, vue) {
44124
44140
 
44125
44141
  /** @jsxImportSource vue */
44126
44142
 
44127
- const COMPONENT_NAME$a = 'vcm-textarea';
44143
+ const COMPONENT_NAME$b = 'vcm-textarea';
44128
44144
  const MTextarea = /* @__PURE__ */ vue.defineComponent({
44129
- name: COMPONENT_NAME$a,
44145
+ name: COMPONENT_NAME$b,
44130
44146
  props: Object.assign(props$7, {
44131
44147
  align: {
44132
44148
  type: String,
@@ -44209,9 +44225,9 @@ var VcComponents = (function (exports, vue) {
44209
44225
  }
44210
44226
  };
44211
44227
 
44212
- const COMPONENT_NAME$9 = "vc-theme";
44228
+ const COMPONENT_NAME$a = "vc-theme";
44213
44229
  const Theme = vue.defineComponent({
44214
- name: COMPONENT_NAME$9,
44230
+ name: COMPONENT_NAME$a,
44215
44231
  props: props$6,
44216
44232
  setup(props, { slots }) {
44217
44233
  const themeId = getUid("vc-theme");
@@ -44297,9 +44313,9 @@ var VcComponents = (function (exports, vue) {
44297
44313
  }
44298
44314
  });
44299
44315
 
44300
- const COMPONENT_NAME$8 = "vc-theme-view";
44316
+ const COMPONENT_NAME$9 = "vc-theme-view";
44301
44317
  const ThemeView = vue.defineComponent({
44302
- name: COMPONENT_NAME$8,
44318
+ name: COMPONENT_NAME$9,
44303
44319
  props: props$6,
44304
44320
  setup(props, { slots }) {
44305
44321
  return () => {
@@ -44315,9 +44331,9 @@ var VcComponents = (function (exports, vue) {
44315
44331
  }
44316
44332
  });
44317
44333
 
44318
- const COMPONENT_NAME$7 = "vc-theme-text";
44334
+ const COMPONENT_NAME$8 = "vc-theme-text";
44319
44335
  const ThemeText = vue.defineComponent({
44320
- name: COMPONENT_NAME$7,
44336
+ name: COMPONENT_NAME$8,
44321
44337
  props: props$6,
44322
44338
  setup(props, { slots }) {
44323
44339
  return () => {
@@ -44333,9 +44349,9 @@ var VcComponents = (function (exports, vue) {
44333
44349
  }
44334
44350
  });
44335
44351
 
44336
- const COMPONENT_NAME$6 = "vc-theme-image";
44352
+ const COMPONENT_NAME$7 = "vc-theme-image";
44337
44353
  const ThemeImage = vue.defineComponent({
44338
- name: COMPONENT_NAME$6,
44354
+ name: COMPONENT_NAME$7,
44339
44355
  props: props$6,
44340
44356
  setup(props, { slots }) {
44341
44357
  return () => {
@@ -44383,12 +44399,12 @@ var VcComponents = (function (exports, vue) {
44383
44399
 
44384
44400
  /** @jsxImportSource vue */
44385
44401
 
44386
- const COMPONENT_NAME$5 = 'vc-time-picker';
44402
+ const COMPONENT_NAME$6 = 'vc-time-picker';
44387
44403
  const getPanel = type => {
44388
44404
  const isRange = type === 'timerange';
44389
44405
  return isRange ? TimeRangePanel : TimePanel;
44390
44406
  };
44391
- const TimePicker = createPicker(COMPONENT_NAME$5, props$5, () => {
44407
+ const TimePicker = createPicker(COMPONENT_NAME$6, props$5, () => {
44392
44408
  const props = vue.getCurrentInstance().props;
44393
44409
  const icon = vue.ref('icon');
44394
44410
  const panel = vue.shallowRef({});
@@ -44423,9 +44439,9 @@ var VcComponents = (function (exports, vue) {
44423
44439
 
44424
44440
  /** @jsxImportSource vue */
44425
44441
 
44426
- const COMPONENT_NAME$4 = 'vc-timeline';
44442
+ const COMPONENT_NAME$5 = 'vc-timeline';
44427
44443
  const Timeline = /* @__PURE__ */ vue.defineComponent({
44428
- name: COMPONENT_NAME$4,
44444
+ name: COMPONENT_NAME$5,
44429
44445
  props: props$4,
44430
44446
  setup(props, {
44431
44447
  slots
@@ -44452,9 +44468,9 @@ var VcComponents = (function (exports, vue) {
44452
44468
 
44453
44469
  /** @jsxImportSource vue */
44454
44470
 
44455
- const COMPONENT_NAME$3 = 'vc-touch';
44471
+ const COMPONENT_NAME$4 = 'vc-touch';
44456
44472
  const Touch = /* @__PURE__ */ vue.defineComponent({
44457
- name: COMPONENT_NAME$3,
44473
+ name: COMPONENT_NAME$4,
44458
44474
  props: props$3,
44459
44475
  setup(props, {
44460
44476
  slots
@@ -44478,9 +44494,9 @@ var VcComponents = (function (exports, vue) {
44478
44494
 
44479
44495
  /** @jsxImportSource vue */
44480
44496
 
44481
- const COMPONENT_NAME$2 = 'vc-tree';
44497
+ const COMPONENT_NAME$3 = 'vc-tree';
44482
44498
  const Tree$1 = /* @__PURE__ */ vue.defineComponent({
44483
- name: COMPONENT_NAME$2,
44499
+ name: COMPONENT_NAME$3,
44484
44500
  props: props$2,
44485
44501
  setup(props, {
44486
44502
  slots
@@ -44590,9 +44606,9 @@ var VcComponents = (function (exports, vue) {
44590
44606
  }
44591
44607
  };
44592
44608
 
44593
- const COMPONENT_NAME$1 = "vc-upload";
44609
+ const COMPONENT_NAME$2 = "vc-upload";
44594
44610
  const Upload = vue.defineComponent({
44595
- name: COMPONENT_NAME$1,
44611
+ name: COMPONENT_NAME$2,
44596
44612
  props: props$1,
44597
44613
  emits: [
44598
44614
  "message",
@@ -44978,6 +44994,104 @@ var VcComponents = (function (exports, vue) {
44978
44994
  gallery: Boolean
44979
44995
  };
44980
44996
 
44997
+ /** @jsxImportSource vue */
44998
+
44999
+ const COMPONENT_NAME$1 = 'vc-steps';
45000
+ const ImageItem = /* @__PURE__ */ vue.defineComponent({
45001
+ name: COMPONENT_NAME$1,
45002
+ props: {
45003
+ imageClass: [String, Object, Array],
45004
+ disabled: Boolean,
45005
+ row: Object,
45006
+ imagePreviewOptions: {
45007
+ type: Object,
45008
+ default: () => ({})
45009
+ },
45010
+ index: [String, Number],
45011
+ data: {
45012
+ type: Array,
45013
+ default: () => []
45014
+ },
45015
+ keyValue: Object
45016
+ },
45017
+ emits: ['open', 'close', 'delete'],
45018
+ setup(props, {
45019
+ slots,
45020
+ emit
45021
+ }) {
45022
+ const instance = vue.getCurrentInstance();
45023
+ const current = vue.computed(() => {
45024
+ if (props.row?.status === 0) return -1;
45025
+ const v = props.data.filter(i => i.status !== 0);
45026
+ return v.findIndex(i => {
45027
+ const a = i[props.keyValue.value] || i;
45028
+ const b = props.row?.[props.keyValue.value] || props.row;
45029
+ return a === b;
45030
+ });
45031
+ });
45032
+ // 拿到可预览的图片,供预览组件使用
45033
+ const getPreviewData = () => {
45034
+ return props.data.map(i => i?.[props.keyValue.value]);
45035
+ };
45036
+ const previewByPS = (e, index) => {
45037
+ emit('open');
45038
+ ImagePreview.open({
45039
+ current: index,
45040
+ data: getPreviewData(),
45041
+ onClose: () => emit('close')
45042
+ });
45043
+ };
45044
+ const handlePreview = e => {
45045
+ /**
45046
+ * 渐进增强
45047
+ */
45048
+ let {
45049
+ enhancer
45050
+ } = VcInstance.options.ImagePreview || {};
45051
+ enhancer = props.imagePreviewOptions.enhancer || enhancer || (() => false);
45052
+ const images = getPreviewData().map(item => ({
45053
+ src: item
45054
+ }));
45055
+ enhancer(current.value, images, instance) || previewByPS(e, current.value);
45056
+ };
45057
+ const handleDel = () => {
45058
+ emit('delete');
45059
+ };
45060
+ return () => {
45061
+ const row = props.row;
45062
+ return vue.createVNode("div", {
45063
+ "class": [{
45064
+ 'is-error': row.status == 0
45065
+ }, 'vc-upload-image-item']
45066
+ }, [slots.default ? slots.default({
45067
+ it: row,
45068
+ current: current.value
45069
+ }) : vue.createVNode(vue.Fragment, null, [!row.errorFlag && typeof row[props.keyValue.value] === 'string' ? vue.createVNode(Image$1, {
45070
+ "src": row[props.keyValue.value],
45071
+ "class": [props.imageClass, 'vc-upload-image-item__content'],
45072
+ "fit": "cover",
45073
+ "previewable": false,
45074
+ "onClick": handlePreview
45075
+ }, null) : vue.createVNode("div", {
45076
+ "class": [props.imageClass, 'vc-upload-image-item__content']
45077
+ }, [row.percent && row.percent != 100 ? vue.createVNode(Progress, {
45078
+ "percent": row.percent,
45079
+ "show-text": false,
45080
+ "status": "normal",
45081
+ "style": "width: 100%;padding: 0 5px"
45082
+ }, null) : !row[props.keyValue.value] && row.percent === 100 && !row.errorFlag ? vue.createVNode("p", {
45083
+ "style": "line-height: 1; padding: 5px"
45084
+ }, [vue.createTextVNode("\u670D\u52A1\u5668\u6B63\u5728\u63A5\u6536...")]) : row.status == 0 ? vue.createVNode("div", {
45085
+ "style": "padding: 5px"
45086
+ }, [vue.createTextVNode("\u4E0A\u4F20\u5931\u8D25")]) : null]), (!props.disabled || row.errorFlag) && vue.createVNode(Icon, {
45087
+ "type": "close-small",
45088
+ "class": "vc-upload-picker__delete",
45089
+ "onClick": handleDel
45090
+ }, null)])]);
45091
+ };
45092
+ }
45093
+ });
45094
+
44981
45095
  const recognizer = (url) => {
44982
45096
  const reg = /\.(jpe?g|png|gif|bmp|webp|image|heic|mp4|mov|avi|mpg|mpeg|rmvb)/ig;
44983
45097
  const result = url.match(reg);
@@ -45229,7 +45343,7 @@ var VcComponents = (function (exports, vue) {
45229
45343
  const UploadPicker = /* @__PURE__ */ vue.defineComponent({
45230
45344
  name: COMPONENT_NAME,
45231
45345
  props: props,
45232
- emits: ['update:modelValue', 'file-success', 'file-start', 'success', 'error', 'complete', 'change', 'remove-before'],
45346
+ emits: ['update:modelValue', 'file-success', 'file-start', 'file-before', 'file-error', 'success', 'error', 'complete', 'change', 'remove-before'],
45233
45347
  setup(props, {
45234
45348
  slots,
45235
45349
  expose
@@ -45241,8 +45355,7 @@ var VcComponents = (function (exports, vue) {
45241
45355
  case 'image':
45242
45356
  pre.push({
45243
45357
  type: cur,
45244
- item: 'div'
45245
- // item: ImageItem
45358
+ item: ImageItem
45246
45359
  });
45247
45360
  return pre;
45248
45361
  case 'video':
@@ -45291,7 +45404,7 @@ var VcComponents = (function (exports, vue) {
45291
45404
  const Item = picker.item;
45292
45405
  return vue.createVNode(Item, {
45293
45406
  "key": typeof item === 'object' ? item.uid : item,
45294
- "it": item,
45407
+ "row": item,
45295
45408
  "disabled": props.disabled,
45296
45409
  "image-preview-options": props.imagePreviewOptions,
45297
45410
  "imageClass": props.imageClass,
@@ -45299,18 +45412,19 @@ var VcComponents = (function (exports, vue) {
45299
45412
  "audioClass": props.audioClass,
45300
45413
  "fileClass": props.fileClass,
45301
45414
  "index": index,
45302
- "data": item,
45415
+ "keyValue": props.keyValue,
45416
+ "data": base.currentValue.value[picker.type],
45303
45417
  "class": "vc-upload-picker__item",
45304
45418
  "onDelete": () => base.handleDelete(index, picker.type)
45305
45419
  }, {
45306
- default: scopeData => {
45307
- return slots.default ? slots.default({
45420
+ default: slots.default ? scopeData => {
45421
+ return slots?.default?.({
45308
45422
  it: scopeData?.it,
45309
45423
  current: scopeData?.current,
45310
45424
  index,
45311
45425
  name: picker.type
45312
- }) : scopeData;
45313
- }
45426
+ });
45427
+ } : null
45314
45428
  });
45315
45429
  }), vue.withDirectives(vue.createVNode(Upload, vue.mergeProps(base.currentUploadOptions.value[picker.type], {
45316
45430
  "max": base.dynamicMax[picker.type],