@deot/vc-components 1.0.24 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -11,6 +11,7 @@ const $ = require('@deot/helper-dom');
11
11
  const vcHooks = require('@deot/vc-hooks');
12
12
  const helperWheel = require('@deot/helper-wheel');
13
13
  const helperValidator = require('@deot/helper-validator');
14
+ const PhotoSwipeLightbox = require('photoswipe/lightbox');
14
15
  const helperCache = require('@deot/helper-cache');
15
16
  const Load = require('@deot/helper-load');
16
17
  const helperScheduler = require('@deot/helper-scheduler');
@@ -102,9 +103,9 @@ const props$1q = {
102
103
 
103
104
  /** @jsxImportSource vue */
104
105
 
105
- const COMPONENT_NAME$1$ = 'vc-action-sheet';
106
+ const COMPONENT_NAME$20 = 'vc-action-sheet';
106
107
  const ActionSheet = /* @__PURE__ */ vue.defineComponent({
107
- name: COMPONENT_NAME$1$,
108
+ name: COMPONENT_NAME$20,
108
109
  props: props$1q,
109
110
  setup(props, {
110
111
  slots
@@ -291,9 +292,9 @@ const IconManager = new Manager();
291
292
 
292
293
  /** @jsxImportSource vue */
293
294
 
294
- const COMPONENT_NAME$1_ = 'vc-icon';
295
+ const COMPONENT_NAME$1$ = 'vc-icon';
295
296
  const Icon = /* @__PURE__ */ vue.defineComponent({
296
- name: COMPONENT_NAME$1_,
297
+ name: COMPONENT_NAME$1$,
297
298
  props: props$1o,
298
299
  setup(props) {
299
300
  const viewBox = vue.ref('0 0 1024 1024');
@@ -492,9 +493,9 @@ const useTransition = () => {
492
493
  };
493
494
  };
494
495
 
495
- const COMPONENT_NAME$1Z = "vc-transition";
496
+ const COMPONENT_NAME$1_ = "vc-transition";
496
497
  const Transition = vue.defineComponent({
497
- name: COMPONENT_NAME$1Z,
498
+ name: COMPONENT_NAME$1_,
498
499
  props: props$1n,
499
500
  // 当不声明emits的情况下,事件存在于attrs中
500
501
  inheritAttrs: false,
@@ -515,9 +516,9 @@ const Transition = vue.defineComponent({
515
516
  }
516
517
  });
517
518
 
518
- const COMPONENT_NAME$1Y = "vc-transition-collapse";
519
+ const COMPONENT_NAME$1Z = "vc-transition-collapse";
519
520
  const TransitionCollapse = vue.defineComponent({
520
- name: COMPONENT_NAME$1Y,
521
+ name: COMPONENT_NAME$1Z,
521
522
  props: props$1n,
522
523
  // 当不声明emits的情况下,事件存在于attrs中
523
524
  inheritAttrs: false,
@@ -636,9 +637,9 @@ const TransitionCollapse = vue.defineComponent({
636
637
  }
637
638
  });
638
639
 
639
- const COMPONENT_NAME$1X = "vc-transition-fade";
640
+ const COMPONENT_NAME$1Y = "vc-transition-fade";
640
641
  const TransitionFade = vue.defineComponent({
641
- name: COMPONENT_NAME$1X,
642
+ name: COMPONENT_NAME$1Y,
642
643
  props: {
643
644
  ...props$1n,
644
645
  // inheritAttrs必须是false
@@ -673,9 +674,9 @@ const TransitionFade = vue.defineComponent({
673
674
  }
674
675
  });
675
676
 
676
- const COMPONENT_NAME$1W = "vc-transition-scale";
677
+ const COMPONENT_NAME$1X = "vc-transition-scale";
677
678
  const TransitionScale = vue.defineComponent({
678
- name: COMPONENT_NAME$1W,
679
+ name: COMPONENT_NAME$1X,
679
680
  props: {
680
681
  ...props$1n,
681
682
  mode: {
@@ -715,9 +716,9 @@ const TransitionScale = vue.defineComponent({
715
716
  }
716
717
  });
717
718
 
718
- const COMPONENT_NAME$1V = "vc-transition-slide";
719
+ const COMPONENT_NAME$1W = "vc-transition-slide";
719
720
  const TransitionSlide = vue.defineComponent({
720
- name: COMPONENT_NAME$1V,
721
+ name: COMPONENT_NAME$1W,
721
722
  props: {
722
723
  ...props$1n,
723
724
  mode: {
@@ -757,9 +758,9 @@ const TransitionSlide = vue.defineComponent({
757
758
  }
758
759
  });
759
760
 
760
- const COMPONENT_NAME$1U = "vc-transition-zoom";
761
+ const COMPONENT_NAME$1V = "vc-transition-zoom";
761
762
  const TransitionZoom = vue.defineComponent({
762
- name: COMPONENT_NAME$1U,
763
+ name: COMPONENT_NAME$1V,
763
764
  props: {
764
765
  ...props$1n,
765
766
  mode: {
@@ -801,7 +802,7 @@ const TransitionZoom = vue.defineComponent({
801
802
 
802
803
  /** @jsxImportSource vue */
803
804
 
804
- const COMPONENT_NAME$1T = 'vc-alert';
805
+ const COMPONENT_NAME$1U = 'vc-alert';
805
806
 
806
807
  // [color, borderColor, backgroundColor], -> CSS
807
808
  const THEME_MAP = {
@@ -811,7 +812,7 @@ const THEME_MAP = {
811
812
  warning: ['#ffbf00', '#ffe58f', '#fffbe6']
812
813
  };
813
814
  const Alert = /* @__PURE__ */ vue.defineComponent({
814
- name: COMPONENT_NAME$1T,
815
+ name: COMPONENT_NAME$1U,
815
816
  props: props$1p,
816
817
  setup(props, {
817
818
  slots,
@@ -910,9 +911,9 @@ const props$1m = {
910
911
 
911
912
  /** @jsxImportSource vue */
912
913
 
913
- const COMPONENT_NAME$1S = 'vc-artboard';
914
+ const COMPONENT_NAME$1T = 'vc-artboard';
914
915
  const Artboard = /* @__PURE__ */ vue.defineComponent({
915
- name: COMPONENT_NAME$1S,
916
+ name: COMPONENT_NAME$1T,
916
917
  props: props$1m,
917
918
  setup(props, {
918
919
  slots
@@ -951,9 +952,9 @@ const props$1l = {
951
952
 
952
953
  /** @jsxImportSource vue */
953
954
 
954
- const COMPONENT_NAME$1R = 'vc-spin';
955
+ const COMPONENT_NAME$1S = 'vc-spin';
955
956
  const Spin = /* @__PURE__ */ vue.defineComponent({
956
- name: COMPONENT_NAME$1R,
957
+ name: COMPONENT_NAME$1S,
957
958
  props: props$1l,
958
959
  setup(props, {
959
960
  slots
@@ -1004,9 +1005,9 @@ const props$1k = {
1004
1005
  exclude: RegExp
1005
1006
  };
1006
1007
 
1007
- const COMPONENT_NAME$1Q = "vc-debounce";
1008
+ const COMPONENT_NAME$1R = "vc-debounce";
1008
1009
  const Debounce = vue.defineComponent({
1009
- name: COMPONENT_NAME$1Q,
1010
+ name: COMPONENT_NAME$1R,
1010
1011
  props: props$1k,
1011
1012
  /**
1012
1013
  * 不声明emits使得事件被透传放入attrs中, 这样可以让所有的事件透传
@@ -1078,16 +1079,16 @@ const props$1j = {
1078
1079
 
1079
1080
  /** @jsxImportSource vue */
1080
1081
 
1081
- const COMPONENT_NAME$1P = 'vc-button';
1082
+ const COMPONENT_NAME$1Q = 'vc-button';
1082
1083
  const Button = /* @__PURE__ */ vue.defineComponent({
1083
- name: COMPONENT_NAME$1P,
1084
+ name: COMPONENT_NAME$1Q,
1084
1085
  emits: ['click'],
1085
1086
  props: props$1j,
1086
1087
  setup(props, {
1087
1088
  slots
1088
1089
  }) {
1089
1090
  const vm = vue.getCurrentInstance();
1090
- const hasSlot = vue.ref(true);
1091
+ const isHover = vue.ref(false);
1091
1092
  const isLoading = vue.ref(false);
1092
1093
  const group = vue.inject('vc-button-group', {
1093
1094
  size: 'medium',
@@ -1096,10 +1097,11 @@ const Button = /* @__PURE__ */ vue.defineComponent({
1096
1097
  });
1097
1098
  const classes = vue.computed(() => ({
1098
1099
  'is-circle': props.circle || group.circle,
1099
- 'is-alone': !hasSlot.value,
1100
+ 'is-alone': !slots?.default,
1100
1101
  'is-round': props.round,
1101
1102
  'is-long': props.long,
1102
1103
  'is-disabled': props.disabled,
1104
+ 'is-hover': isHover.value,
1103
1105
  [`is-${props.size}`]: true,
1104
1106
  [`is-${props.type}`]: true
1105
1107
  }));
@@ -1112,9 +1114,6 @@ const Button = /* @__PURE__ */ vue.defineComponent({
1112
1114
  });
1113
1115
  }
1114
1116
  };
1115
- vue.onMounted(() => {
1116
- hasSlot.value = slots.default !== undefined;
1117
- });
1118
1117
  return () => {
1119
1118
  return vue.createVNode(Debounce, {
1120
1119
  "tag": props.tag,
@@ -1125,15 +1124,19 @@ const Button = /* @__PURE__ */ vue.defineComponent({
1125
1124
  "wait": props.wait,
1126
1125
  "disabled": props.disabled,
1127
1126
  "type": props.htmlType,
1128
- "onClick": handleClick
1127
+ "onClick": handleClick,
1128
+ "onMouseenter": () => isHover.value = true,
1129
+ "onMouseleave": () => isHover.value = false
1129
1130
  }, {
1130
1131
  default: () => [props.icon && vue.createVNode(Icon, {
1131
1132
  "type": props.icon
1132
- }, null), isLoading.value && vue.createVNode(Spin, {
1133
+ }, null), slots.icon && slots?.icon?.({
1134
+ hover: isHover.value
1135
+ }), isLoading.value && vue.createVNode(Spin, {
1133
1136
  "size": 12,
1134
1137
  "foreground": props.type === 'default' ? '#ccc' : '#fff',
1135
1138
  "class": "vc-button__loading"
1136
- }, null), hasSlot.value && vue.createVNode("span", null, [slots?.default?.()])]
1139
+ }, null), slots?.default && vue.createVNode("span", null, [slots?.default?.()])]
1137
1140
  });
1138
1141
  };
1139
1142
  }
@@ -1160,9 +1163,9 @@ const props$1i = {
1160
1163
 
1161
1164
  /** @jsxImportSource vue */
1162
1165
 
1163
- const COMPONENT_NAME$1O = 'vc-button-group';
1166
+ const COMPONENT_NAME$1P = 'vc-button-group';
1164
1167
  const ButtonGroup = /* @__PURE__ */ vue.defineComponent({
1165
- name: COMPONENT_NAME$1O,
1168
+ name: COMPONENT_NAME$1P,
1166
1169
  props: props$1i,
1167
1170
  setup(props, {
1168
1171
  slots
@@ -1196,9 +1199,9 @@ const props$1h = {
1196
1199
 
1197
1200
  /** @jsxImportSource vue */
1198
1201
 
1199
- const COMPONENT_NAME$1N = 'vc-calendar';
1202
+ const COMPONENT_NAME$1O = 'vc-calendar';
1200
1203
  const Calendar = /* @__PURE__ */ vue.defineComponent({
1201
- name: COMPONENT_NAME$1N,
1204
+ name: COMPONENT_NAME$1O,
1202
1205
  props: props$1h,
1203
1206
  setup(props, {
1204
1207
  slots
@@ -1236,9 +1239,9 @@ const props$1g = {
1236
1239
 
1237
1240
  /** @jsxImportSource vue */
1238
1241
 
1239
- const COMPONENT_NAME$1M = 'vc-card';
1242
+ const COMPONENT_NAME$1N = 'vc-card';
1240
1243
  const Card = /* @__PURE__ */ vue.defineComponent({
1241
- name: COMPONENT_NAME$1M,
1244
+ name: COMPONENT_NAME$1N,
1242
1245
  props: props$1g,
1243
1246
  setup(props, {
1244
1247
  slots
@@ -1274,9 +1277,9 @@ const props$1f = {
1274
1277
 
1275
1278
  /** @jsxImportSource vue */
1276
1279
 
1277
- const COMPONENT_NAME$1L = 'vc-carousel';
1280
+ const COMPONENT_NAME$1M = 'vc-carousel';
1278
1281
  const Carousel = /* @__PURE__ */ vue.defineComponent({
1279
- name: COMPONENT_NAME$1L,
1282
+ name: COMPONENT_NAME$1M,
1280
1283
  props: props$1f,
1281
1284
  setup(props, {
1282
1285
  slots
@@ -1300,9 +1303,9 @@ const props$1e = {
1300
1303
 
1301
1304
  /** @jsxImportSource vue */
1302
1305
 
1303
- const COMPONENT_NAME$1K = 'vc-cascader';
1306
+ const COMPONENT_NAME$1L = 'vc-cascader';
1304
1307
  const Cascader = /* @__PURE__ */ vue.defineComponent({
1305
- name: COMPONENT_NAME$1K,
1308
+ name: COMPONENT_NAME$1L,
1306
1309
  props: props$1e,
1307
1310
  setup(props, {
1308
1311
  slots
@@ -1371,9 +1374,9 @@ const props$1d = {
1371
1374
 
1372
1375
  /** @jsxImportSource vue */
1373
1376
 
1374
- const COMPONENT_NAME$1J = 'vc-chart';
1377
+ const COMPONENT_NAME$1K = 'vc-chart';
1375
1378
  const Chart = /* @__PURE__ */ vue.defineComponent({
1376
- name: COMPONENT_NAME$1J,
1379
+ name: COMPONENT_NAME$1K,
1377
1380
  props: props$1d,
1378
1381
  emits: [...EVENTS, 'ready'],
1379
1382
  setup(props, {
@@ -1549,7 +1552,8 @@ const useCheckbox = () => {
1549
1552
  "is-indeterminate": props.indeterminate,
1550
1553
  "is-checked": checked.value,
1551
1554
  "is-disabled": props.disabled,
1552
- "is-focus": isFocus.value
1555
+ "is-focus": isFocus.value,
1556
+ "is-error": !!formItem?.message?.value
1553
1557
  };
1554
1558
  });
1555
1559
  vue.watch(
@@ -1604,9 +1608,9 @@ const useCheckbox = () => {
1604
1608
 
1605
1609
  /** @jsxImportSource vue */
1606
1610
 
1607
- const COMPONENT_NAME$1I = 'vc-checkbox';
1611
+ const COMPONENT_NAME$1J = 'vc-checkbox';
1608
1612
  const Checkbox = /* @__PURE__ */ vue.defineComponent({
1609
- name: COMPONENT_NAME$1I,
1613
+ name: COMPONENT_NAME$1J,
1610
1614
  props: props$1c,
1611
1615
  emits: ['update:modelValue', 'change'],
1612
1616
  setup(props, {
@@ -1693,9 +1697,9 @@ const useCheckboxGroup = () => {
1693
1697
 
1694
1698
  /** @jsxImportSource vue */
1695
1699
 
1696
- const COMPONENT_NAME$1H = 'vc-checkbox-group';
1700
+ const COMPONENT_NAME$1I = 'vc-checkbox-group';
1697
1701
  const CheckboxGroup = /* @__PURE__ */ vue.defineComponent({
1698
- name: COMPONENT_NAME$1H,
1702
+ name: COMPONENT_NAME$1I,
1699
1703
  props: props$1b,
1700
1704
  emits: ['update:modelValue', 'change'],
1701
1705
  setup(props, {
@@ -1713,9 +1717,9 @@ const CheckboxGroup = /* @__PURE__ */ vue.defineComponent({
1713
1717
 
1714
1718
  /** @jsxImportSource vue */
1715
1719
 
1716
- const COMPONENT_NAME$1G = 'vcm-checkbox';
1720
+ const COMPONENT_NAME$1H = 'vcm-checkbox';
1717
1721
  const MCheckbox = /* @__PURE__ */ vue.defineComponent({
1718
- name: COMPONENT_NAME$1G,
1722
+ name: COMPONENT_NAME$1H,
1719
1723
  props: props$1c,
1720
1724
  emits: ['update:modelValue', 'change'],
1721
1725
  setup(props, {
@@ -1755,9 +1759,9 @@ const MCheckbox = /* @__PURE__ */ vue.defineComponent({
1755
1759
 
1756
1760
  /** @jsxImportSource vue */
1757
1761
 
1758
- const COMPONENT_NAME$1F = 'vcm-checkbox-group';
1762
+ const COMPONENT_NAME$1G = 'vcm-checkbox-group';
1759
1763
  const MCheckboxGroup = /* @__PURE__ */ vue.defineComponent({
1760
- name: COMPONENT_NAME$1F,
1764
+ name: COMPONENT_NAME$1G,
1761
1765
  props: props$1b,
1762
1766
  emits: ['update:modelValue', 'change'],
1763
1767
  setup(props, {
@@ -1816,9 +1820,9 @@ const props$19 = {
1816
1820
  }
1817
1821
  };
1818
1822
 
1819
- const COMPONENT_NAME$1E = "vc-customer";
1823
+ const COMPONENT_NAME$1F = "vc-customer";
1820
1824
  const Customer = vue.defineComponent({
1821
- name: COMPONENT_NAME$1E,
1825
+ name: COMPONENT_NAME$1F,
1822
1826
  props: props$19,
1823
1827
  setup(props, context) {
1824
1828
  return () => vue.h(() => {
@@ -1829,9 +1833,9 @@ const Customer = vue.defineComponent({
1829
1833
 
1830
1834
  /** @jsxImportSource vue */
1831
1835
 
1832
- const COMPONENT_NAME$1D = 'vc-message';
1836
+ const COMPONENT_NAME$1E = 'vc-message';
1833
1837
  const MessageView = /* @__PURE__ */ vue.defineComponent({
1834
- name: COMPONENT_NAME$1D,
1838
+ name: COMPONENT_NAME$1E,
1835
1839
  emits: ['before-close', 'close', 'portal-fulfilled'],
1836
1840
  props: props$1a,
1837
1841
  setup(props, {
@@ -1978,7 +1982,7 @@ class PortalLeaf {
1978
1982
  }
1979
1983
  }
1980
1984
 
1981
- const COMPONENT_NAME$1C = "vc-portal";
1985
+ const COMPONENT_NAME$1D = "vc-portal";
1982
1986
  class Portal {
1983
1987
  /**
1984
1988
  * 清理Portals类型组件
@@ -2030,7 +2034,7 @@ class Portal {
2030
2034
  this.wrapper = wrapper;
2031
2035
  this.globalOptions = {
2032
2036
  ...options,
2033
- name: options?.name || wrapper.name || Utils__namespace.getUid(COMPONENT_NAME$1C)
2037
+ name: options?.name || wrapper.name || Utils__namespace.getUid(COMPONENT_NAME$1D)
2034
2038
  };
2035
2039
  }
2036
2040
  popup(propsData, options) {
@@ -2129,7 +2133,7 @@ class Portal {
2129
2133
  ...rest
2130
2134
  } = options;
2131
2135
  let useAllNodes = fragment;
2132
- const name = multiple ? `${name$}__${Utils__namespace.getUid(COMPONENT_NAME$1C)}` : name$;
2136
+ const name = multiple ? `${name$}__${Utils__namespace.getUid(COMPONENT_NAME$1D)}` : name$;
2133
2137
  const container = document.createElement(tag);
2134
2138
  const root = typeof el === "object" ? el : document.querySelector(el || "body");
2135
2139
  !alive && Portal.leafs.get(name)?.destroy();
@@ -2163,7 +2167,7 @@ class Portal {
2163
2167
  } else {
2164
2168
  const wrapper = this.wrapper;
2165
2169
  const app = vue.createApp({
2166
- name: COMPONENT_NAME$1C,
2170
+ name: COMPONENT_NAME$1D,
2167
2171
  parent,
2168
2172
  setup() {
2169
2173
  if (alive) {
@@ -2275,13 +2279,13 @@ const props$18 = {
2275
2279
  }
2276
2280
  };
2277
2281
 
2278
- const COMPONENT_NAME$1B = 'vc-portal-view';
2282
+ const COMPONENT_NAME$1C = 'vc-portal-view';
2279
2283
 
2280
2284
  /**
2281
2285
  * 写法不同,但与vue@2.x 保持一致
2282
2286
  */
2283
2287
  const PortalView = /* @__PURE__ */ vue.defineComponent({
2284
- name: COMPONENT_NAME$1B,
2288
+ name: COMPONENT_NAME$1C,
2285
2289
  props: props$18,
2286
2290
  setup(props, {
2287
2291
  slots
@@ -2452,9 +2456,9 @@ const useClipboard = (done) => {
2452
2456
  return () => vue.h(props.tag, { onClick: handleClick, class: "vc-clipboard" }, slots?.default?.());
2453
2457
  };
2454
2458
 
2455
- const COMPONENT_NAME$1A = "vc-clipboard";
2459
+ const COMPONENT_NAME$1B = "vc-clipboard";
2456
2460
  const Clipboard$1 = vue.defineComponent({
2457
- name: COMPONENT_NAME$1A,
2461
+ name: COMPONENT_NAME$1B,
2458
2462
  props: props$17,
2459
2463
  setup() {
2460
2464
  return useClipboard((content) => Message.success({ content }));
@@ -2494,9 +2498,9 @@ const MTransitionZoom = TransitionZoom;
2494
2498
 
2495
2499
  /** @jsxImportSource vue */
2496
2500
 
2497
- const COMPONENT_NAME$1z = 'vcm-toast';
2501
+ const COMPONENT_NAME$1A = 'vcm-toast';
2498
2502
  const MToastView = /* @__PURE__ */ vue.defineComponent({
2499
- name: COMPONENT_NAME$1z,
2503
+ name: COMPONENT_NAME$1A,
2500
2504
  emits: ['close', 'portal-fulfilled'],
2501
2505
  props: props$16,
2502
2506
  setup(props, {
@@ -2598,9 +2602,9 @@ const warning$2 = create$3({ mode: "warning" });
2598
2602
  const error$2 = create$3({ mode: "error" });
2599
2603
  const MToast = Object.assign(MToastView, { destroy: destroy$4, info: info$2, success: success$2, loading, warning: warning$2, error: error$2 });
2600
2604
 
2601
- const COMPONENT_NAME$1y = "vcm-clipboard";
2605
+ const COMPONENT_NAME$1z = "vcm-clipboard";
2602
2606
  const MClipboard$1 = vue.defineComponent({
2603
- name: COMPONENT_NAME$1y,
2607
+ name: COMPONENT_NAME$1z,
2604
2608
  props: props$17,
2605
2609
  setup() {
2606
2610
  return useClipboard((content) => MToast.info({ content }));
@@ -2632,9 +2636,9 @@ const props$15 = {
2632
2636
  }
2633
2637
  };
2634
2638
 
2635
- const COMPONENT_NAME$1x = "vc-collapse";
2639
+ const COMPONENT_NAME$1y = "vc-collapse";
2636
2640
  const Collapse = vue.defineComponent({
2637
- name: COMPONENT_NAME$1x,
2641
+ name: COMPONENT_NAME$1y,
2638
2642
  props: props$15,
2639
2643
  emits: ["update:moodelValue", "change"],
2640
2644
  setup(props, { slots, emit }) {
@@ -2751,9 +2755,9 @@ const props$13 = {
2751
2755
  function _isSlot$3(s) {
2752
2756
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
2753
2757
  }
2754
- const COMPONENT_NAME$1w = 'vc-expand';
2758
+ const COMPONENT_NAME$1x = 'vc-expand';
2755
2759
  const Expand$1 = /* @__PURE__ */ vue.defineComponent({
2756
- name: COMPONENT_NAME$1w,
2760
+ name: COMPONENT_NAME$1x,
2757
2761
  props: props$13,
2758
2762
  setup(props, {
2759
2763
  slots
@@ -2783,9 +2787,9 @@ const Expand$1 = /* @__PURE__ */ vue.defineComponent({
2783
2787
 
2784
2788
  /** @jsxImportSource vue */
2785
2789
 
2786
- const COMPONENT_NAME$1v = 'vc-collapse-item';
2790
+ const COMPONENT_NAME$1w = 'vc-collapse-item';
2787
2791
  const CollapseItem = /* @__PURE__ */ vue.defineComponent({
2788
- name: COMPONENT_NAME$1v,
2792
+ name: COMPONENT_NAME$1w,
2789
2793
  props: props$14,
2790
2794
  setup(props, {
2791
2795
  slots,
@@ -2860,9 +2864,9 @@ const props$12 = {
2860
2864
 
2861
2865
  /** @jsxImportSource vue */
2862
2866
 
2863
- const COMPONENT_NAME$1u = 'vc-color-picker';
2867
+ const COMPONENT_NAME$1v = 'vc-color-picker';
2864
2868
  const ColorPicker = /* @__PURE__ */ vue.defineComponent({
2865
- name: COMPONENT_NAME$1u,
2869
+ name: COMPONENT_NAME$1v,
2866
2870
  props: props$12,
2867
2871
  setup(props, {
2868
2872
  slots
@@ -2886,9 +2890,9 @@ const props$11 = {
2886
2890
 
2887
2891
  /** @jsxImportSource vue */
2888
2892
 
2889
- const COMPONENT_NAME$1t = 'vc-countdown';
2893
+ const COMPONENT_NAME$1u = 'vc-countdown';
2890
2894
  const Countdown = /* @__PURE__ */ vue.defineComponent({
2891
- name: COMPONENT_NAME$1t,
2895
+ name: COMPONENT_NAME$1u,
2892
2896
  props: props$11,
2893
2897
  setup(props, {
2894
2898
  slots
@@ -3200,7 +3204,8 @@ const useInput = (input) => {
3200
3204
  const classes = vue.computed(() => {
3201
3205
  return {
3202
3206
  "is-focus": isFocus.value,
3203
- "is-disabled": props.disabled
3207
+ "is-disabled": props.disabled,
3208
+ "is-error": !!formItem?.message?.value
3204
3209
  };
3205
3210
  });
3206
3211
  const currentMaxlength = vue.computed(() => {
@@ -3337,9 +3342,9 @@ const useNativeEmitter = (input, expose) => {
3337
3342
 
3338
3343
  /** @jsxImportSource vue */
3339
3344
 
3340
- const COMPONENT_NAME$1s = 'vc-input';
3345
+ const COMPONENT_NAME$1t = 'vc-input';
3341
3346
  const Input = /* @__PURE__ */ vue.defineComponent({
3342
- name: COMPONENT_NAME$1s,
3347
+ name: COMPONENT_NAME$1t,
3343
3348
  inheritAttrs: false,
3344
3349
  props: {
3345
3350
  ...props$$,
@@ -3673,9 +3678,9 @@ const useInputNumber = () => {
3673
3678
 
3674
3679
  /** @jsxImportSource vue */
3675
3680
 
3676
- const COMPONENT_NAME$1r = 'vc-input-number';
3681
+ const COMPONENT_NAME$1s = 'vc-input-number';
3677
3682
  const InputNumber = /* @__PURE__ */ vue.defineComponent({
3678
- name: COMPONENT_NAME$1r,
3683
+ name: COMPONENT_NAME$1s,
3679
3684
  props: props$X,
3680
3685
  inheritAttrs: false,
3681
3686
  setup(props, {
@@ -3739,9 +3744,9 @@ const props$W = {
3739
3744
 
3740
3745
  /** @jsxImportSource vue */
3741
3746
 
3742
- const COMPONENT_NAME$1q = 'vc-input-search';
3747
+ const COMPONENT_NAME$1r = 'vc-input-search';
3743
3748
  const InputSearch = /* @__PURE__ */ vue.defineComponent({
3744
- name: COMPONENT_NAME$1q,
3749
+ name: COMPONENT_NAME$1r,
3745
3750
  props: props$W,
3746
3751
  inheritAttrs: false,
3747
3752
  setup(props, {
@@ -4032,9 +4037,9 @@ const usePos = () => {
4032
4037
  function _isSlot$2(s) {
4033
4038
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
4034
4039
  }
4035
- const COMPONENT_NAME$1p = 'vc-popover-wrapper';
4040
+ const COMPONENT_NAME$1q = 'vc-popover-wrapper';
4036
4041
  const PopoverWrapper = /* @__PURE__ */ vue.defineComponent({
4037
- name: COMPONENT_NAME$1p,
4042
+ name: COMPONENT_NAME$1q,
4038
4043
  props: props$_,
4039
4044
  emits: ['portal-fulfilled', 'close'],
4040
4045
  setup(props, {
@@ -4284,9 +4289,9 @@ const PopoverPortal = new Portal(PopoverWrapper);
4284
4289
 
4285
4290
  /** @jsxImportSource vue */
4286
4291
 
4287
- const COMPONENT_NAME$1o = 'vc-popover';
4292
+ const COMPONENT_NAME$1p = 'vc-popover';
4288
4293
  const Popover$1 = /* @__PURE__ */ vue.defineComponent({
4289
- name: COMPONENT_NAME$1o,
4294
+ name: COMPONENT_NAME$1p,
4290
4295
  props: props$Z,
4291
4296
  emits: ['update:modelValue', 'visible-change', 'ready', 'close'],
4292
4297
  setup(props, {
@@ -5387,9 +5392,9 @@ const getTimeType = type => {
5387
5392
  }
5388
5393
  return view;
5389
5394
  };
5390
- const COMPONENT_NAME$1n = 'vc-date-confirm';
5395
+ const COMPONENT_NAME$1o = 'vc-date-confirm';
5391
5396
  const Confirm = /* @__PURE__ */ vue.defineComponent({
5392
- name: COMPONENT_NAME$1n,
5397
+ name: COMPONENT_NAME$1o,
5393
5398
  props: {
5394
5399
  showTime: {
5395
5400
  type: Boolean,
@@ -5453,9 +5458,9 @@ const Confirm = /* @__PURE__ */ vue.defineComponent({
5453
5458
 
5454
5459
  /** @jsxImportSource vue */
5455
5460
 
5456
- const COMPONENT_NAME$1m = 'vc-date-header';
5461
+ const COMPONENT_NAME$1n = 'vc-date-header';
5457
5462
  const DateHeader = /* @__PURE__ */ vue.defineComponent({
5458
- name: COMPONENT_NAME$1m,
5463
+ name: COMPONENT_NAME$1n,
5459
5464
  props: {
5460
5465
  panelDate: Date,
5461
5466
  showNext: {
@@ -5539,9 +5544,9 @@ const DateHeader = /* @__PURE__ */ vue.defineComponent({
5539
5544
 
5540
5545
  /** @jsxImportSource vue */
5541
5546
 
5542
- const COMPONENT_NAME$1l = 'vc-date-table';
5547
+ const COMPONENT_NAME$1m = 'vc-date-table';
5543
5548
  const DateTable = /* @__PURE__ */ vue.defineComponent({
5544
- name: COMPONENT_NAME$1l,
5549
+ name: COMPONENT_NAME$1m,
5545
5550
  props: {
5546
5551
  value: Array,
5547
5552
  firstDayOfWeek: {
@@ -5750,9 +5755,9 @@ const DateTable = /* @__PURE__ */ vue.defineComponent({
5750
5755
 
5751
5756
  /** @jsxImportSource vue */
5752
5757
 
5753
- const COMPONENT_NAME$1k = 'vc-month-table';
5758
+ const COMPONENT_NAME$1l = 'vc-month-table';
5754
5759
  const MonthTable = /* @__PURE__ */ vue.defineComponent({
5755
- name: COMPONENT_NAME$1k,
5760
+ name: COMPONENT_NAME$1l,
5756
5761
  props: {
5757
5762
  value: Array,
5758
5763
  panelDate: Date,
@@ -5884,7 +5889,7 @@ const MonthTable = /* @__PURE__ */ vue.defineComponent({
5884
5889
 
5885
5890
  /** @jsxImportSource vue */
5886
5891
 
5887
- const COMPONENT_NAME$1j = 'vc-quarter-table';
5892
+ const COMPONENT_NAME$1k = 'vc-quarter-table';
5888
5893
 
5889
5894
  /**
5890
5895
  * 获取季度对应的月份范围
@@ -5918,7 +5923,7 @@ const getQuarterRangeByMonth = value => {
5918
5923
  }
5919
5924
  };
5920
5925
  const QuarterTable = /* @__PURE__ */ vue.defineComponent({
5921
- name: COMPONENT_NAME$1j,
5926
+ name: COMPONENT_NAME$1k,
5922
5927
  props: {
5923
5928
  value: Array,
5924
5929
  panelDate: Date,
@@ -6041,9 +6046,9 @@ const QuarterTable = /* @__PURE__ */ vue.defineComponent({
6041
6046
 
6042
6047
  /** @jsxImportSource vue */
6043
6048
 
6044
- const COMPONENT_NAME$1i = 'vc-shortcuts-select';
6049
+ const COMPONENT_NAME$1j = 'vc-shortcuts-select';
6045
6050
  const ShortcutsSelect = /* @__PURE__ */ vue.defineComponent({
6046
- name: COMPONENT_NAME$1i,
6051
+ name: COMPONENT_NAME$1j,
6047
6052
  props: {
6048
6053
  panelDate: Date,
6049
6054
  config: Array,
@@ -6083,9 +6088,9 @@ const ShortcutsSelect = /* @__PURE__ */ vue.defineComponent({
6083
6088
 
6084
6089
  /** @jsxImportSource vue */
6085
6090
 
6086
- const COMPONENT_NAME$1h = 'vc-time-select';
6091
+ const COMPONENT_NAME$1i = 'vc-time-select';
6087
6092
  const TimeSelect = /* @__PURE__ */ vue.defineComponent({
6088
- name: COMPONENT_NAME$1h,
6093
+ name: COMPONENT_NAME$1i,
6089
6094
  props: {
6090
6095
  hours: {
6091
6096
  type: [Number, String],
@@ -6364,9 +6369,9 @@ const TimeSelect = /* @__PURE__ */ vue.defineComponent({
6364
6369
 
6365
6370
  /** @jsxImportSource vue */
6366
6371
 
6367
- const COMPONENT_NAME$1g = 'vc-year-table';
6372
+ const COMPONENT_NAME$1h = 'vc-year-table';
6368
6373
  const YearTable = /* @__PURE__ */ vue.defineComponent({
6369
- name: COMPONENT_NAME$1g,
6374
+ name: COMPONENT_NAME$1h,
6370
6375
  props: {
6371
6376
  value: Array,
6372
6377
  panelDate: Date,
@@ -6489,9 +6494,9 @@ const getDateIsInRange = (value, type, leftPanelDate, rightPanelDate) => {
6489
6494
  }
6490
6495
  return true;
6491
6496
  };
6492
- const COMPONENT_NAME$1f = 'vc-date-range-panel';
6497
+ const COMPONENT_NAME$1g = 'vc-date-range-panel';
6493
6498
  const DateRangePanel = /* @__PURE__ */ vue.defineComponent({
6494
- name: COMPONENT_NAME$1f,
6499
+ name: COMPONENT_NAME$1g,
6495
6500
  props: {
6496
6501
  ...props$V,
6497
6502
  confirm: {
@@ -6870,9 +6875,9 @@ const DateRangePanel = /* @__PURE__ */ vue.defineComponent({
6870
6875
 
6871
6876
  /** @jsxImportSource vue */
6872
6877
 
6873
- const COMPONENT_NAME$1e = 'vc-date-panel';
6878
+ const COMPONENT_NAME$1f = 'vc-date-panel';
6874
6879
  const DatePanel = /* @__PURE__ */ vue.defineComponent({
6875
- name: COMPONENT_NAME$1e,
6880
+ name: COMPONENT_NAME$1f,
6876
6881
  props: {
6877
6882
  ...props$V,
6878
6883
  type: String,
@@ -7080,9 +7085,9 @@ const isEqualYear$1 = value => {
7080
7085
  const endYear = value[1].getFullYear();
7081
7086
  return startYear === endYear;
7082
7087
  };
7083
- const COMPONENT_NAME$1d = 'vc-monthrange-panel';
7088
+ const COMPONENT_NAME$1e = 'vc-monthrange-panel';
7084
7089
  const MonthRangePanel = /* @__PURE__ */ vue.defineComponent({
7085
- name: COMPONENT_NAME$1d,
7090
+ name: COMPONENT_NAME$1e,
7086
7091
  props: {
7087
7092
  ...props$V,
7088
7093
  confirm: {
@@ -7257,9 +7262,9 @@ const isEqualYear = value => {
7257
7262
  const endYear = value[1].getFullYear();
7258
7263
  return startYear === endYear;
7259
7264
  };
7260
- const COMPONENT_NAME$1c = 'vc-quarterrange-panel';
7265
+ const COMPONENT_NAME$1d = 'vc-quarterrange-panel';
7261
7266
  const QuarterRangePanel = /* @__PURE__ */ vue.defineComponent({
7262
- name: COMPONENT_NAME$1c,
7267
+ name: COMPONENT_NAME$1d,
7263
7268
  props: {
7264
7269
  ...props$V,
7265
7270
  confirm: {
@@ -7498,9 +7503,9 @@ const getComparedDate = (leftDate, rightDate) => {
7498
7503
  seconds
7499
7504
  };
7500
7505
  };
7501
- const COMPONENT_NAME$1b = 'vc-timerange-panel';
7506
+ const COMPONENT_NAME$1c = 'vc-timerange-panel';
7502
7507
  const TimeRangePanel = /* @__PURE__ */ vue.defineComponent({
7503
- name: COMPONENT_NAME$1b,
7508
+ name: COMPONENT_NAME$1c,
7504
7509
  props: props$U,
7505
7510
  emits: ['pick', 'clear', 'ok'],
7506
7511
  setup(props, {
@@ -7599,9 +7604,9 @@ const TimeRangePanel = /* @__PURE__ */ vue.defineComponent({
7599
7604
 
7600
7605
  /** @jsxImportSource vue */
7601
7606
 
7602
- const COMPONENT_NAME$1a = 'vc-time-panel';
7607
+ const COMPONENT_NAME$1b = 'vc-time-panel';
7603
7608
  const TimePanel = /* @__PURE__ */ vue.defineComponent({
7604
- name: COMPONENT_NAME$1a,
7609
+ name: COMPONENT_NAME$1b,
7605
7610
  props: props$U,
7606
7611
  emits: ['pick', 'clear', 'ok'],
7607
7612
  setup(props, {
@@ -7656,7 +7661,7 @@ const TimePanel = /* @__PURE__ */ vue.defineComponent({
7656
7661
 
7657
7662
  /** @jsxImportSource vue */
7658
7663
 
7659
- const COMPONENT_NAME$19 = 'vc-date-picker';
7664
+ const COMPONENT_NAME$1a = 'vc-date-picker';
7660
7665
  const getPanel$1 = type => {
7661
7666
  if (['daterange', 'datetimerange'].includes(type)) {
7662
7667
  return DateRangePanel;
@@ -7667,7 +7672,7 @@ const getPanel$1 = type => {
7667
7672
  }
7668
7673
  return DatePanel;
7669
7674
  };
7670
- const DatePicker = createPicker(COMPONENT_NAME$19, props$10, () => {
7675
+ const DatePicker = createPicker(COMPONENT_NAME$1a, props$10, () => {
7671
7676
  const props = vue.getCurrentInstance().props;
7672
7677
  const icon = vue.ref('date');
7673
7678
  const panel = vue.shallowRef({});
@@ -7700,9 +7705,9 @@ const props$T = {
7700
7705
 
7701
7706
  /** @jsxImportSource vue */
7702
7707
 
7703
- const COMPONENT_NAME$18 = 'vc-divider';
7708
+ const COMPONENT_NAME$19 = 'vc-divider';
7704
7709
  const Divider = /* @__PURE__ */ vue.defineComponent({
7705
- name: COMPONENT_NAME$18,
7710
+ name: COMPONENT_NAME$19,
7706
7711
  props: props$T,
7707
7712
  setup(props, {
7708
7713
  slots
@@ -7857,7 +7862,7 @@ const props$Q = {
7857
7862
 
7858
7863
  /** @jsxImportSource vue */
7859
7864
 
7860
- const COMPONENT_NAME$17 = 'vc-scroller-track';
7865
+ const COMPONENT_NAME$18 = 'vc-scroller-track';
7861
7866
  const BAR_MAP = {
7862
7867
  vertical: {
7863
7868
  scroll: 'scrollTop',
@@ -7877,7 +7882,7 @@ const BAR_MAP = {
7877
7882
  }
7878
7883
  };
7879
7884
  const Track = /* @__PURE__ */ vue.defineComponent({
7880
- name: COMPONENT_NAME$17,
7885
+ name: COMPONENT_NAME$18,
7881
7886
  props: props$S,
7882
7887
  emits: ['change'],
7883
7888
  inheritAttrs: false,
@@ -8067,9 +8072,9 @@ const Track = /* @__PURE__ */ vue.defineComponent({
8067
8072
 
8068
8073
  /** @jsxImportSource vue */
8069
8074
 
8070
- const COMPONENT_NAME$16 = 'vc-scroller-bar';
8075
+ const COMPONENT_NAME$17 = 'vc-scroller-bar';
8071
8076
  const Bar = /* @__PURE__ */ vue.defineComponent({
8072
- name: COMPONENT_NAME$16,
8077
+ name: COMPONENT_NAME$17,
8073
8078
  props: props$R,
8074
8079
  emits: ['change'],
8075
8080
  setup(props, {
@@ -8284,7 +8289,7 @@ const useScroller = (expose) => {
8284
8289
 
8285
8290
  /** @jsxImportSource vue */
8286
8291
 
8287
- const COMPONENT_NAME$15 = 'vc-scroller';
8292
+ const COMPONENT_NAME$16 = 'vc-scroller';
8288
8293
 
8289
8294
  /**
8290
8295
  * 作为备选方案,目前推荐使用ScrollerWheel
@@ -8295,7 +8300,7 @@ const COMPONENT_NAME$15 = 'vc-scroller';
8295
8300
  * 2. 增加了一层嵌套
8296
8301
  */
8297
8302
  const Scroller = /* @__PURE__ */ vue.defineComponent({
8298
- name: COMPONENT_NAME$15,
8303
+ name: COMPONENT_NAME$16,
8299
8304
  props: props$Q,
8300
8305
  emits: ['scroll'],
8301
8306
  setup(props, {
@@ -8356,7 +8361,7 @@ const Scroller = /* @__PURE__ */ vue.defineComponent({
8356
8361
 
8357
8362
  /** @jsxImportSource vue */
8358
8363
 
8359
- const COMPONENT_NAME$14 = 'vc-scroller-wheel';
8364
+ const COMPONENT_NAME$15 = 'vc-scroller-wheel';
8360
8365
 
8361
8366
  /**
8362
8367
  * 为减少一层嵌套,为去除滚动bar的抖动,使用wheel模拟
@@ -8378,7 +8383,7 @@ const COMPONENT_NAME$14 = 'vc-scroller-wheel';
8378
8383
  * 设置scrollTop不会reflow和repaint,不需要考虑transfrom来改变content(transform也只在draw完成)
8379
8384
  */
8380
8385
  const ScrollerWheel = /* @__PURE__ */ vue.defineComponent({
8381
- name: COMPONENT_NAME$14,
8386
+ name: COMPONENT_NAME$15,
8382
8387
  props: Object.assign(props$Q, {
8383
8388
  stopPropagation: {
8384
8389
  type: Boolean,
@@ -8567,9 +8572,9 @@ const props$P = {
8567
8572
 
8568
8573
  /** @jsxImportSource vue */
8569
8574
 
8570
- const COMPONENT_NAME$13 = 'vc-drawer';
8575
+ const COMPONENT_NAME$14 = 'vc-drawer';
8571
8576
  const DrawerView = /* @__PURE__ */ vue.defineComponent({
8572
- name: COMPONENT_NAME$13,
8577
+ name: COMPONENT_NAME$14,
8573
8578
  props: props$P,
8574
8579
  emits: ['close', 'update:modelValue', 'visible-change'],
8575
8580
  setup(props, {
@@ -8721,7 +8726,7 @@ const Drawer$ = new Portal(DrawerView, {
8721
8726
  multiple: true
8722
8727
  });
8723
8728
  const destroy$3 = () => Drawer$.destroy();
8724
- const open$1 = (options) => {
8729
+ const open$2 = (options) => {
8725
8730
  const leaf = Drawer$.popup({
8726
8731
  ...options,
8727
8732
  onFulfilled: options.onClose,
@@ -8731,7 +8736,7 @@ const open$1 = (options) => {
8731
8736
  leaf.wrapper.toggle?.(true);
8732
8737
  return leaf;
8733
8738
  };
8734
- const Drawer = Object.assign(DrawerView, { open: open$1, destroy: destroy$3 });
8739
+ const Drawer = Object.assign(DrawerView, { open: open$2, destroy: destroy$3 });
8735
8740
 
8736
8741
  const MDrawer = Drawer;
8737
8742
  const MDrawerView = DrawerView;
@@ -8745,9 +8750,9 @@ const props$O = {
8745
8750
 
8746
8751
  /** @jsxImportSource vue */
8747
8752
 
8748
- const COMPONENT_NAME$12 = 'vc-dropdown';
8753
+ const COMPONENT_NAME$13 = 'vc-dropdown';
8749
8754
  const Dropdown = /* @__PURE__ */ vue.defineComponent({
8750
- name: COMPONENT_NAME$12,
8755
+ name: COMPONENT_NAME$13,
8751
8756
  props: props$O,
8752
8757
  setup(props, {
8753
8758
  slots
@@ -8771,9 +8776,9 @@ const props$N = {
8771
8776
 
8772
8777
  /** @jsxImportSource vue */
8773
8778
 
8774
- const COMPONENT_NAME$11 = 'vc-editor';
8779
+ const COMPONENT_NAME$12 = 'vc-editor';
8775
8780
  const Editor = /* @__PURE__ */ vue.defineComponent({
8776
- name: COMPONENT_NAME$11,
8781
+ name: COMPONENT_NAME$12,
8777
8782
  props: props$N,
8778
8783
  setup(props, {
8779
8784
  slots
@@ -8830,7 +8835,7 @@ const useForm = (expose, options = {}) => {
8830
8835
  const instance = vue.getCurrentInstance();
8831
8836
  const props = instance.props;
8832
8837
  const fields = [];
8833
- vue.provide("form", {
8838
+ vue.provide("vc-form", {
8834
8839
  props,
8835
8840
  add: (field) => {
8836
8841
  field && fields.push(field);
@@ -8917,9 +8922,9 @@ const useForm = (expose, options = {}) => {
8917
8922
  });
8918
8923
  };
8919
8924
 
8920
- const COMPONENT_NAME$10 = "vc-form";
8925
+ const COMPONENT_NAME$11 = "vc-form";
8921
8926
  const Form = vue.defineComponent({
8922
- name: COMPONENT_NAME$10,
8927
+ name: COMPONENT_NAME$11,
8923
8928
  props: props$M,
8924
8929
  setup(props, { slots, expose }) {
8925
8930
  useForm(expose);
@@ -8978,8 +8983,7 @@ const props$L = {
8978
8983
  default: false
8979
8984
  },
8980
8985
  labelPosition: {
8981
- type: String,
8982
- default: "right"
8986
+ type: String
8983
8987
  },
8984
8988
  contentStyle: [Object, String],
8985
8989
  contentClass: [Object, String],
@@ -8997,7 +9001,7 @@ const toRules = (rules) => {
8997
9001
  return rules instanceof Array ? rules : rules ? [rules] : [];
8998
9002
  };
8999
9003
  const useFormItem = (expose) => {
9000
- const form = vue.inject("form");
9004
+ const form = vue.inject("vc-form");
9001
9005
  const instance = vue.getCurrentInstance();
9002
9006
  const props = instance.props;
9003
9007
  const { slots } = instance;
@@ -9245,9 +9249,9 @@ const useFormItem = (expose) => {
9245
9249
 
9246
9250
  /** @jsxImportSource vue */
9247
9251
 
9248
- const COMPONENT_NAME$$ = 'vc-form-item';
9252
+ const COMPONENT_NAME$10 = 'vc-form-item';
9249
9253
  const FormItem = /* @__PURE__ */ vue.defineComponent({
9250
- name: COMPONENT_NAME$$,
9254
+ name: COMPONENT_NAME$10,
9251
9255
  props: props$L,
9252
9256
  setup(props, {
9253
9257
  slots,
@@ -9312,9 +9316,9 @@ const props$K = {
9312
9316
  }
9313
9317
  };
9314
9318
 
9315
- const COMPONENT_NAME$_ = "vcm-form";
9319
+ const COMPONENT_NAME$$ = "vcm-form";
9316
9320
  const MForm = vue.defineComponent({
9317
- name: COMPONENT_NAME$_,
9321
+ name: COMPONENT_NAME$$,
9318
9322
  props: props$K,
9319
9323
  setup(props, { slots, expose }) {
9320
9324
  useForm(expose, {
@@ -9345,9 +9349,9 @@ const props$J = {
9345
9349
 
9346
9350
  /** @jsxImportSource vue */
9347
9351
 
9348
- const COMPONENT_NAME$Z = 'vcm-form-item';
9352
+ const COMPONENT_NAME$_ = 'vcm-form-item';
9349
9353
  const MFormItem = /* @__PURE__ */ vue.defineComponent({
9350
- name: COMPONENT_NAME$Z,
9354
+ name: COMPONENT_NAME$_,
9351
9355
  props: props$J,
9352
9356
  setup(props, {
9353
9357
  slots,
@@ -9401,9 +9405,9 @@ const MFormItem = /* @__PURE__ */ vue.defineComponent({
9401
9405
  }
9402
9406
  });
9403
9407
 
9404
- const COMPONENT_NAME$Y = "vc-fragment";
9408
+ const COMPONENT_NAME$Z = "vc-fragment";
9405
9409
  const Fragment = vue.defineComponent({
9406
- name: COMPONENT_NAME$Y,
9410
+ name: COMPONENT_NAME$Z,
9407
9411
  setup(_, { slots }) {
9408
9412
  return () => vue.h(vue.Fragment, slots.default?.());
9409
9413
  }
@@ -9420,9 +9424,9 @@ const props$I = {
9420
9424
 
9421
9425
  /** @jsxImportSource vue */
9422
9426
 
9423
- const COMPONENT_NAME$X = 'vc-html-to-image';
9427
+ const COMPONENT_NAME$Y = 'vc-html-to-image';
9424
9428
  const HTMLToImage = /* @__PURE__ */ vue.defineComponent({
9425
- name: COMPONENT_NAME$X,
9429
+ name: COMPONENT_NAME$Y,
9426
9430
  props: props$I,
9427
9431
  setup(props, {
9428
9432
  slots
@@ -9440,10 +9444,113 @@ const MHTMLToImage = HTMLToImage;
9440
9444
  const MIcon = Icon;
9441
9445
 
9442
9446
  const props$H = {
9447
+ tag: {
9448
+ type: String,
9449
+ default: "div"
9450
+ }
9451
+ };
9452
+
9453
+ /** @jsxImportSource vue */
9454
+
9455
+ const COMPONENT_NAME$X = 'vc-image-preview';
9456
+ const ImagePreview$1 = /* @__PURE__ */ vue.defineComponent({
9457
+ name: COMPONENT_NAME$X,
9458
+ props: props$H,
9459
+ setup(props, {
9460
+ slots
9461
+ }) {
9462
+ return () => {
9463
+ return vue.createVNode("div", {
9464
+ "class": "vc-image-preview"
9465
+ }, [slots?.default?.()]);
9466
+ };
9467
+ }
9468
+ });
9469
+
9470
+ const MAX_WIDTH = window.innerWidth;
9471
+ const MAX_HEIGHT = window.innerHeight;
9472
+ const getFitSize = (src) => {
9473
+ return new Promise((resolve) => {
9474
+ const img = new Image();
9475
+ let width;
9476
+ let height;
9477
+ img.onload = () => {
9478
+ const owidth = img.naturalWidth || img.width;
9479
+ const oheight = img.naturalHeight || img.height;
9480
+ if (owidth > oheight) {
9481
+ width = Math.min(MAX_WIDTH, owidth);
9482
+ height = width / owidth * oheight;
9483
+ resolve({
9484
+ width,
9485
+ height
9486
+ });
9487
+ } else {
9488
+ height = Math.min(MAX_HEIGHT, oheight);
9489
+ width = height / oheight * owidth;
9490
+ resolve({
9491
+ width,
9492
+ height
9493
+ });
9494
+ }
9495
+ };
9496
+ img.onerror = () => resolve({});
9497
+ img.src = src;
9498
+ });
9499
+ };
9500
+ const open$1 = async (options) => {
9501
+ const e = VcInstance.globalEvent;
9502
+ const data = options.data.map((i) => {
9503
+ if (typeof i === "string") {
9504
+ return {
9505
+ src: i
9506
+ };
9507
+ }
9508
+ return {
9509
+ ...i,
9510
+ src: i.source || i.src
9511
+ };
9512
+ });
9513
+ for (let i = 0; i < data.length; i++) {
9514
+ if (!data[i].width) {
9515
+ data[i] = {
9516
+ ...data[i],
9517
+ ...await getFitSize(data[i].src)
9518
+ };
9519
+ }
9520
+ }
9521
+ const lightbox = new PhotoSwipeLightbox({
9522
+ pswpModule: () => import('photoswipe'),
9523
+ closeTitle: "关闭(Esc)",
9524
+ zoomTitle: "缩放",
9525
+ arrowPrevTitle: "上一张",
9526
+ arrowNextTitle: "下一张",
9527
+ errorMsg: "网络异常 图片加载失败",
9528
+ indexIndicatorSep: " / ",
9529
+ initialZoomLevel: "fit"
9530
+ });
9531
+ lightbox.init();
9532
+ lightbox.loadAndOpen(
9533
+ options.current || 0,
9534
+ data,
9535
+ // 下面无效,需要给官方支持
9536
+ {
9537
+ x: e?.clientX,
9538
+ y: e?.clientY
9539
+ }
9540
+ );
9541
+ };
9542
+
9543
+ const ImagePreview = Object.assign(ImagePreview$1, { open: open$1 });
9544
+
9545
+ const props$G = {
9443
9546
  src: String,
9444
9547
  fit: String,
9445
9548
  lazy: Boolean,
9446
- wrapper: [Object, String]
9549
+ wrapper: [Object, String],
9550
+ previewable: {
9551
+ type: Boolean,
9552
+ default: true
9553
+ }
9447
9554
  };
9448
9555
 
9449
9556
  class IMGStore {
@@ -9510,10 +9617,10 @@ const ObjectFit = {
9510
9617
  FILL: 'fill',
9511
9618
  SCALE_DOWN: 'scale-down'
9512
9619
  };
9513
- const Image = /* @__PURE__ */ vue.defineComponent({
9620
+ const Image$1 = /* @__PURE__ */ vue.defineComponent({
9514
9621
  name: COMPONENT_NAME$W,
9515
9622
  inheritAttrs: false,
9516
- props: props$H,
9623
+ props: props$G,
9517
9624
  setup(props, {
9518
9625
  slots,
9519
9626
  emit
@@ -9662,6 +9769,14 @@ const Image = /* @__PURE__ */ vue.defineComponent({
9662
9769
  const alignCenter = vue.computed(() => {
9663
9770
  return !isSupportObjectFit && props.fit !== ObjectFit.FILL;
9664
9771
  });
9772
+ const handlePreview = () => {
9773
+ if (!props.previewable) return;
9774
+ ImagePreview.open({
9775
+ current: 0,
9776
+ data: [props.src],
9777
+ onClose() {}
9778
+ });
9779
+ };
9665
9780
  vue.watch(() => props.src, v => {
9666
9781
  if (!v && !isLoading.value) {
9667
9782
  isLoading.value = true;
@@ -9682,7 +9797,9 @@ const Image = /* @__PURE__ */ vue.defineComponent({
9682
9797
  return () => {
9683
9798
  return vue.createVNode("div", {
9684
9799
  "style": its.value.style,
9685
- "class": [its.value.class, 'vc-image']
9800
+ "class": [its.value.class, {
9801
+ 'is-allow-preview': props.previewable
9802
+ }, 'vc-image']
9686
9803
  }, [isLoading.value && (slots.placeholder ? slots.placeholder() : vue.createVNode("div", {
9687
9804
  "class": [{
9688
9805
  'is-auto': isAuto.value
@@ -9700,14 +9817,16 @@ const Image = /* @__PURE__ */ vue.defineComponent({
9700
9817
  // 包含所有on*都会被绑定, 且listeners中覆盖将由listener内触发(inheritAttrs: false)
9701
9818
  ...its.value.attrs,
9702
9819
  ...its.value.listeners
9820
+ }, {
9821
+ "onClick": handlePreview
9703
9822
  }), null)]);
9704
9823
  };
9705
9824
  }
9706
9825
  });
9707
9826
 
9708
- const MImage = Image;
9827
+ const MImage = Image$1;
9709
9828
 
9710
- const props$G = {
9829
+ const props$F = {
9711
9830
  tag: {
9712
9831
  type: String,
9713
9832
  default: "div"
@@ -9719,7 +9838,7 @@ const props$G = {
9719
9838
  const COMPONENT_NAME$V = 'vc-image-crop';
9720
9839
  const ImageCrop = /* @__PURE__ */ vue.defineComponent({
9721
9840
  name: COMPONENT_NAME$V,
9722
- props: props$G,
9841
+ props: props$F,
9723
9842
  setup(props, {
9724
9843
  slots
9725
9844
  }) {
@@ -9733,30 +9852,6 @@ const ImageCrop = /* @__PURE__ */ vue.defineComponent({
9733
9852
 
9734
9853
  const MImageCrop = ImageCrop;
9735
9854
 
9736
- const props$F = {
9737
- tag: {
9738
- type: String,
9739
- default: "div"
9740
- }
9741
- };
9742
-
9743
- /** @jsxImportSource vue */
9744
-
9745
- const COMPONENT_NAME$U = 'vc-image-preview';
9746
- const ImagePreview = /* @__PURE__ */ vue.defineComponent({
9747
- name: COMPONENT_NAME$U,
9748
- props: props$F,
9749
- setup(props, {
9750
- slots
9751
- }) {
9752
- return () => {
9753
- return vue.createVNode("div", {
9754
- "class": "vc-image-preview"
9755
- }, [slots?.default?.()]);
9756
- };
9757
- }
9758
- });
9759
-
9760
9855
  const MImagePreview = ImagePreview;
9761
9856
 
9762
9857
  const props$E = {
@@ -9768,9 +9863,9 @@ const props$E = {
9768
9863
 
9769
9864
  /** @jsxImportSource vue */
9770
9865
 
9771
- const COMPONENT_NAME$T = 'vc-image-processing';
9866
+ const COMPONENT_NAME$U = 'vc-image-processing';
9772
9867
  const ImageProcessing = /* @__PURE__ */ vue.defineComponent({
9773
- name: COMPONENT_NAME$T,
9868
+ name: COMPONENT_NAME$U,
9774
9869
  props: props$E,
9775
9870
  setup(props, {
9776
9871
  slots
@@ -9787,9 +9882,9 @@ const MImageProcessing = ImageProcessing;
9787
9882
 
9788
9883
  /** @jsxImportSource vue */
9789
9884
 
9790
- const COMPONENT_NAME$S = 'vcm-input';
9885
+ const COMPONENT_NAME$T = 'vcm-input';
9791
9886
  const MInput = /* @__PURE__ */ vue.defineComponent({
9792
- name: COMPONENT_NAME$S,
9887
+ name: COMPONENT_NAME$T,
9793
9888
  inheritAttrs: false,
9794
9889
  props: {
9795
9890
  ...props$$,
@@ -9878,9 +9973,9 @@ const MInput = /* @__PURE__ */ vue.defineComponent({
9878
9973
 
9879
9974
  /** @jsxImportSource vue */
9880
9975
 
9881
- const COMPONENT_NAME$R = 'vcm-input-number';
9976
+ const COMPONENT_NAME$S = 'vcm-input-number';
9882
9977
  const MInputNumber = /* @__PURE__ */ vue.defineComponent({
9883
- name: COMPONENT_NAME$R,
9978
+ name: COMPONENT_NAME$S,
9884
9979
  props: props$X,
9885
9980
  inheritAttrs: false,
9886
9981
  setup(props, {
@@ -9929,9 +10024,9 @@ const MInputNumber = /* @__PURE__ */ vue.defineComponent({
9929
10024
 
9930
10025
  /** @jsxImportSource vue */
9931
10026
 
9932
- const COMPONENT_NAME$Q = 'vcm-input-search';
10027
+ const COMPONENT_NAME$R = 'vcm-input-search';
9933
10028
  const MInputSearch = /* @__PURE__ */ vue.defineComponent({
9934
- name: COMPONENT_NAME$Q,
10029
+ name: COMPONENT_NAME$R,
9935
10030
  props: {
9936
10031
  ...props$W,
9937
10032
  cancelText: {
@@ -10008,9 +10103,9 @@ const props$D = {
10008
10103
  }
10009
10104
  };
10010
10105
 
10011
- const COMPONENT_NAME$P = "vcm-list";
10106
+ const COMPONENT_NAME$Q = "vcm-list";
10012
10107
  const MList = vue.defineComponent({
10013
- name: COMPONENT_NAME$P,
10108
+ name: COMPONENT_NAME$Q,
10014
10109
  props: props$D,
10015
10110
  setup(props, { slots }) {
10016
10111
  vue.provide("vc-list", { props });
@@ -10065,10 +10160,10 @@ const props$C = {
10065
10160
 
10066
10161
  /** @jsxImportSource vue */
10067
10162
 
10068
- const COMPONENT_NAME$O = 'vcm-list-item';
10163
+ const COMPONENT_NAME$P = 'vcm-list-item';
10069
10164
  const HTTP_REGEX = /[a-zA-z]+:\/\/[^\s]*/;
10070
10165
  const MListItem = /* @__PURE__ */ vue.defineComponent({
10071
- name: COMPONENT_NAME$O,
10166
+ name: COMPONENT_NAME$P,
10072
10167
  props: props$C,
10073
10168
  emits: ['click'],
10074
10169
  setup(props, {
@@ -10162,11 +10257,11 @@ const props$B = {
10162
10257
 
10163
10258
  /** @jsxImportSource vue */
10164
10259
 
10165
- const COMPONENT_NAME$N = 'vc-marquee';
10260
+ const COMPONENT_NAME$O = 'vc-marquee';
10166
10261
  const ANIMATION = $.prefixStyle('animation').camel;
10167
10262
  const TRANSFORM_KEBAB = $.prefixStyle('transform').kebab;
10168
10263
  const Marquee = /* @__PURE__ */ vue.defineComponent({
10169
- name: COMPONENT_NAME$N,
10264
+ name: COMPONENT_NAME$O,
10170
10265
  props: props$B,
10171
10266
  setup(props, {
10172
10267
  slots
@@ -10234,9 +10329,9 @@ const props$A = {
10234
10329
  }
10235
10330
  };
10236
10331
 
10237
- const COMPONENT_NAME$M = "vc-resizer";
10332
+ const COMPONENT_NAME$N = "vc-resizer";
10238
10333
  const Resizer = vue.defineComponent({
10239
- name: COMPONENT_NAME$M,
10334
+ name: COMPONENT_NAME$N,
10240
10335
  props: props$A,
10241
10336
  emit: ["resize", "change"],
10242
10337
  setup(props, { emit, slots, expose }) {
@@ -10363,9 +10458,8 @@ const props$z = {
10363
10458
  type: [String, Boolean],
10364
10459
  default: "取消"
10365
10460
  },
10366
- wrapperStyle: {
10367
- type: [String, Object]
10368
- },
10461
+ wrapperStyle: [String, Object],
10462
+ wrapperClass: [String, Object],
10369
10463
  footer: {
10370
10464
  type: Boolean,
10371
10465
  default: true
@@ -10395,10 +10489,10 @@ const props$z = {
10395
10489
 
10396
10490
  /** @jsxImportSource vue */
10397
10491
 
10398
- const COMPONENT_NAME$L = 'vc-modal';
10492
+ const COMPONENT_NAME$M = 'vc-modal';
10399
10493
  let zIndexNumber = 1002;
10400
10494
  const ModalView = /* @__PURE__ */ vue.defineComponent({
10401
- name: COMPONENT_NAME$L,
10495
+ name: COMPONENT_NAME$M,
10402
10496
  emits: ['update:modelValue', 'close', 'portal-fulfilled', 'visible-change', 'ok', 'cancel'],
10403
10497
  props: props$z,
10404
10498
  setup(props, {
@@ -10419,6 +10513,7 @@ const ModalView = /* @__PURE__ */ vue.defineComponent({
10419
10513
 
10420
10514
  // 注: 服务端渲染为0, 在客服端激活前,展示端存在问题【高度不定】
10421
10515
  const MAX_HEIGHT = vcShared.IS_SERVER ? 0 : window.innerHeight - 20;
10516
+ const MAX_WIDTH = vcShared.IS_SERVER ? 0 : window.innerWidth - 20;
10422
10517
  const defaultSize = vue.computed(() => {
10423
10518
  let width = 0;
10424
10519
  let height = 0;
@@ -10437,7 +10532,7 @@ const ModalView = /* @__PURE__ */ vue.defineComponent({
10437
10532
  break;
10438
10533
  }
10439
10534
  return {
10440
- width: props.width || width,
10535
+ width: Math.min(props.width || width, MAX_WIDTH),
10441
10536
  height: Math.min(props.height || height, MAX_HEIGHT)
10442
10537
  };
10443
10538
  });
@@ -10673,7 +10768,7 @@ const ModalView = /* @__PURE__ */ vue.defineComponent({
10673
10768
  "style": [props.wrapperStyle || {}, props.draggable ? {
10674
10769
  top: 0
10675
10770
  } : {}],
10676
- "class": "vc-modal__wrapper",
10771
+ "class": [props.wrapperClass, 'vc-modal__wrapper'],
10677
10772
  "onClick": e => handleClose(e, false)
10678
10773
  }, [vue.createVNode(TransitionScale, {
10679
10774
  "mode": "part",
@@ -10836,9 +10931,9 @@ const props$y = {
10836
10931
 
10837
10932
  /** @jsxImportSource vue */
10838
10933
 
10839
- const COMPONENT_NAME$K = 'vc-modal';
10934
+ const COMPONENT_NAME$L = 'vc-modal';
10840
10935
  const MModalView = /* @__PURE__ */ vue.defineComponent({
10841
- name: COMPONENT_NAME$K,
10936
+ name: COMPONENT_NAME$L,
10842
10937
  emits: ['update:modelValue', 'portal-fulfilled', 'close', 'ok', 'cancel'],
10843
10938
  props: props$y,
10844
10939
  setup(props, {
@@ -11050,9 +11145,9 @@ const props$x = {
11050
11145
 
11051
11146
  /** @jsxImportSource vue */
11052
11147
 
11053
- const COMPONENT_NAME$J = 'vc-notice';
11148
+ const COMPONENT_NAME$K = 'vc-notice';
11054
11149
  const NoticeView = /* @__PURE__ */ vue.defineComponent({
11055
- name: COMPONENT_NAME$J,
11150
+ name: COMPONENT_NAME$K,
11056
11151
  props: props$x,
11057
11152
  emits: ['portal-fulfilled', 'close', 'before-close'],
11058
11153
  setup(props, {
@@ -11225,9 +11320,9 @@ const props$w = {
11225
11320
 
11226
11321
  /** @jsxImportSource vue */
11227
11322
 
11228
- const COMPONENT_NAME$I = 'vc-option';
11323
+ const COMPONENT_NAME$J = 'vc-option';
11229
11324
  const Option$1 = /* @__PURE__ */ vue.defineComponent({
11230
- name: COMPONENT_NAME$I,
11325
+ name: COMPONENT_NAME$J,
11231
11326
  props: props$w,
11232
11327
  setup(props, {
11233
11328
  slots
@@ -11340,9 +11435,9 @@ const props$u = {
11340
11435
 
11341
11436
  /** @jsxImportSource vue */
11342
11437
 
11343
- const COMPONENT_NAME$H = 'vc-tag';
11438
+ const COMPONENT_NAME$I = 'vc-tag';
11344
11439
  const Tag = /* @__PURE__ */ vue.defineComponent({
11345
- name: COMPONENT_NAME$H,
11440
+ name: COMPONENT_NAME$I,
11346
11441
  props: props$u,
11347
11442
  emits: ['close', 'change'],
11348
11443
  setup(props, {
@@ -11411,9 +11506,9 @@ const props$t = {
11411
11506
 
11412
11507
  /** @jsxImportSource vue */
11413
11508
 
11414
- const COMPONENT_NAME$G = 'vc-select-option';
11509
+ const COMPONENT_NAME$H = 'vc-select-option';
11415
11510
  const Option = /* @__PURE__ */ vue.defineComponent({
11416
- name: COMPONENT_NAME$G,
11511
+ name: COMPONENT_NAME$H,
11417
11512
  props: props$t,
11418
11513
  setup(props, {
11419
11514
  slots
@@ -11486,9 +11581,9 @@ const props$s = {
11486
11581
 
11487
11582
  /** @jsxImportSource vue */
11488
11583
 
11489
- const COMPONENT_NAME$F = 'vc-select-option-group';
11584
+ const COMPONENT_NAME$G = 'vc-select-option-group';
11490
11585
  const OptionGroup = /* @__PURE__ */ vue.defineComponent({
11491
- name: COMPONENT_NAME$F,
11586
+ name: COMPONENT_NAME$G,
11492
11587
  props: props$s,
11493
11588
  setup(props, {
11494
11589
  slots
@@ -11586,9 +11681,9 @@ const props$r = {
11586
11681
  function _isSlot$1(s) {
11587
11682
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
11588
11683
  }
11589
- const COMPONENT_NAME$E = 'vc-select';
11684
+ const COMPONENT_NAME$F = 'vc-select';
11590
11685
  const Select = /* @__PURE__ */ vue.defineComponent({
11591
- name: COMPONENT_NAME$E,
11686
+ name: COMPONENT_NAME$F,
11592
11687
  props: props$r,
11593
11688
  emits: ['ready', 'close', 'visible-change', 'clear', 'change', 'update:modelValue'],
11594
11689
  setup(props, {
@@ -11835,9 +11930,9 @@ const Select = /* @__PURE__ */ vue.defineComponent({
11835
11930
 
11836
11931
  /** @jsxImportSource vue */
11837
11932
 
11838
- const COMPONENT_NAME$D = 'vc-pagination';
11933
+ const COMPONENT_NAME$E = 'vc-pagination';
11839
11934
  const Pagination = /* @__PURE__ */ vue.defineComponent({
11840
- name: COMPONENT_NAME$D,
11935
+ name: COMPONENT_NAME$E,
11841
11936
  props: props$v,
11842
11937
  emits: ['update:current', 'change', 'page-size-change'],
11843
11938
  setup(props, {
@@ -12035,9 +12130,9 @@ const props$q = {
12035
12130
 
12036
12131
  /** @jsxImportSource vue */
12037
12132
 
12038
- const COMPONENT_NAME$C = 'vc-picker';
12133
+ const COMPONENT_NAME$D = 'vc-picker';
12039
12134
  const Picker = /* @__PURE__ */ vue.defineComponent({
12040
- name: COMPONENT_NAME$C,
12135
+ name: COMPONENT_NAME$D,
12041
12136
  props: props$q,
12042
12137
  setup(props, {
12043
12138
  slots
@@ -12061,9 +12156,9 @@ const props$p = {
12061
12156
 
12062
12157
  /** @jsxImportSource vue */
12063
12158
 
12064
- const COMPONENT_NAME$B = 'vc-popconfirm';
12159
+ const COMPONENT_NAME$C = 'vc-popconfirm';
12065
12160
  const Popconfirm = /* @__PURE__ */ vue.defineComponent({
12066
- name: COMPONENT_NAME$B,
12161
+ name: COMPONENT_NAME$C,
12067
12162
  props: props$p,
12068
12163
  setup(props, {
12069
12164
  slots
@@ -12089,9 +12184,9 @@ const props$o = {
12089
12184
 
12090
12185
  /** @jsxImportSource vue */
12091
12186
 
12092
- const COMPONENT_NAME$A = 'vc-popup';
12187
+ const COMPONENT_NAME$B = 'vc-popup';
12093
12188
  const Popup = /* @__PURE__ */ vue.defineComponent({
12094
- name: COMPONENT_NAME$A,
12189
+ name: COMPONENT_NAME$B,
12095
12190
  props: props$o,
12096
12191
  setup(props, {
12097
12192
  slots
@@ -12118,9 +12213,9 @@ const props$n = {
12118
12213
 
12119
12214
  /** @jsxImportSource vue */
12120
12215
 
12121
- const COMPONENT_NAME$z = 'vc-print';
12216
+ const COMPONENT_NAME$A = 'vc-print';
12122
12217
  const Print = /* @__PURE__ */ vue.defineComponent({
12123
- name: COMPONENT_NAME$z,
12218
+ name: COMPONENT_NAME$A,
12124
12219
  props: props$n,
12125
12220
  setup(props, {
12126
12221
  expose,
@@ -12222,9 +12317,9 @@ const props$m = {
12222
12317
 
12223
12318
  /** @jsxImportSource vue */
12224
12319
 
12225
- const COMPONENT_NAME$y = 'vc-progress-circle';
12320
+ const COMPONENT_NAME$z = 'vc-progress-circle';
12226
12321
  const Circle = /* @__PURE__ */ vue.defineComponent({
12227
- name: COMPONENT_NAME$y,
12322
+ name: COMPONENT_NAME$z,
12228
12323
  props: props$m,
12229
12324
  setup(props, {
12230
12325
  slots
@@ -12284,9 +12379,9 @@ const Circle = /* @__PURE__ */ vue.defineComponent({
12284
12379
 
12285
12380
  /** @jsxImportSource vue */
12286
12381
 
12287
- const COMPONENT_NAME$x = 'vc-progress-line';
12382
+ const COMPONENT_NAME$y = 'vc-progress-line';
12288
12383
  const Line = /* @__PURE__ */ vue.defineComponent({
12289
- name: COMPONENT_NAME$x,
12384
+ name: COMPONENT_NAME$y,
12290
12385
  props: props$m,
12291
12386
  setup(props) {
12292
12387
  const colorStyle = vue.computed(() => {
@@ -12333,15 +12428,19 @@ const Line = /* @__PURE__ */ vue.defineComponent({
12333
12428
  function _isSlot(s) {
12334
12429
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
12335
12430
  }
12336
- const COMPONENT_NAME$w = 'vc-progress';
12431
+ const COMPONENT_NAME$x = 'vc-progress';
12337
12432
  const Progress = /* @__PURE__ */ vue.defineComponent({
12338
- name: COMPONENT_NAME$w,
12433
+ name: COMPONENT_NAME$x,
12339
12434
  props: props$m,
12340
12435
  setup(props, {
12341
12436
  slots
12342
12437
  }) {
12438
+ const currentPercent = vue.computed(() => {
12439
+ const v = Number(props.percent);
12440
+ return v >= 100 ? 100 : v;
12441
+ });
12343
12442
  const currentStatus = vue.computed(() => {
12344
- if (Number(props.percent) >= 100) {
12443
+ if (currentPercent.value === 100) {
12345
12444
  return 'success';
12346
12445
  }
12347
12446
  return props.status;
@@ -12353,6 +12452,7 @@ const Progress = /* @__PURE__ */ vue.defineComponent({
12353
12452
  const binds = vue.computed(() => {
12354
12453
  return {
12355
12454
  ...props,
12455
+ percent: currentPercent.value,
12356
12456
  status: currentStatus.value,
12357
12457
  color: currentColor.value
12358
12458
  };
@@ -12430,7 +12530,8 @@ const useRadio = () => {
12430
12530
  return {
12431
12531
  "is-checked": checked.value,
12432
12532
  "is-disabled": isDisabled.value,
12433
- "is-focus": isFocus.value
12533
+ "is-focus": isFocus.value,
12534
+ "is-error": !!formItem?.message?.value
12434
12535
  };
12435
12536
  });
12436
12537
  vue.watch(
@@ -12487,9 +12588,9 @@ const useRadio = () => {
12487
12588
 
12488
12589
  /** @jsxImportSource vue */
12489
12590
 
12490
- const COMPONENT_NAME$v = 'vc-radio';
12591
+ const COMPONENT_NAME$w = 'vc-radio';
12491
12592
  const Radio = /* @__PURE__ */ vue.defineComponent({
12492
- name: COMPONENT_NAME$v,
12593
+ name: COMPONENT_NAME$w,
12493
12594
  props: props$l,
12494
12595
  emits: ['update:modelValue', 'change'],
12495
12596
  setup(props, {
@@ -12600,9 +12701,9 @@ const useRadioGroup = () => {
12600
12701
 
12601
12702
  /** @jsxImportSource vue */
12602
12703
 
12603
- const COMPONENT_NAME$u = 'vc-radio-group';
12704
+ const COMPONENT_NAME$v = 'vc-radio-group';
12604
12705
  const RadioGroup = /* @__PURE__ */ vue.defineComponent({
12605
- name: COMPONENT_NAME$u,
12706
+ name: COMPONENT_NAME$v,
12606
12707
  props: props$k,
12607
12708
  emits: ['update:modelValue', 'change'],
12608
12709
  setup(props, {
@@ -12614,8 +12715,7 @@ const RadioGroup = /* @__PURE__ */ vue.defineComponent({
12614
12715
  return () => {
12615
12716
  if (props.fragment) return slots.default?.();
12616
12717
  return vue.createVNode("div", {
12617
- "class": "vc-radio-group",
12618
- "style": classes.value,
12718
+ "class": [classes.value, 'vc-radio-group'],
12619
12719
  "name": props.name
12620
12720
  }, [slots?.default?.()]);
12621
12721
  };
@@ -12624,9 +12724,9 @@ const RadioGroup = /* @__PURE__ */ vue.defineComponent({
12624
12724
 
12625
12725
  /** @jsxImportSource vue */
12626
12726
 
12627
- const COMPONENT_NAME$t = 'vcm-radio';
12727
+ const COMPONENT_NAME$u = 'vcm-radio';
12628
12728
  const MRadio = /* @__PURE__ */ vue.defineComponent({
12629
- name: COMPONENT_NAME$t,
12729
+ name: COMPONENT_NAME$u,
12630
12730
  props: props$l,
12631
12731
  emits: ['update:modelValue', 'change'],
12632
12732
  setup(props, {
@@ -12667,9 +12767,9 @@ const MRadio = /* @__PURE__ */ vue.defineComponent({
12667
12767
 
12668
12768
  /** @jsxImportSource vue */
12669
12769
 
12670
- const COMPONENT_NAME$s = 'vcm-radio-group';
12770
+ const COMPONENT_NAME$t = 'vcm-radio-group';
12671
12771
  const MRadioGroup = /* @__PURE__ */ vue.defineComponent({
12672
- name: COMPONENT_NAME$s,
12772
+ name: COMPONENT_NAME$t,
12673
12773
  props: props$k,
12674
12774
  emits: ['update:modelValue', 'change'],
12675
12775
  setup(props, {
@@ -12698,9 +12798,9 @@ const props$j = {
12698
12798
 
12699
12799
  /** @jsxImportSource vue */
12700
12800
 
12701
- const COMPONENT_NAME$r = 'vc-rate';
12801
+ const COMPONENT_NAME$s = 'vc-rate';
12702
12802
  const Rate = /* @__PURE__ */ vue.defineComponent({
12703
- name: COMPONENT_NAME$r,
12803
+ name: COMPONENT_NAME$s,
12704
12804
  props: props$j,
12705
12805
  setup(props, {
12706
12806
  slots
@@ -12768,9 +12868,9 @@ const props$i = {
12768
12868
 
12769
12869
  /** @jsxImportSource vue */
12770
12870
 
12771
- const COMPONENT_NAME$q = 'vc-recycle-list-scroll-state';
12871
+ const COMPONENT_NAME$r = 'vc-recycle-list-scroll-state';
12772
12872
  const ScrollState = /* @__PURE__ */ vue.defineComponent({
12773
- name: COMPONENT_NAME$q,
12873
+ name: COMPONENT_NAME$r,
12774
12874
  setup(_, {
12775
12875
  slots
12776
12876
  }) {
@@ -12900,12 +13000,12 @@ const useDirectionKeys = () => {
12900
13000
 
12901
13001
  /** @jsxImportSource vue */
12902
13002
 
12903
- const COMPONENT_NAME$p = 'vc-recycle-list-container';
13003
+ const COMPONENT_NAME$q = 'vc-recycle-list-container';
12904
13004
 
12905
13005
  // TODO: 抽离
12906
13006
  const transformKey = $__namespace.prefixStyle('transform').camel;
12907
13007
  const Container = /* @__PURE__ */ vue.defineComponent({
12908
- name: COMPONENT_NAME$p,
13008
+ name: COMPONENT_NAME$q,
12909
13009
  props: props$h,
12910
13010
  emits: ['refresh'],
12911
13011
  setup(props, {
@@ -13003,9 +13103,9 @@ const Container = /* @__PURE__ */ vue.defineComponent({
13003
13103
 
13004
13104
  /** @jsxImportSource vue */
13005
13105
 
13006
- const COMPONENT_NAME$o = 'vc-recycle-list';
13106
+ const COMPONENT_NAME$p = 'vc-recycle-list';
13007
13107
  const RecycleList = /* @__PURE__ */ vue.defineComponent({
13008
- name: COMPONENT_NAME$o,
13108
+ name: COMPONENT_NAME$p,
13009
13109
  props: props$i,
13010
13110
  emits: ['scroll', 'row-resize'],
13011
13111
  setup(props, {
@@ -13577,9 +13677,9 @@ const props$g = {
13577
13677
 
13578
13678
  /** @jsxImportSource vue */
13579
13679
 
13580
- const COMPONENT_NAME$n = 'vc-slider';
13680
+ const COMPONENT_NAME$o = 'vc-slider';
13581
13681
  const Slider = /* @__PURE__ */ vue.defineComponent({
13582
- name: COMPONENT_NAME$n,
13682
+ name: COMPONENT_NAME$o,
13583
13683
  props: props$g,
13584
13684
  setup(props, {
13585
13685
  slots
@@ -13603,9 +13703,9 @@ const props$f = {
13603
13703
 
13604
13704
  /** @jsxImportSource vue */
13605
13705
 
13606
- const COMPONENT_NAME$m = 'vc-sort-list';
13706
+ const COMPONENT_NAME$n = 'vc-sort-list';
13607
13707
  const SortList = /* @__PURE__ */ vue.defineComponent({
13608
- name: COMPONENT_NAME$m,
13708
+ name: COMPONENT_NAME$n,
13609
13709
  props: props$f,
13610
13710
  setup(props, {
13611
13711
  slots
@@ -13629,9 +13729,9 @@ const props$e = {
13629
13729
 
13630
13730
  /** @jsxImportSource vue */
13631
13731
 
13632
- const COMPONENT_NAME$l = 'vc-steps';
13732
+ const COMPONENT_NAME$m = 'vc-steps';
13633
13733
  const Steps = /* @__PURE__ */ vue.defineComponent({
13634
- name: COMPONENT_NAME$l,
13734
+ name: COMPONENT_NAME$m,
13635
13735
  props: props$e,
13636
13736
  setup(props, {
13637
13737
  slots
@@ -13744,9 +13844,9 @@ const useSwitch = (expose) => {
13744
13844
 
13745
13845
  /** @jsxImportSource vue */
13746
13846
 
13747
- const COMPONENT_NAME$k = 'vc-switch';
13847
+ const COMPONENT_NAME$l = 'vc-switch';
13748
13848
  const Switch = /* @__PURE__ */ vue.defineComponent({
13749
- name: COMPONENT_NAME$k,
13849
+ name: COMPONENT_NAME$l,
13750
13850
  props: props$d,
13751
13851
  // click -> onClick要被拦截,此处不能放置
13752
13852
  emits: ['update:modelValue', 'change', 'click'],
@@ -13783,9 +13883,9 @@ const Switch = /* @__PURE__ */ vue.defineComponent({
13783
13883
 
13784
13884
  /** @jsxImportSource vue */
13785
13885
 
13786
- const COMPONENT_NAME$j = 'vcm-switch';
13886
+ const COMPONENT_NAME$k = 'vcm-switch';
13787
13887
  const MSwitch = /* @__PURE__ */ vue.defineComponent({
13788
- name: COMPONENT_NAME$j,
13888
+ name: COMPONENT_NAME$k,
13789
13889
  props: props$d,
13790
13890
  // click -> onClick要被拦截,此处不能放置
13791
13891
  emits: ['update:modelValue', 'change', 'click'],
@@ -14898,9 +14998,9 @@ const useStates = (mapper, $store) => {
14898
14998
 
14899
14999
  /** @jsxImportSource vue */
14900
15000
 
14901
- const COMPONENT_NAME$i = 'vc-table-normal-list';
15001
+ const COMPONENT_NAME$j = 'vc-table-normal-list';
14902
15002
  const NormalList = /* @__PURE__ */ vue.defineComponent({
14903
- name: COMPONENT_NAME$i,
15003
+ name: COMPONENT_NAME$j,
14904
15004
  props: {
14905
15005
  data: {
14906
15006
  type: Array,
@@ -15740,9 +15840,9 @@ const props$c = {
15740
15840
 
15741
15841
  /** @jsxImportSource vue */
15742
15842
 
15743
- const COMPONENT_NAME$h = 'vc-table';
15843
+ const COMPONENT_NAME$i = 'vc-table';
15744
15844
  const Table = /* @__PURE__ */ vue.defineComponent({
15745
- name: COMPONENT_NAME$h,
15845
+ name: COMPONENT_NAME$i,
15746
15846
  props: props$c,
15747
15847
  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'],
15748
15848
  setup(props, {
@@ -16377,9 +16477,9 @@ const getFitIndex = (options = {}) => {
16377
16477
 
16378
16478
  /** @jsxImportSource vue */
16379
16479
 
16380
- const COMPONENT_NAME$g = 'vc-text';
16480
+ const COMPONENT_NAME$h = 'vc-text';
16381
16481
  const Text = /* @__PURE__ */ vue.defineComponent({
16382
- name: COMPONENT_NAME$g,
16482
+ name: COMPONENT_NAME$h,
16383
16483
  props: props$b,
16384
16484
  setup(props, {
16385
16485
  emit
@@ -16935,7 +17035,11 @@ const props$a = {
16935
17035
  closable: {
16936
17036
  type: Boolean,
16937
17037
  default: false
16938
- }
17038
+ },
17039
+ barStyle: [Object, String],
17040
+ contentStyle: [Object, String],
17041
+ barClass: [Object, String],
17042
+ contentClass: [Object, String]
16939
17043
  };
16940
17044
 
16941
17045
  const useTabs = (options = {}) => {
@@ -17070,9 +17174,9 @@ const useTabs = (options = {}) => {
17070
17174
 
17071
17175
  /** @jsxImportSource vue */
17072
17176
 
17073
- const COMPONENT_NAME$f = 'vc-tabs';
17177
+ const COMPONENT_NAME$g = 'vc-tabs';
17074
17178
  const Tabs = /* @__PURE__ */ vue.defineComponent({
17075
- name: COMPONENT_NAME$f,
17179
+ name: COMPONENT_NAME$g,
17076
17180
  props: props$a,
17077
17181
  emits: ['update:modelValue', 'change', 'click'],
17078
17182
  setup(props, {
@@ -17188,10 +17292,10 @@ const Tabs = /* @__PURE__ */ vue.defineComponent({
17188
17292
  "class": "vc-tabs__extra"
17189
17293
  }, [slots.extra?.()]), vue.createVNode("div", {
17190
17294
  "ref": wrapper,
17191
- "style": {
17295
+ "style": [props.barStyle, {
17192
17296
  padding: tabs.scrollable.value ? '0 24px' : 0
17193
- },
17194
- "class": "vc-tabs__bar"
17297
+ }],
17298
+ "class": [props.barClass, 'vc-tabs__bar']
17195
17299
  }, [tabs.scrollable.value && vue.createVNode(Icon, {
17196
17300
  "class": "vc-tabs__icon is-left",
17197
17301
  "type": "left",
@@ -17231,8 +17335,8 @@ const Tabs = /* @__PURE__ */ vue.defineComponent({
17231
17335
  }, null)]);
17232
17336
  })])])]), vue.createVNode("div", {
17233
17337
  "ref": content,
17234
- "style": tabs.contentStyle.value,
17235
- "class": "vc-tabs__content"
17338
+ "style": [props.contentStyle, tabs.contentStyle.value],
17339
+ "class": [props.contentClass, 'vc-tabs__content']
17236
17340
  }, [slots.default?.()])]);
17237
17341
  };
17238
17342
  }
@@ -17320,9 +17424,9 @@ const useTabsPane = () => {
17320
17424
 
17321
17425
  /** @jsxImportSource vue */
17322
17426
 
17323
- const COMPONENT_NAME$e = 'vc-tabs-pane';
17427
+ const COMPONENT_NAME$f = 'vc-tabs-pane';
17324
17428
  const TabsPane = /* @__PURE__ */ vue.defineComponent({
17325
- name: COMPONENT_NAME$e,
17429
+ name: COMPONENT_NAME$f,
17326
17430
  props: props$9,
17327
17431
  setup(_, {
17328
17432
  slots
@@ -17377,9 +17481,9 @@ const props$8 = {
17377
17481
 
17378
17482
  /** @jsxImportSource vue */
17379
17483
 
17380
- const COMPONENT_NAME$d = 'vcm-tabs';
17484
+ const COMPONENT_NAME$e = 'vcm-tabs';
17381
17485
  const MTabs = /* @__PURE__ */ vue.defineComponent({
17382
- name: COMPONENT_NAME$d,
17486
+ name: COMPONENT_NAME$e,
17383
17487
  props: props$8,
17384
17488
  emits: ['update:modelValue', 'change', 'click'],
17385
17489
  setup(props, {
@@ -17644,9 +17748,9 @@ const MTabs = /* @__PURE__ */ vue.defineComponent({
17644
17748
 
17645
17749
  /** @jsxImportSource vue */
17646
17750
 
17647
- const COMPONENT_NAME$c = 'vcm-tabs-pane';
17751
+ const COMPONENT_NAME$d = 'vcm-tabs-pane';
17648
17752
  const MTabsPane = /* @__PURE__ */ vue.defineComponent({
17649
- name: COMPONENT_NAME$c,
17753
+ name: COMPONENT_NAME$d,
17650
17754
  props: props$9,
17651
17755
  setup(_, {
17652
17756
  slots
@@ -17847,7 +17951,8 @@ const useTextarea = (textarea, expose) => {
17847
17951
  const classes = vue.computed(() => {
17848
17952
  return {
17849
17953
  "is-focus": isFocus.value,
17850
- "is-disabled": props.disabled
17954
+ "is-disabled": props.disabled,
17955
+ "is-error": !!formItem?.message?.value
17851
17956
  };
17852
17957
  });
17853
17958
  const listeners = vue.computed(() => {
@@ -17946,9 +18051,9 @@ const props$7 = {
17946
18051
 
17947
18052
  /** @jsxImportSource vue */
17948
18053
 
17949
- const COMPONENT_NAME$b = 'vc-textarea';
18054
+ const COMPONENT_NAME$c = 'vc-textarea';
17950
18055
  const Textarea = /* @__PURE__ */ vue.defineComponent({
17951
- name: COMPONENT_NAME$b,
18056
+ name: COMPONENT_NAME$c,
17952
18057
  props: Object.assign(props$7, {
17953
18058
  indicator: {
17954
18059
  type: [Boolean, Object],
@@ -18004,9 +18109,9 @@ const Textarea = /* @__PURE__ */ vue.defineComponent({
18004
18109
 
18005
18110
  /** @jsxImportSource vue */
18006
18111
 
18007
- const COMPONENT_NAME$a = 'vcm-textarea';
18112
+ const COMPONENT_NAME$b = 'vcm-textarea';
18008
18113
  const MTextarea = /* @__PURE__ */ vue.defineComponent({
18009
- name: COMPONENT_NAME$a,
18114
+ name: COMPONENT_NAME$b,
18010
18115
  props: Object.assign(props$7, {
18011
18116
  align: {
18012
18117
  type: String,
@@ -18089,9 +18194,9 @@ const props$6 = {
18089
18194
  }
18090
18195
  };
18091
18196
 
18092
- const COMPONENT_NAME$9 = "vc-theme";
18197
+ const COMPONENT_NAME$a = "vc-theme";
18093
18198
  const Theme = vue.defineComponent({
18094
- name: COMPONENT_NAME$9,
18199
+ name: COMPONENT_NAME$a,
18095
18200
  props: props$6,
18096
18201
  setup(props, { slots }) {
18097
18202
  const themeId = Utils__namespace.getUid("vc-theme");
@@ -18177,9 +18282,9 @@ const Theme = vue.defineComponent({
18177
18282
  }
18178
18283
  });
18179
18284
 
18180
- const COMPONENT_NAME$8 = "vc-theme-view";
18285
+ const COMPONENT_NAME$9 = "vc-theme-view";
18181
18286
  const ThemeView = vue.defineComponent({
18182
- name: COMPONENT_NAME$8,
18287
+ name: COMPONENT_NAME$9,
18183
18288
  props: props$6,
18184
18289
  setup(props, { slots }) {
18185
18290
  return () => {
@@ -18195,9 +18300,9 @@ const ThemeView = vue.defineComponent({
18195
18300
  }
18196
18301
  });
18197
18302
 
18198
- const COMPONENT_NAME$7 = "vc-theme-text";
18303
+ const COMPONENT_NAME$8 = "vc-theme-text";
18199
18304
  const ThemeText = vue.defineComponent({
18200
- name: COMPONENT_NAME$7,
18305
+ name: COMPONENT_NAME$8,
18201
18306
  props: props$6,
18202
18307
  setup(props, { slots }) {
18203
18308
  return () => {
@@ -18213,9 +18318,9 @@ const ThemeText = vue.defineComponent({
18213
18318
  }
18214
18319
  });
18215
18320
 
18216
- const COMPONENT_NAME$6 = "vc-theme-image";
18321
+ const COMPONENT_NAME$7 = "vc-theme-image";
18217
18322
  const ThemeImage = vue.defineComponent({
18218
- name: COMPONENT_NAME$6,
18323
+ name: COMPONENT_NAME$7,
18219
18324
  props: props$6,
18220
18325
  setup(props, { slots }) {
18221
18326
  return () => {
@@ -18263,12 +18368,12 @@ const props$5 = {
18263
18368
 
18264
18369
  /** @jsxImportSource vue */
18265
18370
 
18266
- const COMPONENT_NAME$5 = 'vc-time-picker';
18371
+ const COMPONENT_NAME$6 = 'vc-time-picker';
18267
18372
  const getPanel = type => {
18268
18373
  const isRange = type === 'timerange';
18269
18374
  return isRange ? TimeRangePanel : TimePanel;
18270
18375
  };
18271
- const TimePicker = createPicker(COMPONENT_NAME$5, props$5, () => {
18376
+ const TimePicker = createPicker(COMPONENT_NAME$6, props$5, () => {
18272
18377
  const props = vue.getCurrentInstance().props;
18273
18378
  const icon = vue.ref('icon');
18274
18379
  const panel = vue.shallowRef({});
@@ -18303,9 +18408,9 @@ const props$4 = {
18303
18408
 
18304
18409
  /** @jsxImportSource vue */
18305
18410
 
18306
- const COMPONENT_NAME$4 = 'vc-timeline';
18411
+ const COMPONENT_NAME$5 = 'vc-timeline';
18307
18412
  const Timeline = /* @__PURE__ */ vue.defineComponent({
18308
- name: COMPONENT_NAME$4,
18413
+ name: COMPONENT_NAME$5,
18309
18414
  props: props$4,
18310
18415
  setup(props, {
18311
18416
  slots
@@ -18332,9 +18437,9 @@ const props$3 = {
18332
18437
 
18333
18438
  /** @jsxImportSource vue */
18334
18439
 
18335
- const COMPONENT_NAME$3 = 'vc-touch';
18440
+ const COMPONENT_NAME$4 = 'vc-touch';
18336
18441
  const Touch = /* @__PURE__ */ vue.defineComponent({
18337
- name: COMPONENT_NAME$3,
18442
+ name: COMPONENT_NAME$4,
18338
18443
  props: props$3,
18339
18444
  setup(props, {
18340
18445
  slots
@@ -18358,9 +18463,9 @@ const props$2 = {
18358
18463
 
18359
18464
  /** @jsxImportSource vue */
18360
18465
 
18361
- const COMPONENT_NAME$2 = 'vc-tree';
18466
+ const COMPONENT_NAME$3 = 'vc-tree';
18362
18467
  const Tree = /* @__PURE__ */ vue.defineComponent({
18363
- name: COMPONENT_NAME$2,
18468
+ name: COMPONENT_NAME$3,
18364
18469
  props: props$2,
18365
18470
  setup(props, {
18366
18471
  slots
@@ -18470,9 +18575,9 @@ const props$1 = {
18470
18575
  }
18471
18576
  };
18472
18577
 
18473
- const COMPONENT_NAME$1 = "vc-upload";
18578
+ const COMPONENT_NAME$2 = "vc-upload";
18474
18579
  const Upload = vue.defineComponent({
18475
- name: COMPONENT_NAME$1,
18580
+ name: COMPONENT_NAME$2,
18476
18581
  props: props$1,
18477
18582
  emits: [
18478
18583
  "message",
@@ -18765,10 +18870,440 @@ const Upload = vue.defineComponent({
18765
18870
  const MUpload = Upload;
18766
18871
 
18767
18872
  const props = {
18768
- tag: {
18769
- type: String,
18770
- default: "div"
18873
+ picker: {
18874
+ type: Array,
18875
+ default: () => ["image"]
18876
+ },
18877
+ sortable: {
18878
+ type: Boolean,
18879
+ default: false
18880
+ },
18881
+ mask: {
18882
+ type: Boolean,
18883
+ default: false
18884
+ },
18885
+ /**
18886
+ * vc-upload组件的属性
18887
+ */
18888
+ uploadOptions: {
18889
+ type: Object,
18890
+ default() {
18891
+ return {};
18892
+ }
18893
+ },
18894
+ /**
18895
+ * 数据源['xxx.jpg', ....]
18896
+ */
18897
+ modelValue: {
18898
+ type: [String, Array, Object],
18899
+ // { value: '', label: '' }
18900
+ default: () => []
18901
+ },
18902
+ // 数据字典
18903
+ keyValue: {
18904
+ type: Object,
18905
+ default: () => {
18906
+ return {
18907
+ label: "label",
18908
+ value: "value"
18909
+ };
18910
+ }
18911
+ },
18912
+ output: {
18913
+ type: [String, Function],
18914
+ default: "object",
18915
+ validator: (v) => /(string|object)/.test(v)
18916
+ },
18917
+ /**
18918
+ * 可上传的最大值,跟upload内的Max不同,有可能是对象类型,对应的Upload做限制
18919
+ */
18920
+ max: {
18921
+ type: [Number, Object],
18922
+ default: Number.MAX_SAFE_INTEGER
18923
+ },
18924
+ disabled: {
18925
+ type: Boolean,
18926
+ default: false
18927
+ },
18928
+ /**
18929
+ * 上传成功后对数据的格式化
18930
+ */
18931
+ formatter: Function,
18932
+ // TODO 下面两个重复了,需删除
18933
+ /**
18934
+ * 盒子className
18935
+ */
18936
+ boxClass: String,
18937
+ imagePreviewOptions: {
18938
+ type: Object,
18939
+ default: () => ({})
18940
+ },
18941
+ imageClass: String,
18942
+ videoClass: String,
18943
+ audioClass: String,
18944
+ fileClass: String,
18945
+ compressOptions: {
18946
+ type: Object,
18947
+ default: () => {
18948
+ return {
18949
+ compress: false,
18950
+ // 是否开启图片压缩
18951
+ width: 0,
18952
+ // 图片缩放最大宽度,为0默认源图片宽度
18953
+ height: 0,
18954
+ // 图片缩放最大高度,为0默认源图片高度
18955
+ filetype: "image/jpeg",
18956
+ // 文件类型
18957
+ encoderOptions: 0.92
18958
+ // 在指定图片格式为 image/jpeg 或 image/webp的情况下,可以从 0 到 1 的区间内选择图片的质量。如果超出取值范围,使用默认值 0.92
18959
+ };
18960
+ }
18961
+ },
18962
+ showMessage: Boolean,
18963
+ gallery: Boolean
18964
+ };
18965
+
18966
+ /** @jsxImportSource vue */
18967
+
18968
+ const COMPONENT_NAME$1 = 'vc-steps';
18969
+ const ImageItem = /* @__PURE__ */ vue.defineComponent({
18970
+ name: COMPONENT_NAME$1,
18971
+ props: {
18972
+ imageClass: [String, Object, Array],
18973
+ disabled: Boolean,
18974
+ row: Object,
18975
+ imagePreviewOptions: {
18976
+ type: Object,
18977
+ default: () => ({})
18978
+ },
18979
+ index: [String, Number],
18980
+ data: {
18981
+ type: Array,
18982
+ default: () => []
18983
+ },
18984
+ keyValue: Object
18985
+ },
18986
+ emits: ['open', 'close', 'delete'],
18987
+ setup(props, {
18988
+ slots,
18989
+ emit
18990
+ }) {
18991
+ const instance = vue.getCurrentInstance();
18992
+ const current = vue.computed(() => {
18993
+ if (props.row?.status === 0) return -1;
18994
+ const v = props.data.filter(i => i.status !== 0);
18995
+ return v.findIndex(i => {
18996
+ const a = i[props.keyValue.value] || i;
18997
+ const b = props.row?.[props.keyValue.value] || props.row;
18998
+ return a === b;
18999
+ });
19000
+ });
19001
+ // 拿到可预览的图片,供预览组件使用
19002
+ const getPreviewData = () => {
19003
+ return props.data.map(i => i?.[props.keyValue.value]);
19004
+ };
19005
+ const previewByPS = (e, index) => {
19006
+ emit('open');
19007
+ ImagePreview.open({
19008
+ current: index,
19009
+ data: getPreviewData(),
19010
+ onClose: () => emit('close')
19011
+ });
19012
+ };
19013
+ const handlePreview = e => {
19014
+ /**
19015
+ * 渐进增强
19016
+ */
19017
+ let {
19018
+ enhancer
19019
+ } = VcInstance.options.ImagePreview || {};
19020
+ enhancer = props.imagePreviewOptions.enhancer || enhancer || (() => false);
19021
+ const images = getPreviewData().map(item => ({
19022
+ src: item
19023
+ }));
19024
+ enhancer(current.value, images, instance) || previewByPS(e, current.value);
19025
+ };
19026
+ const handleDel = () => {
19027
+ emit('delete');
19028
+ };
19029
+ return () => {
19030
+ const row = props.row;
19031
+ return vue.createVNode("div", {
19032
+ "class": [{
19033
+ 'is-error': row.status == 0
19034
+ }, 'vc-upload-image-item']
19035
+ }, [slots.default ? slots.default({
19036
+ it: row,
19037
+ current: current.value
19038
+ }) : vue.createVNode(vue.Fragment, null, [!row.errorFlag && typeof row[props.keyValue.value] === 'string' ? vue.createVNode(Image$1, {
19039
+ "src": row[props.keyValue.value],
19040
+ "class": [props.imageClass, 'vc-upload-image-item__content'],
19041
+ "fit": "cover",
19042
+ "previewable": false,
19043
+ "onClick": handlePreview
19044
+ }, null) : vue.createVNode("div", {
19045
+ "class": [props.imageClass, 'vc-upload-image-item__content']
19046
+ }, [row.percent && row.percent != 100 ? vue.createVNode(Progress, {
19047
+ "percent": row.percent,
19048
+ "show-text": false,
19049
+ "status": "normal",
19050
+ "style": "width: 100%;padding: 0 5px"
19051
+ }, null) : !row[props.keyValue.value] && row.percent === 100 && !row.errorFlag ? vue.createVNode("p", {
19052
+ "style": "line-height: 1; padding: 5px"
19053
+ }, [vue.createTextVNode("\u670D\u52A1\u5668\u6B63\u5728\u63A5\u6536...")]) : row.status == 0 ? vue.createVNode("div", {
19054
+ "style": "padding: 5px"
19055
+ }, [vue.createTextVNode("\u4E0A\u4F20\u5931\u8D25")]) : null]), (!props.disabled || row.errorFlag) && vue.createVNode(Icon, {
19056
+ "type": "close-small",
19057
+ "class": "vc-upload-picker__delete",
19058
+ "onClick": handleDel
19059
+ }, null)])]);
19060
+ };
18771
19061
  }
19062
+ });
19063
+
19064
+ const recognizer = (url) => {
19065
+ const reg = /\.(jpe?g|png|gif|bmp|webp|image|heic|mp4|mov|avi|mpg|mpeg|rmvb)/ig;
19066
+ const result = url.match(reg);
19067
+ return result && result.length ? /.(jpe?g|png|gif|bmp|webp|image|heic)/ig.test(result[result.length - 1]) ? "image" : "video" : "file";
19068
+ };
19069
+ const FILE_ACCEPT_MAP = {
19070
+ DOC_ACCEPTS: ".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
19071
+ EXCEL_ACCEPTS: ".csv,.xls,.xlsx,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
19072
+ PPT_ACCEPTS: ".ppt,.pptx,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation",
19073
+ PDF_ACCEPTS: ".pdf,application/pdf",
19074
+ TXT_ACCEPTS: "text/plain",
19075
+ HTML_ACCEPTS: "text/html"
19076
+ };
19077
+
19078
+ const {
19079
+ DOC_ACCEPTS,
19080
+ EXCEL_ACCEPTS,
19081
+ PPT_ACCEPTS,
19082
+ PDF_ACCEPTS,
19083
+ TXT_ACCEPTS,
19084
+ HTML_ACCEPTS
19085
+ } = FILE_ACCEPT_MAP;
19086
+ const usePicker = (expose) => {
19087
+ const instance = vue.getCurrentInstance();
19088
+ const props = instance.props;
19089
+ const { emit } = instance;
19090
+ const formItem = vue.inject("vc-form-item", {});
19091
+ const allowKeepString = vue.computed(() => {
19092
+ return typeof props.modelValue === "string";
19093
+ });
19094
+ const allowKeepObject = vue.computed(() => {
19095
+ const v = props.modelValue;
19096
+ return props.output === "object" && props.max === 1 && !Array.isArray(v) && typeof v === "object";
19097
+ });
19098
+ const currentValue = vue.ref({
19099
+ image: [],
19100
+ video: [],
19101
+ audio: [],
19102
+ file: []
19103
+ });
19104
+ const currentUploadOptions = vue.ref({
19105
+ image: {
19106
+ accept: "image/gif,image/jpeg,image/jpg,image/png",
19107
+ ...props.uploadOptions.image || {}
19108
+ },
19109
+ video: {
19110
+ accept: "video/*",
19111
+ ...props.uploadOptions.video || {}
19112
+ },
19113
+ audio: {
19114
+ accept: "audio/*",
19115
+ ...props.uploadOptions.audio || {}
19116
+ },
19117
+ file: {
19118
+ accept: `${DOC_ACCEPTS},${EXCEL_ACCEPTS},${PPT_ACCEPTS},${PDF_ACCEPTS},${TXT_ACCEPTS},${HTML_ACCEPTS}`,
19119
+ ...props.uploadOptions.file || {}
19120
+ }
19121
+ });
19122
+ const dynamicMax = vue.computed(() => {
19123
+ const image = currentValue.value.image || [];
19124
+ const video = currentValue.value.video || [];
19125
+ const audio = currentValue.value.audio || [];
19126
+ const file = currentValue.value.file || [];
19127
+ const imageCount = image.length || 0;
19128
+ const videoCount = video.length || 0;
19129
+ const audioCount = audio.length || 0;
19130
+ const fileCount = file.length || 0;
19131
+ if (typeof props.max === "number") {
19132
+ const curNum = imageCount + videoCount + audioCount + fileCount;
19133
+ const leftNum = props.max - curNum;
19134
+ return {
19135
+ image: leftNum,
19136
+ video: leftNum,
19137
+ audio: leftNum,
19138
+ file: leftNum
19139
+ };
19140
+ } else if (typeof props.max === "object") {
19141
+ const {
19142
+ image: $image,
19143
+ video: $video,
19144
+ audio: $audio,
19145
+ file: $file
19146
+ } = props.max;
19147
+ const max = {};
19148
+ $image && (max.image = $image - imageCount);
19149
+ $video && (max.video = $video - videoCount);
19150
+ $audio && (max.audio = $audio - audioCount);
19151
+ $file && (max.file = $file - fileCount);
19152
+ return max;
19153
+ }
19154
+ return {};
19155
+ });
19156
+ const sync = () => {
19157
+ let v = props.picker.reduce((pre, cur) => pre.concat(currentValue.value[cur] || []), []).filter((i) => !i.errorFlag).map((i) => {
19158
+ if (props.output === "string") return i[props.keyValue.value];
19159
+ if (typeof props.output === "function") return props.output(i) || i;
19160
+ return i;
19161
+ });
19162
+ if (allowKeepString.value) {
19163
+ v = v.map((i) => i[props.keyValue.value] || i).join(",");
19164
+ } else if (allowKeepObject.value) {
19165
+ v = v[0] || null;
19166
+ }
19167
+ emit("update:modelValue", v);
19168
+ emit("change", v);
19169
+ formItem.change?.(v);
19170
+ };
19171
+ const handleFileBefore = async (vFile, fileList, type) => {
19172
+ if (props?.compressOptions?.compress && type === "image") ;
19173
+ const onFileBefore = instance.vnode.props?.onFileBefore || (() => {
19174
+ });
19175
+ return await onFileBefore(vFile, fileList, type) || vFile;
19176
+ };
19177
+ const handleFileStart = (vFile, type) => {
19178
+ currentValue.value[type].push(vFile);
19179
+ emit("file-start", vFile, type);
19180
+ };
19181
+ const handleFileProgress = (e, vFile, type) => {
19182
+ if (parseInt(e.percent, 10) <= 100) {
19183
+ currentValue.value[type] = currentValue.value[type].map((item) => {
19184
+ if (vFile.uploadId === item.uploadId) {
19185
+ return {
19186
+ ...item,
19187
+ percent: e.percent
19188
+ };
19189
+ }
19190
+ return item;
19191
+ });
19192
+ }
19193
+ };
19194
+ const handleFileSuccess = (response, vFile, cycle, type) => {
19195
+ currentValue.value[type] = currentValue.value[type].map((item) => {
19196
+ if (item.uploadId === vFile.uploadId) {
19197
+ return {
19198
+ type,
19199
+ [props.keyValue.label]: vFile.name,
19200
+ // 外部需要满足response中带source
19201
+ [props.keyValue.value]: response.source
19202
+ };
19203
+ }
19204
+ return item;
19205
+ });
19206
+ emit("file-success", response, vFile, cycle, type);
19207
+ };
19208
+ const handleError = (err, type) => {
19209
+ props.showMessage && err.message && Message.error(err.message);
19210
+ emit("error", err, type);
19211
+ };
19212
+ const handleFileError = (response, vFile, cycle, type) => {
19213
+ currentValue.value[type] = currentValue.value[type].map((item) => {
19214
+ if (item.uploadId === vFile.uploadId) {
19215
+ return {
19216
+ ...item,
19217
+ ...response,
19218
+ // 文件基础信息
19219
+ type,
19220
+ [props.keyValue.label]: vFile.name,
19221
+ errorFlag: (/* @__PURE__ */ new Date()).getTime()
19222
+ };
19223
+ }
19224
+ return item;
19225
+ });
19226
+ emit("file-error", response, vFile, cycle, type);
19227
+ };
19228
+ const handleFileComplete = (response, type) => {
19229
+ sync();
19230
+ emit("complete", response, type);
19231
+ };
19232
+ const handleDelete = async (index, type) => {
19233
+ const onRemoveBefore = instance.vnode.props?.onRemoveBefore || (() => {
19234
+ });
19235
+ await onRemoveBefore(index, type);
19236
+ const target = currentValue.value[type];
19237
+ const item = target[index];
19238
+ if (!item) {
19239
+ console.error("【vc-upload-picker】: 没有找到要删除的元素");
19240
+ return;
19241
+ }
19242
+ if (item.errorFlag) {
19243
+ currentValue.value[type] = target.filter(
19244
+ (it) => it.uploadId != item.uploadId
19245
+ );
19246
+ return;
19247
+ }
19248
+ target.splice(index, 1);
19249
+ sync();
19250
+ };
19251
+ const parseModelValue = (v) => {
19252
+ const initialData = { image: [], video: [], audio: [], file: [] };
19253
+ if (allowKeepString.value) {
19254
+ v = (props.max === 1 ? [v] : v.split(",")).filter((i) => !!i);
19255
+ } else if (allowKeepObject.value) {
19256
+ v = [v].filter((i) => i && !!i[props.keyValue.value]);
19257
+ }
19258
+ if (!Array.isArray(v) || !v.length) return initialData;
19259
+ return v.reduce((pre, cur) => {
19260
+ const value = cur[props.keyValue.value] || (typeof cur === "object" ? "" : cur);
19261
+ const label = cur[props.keyValue.label] || value.replace(/^.*\/([^/]+)$/, "$1");
19262
+ const type = cur.type || (props.picker.length === 1 ? props.picker[0] : recognizer(value));
19263
+ switch (type) {
19264
+ case "image":
19265
+ case "video":
19266
+ case "audio":
19267
+ case "file":
19268
+ pre[type].push({
19269
+ // 文件类型
19270
+ type,
19271
+ // 文件名
19272
+ [props.keyValue.label]: label,
19273
+ // 源文件地址
19274
+ [props.keyValue.value]: value,
19275
+ // 上传进度
19276
+ percent: null,
19277
+ // 错误标记
19278
+ errorFlag: false
19279
+ });
19280
+ return pre;
19281
+ default:
19282
+ return pre;
19283
+ }
19284
+ }, initialData);
19285
+ };
19286
+ vue.watch(
19287
+ () => props.modelValue,
19288
+ (v) => {
19289
+ currentValue.value = parseModelValue(v);
19290
+ },
19291
+ { immediate: true }
19292
+ );
19293
+ expose();
19294
+ return {
19295
+ currentValue,
19296
+ currentUploadOptions,
19297
+ dynamicMax,
19298
+ handleDelete,
19299
+ handleFileBefore,
19300
+ handleFileStart,
19301
+ handleFileProgress,
19302
+ handleFileSuccess,
19303
+ handleFileError,
19304
+ handleError,
19305
+ handleFileComplete
19306
+ };
18772
19307
  };
18773
19308
 
18774
19309
  /** @jsxImportSource vue */
@@ -18777,13 +19312,111 @@ const COMPONENT_NAME = 'vc-upload-picker';
18777
19312
  const UploadPicker = /* @__PURE__ */ vue.defineComponent({
18778
19313
  name: COMPONENT_NAME,
18779
19314
  props: props,
19315
+ emits: ['update:modelValue', 'file-success', 'file-start', 'file-before', 'file-error', 'success', 'error', 'complete', 'change', 'remove-before'],
18780
19316
  setup(props, {
18781
- slots
19317
+ slots,
19318
+ expose
18782
19319
  }) {
19320
+ const instance = vue.getCurrentInstance();
19321
+ const currentPicker = vue.computed(() => {
19322
+ return props.picker.reduce((pre, cur) => {
19323
+ switch (cur) {
19324
+ case 'image':
19325
+ pre.push({
19326
+ type: cur,
19327
+ item: ImageItem
19328
+ });
19329
+ return pre;
19330
+ case 'video':
19331
+ pre.push({
19332
+ type: cur,
19333
+ item: 'div'
19334
+ // item: VideoItem
19335
+ });
19336
+ return pre;
19337
+ case 'audio':
19338
+ pre.push({
19339
+ type: cur,
19340
+ item: 'div'
19341
+ // item: AudioItem
19342
+ });
19343
+ return pre;
19344
+ case 'file':
19345
+ pre.push({
19346
+ type: cur,
19347
+ item: 'div'
19348
+ // item: FileItem
19349
+ });
19350
+ return pre;
19351
+ default:
19352
+ return pre;
19353
+ }
19354
+ }, []);
19355
+ });
19356
+ const handleClick = (e, type) => {
19357
+ const options = VcInstance.options.UploadPicker || {};
19358
+ if (typeof props.gallery === 'function' || props.gallery && options.gallery) {
19359
+ const fn = typeof props.gallery === 'function' ? props.gallery : options.gallery;
19360
+
19361
+ // 阻止原生事件,如video, file不走gallery, 可以跳过;
19362
+ fn(instance, type) && e.stopPropagation();
19363
+ }
19364
+ };
19365
+ const base = usePicker(expose);
18783
19366
  return () => {
18784
19367
  return vue.createVNode("div", {
18785
19368
  "class": "vc-upload-picker"
18786
- }, [slots?.default?.()]);
19369
+ }, [currentPicker.value.map((picker, $index) => {
19370
+ return vue.createVNode(vue.Fragment, {
19371
+ "key": `${picker}-${$index}`
19372
+ }, [base.currentValue.value[picker.type].map((item, index) => {
19373
+ const Item = picker.item;
19374
+ return vue.createVNode(Item, {
19375
+ "key": typeof item === 'object' ? item.uid : item,
19376
+ "row": item,
19377
+ "disabled": props.disabled,
19378
+ "image-preview-options": props.imagePreviewOptions,
19379
+ "imageClass": props.imageClass,
19380
+ "videoClass": props.videoClass,
19381
+ "audioClass": props.audioClass,
19382
+ "fileClass": props.fileClass,
19383
+ "index": index,
19384
+ "keyValue": props.keyValue,
19385
+ "data": base.currentValue.value[picker.type],
19386
+ "class": "vc-upload-picker__item",
19387
+ "onDelete": () => base.handleDelete(index, picker.type)
19388
+ }, {
19389
+ default: slots.default ? scopeData => {
19390
+ return slots?.default?.({
19391
+ it: scopeData?.it,
19392
+ current: scopeData?.current,
19393
+ index,
19394
+ name: picker.type
19395
+ });
19396
+ } : null
19397
+ });
19398
+ }), vue.withDirectives(vue.createVNode(Upload, vue.mergeProps(base.currentUploadOptions.value[picker.type], {
19399
+ "max": base.dynamicMax[picker.type],
19400
+ "class": "vc-upload-picker__upload",
19401
+ "onFileBefore": (vFile, fileList) => base.handleFileBefore(vFile, fileList, picker.type),
19402
+ "onFileStart": vFile => base.handleFileStart(vFile, picker.type),
19403
+ "onFileProgress": (e, vFile) => base.handleFileProgress(e, vFile, picker.type),
19404
+ "onFileSuccess": (response, vFile, cycle) => base.handleFileSuccess(response, vFile, cycle, picker.type),
19405
+ "onFileError": (response, vFile, cycle) => base.handleFileError(response, vFile, cycle, picker.type),
19406
+ "onError": e => base.handleError(e, picker.type),
19407
+ "onComplete": response => base.handleFileComplete(response, picker.type)
19408
+ }), {
19409
+ default: () => [slots?.[`${picker.type}-upload`] ? slots[`${picker.type}-upload`]?.() : vue.createVNode("div", {
19410
+ "class": [props.boxClass, 'vc-upload-picker__box'],
19411
+ "onClick": e => handleClick(e, picker.type)
19412
+ }, [vue.createVNode(Icon, {
19413
+ "type": "mini-plus",
19414
+ "class": "vc-upload-picker__plus-icon"
19415
+ }, null), vue.createVNode("span", {
19416
+ "style": "margin-top: 8px"
19417
+ }, [vue.createTextVNode("\u4E0A\u4F20")])])]
19418
+ }), [[vue.vShow, !props.disabled && base.dynamicMax.value[picker.type] >= 1]])]);
19419
+ })]);
18787
19420
  };
18788
19421
  }
18789
19422
  });
@@ -18822,7 +19455,7 @@ exports.Fragment = Fragment;
18822
19455
  exports.HTMLToImage = HTMLToImage;
18823
19456
  exports.Icon = Icon;
18824
19457
  exports.IconManager = IconManager;
18825
- exports.Image = Image;
19458
+ exports.Image = Image$1;
18826
19459
  exports.ImageCrop = ImageCrop;
18827
19460
  exports.ImagePreview = ImagePreview;
18828
19461
  exports.ImageProcessing = ImageProcessing;