@deot/vc-components 1.0.7 → 1.0.8

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
@@ -5,15 +5,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
  const vue = require('vue');
6
6
  const lodashEs = require('lodash-es');
7
7
  const helperResize = require('@deot/helper-resize');
8
+ const lodash = require('lodash');
8
9
  const Utils = require('@deot/helper-utils');
9
10
  const $ = require('@deot/helper-dom');
10
11
  const vcShared = require('@deot/vc-shared');
11
12
  const vcHooks = require('@deot/vc-hooks');
12
13
  const helperValidator = require('@deot/helper-validator');
13
14
  const helperCache = require('@deot/helper-cache');
15
+ const Load = require('@deot/helper-load');
14
16
  const helperScheduler = require('@deot/helper-scheduler');
15
17
  const helperWheel = require('@deot/helper-wheel');
16
- const Load = require('@deot/helper-load');
17
18
 
18
19
  function _interopNamespaceDefault(e) {
19
20
  const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
@@ -80,7 +81,7 @@ class Instance {
80
81
  }
81
82
  const VcInstance = new Instance();
82
83
 
83
- const props$1j = {
84
+ const props$1l = {
84
85
  tag: {
85
86
  type: String,
86
87
  default: "div"
@@ -89,10 +90,10 @@ const props$1j = {
89
90
 
90
91
  /** @jsxImportSource vue */
91
92
 
92
- const COMPONENT_NAME$1A = 'vc-action-sheet';
93
+ const COMPONENT_NAME$1H = 'vc-action-sheet';
93
94
  const ActionSheet = /* @__PURE__ */ vue.defineComponent({
94
- name: COMPONENT_NAME$1A,
95
- props: props$1j,
95
+ name: COMPONENT_NAME$1H,
96
+ props: props$1l,
96
97
  setup(props, {
97
98
  slots
98
99
  }) {
@@ -106,7 +107,7 @@ const ActionSheet = /* @__PURE__ */ vue.defineComponent({
106
107
 
107
108
  const MActionSheet = ActionSheet;
108
109
 
109
- const props$1i = {
110
+ const props$1k = {
110
111
  modelValue: {
111
112
  type: Boolean,
112
113
  default: true
@@ -133,7 +134,7 @@ const props$1i = {
133
134
  }
134
135
  };
135
136
 
136
- const props$1h = {
137
+ const props$1j = {
137
138
  type: String,
138
139
  inherit: {
139
140
  type: Boolean,
@@ -278,10 +279,10 @@ const IconManager = new Manager();
278
279
 
279
280
  /** @jsxImportSource vue */
280
281
 
281
- const COMPONENT_NAME$1z = 'vc-icon';
282
+ const COMPONENT_NAME$1G = 'vc-icon';
282
283
  const Icon = /* @__PURE__ */ vue.defineComponent({
283
- name: COMPONENT_NAME$1z,
284
- props: props$1h,
284
+ name: COMPONENT_NAME$1G,
285
+ props: props$1j,
285
286
  setup(props) {
286
287
  const viewBox = vue.ref('0 0 1024 1024');
287
288
  const path = vue.ref([]);
@@ -314,7 +315,7 @@ const Icon = /* @__PURE__ */ vue.defineComponent({
314
315
  }
315
316
  });
316
317
 
317
- const props$1g = {
318
+ const props$1i = {
318
319
  /**
319
320
  * 进入/离开持续时间
320
321
  * {enter: 300, leave: 300}
@@ -479,10 +480,10 @@ const useTransition = () => {
479
480
  };
480
481
  };
481
482
 
482
- const COMPONENT_NAME$1y = "vc-transition";
483
+ const COMPONENT_NAME$1F = "vc-transition";
483
484
  const Transition = vue.defineComponent({
484
- name: COMPONENT_NAME$1y,
485
- props: props$1g,
485
+ name: COMPONENT_NAME$1F,
486
+ props: props$1i,
486
487
  // 当不声明emits的情况下,事件存在于attrs中
487
488
  inheritAttrs: false,
488
489
  setup(props, { slots, attrs }) {
@@ -502,10 +503,10 @@ const Transition = vue.defineComponent({
502
503
  }
503
504
  });
504
505
 
505
- const COMPONENT_NAME$1x = "vc-transition-collapse";
506
+ const COMPONENT_NAME$1E = "vc-transition-collapse";
506
507
  const TransitionCollapse = vue.defineComponent({
507
- name: COMPONENT_NAME$1x,
508
- props: props$1g,
508
+ name: COMPONENT_NAME$1E,
509
+ props: props$1i,
509
510
  // 当不声明emits的情况下,事件存在于attrs中
510
511
  inheritAttrs: false,
511
512
  setup(props, { slots, attrs: _attrs }) {
@@ -623,11 +624,11 @@ const TransitionCollapse = vue.defineComponent({
623
624
  }
624
625
  });
625
626
 
626
- const COMPONENT_NAME$1w = "vc-transition-fade";
627
+ const COMPONENT_NAME$1D = "vc-transition-fade";
627
628
  const TransitionFade = vue.defineComponent({
628
- name: COMPONENT_NAME$1w,
629
+ name: COMPONENT_NAME$1D,
629
630
  props: {
630
- ...props$1g,
631
+ ...props$1i,
631
632
  // inheritAttrs必须是false
632
633
  style: {
633
634
  type: Object,
@@ -660,11 +661,11 @@ const TransitionFade = vue.defineComponent({
660
661
  }
661
662
  });
662
663
 
663
- const COMPONENT_NAME$1v = "vc-transition-scale";
664
+ const COMPONENT_NAME$1C = "vc-transition-scale";
664
665
  const TransitionScale = vue.defineComponent({
665
- name: COMPONENT_NAME$1v,
666
+ name: COMPONENT_NAME$1C,
666
667
  props: {
667
- ...props$1g,
668
+ ...props$1i,
668
669
  mode: {
669
670
  type: String,
670
671
  default: "both",
@@ -702,11 +703,11 @@ const TransitionScale = vue.defineComponent({
702
703
  }
703
704
  });
704
705
 
705
- const COMPONENT_NAME$1u = "vc-transition-slide";
706
+ const COMPONENT_NAME$1B = "vc-transition-slide";
706
707
  const TransitionSlide = vue.defineComponent({
707
- name: COMPONENT_NAME$1u,
708
+ name: COMPONENT_NAME$1B,
708
709
  props: {
709
- ...props$1g,
710
+ ...props$1i,
710
711
  mode: {
711
712
  type: String,
712
713
  default: "left",
@@ -744,11 +745,11 @@ const TransitionSlide = vue.defineComponent({
744
745
  }
745
746
  });
746
747
 
747
- const COMPONENT_NAME$1t = "vc-transition-zoom";
748
+ const COMPONENT_NAME$1A = "vc-transition-zoom";
748
749
  const TransitionZoom = vue.defineComponent({
749
- name: COMPONENT_NAME$1t,
750
+ name: COMPONENT_NAME$1A,
750
751
  props: {
751
- ...props$1g,
752
+ ...props$1i,
752
753
  mode: {
753
754
  type: String,
754
755
  default: "x",
@@ -788,7 +789,7 @@ const TransitionZoom = vue.defineComponent({
788
789
 
789
790
  /** @jsxImportSource vue */
790
791
 
791
- const COMPONENT_NAME$1s = 'vc-alert';
792
+ const COMPONENT_NAME$1z = 'vc-alert';
792
793
 
793
794
  // [color, borderColor, backgroundColor], -> CSS
794
795
  const THEME_MAP = {
@@ -798,8 +799,8 @@ const THEME_MAP = {
798
799
  warning: ['#ffbf00', '#ffe58f', '#fffbe6']
799
800
  };
800
801
  const Alert = /* @__PURE__ */ vue.defineComponent({
801
- name: COMPONENT_NAME$1s,
802
- props: props$1i,
802
+ name: COMPONENT_NAME$1z,
803
+ props: props$1k,
803
804
  setup(props, {
804
805
  slots,
805
806
  emit
@@ -888,7 +889,7 @@ const Alert = /* @__PURE__ */ vue.defineComponent({
888
889
 
889
890
  const MAlert = Alert;
890
891
 
891
- const props$1f = {
892
+ const props$1h = {
892
893
  tag: {
893
894
  type: String,
894
895
  default: "div"
@@ -897,10 +898,10 @@ const props$1f = {
897
898
 
898
899
  /** @jsxImportSource vue */
899
900
 
900
- const COMPONENT_NAME$1r = 'vc-artboard';
901
+ const COMPONENT_NAME$1y = 'vc-artboard';
901
902
  const Artboard = /* @__PURE__ */ vue.defineComponent({
902
- name: COMPONENT_NAME$1r,
903
- props: props$1f,
903
+ name: COMPONENT_NAME$1y,
904
+ props: props$1h,
904
905
  setup(props, {
905
906
  slots
906
907
  }) {
@@ -914,7 +915,7 @@ const Artboard = /* @__PURE__ */ vue.defineComponent({
914
915
 
915
916
  const MArtboard = Artboard;
916
917
 
917
- const props$1e = {
918
+ const props$1g = {
918
919
  size: {
919
920
  type: Number,
920
921
  default: 28
@@ -938,10 +939,10 @@ const props$1e = {
938
939
 
939
940
  /** @jsxImportSource vue */
940
941
 
941
- const COMPONENT_NAME$1q = 'vc-spin';
942
+ const COMPONENT_NAME$1x = 'vc-spin';
942
943
  const Spin = /* @__PURE__ */ vue.defineComponent({
943
- name: COMPONENT_NAME$1q,
944
- props: props$1e,
944
+ name: COMPONENT_NAME$1x,
945
+ props: props$1g,
945
946
  setup(props, {
946
947
  slots
947
948
  }) {
@@ -975,7 +976,7 @@ const Spin = /* @__PURE__ */ vue.defineComponent({
975
976
  }
976
977
  });
977
978
 
978
- const props$1d = {
979
+ const props$1f = {
979
980
  wait: {
980
981
  type: Number,
981
982
  default: 250
@@ -991,10 +992,10 @@ const props$1d = {
991
992
  exclude: RegExp
992
993
  };
993
994
 
994
- const COMPONENT_NAME$1p = "vc-debounce";
995
+ const COMPONENT_NAME$1w = "vc-debounce";
995
996
  const Debounce = vue.defineComponent({
996
- name: COMPONENT_NAME$1p,
997
- props: props$1d,
997
+ name: COMPONENT_NAME$1w,
998
+ props: props$1f,
998
999
  /**
999
1000
  * 不声明emits使得事件被透传放入attrs中, 这样可以让所有的事件透传
1000
1001
  * 如事件onClick
@@ -1035,7 +1036,7 @@ const Debounce = vue.defineComponent({
1035
1036
  }
1036
1037
  });
1037
1038
 
1038
- const props$1c = {
1039
+ const props$1e = {
1039
1040
  tag: {
1040
1041
  type: String,
1041
1042
  default: "button"
@@ -1065,11 +1066,11 @@ const props$1c = {
1065
1066
 
1066
1067
  /** @jsxImportSource vue */
1067
1068
 
1068
- const COMPONENT_NAME$1o = 'vc-button';
1069
+ const COMPONENT_NAME$1v = 'vc-button';
1069
1070
  const Button = /* @__PURE__ */ vue.defineComponent({
1070
- name: COMPONENT_NAME$1o,
1071
+ name: COMPONENT_NAME$1v,
1071
1072
  emits: ['click'],
1072
- props: props$1c,
1073
+ props: props$1e,
1073
1074
  setup(props, {
1074
1075
  slots
1075
1076
  }) {
@@ -1126,7 +1127,7 @@ const Button = /* @__PURE__ */ vue.defineComponent({
1126
1127
  }
1127
1128
  });
1128
1129
 
1129
- const props$1b = {
1130
+ const props$1d = {
1130
1131
  vertical: {
1131
1132
  type: Boolean,
1132
1133
  default: false
@@ -1147,10 +1148,10 @@ const props$1b = {
1147
1148
 
1148
1149
  /** @jsxImportSource vue */
1149
1150
 
1150
- const COMPONENT_NAME$1n = 'vc-button-group';
1151
+ const COMPONENT_NAME$1u = 'vc-button-group';
1151
1152
  const ButtonGroup = /* @__PURE__ */ vue.defineComponent({
1152
- name: COMPONENT_NAME$1n,
1153
- props: props$1b,
1153
+ name: COMPONENT_NAME$1u,
1154
+ props: props$1d,
1154
1155
  setup(props, {
1155
1156
  slots
1156
1157
  }) {
@@ -1174,7 +1175,7 @@ const ButtonGroup = /* @__PURE__ */ vue.defineComponent({
1174
1175
  const MButton = Button;
1175
1176
  const MButtonGroup = ButtonGroup;
1176
1177
 
1177
- const props$1a = {
1178
+ const props$1c = {
1178
1179
  tag: {
1179
1180
  type: String,
1180
1181
  default: "div"
@@ -1183,10 +1184,10 @@ const props$1a = {
1183
1184
 
1184
1185
  /** @jsxImportSource vue */
1185
1186
 
1186
- const COMPONENT_NAME$1m = 'vc-calendar';
1187
+ const COMPONENT_NAME$1t = 'vc-calendar';
1187
1188
  const Calendar = /* @__PURE__ */ vue.defineComponent({
1188
- name: COMPONENT_NAME$1m,
1189
- props: props$1a,
1189
+ name: COMPONENT_NAME$1t,
1190
+ props: props$1c,
1190
1191
  setup(props, {
1191
1192
  slots
1192
1193
  }) {
@@ -1200,7 +1201,7 @@ const Calendar = /* @__PURE__ */ vue.defineComponent({
1200
1201
 
1201
1202
  const MCalendar = Calendar;
1202
1203
 
1203
- const props$19 = {
1204
+ const props$1b = {
1204
1205
  border: {
1205
1206
  type: Boolean,
1206
1207
  default: true
@@ -1223,10 +1224,10 @@ const props$19 = {
1223
1224
 
1224
1225
  /** @jsxImportSource vue */
1225
1226
 
1226
- const COMPONENT_NAME$1l = 'vc-card';
1227
+ const COMPONENT_NAME$1s = 'vc-card';
1227
1228
  const Card = /* @__PURE__ */ vue.defineComponent({
1228
- name: COMPONENT_NAME$1l,
1229
- props: props$19,
1229
+ name: COMPONENT_NAME$1s,
1230
+ props: props$1b,
1230
1231
  setup(props, {
1231
1232
  slots
1232
1233
  }) {
@@ -1252,7 +1253,7 @@ const Card = /* @__PURE__ */ vue.defineComponent({
1252
1253
 
1253
1254
  const MCard = Card;
1254
1255
 
1255
- const props$18 = {
1256
+ const props$1a = {
1256
1257
  tag: {
1257
1258
  type: String,
1258
1259
  default: "div"
@@ -1261,10 +1262,10 @@ const props$18 = {
1261
1262
 
1262
1263
  /** @jsxImportSource vue */
1263
1264
 
1264
- const COMPONENT_NAME$1k = 'vc-carousel';
1265
+ const COMPONENT_NAME$1r = 'vc-carousel';
1265
1266
  const Carousel = /* @__PURE__ */ vue.defineComponent({
1266
- name: COMPONENT_NAME$1k,
1267
- props: props$18,
1267
+ name: COMPONENT_NAME$1r,
1268
+ props: props$1a,
1268
1269
  setup(props, {
1269
1270
  slots
1270
1271
  }) {
@@ -1278,7 +1279,7 @@ const Carousel = /* @__PURE__ */ vue.defineComponent({
1278
1279
 
1279
1280
  const MCarousel = Carousel;
1280
1281
 
1281
- const props$17 = {
1282
+ const props$19 = {
1282
1283
  tag: {
1283
1284
  type: String,
1284
1285
  default: "div"
@@ -1287,10 +1288,10 @@ const props$17 = {
1287
1288
 
1288
1289
  /** @jsxImportSource vue */
1289
1290
 
1290
- const COMPONENT_NAME$1j = 'vc-cascader';
1291
+ const COMPONENT_NAME$1q = 'vc-cascader';
1291
1292
  const Cascader = /* @__PURE__ */ vue.defineComponent({
1292
- name: COMPONENT_NAME$1j,
1293
- props: props$17,
1293
+ name: COMPONENT_NAME$1q,
1294
+ props: props$19,
1294
1295
  setup(props, {
1295
1296
  slots
1296
1297
  }) {
@@ -1343,22 +1344,25 @@ const EVENTS = [
1343
1344
  "contextmenu"
1344
1345
  ];
1345
1346
 
1346
- const props$16 = {
1347
+ const props$18 = {
1347
1348
  options: Object,
1348
1349
  pluginOptions: Object,
1349
1350
  theme: [String, Object],
1350
1351
  group: String,
1351
- autoResize: Boolean,
1352
+ resize: {
1353
+ type: [Boolean, Number],
1354
+ default: 100
1355
+ },
1352
1356
  watchShallow: Boolean,
1353
1357
  manualUpdate: Boolean
1354
1358
  };
1355
1359
 
1356
1360
  /** @jsxImportSource vue */
1357
1361
 
1358
- const COMPONENT_NAME$1i = 'vc-chart';
1362
+ const COMPONENT_NAME$1p = 'vc-chart';
1359
1363
  const Chart = /* @__PURE__ */ vue.defineComponent({
1360
- name: COMPONENT_NAME$1i,
1361
- props: props$16,
1364
+ name: COMPONENT_NAME$1p,
1365
+ props: props$18,
1362
1366
  emits: [...EVENTS, 'ready'],
1363
1367
  setup(props, {
1364
1368
  emit,
@@ -1381,6 +1385,17 @@ const Chart = /* @__PURE__ */ vue.defineComponent({
1381
1385
  if (!chart.value) return;
1382
1386
  chart.value.setOption(options, notMerge, lazyUpdate);
1383
1387
  };
1388
+ const handleResize = () => {
1389
+ if (lastArea === 0) {
1390
+ // emulate initial render for initially hidden charts
1391
+ mergeOptions({}, true);
1392
+ chart.value.resize();
1393
+ mergeOptions(props.options || manualOptions.value || {}, true);
1394
+ } else {
1395
+ chart.value.resize();
1396
+ }
1397
+ lastArea = getArea();
1398
+ };
1384
1399
  const init = () => {
1385
1400
  if (chart.value || !echartsInstance.value) {
1386
1401
  return;
@@ -1397,20 +1412,10 @@ const Chart = /* @__PURE__ */ vue.defineComponent({
1397
1412
  emit(event, params);
1398
1413
  });
1399
1414
  });
1400
- if (props.autoResize) {
1415
+ if (props.resize !== false) {
1401
1416
  lastArea = getArea();
1402
1417
  resizeHandler && helperResize.Resize.off(instance.vnode.el, resizeHandler);
1403
- resizeHandler = lodashEs.debounce(() => {
1404
- if (lastArea === 0) {
1405
- // emulate initial render for initially hidden charts
1406
- mergeOptions({}, true);
1407
- chart.value.resize();
1408
- mergeOptions(props.options || manualOptions.value || {}, true);
1409
- } else {
1410
- chart.value.resize();
1411
- }
1412
- lastArea = getArea();
1413
- }, 100, {
1418
+ resizeHandler = props.resize === 0 || props.resize === true ? handleResize : lodashEs.debounce(handleResize, props.resize, {
1414
1419
  leading: true
1415
1420
  });
1416
1421
  helperResize.Resize.on(instance.vnode.el, resizeHandler);
@@ -1418,7 +1423,7 @@ const Chart = /* @__PURE__ */ vue.defineComponent({
1418
1423
  };
1419
1424
  const destroy = () => {
1420
1425
  if (!chart.value) return;
1421
- if (props.autoResize) {
1426
+ if (props.resize !== false) {
1422
1427
  resizeHandler && helperResize.Resize.off(instance.vnode.el, resizeHandler);
1423
1428
  resizeHandler = null;
1424
1429
  }
@@ -1444,7 +1449,7 @@ const Chart = /* @__PURE__ */ vue.defineComponent({
1444
1449
  deep: !props.watchShallow
1445
1450
  });
1446
1451
  }
1447
- const watched = ['theme', 'pluginOptions', 'autoResize', 'manualUpdate', 'watchShallow'];
1452
+ const watched = ['theme', 'pluginOptions', 'resize', 'manualUpdate', 'watchShallow'];
1448
1453
  watched.forEach(prop => vue.watch(() => props[prop], refresh, {
1449
1454
  deep: true
1450
1455
  }));
@@ -1472,33 +1477,291 @@ const Chart = /* @__PURE__ */ vue.defineComponent({
1472
1477
 
1473
1478
  const MChart = Chart;
1474
1479
 
1475
- const props$15 = {
1476
- tag: {
1477
- type: String,
1478
- default: "div"
1480
+ const props$17 = {
1481
+ disabled: {
1482
+ type: Boolean,
1483
+ default: false
1484
+ },
1485
+ modelValue: {
1486
+ type: [String, Number, Boolean],
1487
+ default: false
1488
+ },
1489
+ // 当前选项value值
1490
+ value: {
1491
+ type: [String, Number, Boolean],
1492
+ default: void 0
1493
+ },
1494
+ // 当前选项label值
1495
+ label: {
1496
+ type: [String, Number, Boolean],
1497
+ default: void 0
1498
+ },
1499
+ indeterminate: {
1500
+ type: Boolean,
1501
+ default: false
1502
+ },
1503
+ // 原生 `name` 属性
1504
+ name: String,
1505
+ // group模式下无效
1506
+ checkedValue: {
1507
+ type: [String, Number, Boolean],
1508
+ default: true
1509
+ },
1510
+ // group模式下无效
1511
+ uncheckedValue: {
1512
+ type: [String, Number, Boolean],
1513
+ default: false
1479
1514
  }
1480
1515
  };
1481
1516
 
1517
+ const useCheckbox = () => {
1518
+ const { props, emit } = vue.getCurrentInstance();
1519
+ const group = vue.inject("vc-checkbox-group", {});
1520
+ const formItem = vue.inject("vc-form-item", {});
1521
+ const currentValue = vue.ref(void 0);
1522
+ const isFocus = vue.ref(false);
1523
+ const hasGroup = vue.computed(() => {
1524
+ return !!group.props;
1525
+ });
1526
+ const computedValue = vue.computed(() => {
1527
+ return typeof props.value === "undefined" || props.value === "" ? props.label : props.value;
1528
+ });
1529
+ const computedLabel = vue.computed(() => {
1530
+ return typeof props.label === "undefined" || props.label === "" ? props.value : props.label;
1531
+ });
1532
+ const checked = vue.computed(() => {
1533
+ return hasGroup.value ? group.currentValue.value.includes(computedValue.value) : currentValue.value === props.checkedValue;
1534
+ });
1535
+ const classes = vue.computed(() => {
1536
+ return {
1537
+ "is-indeterminate": props.indeterminate,
1538
+ "is-checked": checked.value,
1539
+ "is-disabled": props.disabled,
1540
+ "is-focus": isFocus.value
1541
+ };
1542
+ });
1543
+ vue.watch(
1544
+ () => props.modelValue,
1545
+ (v) => {
1546
+ currentValue.value = v;
1547
+ },
1548
+ { immediate: true }
1549
+ );
1550
+ const reset = ($checked) => {
1551
+ currentValue.value = $checked ? props.checkedValue : props.uncheckedValue;
1552
+ };
1553
+ const sync = (e) => {
1554
+ emit("update:modelValue", currentValue.value, e, reset);
1555
+ emit("change", currentValue.value, e, reset);
1556
+ formItem?.change?.(currentValue.value);
1557
+ };
1558
+ const handleChange = (e) => {
1559
+ if (props.disabled) {
1560
+ return false;
1561
+ }
1562
+ const $checked = e.target.checked;
1563
+ if (hasGroup.value) {
1564
+ group.reset(computedValue.value);
1565
+ group.sync(e);
1566
+ } else {
1567
+ reset($checked);
1568
+ sync(e);
1569
+ }
1570
+ };
1571
+ const handleBlur = () => {
1572
+ isFocus.value = false;
1573
+ };
1574
+ const handleFocus = () => {
1575
+ isFocus.value = true;
1576
+ };
1577
+ return {
1578
+ currentValue,
1579
+ isFocus,
1580
+ classes,
1581
+ hasGroup,
1582
+ checked,
1583
+ handleChange,
1584
+ handleBlur,
1585
+ handleFocus,
1586
+ sync,
1587
+ reset,
1588
+ computedValue,
1589
+ computedLabel
1590
+ };
1591
+ };
1592
+
1482
1593
  /** @jsxImportSource vue */
1483
1594
 
1484
- const COMPONENT_NAME$1h = 'vc-checkbox';
1595
+ const COMPONENT_NAME$1o = 'vc-checkbox';
1485
1596
  const Checkbox = /* @__PURE__ */ vue.defineComponent({
1486
- name: COMPONENT_NAME$1h,
1487
- props: props$15,
1597
+ name: COMPONENT_NAME$1o,
1598
+ props: props$17,
1599
+ emits: ['update:modelValue', 'change'],
1488
1600
  setup(props, {
1489
1601
  slots
1490
1602
  }) {
1603
+ const {
1604
+ checked,
1605
+ classes,
1606
+ computedLabel,
1607
+ handleChange,
1608
+ handleFocus,
1609
+ handleBlur
1610
+ } = useCheckbox();
1491
1611
  return () => {
1612
+ return vue.createVNode("label", {
1613
+ "class": [classes.value, 'vc-checkbox']
1614
+ }, [vue.createVNode("span", {
1615
+ "class": [{
1616
+ 'has-sibling': !!(computedLabel.value || slots.default)
1617
+ }, 'vc-checkbox__wrapper']
1618
+ }, [vue.createVNode("span", {
1619
+ "class": "vc-checkbox__border"
1620
+ }, [vue.createVNode("span", {
1621
+ "class": "vc-checkbox__inner"
1622
+ }, null)]), vue.createVNode("input", {
1623
+ "checked": checked.value,
1624
+ "name": props.name,
1625
+ "disabled": props.disabled,
1626
+ "type": "checkbox",
1627
+ "onChange": handleChange,
1628
+ "onFocus": handleFocus,
1629
+ "onBlur": handleBlur
1630
+ }, null)]), slots.default ? slots.default() : computedLabel.value && vue.createVNode("span", null, [computedLabel.value])]);
1631
+ };
1632
+ }
1633
+ });
1634
+
1635
+ const props$16 = {
1636
+ modelValue: {
1637
+ type: Array,
1638
+ default: () => []
1639
+ },
1640
+ fragment: {
1641
+ type: Boolean,
1642
+ default: false
1643
+ }
1644
+ };
1645
+
1646
+ const useCheckboxGroup = () => {
1647
+ const { props, emit } = vue.getCurrentInstance();
1648
+ const formItem = vue.inject("vc-form-item", {});
1649
+ const currentValue = vue.ref([]);
1650
+ vue.watch(
1651
+ () => props.modelValue,
1652
+ (v) => {
1653
+ if (lodash.isEqualWith(v, currentValue.value)) {
1654
+ return;
1655
+ }
1656
+ currentValue.value = v;
1657
+ },
1658
+ { immediate: true }
1659
+ );
1660
+ const reset = (v) => {
1661
+ const index = currentValue.value.findIndex((i) => i == v);
1662
+ index == -1 ? currentValue.value.push(v) : currentValue.value.splice(index, 1);
1663
+ };
1664
+ const sync = (e) => {
1665
+ emit("update:modelValue", currentValue.value, e, reset);
1666
+ emit("change", currentValue.value, e, reset);
1667
+ formItem?.change?.(currentValue.value);
1668
+ };
1669
+ vue.provide("vc-checkbox-group", {
1670
+ props,
1671
+ currentValue,
1672
+ reset,
1673
+ sync
1674
+ });
1675
+ return {
1676
+ currentValue,
1677
+ sync,
1678
+ reset
1679
+ };
1680
+ };
1681
+
1682
+ /** @jsxImportSource vue */
1683
+
1684
+ const COMPONENT_NAME$1n = 'vc-checkbox-group';
1685
+ const CheckboxGroup = /* @__PURE__ */ vue.defineComponent({
1686
+ name: COMPONENT_NAME$1n,
1687
+ props: props$16,
1688
+ emits: ['update:modelValue', 'change'],
1689
+ setup(props, {
1690
+ slots
1691
+ }) {
1692
+ useCheckboxGroup();
1693
+ return () => {
1694
+ if (props.fragment) return slots.default?.();
1492
1695
  return vue.createVNode("div", {
1493
- "class": "vc-checkbox"
1696
+ "class": "vc-checkbox-group"
1494
1697
  }, [slots?.default?.()]);
1495
1698
  };
1496
1699
  }
1497
1700
  });
1498
1701
 
1499
- const MCheckbox = Checkbox;
1702
+ /** @jsxImportSource vue */
1500
1703
 
1501
- const props$14 = {
1704
+ const COMPONENT_NAME$1m = 'vcm-checkbox';
1705
+ const MCheckbox = /* @__PURE__ */ vue.defineComponent({
1706
+ name: COMPONENT_NAME$1m,
1707
+ props: props$17,
1708
+ emits: ['update:modelValue', 'change'],
1709
+ setup(props, {
1710
+ slots
1711
+ }) {
1712
+ const {
1713
+ checked,
1714
+ classes,
1715
+ computedLabel,
1716
+ handleChange,
1717
+ handleFocus,
1718
+ handleBlur
1719
+ } = useCheckbox();
1720
+ return () => {
1721
+ return vue.createVNode("label", {
1722
+ "class": [classes.value, 'vcm-checkbox']
1723
+ }, [vue.createVNode("span", {
1724
+ "class": [{
1725
+ 'has-sibling': !!(computedLabel.value || slots.default)
1726
+ }, 'vcm-checkbox__wrapper']
1727
+ }, [vue.createVNode("span", {
1728
+ "class": "vcm-checkbox__border"
1729
+ }, [vue.createVNode("span", {
1730
+ "class": "vcm-checkbox__inner"
1731
+ }, null)]), vue.createVNode("input", {
1732
+ "checked": checked.value,
1733
+ "name": props.name,
1734
+ "disabled": props.disabled,
1735
+ "type": "checkbox",
1736
+ "onChange": handleChange,
1737
+ "onFocus": handleFocus,
1738
+ "onBlur": handleBlur
1739
+ }, null)]), slots.default ? slots.default() : computedLabel.value && vue.createVNode("span", null, [computedLabel.value])]);
1740
+ };
1741
+ }
1742
+ });
1743
+
1744
+ /** @jsxImportSource vue */
1745
+
1746
+ const COMPONENT_NAME$1l = 'vcm-checkbox-group';
1747
+ const MCheckboxGroup = /* @__PURE__ */ vue.defineComponent({
1748
+ name: COMPONENT_NAME$1l,
1749
+ props: props$16,
1750
+ emits: ['update:modelValue', 'change'],
1751
+ setup(props, {
1752
+ slots
1753
+ }) {
1754
+ useCheckboxGroup();
1755
+ return () => {
1756
+ if (props.fragment) return slots.default?.();
1757
+ return vue.createVNode("div", {
1758
+ "class": "vcm-checkbox-group"
1759
+ }, [slots?.default?.()]);
1760
+ };
1761
+ }
1762
+ });
1763
+
1764
+ const props$15 = {
1502
1765
  tag: {
1503
1766
  type: String,
1504
1767
  default: "div"
@@ -1507,10 +1770,10 @@ const props$14 = {
1507
1770
 
1508
1771
  /** @jsxImportSource vue */
1509
1772
 
1510
- const COMPONENT_NAME$1g = 'vc-clipboard';
1773
+ const COMPONENT_NAME$1k = 'vc-clipboard';
1511
1774
  const Clipboard = /* @__PURE__ */ vue.defineComponent({
1512
- name: COMPONENT_NAME$1g,
1513
- props: props$14,
1775
+ name: COMPONENT_NAME$1k,
1776
+ props: props$15,
1514
1777
  setup(props, {
1515
1778
  slots
1516
1779
  }) {
@@ -1524,7 +1787,7 @@ const Clipboard = /* @__PURE__ */ vue.defineComponent({
1524
1787
 
1525
1788
  const MClipboard = Clipboard;
1526
1789
 
1527
- const props$13 = {
1790
+ const props$14 = {
1528
1791
  tag: {
1529
1792
  type: String,
1530
1793
  default: "div"
@@ -1547,10 +1810,10 @@ const props$13 = {
1547
1810
  }
1548
1811
  };
1549
1812
 
1550
- const COMPONENT_NAME$1f = "vc-collapse";
1813
+ const COMPONENT_NAME$1j = "vc-collapse";
1551
1814
  const Collapse = vue.defineComponent({
1552
- name: COMPONENT_NAME$1f,
1553
- props: props$13,
1815
+ name: COMPONENT_NAME$1j,
1816
+ props: props$14,
1554
1817
  emits: ["update:moodelValue", "change"],
1555
1818
  setup(props, { slots, emit }) {
1556
1819
  const instance = vue.getCurrentInstance();
@@ -1635,7 +1898,7 @@ const Collapse = vue.defineComponent({
1635
1898
  }
1636
1899
  });
1637
1900
 
1638
- const props$12 = {
1901
+ const props$13 = {
1639
1902
  tag: {
1640
1903
  type: String,
1641
1904
  default: "div"
@@ -1645,7 +1908,7 @@ const props$12 = {
1645
1908
  }
1646
1909
  };
1647
1910
 
1648
- const props$11 = {
1911
+ const props$12 = {
1649
1912
  tag: {
1650
1913
  type: String,
1651
1914
  default: "div"
@@ -1663,13 +1926,13 @@ const props$11 = {
1663
1926
 
1664
1927
  /** @jsxImportSource vue */
1665
1928
 
1666
- function _isSlot$2(s) {
1929
+ function _isSlot$1(s) {
1667
1930
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
1668
1931
  }
1669
- const COMPONENT_NAME$1e = 'vc-expand';
1932
+ const COMPONENT_NAME$1i = 'vc-expand';
1670
1933
  const Expand = /* @__PURE__ */ vue.defineComponent({
1671
- name: COMPONENT_NAME$1e,
1672
- props: props$11,
1934
+ name: COMPONENT_NAME$1i,
1935
+ props: props$12,
1673
1936
  setup(props, {
1674
1937
  slots
1675
1938
  }) {
@@ -1687,7 +1950,7 @@ const Expand = /* @__PURE__ */ vue.defineComponent({
1687
1950
  enter: 200,
1688
1951
  leave: 200
1689
1952
  }
1690
- }, _isSlot$2(_slot = vue.withDirectives(vue.createVNode(Content, null, {
1953
+ }, _isSlot$1(_slot = vue.withDirectives(vue.createVNode(Content, null, {
1691
1954
  default: () => [(props.alive || !props.alive && isActive.value) && slots.default?.()]
1692
1955
  }), [[vue.vShow, isActive.value]])) ? _slot : {
1693
1956
  default: () => [_slot]
@@ -1698,10 +1961,10 @@ const Expand = /* @__PURE__ */ vue.defineComponent({
1698
1961
 
1699
1962
  /** @jsxImportSource vue */
1700
1963
 
1701
- const COMPONENT_NAME$1d = 'vc-collapse-item';
1964
+ const COMPONENT_NAME$1h = 'vc-collapse-item';
1702
1965
  const CollapseItem = /* @__PURE__ */ vue.defineComponent({
1703
- name: COMPONENT_NAME$1d,
1704
- props: props$12,
1966
+ name: COMPONENT_NAME$1h,
1967
+ props: props$13,
1705
1968
  setup(props, {
1706
1969
  slots,
1707
1970
  expose
@@ -1766,7 +2029,7 @@ const CollapseItem = /* @__PURE__ */ vue.defineComponent({
1766
2029
  const MCollapse = Collapse;
1767
2030
  const MCollapseItem = CollapseItem;
1768
2031
 
1769
- const props$10 = {
2032
+ const props$11 = {
1770
2033
  tag: {
1771
2034
  type: String,
1772
2035
  default: "div"
@@ -1775,10 +2038,10 @@ const props$10 = {
1775
2038
 
1776
2039
  /** @jsxImportSource vue */
1777
2040
 
1778
- const COMPONENT_NAME$1c = 'vc-color-picker';
2041
+ const COMPONENT_NAME$1g = 'vc-color-picker';
1779
2042
  const ColorPicker = /* @__PURE__ */ vue.defineComponent({
1780
- name: COMPONENT_NAME$1c,
1781
- props: props$10,
2043
+ name: COMPONENT_NAME$1g,
2044
+ props: props$11,
1782
2045
  setup(props, {
1783
2046
  slots
1784
2047
  }) {
@@ -1792,7 +2055,7 @@ const ColorPicker = /* @__PURE__ */ vue.defineComponent({
1792
2055
 
1793
2056
  const MColorPicker = ColorPicker;
1794
2057
 
1795
- const props$$ = {
2058
+ const props$10 = {
1796
2059
  tag: {
1797
2060
  type: String,
1798
2061
  default: "div"
@@ -1801,10 +2064,10 @@ const props$$ = {
1801
2064
 
1802
2065
  /** @jsxImportSource vue */
1803
2066
 
1804
- const COMPONENT_NAME$1b = 'vc-countdown';
2067
+ const COMPONENT_NAME$1f = 'vc-countdown';
1805
2068
  const Countdown = /* @__PURE__ */ vue.defineComponent({
1806
- name: COMPONENT_NAME$1b,
1807
- props: props$$,
2069
+ name: COMPONENT_NAME$1f,
2070
+ props: props$10,
1808
2071
  setup(props, {
1809
2072
  slots
1810
2073
  }) {
@@ -1818,17 +2081,17 @@ const Countdown = /* @__PURE__ */ vue.defineComponent({
1818
2081
 
1819
2082
  const MCountdown = Countdown;
1820
2083
 
1821
- const props$_ = {
2084
+ const props$$ = {
1822
2085
  render: {
1823
2086
  type: Function,
1824
2087
  default: () => null
1825
2088
  }
1826
2089
  };
1827
2090
 
1828
- const COMPONENT_NAME$1a = "vc-customer";
2091
+ const COMPONENT_NAME$1e = "vc-customer";
1829
2092
  const Customer = vue.defineComponent({
1830
- name: COMPONENT_NAME$1a,
1831
- props: props$_,
2093
+ name: COMPONENT_NAME$1e,
2094
+ props: props$$,
1832
2095
  setup(props, context) {
1833
2096
  return () => vue.h(() => {
1834
2097
  return props.render(context.attrs, context);
@@ -1838,7 +2101,7 @@ const Customer = vue.defineComponent({
1838
2101
 
1839
2102
  const MCustomer = Customer;
1840
2103
 
1841
- const props$Z = {
2104
+ const props$_ = {
1842
2105
  tag: {
1843
2106
  type: String,
1844
2107
  default: "div"
@@ -1847,10 +2110,10 @@ const props$Z = {
1847
2110
 
1848
2111
  /** @jsxImportSource vue */
1849
2112
 
1850
- const COMPONENT_NAME$19 = 'vc-date-picker';
2113
+ const COMPONENT_NAME$1d = 'vc-date-picker';
1851
2114
  const DatePicker = /* @__PURE__ */ vue.defineComponent({
1852
- name: COMPONENT_NAME$19,
1853
- props: props$Z,
2115
+ name: COMPONENT_NAME$1d,
2116
+ props: props$_,
1854
2117
  setup(props, {
1855
2118
  slots
1856
2119
  }) {
@@ -1864,7 +2127,7 @@ const DatePicker = /* @__PURE__ */ vue.defineComponent({
1864
2127
 
1865
2128
  const MDatePicker = DatePicker;
1866
2129
 
1867
- const props$Y = {
2130
+ const props$Z = {
1868
2131
  tag: {
1869
2132
  type: String,
1870
2133
  default: "div"
@@ -1873,10 +2136,10 @@ const props$Y = {
1873
2136
 
1874
2137
  /** @jsxImportSource vue */
1875
2138
 
1876
- const COMPONENT_NAME$18 = 'vc-divider';
2139
+ const COMPONENT_NAME$1c = 'vc-divider';
1877
2140
  const Divider = /* @__PURE__ */ vue.defineComponent({
1878
- name: COMPONENT_NAME$18,
1879
- props: props$Y,
2141
+ name: COMPONENT_NAME$1c,
2142
+ props: props$Z,
1880
2143
  setup(props, {
1881
2144
  slots
1882
2145
  }) {
@@ -1941,7 +2204,7 @@ class PortalLeaf {
1941
2204
  }
1942
2205
  }
1943
2206
 
1944
- const COMPONENT_NAME$17 = "vc-portal";
2207
+ const COMPONENT_NAME$1b = "vc-portal";
1945
2208
  class Portal {
1946
2209
  /**
1947
2210
  * 清理Portals类型组件
@@ -1993,7 +2256,7 @@ class Portal {
1993
2256
  this.wrapper = wrapper;
1994
2257
  this.globalOptions = {
1995
2258
  ...options,
1996
- name: options?.name || wrapper.name || Utils__namespace.getUid(COMPONENT_NAME$17)
2259
+ name: options?.name || wrapper.name || Utils__namespace.getUid(COMPONENT_NAME$1b)
1997
2260
  };
1998
2261
  }
1999
2262
  popup(propsData, options) {
@@ -2092,7 +2355,7 @@ class Portal {
2092
2355
  ...rest
2093
2356
  } = options;
2094
2357
  let useAllNodes = fragment;
2095
- const name = multiple ? `${name$}__${Utils__namespace.getUid(COMPONENT_NAME$17)}` : name$;
2358
+ const name = multiple ? `${name$}__${Utils__namespace.getUid(COMPONENT_NAME$1b)}` : name$;
2096
2359
  const container = document.createElement(tag);
2097
2360
  const root = typeof el === "object" ? el : document.querySelector(el || "body");
2098
2361
  !alive && Portal.leafs.get(name)?.destroy();
@@ -2126,7 +2389,7 @@ class Portal {
2126
2389
  } else {
2127
2390
  const wrapper = this.wrapper;
2128
2391
  const app = vue.createApp({
2129
- name: COMPONENT_NAME$17,
2392
+ name: COMPONENT_NAME$1b,
2130
2393
  parent,
2131
2394
  setup() {
2132
2395
  if (alive) {
@@ -2231,21 +2494,21 @@ class Portal {
2231
2494
  }
2232
2495
  }
2233
2496
 
2234
- const props$X = {
2497
+ const props$Y = {
2235
2498
  tag: {
2236
2499
  type: String,
2237
2500
  default: "div"
2238
2501
  }
2239
2502
  };
2240
2503
 
2241
- const COMPONENT_NAME$16 = 'vc-portal-view';
2504
+ const COMPONENT_NAME$1a = 'vc-portal-view';
2242
2505
 
2243
2506
  /**
2244
2507
  * 写法不同,但与vue@2.x 保持一致
2245
2508
  */
2246
2509
  const PortalView = /* @__PURE__ */ vue.defineComponent({
2247
- name: COMPONENT_NAME$16,
2248
- props: props$X,
2510
+ name: COMPONENT_NAME$1a,
2511
+ props: props$Y,
2249
2512
  setup(props, {
2250
2513
  slots
2251
2514
  }) {
@@ -2262,7 +2525,7 @@ const PortalView = /* @__PURE__ */ vue.defineComponent({
2262
2525
  }
2263
2526
  });
2264
2527
 
2265
- const props$W = {
2528
+ const props$X = {
2266
2529
  title: String,
2267
2530
  content: {
2268
2531
  type: [String, Function],
@@ -2330,13 +2593,10 @@ const props$W = {
2330
2593
 
2331
2594
  /** @jsxImportSource vue */
2332
2595
 
2333
- function _isSlot$1(s) {
2334
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
2335
- }
2336
- const COMPONENT_NAME$15 = 'vc-drawer';
2596
+ const COMPONENT_NAME$19 = 'vc-drawer';
2337
2597
  const DrawerView = /* @__PURE__ */ vue.defineComponent({
2338
- name: COMPONENT_NAME$15,
2339
- props: props$W,
2598
+ name: COMPONENT_NAME$19,
2599
+ props: props$X,
2340
2600
  emits: ['close', 'update:modelValue', 'visible-change'],
2341
2601
  setup(props, {
2342
2602
  emit,
@@ -2417,57 +2677,58 @@ const DrawerView = /* @__PURE__ */ vue.defineComponent({
2417
2677
  }
2418
2678
  });
2419
2679
  return () => {
2420
- let _slot, _slot2;
2421
2680
  return vue.createVNode("div", {
2422
2681
  "class": [classes.value, 'vc-drawer']
2423
2682
  }, [vue.createVNode(TransitionFade, {
2424
2683
  "delay": 50
2425
- }, _isSlot$1(_slot = vue.withDirectives(vue.createVNode("div", {
2426
- "style": props.maskStyle,
2427
- "class": "vc-drawer__mask",
2428
- "onClick": e => handleClose(e, props.maskClosable)
2429
- }, null), [[vue.vShow, props.mask && isActive.value]])) ? _slot : {
2430
- default: () => [_slot]
2684
+ }, {
2685
+ default: () => [vue.withDirectives(vue.createVNode("div", {
2686
+ "style": props.maskStyle,
2687
+ "class": "vc-drawer__mask",
2688
+ "onClick": e => handleClose(e, props.maskClosable)
2689
+ }, null), [[vue.vShow, props.mask && isActive.value]])]
2431
2690
  }), vue.createVNode(TransitionSlide, {
2432
2691
  "mode": props.placement,
2433
2692
  "onAfterLeave": handleRemove
2434
- }, _isSlot$1(_slot2 = vue.withDirectives(vue.createVNode("div", {
2435
- "class": [props.wrapperClass, 'vc-drawer__wrapper'],
2436
- "style": [style.value, props.wrapperStyle]
2437
- }, [vue.createVNode("div", {
2438
- "class": "vc-drawer__container"
2439
- }, [vue.createVNode("div", {
2440
- "class": "vc-drawer__header"
2441
- }, [slots.header ? slots.header() : typeof props.title === 'string' ? vue.createVNode("div", {
2442
- "class": "vc-drawer__title",
2443
- "innerHTML": props.title
2444
- }, null) : typeof props.title === 'function' && vue.createVNode(Customer, {
2445
- "render": props.title
2446
- }, null), vue.createVNode("a", {
2447
- "class": "vc-drawer__close",
2448
- "onClick": e => handleClose(e, true)
2449
- }, [vue.createVNode(Icon, {
2450
- "type": "close"
2451
- }, null)])]), vue.createVNode("div", {
2452
- "class": ['vc-drawer__content']
2453
- }, [typeof props.content === 'string' ? vue.createVNode("div", {
2454
- "innerHTML": props.content
2455
- }, null) : typeof props.content === 'function' ? vue.createVNode(Customer, {
2456
- "render": props.content
2457
- }, null) : null, slots.default?.()]), props.footer && (props.cancelText || props.okText) && vue.createVNode("div", {
2458
- "class": ['vc-drawer__footer']
2459
- }, [slots['footer-extra']?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props.cancelText && vue.createVNode(Button, {
2460
- "style": "margin-right: 8px;",
2461
- "onClick": e => handleBefore(e, handleCancel)
2462
- }, {
2463
- default: () => [props.cancelText]
2464
- }), props.okText && vue.createVNode(Button, {
2465
- "type": "primary",
2466
- "onClick": e => handleBefore(e, handleOk)
2467
2693
  }, {
2468
- default: () => [props.okText]
2469
- })]) : slots.footer?.()])])]), [[vue.vShow, isActive.value]])) ? _slot2 : {
2470
- default: () => [_slot2]
2694
+ default: () => [vue.withDirectives(vue.createVNode("div", {
2695
+ "class": [props.wrapperClass, 'vc-drawer__wrapper'],
2696
+ "style": [style.value, props.wrapperStyle]
2697
+ }, [vue.createVNode("div", {
2698
+ "class": [{
2699
+ 'is-no-footer': !props.footer || !props.cancelText && !props.okText
2700
+ }, 'vc-drawer__container']
2701
+ }, [vue.createVNode("div", {
2702
+ "class": "vc-drawer__header"
2703
+ }, [slots.header ? slots.header() : typeof props.title === 'string' ? vue.createVNode("div", {
2704
+ "class": "vc-drawer__title",
2705
+ "innerHTML": props.title
2706
+ }, null) : typeof props.title === 'function' && vue.createVNode(Customer, {
2707
+ "render": props.title
2708
+ }, null), vue.createVNode("a", {
2709
+ "class": "vc-drawer__close",
2710
+ "onClick": e => handleClose(e, true)
2711
+ }, [vue.createVNode(Icon, {
2712
+ "type": "close"
2713
+ }, null)])]), vue.createVNode("div", {
2714
+ "class": ['vc-drawer__content']
2715
+ }, [typeof props.content === 'string' ? vue.createVNode("div", {
2716
+ "innerHTML": props.content
2717
+ }, null) : typeof props.content === 'function' ? vue.createVNode(Customer, {
2718
+ "render": props.content
2719
+ }, null) : null, slots.default?.()]), props.footer && (props.cancelText || props.okText) && vue.createVNode("div", {
2720
+ "class": ['vc-drawer__footer']
2721
+ }, [slots['footer-extra']?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props.cancelText && vue.createVNode(Button, {
2722
+ "style": "margin-right: 8px;",
2723
+ "onClick": e => handleBefore(e, handleCancel)
2724
+ }, {
2725
+ default: () => [props.cancelText]
2726
+ }), props.okText && vue.createVNode(Button, {
2727
+ "type": "primary",
2728
+ "onClick": e => handleBefore(e, handleOk)
2729
+ }, {
2730
+ default: () => [props.okText]
2731
+ })]) : slots.footer?.()])])]), [[vue.vShow, isActive.value]])]
2471
2732
  })]);
2472
2733
  };
2473
2734
  }
@@ -2497,7 +2758,7 @@ const drawer = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2497
2758
 
2498
2759
  const MDrawerView = DrawerView;
2499
2760
 
2500
- const props$V = {
2761
+ const props$W = {
2501
2762
  tag: {
2502
2763
  type: String,
2503
2764
  default: "div"
@@ -2506,10 +2767,10 @@ const props$V = {
2506
2767
 
2507
2768
  /** @jsxImportSource vue */
2508
2769
 
2509
- const COMPONENT_NAME$14 = 'vc-dropdown';
2770
+ const COMPONENT_NAME$18 = 'vc-dropdown';
2510
2771
  const Dropdown = /* @__PURE__ */ vue.defineComponent({
2511
- name: COMPONENT_NAME$14,
2512
- props: props$V,
2772
+ name: COMPONENT_NAME$18,
2773
+ props: props$W,
2513
2774
  setup(props, {
2514
2775
  slots
2515
2776
  }) {
@@ -2523,7 +2784,7 @@ const Dropdown = /* @__PURE__ */ vue.defineComponent({
2523
2784
 
2524
2785
  const MDropdown = Dropdown;
2525
2786
 
2526
- const props$U = {
2787
+ const props$V = {
2527
2788
  tag: {
2528
2789
  type: String,
2529
2790
  default: "div"
@@ -2532,10 +2793,10 @@ const props$U = {
2532
2793
 
2533
2794
  /** @jsxImportSource vue */
2534
2795
 
2535
- const COMPONENT_NAME$13 = 'vc-editor';
2796
+ const COMPONENT_NAME$17 = 'vc-editor';
2536
2797
  const Editor = /* @__PURE__ */ vue.defineComponent({
2537
- name: COMPONENT_NAME$13,
2538
- props: props$U,
2798
+ name: COMPONENT_NAME$17,
2799
+ props: props$V,
2539
2800
  setup(props, {
2540
2801
  slots
2541
2802
  }) {
@@ -2551,7 +2812,7 @@ const MEditor = Editor;
2551
2812
 
2552
2813
  const MExpand = Expand;
2553
2814
 
2554
- const props$T = {
2815
+ const props$U = {
2555
2816
  tag: {
2556
2817
  type: String,
2557
2818
  default: "form"
@@ -2678,10 +2939,10 @@ const useForm = (expose, options = {}) => {
2678
2939
  });
2679
2940
  };
2680
2941
 
2681
- const COMPONENT_NAME$12 = "vc-form";
2942
+ const COMPONENT_NAME$16 = "vc-form";
2682
2943
  const Form = vue.defineComponent({
2683
- name: COMPONENT_NAME$12,
2684
- props: props$T,
2944
+ name: COMPONENT_NAME$16,
2945
+ props: props$U,
2685
2946
  setup(props, { slots, expose }) {
2686
2947
  useForm(expose);
2687
2948
  return () => {
@@ -2697,7 +2958,7 @@ const Form = vue.defineComponent({
2697
2958
  }
2698
2959
  });
2699
2960
 
2700
- const props$S = {
2961
+ const props$T = {
2701
2962
  label: {
2702
2963
  type: String,
2703
2964
  default: ""
@@ -3000,10 +3261,10 @@ const useFormItem = (expose) => {
3000
3261
 
3001
3262
  /** @jsxImportSource vue */
3002
3263
 
3003
- const COMPONENT_NAME$11 = 'vc-form-item';
3264
+ const COMPONENT_NAME$15 = 'vc-form-item';
3004
3265
  const FormItem = /* @__PURE__ */ vue.defineComponent({
3005
- name: COMPONENT_NAME$11,
3006
- props: props$S,
3266
+ name: COMPONENT_NAME$15,
3267
+ props: props$T,
3007
3268
  setup(props, {
3008
3269
  slots,
3009
3270
  expose
@@ -3055,8 +3316,8 @@ const FormItem = /* @__PURE__ */ vue.defineComponent({
3055
3316
  }
3056
3317
  });
3057
3318
 
3058
- const props$R = {
3059
- ...props$T,
3319
+ const props$S = {
3320
+ ...props$U,
3060
3321
  showToast: {
3061
3322
  type: Boolean,
3062
3323
  default: false
@@ -3067,7 +3328,7 @@ const props$R = {
3067
3328
  }
3068
3329
  };
3069
3330
 
3070
- const props$Q = {
3331
+ const props$R = {
3071
3332
  content: [String, Function],
3072
3333
  maskClosable: {
3073
3334
  type: Boolean,
@@ -3096,11 +3357,11 @@ const MTransitionZoom = TransitionZoom;
3096
3357
 
3097
3358
  /** @jsxImportSource vue */
3098
3359
 
3099
- const COMPONENT_NAME$10 = 'vcm-toast';
3360
+ const COMPONENT_NAME$14 = 'vcm-toast';
3100
3361
  const MToastView = /* @__PURE__ */ vue.defineComponent({
3101
- name: COMPONENT_NAME$10,
3362
+ name: COMPONENT_NAME$14,
3102
3363
  emits: ['close', 'portal-fulfilled'],
3103
- props: props$Q,
3364
+ props: props$R,
3104
3365
  setup(props, {
3105
3366
  emit,
3106
3367
  expose
@@ -3209,10 +3470,10 @@ const MToast$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
3209
3470
  warning: warning$3
3210
3471
  }, Symbol.toStringTag, { value: 'Module' }));
3211
3472
 
3212
- const COMPONENT_NAME$$ = "vcm-form";
3473
+ const COMPONENT_NAME$13 = "vcm-form";
3213
3474
  const MForm = vue.defineComponent({
3214
- name: COMPONENT_NAME$$,
3215
- props: props$R,
3475
+ name: COMPONENT_NAME$13,
3476
+ props: props$S,
3216
3477
  setup(props, { slots, expose }) {
3217
3478
  useForm(expose, {
3218
3479
  throwToast(message) {
@@ -3232,8 +3493,8 @@ const MForm = vue.defineComponent({
3232
3493
  }
3233
3494
  });
3234
3495
 
3235
- const props$P = {
3236
- ...props$S,
3496
+ const props$Q = {
3497
+ ...props$T,
3237
3498
  indent: {
3238
3499
  type: Number,
3239
3500
  default: 12
@@ -3242,10 +3503,10 @@ const props$P = {
3242
3503
 
3243
3504
  /** @jsxImportSource vue */
3244
3505
 
3245
- const COMPONENT_NAME$_ = 'vcm-form-item';
3506
+ const COMPONENT_NAME$12 = 'vcm-form-item';
3246
3507
  const MFormItem = /* @__PURE__ */ vue.defineComponent({
3247
- name: COMPONENT_NAME$_,
3248
- props: props$P,
3508
+ name: COMPONENT_NAME$12,
3509
+ props: props$Q,
3249
3510
  setup(props, {
3250
3511
  slots,
3251
3512
  expose
@@ -3298,9 +3559,9 @@ const MFormItem = /* @__PURE__ */ vue.defineComponent({
3298
3559
  }
3299
3560
  });
3300
3561
 
3301
- const COMPONENT_NAME$Z = "vc-fragment";
3562
+ const COMPONENT_NAME$11 = "vc-fragment";
3302
3563
  const Fragment = vue.defineComponent({
3303
- name: COMPONENT_NAME$Z,
3564
+ name: COMPONENT_NAME$11,
3304
3565
  setup(_, { slots }) {
3305
3566
  return () => vue.h(vue.Fragment, slots.default?.());
3306
3567
  }
@@ -3308,7 +3569,7 @@ const Fragment = vue.defineComponent({
3308
3569
 
3309
3570
  const MFragment = Fragment;
3310
3571
 
3311
- const props$O = {
3572
+ const props$P = {
3312
3573
  tag: {
3313
3574
  type: String,
3314
3575
  default: "div"
@@ -3317,10 +3578,10 @@ const props$O = {
3317
3578
 
3318
3579
  /** @jsxImportSource vue */
3319
3580
 
3320
- const COMPONENT_NAME$Y = 'vc-html-to-image';
3581
+ const COMPONENT_NAME$10 = 'vc-html-to-image';
3321
3582
  const HTMLToImage = /* @__PURE__ */ vue.defineComponent({
3322
- name: COMPONENT_NAME$Y,
3323
- props: props$O,
3583
+ name: COMPONENT_NAME$10,
3584
+ props: props$P,
3324
3585
  setup(props, {
3325
3586
  slots
3326
3587
  }) {
@@ -3336,7 +3597,7 @@ const MHTMLToImage = HTMLToImage;
3336
3597
 
3337
3598
  const MIcon = Icon;
3338
3599
 
3339
- const props$N = {
3600
+ const props$O = {
3340
3601
  src: String,
3341
3602
  fit: String,
3342
3603
  lazy: Boolean,
@@ -3395,7 +3656,7 @@ const IMGStore$1 = new IMGStore();
3395
3656
 
3396
3657
  /** @jsxImportSource vue */
3397
3658
 
3398
- const COMPONENT_NAME$X = 'vc-image';
3659
+ const COMPONENT_NAME$$ = 'vc-image';
3399
3660
  let isSupportObjectFit = false;
3400
3661
  window.addEventListener('DOMContentLoaded', () => {
3401
3662
  isSupportObjectFit = !vcShared.IS_SERVER && document.documentElement.style.objectFit !== undefined;
@@ -3408,9 +3669,9 @@ const ObjectFit = {
3408
3669
  SCALE_DOWN: 'scale-down'
3409
3670
  };
3410
3671
  const Image = /* @__PURE__ */ vue.defineComponent({
3411
- name: COMPONENT_NAME$X,
3672
+ name: COMPONENT_NAME$$,
3412
3673
  inheritAttrs: false,
3413
- props: props$N,
3674
+ props: props$O,
3414
3675
  setup(props, {
3415
3676
  slots,
3416
3677
  emit
@@ -3604,7 +3865,7 @@ const Image = /* @__PURE__ */ vue.defineComponent({
3604
3865
 
3605
3866
  const MImage = Image;
3606
3867
 
3607
- const props$M = {
3868
+ const props$N = {
3608
3869
  tag: {
3609
3870
  type: String,
3610
3871
  default: "div"
@@ -3613,10 +3874,10 @@ const props$M = {
3613
3874
 
3614
3875
  /** @jsxImportSource vue */
3615
3876
 
3616
- const COMPONENT_NAME$W = 'vc-image-crop';
3877
+ const COMPONENT_NAME$_ = 'vc-image-crop';
3617
3878
  const ImageCrop = /* @__PURE__ */ vue.defineComponent({
3618
- name: COMPONENT_NAME$W,
3619
- props: props$M,
3879
+ name: COMPONENT_NAME$_,
3880
+ props: props$N,
3620
3881
  setup(props, {
3621
3882
  slots
3622
3883
  }) {
@@ -3630,7 +3891,7 @@ const ImageCrop = /* @__PURE__ */ vue.defineComponent({
3630
3891
 
3631
3892
  const MImageCrop = ImageCrop;
3632
3893
 
3633
- const props$L = {
3894
+ const props$M = {
3634
3895
  tag: {
3635
3896
  type: String,
3636
3897
  default: "div"
@@ -3639,10 +3900,10 @@ const props$L = {
3639
3900
 
3640
3901
  /** @jsxImportSource vue */
3641
3902
 
3642
- const COMPONENT_NAME$V = 'vc-image-preview';
3903
+ const COMPONENT_NAME$Z = 'vc-image-preview';
3643
3904
  const ImagePreview = /* @__PURE__ */ vue.defineComponent({
3644
- name: COMPONENT_NAME$V,
3645
- props: props$L,
3905
+ name: COMPONENT_NAME$Z,
3906
+ props: props$M,
3646
3907
  setup(props, {
3647
3908
  slots
3648
3909
  }) {
@@ -3656,7 +3917,7 @@ const ImagePreview = /* @__PURE__ */ vue.defineComponent({
3656
3917
 
3657
3918
  const MImagePreview = ImagePreview;
3658
3919
 
3659
- const props$K = {
3920
+ const props$L = {
3660
3921
  tag: {
3661
3922
  type: String,
3662
3923
  default: "div"
@@ -3665,10 +3926,10 @@ const props$K = {
3665
3926
 
3666
3927
  /** @jsxImportSource vue */
3667
3928
 
3668
- const COMPONENT_NAME$U = 'vc-image-processing';
3929
+ const COMPONENT_NAME$Y = 'vc-image-processing';
3669
3930
  const ImageProcessing = /* @__PURE__ */ vue.defineComponent({
3670
- name: COMPONENT_NAME$U,
3671
- props: props$K,
3931
+ name: COMPONENT_NAME$Y,
3932
+ props: props$L,
3672
3933
  setup(props, {
3673
3934
  slots
3674
3935
  }) {
@@ -3682,7 +3943,7 @@ const ImageProcessing = /* @__PURE__ */ vue.defineComponent({
3682
3943
 
3683
3944
  const MImageProcessing = ImageProcessing;
3684
3945
 
3685
- const props$J = {
3946
+ const props$K = {
3686
3947
  // Array, 作为select等数组存放临时值
3687
3948
  modelValue: {
3688
3949
  type: [String, Number, Array],
@@ -3936,12 +4197,12 @@ const useNativeEmitter = (input, expose) => {
3936
4197
 
3937
4198
  /** @jsxImportSource vue */
3938
4199
 
3939
- const COMPONENT_NAME$T = 'vc-input';
4200
+ const COMPONENT_NAME$X = 'vc-input';
3940
4201
  const Input = /* @__PURE__ */ vue.defineComponent({
3941
- name: COMPONENT_NAME$T,
4202
+ name: COMPONENT_NAME$X,
3942
4203
  inheritAttrs: false,
3943
4204
  props: {
3944
- ...props$J,
4205
+ ...props$K,
3945
4206
  indicator: {
3946
4207
  type: [Boolean, Object],
3947
4208
  default: false
@@ -4042,8 +4303,8 @@ const Input = /* @__PURE__ */ vue.defineComponent({
4042
4303
  }
4043
4304
  });
4044
4305
 
4045
- const props$I = {
4046
- ...props$J,
4306
+ const props$J = {
4307
+ ...props$K,
4047
4308
  min: {
4048
4309
  type: Number,
4049
4310
  default: 0
@@ -4258,10 +4519,10 @@ const useInputNumber = () => {
4258
4519
 
4259
4520
  /** @jsxImportSource vue */
4260
4521
 
4261
- const COMPONENT_NAME$S = 'vc-input-number';
4522
+ const COMPONENT_NAME$W = 'vc-input-number';
4262
4523
  const InputNumber = /* @__PURE__ */ vue.defineComponent({
4263
- name: COMPONENT_NAME$S,
4264
- props: props$I,
4524
+ name: COMPONENT_NAME$W,
4525
+ props: props$J,
4265
4526
  inheritAttrs: false,
4266
4527
  setup(props, {
4267
4528
  slots,
@@ -4292,28 +4553,30 @@ const InputNumber = /* @__PURE__ */ vue.defineComponent({
4292
4553
  ...listeners
4293
4554
  }), {
4294
4555
  prepend: slots.prepend && (() => slots.prepend?.()),
4295
- append: props.step && (() => slots.append?.() || vue.createVNode("div", {
4296
- "class": "vc-input-number__icon"
4297
- }, [vue.createVNode("div", {
4298
- "class": "vc-input-number__up",
4299
- "disabled": plusDisabled.value ? 'disabled' : undefined,
4300
- "onClick": e => handleStepper(e, 1)
4301
- }, [vue.createVNode(Icon, {
4302
- "type": "up"
4303
- }, null)]), vue.createVNode("div", {
4304
- "class": "vc-input-number__down",
4305
- "disabled": minusDisabled.value ? 'disabled' : undefined,
4306
- "onClick": e => handleStepper(e, -1)
4307
- }, [vue.createVNode(Icon, {
4308
- "type": "down"
4309
- }, null)])]))
4556
+ append: props.step ? slots.append ? () => slots.append?.() : () => {
4557
+ return vue.createVNode("div", {
4558
+ "class": "vc-input-number__icon"
4559
+ }, [vue.createVNode("div", {
4560
+ "class": "vc-input-number__up",
4561
+ "disabled": plusDisabled.value ? 'disabled' : undefined,
4562
+ "onClick": e => handleStepper(e, 1)
4563
+ }, [vue.createVNode(Icon, {
4564
+ "type": "up"
4565
+ }, null)]), vue.createVNode("div", {
4566
+ "class": "vc-input-number__down",
4567
+ "disabled": minusDisabled.value ? 'disabled' : undefined,
4568
+ "onClick": e => handleStepper(e, -1)
4569
+ }, [vue.createVNode(Icon, {
4570
+ "type": "down"
4571
+ }, null)])]);
4572
+ } : undefined
4310
4573
  });
4311
4574
  };
4312
4575
  }
4313
4576
  });
4314
4577
 
4315
- const props$H = {
4316
- ...props$J,
4578
+ const props$I = {
4579
+ ...props$K,
4317
4580
  enterText: {
4318
4581
  type: [Boolean, String],
4319
4582
  default: true
@@ -4322,10 +4585,10 @@ const props$H = {
4322
4585
 
4323
4586
  /** @jsxImportSource vue */
4324
4587
 
4325
- const COMPONENT_NAME$R = 'vc-input-search';
4588
+ const COMPONENT_NAME$V = 'vc-input-search';
4326
4589
  const InputSearch = /* @__PURE__ */ vue.defineComponent({
4327
- name: COMPONENT_NAME$R,
4328
- props: props$H,
4590
+ name: COMPONENT_NAME$V,
4591
+ props: props$I,
4329
4592
  inheritAttrs: false,
4330
4593
  setup(props, {
4331
4594
  emit,
@@ -4359,12 +4622,12 @@ const InputSearch = /* @__PURE__ */ vue.defineComponent({
4359
4622
 
4360
4623
  /** @jsxImportSource vue */
4361
4624
 
4362
- const COMPONENT_NAME$Q = 'vcm-input';
4625
+ const COMPONENT_NAME$U = 'vcm-input';
4363
4626
  const MInput = /* @__PURE__ */ vue.defineComponent({
4364
- name: COMPONENT_NAME$Q,
4627
+ name: COMPONENT_NAME$U,
4365
4628
  inheritAttrs: false,
4366
4629
  props: {
4367
- ...props$J,
4630
+ ...props$K,
4368
4631
  right: {
4369
4632
  type: Boolean,
4370
4633
  default: false
@@ -4450,10 +4713,10 @@ const MInput = /* @__PURE__ */ vue.defineComponent({
4450
4713
 
4451
4714
  /** @jsxImportSource vue */
4452
4715
 
4453
- const COMPONENT_NAME$P = 'vcm-input-number';
4716
+ const COMPONENT_NAME$T = 'vcm-input-number';
4454
4717
  const MInputNumber = /* @__PURE__ */ vue.defineComponent({
4455
- name: COMPONENT_NAME$P,
4456
- props: props$I,
4718
+ name: COMPONENT_NAME$T,
4719
+ props: props$J,
4457
4720
  inheritAttrs: false,
4458
4721
  setup(props, {
4459
4722
  slots,
@@ -4501,11 +4764,11 @@ const MInputNumber = /* @__PURE__ */ vue.defineComponent({
4501
4764
 
4502
4765
  /** @jsxImportSource vue */
4503
4766
 
4504
- const COMPONENT_NAME$O = 'vcm-input-search';
4767
+ const COMPONENT_NAME$S = 'vcm-input-search';
4505
4768
  const MInputSearch = /* @__PURE__ */ vue.defineComponent({
4506
- name: COMPONENT_NAME$O,
4769
+ name: COMPONENT_NAME$S,
4507
4770
  props: {
4508
- ...props$H,
4771
+ ...props$I,
4509
4772
  cancelText: {
4510
4773
  type: String,
4511
4774
  default: '取消'
@@ -4565,7 +4828,7 @@ const MInputSearch = /* @__PURE__ */ vue.defineComponent({
4565
4828
  }
4566
4829
  });
4567
4830
 
4568
- const props$G = {
4831
+ const props$H = {
4569
4832
  tag: {
4570
4833
  type: String,
4571
4834
  default: "div"
@@ -4580,10 +4843,10 @@ const props$G = {
4580
4843
  }
4581
4844
  };
4582
4845
 
4583
- const COMPONENT_NAME$N = "vcm-list";
4846
+ const COMPONENT_NAME$R = "vcm-list";
4584
4847
  const MList = vue.defineComponent({
4585
- name: COMPONENT_NAME$N,
4586
- props: props$G,
4848
+ name: COMPONENT_NAME$R,
4849
+ props: props$H,
4587
4850
  setup(props, { slots }) {
4588
4851
  vue.provide("vc-list", { props });
4589
4852
  return () => {
@@ -4603,7 +4866,7 @@ const MList = vue.defineComponent({
4603
4866
  }
4604
4867
  });
4605
4868
 
4606
- const props$F = {
4869
+ const props$G = {
4607
4870
  tag: {
4608
4871
  type: String,
4609
4872
  default: "div"
@@ -4637,11 +4900,11 @@ const props$F = {
4637
4900
 
4638
4901
  /** @jsxImportSource vue */
4639
4902
 
4640
- const COMPONENT_NAME$M = 'vcm-list-item';
4903
+ const COMPONENT_NAME$Q = 'vcm-list-item';
4641
4904
  const HTTP_REGEX = /[a-zA-z]+:\/\/[^\s]*/;
4642
4905
  const MListItem = /* @__PURE__ */ vue.defineComponent({
4643
- name: COMPONENT_NAME$M,
4644
- props: props$F,
4906
+ name: COMPONENT_NAME$Q,
4907
+ props: props$G,
4645
4908
  emits: ['click'],
4646
4909
  setup(props, {
4647
4910
  slots,
@@ -4715,33 +4978,85 @@ const MListItem = /* @__PURE__ */ vue.defineComponent({
4715
4978
  }
4716
4979
  });
4717
4980
 
4718
- const props$E = {
4719
- tag: {
4720
- type: String,
4721
- default: "div"
4981
+ const props$F = {
4982
+ // 每秒移动多少px
4983
+ speed: {
4984
+ type: Number,
4985
+ default: 50
4986
+ },
4987
+ content: [String, Function],
4988
+ animated: {
4989
+ type: Boolean,
4990
+ default: true
4991
+ },
4992
+ autoplay: {
4993
+ type: Boolean,
4994
+ default: false
4722
4995
  }
4723
4996
  };
4724
4997
 
4725
4998
  /** @jsxImportSource vue */
4726
4999
 
4727
- const COMPONENT_NAME$L = 'vc-marquee';
5000
+ const COMPONENT_NAME$P = 'vc-marquee';
5001
+ const ANIMATION = $.prefixStyle('animation').camel;
5002
+ const TRANSFORM_KEBAB = $.prefixStyle('transform').kebab;
4728
5003
  const Marquee = /* @__PURE__ */ vue.defineComponent({
4729
- name: COMPONENT_NAME$L,
4730
- props: props$E,
5004
+ name: COMPONENT_NAME$P,
5005
+ props: props$F,
4731
5006
  setup(props, {
4732
5007
  slots
4733
5008
  }) {
5009
+ const instance = vue.getCurrentInstance();
5010
+ const duration = vue.ref(0);
5011
+ const elW = vue.ref(0);
5012
+ const contentW = vue.ref(0);
5013
+ const marqueeId = vue.ref(Utils.getUid('marquee'));
5014
+ const paused = vue.computed(() => {
5015
+ return !props.animated || !props.autoplay && contentW.value < elW.value;
5016
+ });
5017
+ const style = vue.computed(() => {
5018
+ return {
5019
+ [ANIMATION]: `${marqueeId.value} ${duration.value}s linear 0s ${paused.value ? 'paused' : 'running'} infinite`
5020
+ };
5021
+ });
5022
+ const refresh = () => {
5023
+ elW.value = instance.vnode.el.offsetWidth;
5024
+ contentW.value = instance.vnode.el.firstChild.offsetWidth;
5025
+ if (paused.value) return;
5026
+ const FROM = `from { ${TRANSFORM_KEBAB}: translateX(${elW.value}px) }`;
5027
+ const TO = `to { ${TRANSFORM_KEBAB}: translateX(-${contentW.value}px) }`;
5028
+ Load.style(`@keyframes ${marqueeId.value} { ${FROM} ${TO} }`);
5029
+ duration.value = (elW.value + contentW.value) / props.speed;
5030
+ };
5031
+
5032
+ // TODO: content render和slot下也支持重置
5033
+ ['content', 'speed'].forEach(key => {
5034
+ vue.watch(() => props[key], refresh);
5035
+ });
5036
+ vue.onMounted(() => {
5037
+ // 兼容Portal前动画延迟
5038
+ setTimeout(refresh, 0);
5039
+ });
4734
5040
  return () => {
4735
5041
  return vue.createVNode("div", {
4736
5042
  "class": "vc-marquee"
4737
- }, [slots?.default?.()]);
5043
+ }, [vue.createVNode("div", {
5044
+ "style": style.value,
5045
+ "class": [{
5046
+ 'is-paused': paused.value
5047
+ }, 'vc-marquee__content']
5048
+ }, [slots.defalut ? slots.defalut() : typeof props.content === 'string' ? vue.createVNode("div", {
5049
+ "innerHTML": props.content
5050
+ }, null) : typeof props.content === 'function' ? vue.createVNode(Customer, {
5051
+ "render": props.content
5052
+ }, null) : null])]);
4738
5053
  };
4739
5054
  }
4740
5055
  });
4741
5056
 
4742
5057
  const MMarquee = Marquee;
4743
5058
 
4744
- const props$D = {
5059
+ const props$E = {
4745
5060
  content: [String, Function],
4746
5061
  mask: {
4747
5062
  type: Boolean,
@@ -4779,11 +5094,11 @@ const props$D = {
4779
5094
 
4780
5095
  /** @jsxImportSource vue */
4781
5096
 
4782
- const COMPONENT_NAME$K = 'vc-message';
5097
+ const COMPONENT_NAME$O = 'vc-message';
4783
5098
  const MessageView = /* @__PURE__ */ vue.defineComponent({
4784
- name: COMPONENT_NAME$K,
5099
+ name: COMPONENT_NAME$O,
4785
5100
  emits: ['before-close', 'close', 'portal-fulfilled'],
4786
- props: props$D,
5101
+ props: props$E,
4787
5102
  setup(props, {
4788
5103
  emit,
4789
5104
  expose
@@ -4924,7 +5239,7 @@ const Message$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
4924
5239
 
4925
5240
  const MMessage = Message$1;
4926
5241
 
4927
- const props$C = {
5242
+ const props$D = {
4928
5243
  modelValue: {
4929
5244
  type: Boolean,
4930
5245
  default: false
@@ -5004,12 +5319,12 @@ const props$C = {
5004
5319
 
5005
5320
  /** @jsxImportSource vue */
5006
5321
 
5007
- const COMPONENT_NAME$J = 'vc-modal';
5322
+ const COMPONENT_NAME$N = 'vc-modal';
5008
5323
  let zIndexNumber = 1002;
5009
5324
  const ModalView = /* @__PURE__ */ vue.defineComponent({
5010
- name: COMPONENT_NAME$J,
5325
+ name: COMPONENT_NAME$N,
5011
5326
  emits: ['update:modelValue', 'close', 'portal-fulfilled', 'visible-change', 'ok', 'cancel'],
5012
- props: props$C,
5327
+ props: props$D,
5013
5328
  setup(props, {
5014
5329
  slots,
5015
5330
  emit,
@@ -5348,7 +5663,7 @@ const modal$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
5348
5663
  warning: warning$1
5349
5664
  }, Symbol.toStringTag, { value: 'Module' }));
5350
5665
 
5351
- const props$B = {
5666
+ const props$C = {
5352
5667
  mode: {
5353
5668
  type: String,
5354
5669
  validator: (v) => /(alert|operation)/.test(v),
@@ -5410,11 +5725,11 @@ const props$B = {
5410
5725
 
5411
5726
  /** @jsxImportSource vue */
5412
5727
 
5413
- const COMPONENT_NAME$I = 'vc-modal';
5728
+ const COMPONENT_NAME$M = 'vc-modal';
5414
5729
  const MModalView = /* @__PURE__ */ vue.defineComponent({
5415
- name: COMPONENT_NAME$I,
5730
+ name: COMPONENT_NAME$M,
5416
5731
  emits: ['update:modelValue', 'portal-fulfilled', 'close', 'ok', 'cancel'],
5417
- props: props$B,
5732
+ props: props$C,
5418
5733
  setup(props, {
5419
5734
  slots,
5420
5735
  emit,
@@ -5587,7 +5902,7 @@ const modal = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
5587
5902
  operation
5588
5903
  }, Symbol.toStringTag, { value: 'Module' }));
5589
5904
 
5590
- const props$A = {
5905
+ const props$B = {
5591
5906
  title: [String, Function],
5592
5907
  content: [String, Function],
5593
5908
  // 单位ms
@@ -5617,10 +5932,10 @@ const props$A = {
5617
5932
 
5618
5933
  /** @jsxImportSource vue */
5619
5934
 
5620
- const COMPONENT_NAME$H = 'vc-notice';
5935
+ const COMPONENT_NAME$L = 'vc-notice';
5621
5936
  const NoticeView = /* @__PURE__ */ vue.defineComponent({
5622
- name: COMPONENT_NAME$H,
5623
- props: props$A,
5937
+ name: COMPONENT_NAME$L,
5938
+ props: props$B,
5624
5939
  emits: ['portal-fulfilled', 'close', 'before-close'],
5625
5940
  setup(props, {
5626
5941
  emit,
@@ -5792,7 +6107,7 @@ const Notice$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
5792
6107
 
5793
6108
  const MNotice = Notice$1;
5794
6109
 
5795
- const props$z = {
6110
+ const props$A = {
5796
6111
  tag: {
5797
6112
  type: String,
5798
6113
  default: "div"
@@ -5801,10 +6116,10 @@ const props$z = {
5801
6116
 
5802
6117
  /** @jsxImportSource vue */
5803
6118
 
5804
- const COMPONENT_NAME$G = 'vc-option';
6119
+ const COMPONENT_NAME$K = 'vc-option';
5805
6120
  const Option = /* @__PURE__ */ vue.defineComponent({
5806
- name: COMPONENT_NAME$G,
5807
- props: props$z,
6121
+ name: COMPONENT_NAME$K,
6122
+ props: props$A,
5808
6123
  setup(props, {
5809
6124
  slots
5810
6125
  }) {
@@ -5818,7 +6133,7 @@ const Option = /* @__PURE__ */ vue.defineComponent({
5818
6133
 
5819
6134
  const MOption = Option;
5820
6135
 
5821
- const props$y = {
6136
+ const props$z = {
5822
6137
  tag: {
5823
6138
  type: String,
5824
6139
  default: "div"
@@ -5827,10 +6142,10 @@ const props$y = {
5827
6142
 
5828
6143
  /** @jsxImportSource vue */
5829
6144
 
5830
- const COMPONENT_NAME$F = 'vc-page';
6145
+ const COMPONENT_NAME$J = 'vc-page';
5831
6146
  const Page = /* @__PURE__ */ vue.defineComponent({
5832
- name: COMPONENT_NAME$F,
5833
- props: props$y,
6147
+ name: COMPONENT_NAME$J,
6148
+ props: props$z,
5834
6149
  setup(props, {
5835
6150
  slots
5836
6151
  }) {
@@ -5844,7 +6159,7 @@ const Page = /* @__PURE__ */ vue.defineComponent({
5844
6159
 
5845
6160
  const MPage = Page;
5846
6161
 
5847
- const props$x = {
6162
+ const props$y = {
5848
6163
  tag: {
5849
6164
  type: String,
5850
6165
  default: "div"
@@ -5853,10 +6168,10 @@ const props$x = {
5853
6168
 
5854
6169
  /** @jsxImportSource vue */
5855
6170
 
5856
- const COMPONENT_NAME$E = 'vc-picker';
6171
+ const COMPONENT_NAME$I = 'vc-picker';
5857
6172
  const Picker = /* @__PURE__ */ vue.defineComponent({
5858
- name: COMPONENT_NAME$E,
5859
- props: props$x,
6173
+ name: COMPONENT_NAME$I,
6174
+ props: props$y,
5860
6175
  setup(props, {
5861
6176
  slots
5862
6177
  }) {
@@ -5870,7 +6185,7 @@ const Picker = /* @__PURE__ */ vue.defineComponent({
5870
6185
 
5871
6186
  const MPicker = Picker;
5872
6187
 
5873
- const props$w = {
6188
+ const props$x = {
5874
6189
  tag: {
5875
6190
  type: String,
5876
6191
  default: "div"
@@ -5879,10 +6194,10 @@ const props$w = {
5879
6194
 
5880
6195
  /** @jsxImportSource vue */
5881
6196
 
5882
- const COMPONENT_NAME$D = 'vc-popconfirm';
6197
+ const COMPONENT_NAME$H = 'vc-popconfirm';
5883
6198
  const Popconfirm = /* @__PURE__ */ vue.defineComponent({
5884
- name: COMPONENT_NAME$D,
5885
- props: props$w,
6199
+ name: COMPONENT_NAME$H,
6200
+ props: props$x,
5886
6201
  setup(props, {
5887
6202
  slots
5888
6203
  }) {
@@ -5896,7 +6211,7 @@ const Popconfirm = /* @__PURE__ */ vue.defineComponent({
5896
6211
 
5897
6212
  const MPopconfirm = Popconfirm;
5898
6213
 
5899
- const props$v = {
6214
+ const props$w = {
5900
6215
  modelValue: Boolean,
5901
6216
  animation: String,
5902
6217
  placement: {
@@ -5953,7 +6268,7 @@ const props$v = {
5953
6268
  // 直接传送门标记调用时,hover需要绑定事件
5954
6269
  alone: {
5955
6270
  type: Boolean,
5956
- default: false
6271
+ default: true
5957
6272
  },
5958
6273
  hover: Boolean,
5959
6274
  always: Boolean,
@@ -5975,7 +6290,7 @@ const wrapperKeys = [
5975
6290
  "autoWidth",
5976
6291
  "always"
5977
6292
  ];
5978
- const props$u = {
6293
+ const props$v = {
5979
6294
  trigger: {
5980
6295
  type: String,
5981
6296
  default: "hover",
@@ -5993,7 +6308,7 @@ const props$u = {
5993
6308
  type: Boolean,
5994
6309
  default: true
5995
6310
  },
5996
- ...lodashEs.pick(props$v, wrapperKeys)
6311
+ ...lodashEs.pick(props$w, wrapperKeys)
5997
6312
  };
5998
6313
 
5999
6314
  const EXTRA_DISTANCE = 4;
@@ -6071,7 +6386,7 @@ const usePos = () => {
6071
6386
  const topSurplus = topDistance - el.offsetHeight;
6072
6387
  switch (direction[0]) {
6073
6388
  case "left":
6074
- if (popupRect.x - el.offsetWidth < 0) {
6389
+ if (popupRect.x - el.offsetWidth < 0 && leftSurplus < rightSurplus) {
6075
6390
  placement = placement.replace("left", "right");
6076
6391
  }
6077
6392
  placement = getYAssistFitPos({
@@ -6086,7 +6401,7 @@ const usePos = () => {
6086
6401
  break;
6087
6402
  case "right":
6088
6403
  remanentW = window.innerWidth - popupRect.x - popupRect.width - el.offsetWidth;
6089
- if (remanentW < 0) {
6404
+ if (remanentW < 0 && rightSurplus < leftSurplus) {
6090
6405
  placement = placement.replace("right", "left");
6091
6406
  }
6092
6407
  placement = getYAssistFitPos({
@@ -6100,7 +6415,7 @@ const usePos = () => {
6100
6415
  });
6101
6416
  break;
6102
6417
  case "top":
6103
- if (popupRect.y - el.offsetHeight < 0) {
6418
+ if (popupRect.y - el.offsetHeight < 0 && topSurplus < bottomSurplus) {
6104
6419
  placement = placement.replace("top", "bottom");
6105
6420
  }
6106
6421
  placement = getXAssistFitPos({
@@ -6115,7 +6430,7 @@ const usePos = () => {
6115
6430
  break;
6116
6431
  case "bottom":
6117
6432
  remanentH = window.innerHeight - popupRect.y - popupRect.height - el.offsetHeight;
6118
- if (remanentH < 0) {
6433
+ if (remanentH < 0 && bottomSurplus < topSurplus) {
6119
6434
  placement = placement.replace("bottom", "top");
6120
6435
  }
6121
6436
  placement = getXAssistFitPos({
@@ -6254,10 +6569,10 @@ const usePos = () => {
6254
6569
  function _isSlot(s) {
6255
6570
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
6256
6571
  }
6257
- const COMPONENT_NAME$C = 'vc-popover-wrapper';
6572
+ const COMPONENT_NAME$G = 'vc-popover-wrapper';
6258
6573
  const PopoverWrapper = /* @__PURE__ */ vue.defineComponent({
6259
- name: COMPONENT_NAME$C,
6260
- props: props$v,
6574
+ name: COMPONENT_NAME$G,
6575
+ props: props$w,
6261
6576
  emits: ['portal-fulfilled', 'close'],
6262
6577
  setup(props, {
6263
6578
  emit,
@@ -6445,18 +6760,15 @@ const PopoverWrapper = /* @__PURE__ */ vue.defineComponent({
6445
6760
  props.alone && props.hover && bindEvents();
6446
6761
  vue.onMounted(() => {
6447
6762
  isActive.value = true;
6448
- vue.nextTick(() => {
6449
- setPopupStyle();
6450
- });
6451
-
6452
6763
  // 捕获阶段执行
6453
6764
  !props.hover && document.addEventListener('click', handleClick, true);
6454
6765
  // 监听body的滚动
6455
6766
  document.addEventListener('scroll', setPopupStyle);
6456
6767
  // 监听触发节点的Resize
6457
- helperResize.Resize.on(props.triggerEl, setPopupStyle);
6768
+ helperResize.Resize.on(props.triggerEl, setPopupStyle); // 首次会执行一次
6458
6769
  // 监听弹层的Resize
6459
- helperResize.Resize.on(vnode.el, handleWrapperResize);
6770
+ helperResize.Resize.on(vnode.el, handleWrapperResize); // 首次会执行一次
6771
+
6460
6772
  props.onReady && props.onReady();
6461
6773
  });
6462
6774
  vue.onUnmounted(() => {
@@ -6511,10 +6823,10 @@ const PopoverPortal = new Portal(PopoverWrapper);
6511
6823
 
6512
6824
  /** @jsxImportSource vue */
6513
6825
 
6514
- const COMPONENT_NAME$B = 'vc-popover';
6826
+ const COMPONENT_NAME$F = 'vc-popover';
6515
6827
  const Popover = /* @__PURE__ */ vue.defineComponent({
6516
- name: COMPONENT_NAME$B,
6517
- props: props$u,
6828
+ name: COMPONENT_NAME$F,
6829
+ props: props$v,
6518
6830
  emits: ['update:modelValue', 'visible-change', 'ready', 'close'],
6519
6831
  open: PopoverPortal.popup.bind(PopoverPortal),
6520
6832
  setup(props, {
@@ -6584,10 +6896,12 @@ const Popover = /* @__PURE__ */ vue.defineComponent({
6584
6896
  let {
6585
6897
  portalClass
6586
6898
  } = props;
6587
- typeof portalClass === 'object' ? portalClass instanceof Array ? portalClass.push(popoverId) : portalClass[popoverId] = true : portalClass += ` ${popoverId}`;
6899
+ typeof portalClass === 'object' ? portalClass instanceof Array ? portalClass.push(popoverId) : portalClass[popoverId] = true : portalClass = `${portalClass || ''} ${popoverId}`;
6588
6900
  popperInstance = PopoverPortal.popup({
6589
6901
  el,
6590
- cName: popoverId,
6902
+ alone: false,
6903
+ // 由当前组件控制hover/click等情况
6904
+ name: popoverId,
6591
6905
  triggerEl: instance.vnode.el,
6592
6906
  onChange: handleChange,
6593
6907
  // @ts-ignore
@@ -6651,6 +6965,34 @@ const Popover = /* @__PURE__ */ vue.defineComponent({
6651
6965
 
6652
6966
  const MPopover = Popover;
6653
6967
 
6968
+ const props$u = {
6969
+ tag: {
6970
+ type: String,
6971
+ default: "div"
6972
+ }
6973
+ };
6974
+
6975
+ /** @jsxImportSource vue */
6976
+
6977
+ const COMPONENT_NAME$E = 'vc-popup';
6978
+ const Popup = /* @__PURE__ */ vue.defineComponent({
6979
+ name: COMPONENT_NAME$E,
6980
+ props: props$u,
6981
+ setup(props, {
6982
+ slots
6983
+ }) {
6984
+ return () => {
6985
+ return vue.createVNode("div", {
6986
+ "class": "vc-popup"
6987
+ }, [slots?.default?.()]);
6988
+ };
6989
+ }
6990
+ });
6991
+
6992
+ const MPopup = Popup;
6993
+
6994
+ const MPortal = Portal;
6995
+
6654
6996
  const props$t = {
6655
6997
  tag: {
6656
6998
  type: String,
@@ -6658,105 +7000,371 @@ const props$t = {
6658
7000
  }
6659
7001
  };
6660
7002
 
6661
- /** @jsxImportSource vue */
6662
-
6663
- const COMPONENT_NAME$A = 'vc-popup';
6664
- const Popup = /* @__PURE__ */ vue.defineComponent({
6665
- name: COMPONENT_NAME$A,
6666
- props: props$t,
6667
- setup(props, {
6668
- slots
6669
- }) {
6670
- return () => {
6671
- return vue.createVNode("div", {
6672
- "class": "vc-popup"
6673
- }, [slots?.default?.()]);
7003
+ /** @jsxImportSource vue */
7004
+
7005
+ const COMPONENT_NAME$D = 'vc-print';
7006
+ const Print = /* @__PURE__ */ vue.defineComponent({
7007
+ name: COMPONENT_NAME$D,
7008
+ props: props$t,
7009
+ setup(props, {
7010
+ slots
7011
+ }) {
7012
+ return () => {
7013
+ return vue.createVNode("div", {
7014
+ "class": "vc-print"
7015
+ }, [slots?.default?.()]);
7016
+ };
7017
+ }
7018
+ });
7019
+
7020
+ const MPrint = Print;
7021
+
7022
+ const props$s = {
7023
+ tag: {
7024
+ type: String,
7025
+ default: "div"
7026
+ }
7027
+ };
7028
+
7029
+ /** @jsxImportSource vue */
7030
+
7031
+ const COMPONENT_NAME$C = 'vc-progress';
7032
+ const Progress = /* @__PURE__ */ vue.defineComponent({
7033
+ name: COMPONENT_NAME$C,
7034
+ props: props$s,
7035
+ setup(props, {
7036
+ slots
7037
+ }) {
7038
+ return () => {
7039
+ return vue.createVNode("div", {
7040
+ "class": "vc-progress"
7041
+ }, [slots?.default?.()]);
7042
+ };
7043
+ }
7044
+ });
7045
+
7046
+ const MProgress = Progress;
7047
+
7048
+ const props$r = {
7049
+ disabled: {
7050
+ type: Boolean,
7051
+ default: false
7052
+ },
7053
+ modelValue: {
7054
+ type: [String, Number, Boolean],
7055
+ default: false
7056
+ },
7057
+ value: {
7058
+ type: [String, Number, Boolean],
7059
+ default: void 0
7060
+ },
7061
+ label: {
7062
+ type: [String, Number, Boolean],
7063
+ default: void 0
7064
+ },
7065
+ name: {
7066
+ type: String
7067
+ },
7068
+ /**
7069
+ * group模式下无效
7070
+ */
7071
+ trueValue: {
7072
+ type: [String, Number, Boolean],
7073
+ default: true
7074
+ },
7075
+ falseValue: {
7076
+ type: [String, Number, Boolean],
7077
+ default: false
7078
+ }
7079
+ };
7080
+
7081
+ const useRadio = () => {
7082
+ const { props, emit } = vue.getCurrentInstance();
7083
+ const group = vue.inject("vc-radio-group", {});
7084
+ const formItem = vue.inject("vc-form-item", {});
7085
+ const currentValue = vue.ref(void 0);
7086
+ const isFocus = vue.ref(false);
7087
+ const computedValue = vue.computed(() => {
7088
+ return typeof props.value === "undefined" || props.value === "" ? props.label : props.value;
7089
+ });
7090
+ const computedLabel = vue.computed(() => {
7091
+ return typeof props.label === "undefined" || props.label === "" ? props.value : props.label;
7092
+ });
7093
+ const hasGroup = vue.computed(() => {
7094
+ return !!group.props;
7095
+ });
7096
+ const checked = vue.computed(() => {
7097
+ return hasGroup.value ? group.currentValue.value === computedValue.value : currentValue.value === props.checkedValue;
7098
+ });
7099
+ const radioName = vue.computed(() => {
7100
+ return hasGroup.value ? group.props.name : props.name;
7101
+ });
7102
+ const isDisabled = vue.computed(() => {
7103
+ return hasGroup.value ? group.props.disabled || props.disabled : props.disabled;
7104
+ });
7105
+ const classes = vue.computed(() => {
7106
+ return {
7107
+ "is-checked": checked.value,
7108
+ "is-disabled": isDisabled.value,
7109
+ "is-focus": isFocus.value
7110
+ };
7111
+ });
7112
+ vue.watch(
7113
+ () => props.modelValue,
7114
+ (v) => {
7115
+ currentValue.value = v;
7116
+ },
7117
+ { immediate: true }
7118
+ );
7119
+ const reset = ($checked) => {
7120
+ currentValue.value = $checked ? props.checkedValue : props.uncheckedValue;
7121
+ };
7122
+ const sync = (e) => {
7123
+ emit("update:modelValue", currentValue.value, e, reset);
7124
+ emit("change", currentValue.value, e, reset);
7125
+ formItem?.change?.(currentValue.value);
7126
+ };
7127
+ const handleChange = (e) => {
7128
+ if (props.disabled) {
7129
+ return false;
7130
+ }
7131
+ const $checked = e.target.checked;
7132
+ if (hasGroup.value) {
7133
+ group.reset(computedValue.value);
7134
+ group.sync(e);
7135
+ } else {
7136
+ reset($checked);
7137
+ sync(e);
7138
+ }
7139
+ };
7140
+ const handleBlur = () => {
7141
+ isFocus.value = false;
7142
+ };
7143
+ const handleFocus = () => {
7144
+ isFocus.value = true;
7145
+ };
7146
+ return {
7147
+ currentValue,
7148
+ isFocus,
7149
+ isDisabled,
7150
+ radioName,
7151
+ classes,
7152
+ hasGroup,
7153
+ checked,
7154
+ handleChange,
7155
+ handleBlur,
7156
+ handleFocus,
7157
+ sync,
7158
+ reset,
7159
+ computedValue,
7160
+ computedLabel
7161
+ };
7162
+ };
7163
+
7164
+ /** @jsxImportSource vue */
7165
+
7166
+ const COMPONENT_NAME$B = 'vc-radio';
7167
+ const Radio = /* @__PURE__ */ vue.defineComponent({
7168
+ name: COMPONENT_NAME$B,
7169
+ props: props$r,
7170
+ emits: ['update:modelValue', 'change'],
7171
+ setup(props, {
7172
+ slots
7173
+ }) {
7174
+ const {
7175
+ radioName,
7176
+ checked,
7177
+ classes,
7178
+ computedLabel,
7179
+ handleChange,
7180
+ handleFocus,
7181
+ handleBlur
7182
+ } = useRadio();
7183
+ return () => {
7184
+ return vue.createVNode("label", {
7185
+ "class": [classes.value, 'vc-radio']
7186
+ }, [vue.createVNode("span", {
7187
+ "class": [{
7188
+ 'has-sibling': !!(computedLabel.value || slots.default)
7189
+ }, 'vc-radio__wrapper']
7190
+ }, [vue.createVNode("span", {
7191
+ "class": "vc-radio__border"
7192
+ }, [vue.createVNode("span", {
7193
+ "class": "vc-radio__inner"
7194
+ }, null)]), vue.createVNode("input", {
7195
+ "checked": checked.value,
7196
+ "name": radioName.value,
7197
+ "disabled": props.disabled,
7198
+ "type": "radio",
7199
+ "onChange": handleChange,
7200
+ "onFocus": handleFocus,
7201
+ "onBlur": handleBlur
7202
+ }, null)]), slots.default ? slots.default() : computedLabel.value && vue.createVNode("span", null, [computedLabel.value])]);
7203
+ };
7204
+ }
7205
+ });
7206
+
7207
+ const props$q = {
7208
+ modelValue: {
7209
+ type: [String, Number],
7210
+ default: ""
7211
+ },
7212
+ type: {
7213
+ type: String,
7214
+ default: ""
7215
+ // 'button'
7216
+ },
7217
+ vertical: {
7218
+ type: Boolean,
7219
+ default: false
7220
+ },
7221
+ name: {
7222
+ type: String,
7223
+ default: () => Utils.getUid("radio")
7224
+ },
7225
+ disabled: {
7226
+ type: Boolean,
7227
+ default: false
7228
+ },
7229
+ fragment: {
7230
+ type: Boolean,
7231
+ default: false
7232
+ }
7233
+ };
7234
+
7235
+ const useRadioGroup = () => {
7236
+ const { props, emit } = vue.getCurrentInstance();
7237
+ const formItem = vue.inject("vc-form-item", {});
7238
+ const currentValue = vue.ref("");
7239
+ const classes = vue.computed(() => {
7240
+ return {
7241
+ "is-vertical": props.vertical,
7242
+ "is-button": props.type === "button"
6674
7243
  };
6675
- }
6676
- });
6677
-
6678
- const MPopup = Popup;
6679
-
6680
- const MPortal = Portal;
6681
-
6682
- const props$s = {
6683
- tag: {
6684
- type: String,
6685
- default: "div"
6686
- }
7244
+ });
7245
+ vue.watch(
7246
+ () => props.modelValue,
7247
+ (v) => {
7248
+ if (lodash.isEqualWith(v, currentValue.value)) {
7249
+ return;
7250
+ }
7251
+ currentValue.value = v;
7252
+ },
7253
+ { immediate: true }
7254
+ );
7255
+ const reset = (v) => {
7256
+ currentValue.value = v;
7257
+ };
7258
+ const sync = (e) => {
7259
+ emit("update:modelValue", currentValue.value, e, reset);
7260
+ emit("change", currentValue.value, e, reset);
7261
+ formItem?.change?.(currentValue.value);
7262
+ };
7263
+ vue.provide("vc-radio-group", {
7264
+ props,
7265
+ currentValue,
7266
+ reset,
7267
+ sync
7268
+ });
7269
+ return {
7270
+ currentValue,
7271
+ classes,
7272
+ sync,
7273
+ reset
7274
+ };
6687
7275
  };
6688
7276
 
6689
7277
  /** @jsxImportSource vue */
6690
7278
 
6691
- const COMPONENT_NAME$z = 'vc-print';
6692
- const Print = /* @__PURE__ */ vue.defineComponent({
6693
- name: COMPONENT_NAME$z,
6694
- props: props$s,
7279
+ const COMPONENT_NAME$A = 'vc-radio-group';
7280
+ const RadioGroup = /* @__PURE__ */ vue.defineComponent({
7281
+ name: COMPONENT_NAME$A,
7282
+ props: props$q,
7283
+ emits: ['update:modelValue', 'change'],
6695
7284
  setup(props, {
6696
7285
  slots
6697
7286
  }) {
7287
+ const {
7288
+ classes
7289
+ } = useRadioGroup();
6698
7290
  return () => {
7291
+ if (props.fragment) return slots.default?.();
6699
7292
  return vue.createVNode("div", {
6700
- "class": "vc-print"
7293
+ "class": "vc-radio-group",
7294
+ "style": classes.value,
7295
+ "name": props.name
6701
7296
  }, [slots?.default?.()]);
6702
7297
  };
6703
7298
  }
6704
7299
  });
6705
7300
 
6706
- const MPrint = Print;
6707
-
6708
- const props$r = {
6709
- tag: {
6710
- type: String,
6711
- default: "div"
6712
- }
6713
- };
6714
-
6715
7301
  /** @jsxImportSource vue */
6716
7302
 
6717
- const COMPONENT_NAME$y = 'vc-progress';
6718
- const Progress = /* @__PURE__ */ vue.defineComponent({
6719
- name: COMPONENT_NAME$y,
7303
+ const COMPONENT_NAME$z = 'vcm-radio';
7304
+ const MRadio = /* @__PURE__ */ vue.defineComponent({
7305
+ name: COMPONENT_NAME$z,
6720
7306
  props: props$r,
7307
+ emits: ['update:modelValue', 'change'],
6721
7308
  setup(props, {
6722
7309
  slots
6723
7310
  }) {
7311
+ const {
7312
+ radioName,
7313
+ checked,
7314
+ classes,
7315
+ computedLabel,
7316
+ handleChange,
7317
+ handleFocus,
7318
+ handleBlur
7319
+ } = useRadio();
6724
7320
  return () => {
6725
- return vue.createVNode("div", {
6726
- "class": "vc-progress"
6727
- }, [slots?.default?.()]);
7321
+ return vue.createVNode("label", {
7322
+ "class": [classes.value, 'vcm-radio']
7323
+ }, [vue.createVNode("span", {
7324
+ "class": [{
7325
+ 'has-sibling': !!(computedLabel.value || slots.default)
7326
+ }, 'vcm-radio__wrapper']
7327
+ }, [vue.createVNode("span", {
7328
+ "class": "vcm-radio__border"
7329
+ }, [vue.createVNode("span", {
7330
+ "class": "vcm-radio__inner"
7331
+ }, null)]), vue.createVNode("input", {
7332
+ "checked": checked.value,
7333
+ "name": radioName.value,
7334
+ "disabled": props.disabled,
7335
+ "type": "radio",
7336
+ "onChange": handleChange,
7337
+ "onFocus": handleFocus,
7338
+ "onBlur": handleBlur
7339
+ }, null)]), slots.default ? slots.default() : computedLabel.value && vue.createVNode("span", null, [computedLabel.value])]);
6728
7340
  };
6729
7341
  }
6730
7342
  });
6731
7343
 
6732
- const MProgress = Progress;
6733
-
6734
- const props$q = {
6735
- tag: {
6736
- type: String,
6737
- default: "div"
6738
- }
6739
- };
6740
-
6741
7344
  /** @jsxImportSource vue */
6742
7345
 
6743
- const COMPONENT_NAME$x = 'vc-radio';
6744
- const Radio = /* @__PURE__ */ vue.defineComponent({
6745
- name: COMPONENT_NAME$x,
7346
+ const COMPONENT_NAME$y = 'vcm-radio-group';
7347
+ const MRadioGroup = /* @__PURE__ */ vue.defineComponent({
7348
+ name: COMPONENT_NAME$y,
6746
7349
  props: props$q,
7350
+ emits: ['update:modelValue', 'change'],
6747
7351
  setup(props, {
6748
7352
  slots
6749
7353
  }) {
7354
+ const {
7355
+ classes
7356
+ } = useRadioGroup();
6750
7357
  return () => {
7358
+ if (props.fragment) return slots.default?.();
6751
7359
  return vue.createVNode("div", {
6752
- "class": "vc-radio"
7360
+ "class": "vcm-radio-group",
7361
+ "style": classes.value,
7362
+ "name": props.name
6753
7363
  }, [slots?.default?.()]);
6754
7364
  };
6755
7365
  }
6756
7366
  });
6757
7367
 
6758
- const MRadio = Radio;
6759
-
6760
7368
  const props$p = {
6761
7369
  tag: {
6762
7370
  type: String,
@@ -6766,9 +7374,9 @@ const props$p = {
6766
7374
 
6767
7375
  /** @jsxImportSource vue */
6768
7376
 
6769
- const COMPONENT_NAME$w = 'vc-rate';
7377
+ const COMPONENT_NAME$x = 'vc-rate';
6770
7378
  const Rate = /* @__PURE__ */ vue.defineComponent({
6771
- name: COMPONENT_NAME$w,
7379
+ name: COMPONENT_NAME$x,
6772
7380
  props: props$p,
6773
7381
  setup(props, {
6774
7382
  slots
@@ -6974,7 +7582,7 @@ const props$l = {
6974
7582
 
6975
7583
  /** @jsxImportSource vue */
6976
7584
 
6977
- const COMPONENT_NAME$v = 'vc-scroller-track';
7585
+ const COMPONENT_NAME$w = 'vc-scroller-track';
6978
7586
  const BAR_MAP = {
6979
7587
  vertical: {
6980
7588
  scroll: 'scrollTop',
@@ -6994,7 +7602,7 @@ const BAR_MAP = {
6994
7602
  }
6995
7603
  };
6996
7604
  const Track = /* @__PURE__ */ vue.defineComponent({
6997
- name: COMPONENT_NAME$v,
7605
+ name: COMPONENT_NAME$w,
6998
7606
  props: props$n,
6999
7607
  emits: ['change'],
7000
7608
  setup(props, {
@@ -7180,9 +7788,9 @@ const Track = /* @__PURE__ */ vue.defineComponent({
7180
7788
 
7181
7789
  /** @jsxImportSource vue */
7182
7790
 
7183
- const COMPONENT_NAME$u = 'vc-scroller-bar';
7791
+ const COMPONENT_NAME$v = 'vc-scroller-bar';
7184
7792
  const Bar = /* @__PURE__ */ vue.defineComponent({
7185
- name: COMPONENT_NAME$u,
7793
+ name: COMPONENT_NAME$v,
7186
7794
  props: props$m,
7187
7795
  emits: ['change'],
7188
7796
  setup(props, {
@@ -7396,7 +8004,7 @@ const useScroller = (expose) => {
7396
8004
 
7397
8005
  /** @jsxImportSource vue */
7398
8006
 
7399
- const COMPONENT_NAME$t = 'vc-scroller';
8007
+ const COMPONENT_NAME$u = 'vc-scroller';
7400
8008
 
7401
8009
  /**
7402
8010
  * 作为备选方案,目前推荐使用ScrollerWheel
@@ -7407,7 +8015,7 @@ const COMPONENT_NAME$t = 'vc-scroller';
7407
8015
  * 2. 增加了一层嵌套
7408
8016
  */
7409
8017
  const Scroller = /* @__PURE__ */ vue.defineComponent({
7410
- name: COMPONENT_NAME$t,
8018
+ name: COMPONENT_NAME$u,
7411
8019
  props: props$l,
7412
8020
  emits: ['scroll'],
7413
8021
  setup(props, {
@@ -7468,7 +8076,7 @@ const Scroller = /* @__PURE__ */ vue.defineComponent({
7468
8076
 
7469
8077
  /** @jsxImportSource vue */
7470
8078
 
7471
- const COMPONENT_NAME$s = 'vc-scroller-wheel';
8079
+ const COMPONENT_NAME$t = 'vc-scroller-wheel';
7472
8080
 
7473
8081
  /**
7474
8082
  * 为减少一层嵌套,为去除滚动bar的抖动,使用wheel模拟
@@ -7490,7 +8098,7 @@ const COMPONENT_NAME$s = 'vc-scroller-wheel';
7490
8098
  * 设置scrollTop不会reflow和repaint,不需要考虑transfrom来改变content(transform也只在draw完成)
7491
8099
  */
7492
8100
  const ScrollerWheel = /* @__PURE__ */ vue.defineComponent({
7493
- name: COMPONENT_NAME$s,
8101
+ name: COMPONENT_NAME$t,
7494
8102
  props: props$l,
7495
8103
  emits: ['scroll'],
7496
8104
  setup(props, {
@@ -7595,9 +8203,9 @@ const ScrollerWheel = /* @__PURE__ */ vue.defineComponent({
7595
8203
 
7596
8204
  /** @jsxImportSource vue */
7597
8205
 
7598
- const COMPONENT_NAME$r = 'vc-recycle-list-scroll-state';
8206
+ const COMPONENT_NAME$s = 'vc-recycle-list-scroll-state';
7599
8207
  const ScrollState = /* @__PURE__ */ vue.defineComponent({
7600
- name: COMPONENT_NAME$r,
8208
+ name: COMPONENT_NAME$s,
7601
8209
  setup(_, {
7602
8210
  slots
7603
8211
  }) {
@@ -7727,12 +8335,12 @@ const useDirectionKeys = () => {
7727
8335
 
7728
8336
  /** @jsxImportSource vue */
7729
8337
 
7730
- const COMPONENT_NAME$q = 'vc-recycle-list-container';
8338
+ const COMPONENT_NAME$r = 'vc-recycle-list-container';
7731
8339
 
7732
8340
  // TODO: 抽离
7733
8341
  const transformKey = $__namespace.prefixStyle('transform').camel;
7734
8342
  const Container = /* @__PURE__ */ vue.defineComponent({
7735
- name: COMPONENT_NAME$q,
8343
+ name: COMPONENT_NAME$r,
7736
8344
  props: props$k,
7737
8345
  emits: ['refresh'],
7738
8346
  setup(props, {
@@ -7830,9 +8438,9 @@ const Container = /* @__PURE__ */ vue.defineComponent({
7830
8438
 
7831
8439
  /** @jsxImportSource vue */
7832
8440
 
7833
- const COMPONENT_NAME$p = 'vc-recycle-list-item';
8441
+ const COMPONENT_NAME$q = 'vc-recycle-list-item';
7834
8442
  const Item = /* @__PURE__ */ vue.defineComponent({
7835
- name: COMPONENT_NAME$p,
8443
+ name: COMPONENT_NAME$q,
7836
8444
  props: {
7837
8445
  vertical: {
7838
8446
  type: Boolean,
@@ -7875,9 +8483,9 @@ const Item = /* @__PURE__ */ vue.defineComponent({
7875
8483
 
7876
8484
  /** @jsxImportSource vue */
7877
8485
 
7878
- const COMPONENT_NAME$o = 'vc-recycle-list';
8486
+ const COMPONENT_NAME$p = 'vc-recycle-list';
7879
8487
  const RecycleList = /* @__PURE__ */ vue.defineComponent({
7880
- name: COMPONENT_NAME$o,
8488
+ name: COMPONENT_NAME$p,
7881
8489
  props: props$o,
7882
8490
  emits: ['scroll'],
7883
8491
  setup(props, {
@@ -8429,9 +9037,9 @@ const props$j = {
8429
9037
  }
8430
9038
  };
8431
9039
 
8432
- const COMPONENT_NAME$n = "vc-resizer";
9040
+ const COMPONENT_NAME$o = "vc-resizer";
8433
9041
  const Resizer = vue.defineComponent({
8434
- name: COMPONENT_NAME$n,
9042
+ name: COMPONENT_NAME$o,
8435
9043
  props: props$j,
8436
9044
  emit: ["resize", "change"],
8437
9045
  setup(props, { emit, slots }) {
@@ -8497,9 +9105,9 @@ const props$i = {
8497
9105
 
8498
9106
  /** @jsxImportSource vue */
8499
9107
 
8500
- const COMPONENT_NAME$m = 'vc-select';
9108
+ const COMPONENT_NAME$n = 'vc-select';
8501
9109
  const Select = /* @__PURE__ */ vue.defineComponent({
8502
- name: COMPONENT_NAME$m,
9110
+ name: COMPONENT_NAME$n,
8503
9111
  props: props$i,
8504
9112
  setup(props, {
8505
9113
  slots
@@ -8523,9 +9131,9 @@ const props$h = {
8523
9131
 
8524
9132
  /** @jsxImportSource vue */
8525
9133
 
8526
- const COMPONENT_NAME$l = 'vc-slider';
9134
+ const COMPONENT_NAME$m = 'vc-slider';
8527
9135
  const Slider = /* @__PURE__ */ vue.defineComponent({
8528
- name: COMPONENT_NAME$l,
9136
+ name: COMPONENT_NAME$m,
8529
9137
  props: props$h,
8530
9138
  setup(props, {
8531
9139
  slots
@@ -8549,9 +9157,9 @@ const props$g = {
8549
9157
 
8550
9158
  /** @jsxImportSource vue */
8551
9159
 
8552
- const COMPONENT_NAME$k = 'vc-sort-list';
9160
+ const COMPONENT_NAME$l = 'vc-sort-list';
8553
9161
  const SortList = /* @__PURE__ */ vue.defineComponent({
8554
- name: COMPONENT_NAME$k,
9162
+ name: COMPONENT_NAME$l,
8555
9163
  props: props$g,
8556
9164
  setup(props, {
8557
9165
  slots
@@ -8575,9 +9183,9 @@ const props$f = {
8575
9183
 
8576
9184
  /** @jsxImportSource vue */
8577
9185
 
8578
- const COMPONENT_NAME$j = 'vc-steps';
9186
+ const COMPONENT_NAME$k = 'vc-steps';
8579
9187
  const Steps = /* @__PURE__ */ vue.defineComponent({
8580
- name: COMPONENT_NAME$j,
9188
+ name: COMPONENT_NAME$k,
8581
9189
  props: props$f,
8582
9190
  setup(props, {
8583
9191
  slots
@@ -8593,30 +9201,178 @@ const Steps = /* @__PURE__ */ vue.defineComponent({
8593
9201
  const MSteps = Steps;
8594
9202
 
8595
9203
  const props$e = {
8596
- tag: {
9204
+ modelValue: {
9205
+ type: [String, Number, Boolean],
9206
+ default: false
9207
+ },
9208
+ checkedValue: {
9209
+ type: [String, Number, Boolean],
9210
+ default: true
9211
+ },
9212
+ uncheckedValue: {
9213
+ type: [String, Number, Boolean],
9214
+ default: false
9215
+ },
9216
+ disabled: {
9217
+ type: Boolean,
9218
+ default: false
9219
+ },
9220
+ name: {
9221
+ type: String
9222
+ },
9223
+ checkedText: {
8597
9224
  type: String,
8598
- default: "div"
9225
+ default: ""
9226
+ },
9227
+ uncheckedText: {
9228
+ type: String,
9229
+ default: ""
8599
9230
  }
8600
9231
  };
8601
9232
 
9233
+ const useSwitch = (expose) => {
9234
+ const instance = vue.getCurrentInstance();
9235
+ const formItem = vue.inject("vc-form-item", {});
9236
+ const { props, emit } = instance;
9237
+ const currentValue = vue.ref("");
9238
+ const isLoading = vue.ref(false);
9239
+ const checked = vue.computed(() => {
9240
+ return currentValue.value === props.checkedValue;
9241
+ });
9242
+ const classes = vue.computed(() => {
9243
+ return {
9244
+ "is-loading": isLoading.value,
9245
+ "is-checked": checked.value
9246
+ };
9247
+ });
9248
+ vue.watch(
9249
+ () => props.modelValue,
9250
+ (v) => {
9251
+ currentValue.value = v;
9252
+ },
9253
+ { immediate: true }
9254
+ );
9255
+ const reset = (value) => {
9256
+ currentValue.value = value === props.checkedValue ? props.checkedValue : props.uncheckedValue;
9257
+ };
9258
+ const sync = (e) => {
9259
+ emit("update:modelValue", currentValue.value, e, reset);
9260
+ emit("change", currentValue.value, e, reset);
9261
+ formItem?.change?.(currentValue.value);
9262
+ };
9263
+ const handleToggle = (e) => {
9264
+ e.preventDefault();
9265
+ if (props.disabled || isLoading.value) {
9266
+ return false;
9267
+ }
9268
+ const callback = () => {
9269
+ const value = currentValue.value === props.checkedValue ? props.uncheckedValue : props.checkedValue;
9270
+ reset(value);
9271
+ sync(e);
9272
+ };
9273
+ const { onClick } = instance.vnode.props || {};
9274
+ const fn = onClick && onClick(e, reset);
9275
+ if (fn && fn.then) {
9276
+ isLoading.value = true;
9277
+ fn.then((res) => {
9278
+ callback();
9279
+ return res;
9280
+ }).finally(() => {
9281
+ isLoading.value = false;
9282
+ });
9283
+ } else if (!fn) {
9284
+ callback();
9285
+ }
9286
+ };
9287
+ expose({ reset });
9288
+ return {
9289
+ currentValue,
9290
+ isLoading,
9291
+ classes,
9292
+ checked,
9293
+ handleToggle,
9294
+ sync,
9295
+ reset
9296
+ };
9297
+ };
9298
+
8602
9299
  /** @jsxImportSource vue */
8603
9300
 
8604
- const COMPONENT_NAME$i = 'vc-switch';
9301
+ const COMPONENT_NAME$j = 'vc-switch';
8605
9302
  const Switch = /* @__PURE__ */ vue.defineComponent({
8606
- name: COMPONENT_NAME$i,
9303
+ name: COMPONENT_NAME$j,
8607
9304
  props: props$e,
9305
+ // click -> onClick要被拦截,此处不能放置
9306
+ emits: ['update:modelValue', 'change', 'click'],
8608
9307
  setup(props, {
8609
- slots
9308
+ slots,
9309
+ expose
8610
9310
  }) {
9311
+ const {
9312
+ classes,
9313
+ currentValue,
9314
+ isLoading,
9315
+ handleToggle
9316
+ } = useSwitch(expose);
8611
9317
  return () => {
8612
- return vue.createVNode("div", {
8613
- "class": "vc-switch"
8614
- }, [slots?.default?.()]);
9318
+ return vue.createVNode("span", {
9319
+ "class": [classes.value, 'vc-switch'],
9320
+ "onClick": handleToggle
9321
+ }, [vue.createVNode("input", {
9322
+ "name": props.name,
9323
+ "value": currentValue.value,
9324
+ "type": "hidden"
9325
+ }, null), vue.createVNode("span", {
9326
+ "class": "vc-switch__content"
9327
+ }, [currentValue.value === props.checkedValue ? slots.checked ? slots.checked() : props.checkedText : null, currentValue.value === props.uncheckedValue ? slots.unchecked ? slots.unchecked() : props.uncheckedText : null]), vue.createVNode("span", {
9328
+ "class": "vc-switch__inner"
9329
+ }, null), isLoading.value && vue.createVNode(Spin, {
9330
+ "size": 14,
9331
+ "foreground": "#fff",
9332
+ "class": "vc-switch__loading"
9333
+ }, null)]);
8615
9334
  };
8616
9335
  }
8617
9336
  });
8618
9337
 
8619
- const MSwitch = Switch;
9338
+ /** @jsxImportSource vue */
9339
+
9340
+ const COMPONENT_NAME$i = 'vcm-switch';
9341
+ const MSwitch = /* @__PURE__ */ vue.defineComponent({
9342
+ name: COMPONENT_NAME$i,
9343
+ props: props$e,
9344
+ // click -> onClick要被拦截,此处不能放置
9345
+ emits: ['update:modelValue', 'change', 'click'],
9346
+ setup(props, {
9347
+ slots,
9348
+ expose
9349
+ }) {
9350
+ const {
9351
+ classes,
9352
+ currentValue,
9353
+ isLoading,
9354
+ handleToggle
9355
+ } = useSwitch(expose);
9356
+ return () => {
9357
+ return vue.createVNode("span", {
9358
+ "class": [classes.value, 'vcm-switch'],
9359
+ "onClick": handleToggle
9360
+ }, [vue.createVNode("input", {
9361
+ "name": props.name,
9362
+ "value": currentValue.value,
9363
+ "type": "hidden"
9364
+ }, null), vue.createVNode("span", {
9365
+ "class": "vcm-switch__content"
9366
+ }, [currentValue.value === props.checkedValue ? slots.checked ? slots.checked() : props.checkedText : null, currentValue.value === props.uncheckedValue ? slots.unchecked ? slots.unchecked() : props.uncheckedText : null]), vue.createVNode("span", {
9367
+ "class": "vcm-switch__inner"
9368
+ }, null), isLoading.value && vue.createVNode(MSpin, {
9369
+ "size": 14,
9370
+ "foreground": "#fff",
9371
+ "class": "vcm-switch__loading"
9372
+ }, null)]);
9373
+ };
9374
+ }
9375
+ });
8620
9376
 
8621
9377
  const props$d = {
8622
9378
  tag: {
@@ -9421,9 +10177,106 @@ const props$8 = {
9421
10177
  tag: {
9422
10178
  type: String,
9423
10179
  default: "div"
10180
+ },
10181
+ value: {
10182
+ type: String,
10183
+ default: ""
10184
+ },
10185
+ line: {
10186
+ type: Number,
10187
+ default: 0
10188
+ },
10189
+ // TODO: 是否改为tail-indent来表示尾部缩进
10190
+ indent: {
10191
+ type: Number,
10192
+ default: 0
10193
+ },
10194
+ resize: {
10195
+ type: [Boolean, Number],
10196
+ default: 100
10197
+ },
10198
+ suffix: {
10199
+ type: String,
10200
+ default: "..."
10201
+ },
10202
+ placement: {
10203
+ type: String,
10204
+ default: "top"
10205
+ },
10206
+ portalClassName: [Object, String, Array],
10207
+ portalStyle: [Object, String, Array],
10208
+ renderRow: {
10209
+ type: Function,
10210
+ // 函数式可以用于高亮显示
10211
+ default: (props$) => {
10212
+ const { value } = props$;
10213
+ return vue.h("span", {}, value);
10214
+ }
9424
10215
  }
9425
10216
  };
9426
10217
 
10218
+ const HIDDEN_TEXT_STYLE = `
10219
+ position: absolute!important;
10220
+ word-break: break-all!important;
10221
+ overflow: auto!important;
10222
+ opacity: 0!important;
10223
+ z-index: -1000!important;
10224
+ top: 0!important;
10225
+ right: 0!important;
10226
+ `;
10227
+ const SIZING_STYLE = [
10228
+ "letter-spacing",
10229
+ "line-height",
10230
+ "padding-top",
10231
+ "padding-bottom",
10232
+ "font-family",
10233
+ "font-weight",
10234
+ "font-size",
10235
+ "text-rendering",
10236
+ "text-transform",
10237
+ "width",
10238
+ // 'text-indent', // 需要额外计算
10239
+ "padding-left",
10240
+ "padding-right",
10241
+ "border-width",
10242
+ "box-sizing"
10243
+ ];
10244
+ let hiddenEl;
10245
+ const getFitIndex = (options = {}) => {
10246
+ const { el, line, value, suffix, indent } = options;
10247
+ let lineHeight = parseInt($.getStyle(el, "line-height"), 10);
10248
+ if (!hiddenEl) {
10249
+ hiddenEl = document.createElement("div");
10250
+ document.body.appendChild(hiddenEl);
10251
+ }
10252
+ el.getAttribute("wrap") ? hiddenEl.setAttribute("wrap", el.getAttribute("wrap")) : hiddenEl.removeAttribute("wrap");
10253
+ const {
10254
+ paddingSize,
10255
+ borderSize,
10256
+ boxSizing,
10257
+ sizingStyle
10258
+ } = vcShared.Utils.getComputedStyle(el, SIZING_STYLE);
10259
+ const textIndent = `text-indent: ${parseInt($.getStyle(el, "text-indent"), 10) + indent}px;`;
10260
+ hiddenEl.setAttribute("style", `${sizingStyle};${textIndent};${HIDDEN_TEXT_STYLE}`);
10261
+ let sideHeight = paddingSize || 0;
10262
+ boxSizing === "border-box" && (sideHeight += borderSize);
10263
+ if (Number.isNaN(lineHeight)) {
10264
+ hiddenEl.innerText = ".";
10265
+ lineHeight = hiddenEl.clientHeight - sideHeight;
10266
+ }
10267
+ let endIndex = 0;
10268
+ hiddenEl.innerText = suffix;
10269
+ value.split("").forEach((item, i) => {
10270
+ let old = hiddenEl.innerText;
10271
+ old = old.substring(0, old.length - suffix.length);
10272
+ hiddenEl.innerText = old + item + suffix;
10273
+ if (hiddenEl.clientHeight - sideHeight > lineHeight * line && endIndex === 0) {
10274
+ endIndex = i;
10275
+ }
10276
+ });
10277
+ return endIndex;
10278
+ };
10279
+
9427
10280
  /** @jsxImportSource vue */
9428
10281
 
9429
10282
  const COMPONENT_NAME$b = 'vc-text';
@@ -9431,12 +10284,81 @@ const Text = /* @__PURE__ */ vue.defineComponent({
9431
10284
  name: COMPONENT_NAME$b,
9432
10285
  props: props$8,
9433
10286
  setup(props, {
9434
- slots
10287
+ emit
9435
10288
  }) {
10289
+ const instance = vue.getCurrentInstance();
10290
+ const isActive = vue.ref(false);
10291
+ const endIndex = vue.ref(0);
10292
+ const styles = vue.computed(() => {
10293
+ return {
10294
+ cursor: endIndex.value === 0 ? 'unset' : 'pointer'
10295
+ };
10296
+ });
10297
+ const calcPosition = () => {
10298
+ const {
10299
+ suffix,
10300
+ line,
10301
+ value,
10302
+ indent
10303
+ } = props;
10304
+ if (line === 0) {
10305
+ endIndex.value = 0;
10306
+ isActive.value = true;
10307
+ } else {
10308
+ endIndex.value = getFitIndex({
10309
+ el: instance.vnode.el,
10310
+ line,
10311
+ value,
10312
+ suffix,
10313
+ indent
10314
+ });
10315
+ isActive.value = true;
10316
+ }
10317
+ emit('clip', endIndex.value);
10318
+ };
10319
+ const handleResize = props.resize === true || props.resize === 0 ? calcPosition : lodashEs.debounce(calcPosition, props.resize || 0);
10320
+ const handleMouseOver = e => {
10321
+ if (endIndex.value > 0) {
10322
+ Popover.open({
10323
+ el: document.body,
10324
+ name: 'vc-text-popover',
10325
+ // 确保不重复创建
10326
+ triggerEl: e.target,
10327
+ hover: true,
10328
+ theme: 'dark',
10329
+ placement: props.placement,
10330
+ portalClassName: props.portalClassName,
10331
+ portalStyle: props.portalStyle || `width: ${e.target.clientWidth}px`,
10332
+ content: props.value
10333
+ });
10334
+ }
10335
+ };
10336
+ const handleMouseOut = () => {
10337
+ // Do.
10338
+ };
10339
+ ['value', 'indent', 'line'].forEach(key => {
10340
+ vue.watch(() => props[key], calcPosition);
10341
+ });
10342
+ vue.onMounted(() => {
10343
+ props.resize !== false && helperResize.Resize.on(instance.vnode.el, handleResize); // 首次会执行一次
10344
+ });
10345
+ vue.onBeforeUnmount(() => {
10346
+ props.resize !== false && helperResize.Resize.off(instance.vnode.el, handleResize);
10347
+ });
10348
+ const Content = props.tag;
9436
10349
  return () => {
9437
- return vue.createVNode("div", {
9438
- "class": "vc-text"
9439
- }, [slots?.default?.()]);
10350
+ return vue.createVNode(Content, {
10351
+ "class": "vc-text",
10352
+ "style": styles.value,
10353
+ "onMouseover": handleMouseOver,
10354
+ "onMouseout": handleMouseOut
10355
+ }, {
10356
+ default: () => [isActive.value ? vue.createVNode(Customer, {
10357
+ "value": endIndex.value > 0 ? `${props.value.slice(0, endIndex.value)}${props.suffix}` : props.value,
10358
+ "index": endIndex.value,
10359
+ "render": props.renderRow
10360
+ }, null) : null]
10361
+ });
9440
10362
  };
9441
10363
  }
9442
10364
  });
@@ -9824,6 +10746,7 @@ exports.Carousel = Carousel;
9824
10746
  exports.Cascader = Cascader;
9825
10747
  exports.Chart = Chart;
9826
10748
  exports.Checkbox = Checkbox;
10749
+ exports.CheckboxGroup = CheckboxGroup;
9827
10750
  exports.Clipboard = Clipboard;
9828
10751
  exports.Collapse = Collapse;
9829
10752
  exports.CollapseItem = CollapseItem;
@@ -9864,6 +10787,7 @@ exports.MCarousel = MCarousel;
9864
10787
  exports.MCascader = MCascader;
9865
10788
  exports.MChart = MChart;
9866
10789
  exports.MCheckbox = MCheckbox;
10790
+ exports.MCheckboxGroup = MCheckboxGroup;
9867
10791
  exports.MClipboard = MClipboard;
9868
10792
  exports.MCollapse = MCollapse;
9869
10793
  exports.MCollapseItem = MCollapseItem;
@@ -9906,6 +10830,7 @@ exports.MPortal = MPortal;
9906
10830
  exports.MPrint = MPrint;
9907
10831
  exports.MProgress = MProgress;
9908
10832
  exports.MRadio = MRadio;
10833
+ exports.MRadioGroup = MRadioGroup;
9909
10834
  exports.MRate = MRate;
9910
10835
  exports.MRecycleList = MRecycleList;
9911
10836
  exports.MResizer = MResizer;
@@ -9954,6 +10879,7 @@ exports.PortalView = PortalView;
9954
10879
  exports.Print = Print;
9955
10880
  exports.Progress = Progress;
9956
10881
  exports.Radio = Radio;
10882
+ exports.RadioGroup = RadioGroup;
9957
10883
  exports.Rate = Rate;
9958
10884
  exports.RecycleList = RecycleList;
9959
10885
  exports.Resizer = Resizer;