@deot/vc 1.0.9 → 1.0.10

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.
@@ -9089,6 +9089,10 @@ var Vc = (function (exports, vue) {
9089
9089
  changeOnSelect: {
9090
9090
  type: Boolean,
9091
9091
  default: false
9092
+ },
9093
+ nullValue: {
9094
+ type: [Number, String, Object],
9095
+ default: ""
9092
9096
  }
9093
9097
  };
9094
9098
  const getInfo = (value) => {
@@ -10318,6 +10322,7 @@ var Vc = (function (exports, vue) {
10318
10322
  datetime: "YYYY-MM-DD HH:mm:ss",
10319
10323
  time: "HH:mm:ss",
10320
10324
  timerange: "HH:mm:ss",
10325
+ monthrange: "YYYY-MM",
10321
10326
  daterange: "YYYY-MM-DD",
10322
10327
  datetimerange: "YYYY-MM-DD HH:mm:ss"
10323
10328
  };
@@ -10862,8 +10867,8 @@ var Vc = (function (exports, vue) {
10862
10867
  const props2 = instance.props;
10863
10868
  const isHover = vue.ref(false);
10864
10869
  const isActive = vue.ref(false);
10865
- const currentValue = vue.ref("");
10866
- const focusedDate = vue.ref(null);
10870
+ const currentValue = vue.ref([]);
10871
+ const focusedDate = vue.ref();
10867
10872
  const formItem = vue.inject("vc-form-item", {});
10868
10873
  const its = useAttrs({ merge: false });
10869
10874
  const formatDateText = (value) => {
@@ -10928,23 +10933,22 @@ var Vc = (function (exports, vue) {
10928
10933
  };
10929
10934
  const parseValue = (val) => {
10930
10935
  if (isEmpty(val)) {
10931
- return isRange.value ? [null, null] : [];
10936
+ return [];
10932
10937
  }
10933
10938
  return parserDate(val);
10934
10939
  };
10935
- const rest = (date) => {
10936
- currentValue.value = date;
10940
+ const reset = (v) => {
10941
+ currentValue.value = value2Array(v);
10937
10942
  };
10938
10943
  const sync = (eventName, value) => {
10939
- const date = isRange.value || isQuarter.value ? value : value[0];
10940
- const dateString = formatDate2(value);
10941
- emit("input", date);
10942
- emit("update:modelValue", dateString);
10944
+ const formatValue = formatDate2(isRange.value || isQuarter.value ? value : value[0]) || props2.nullValue;
10945
+ emit("update:modelValue", formatValue);
10943
10946
  eventName = typeof eventName === "string" ? [eventName] : eventName;
10944
10947
  eventName.forEach((name) => {
10945
- emit(name, dateString, rest);
10948
+ emit(name, formatValue, reset);
10946
10949
  });
10947
- formItem?.change?.(date);
10950
+ formItem?.change?.();
10951
+ return formatValue;
10948
10952
  };
10949
10953
  const executePromise = (promiseFn, cb, param) => {
10950
10954
  try {
@@ -10974,11 +10978,9 @@ var Vc = (function (exports, vue) {
10974
10978
  };
10975
10979
  const handleClear = () => {
10976
10980
  const clear = () => {
10977
- const date = isRange.value ? [] : "";
10978
10981
  isActive.value = false;
10979
- currentValue.value = date;
10980
- sync("change", date);
10981
- emit("clear", date);
10982
+ currentValue.value = [];
10983
+ emit("clear", sync("change", []));
10982
10984
  };
10983
10985
  executePromise(instance.vnode.props?.onBeforeClear, clear);
10984
10986
  };
@@ -10995,10 +10997,10 @@ var Vc = (function (exports, vue) {
10995
10997
  executePromise(instance.vnode.props?.onBeforeOk, ok, value);
10996
10998
  };
10997
10999
  const handleClose = () => {
10998
- const val = parseValue(props2.modelValue);
10999
- const isSetValueProp = instance.props.modelValue;
11000
- if (!isEqualWith(currentValue.value, val) && isSetValueProp) {
11001
- currentValue.value = value2Array(val);
11000
+ const v = parseValue(props2.modelValue);
11001
+ const isSetValueProp = props2.modelValue;
11002
+ if (!isEqualWith(currentValue.value, v) && isSetValueProp) {
11003
+ currentValue.value = value2Array(v);
11002
11004
  }
11003
11005
  emit("close");
11004
11006
  };
@@ -11006,7 +11008,7 @@ var Vc = (function (exports, vue) {
11006
11008
  () => props2.modelValue,
11007
11009
  (v) => {
11008
11010
  v = parseValue(v);
11009
- focusedDate.value = v[0] || props2.startDate || /* @__PURE__ */ new Date();
11011
+ focusedDate.value = v?.[0] || props2.startDate || /* @__PURE__ */ new Date();
11010
11012
  currentValue.value = value2Array(v);
11011
11013
  },
11012
11014
  { immediate: true }
@@ -11039,7 +11041,7 @@ var Vc = (function (exports, vue) {
11039
11041
  handleClose
11040
11042
  };
11041
11043
  };
11042
- const COMPONENT_NAME$1l = "vc-picker";
11044
+ const COMPONENT_NAME$1l = "vc-date-picker";
11043
11045
  const createPicker = (pickerProps, usePicker) => /* @__PURE__ */ vue.defineComponent({
11044
11046
  name: COMPONENT_NAME$1l,
11045
11047
  props: Object.assign(props$Y, pickerProps),
@@ -11097,7 +11099,7 @@ var Vc = (function (exports, vue) {
11097
11099
  "disabled": props2.disabled,
11098
11100
  "modelValue": visibleValue.value,
11099
11101
  "allowDispatch": false,
11100
- "class": "vc-picker__input",
11102
+ "class": "vc-date-picker__input",
11101
11103
  "readonly": true,
11102
11104
  "placeholder": props2.placeholder || "请选择"
11103
11105
  }, {
@@ -11105,7 +11107,7 @@ var Vc = (function (exports, vue) {
11105
11107
  return vue.createVNode("div", {
11106
11108
  "class": [{
11107
11109
  "is-clear": showClear
11108
- }, "vc-picker__append"]
11110
+ }, "vc-date-picker__append"]
11109
11111
  }, [vue.createVNode(Icon, {
11110
11112
  "type": showClear.value ? "clear" : icon.value,
11111
11113
  "onClick": handleIconClick
@@ -15990,11 +15992,6 @@ var Vc = (function (exports, vue) {
15990
15992
  };
15991
15993
  });
15992
15994
  useScrollbar(isActive);
15993
- vue.watch(() => props2.modelValue, (v) => {
15994
- isActive.value = v;
15995
- }, {
15996
- immediate: true
15997
- });
15998
15995
  let startX = 0;
15999
15996
  let startY = 0;
16000
15997
  let originX = VcInstance.globalEvent.x;
@@ -16012,7 +16009,17 @@ var Vc = (function (exports, vue) {
16012
16009
  }, 250, {
16013
16010
  leading: true
16014
16011
  });
16015
- const handleEnter = () => resetOrigin();
16012
+ const isTransitionEnd = vue.ref(false);
16013
+ const handleBeforeEnter = () => {
16014
+ isTransitionEnd.value = false;
16015
+ };
16016
+ const handleEnter = () => {
16017
+ resetOrigin();
16018
+ };
16019
+ const handleAfterEnter = () => {
16020
+ isTransitionEnd.value = true;
16021
+ resizer.value.refresh();
16022
+ };
16016
16023
  const handleRemove = () => {
16017
16024
  !instance.isUnmounted && (emit("close"), emit("portal-fulfilled"), emit("update:modelValue", false), emit("visible-change", false));
16018
16025
  };
@@ -16065,9 +16072,11 @@ var Vc = (function (exports, vue) {
16065
16072
  }
16066
16073
  };
16067
16074
  const handleContentResize = () => {
16068
- const has = !!scroller.value.wrapper.style.getPropertyValue("height");
16069
- has && scroller.value.wrapper.style.removeProperty("height");
16070
- has && resizer.value.refresh();
16075
+ const needRefreshScroller = !!scroller.value.wrapper.style.getPropertyValue("height");
16076
+ const needRefreshContainer = !!container.value.style.getPropertyValue("height");
16077
+ needRefreshContainer && container.value.style.removeProperty("height");
16078
+ needRefreshScroller && scroller.value.wrapper.style.removeProperty("height");
16079
+ needRefreshScroller && resizer.value.refresh();
16071
16080
  };
16072
16081
  const handleClick = (e) => {
16073
16082
  if (props2.draggable && isActive.value && originX) return;
@@ -16122,6 +16131,11 @@ var Vc = (function (exports, vue) {
16122
16131
  document.removeEventListener("mousemove", handleMouseMove);
16123
16132
  document.removeEventListener("mouseup", handleMouseUp);
16124
16133
  });
16134
+ vue.watch(() => props2.modelValue, (v) => {
16135
+ isActive.value = v;
16136
+ }, {
16137
+ immediate: true
16138
+ });
16125
16139
  expose({
16126
16140
  isActive,
16127
16141
  // for portal
@@ -16150,7 +16164,9 @@ var Vc = (function (exports, vue) {
16150
16164
  "onClick": (e) => handleClose(e, false)
16151
16165
  }, [vue.createVNode(TransitionScale, {
16152
16166
  "mode": "part",
16167
+ "onBeforeEnter": handleBeforeEnter,
16153
16168
  "onEnter": handleEnter,
16169
+ "onAfterEnter": handleAfterEnter,
16154
16170
  "onAfterLeave": handleRemove
16155
16171
  }, {
16156
16172
  default: () => [vue.withDirectives(vue.createVNode("div", {
@@ -16186,8 +16202,8 @@ var Vc = (function (exports, vue) {
16186
16202
  return vue.createVNode(Scroller, {
16187
16203
  "ref": scroller,
16188
16204
  "native": false,
16189
- "always": true,
16190
- "height": row.height,
16205
+ "always": false,
16206
+ "height": isTransitionEnd.value ? row.height : void 0,
16191
16207
  "contentClass": [{
16192
16208
  "is-confirm": props2.mode
16193
16209
  }, props2.portalClass, "vc-modal__content"]
@@ -17632,7 +17648,7 @@ var Vc = (function (exports, vue) {
17632
17648
  "fill-opacity": "0"
17633
17649
  }, null)]), vue.createVNode("div", {
17634
17650
  "class": "vc-progress-circle__inner"
17635
- }, [slots.default ? slots.default() : vue.createVNode("span", null, [`${props2.percent}%`])])])]);
17651
+ }, [slots.default ? slots.default() : props2.showText && vue.createVNode("span", null, [`${props2.percent}%`])])])]);
17636
17652
  };
17637
17653
  }
17638
17654
  });
@@ -20465,7 +20481,8 @@ var Vc = (function (exports, vue) {
20465
20481
  const { mode, size } = props2;
20466
20482
  const onRequest = instance.vnode.props?.onRequest || VcInstance.options.Upload?.onRequest || (() => {
20467
20483
  });
20468
- const onResponse = instance.vnode.props?.onResponse || VcInstance.options.Upload?.onResponse;
20484
+ const onResponse = instance.vnode.props?.onResponse || VcInstance.options.Upload?.onResponse || (() => {
20485
+ });
20469
20486
  const $mode = mode.replace(/s$/, "");
20470
20487
  const onError = async (originalResponse, internalMessage) => {
20471
20488
  delete requests[vFile.uploadId];
@@ -20474,9 +20491,17 @@ var Vc = (function (exports, vue) {
20474
20491
  emitError(originalResponse, internalMessage);
20475
20492
  done(vFile);
20476
20493
  };
20477
- const onSuccess = async (originalResponse) => {
20494
+ const onSuccess = async (request) => {
20478
20495
  try {
20479
- const response = await onResponse(originalResponse, options) || originalResponse;
20496
+ let response = await onResponse(request, options) || request;
20497
+ if (response === request) {
20498
+ const text = request.responseType ? request.responseText : request.response;
20499
+ try {
20500
+ response = JSON.parse(text);
20501
+ } catch {
20502
+ response = text;
20503
+ }
20504
+ }
20480
20505
  delete requests[vFile.uploadId];
20481
20506
  cycle.success++;
20482
20507
  cycle.responses = [...cycle.responses, response];
@@ -20510,7 +20535,7 @@ var Vc = (function (exports, vue) {
20510
20535
  xhr.onreadystatechange = () => {
20511
20536
  if (xhr.readyState !== 4 || xhr.status === 0) return;
20512
20537
  if (xhr.status >= 200 && xhr.status < 300) {
20513
- onSuccess(!xhr.responseType ? xhr.responseText : xhr.response);
20538
+ onSuccess(xhr);
20514
20539
  } else {
20515
20540
  onError({}, `服务异常`);
20516
20541
  }
@@ -20742,6 +20767,8 @@ var Vc = (function (exports, vue) {
20742
20767
  MDebounce: Debounce,
20743
20768
  Divider,
20744
20769
  MDivider,
20770
+ Drawer,
20771
+ MDrawer,
20745
20772
  DrawerView,
20746
20773
  MDrawerView,
20747
20774
  Dropdown,
@@ -20786,6 +20813,8 @@ var Vc = (function (exports, vue) {
20786
20813
  MListItem,
20787
20814
  Marquee,
20788
20815
  MMarquee,
20816
+ Modal,
20817
+ MModal: modal,
20789
20818
  ModalView,
20790
20819
  MModalView,
20791
20820
  Notice,
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { Utils } from '@deot/vc-shared';
2
2
  export * from '@deot/vc-hooks';
3
- import { MUploadPicker, UploadPicker, MUpload, Upload, MTree, Tree, MTransitionCollapse, TransitionCollapse, MTransitionZoom, TransitionZoom, MTransitionSlide, TransitionSlide, MTransitionScale, TransitionScale, MTransitionFade, TransitionFade, MTransition, Transition, MTouch, Touch, MTimePicker, TimePicker, MTimeline, Timeline, MTextarea, Textarea, MText, Text, MTag, Tag, MTabsPane, TabsPane, MTabs, Tabs, MTable, Table, MSwitch, Switch, MSteps, Steps, MSpin, Spin, MSortList, SortList, MSlider, Slider, MSelect, Select, MScroller, Scroller, MResizer, Resizer, MRecycleList, RecycleList, MRate, Rate, MRadioGroup, RadioGroup, MRadio, Radio, MProgress, Progress, MPrint, Print, MPopup, Popup, MPopover, Popover, MPopconfirm, Popconfirm, MPicker, Picker, MPagination, Pagination, MOption, Option, MNotice, Notice, MModalView, ModalView, MMarquee, Marquee, MListItem, ListItem, MList, List, MInputSearch, InputSearch, MInputNumber, InputNumber, MInput, Input, MImageProcessing, ImageProcessing, MImagePreview, ImagePreview, MImageCrop, ImageCrop, MImage, Image, MIcon, Icon, MHTMLToImage, HTMLToImage, MFragment, Fragment, MFormItem, FormItem, MForm, Form, MExpand, Expand, MEditor, Editor, MDropdown, Dropdown, MDrawerView, DrawerView, MDivider, Divider, MDebounce, Debounce, MDatePicker, DatePicker, MCustomer, Customer, MCountdown, Countdown, MColorPicker, ColorPicker, MCollapseItem, CollapseItem, MCollapse, Collapse, MClipboard, Clipboard, MCheckboxGroup, CheckboxGroup, MCheckbox, Checkbox, MChart, Chart, MCascader, Cascader, MCarousel, Carousel, MCard, Card, MCalendar, Calendar, MButtonGroup, ButtonGroup, MButton, Button, MArtboard, Artboard, MAlert, Alert, MActionSheet, ActionSheet, VcInstance } from '@deot/vc-components';
3
+ import { MUploadPicker, UploadPicker, MUpload, Upload, MTree, Tree, MTransitionCollapse, TransitionCollapse, MTransitionZoom, TransitionZoom, MTransitionSlide, TransitionSlide, MTransitionScale, TransitionScale, MTransitionFade, TransitionFade, MTransition, Transition, MTouch, Touch, MTimePicker, TimePicker, MTimeline, Timeline, MTextarea, Textarea, MText, Text, MTag, Tag, MTabsPane, TabsPane, MTabs, Tabs, MTable, Table, MSwitch, Switch, MSteps, Steps, MSpin, Spin, MSortList, SortList, MSlider, Slider, MSelect, Select, MScroller, Scroller, MResizer, Resizer, MRecycleList, RecycleList, MRate, Rate, MRadioGroup, RadioGroup, MRadio, Radio, MProgress, Progress, MPrint, Print, MPopup, Popup, MPopover, Popover, MPopconfirm, Popconfirm, MPicker, Picker, MPagination, Pagination, MOption, Option, MNotice, Notice, MModalView, ModalView, MModal, Modal, MMarquee, Marquee, MListItem, ListItem, MList, List, MInputSearch, InputSearch, MInputNumber, InputNumber, MInput, Input, MImageProcessing, ImageProcessing, MImagePreview, ImagePreview, MImageCrop, ImageCrop, MImage, Image, MIcon, Icon, MHTMLToImage, HTMLToImage, MFragment, Fragment, MFormItem, FormItem, MForm, Form, MExpand, Expand, MEditor, Editor, MDropdown, Dropdown, MDrawerView, DrawerView, MDrawer, Drawer, MDivider, Divider, MDebounce, Debounce, MDatePicker, DatePicker, MCustomer, Customer, MCountdown, Countdown, MColorPicker, ColorPicker, MCollapseItem, CollapseItem, MCollapse, Collapse, MClipboard, Clipboard, MCheckboxGroup, CheckboxGroup, MCheckbox, Checkbox, MChart, Chart, MCascader, Cascader, MCarousel, Carousel, MCard, Card, MCalendar, Calendar, MButtonGroup, ButtonGroup, MButton, Button, MArtboard, Artboard, MAlert, Alert, MActionSheet, ActionSheet, VcInstance } from '@deot/vc-components';
4
4
  export * from '@deot/vc-components';
5
5
 
6
6
  const Components = {
@@ -52,6 +52,8 @@ const Components = {
52
52
  MDebounce,
53
53
  Divider,
54
54
  MDivider,
55
+ Drawer,
56
+ MDrawer,
55
57
  DrawerView,
56
58
  MDrawerView,
57
59
  Dropdown,
@@ -96,6 +98,8 @@ const Components = {
96
98
  MListItem,
97
99
  Marquee,
98
100
  MMarquee,
101
+ Modal,
102
+ MModal,
99
103
  ModalView,
100
104
  MModalView,
101
105
  Notice,
@@ -9092,6 +9092,10 @@
9092
9092
  changeOnSelect: {
9093
9093
  type: Boolean,
9094
9094
  default: false
9095
+ },
9096
+ nullValue: {
9097
+ type: [Number, String, Object],
9098
+ default: ""
9095
9099
  }
9096
9100
  };
9097
9101
  const getInfo = (value) => {
@@ -10321,6 +10325,7 @@
10321
10325
  datetime: "YYYY-MM-DD HH:mm:ss",
10322
10326
  time: "HH:mm:ss",
10323
10327
  timerange: "HH:mm:ss",
10328
+ monthrange: "YYYY-MM",
10324
10329
  daterange: "YYYY-MM-DD",
10325
10330
  datetimerange: "YYYY-MM-DD HH:mm:ss"
10326
10331
  };
@@ -10865,8 +10870,8 @@
10865
10870
  const props2 = instance.props;
10866
10871
  const isHover = vue.ref(false);
10867
10872
  const isActive = vue.ref(false);
10868
- const currentValue = vue.ref("");
10869
- const focusedDate = vue.ref(null);
10873
+ const currentValue = vue.ref([]);
10874
+ const focusedDate = vue.ref();
10870
10875
  const formItem = vue.inject("vc-form-item", {});
10871
10876
  const its = useAttrs({ merge: false });
10872
10877
  const formatDateText = (value) => {
@@ -10931,23 +10936,22 @@
10931
10936
  };
10932
10937
  const parseValue = (val) => {
10933
10938
  if (isEmpty(val)) {
10934
- return isRange.value ? [null, null] : [];
10939
+ return [];
10935
10940
  }
10936
10941
  return parserDate(val);
10937
10942
  };
10938
- const rest = (date) => {
10939
- currentValue.value = date;
10943
+ const reset = (v) => {
10944
+ currentValue.value = value2Array(v);
10940
10945
  };
10941
10946
  const sync = (eventName, value) => {
10942
- const date = isRange.value || isQuarter.value ? value : value[0];
10943
- const dateString = formatDate2(value);
10944
- emit("input", date);
10945
- emit("update:modelValue", dateString);
10947
+ const formatValue = formatDate2(isRange.value || isQuarter.value ? value : value[0]) || props2.nullValue;
10948
+ emit("update:modelValue", formatValue);
10946
10949
  eventName = typeof eventName === "string" ? [eventName] : eventName;
10947
10950
  eventName.forEach((name) => {
10948
- emit(name, dateString, rest);
10951
+ emit(name, formatValue, reset);
10949
10952
  });
10950
- formItem?.change?.(date);
10953
+ formItem?.change?.();
10954
+ return formatValue;
10951
10955
  };
10952
10956
  const executePromise = (promiseFn, cb, param) => {
10953
10957
  try {
@@ -10977,11 +10981,9 @@
10977
10981
  };
10978
10982
  const handleClear = () => {
10979
10983
  const clear = () => {
10980
- const date = isRange.value ? [] : "";
10981
10984
  isActive.value = false;
10982
- currentValue.value = date;
10983
- sync("change", date);
10984
- emit("clear", date);
10985
+ currentValue.value = [];
10986
+ emit("clear", sync("change", []));
10985
10987
  };
10986
10988
  executePromise(instance.vnode.props?.onBeforeClear, clear);
10987
10989
  };
@@ -10998,10 +11000,10 @@
10998
11000
  executePromise(instance.vnode.props?.onBeforeOk, ok, value);
10999
11001
  };
11000
11002
  const handleClose = () => {
11001
- const val = parseValue(props2.modelValue);
11002
- const isSetValueProp = instance.props.modelValue;
11003
- if (!isEqualWith(currentValue.value, val) && isSetValueProp) {
11004
- currentValue.value = value2Array(val);
11003
+ const v = parseValue(props2.modelValue);
11004
+ const isSetValueProp = props2.modelValue;
11005
+ if (!isEqualWith(currentValue.value, v) && isSetValueProp) {
11006
+ currentValue.value = value2Array(v);
11005
11007
  }
11006
11008
  emit("close");
11007
11009
  };
@@ -11009,7 +11011,7 @@
11009
11011
  () => props2.modelValue,
11010
11012
  (v) => {
11011
11013
  v = parseValue(v);
11012
- focusedDate.value = v[0] || props2.startDate || /* @__PURE__ */ new Date();
11014
+ focusedDate.value = v?.[0] || props2.startDate || /* @__PURE__ */ new Date();
11013
11015
  currentValue.value = value2Array(v);
11014
11016
  },
11015
11017
  { immediate: true }
@@ -11042,7 +11044,7 @@
11042
11044
  handleClose
11043
11045
  };
11044
11046
  };
11045
- const COMPONENT_NAME$1l = "vc-picker";
11047
+ const COMPONENT_NAME$1l = "vc-date-picker";
11046
11048
  const createPicker = (pickerProps, usePicker) => /* @__PURE__ */ vue.defineComponent({
11047
11049
  name: COMPONENT_NAME$1l,
11048
11050
  props: Object.assign(props$Y, pickerProps),
@@ -11100,7 +11102,7 @@
11100
11102
  "disabled": props2.disabled,
11101
11103
  "modelValue": visibleValue.value,
11102
11104
  "allowDispatch": false,
11103
- "class": "vc-picker__input",
11105
+ "class": "vc-date-picker__input",
11104
11106
  "readonly": true,
11105
11107
  "placeholder": props2.placeholder || "请选择"
11106
11108
  }, {
@@ -11108,7 +11110,7 @@
11108
11110
  return vue.createVNode("div", {
11109
11111
  "class": [{
11110
11112
  "is-clear": showClear
11111
- }, "vc-picker__append"]
11113
+ }, "vc-date-picker__append"]
11112
11114
  }, [vue.createVNode(Icon, {
11113
11115
  "type": showClear.value ? "clear" : icon.value,
11114
11116
  "onClick": handleIconClick
@@ -15993,11 +15995,6 @@
15993
15995
  };
15994
15996
  });
15995
15997
  useScrollbar(isActive);
15996
- vue.watch(() => props2.modelValue, (v) => {
15997
- isActive.value = v;
15998
- }, {
15999
- immediate: true
16000
- });
16001
15998
  let startX = 0;
16002
15999
  let startY = 0;
16003
16000
  let originX = VcInstance.globalEvent.x;
@@ -16015,7 +16012,17 @@
16015
16012
  }, 250, {
16016
16013
  leading: true
16017
16014
  });
16018
- const handleEnter = () => resetOrigin();
16015
+ const isTransitionEnd = vue.ref(false);
16016
+ const handleBeforeEnter = () => {
16017
+ isTransitionEnd.value = false;
16018
+ };
16019
+ const handleEnter = () => {
16020
+ resetOrigin();
16021
+ };
16022
+ const handleAfterEnter = () => {
16023
+ isTransitionEnd.value = true;
16024
+ resizer.value.refresh();
16025
+ };
16019
16026
  const handleRemove = () => {
16020
16027
  !instance.isUnmounted && (emit("close"), emit("portal-fulfilled"), emit("update:modelValue", false), emit("visible-change", false));
16021
16028
  };
@@ -16068,9 +16075,11 @@
16068
16075
  }
16069
16076
  };
16070
16077
  const handleContentResize = () => {
16071
- const has = !!scroller.value.wrapper.style.getPropertyValue("height");
16072
- has && scroller.value.wrapper.style.removeProperty("height");
16073
- has && resizer.value.refresh();
16078
+ const needRefreshScroller = !!scroller.value.wrapper.style.getPropertyValue("height");
16079
+ const needRefreshContainer = !!container.value.style.getPropertyValue("height");
16080
+ needRefreshContainer && container.value.style.removeProperty("height");
16081
+ needRefreshScroller && scroller.value.wrapper.style.removeProperty("height");
16082
+ needRefreshScroller && resizer.value.refresh();
16074
16083
  };
16075
16084
  const handleClick = (e) => {
16076
16085
  if (props2.draggable && isActive.value && originX) return;
@@ -16125,6 +16134,11 @@
16125
16134
  document.removeEventListener("mousemove", handleMouseMove);
16126
16135
  document.removeEventListener("mouseup", handleMouseUp);
16127
16136
  });
16137
+ vue.watch(() => props2.modelValue, (v) => {
16138
+ isActive.value = v;
16139
+ }, {
16140
+ immediate: true
16141
+ });
16128
16142
  expose({
16129
16143
  isActive,
16130
16144
  // for portal
@@ -16153,7 +16167,9 @@
16153
16167
  "onClick": (e) => handleClose(e, false)
16154
16168
  }, [vue.createVNode(TransitionScale, {
16155
16169
  "mode": "part",
16170
+ "onBeforeEnter": handleBeforeEnter,
16156
16171
  "onEnter": handleEnter,
16172
+ "onAfterEnter": handleAfterEnter,
16157
16173
  "onAfterLeave": handleRemove
16158
16174
  }, {
16159
16175
  default: () => [vue.withDirectives(vue.createVNode("div", {
@@ -16189,8 +16205,8 @@
16189
16205
  return vue.createVNode(Scroller, {
16190
16206
  "ref": scroller,
16191
16207
  "native": false,
16192
- "always": true,
16193
- "height": row.height,
16208
+ "always": false,
16209
+ "height": isTransitionEnd.value ? row.height : void 0,
16194
16210
  "contentClass": [{
16195
16211
  "is-confirm": props2.mode
16196
16212
  }, props2.portalClass, "vc-modal__content"]
@@ -17635,7 +17651,7 @@
17635
17651
  "fill-opacity": "0"
17636
17652
  }, null)]), vue.createVNode("div", {
17637
17653
  "class": "vc-progress-circle__inner"
17638
- }, [slots.default ? slots.default() : vue.createVNode("span", null, [`${props2.percent}%`])])])]);
17654
+ }, [slots.default ? slots.default() : props2.showText && vue.createVNode("span", null, [`${props2.percent}%`])])])]);
17639
17655
  };
17640
17656
  }
17641
17657
  });
@@ -20468,7 +20484,8 @@
20468
20484
  const { mode, size } = props2;
20469
20485
  const onRequest = instance.vnode.props?.onRequest || VcInstance.options.Upload?.onRequest || (() => {
20470
20486
  });
20471
- const onResponse = instance.vnode.props?.onResponse || VcInstance.options.Upload?.onResponse;
20487
+ const onResponse = instance.vnode.props?.onResponse || VcInstance.options.Upload?.onResponse || (() => {
20488
+ });
20472
20489
  const $mode = mode.replace(/s$/, "");
20473
20490
  const onError = async (originalResponse, internalMessage) => {
20474
20491
  delete requests[vFile.uploadId];
@@ -20477,9 +20494,17 @@
20477
20494
  emitError(originalResponse, internalMessage);
20478
20495
  done(vFile);
20479
20496
  };
20480
- const onSuccess = async (originalResponse) => {
20497
+ const onSuccess = async (request) => {
20481
20498
  try {
20482
- const response = await onResponse(originalResponse, options) || originalResponse;
20499
+ let response = await onResponse(request, options) || request;
20500
+ if (response === request) {
20501
+ const text = request.responseType ? request.responseText : request.response;
20502
+ try {
20503
+ response = JSON.parse(text);
20504
+ } catch {
20505
+ response = text;
20506
+ }
20507
+ }
20483
20508
  delete requests[vFile.uploadId];
20484
20509
  cycle.success++;
20485
20510
  cycle.responses = [...cycle.responses, response];
@@ -20513,7 +20538,7 @@
20513
20538
  xhr.onreadystatechange = () => {
20514
20539
  if (xhr.readyState !== 4 || xhr.status === 0) return;
20515
20540
  if (xhr.status >= 200 && xhr.status < 300) {
20516
- onSuccess(!xhr.responseType ? xhr.responseText : xhr.response);
20541
+ onSuccess(xhr);
20517
20542
  } else {
20518
20543
  onError({}, `服务异常`);
20519
20544
  }
@@ -20745,6 +20770,8 @@
20745
20770
  MDebounce: Debounce,
20746
20771
  Divider,
20747
20772
  MDivider,
20773
+ Drawer,
20774
+ MDrawer,
20748
20775
  DrawerView,
20749
20776
  MDrawerView,
20750
20777
  Dropdown,
@@ -20789,6 +20816,8 @@
20789
20816
  MListItem,
20790
20817
  Marquee,
20791
20818
  MMarquee,
20819
+ Modal,
20820
+ MModal: modal,
20792
20821
  ModalView,
20793
20822
  MModalView,
20794
20823
  Notice,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/vc",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,9 +19,9 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@deot/vc-components": "^1.0.9",
23
- "@deot/vc-hooks": "^1.0.9",
24
- "@deot/vc-shared": "^1.0.9"
22
+ "@deot/vc-components": "^1.0.10",
23
+ "@deot/vc-hooks": "^1.0.10",
24
+ "@deot/vc-shared": "^1.0.10"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "vue": "*"