vue-devui 1.0.0-rc.10 → 1.0.0-rc.11

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.
Files changed (94) hide show
  1. package/README.md +149 -149
  2. package/auto-complete/index.es.js +22 -14
  3. package/auto-complete/index.umd.js +8 -8
  4. package/auto-complete/style.css +1 -1
  5. package/badge/index.es.js +5 -1
  6. package/badge/index.umd.js +1 -1
  7. package/badge/style.css +1 -1
  8. package/button/index.es.js +1 -1
  9. package/button/index.umd.js +1 -1
  10. package/button/style.css +1 -1
  11. package/card/index.es.js +5 -1
  12. package/card/index.umd.js +1 -1
  13. package/card/style.css +1 -1
  14. package/checkbox/index.es.js +21 -13
  15. package/checkbox/index.umd.js +7 -7
  16. package/checkbox/style.css +1 -1
  17. package/collapse/index.es.js +1 -1
  18. package/collapse/index.umd.js +1 -1
  19. package/collapse/style.css +1 -1
  20. package/date-picker/index.es.js +22 -14
  21. package/date-picker/index.umd.js +9 -9
  22. package/date-picker/style.css +1 -1
  23. package/editable-select/style.css +1 -1
  24. package/form/index.es.js +21 -13
  25. package/form/index.umd.js +11 -11
  26. package/icon/index.es.js +1 -1
  27. package/icon/index.umd.js +1 -1
  28. package/icon/style.css +1 -1
  29. package/image-preview/style.css +1 -1
  30. package/input/index.es.js +22 -14
  31. package/input/index.umd.js +7 -7
  32. package/input/style.css +1 -1
  33. package/input-number/style.css +1 -1
  34. package/modal/index.es.js +1 -1
  35. package/modal/index.umd.js +1 -1
  36. package/modal/style.css +1 -1
  37. package/notification/index.es.js +1 -1
  38. package/notification/index.umd.js +1 -1
  39. package/notification/style.css +1 -1
  40. package/nuxt/components/TABLE_TOKEN.js +3 -0
  41. package/nuxt/components/TimeSelect.js +3 -0
  42. package/nuxt/components/tableProps.js +3 -0
  43. package/package.json +2 -1
  44. package/pagination/style.css +1 -1
  45. package/panel/style.css +1 -1
  46. package/radio/index.es.js +21 -13
  47. package/radio/index.umd.js +7 -7
  48. package/radio/style.css +1 -1
  49. package/rate/style.css +1 -1
  50. package/result/index.es.js +1 -1
  51. package/result/index.umd.js +1 -1
  52. package/result/style.css +1 -1
  53. package/search/index.es.js +23 -14
  54. package/search/index.umd.js +7 -7
  55. package/search/style.css +1 -1
  56. package/select/index.es.js +45 -18
  57. package/select/index.umd.js +11 -11
  58. package/select/style.css +1 -1
  59. package/slider/index.es.js +116 -143
  60. package/slider/index.umd.js +1 -1
  61. package/slider/style.css +1 -1
  62. package/statistic/index.es.js +34 -16
  63. package/statistic/index.umd.js +1 -1
  64. package/statistic/style.css +1 -1
  65. package/status/style.css +1 -1
  66. package/style.css +1 -1
  67. package/switch/index.es.js +21 -13
  68. package/switch/index.umd.js +9 -9
  69. package/switch/style.css +1 -1
  70. package/table/index.es.js +212 -177
  71. package/table/index.umd.js +15 -15
  72. package/table/style.css +1 -1
  73. package/tabs/index.es.js +3 -1
  74. package/tabs/index.umd.js +1 -1
  75. package/tabs/style.css +1 -1
  76. package/textarea/index.es.js +21 -13
  77. package/textarea/index.umd.js +9 -9
  78. package/textarea/style.css +1 -1
  79. package/time-select/index.d.ts +7 -0
  80. package/time-select/index.es.js +9460 -0
  81. package/time-select/index.umd.js +27 -0
  82. package/time-select/package.json +7 -0
  83. package/time-select/style.css +1 -0
  84. package/timeline/index.es.js +1 -1
  85. package/timeline/index.umd.js +1 -1
  86. package/timeline/style.css +1 -1
  87. package/tree/index.es.js +1073 -63
  88. package/tree/index.umd.js +17 -17
  89. package/tree/style.css +1 -1
  90. package/upload/index.es.js +49 -11
  91. package/upload/index.umd.js +1 -1
  92. package/upload/style.css +1 -1
  93. package/vue-devui.es.js +1756 -493
  94. package/vue-devui.umd.js +21 -21
package/vue-devui.es.js CHANGED
@@ -33,7 +33,7 @@ var __publicField = (obj, key, value) => {
33
33
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
34
34
  return value;
35
35
  };
36
- import { createVNode, defineComponent, ref, onMounted, Transition, withDirectives, vShow, nextTick, watch, provide, reactive, toRefs, onUnmounted, mergeProps, unref, Comment, Text, h, Fragment, inject, cloneVNode, computed, Teleport, createTextVNode, onBeforeUnmount, render, resolveDirective, resolveDynamicComponent, isVNode, toRef, shallowRef, createApp, withModifiers, resolveComponent, renderSlot, useSlots, effect, onBeforeMount, onUpdated, getCurrentInstance } from "vue";
36
+ import { createVNode, defineComponent, ref, onMounted, Transition, withDirectives, vShow, nextTick, watch, provide, reactive, toRefs, onUnmounted, mergeProps, unref, Comment, Text, h, Fragment, inject, cloneVNode, computed, Teleport, createTextVNode, onBeforeUnmount, render, resolveDirective, resolveDynamicComponent, isVNode, toRef, shallowRef, createApp, withModifiers, resolveComponent, renderSlot, useSlots, effect, onBeforeMount, onUpdated, watchEffect, getCurrentInstance, toRaw } from "vue";
37
37
  import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
38
38
  import { onClickOutside } from "@vueuse/core";
39
39
  const AlertCloseIcon = () => createVNode("svg", {
@@ -1972,7 +1972,7 @@ var lodash = { exports: {} };
1972
1972
  }
1973
1973
  function baseFunctions(object4, props) {
1974
1974
  return arrayFilter(props, function(key) {
1975
- return isFunction(object4[key]);
1975
+ return isFunction2(object4[key]);
1976
1976
  });
1977
1977
  }
1978
1978
  function baseGet(object4, path) {
@@ -2135,7 +2135,7 @@ var lodash = { exports: {} };
2135
2135
  if (!isObject2(value) || isMasked(value)) {
2136
2136
  return false;
2137
2137
  }
2138
- var pattern4 = isFunction(value) ? reIsNative : reIsHostCtor;
2138
+ var pattern4 = isFunction2(value) ? reIsNative : reIsHostCtor;
2139
2139
  return pattern4.test(toSource(value));
2140
2140
  }
2141
2141
  function baseIsRegExp(value) {
@@ -2257,7 +2257,7 @@ var lodash = { exports: {} };
2257
2257
  newValue = objValue;
2258
2258
  if (isArguments(objValue)) {
2259
2259
  newValue = toPlainObject(objValue);
2260
- } else if (!isObject2(objValue) || isFunction(objValue)) {
2260
+ } else if (!isObject2(objValue) || isFunction2(objValue)) {
2261
2261
  newValue = initCloneObject(srcValue);
2262
2262
  }
2263
2263
  } else {
@@ -3559,7 +3559,7 @@ var lodash = { exports: {} };
3559
3559
  function isMasked(func) {
3560
3560
  return !!maskSrcKey && maskSrcKey in func;
3561
3561
  }
3562
- var isMaskable = coreJsData ? isFunction : stubFalse;
3562
+ var isMaskable = coreJsData ? isFunction2 : stubFalse;
3563
3563
  function isPrototype(value) {
3564
3564
  var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
3565
3565
  return value === proto;
@@ -4672,12 +4672,12 @@ var lodash = { exports: {} };
4672
4672
  var isArray = Array2.isArray;
4673
4673
  var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
4674
4674
  function isArrayLike(value) {
4675
- return value != null && isLength(value.length) && !isFunction(value);
4675
+ return value != null && isLength(value.length) && !isFunction2(value);
4676
4676
  }
4677
4677
  function isArrayLikeObject(value) {
4678
4678
  return isObjectLike(value) && isArrayLike(value);
4679
4679
  }
4680
- function isBoolean(value) {
4680
+ function isBoolean2(value) {
4681
4681
  return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
4682
4682
  }
4683
4683
  var isBuffer = nativeIsBuffer || stubFalse;
@@ -4724,7 +4724,7 @@ var lodash = { exports: {} };
4724
4724
  function isFinite(value) {
4725
4725
  return typeof value == "number" && nativeIsFinite(value);
4726
4726
  }
4727
- function isFunction(value) {
4727
+ function isFunction2(value) {
4728
4728
  if (!isObject2(value)) {
4729
4729
  return false;
4730
4730
  }
@@ -5047,7 +5047,7 @@ var lodash = { exports: {} };
5047
5047
  index2 = length;
5048
5048
  value = defaultValue;
5049
5049
  }
5050
- object4 = isFunction(value) ? value.call(object4) : value;
5050
+ object4 = isFunction2(value) ? value.call(object4) : value;
5051
5051
  }
5052
5052
  return object4;
5053
5053
  }
@@ -5068,7 +5068,7 @@ var lodash = { exports: {} };
5068
5068
  if (isArrLike) {
5069
5069
  accumulator = isArr ? new Ctor() : [];
5070
5070
  } else if (isObject2(object4)) {
5071
- accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object4)) : {};
5071
+ accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object4)) : {};
5072
5072
  } else {
5073
5073
  accumulator = {};
5074
5074
  }
@@ -5485,7 +5485,7 @@ var lodash = { exports: {} };
5485
5485
  object4 = this;
5486
5486
  methodNames = baseFunctions(source, keys(source));
5487
5487
  }
5488
- var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object4);
5488
+ var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object4);
5489
5489
  arrayEach(methodNames, function(methodName) {
5490
5490
  var func = source[methodName];
5491
5491
  object4[methodName] = func;
@@ -5811,7 +5811,7 @@ var lodash = { exports: {} };
5811
5811
  lodash2.isArrayBuffer = isArrayBuffer;
5812
5812
  lodash2.isArrayLike = isArrayLike;
5813
5813
  lodash2.isArrayLikeObject = isArrayLikeObject;
5814
- lodash2.isBoolean = isBoolean;
5814
+ lodash2.isBoolean = isBoolean2;
5815
5815
  lodash2.isBuffer = isBuffer;
5816
5816
  lodash2.isDate = isDate;
5817
5817
  lodash2.isElement = isElement;
@@ -5820,7 +5820,7 @@ var lodash = { exports: {} };
5820
5820
  lodash2.isEqualWith = isEqualWith;
5821
5821
  lodash2.isError = isError;
5822
5822
  lodash2.isFinite = isFinite;
5823
- lodash2.isFunction = isFunction;
5823
+ lodash2.isFunction = isFunction2;
5824
5824
  lodash2.isInteger = isInteger;
5825
5825
  lodash2.isLength = isLength;
5826
5826
  lodash2.isMap = isMap;
@@ -8081,6 +8081,16 @@ Schema.register = function register(type4, validator) {
8081
8081
  Schema.warning = warning;
8082
8082
  Schema.messages = messages;
8083
8083
  Schema.validators = validators;
8084
+ function getFieldValue(obj, path) {
8085
+ return {
8086
+ get value() {
8087
+ return lodash.exports.get(obj, path);
8088
+ },
8089
+ set value(val) {
8090
+ lodash.exports.set(obj, path, val);
8091
+ }
8092
+ };
8093
+ }
8084
8094
  function useFormItem(messageType, _rules, validateState) {
8085
8095
  const formContext = inject(FORM_TOKEN);
8086
8096
  const ns2 = useNamespace("form");
@@ -8119,17 +8129,12 @@ function useFormItemValidate(props, _rules) {
8119
8129
  const computedField = computed(() => {
8120
8130
  return typeof props.field === "string" ? props.field : "";
8121
8131
  });
8122
- const fieldValue = computed({
8123
- get: () => {
8124
- const formData = formContext.data;
8125
- if (!formData || !props.field) {
8126
- return;
8127
- }
8128
- return formData[props.field];
8129
- },
8130
- set: (val) => {
8131
- formContext.data[props.field] = val;
8132
+ const fieldValue = computed(() => {
8133
+ const formData = formContext.data;
8134
+ if (!formData || !props.field) {
8135
+ return;
8132
8136
  }
8137
+ return getFieldValue(formData, props.field).value;
8133
8138
  });
8134
8139
  const getRuleByTrigger = (triggerVal) => {
8135
8140
  return _rules.value.filter((rule) => {
@@ -8198,13 +8203,16 @@ function useFormItemValidate(props, _rules) {
8198
8203
  if (!formContext.data || !props.field) {
8199
8204
  return;
8200
8205
  }
8201
- isResetting = true;
8202
- fieldValue.value = initFieldValue;
8206
+ const currentValue = getFieldValue(formContext.data, props.field);
8207
+ if (!lodash.exports.isEqual(currentValue.value, initFieldValue)) {
8208
+ isResetting = true;
8209
+ }
8210
+ currentValue.value = initFieldValue;
8203
8211
  await nextTick();
8204
8212
  clearValidate();
8205
8213
  };
8206
8214
  onMounted(() => {
8207
- initFieldValue = lodash.exports.cloneDeep(formContext.data[props.field]);
8215
+ initFieldValue = lodash.exports.clone(fieldValue.value);
8208
8216
  });
8209
8217
  return { validateState, validateMessage, validate, resetField, clearValidate };
8210
8218
  }
@@ -8872,9 +8880,9 @@ var DIcon = defineComponent({
8872
8880
  [ns2.m("operable")]: operable.value
8873
8881
  }));
8874
8882
  const onClick = (e) => {
8883
+ e.stopImmediatePropagation();
8875
8884
  if (disabled.value) {
8876
8885
  e.preventDefault();
8877
- e.stopImmediatePropagation();
8878
8886
  }
8879
8887
  };
8880
8888
  return () => {
@@ -8908,7 +8916,7 @@ var IconInstall = {
8908
8916
  app.component(IconGroup.name, IconGroup);
8909
8917
  }
8910
8918
  };
8911
- function _isSlot$4(s) {
8919
+ function _isSlot$5(s) {
8912
8920
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
8913
8921
  }
8914
8922
  var AutoComplete = defineComponent({
@@ -9022,7 +9030,7 @@ var AutoComplete = defineComponent({
9022
9030
  ${width.value + "px"}
9023
9031
  `
9024
9032
  }
9025
- }, [createVNode(DAutoCompleteDropdown, null, _isSlot$4(_slot = customRenderSolts()) ? _slot : {
9033
+ }, [createVNode(DAutoCompleteDropdown, null, _isSlot$5(_slot = customRenderSolts()) ? _slot : {
9026
9034
  default: () => [_slot]
9027
9035
  })])]
9028
9036
  })]
@@ -9033,7 +9041,7 @@ var AutoComplete = defineComponent({
9033
9041
  let _slot2;
9034
9042
  return createVNode(Teleport, {
9035
9043
  "to": "body"
9036
- }, _isSlot$4(_slot2 = renderBasicDropdown()) ? _slot2 : {
9044
+ }, _isSlot$5(_slot2 = renderBasicDropdown()) ? _slot2 : {
9037
9045
  default: () => [_slot2]
9038
9046
  });
9039
9047
  } else {
@@ -9410,6 +9418,10 @@ const badgeProps = {
9410
9418
  },
9411
9419
  textColor: {
9412
9420
  type: String
9421
+ },
9422
+ hidden: {
9423
+ type: Boolean,
9424
+ default: false
9413
9425
  }
9414
9426
  };
9415
9427
  var badge = "";
@@ -9420,7 +9432,7 @@ var Badge = defineComponent({
9420
9432
  const ns2 = useNamespace("badge");
9421
9433
  const className2 = computed(() => {
9422
9434
  const base = ns2.e("content");
9423
- return [base, props.showDot ? ns2.m("dot") : ns2.m("count"), props.status && ns2.m(props.status), ctx2.slots.default && props.position && ns2.m(props.position), ctx2.slots.default && ns2.m("fixed")].join(" ");
9435
+ return [base, props.showDot ? ns2.m("dot") : ns2.m("count"), props.status && ns2.m(props.status), ctx2.slots.default && props.position && ns2.m(props.position), ctx2.slots.default && ns2.m("fixed"), props.hidden ? ns2.m("hidden") : ns2.m("show")].join(" ");
9424
9436
  });
9425
9437
  const style = computed(() => {
9426
9438
  const styleMap = {
@@ -9614,6 +9626,10 @@ const cardProps = {
9614
9626
  src: {
9615
9627
  type: String,
9616
9628
  default: ""
9629
+ },
9630
+ shadow: {
9631
+ type: String,
9632
+ default: "hover"
9617
9633
  }
9618
9634
  };
9619
9635
  var card = "";
@@ -9637,7 +9653,7 @@ var Card = defineComponent({
9637
9653
  return () => {
9638
9654
  var _a, _b, _c, _d, _e, _f, _g;
9639
9655
  return createVNode("div", {
9640
- "class": ["card-container", ns2.b()]
9656
+ "class": ["card-container", ns2.b(), ns2.em("shadow", props.shadow)]
9641
9657
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots), createVNode("div", {
9642
9658
  "class": ns2.e("header")
9643
9659
  }, [((_b = slots.avatar) == null ? void 0 : _b.call(slots)) ? createVNode("div", {
@@ -11044,7 +11060,7 @@ const Month = (props) => {
11044
11060
  }, null)])]);
11045
11061
  };
11046
11062
  var index$5 = "";
11047
- const Item = (props) => {
11063
+ const Item$1 = (props) => {
11048
11064
  const {
11049
11065
  button: Btn,
11050
11066
  disabled = false,
@@ -11105,13 +11121,13 @@ const CalendarToolbar = (props) => {
11105
11121
  }
11106
11122
  return createVNode("div", {
11107
11123
  "class": "devui-calendar-toolbar"
11108
- }, [createVNode(Item, {
11124
+ }, [createVNode(Item$1, {
11109
11125
  "disabled": dis[0],
11110
11126
  "date": current,
11111
11127
  "pos": pos,
11112
11128
  "button": Year,
11113
11129
  "cb": onPreviousYear
11114
- }, null), createVNode(Item, {
11130
+ }, null), createVNode(Item$1, {
11115
11131
  "disabled": dis[1],
11116
11132
  "date": current,
11117
11133
  "pos": pos,
@@ -11120,14 +11136,14 @@ const CalendarToolbar = (props) => {
11120
11136
  "cb": onPreviousMonth
11121
11137
  }, null), createVNode(Title, {
11122
11138
  "date": current
11123
- }, null), createVNode(Item, {
11139
+ }, null), createVNode(Item$1, {
11124
11140
  "disabled": dis[2],
11125
11141
  "date": current,
11126
11142
  "pos": pos,
11127
11143
  "button": Month,
11128
11144
  "rotate": 90,
11129
11145
  "cb": onNextMonth
11130
- }, null), createVNode(Item, {
11146
+ }, null), createVNode(Item$1, {
11131
11147
  "disabled": dis[3],
11132
11148
  "date": current,
11133
11149
  "pos": pos,
@@ -11745,7 +11761,7 @@ var Drawer = defineComponent({
11745
11761
  });
11746
11762
  }
11747
11763
  });
11748
- function _isSlot$3(s) {
11764
+ function _isSlot$4(s) {
11749
11765
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
11750
11766
  }
11751
11767
  const defaultOptions$1 = {
@@ -11772,7 +11788,7 @@ function initInstance$1(state) {
11772
11788
  });
11773
11789
  return () => createVNode(Drawer, mergeProps(state, {
11774
11790
  "onUpdate:modelValue": handleVisibleChange
11775
- }), _isSlot$3(content2) ? content2 : {
11791
+ }), _isSlot$4(content2) ? content2 : {
11776
11792
  default: () => [content2]
11777
11793
  });
11778
11794
  }
@@ -13525,6 +13541,8 @@ function middleNum(num, min = 0, max = 100) {
13525
13541
  return middle;
13526
13542
  }
13527
13543
  const isNumber = (value) => typeof value === "number";
13544
+ const isBoolean = (value) => typeof value === "boolean";
13545
+ const isFunction = (value) => Object.prototype.toString.call(value) === "[object Function]";
13528
13546
  const isUndefined = (value) => value === void 0;
13529
13547
  const isNull = (value) => value === null;
13530
13548
  const ns$5 = useNamespace("input-number");
@@ -14405,7 +14423,7 @@ var Notification = defineComponent({
14405
14423
  });
14406
14424
  }
14407
14425
  });
14408
- function _isSlot$2(s) {
14426
+ function _isSlot$3(s) {
14409
14427
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
14410
14428
  }
14411
14429
  const defaultOptions = {
@@ -14422,7 +14440,7 @@ function initInstance(props, content2) {
14422
14440
  });
14423
14441
  return () => createVNode(Notification, mergeProps(props, {
14424
14442
  "onDestroy": app.unmount
14425
- }), _isSlot$2(content2) ? content2 : {
14443
+ }), _isSlot$3(content2) ? content2 : {
14426
14444
  default: () => [content2]
14427
14445
  });
14428
14446
  }
@@ -15638,7 +15656,7 @@ var Radio = defineComponent({
15638
15656
  }
15639
15657
  });
15640
15658
  var radioGroup = "";
15641
- function _isSlot$1(s) {
15659
+ function _isSlot$2(s) {
15642
15660
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
15643
15661
  }
15644
15662
  var RadioGroup = defineComponent({
@@ -15658,7 +15676,7 @@ var RadioGroup = defineComponent({
15658
15676
  return createVNode(Radio, {
15659
15677
  "key": item,
15660
15678
  "value": item
15661
- }, _isSlot$1(item) ? item : {
15679
+ }, _isSlot$2(item) ? item : {
15662
15680
  default: () => [item]
15663
15681
  });
15664
15682
  });
@@ -16245,6 +16263,7 @@ const keywordsHandles = (ctx2, props) => {
16245
16263
  const onClearHandle = () => {
16246
16264
  keywords.value = "";
16247
16265
  ctx2.emit("update:modelValue", "");
16266
+ ctx2.emit("search", "");
16248
16267
  };
16249
16268
  const clearIconShow = computed(() => keywords.value.length > 0);
16250
16269
  return {
@@ -16484,7 +16503,7 @@ function useSelect$1(props, ctx2, focus, blur, isSelectFocus) {
16484
16503
  option2._checked = !option2._checked;
16485
16504
  }
16486
16505
  if (index2 > -1) {
16487
- checkedItems.splice(index2);
16506
+ checkedItems.splice(index2, 1);
16488
16507
  } else {
16489
16508
  checkedItems.push(item.value);
16490
16509
  }
@@ -16582,6 +16601,16 @@ function useSelect$1(props, ctx2, focus, blur, isSelectFocus) {
16582
16601
  const isShowEmptyText = computed(() => {
16583
16602
  return !!emptyText.value && (!props.allowCreate || isLoading.value || props.allowCreate && injectOptionsArray.value.length === 0);
16584
16603
  });
16604
+ const isDisabled = (item) => {
16605
+ const checkOptionDisabledKey = props.optionDisabledKey ? !!item[props.optionDisabledKey] : false;
16606
+ if (!props.multiple) {
16607
+ return checkOptionDisabledKey;
16608
+ } else {
16609
+ let tempModelValue = [];
16610
+ tempModelValue = props.modelValue;
16611
+ return checkOptionDisabledKey || !!props.multipleLimit && props.multipleLimit <= tempModelValue.length && !tempModelValue.includes(item.value);
16612
+ }
16613
+ };
16585
16614
  watch(() => props.modelValue, () => {
16586
16615
  formItemContext == null ? void 0 : formItemContext.validate("change").catch((err) => console.warn(err));
16587
16616
  }, { deep: true });
@@ -16607,6 +16636,8 @@ function useSelect$1(props, ctx2, focus, blur, isSelectFocus) {
16607
16636
  tagDelete,
16608
16637
  onFocus,
16609
16638
  onBlur,
16639
+ isDisabled,
16640
+ toggleChange,
16610
16641
  debounceQueryFilter,
16611
16642
  isShowCreateOption
16612
16643
  };
@@ -16695,6 +16726,10 @@ const selectProps = {
16695
16726
  onValueChange: {
16696
16727
  type: Function,
16697
16728
  default: void 0
16729
+ },
16730
+ multipleLimit: {
16731
+ type: Number,
16732
+ default: 0
16698
16733
  }
16699
16734
  };
16700
16735
  const optionProps = {
@@ -17183,6 +17218,8 @@ var Select = defineComponent({
17183
17218
  onFocus,
17184
17219
  onBlur,
17185
17220
  debounceQueryFilter,
17221
+ isDisabled,
17222
+ toggleChange,
17186
17223
  isShowCreateOption
17187
17224
  } = useSelect$1(props, ctx2, focus, blur, isSelectFocus);
17188
17225
  const scrollbarNs = useNamespace("scrollbar");
@@ -17195,7 +17232,8 @@ var Select = defineComponent({
17195
17232
  const dropdownEmptyCls = ns2.em("dropdown", "empty");
17196
17233
  ctx2.expose({
17197
17234
  focus,
17198
- blur
17235
+ blur,
17236
+ toggleChange
17199
17237
  });
17200
17238
  provide(SELECT_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
17201
17239
  selectDisabled,
@@ -17242,12 +17280,12 @@ var Select = defineComponent({
17242
17280
  "key": i,
17243
17281
  "value": item.value,
17244
17282
  "name": item.name,
17245
- "disabled": props.optionDisabledKey ? !!item[props.optionDisabledKey] : false
17283
+ "disabled": isDisabled(item)
17246
17284
  }, {
17247
17285
  default: () => [props.multiple ? createVNode(Checkbox, {
17248
17286
  "modelValue": item._checked,
17249
17287
  "label": item.name,
17250
- "disabled": props.optionDisabledKey ? !!item[props.optionDisabledKey] : false
17288
+ "disabled": isDisabled(item)
17251
17289
  }, null) : item.name || item.value]
17252
17290
  }))]), [[vShow, !isLoading.value]]), isShowEmptyText.value && createVNode("div", null, [((_c = ctx2.slots) == null ? void 0 : _c.empty) && ctx2.slots.empty(), !((_d = ctx2.slots) == null ? void 0 : _d.empty) && createVNode("p", {
17253
17291
  "class": dropdownEmptyCls
@@ -17577,157 +17615,126 @@ const sliderProps = {
17577
17615
  type: Number,
17578
17616
  default: 0
17579
17617
  },
17580
- showInput: {
17581
- type: Boolean,
17582
- default: false
17583
- },
17584
17618
  step: {
17585
17619
  type: Number,
17586
17620
  default: 1
17587
17621
  },
17588
17622
  tipsRenderer: {
17589
- type: String,
17590
- default: ""
17591
- },
17592
- color: {
17593
- type: String,
17594
- default: ""
17623
+ type: [Function, null],
17624
+ default: () => (value) => `${value}`
17625
+ }
17626
+ };
17627
+ function useSliderEvent(props, ctx2) {
17628
+ let isClick = true;
17629
+ let startPosition = 0;
17630
+ let startX = 0;
17631
+ const sliderRunway = ref();
17632
+ const currentValue = ref(Number(props.modelValue));
17633
+ const currentPosition = ref(0);
17634
+ const percentDisplay = ref("");
17635
+ const popoverShow = ref(false);
17636
+ const newPosition = ref(0);
17637
+ function getSliderWidth() {
17638
+ var _a;
17639
+ return Boolean(sliderRunway.value) ? ((_a = sliderRunway.value) == null ? void 0 : _a.clientWidth) || 0 : 0;
17640
+ }
17641
+ function initCurrentPosition() {
17642
+ const sliderWidth = getSliderWidth();
17643
+ currentPosition.value = sliderWidth * (currentValue.value - props.min) / (props.max - props.min);
17644
+ }
17645
+ function setPosition(position) {
17646
+ const clientWidth = getSliderWidth();
17647
+ const sliderWidth = Math.round(clientWidth);
17648
+ if (position < 0) {
17649
+ position = 0;
17650
+ }
17651
+ const LengthPerStep = sliderWidth / ((props.max - props.min) / props.step);
17652
+ const steps = Math.round(position / LengthPerStep);
17653
+ const value = steps * LengthPerStep;
17654
+ if (Math.round(value) >= sliderWidth) {
17655
+ currentPosition.value = sliderWidth;
17656
+ currentValue.value = props.max;
17657
+ percentDisplay.value = "100%";
17658
+ ctx2.emit("update:modelValue", props.max);
17659
+ return;
17660
+ }
17661
+ percentDisplay.value = Math.round(value * 100 / sliderWidth) + "%";
17662
+ currentValue.value = Math.round(value * (props.max - props.min) / sliderWidth) + props.min;
17663
+ currentPosition.value = position;
17664
+ ctx2.emit("update:modelValue", currentValue.value);
17665
+ }
17666
+ function dragStart(event) {
17667
+ isClick = false;
17668
+ startX = event.clientX;
17669
+ startPosition = currentPosition.value;
17670
+ newPosition.value = startPosition;
17671
+ }
17672
+ function onDragging(event) {
17673
+ popoverShow.value = true;
17674
+ const currentX = event.clientX;
17675
+ const pxOffset = currentX - startX;
17676
+ newPosition.value = startPosition + pxOffset;
17677
+ setPosition(newPosition.value);
17678
+ }
17679
+ function onDragEnd() {
17680
+ popoverShow.value = false;
17681
+ setTimeout(() => {
17682
+ isClick = true;
17683
+ }, 100);
17684
+ window.removeEventListener("mousemove", onDragging);
17685
+ window.removeEventListener("mouseup", onDragEnd);
17595
17686
  }
17596
- };
17687
+ function handleButtonMousedown(event) {
17688
+ popoverShow.value = true;
17689
+ if (!props.disabled) {
17690
+ event.preventDefault();
17691
+ dragStart(event);
17692
+ window.addEventListener("mousemove", onDragging);
17693
+ window.addEventListener("mouseup", onDragEnd);
17694
+ }
17695
+ }
17696
+ function handleRunwayMousedown(event) {
17697
+ if (!props.disabled && isClick) {
17698
+ const _e = event.target;
17699
+ startX = _e.getBoundingClientRect().left;
17700
+ const currentX = event.clientX;
17701
+ setPosition(currentX - startX);
17702
+ handleButtonMousedown(event);
17703
+ }
17704
+ }
17705
+ watch(() => props.modelValue, () => {
17706
+ currentValue.value = Number(props.modelValue);
17707
+ if (currentValue.value > props.max) {
17708
+ percentDisplay.value = "100%";
17709
+ } else if (currentValue.value < props.min) {
17710
+ percentDisplay.value = "0%";
17711
+ } else {
17712
+ percentDisplay.value = (currentValue.value - props.min) * 100 / (props.max - props.min) + "%";
17713
+ }
17714
+ initCurrentPosition();
17715
+ }, { immediate: true });
17716
+ onMounted(initCurrentPosition);
17717
+ return { sliderRunway, popoverShow, percentDisplay, currentValue, handleRunwayMousedown, handleButtonMousedown };
17718
+ }
17597
17719
  var slider = "";
17598
17720
  var Slider = defineComponent({
17599
17721
  name: "DSlider",
17600
17722
  props: sliderProps,
17601
17723
  emits: ["update:modelValue"],
17602
17724
  setup(props, ctx2) {
17603
- let isClick = true;
17604
- let startPosition = 0;
17605
- let startX = 0;
17606
17725
  const ns2 = useNamespace("slider");
17607
- const popoverShow = ref(false);
17608
- const sliderRunway = ref(null);
17609
- const inputValue = ref(props.modelValue);
17610
- const currentPosition = ref(0);
17611
- const newPostion = ref(0);
17612
- const percentDispaly = ref("");
17613
- function handleOnInput(event) {
17614
- inputValue.value = parseInt(event.target.value);
17615
- if (!inputValue.value) {
17616
- inputValue.value = props.min;
17617
- percentDispaly.value = "0%";
17618
- } else {
17619
- if (inputValue.value < props.min || inputValue.value > props.max) {
17620
- return;
17621
- }
17622
- const re = /^(?:[1-9]?\d|100)$/;
17623
- if (re.test(`${inputValue.value}`)) {
17624
- percentDispaly.value = (inputValue.value - props.min) * 100 / (props.max - props.min) + "%";
17625
- ctx2.emit("update:modelValue", inputValue.value);
17626
- }
17627
- }
17628
- }
17629
- function setPostion(newPosition) {
17630
- const clientWidth = !!sliderRunway.value ? sliderRunway.value.clientWidth : 0;
17631
- const sliderWidth = Math.round(clientWidth);
17632
- if (newPosition < 0) {
17633
- newPosition = 0;
17634
- }
17635
- const LengthPerStep = sliderWidth / ((props.max - props.min) / props.step);
17636
- const steps = Math.round(newPosition / LengthPerStep);
17637
- const value = steps * LengthPerStep;
17638
- if (Math.round(value) >= sliderWidth) {
17639
- currentPosition.value = sliderWidth;
17640
- inputValue.value = props.max;
17641
- percentDispaly.value = "100%";
17642
- ctx2.emit("update:modelValue", props.max);
17643
- return;
17644
- }
17645
- percentDispaly.value = Math.round(value * 100 / sliderWidth) + "%";
17646
- inputValue.value = Math.round(value * (props.max - props.min) / sliderWidth) + props.min;
17647
- currentPosition.value = newPosition;
17648
- ctx2.emit("update:modelValue", inputValue.value);
17649
- }
17650
- function dragStart(event) {
17651
- isClick = false;
17652
- startX = event.clientX;
17653
- startPosition = currentPosition.value;
17654
- newPostion.value = startPosition;
17655
- }
17656
- function onDragging(event) {
17657
- popoverShow.value = true;
17658
- const currentX = event.clientX;
17659
- const pxOffset = currentX - startX;
17660
- newPostion.value = startPosition + pxOffset;
17661
- setPostion(newPostion.value);
17662
- }
17663
- function onDragEnd() {
17664
- popoverShow.value = false;
17665
- setTimeout(() => {
17666
- isClick = true;
17667
- }, 100);
17668
- window.removeEventListener("mousemove", onDragging);
17669
- window.removeEventListener("mouseup", onDragEnd);
17670
- }
17671
- const renderShowInput = () => {
17672
- return props.showInput ? createVNode("div", {
17673
- "class": ns2.e("input-wrap")
17674
- }, [createVNode("input", {
17675
- "onInput": handleOnInput,
17676
- "value": inputValue.value + "",
17677
- "disabled": props.disabled
17678
- }, null)]) : "";
17679
- };
17680
- if (props.modelValue > props.max) {
17681
- percentDispaly.value = "100%";
17682
- } else if (props.modelValue < props.min) {
17683
- percentDispaly.value = "0%";
17684
- } else {
17685
- percentDispaly.value = (props.modelValue - props.min) * 100 / (props.max - props.min) + "%";
17686
- }
17687
- onMounted(() => {
17688
- const sliderWidth = !!sliderRunway.value ? sliderRunway.value.clientWidth : 0;
17689
- currentPosition.value = sliderWidth * (inputValue.value - props.min) / (props.max - props.min);
17690
- });
17691
- function handleButtonMousedown(event) {
17692
- popoverShow.value = true;
17693
- if (props.disabled) {
17694
- return;
17695
- }
17696
- event.preventDefault();
17697
- dragStart(event);
17698
- window.addEventListener("mousemove", onDragging);
17699
- window.addEventListener("mouseup", onDragEnd);
17700
- }
17701
- function handleRunwayMousedown(event) {
17702
- if (!props.disabled && isClick) {
17703
- const _e = event.target;
17704
- startX = _e.getBoundingClientRect().left;
17705
- const currentX = event.clientX;
17706
- setPostion(currentX - startX);
17707
- handleButtonMousedown(event);
17708
- } else {
17709
- return;
17710
- }
17711
- }
17726
+ const {
17727
+ sliderRunway,
17728
+ popoverShow,
17729
+ percentDisplay,
17730
+ currentValue,
17731
+ handleRunwayMousedown,
17732
+ handleButtonMousedown
17733
+ } = useSliderEvent(props, ctx2);
17712
17734
  const disableClass = computed(() => {
17713
17735
  return props.disabled ? " disabled" : "";
17714
17736
  });
17715
- const popover2 = () => {
17716
- return createVNode("div", {
17717
- "class": ns2.e("popover"),
17718
- "style": {
17719
- left: percentDispaly.value,
17720
- opacity: popoverShow.value ? 1 : 0
17721
- }
17722
- }, [createVNode("div", {
17723
- "class": ns2.e("popover-arrow")
17724
- }, null), createVNode("div", {
17725
- "class": ns2.e("popover-content")
17726
- }, [inputValue.value + " " + props.tipsRenderer])]);
17727
- };
17728
- const color = computed(() => {
17729
- return props.disabled ? "" : props.color;
17730
- });
17737
+ const tipsContent = computed(() => isFunction(props.tipsRenderer) ? props.tipsRenderer(currentValue.value) : "");
17731
17738
  return () => createVNode("div", {
17732
17739
  "class": ns2.b()
17733
17740
  }, [createVNode("div", {
@@ -17738,23 +17745,26 @@ var Slider = defineComponent({
17738
17745
  }, [createVNode("div", {
17739
17746
  "class": [ns2.e("bar"), disableClass.value],
17740
17747
  "style": {
17741
- width: percentDispaly.value,
17742
- backgroundColor: color.value
17748
+ width: percentDisplay.value
17743
17749
  }
17744
17750
  }, null), createVNode("div", {
17745
17751
  "class": [ns2.e("button"), disableClass.value],
17746
17752
  "style": {
17747
- left: percentDispaly.value,
17748
- borderColor: color.value
17753
+ left: percentDisplay.value
17749
17754
  },
17750
17755
  "onMousedown": handleButtonMousedown,
17751
17756
  "onMouseenter": () => popoverShow.value = true,
17752
17757
  "onMouseout": () => popoverShow.value = false
17753
- }, null), props.tipsRenderer === "null" ? "" : popover2()]), createVNode("span", {
17754
- "class": ns2.e("min-count")
17755
- }, [props.min]), createVNode("span", {
17756
- "class": ns2.e("max-count")
17757
- }, [props.max]), renderShowInput()]);
17758
+ }, null), props.tipsRenderer === null ? null : popoverShow.value ? createVNode("div", {
17759
+ "class": ns2.e("popover"),
17760
+ "style": {
17761
+ left: percentDisplay.value
17762
+ }
17763
+ }, [createVNode("div", {
17764
+ "class": ns2.e("popover-arrow")
17765
+ }, null), createVNode("div", {
17766
+ "class": ns2.e("popover-content")
17767
+ }, [tipsContent.value])]) : null])]);
17758
17768
  }
17759
17769
  });
17760
17770
  var SliderInstall = {
@@ -18592,9 +18602,6 @@ const statisticProps = {
18592
18602
  type: String,
18593
18603
  default: ""
18594
18604
  },
18595
- valueStyle: {
18596
- type: Object
18597
- },
18598
18605
  animationDuration: {
18599
18606
  type: Number,
18600
18607
  default: 2e3
@@ -18748,12 +18755,12 @@ class Tween {
18748
18755
  var statistic = "";
18749
18756
  var Statistic = defineComponent({
18750
18757
  name: "DStatistic",
18751
- inheritAttrs: false,
18752
18758
  props: statisticProps,
18753
18759
  setup(props, ctx2) {
18754
18760
  var _a;
18755
18761
  const innerValue = ref((_a = props.valueFrom) != null ? _a : props.value);
18756
18762
  const tween = ref(null);
18763
+ const ns2 = useNamespace("statistic");
18757
18764
  const animation = (from = ((_b) => (_b = props.valueFrom) != null ? _b : 0)(), to = typeof props.value === "number" ? props.value : Number(props.value)) => {
18758
18765
  if (from !== to) {
18759
18766
  tween.value = new Tween({
@@ -18791,22 +18798,20 @@ var Statistic = defineComponent({
18791
18798
  });
18792
18799
  return () => {
18793
18800
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
18794
- return createVNode("div", mergeProps({
18795
- "class": "devui-statistic"
18796
- }, ctx2.attrs), [createVNode("div", {
18797
- "class": "devui-statistic-title",
18798
- "style": props.titleStyle
18801
+ return createVNode("div", {
18802
+ "class": ns2.b()
18803
+ }, [createVNode("div", {
18804
+ "class": ns2.e("title")
18799
18805
  }, [((_b = (_a2 = ctx2.slots).title) == null ? void 0 : _b.call(_a2)) || props.title]), createVNode("div", {
18800
- "class": "devui-statistic-content",
18801
- "style": props.valueStyle
18806
+ "class": ns2.e("content")
18802
18807
  }, [props.prefix || ((_d = (_c = ctx2.slots).prefix) == null ? void 0 : _d.call(_c)) ? createVNode("span", {
18803
- "class": "devui-statistic-prefix"
18808
+ "class": ns2.e("prefix")
18804
18809
  }, [((_f = (_e = ctx2.slots).prefix) == null ? void 0 : _f.call(_e)) || props.prefix]) : null, createVNode("span", {
18805
- "class": "devui-statistic--value"
18810
+ "class": ns2.e("value")
18806
18811
  }, [statisticValue.value]), props.suffix || ((_h = (_g = ctx2.slots).suffix) == null ? void 0 : _h.call(_g)) ? createVNode("span", {
18807
- "class": "devui-statistic-suffix"
18812
+ "class": ns2.e("suffix")
18808
18813
  }, [((_j = (_i = ctx2.slots).suffix) == null ? void 0 : _j.call(_i)) || props.suffix]) : null]), props.extra || ((_l = (_k = ctx2.slots).extra) == null ? void 0 : _l.call(_k)) ? createVNode("div", {
18809
- "class": "devui-statistic-extra"
18814
+ "class": ns2.e("extra")
18810
18815
  }, [createTextVNode(" "), ((_n = (_m = ctx2.slots).extra) == null ? void 0 : _n.call(_m)) || props.extra]) : null]);
18811
18816
  };
18812
18817
  }
@@ -18968,7 +18973,7 @@ var SwitchInstall = {
18968
18973
  app.component(Switch.name, Switch);
18969
18974
  }
18970
18975
  };
18971
- const TableProps = {
18976
+ const tableProps = {
18972
18977
  data: {
18973
18978
  type: Array,
18974
18979
  default: []
@@ -19045,6 +19050,13 @@ const TableProps = {
19045
19050
  rowKey: {
19046
19051
  type: String
19047
19052
  },
19053
+ defaultExpandAll: {
19054
+ type: Boolean,
19055
+ default: false
19056
+ },
19057
+ expandRowKeys: {
19058
+ type: Array
19059
+ },
19048
19060
  trackBy: {
19049
19061
  type: Function
19050
19062
  }
@@ -19150,6 +19162,103 @@ function useTableLayout(table2) {
19150
19162
  };
19151
19163
  return { tableWidth, updateColumnWidth };
19152
19164
  }
19165
+ function useTableWatcher(props, store) {
19166
+ watchEffect(() => {
19167
+ if (props.expandRowKeys) {
19168
+ store.setExpandRows(props.expandRowKeys);
19169
+ }
19170
+ });
19171
+ }
19172
+ function formatWidth(width) {
19173
+ if (width === "") {
19174
+ return width;
19175
+ }
19176
+ if (typeof width === "number") {
19177
+ return width;
19178
+ }
19179
+ return parseInt(width, 10) || 80;
19180
+ }
19181
+ function getRowIdentity(row2, rowKey) {
19182
+ const paths = rowKey.split(".");
19183
+ let obj = row2;
19184
+ for (const p of paths) {
19185
+ obj = obj[p];
19186
+ }
19187
+ return `${obj}`;
19188
+ }
19189
+ function getRowKeysMap(data, rowKey) {
19190
+ const rowKeyMap = {};
19191
+ (data || []).forEach((row2, index2) => {
19192
+ rowKeyMap[getRowIdentity(row2, rowKey)] = { row: row2, index: index2 };
19193
+ });
19194
+ return rowKeyMap;
19195
+ }
19196
+ function toggleRowExpandStatus(rowsArr, row2, status2) {
19197
+ let isChanged = false;
19198
+ const index2 = rowsArr.indexOf(row2);
19199
+ const isIncluded = index2 !== -1;
19200
+ const addRow = () => {
19201
+ rowsArr.push(row2);
19202
+ isChanged = true;
19203
+ };
19204
+ const deleteRow = () => {
19205
+ rowsArr.splice(index2, 1);
19206
+ isChanged = true;
19207
+ };
19208
+ if (isBoolean(status2)) {
19209
+ if (status2 && !isIncluded) {
19210
+ addRow();
19211
+ } else if (!status2 && isIncluded) {
19212
+ deleteRow();
19213
+ }
19214
+ } else {
19215
+ if (isIncluded) {
19216
+ deleteRow();
19217
+ } else {
19218
+ addRow();
19219
+ }
19220
+ }
19221
+ return isChanged;
19222
+ }
19223
+ function useExpand(dataSource) {
19224
+ const tableInstance = getCurrentInstance();
19225
+ const rowKey = tableInstance.props.rowKey || "";
19226
+ const defaultExpandAll = ref(tableInstance.props.defaultExpandAll);
19227
+ const _expandedRows = ref([]);
19228
+ const updateExpandRows = () => {
19229
+ if (defaultExpandAll.value) {
19230
+ _expandedRows.value = dataSource.value.slice();
19231
+ } else {
19232
+ _expandedRows.value = [];
19233
+ }
19234
+ };
19235
+ const setExpandRows = (rowKeys) => {
19236
+ const data = dataSource.value || [];
19237
+ const rowKeysMap = getRowKeysMap(data, rowKey);
19238
+ _expandedRows.value = rowKeys.reduce((pre, cur) => {
19239
+ const currentRow = rowKeysMap[cur];
19240
+ if (currentRow) {
19241
+ pre.push(currentRow.row);
19242
+ }
19243
+ return pre;
19244
+ }, []);
19245
+ };
19246
+ const toggleRowExpansion = (row2, expanded) => {
19247
+ const isChanged = toggleRowExpandStatus(_expandedRows.value, row2, expanded);
19248
+ if (isChanged) {
19249
+ tableInstance.emit("expand-change", row2, _expandedRows.value.slice());
19250
+ }
19251
+ };
19252
+ const isRowExpanded = (row2) => {
19253
+ return _expandedRows.value.includes(row2);
19254
+ };
19255
+ return {
19256
+ isRowExpanded,
19257
+ updateExpandRows,
19258
+ setExpandRows,
19259
+ toggleRowExpansion
19260
+ };
19261
+ }
19153
19262
  function replaceColumn(array4, column) {
19154
19263
  return array4.map((item) => {
19155
19264
  var _a;
@@ -19281,81 +19390,17 @@ const createFixedLogic = (columns) => {
19281
19390
  });
19282
19391
  return { isFixedLeft };
19283
19392
  };
19284
- const createExpandRow = (dataSource, trackBy) => {
19285
- const _expandedRows = ref(/* @__PURE__ */ new Set());
19286
- const isRowExpanded = (row2) => {
19287
- return _expandedRows.value.has(trackBy(row2));
19288
- };
19289
- const expandRow = (row2) => {
19290
- _expandedRows.value.add(trackBy(row2));
19291
- };
19292
- const collapseRow = (row2) => {
19293
- _expandedRows.value.delete(trackBy(row2));
19294
- };
19295
- const toggleRow = (row2) => {
19296
- if (isRowExpanded(row2)) {
19297
- collapseRow(row2);
19298
- } else {
19299
- expandRow(row2);
19300
- }
19301
- };
19302
- const getExpandedRows = () => {
19303
- return dataSource.value.filter((item) => isRowExpanded(item));
19304
- };
19305
- const expandAllRows = () => {
19306
- dataSource.value.forEach((item) => {
19307
- expandRow(item);
19308
- });
19309
- };
19310
- const collapseAllRows = () => {
19311
- dataSource.value.forEach((item) => {
19312
- collapseRow(item);
19313
- });
19314
- };
19315
- return {
19316
- _expandedRows,
19317
- toggleRow,
19318
- expandRow,
19319
- collapseRow,
19320
- isRowExpanded,
19321
- getExpandedRows,
19322
- expandAllRows,
19323
- collapseAllRows
19324
- };
19325
- };
19326
19393
  function createStore(dataSource, table2) {
19327
19394
  const _data = ref([]);
19395
+ const { _columns, flatColumns, insertColumn, removeColumn, sortColumn, updateColumns } = createColumnGenerator();
19396
+ const { _checkAll, _checkSet, _halfChecked, getCheckedRows, isRowChecked, checkRow } = createSelection(_data, table2.props.trackBy);
19397
+ const { sortData, thList } = createSorter(dataSource, _data);
19398
+ const { isFixedLeft } = createFixedLogic(_columns);
19399
+ const { isRowExpanded, updateExpandRows, setExpandRows, toggleRowExpansion } = useExpand(_data);
19328
19400
  watch(dataSource, (value) => {
19329
19401
  _data.value = [...value];
19402
+ updateExpandRows();
19330
19403
  }, { deep: true, immediate: true });
19331
- const {
19332
- _columns,
19333
- flatColumns,
19334
- insertColumn,
19335
- removeColumn,
19336
- sortColumn,
19337
- updateColumns
19338
- } = createColumnGenerator();
19339
- const {
19340
- _checkAll,
19341
- _checkSet,
19342
- _halfChecked,
19343
- getCheckedRows,
19344
- isRowChecked,
19345
- checkRow
19346
- } = createSelection(_data, table2.props.trackBy);
19347
- const { sortData, thList } = createSorter(dataSource, _data);
19348
- const { isFixedLeft } = createFixedLogic(_columns);
19349
- const {
19350
- _expandedRows,
19351
- toggleRow,
19352
- expandRow,
19353
- collapseRow,
19354
- isRowExpanded,
19355
- getExpandedRows,
19356
- expandAllRows,
19357
- collapseAllRows
19358
- } = createExpandRow(dataSource, table2.props.trackBy);
19359
19404
  return {
19360
19405
  _table: table2,
19361
19406
  states: {
@@ -19366,8 +19411,7 @@ function createStore(dataSource, table2) {
19366
19411
  _checkAll,
19367
19412
  _halfChecked,
19368
19413
  isFixedLeft,
19369
- thList,
19370
- _expandedRows
19414
+ thList
19371
19415
  },
19372
19416
  insertColumn,
19373
19417
  sortColumn,
@@ -19377,13 +19421,9 @@ function createStore(dataSource, table2) {
19377
19421
  sortData,
19378
19422
  isRowChecked,
19379
19423
  checkRow,
19380
- toggleRow,
19381
- expandRow,
19382
- collapseRow,
19383
19424
  isRowExpanded,
19384
- getExpandedRows,
19385
- expandAllRows,
19386
- collapseAllRows
19425
+ setExpandRows,
19426
+ toggleRowExpansion
19387
19427
  };
19388
19428
  }
19389
19429
  var ColGroup = defineComponent({
@@ -19636,7 +19676,7 @@ var ListItem = defineComponent({
19636
19676
  };
19637
19677
  }
19638
19678
  });
19639
- function _isSlot(s) {
19679
+ function _isSlot$1(s) {
19640
19680
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
19641
19681
  }
19642
19682
  var SingleFilter = defineComponent({
@@ -19656,7 +19696,7 @@ var SingleFilter = defineComponent({
19656
19696
  let _slot;
19657
19697
  return createVNode(Fragment, null, [createVNode(List, {
19658
19698
  "class": "filter-single-menu"
19659
- }, _isSlot(_slot = props.filterList.map((item) => createVNode(ListItem, {
19699
+ }, _isSlot$1(_slot = props.filterList.map((item) => createVNode(ListItem, {
19660
19700
  "class": ["filter-item", {
19661
19701
  "filter-item-active": selectedItem.value === item
19662
19702
  }],
@@ -20149,47 +20189,47 @@ var TableBody = defineComponent({
20149
20189
  const onCellClick = (cellClickArg) => {
20150
20190
  table2.emit("cell-click", cellClickArg);
20151
20191
  };
20192
+ const onRowClick = (rowClickArg) => {
20193
+ table2.emit("row-click", rowClickArg);
20194
+ };
20152
20195
  return () => createVNode("tbody", {
20153
20196
  "class": ns2.e("tbody")
20154
20197
  }, [data.value.map((row2, rowIndex) => {
20155
- const tableRow = () => {
20156
- return createVNode("tr", {
20157
- "key": rowIndex,
20158
- "class": {
20159
- "hover-enabled": hoverEnabled.value,
20160
- "expanded": table2.store.isRowExpanded(row2)
20161
- }
20162
- }, [flatColumns.value.map((column, columnIndex) => {
20163
- var _a;
20164
- const cellId = `${rowIndex}-${columnIndex}`;
20165
- const [rowspan, colspan] = (_a = tableSpans.value[cellId]) != null ? _a : [1, 1];
20166
- if (removeCells.value.includes(cellId)) {
20167
- return null;
20168
- }
20169
- return createVNode(TD, {
20170
- "column": column,
20171
- "index": rowIndex,
20172
- "row": row2,
20173
- "rowspan": rowspan,
20174
- "colspan": colspan,
20175
- "onClick": () => onCellClick({
20176
- rowIndex,
20177
- columnIndex,
20178
- column,
20179
- row: row2
20180
- })
20181
- }, null);
20182
- })]);
20183
- };
20184
- const expandedRow = () => {
20185
- var _a, _b, _c, _d;
20186
- return flatColumns.value.some((column) => column.type === "expand") && createVNode("tr", null, [createVNode("td", {
20187
- "colspan": flatColumns.value.length
20188
- }, [(_d = (_c = (_b = (_a = flatColumns.value.filter((column) => column.type === "expand")) == null ? void 0 : _a[0]) == null ? void 0 : _b.slots) == null ? void 0 : _c.default) == null ? void 0 : _d.call(_c, {
20198
+ var _a, _b, _c, _d;
20199
+ return createVNode(Fragment, null, [createVNode("tr", {
20200
+ "key": rowIndex,
20201
+ "class": {
20202
+ "hover-enabled": hoverEnabled.value,
20203
+ expanded: table2.store.isRowExpanded(row2)
20204
+ },
20205
+ "onClick": () => onRowClick({
20189
20206
  row: row2
20190
- })])]);
20191
- };
20192
- return createVNode(Fragment, null, [tableRow(), table2.store.isRowExpanded(row2) && expandedRow()]);
20207
+ })
20208
+ }, [flatColumns.value.map((column, columnIndex) => {
20209
+ var _a2;
20210
+ const cellId = `${rowIndex}-${columnIndex}`;
20211
+ const [rowspan, colspan] = (_a2 = tableSpans.value[cellId]) != null ? _a2 : [1, 1];
20212
+ if (removeCells.value.includes(cellId)) {
20213
+ return null;
20214
+ }
20215
+ return createVNode(TD, {
20216
+ "column": column,
20217
+ "index": rowIndex,
20218
+ "row": row2,
20219
+ "rowspan": rowspan,
20220
+ "colspan": colspan,
20221
+ "onClick": () => onCellClick({
20222
+ rowIndex,
20223
+ columnIndex,
20224
+ column,
20225
+ row: row2
20226
+ })
20227
+ }, null);
20228
+ })]), flatColumns.value.some((column) => column.type === "expand") && table2.store.isRowExpanded(row2) && createVNode("tr", null, [createVNode("td", {
20229
+ "colspan": flatColumns.value.length
20230
+ }, [(_d = (_c = (_b = (_a = flatColumns.value.filter((column) => column.type === "expand")) == null ? void 0 : _a[0]) == null ? void 0 : _b.slots) == null ? void 0 : _c.default) == null ? void 0 : _d.call(_c, {
20231
+ row: row2
20232
+ })])])]);
20193
20233
  })]);
20194
20234
  }
20195
20235
  });
@@ -20255,8 +20295,8 @@ var Table = defineComponent({
20255
20295
  directives: {
20256
20296
  dLoading: loadingDirective
20257
20297
  },
20258
- props: TableProps,
20259
- emits: ["sort-change", "cell-click", "check-change", "check-all-change", "expand-change"],
20298
+ props: tableProps,
20299
+ emits: ["sort-change", "cell-click", "row-click", "check-change", "check-all-change", "expand-change"],
20260
20300
  setup(props, ctx2) {
20261
20301
  const table2 = getCurrentInstance();
20262
20302
  const store = createStore(toRef(props, "data"), table2);
@@ -20273,6 +20313,7 @@ var Table = defineComponent({
20273
20313
  classes,
20274
20314
  styles
20275
20315
  } = useTable(props, tableWidth);
20316
+ useTableWatcher(props, store);
20276
20317
  const isEmpty2 = computed(() => props.data.length === 0);
20277
20318
  const ns2 = useNamespace("table");
20278
20319
  const hiddenColumns = ref(null);
@@ -20388,21 +20429,12 @@ const tableColumnProps = {
20388
20429
  default: false
20389
20430
  }
20390
20431
  };
20391
- function formatWidth(width) {
20392
- if (width === "") {
20393
- return width;
20394
- }
20395
- if (typeof width === "number") {
20396
- return width;
20397
- }
20398
- return parseInt(width, 10) || 80;
20399
- }
20400
20432
  const cellMap = {
20401
20433
  checkable: {
20402
20434
  renderHeader(column, store) {
20403
20435
  return h(Checkbox, {
20404
20436
  modelValue: store.states._checkAll.value,
20405
- halfchecked: store.states._halfChecked.value,
20437
+ halfChecked: store.states._halfChecked.value,
20406
20438
  onChange: (val) => {
20407
20439
  store.states._checkAll.value = val;
20408
20440
  store._table.emit("check-all-change", val);
@@ -20439,8 +20471,7 @@ const cellMap = {
20439
20471
  "name": "chevron-right",
20440
20472
  "class": "icon-expand-row",
20441
20473
  "onClick": () => {
20442
- store.toggleRow(rowData);
20443
- store._table.emit("expand-change", rowData, store.getExpandedRows());
20474
+ store.toggleRowExpansion(rowData);
20444
20475
  }
20445
20476
  }, null);
20446
20477
  }
@@ -20927,7 +20958,9 @@ var Tabs = defineComponent({
20927
20958
  const content2 = (_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a);
20928
20959
  return createVNode("div", {
20929
20960
  "class": tabsClasses.value
20930
- }, [props.tabPosition === "bottom" ? [content2, tabNav2] : [tabNav2, content2]]);
20961
+ }, [props.tabPosition === "bottom" ? [content2, tabNav2] : [tabNav2, content2], createVNode("div", {
20962
+ "style": "clear: both"
20963
+ }, null)]);
20931
20964
  };
20932
20965
  }
20933
20966
  });
@@ -21230,52 +21263,241 @@ var TextareaInstall = {
21230
21263
  app.component(Textarea.name, Textarea);
21231
21264
  }
21232
21265
  };
21233
- const timeAxisProps = {
21234
- direction: {
21266
+ const timeSelectProps = {
21267
+ modelValue: {
21235
21268
  type: String,
21236
- default: "vertical"
21269
+ default: ""
21237
21270
  },
21238
- center: {
21271
+ disabled: {
21239
21272
  type: Boolean,
21240
21273
  default: false
21241
21274
  },
21242
- mode: {
21275
+ start: {
21243
21276
  type: String,
21244
- default: "normal"
21277
+ default: "00:00"
21245
21278
  },
21246
- timePosition: {
21279
+ end: {
21247
21280
  type: String,
21248
- default: "left"
21249
- }
21250
- };
21251
- const timeAxisItemProps = {
21252
- time: {
21253
- type: String
21254
- },
21255
- dotColor: {
21256
- type: String
21281
+ default: "24:00"
21257
21282
  },
21258
- lineStyle: {
21283
+ step: {
21259
21284
  type: String,
21260
- default: "solid"
21285
+ default: "00:30"
21261
21286
  },
21262
- lineColor: {
21263
- type: String
21287
+ minTime: {
21288
+ type: String,
21289
+ default: "-1:-1"
21264
21290
  },
21265
- position: {
21266
- type: String
21291
+ maxTime: {
21292
+ type: String,
21293
+ default: "24:00"
21267
21294
  },
21268
- timePosition: {
21295
+ placeholder: {
21269
21296
  type: String,
21270
- default: "left"
21297
+ default: "\u8BF7\u9009\u62E9\u65F6\u95F4"
21271
21298
  },
21272
- type: {
21299
+ size: {
21273
21300
  type: String,
21274
- default: "primary"
21275
- }
21276
- };
21277
- var TimelineItem = defineComponent({
21278
- name: "DTimelineItem",
21301
+ default: "md"
21302
+ },
21303
+ "onUpdate:modelValue": {
21304
+ type: Function
21305
+ },
21306
+ clearable: {
21307
+ type: Boolean,
21308
+ default: true
21309
+ }
21310
+ };
21311
+ function useTimeSelect(props, ctx2) {
21312
+ const select2 = ref();
21313
+ const padTime = (time) => {
21314
+ return `${time}`.padStart(2, "0");
21315
+ };
21316
+ const parseTimeToNumber = (time) => {
21317
+ const timeArr = (time || "").split(":");
21318
+ if (timeArr.length < 2) {
21319
+ return null;
21320
+ }
21321
+ const hour = Number.parseInt(timeArr[0], 10);
21322
+ const minute = Number.parseInt(timeArr[1], 10);
21323
+ return {
21324
+ hour,
21325
+ minute
21326
+ };
21327
+ };
21328
+ const formatTime = (time) => {
21329
+ return `${padTime(time.hour)}:${padTime(time.minute)}`;
21330
+ };
21331
+ const nextTime = (time, step2) => {
21332
+ const timeValue = parseTimeToNumber(time);
21333
+ const stepValue = parseTimeToNumber(step2);
21334
+ const nextTimeObj = {
21335
+ hour: timeValue.hour,
21336
+ minute: timeValue.minute
21337
+ };
21338
+ nextTimeObj.minute += stepValue.minute;
21339
+ nextTimeObj.hour += stepValue.hour;
21340
+ nextTimeObj.hour += Math.floor(nextTimeObj.minute / 60);
21341
+ nextTimeObj.minute = nextTimeObj.minute % 60;
21342
+ return formatTime(nextTimeObj);
21343
+ };
21344
+ const start = computed(() => {
21345
+ const startTime = parseTimeToNumber(props.start);
21346
+ return startTime ? formatTime(startTime) : "00:00";
21347
+ });
21348
+ const end = computed(() => {
21349
+ const endTime = parseTimeToNumber(props.end);
21350
+ return endTime ? formatTime(endTime) : "24:00";
21351
+ });
21352
+ const step = computed(() => {
21353
+ const stepTime = parseTimeToNumber(props.step);
21354
+ return stepTime ? formatTime(stepTime) : "00:30";
21355
+ });
21356
+ const minTime = computed(() => {
21357
+ const min = parseTimeToNumber(props.minTime);
21358
+ return min ? formatTime(min) : null;
21359
+ });
21360
+ const maxTime = computed(() => {
21361
+ const max = parseTimeToNumber(props.maxTime);
21362
+ return max ? formatTime(max) : null;
21363
+ });
21364
+ const compareTime = (time1, time2) => {
21365
+ const time1Obj = parseTimeToNumber(time1);
21366
+ const time2Obj = parseTimeToNumber(time2);
21367
+ const minutes01 = time1Obj.minute + time1Obj.hour * 60;
21368
+ const minutes02 = time2Obj.minute + time2Obj.hour * 60;
21369
+ if (minutes01 === minutes02) {
21370
+ return 0;
21371
+ }
21372
+ return minutes01 > minutes02 ? 1 : -1;
21373
+ };
21374
+ const options = computed(() => {
21375
+ const list2 = [];
21376
+ if (props.start && props.end && props.step) {
21377
+ let current = start.value;
21378
+ let currentTime;
21379
+ while (compareTime(current, end.value) <= 0) {
21380
+ currentTime = current;
21381
+ list2.push({
21382
+ value: currentTime,
21383
+ name: currentTime,
21384
+ disabled: compareTime(current, minTime.value || "-1:-1") <= 0 || compareTime(current, maxTime.value || "24:00") > 0
21385
+ });
21386
+ current = nextTime(current, step.value);
21387
+ }
21388
+ }
21389
+ return list2;
21390
+ });
21391
+ const changeData = (data) => {
21392
+ ctx2.emit("update:modelValue", data.value);
21393
+ ctx2.emit("change", data.value);
21394
+ };
21395
+ const clearData = (value) => {
21396
+ ctx2.emit("update:modelValue", value);
21397
+ };
21398
+ const focusFun = (e) => {
21399
+ ctx2.emit("focus", e);
21400
+ };
21401
+ const blurFun = (e) => {
21402
+ ctx2.emit("blur", e);
21403
+ };
21404
+ return {
21405
+ options,
21406
+ changeData,
21407
+ select: select2,
21408
+ clearData,
21409
+ focusFun,
21410
+ blurFun
21411
+ };
21412
+ }
21413
+ var TimeSelect = defineComponent({
21414
+ name: "DTimeSelect",
21415
+ components: {
21416
+ Select
21417
+ },
21418
+ props: timeSelectProps,
21419
+ emits: ["change", "blur", "focus", "update:modelValue"],
21420
+ setup(props, ctx2) {
21421
+ const {
21422
+ options,
21423
+ changeData,
21424
+ select: select2,
21425
+ clearData,
21426
+ focusFun,
21427
+ blurFun
21428
+ } = useTimeSelect(props, ctx2);
21429
+ return () => {
21430
+ return createVNode(Fragment, null, [createVNode(Select, {
21431
+ "ref": select2,
21432
+ "modelValue": props.modelValue,
21433
+ "options": options.value,
21434
+ "onValueChange": changeData,
21435
+ "placeholder": props.placeholder,
21436
+ "option-disabled-key": "disabled",
21437
+ "disabled": props.disabled,
21438
+ "allow-clear": props.clearable,
21439
+ "size": props.size,
21440
+ "onClear": clearData,
21441
+ "onFocus": focusFun,
21442
+ "onBlur": blurFun
21443
+ }, null)]);
21444
+ };
21445
+ }
21446
+ });
21447
+ var TimeSelectInstall = {
21448
+ title: "TimeSelect \u65F6\u95F4\u9009\u62E9\u5668",
21449
+ category: "\u6570\u636E\u5F55\u5165",
21450
+ status: "100%",
21451
+ install(app) {
21452
+ app.component(TimeSelect.name, TimeSelect);
21453
+ }
21454
+ };
21455
+ const timeAxisProps = {
21456
+ direction: {
21457
+ type: String,
21458
+ default: "vertical"
21459
+ },
21460
+ center: {
21461
+ type: Boolean,
21462
+ default: false
21463
+ },
21464
+ mode: {
21465
+ type: String,
21466
+ default: "normal"
21467
+ },
21468
+ timePosition: {
21469
+ type: String,
21470
+ default: "left"
21471
+ }
21472
+ };
21473
+ const timeAxisItemProps = {
21474
+ time: {
21475
+ type: String
21476
+ },
21477
+ dotColor: {
21478
+ type: String
21479
+ },
21480
+ lineStyle: {
21481
+ type: String,
21482
+ default: "solid"
21483
+ },
21484
+ lineColor: {
21485
+ type: String
21486
+ },
21487
+ position: {
21488
+ type: String
21489
+ },
21490
+ timePosition: {
21491
+ type: String,
21492
+ default: "left"
21493
+ },
21494
+ type: {
21495
+ type: String,
21496
+ default: "primary"
21497
+ }
21498
+ };
21499
+ var TimelineItem = defineComponent({
21500
+ name: "DTimelineItem",
21279
21501
  components: {
21280
21502
  DIcon
21281
21503
  },
@@ -21550,7 +21772,6 @@ var DTreeNodeToggle = defineComponent({
21550
21772
  });
21551
21773
  const ns = useNamespace("tree");
21552
21774
  function useTreeNode(data) {
21553
- const { getChildren } = inject(USE_TREE_TOKEN);
21554
21775
  const nodeClass = computed(() => {
21555
21776
  var _a;
21556
21777
  return [ns.e("node"), ((_a = data.value) == null ? void 0 : _a.expanded) && ns.em("node", "open")];
@@ -21560,16 +21781,19 @@ function useTreeNode(data) {
21560
21781
  return { paddingLeft: `${NODE_INDENT * (((_a = data.value) == null ? void 0 : _a.level) - 1)}px` };
21561
21782
  });
21562
21783
  const nodeVLineClass = computed(() => {
21563
- var _a, _b;
21564
- return [!((_a = data.value) == null ? void 0 : _a.isLeaf) && ((_b = data.value) == null ? void 0 : _b.expanded) && ns.e("node-vline")];
21565
- });
21566
- const nodeVLineStyle = computed(() => {
21567
21784
  var _a;
21568
- return {
21569
- height: `${NODE_HEIGHT * (getChildren(data.value, { expanded: true }).length - 1) + NODE_HEIGHT / 2 + 1}px`,
21570
- left: `${NODE_INDENT * (((_a = data.value) == null ? void 0 : _a.level) - 1) + 9}px`,
21571
- top: `${NODE_HEIGHT}px`
21572
- };
21785
+ return [((_a = data.value) == null ? void 0 : _a.level) !== 1 && ns.e("node-vline")];
21786
+ });
21787
+ const nodeVLineStyles = computed(() => {
21788
+ if (!data.value || data.value.level === 1) {
21789
+ return [];
21790
+ }
21791
+ const { currentIndex = 0, parentChildNode = 0, level, expanded, isLeaf } = data.value;
21792
+ return Array.from({ length: data.value.level - 1 }).map((_, index2) => ({
21793
+ height: `${currentIndex + 1 === parentChildNode && index2 === 0 ? isLeaf || !expanded ? NODE_HEIGHT / 2 : NODE_HEIGHT : NODE_HEIGHT}px`,
21794
+ left: `${NODE_INDENT * (level - index2 - 2) + 9}px`,
21795
+ top: `0px`
21796
+ }));
21573
21797
  });
21574
21798
  const nodeHLineClass = computed(() => {
21575
21799
  var _a;
@@ -21589,7 +21813,7 @@ function useTreeNode(data) {
21589
21813
  nodeContentClass,
21590
21814
  nodeTitleClass,
21591
21815
  nodeVLineClass,
21592
- nodeVLineStyle,
21816
+ nodeVLineStyles,
21593
21817
  nodeHLineClass
21594
21818
  };
21595
21819
  }
@@ -21609,98 +21833,1060 @@ var DTreeNodeContent = defineComponent({
21609
21833
  nodeTitleClass
21610
21834
  } = useTreeNode(data);
21611
21835
  return () => {
21612
- var _a;
21613
- return createVNode("span", {
21614
- "class": nodeTitleClass.value
21615
- }, [(_a = data.value) == null ? void 0 : _a.label]);
21836
+ var _a;
21837
+ return createVNode("span", {
21838
+ "class": nodeTitleClass.value
21839
+ }, [(_a = data.value) == null ? void 0 : _a.label]);
21840
+ };
21841
+ }
21842
+ });
21843
+ var DTreeNode = defineComponent({
21844
+ name: "DTreeNode",
21845
+ props: {
21846
+ data: {
21847
+ type: Object,
21848
+ default: () => ({})
21849
+ },
21850
+ check: {
21851
+ type: Boolean,
21852
+ default: false
21853
+ }
21854
+ },
21855
+ setup(props, {
21856
+ slots
21857
+ }) {
21858
+ const {
21859
+ data,
21860
+ check
21861
+ } = toRefs(props);
21862
+ const {
21863
+ toggleSelectNode,
21864
+ toggleCheckNode,
21865
+ toggleNode,
21866
+ getChildren
21867
+ } = inject(USE_TREE_TOKEN);
21868
+ const ns2 = useNamespace("tree");
21869
+ const {
21870
+ nodeClass,
21871
+ nodeStyle,
21872
+ nodeContentClass,
21873
+ nodeVLineClass,
21874
+ nodeVLineStyles,
21875
+ nodeHLineClass
21876
+ } = useTreeNode(data);
21877
+ const halfChecked = computed(() => {
21878
+ const children = getChildren == null ? void 0 : getChildren(data.value);
21879
+ const checkedChildren = children == null ? void 0 : children.filter((item) => item.checked);
21880
+ if (["upward", "both"].includes(check.value)) {
21881
+ return checkedChildren.length > 0 && checkedChildren.length < children.length;
21882
+ } else {
21883
+ return false;
21884
+ }
21885
+ });
21886
+ return () => {
21887
+ var _a, _b, _c;
21888
+ const checkboxProps2 = {
21889
+ key: (_a = data.value) == null ? void 0 : _a.id,
21890
+ disabled: (_b = data.value) == null ? void 0 : _b.disableCheck,
21891
+ halfchecked: halfChecked.value,
21892
+ modelValue: (_c = data.value) == null ? void 0 : _c.checked,
21893
+ "onUpdate:modelValue": () => {
21894
+ toggleCheckNode == null ? void 0 : toggleCheckNode(data.value);
21895
+ },
21896
+ onClick: (event) => {
21897
+ event.stopPropagation();
21898
+ }
21899
+ };
21900
+ return createVNode("div", {
21901
+ "class": nodeClass.value,
21902
+ "style": nodeStyle.value
21903
+ }, [nodeVLineStyles.value.map((item) => createVNode("span", {
21904
+ "class": nodeVLineClass.value,
21905
+ "style": item
21906
+ }, null)), createVNode("div", {
21907
+ "class": nodeContentClass.value,
21908
+ "onClick": () => {
21909
+ toggleSelectNode == null ? void 0 : toggleSelectNode(data.value);
21910
+ }
21911
+ }, [createVNode("span", {
21912
+ "class": nodeHLineClass.value
21913
+ }, null), slots.icon ? renderSlot(useSlots(), "icon", {
21914
+ nodeData: data,
21915
+ toggleNode
21916
+ }) : createVNode(DTreeNodeToggle, {
21917
+ "data": data.value
21918
+ }, null), createVNode("div", {
21919
+ "class": ns2.em("node-content", "value-wrapper"),
21920
+ "style": {
21921
+ height: `${NODE_HEIGHT}px`
21922
+ }
21923
+ }, [check.value && createVNode(Checkbox, checkboxProps2, null), slots.default ? renderSlot(useSlots(), "default", {
21924
+ nodeData: data
21925
+ }) : createVNode(DTreeNodeContent, {
21926
+ "data": data.value
21927
+ }, null)])])]);
21928
+ };
21929
+ }
21930
+ });
21931
+ const virtualListProps = {
21932
+ data: {
21933
+ type: Array,
21934
+ default: () => []
21935
+ },
21936
+ component: {
21937
+ type: String,
21938
+ default: "div"
21939
+ },
21940
+ height: {
21941
+ type: Number,
21942
+ default: 100
21943
+ },
21944
+ itemHeight: {
21945
+ type: Number,
21946
+ default: 0
21947
+ },
21948
+ virtual: {
21949
+ type: Boolean,
21950
+ default: true
21951
+ },
21952
+ fullHeight: {
21953
+ type: Boolean
21954
+ },
21955
+ itemKey: {
21956
+ type: [String, Number, Function]
21957
+ }
21958
+ };
21959
+ const resizeObserverContainerProps = {
21960
+ height: {
21961
+ type: Number
21962
+ },
21963
+ offset: {
21964
+ type: Number || void 0
21965
+ },
21966
+ disabled: {
21967
+ type: Function
21968
+ },
21969
+ onInnerResize: {
21970
+ type: Function
21971
+ }
21972
+ };
21973
+ const scrollBarProps = {
21974
+ scrollTop: {
21975
+ type: Number
21976
+ },
21977
+ scrollHeight: {
21978
+ type: Number
21979
+ },
21980
+ height: {
21981
+ type: Number
21982
+ },
21983
+ count: {
21984
+ type: Number
21985
+ },
21986
+ onScroll: {
21987
+ type: Function
21988
+ },
21989
+ onStartMove: {
21990
+ type: Function
21991
+ },
21992
+ onStopMove: {
21993
+ type: Function
21994
+ }
21995
+ };
21996
+ const resizeObserverProps = {
21997
+ disabled: {
21998
+ type: Boolean
21999
+ },
22000
+ onResize: {
22001
+ type: Function
22002
+ }
22003
+ };
22004
+ function useVirtual(props) {
22005
+ const isVirtual = computed(() => {
22006
+ const {
22007
+ height,
22008
+ virtual
22009
+ } = props;
22010
+ return !!(virtual !== false && height);
22011
+ });
22012
+ const inVirtual = computed(() => {
22013
+ const {
22014
+ height,
22015
+ data
22016
+ } = props;
22017
+ return isVirtual.value && data && 20 * data.length > height;
22018
+ });
22019
+ return {
22020
+ isVirtual,
22021
+ inVirtual
22022
+ };
22023
+ }
22024
+ function useHeights(mergedData, getKey) {
22025
+ const instance = /* @__PURE__ */ new Map();
22026
+ let heights = /* @__PURE__ */ new Map();
22027
+ const updatedMark = ref(Symbol("update"));
22028
+ watch(mergedData, () => {
22029
+ heights = /* @__PURE__ */ new Map();
22030
+ updatedMark.value = Symbol("update");
22031
+ });
22032
+ let heightUpdateId = 0;
22033
+ function collectHeight() {
22034
+ heightUpdateId += 1;
22035
+ const currentId = heightUpdateId;
22036
+ Promise.resolve().then(() => {
22037
+ if (currentId !== heightUpdateId) {
22038
+ return;
22039
+ }
22040
+ instance.forEach((element, key) => {
22041
+ if (element && element.offsetParent) {
22042
+ const {
22043
+ offsetHeight
22044
+ } = element;
22045
+ if (heights.get(key) !== offsetHeight) {
22046
+ updatedMark.value = Symbol("update");
22047
+ heights.set(key, element.offsetHeight);
22048
+ }
22049
+ }
22050
+ });
22051
+ });
22052
+ }
22053
+ function setInstance(item, ins) {
22054
+ const key = getKey(item);
22055
+ if (ins) {
22056
+ instance.set(key, ins.$el || ins);
22057
+ collectHeight();
22058
+ } else {
22059
+ instance.delete(key);
22060
+ }
22061
+ }
22062
+ return [setInstance, collectHeight, heights, updatedMark];
22063
+ }
22064
+ var useOriginScroll = (isScrollAtTop, isScrollAtBottom) => {
22065
+ let lock = false;
22066
+ let lockTimeout = null;
22067
+ function lockScroll2() {
22068
+ if (lockTimeout) {
22069
+ clearTimeout(lockTimeout);
22070
+ }
22071
+ lock = true;
22072
+ lockTimeout = setTimeout(() => {
22073
+ lock = false;
22074
+ }, 50);
22075
+ }
22076
+ return (deltaY, smoothOffset = false) => {
22077
+ const originScroll = deltaY < 0 && isScrollAtTop.value || deltaY > 0 && isScrollAtBottom.value;
22078
+ if (smoothOffset && originScroll) {
22079
+ if (lockTimeout) {
22080
+ clearTimeout(lockTimeout);
22081
+ }
22082
+ lock = false;
22083
+ } else if (!originScroll || lock) {
22084
+ lockScroll2();
22085
+ }
22086
+ return !lock && originScroll;
22087
+ };
22088
+ };
22089
+ const isValid = (value) => {
22090
+ return value !== void 0 && value !== null && value !== "";
22091
+ };
22092
+ const isEmptyElement = (c) => {
22093
+ var _a, _b;
22094
+ return !!c && (c.type === Comment || c.type === Fragment && ((_a = c == null ? void 0 : c.children) == null ? void 0 : _a.length) === 0 || c.type === Text && ((_b = c == null ? void 0 : c.children) == null ? void 0 : _b.trim()) === "");
22095
+ };
22096
+ const flattenChildren = (children, filterEmpty = true) => {
22097
+ const temp = Array.isArray(children) ? children : [children];
22098
+ const res = [];
22099
+ temp.forEach((child) => {
22100
+ if (Array.isArray(child)) {
22101
+ res.push(...flattenChildren(child, filterEmpty));
22102
+ } else if (child && child.type === Fragment) {
22103
+ res.push(...flattenChildren(child.children, filterEmpty));
22104
+ } else if (child && isVNode(child)) {
22105
+ if (filterEmpty && !isEmptyElement(child)) {
22106
+ res.push(child);
22107
+ } else if (!filterEmpty) {
22108
+ res.push(child);
22109
+ }
22110
+ } else if (isValid(child)) {
22111
+ res.push(child);
22112
+ }
22113
+ });
22114
+ return res;
22115
+ };
22116
+ const findDOMNode = (instance) => {
22117
+ var _a;
22118
+ let node = ((_a = instance == null ? void 0 : instance.vnode) == null ? void 0 : _a.el) || instance && ((instance == null ? void 0 : instance.$el) || instance);
22119
+ while (node && !node.tagName) {
22120
+ node = node.nextSibling;
22121
+ }
22122
+ return node;
22123
+ };
22124
+ const isFF = typeof navigator === "object" && /Firefox/i.test(navigator.userAgent);
22125
+ function useFrameWheel(inVirtual, isScrollAtTop, isScrollAtBottom, onWheelDelta) {
22126
+ let offsetRef = 0;
22127
+ let nextFrame = null;
22128
+ let wheelValue = null;
22129
+ let isMouseScroll = false;
22130
+ const originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
22131
+ const onRawWheel = (event) => {
22132
+ var _a;
22133
+ if (!inVirtual.value) {
22134
+ return;
22135
+ }
22136
+ if (nextFrame) {
22137
+ window.cancelAnimationFrame(nextFrame);
22138
+ }
22139
+ const {
22140
+ deltaY
22141
+ } = event;
22142
+ offsetRef += deltaY;
22143
+ wheelValue = deltaY;
22144
+ if (originScroll(deltaY, false)) {
22145
+ return;
22146
+ }
22147
+ if (!isFF) {
22148
+ (_a = event == null ? void 0 : event.preventDefault) == null ? void 0 : _a.call(event);
22149
+ }
22150
+ nextFrame = window.requestAnimationFrame(() => {
22151
+ const patchMultiple = isMouseScroll ? 10 : 1;
22152
+ onWheelDelta(offsetRef * patchMultiple);
22153
+ offsetRef = 0;
22154
+ });
22155
+ };
22156
+ const onFireFoxScroll = (event) => {
22157
+ if (!inVirtual.value) {
22158
+ return;
22159
+ }
22160
+ isMouseScroll = event.detail === wheelValue;
22161
+ };
22162
+ return [onRawWheel, onFireFoxScroll];
22163
+ }
22164
+ const SMOOTH_PTG = 14 / 15;
22165
+ function useMobileTouchMove(inVirtual, listRef, callback) {
22166
+ let touched = false;
22167
+ let touchY = 0;
22168
+ let element = null;
22169
+ let interval = null;
22170
+ const onTouchMove = (e) => {
22171
+ if (touched) {
22172
+ const currentY = Math.ceil(e.touches[0].pageY);
22173
+ let offsetY = touchY - currentY;
22174
+ touchY = currentY;
22175
+ if (callback(offsetY)) {
22176
+ e.preventDefault();
22177
+ }
22178
+ if (interval) {
22179
+ clearInterval(interval);
22180
+ }
22181
+ interval = setInterval(() => {
22182
+ offsetY *= SMOOTH_PTG;
22183
+ if (!callback(offsetY, true) || Math.abs(offsetY) <= 0.1) {
22184
+ if (interval) {
22185
+ clearInterval(interval);
22186
+ }
22187
+ }
22188
+ }, 16);
22189
+ }
22190
+ };
22191
+ const cleanUpEvents = () => {
22192
+ if (element) {
22193
+ element.removeEventListener("touchmove", onTouchMove);
22194
+ element.removeEventListener("touchend", () => {
22195
+ touched = false;
22196
+ cleanUpEvents();
22197
+ });
22198
+ }
22199
+ };
22200
+ const onTouchEnd = () => {
22201
+ touched = false;
22202
+ cleanUpEvents();
22203
+ };
22204
+ const onTouchStart = (e) => {
22205
+ cleanUpEvents();
22206
+ if (e.touches.length === 1 && !touched) {
22207
+ touched = true;
22208
+ touchY = Math.ceil(e.touches[0].pageY);
22209
+ element = e.target;
22210
+ element.addEventListener("touchmove", onTouchMove, {
22211
+ passive: false
22212
+ });
22213
+ element.addEventListener("touchend", onTouchEnd);
22214
+ }
22215
+ };
22216
+ onMounted(() => {
22217
+ watch(inVirtual, (val) => {
22218
+ var _a, _b;
22219
+ (_a = listRef.value) == null ? void 0 : _a.removeEventListener("touchstart", onTouchStart);
22220
+ cleanUpEvents();
22221
+ if (interval) {
22222
+ clearInterval(interval);
22223
+ }
22224
+ if (val) {
22225
+ (_b = listRef.value) == null ? void 0 : _b.addEventListener("touchstart", onTouchStart, {
22226
+ passive: false
22227
+ });
22228
+ }
22229
+ }, {
22230
+ immediate: true
22231
+ });
22232
+ });
22233
+ }
22234
+ var ResizeObserver$1 = defineComponent({
22235
+ name: "ResizeObserver",
22236
+ props: resizeObserverProps,
22237
+ emits: ["resize"],
22238
+ setup(props, {
22239
+ slots
22240
+ }) {
22241
+ const state = reactive({
22242
+ width: 0,
22243
+ height: 0,
22244
+ offsetHeight: 0,
22245
+ offsetWidth: 0
22246
+ });
22247
+ const currentElement = ref(null);
22248
+ const resizeObserver = ref(null);
22249
+ const destroyObserver = () => {
22250
+ if (resizeObserver.value) {
22251
+ resizeObserver.value.disconnect();
22252
+ resizeObserver.value = null;
22253
+ }
22254
+ };
22255
+ const onTriggerResize = (entries) => {
22256
+ const {
22257
+ onResize
22258
+ } = props;
22259
+ const target = entries[0].target;
22260
+ const {
22261
+ width,
22262
+ height
22263
+ } = target.getBoundingClientRect();
22264
+ const {
22265
+ offsetWidth,
22266
+ offsetHeight
22267
+ } = target;
22268
+ const fixedWidth = Math.floor(width);
22269
+ const fixedHeight = Math.floor(height);
22270
+ if (state.width !== fixedWidth || state.height !== fixedHeight || state.offsetWidth !== offsetWidth || state.offsetHeight !== offsetHeight) {
22271
+ const size = {
22272
+ width: fixedWidth,
22273
+ height: fixedHeight,
22274
+ offsetWidth,
22275
+ offsetHeight
22276
+ };
22277
+ Object.assign(state, size);
22278
+ if (onResize) {
22279
+ Promise.resolve().then(() => {
22280
+ onResize(__spreadProps(__spreadValues({}, size), {
22281
+ offsetWidth,
22282
+ offsetHeight
22283
+ }), target);
22284
+ });
22285
+ }
22286
+ }
22287
+ };
22288
+ const instance = getCurrentInstance();
22289
+ const registerObserver = () => {
22290
+ const {
22291
+ disabled
22292
+ } = props;
22293
+ if (disabled) {
22294
+ destroyObserver();
22295
+ return;
22296
+ }
22297
+ if (instance) {
22298
+ const element = findDOMNode(instance);
22299
+ const elementChanged = element !== currentElement.value;
22300
+ if (elementChanged) {
22301
+ destroyObserver();
22302
+ currentElement.value = element;
22303
+ }
22304
+ if (!resizeObserver.value && element) {
22305
+ resizeObserver.value = new ResizeObserver(onTriggerResize);
22306
+ resizeObserver.value.observe(element);
22307
+ }
22308
+ }
22309
+ };
22310
+ onMounted(() => {
22311
+ registerObserver();
22312
+ });
22313
+ onUpdated(() => {
22314
+ registerObserver();
22315
+ });
22316
+ onUnmounted(() => {
22317
+ destroyObserver();
22318
+ });
22319
+ return () => {
22320
+ var _a;
22321
+ return (_a = slots.default) == null ? void 0 : _a.call(slots)[0];
22322
+ };
22323
+ }
22324
+ });
22325
+ const INIT_INNER_STYLE = {
22326
+ display: "flex",
22327
+ flexDirection: "column"
22328
+ };
22329
+ var ResizeObserverContainer = defineComponent({
22330
+ name: "ResizeObserverContainer",
22331
+ props: resizeObserverContainerProps,
22332
+ setup(props, ctx2) {
22333
+ const {
22334
+ height,
22335
+ offset: offset2
22336
+ } = toRefs(props);
22337
+ const outerStyle = ref({});
22338
+ const innerStyle = ref(INIT_INNER_STYLE);
22339
+ watch([() => height.value, () => offset2.value], () => {
22340
+ if (props.offset !== void 0) {
22341
+ outerStyle.value = {
22342
+ height: `${height.value}px`,
22343
+ position: "relative",
22344
+ overflow: "hidden"
22345
+ };
22346
+ innerStyle.value = __spreadProps(__spreadValues({}, innerStyle.value), {
22347
+ transform: `translateY(${offset2.value}px)`,
22348
+ position: "absolute",
22349
+ left: 0,
22350
+ right: 0,
22351
+ top: 0
22352
+ });
22353
+ }
22354
+ });
22355
+ return () => createVNode("div", {
22356
+ "style": outerStyle.value
22357
+ }, [createVNode(ResizeObserver$1, {
22358
+ "onResize": ({
22359
+ offsetHeight
22360
+ }) => {
22361
+ if (offsetHeight && props.onInnerResize) {
22362
+ props.onInnerResize();
22363
+ }
22364
+ }
22365
+ }, {
22366
+ default: () => {
22367
+ var _a, _b;
22368
+ return [createVNode("div", {
22369
+ "style": innerStyle.value
22370
+ }, [(_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a)])];
22371
+ }
22372
+ })]);
22373
+ }
22374
+ });
22375
+ function getPageY(e) {
22376
+ return "touches" in e ? e.touches[0].pageY : e.pageY;
22377
+ }
22378
+ var ScrollBar = defineComponent({
22379
+ name: "ScrollBar",
22380
+ props: scrollBarProps,
22381
+ setup(props, ctx2) {
22382
+ const scrollbarRef = ref(null);
22383
+ const thumbRef = ref(null);
22384
+ const moveRaf = ref(0);
22385
+ const state = reactive({
22386
+ dragging: false,
22387
+ pageY: null,
22388
+ startTop: null,
22389
+ visible: false
22390
+ });
22391
+ const visibleTimeout = ref(null);
22392
+ const canScroll = computed(() => {
22393
+ return (props.scrollHeight || 0) > (props.height || 0);
22394
+ });
22395
+ const getSpinHeight = () => {
22396
+ const {
22397
+ height = 0,
22398
+ count = 0
22399
+ } = props;
22400
+ let baseHeight = height / count * 10;
22401
+ baseHeight = Math.max(baseHeight, 20);
22402
+ baseHeight = Math.min(baseHeight, height / 2);
22403
+ return Math.floor(baseHeight);
22404
+ };
22405
+ const getEnableScrollRange = () => {
22406
+ const {
22407
+ scrollHeight = 0,
22408
+ height = 0
22409
+ } = props;
22410
+ return scrollHeight - height || 0;
22411
+ };
22412
+ const getEnableHeightRange = () => {
22413
+ const {
22414
+ height = 0
22415
+ } = props;
22416
+ const spinHeight = getSpinHeight();
22417
+ return height - spinHeight || 0;
22418
+ };
22419
+ const getTop = () => {
22420
+ const {
22421
+ scrollTop = 0
22422
+ } = props;
22423
+ const enableScrollRange = getEnableScrollRange();
22424
+ const enableHeightRange = getEnableHeightRange();
22425
+ if (scrollTop === 0 || enableScrollRange === 0) {
22426
+ return 0;
22427
+ }
22428
+ const ptg = scrollTop / enableScrollRange;
22429
+ return ptg * enableHeightRange;
22430
+ };
22431
+ const onMouseMove = (e) => {
22432
+ const {
22433
+ dragging,
22434
+ pageY,
22435
+ startTop
22436
+ } = state;
22437
+ const {
22438
+ onScroll
22439
+ } = props;
22440
+ window.cancelAnimationFrame(moveRaf.value);
22441
+ if (dragging) {
22442
+ const offsetY = getPageY(e) - (pageY || 0);
22443
+ const newTop = (startTop || 0) + offsetY;
22444
+ const enableScrollRange = getEnableScrollRange();
22445
+ const enableHeightRange = getEnableHeightRange();
22446
+ const ptg = enableHeightRange ? newTop / enableHeightRange : 0;
22447
+ const newScrollTop = Math.ceil(ptg * enableScrollRange);
22448
+ moveRaf.value = window.requestAnimationFrame(() => {
22449
+ if (onScroll) {
22450
+ onScroll(newScrollTop);
22451
+ }
22452
+ });
22453
+ }
22454
+ };
22455
+ const onMouseUp = (callback) => {
22456
+ const {
22457
+ onStopMove
22458
+ } = props;
22459
+ state.dragging = false;
22460
+ if (onStopMove) {
22461
+ onStopMove();
22462
+ }
22463
+ if (callback) {
22464
+ callback();
22465
+ }
22466
+ };
22467
+ const onMouseDown = (e, callback) => {
22468
+ var _a, _b;
22469
+ const {
22470
+ onStartMove
22471
+ } = props;
22472
+ Object.assign(state, {
22473
+ dragging: true,
22474
+ pageY: getPageY(e),
22475
+ startTop: getTop()
22476
+ });
22477
+ if (onStartMove) {
22478
+ onStartMove();
22479
+ }
22480
+ window.addEventListener("mousemove", onMouseMove);
22481
+ window.addEventListener("mouseup", () => onMouseUp(callback));
22482
+ (_a = thumbRef == null ? void 0 : thumbRef.value) == null ? void 0 : _a.addEventListener("touchmove", onMouseMove, {
22483
+ passive: false
22484
+ });
22485
+ (_b = thumbRef == null ? void 0 : thumbRef.value) == null ? void 0 : _b.addEventListener("touchend", () => onMouseUp(callback));
22486
+ e.stopPropagation();
22487
+ e.preventDefault();
22488
+ };
22489
+ const removeEvents = () => {
22490
+ var _a, _b, _c, _d;
22491
+ window.removeEventListener("mousemove", onMouseMove);
22492
+ window.removeEventListener("mouseup", () => onMouseUp(removeEvents));
22493
+ (_a = scrollbarRef == null ? void 0 : scrollbarRef.value) == null ? void 0 : _a.removeEventListener("touchstart", (e) => {
22494
+ e.preventDefault();
22495
+ }, {
22496
+ passive: false
22497
+ });
22498
+ (_b = thumbRef == null ? void 0 : thumbRef.value) == null ? void 0 : _b.removeEventListener("touchstart", (e) => onMouseDown(e, removeEvents), {
22499
+ passive: false
22500
+ });
22501
+ (_c = thumbRef == null ? void 0 : thumbRef.value) == null ? void 0 : _c.removeEventListener("touchmove", onMouseMove, {
22502
+ passive: false
22503
+ });
22504
+ (_d = thumbRef == null ? void 0 : thumbRef.value) == null ? void 0 : _d.removeEventListener("touchend", () => onMouseUp(removeEvents));
22505
+ window.cancelAnimationFrame(moveRaf.value);
22506
+ };
22507
+ const onContainerMouseDown = (e) => {
22508
+ e.stopPropagation();
22509
+ e.preventDefault();
22510
+ };
22511
+ onBeforeUnmount(() => {
22512
+ removeEvents();
22513
+ if (visibleTimeout.value) {
22514
+ clearTimeout(visibleTimeout.value);
22515
+ }
22516
+ });
22517
+ onMounted(() => {
22518
+ var _a, _b;
22519
+ (_a = scrollbarRef == null ? void 0 : scrollbarRef.value) == null ? void 0 : _a.addEventListener("touchstart", (e) => {
22520
+ e.preventDefault();
22521
+ }, {
22522
+ passive: false
22523
+ });
22524
+ (_b = thumbRef.value) == null ? void 0 : _b.addEventListener("touchstart", (e) => onMouseDown(e, removeEvents), {
22525
+ passive: false
22526
+ });
22527
+ });
22528
+ const onShowBar = () => {
22529
+ if (visibleTimeout.value) {
22530
+ clearTimeout(visibleTimeout.value);
22531
+ }
22532
+ state.visible = true;
22533
+ visibleTimeout.value = setTimeout(() => {
22534
+ state.visible = false;
22535
+ }, 1e3);
22536
+ };
22537
+ ctx2.expose({
22538
+ onShowBar
22539
+ });
22540
+ return () => {
22541
+ const display = canScroll.value && state.visible ? void 0 : "none";
22542
+ return createVNode("div", {
22543
+ "ref": scrollbarRef,
22544
+ "style": {
22545
+ width: "8px",
22546
+ top: 0,
22547
+ bottom: 0,
22548
+ right: 0,
22549
+ position: "absolute",
22550
+ display
22551
+ },
22552
+ "onMousedown": onContainerMouseDown,
22553
+ "onMousemove": onShowBar
22554
+ }, [createVNode("div", {
22555
+ "ref": thumbRef,
22556
+ "style": {
22557
+ width: "100%",
22558
+ height: getSpinHeight() + "px",
22559
+ top: getTop() + "px",
22560
+ left: 0,
22561
+ position: "absolute",
22562
+ background: "rgba(0, 0, 0, 0.5)",
22563
+ borderRadius: "99px",
22564
+ cursor: "pointer",
22565
+ userSelect: "none"
22566
+ },
22567
+ "onMousedown": (e) => onMouseDown(e, removeEvents)
22568
+ }, null)]);
21616
22569
  };
21617
22570
  }
21618
22571
  });
21619
- var DTreeNode = defineComponent({
21620
- name: "DTreeNode",
21621
- props: {
21622
- data: {
21623
- type: Object,
21624
- default: () => ({})
21625
- },
21626
- check: {
21627
- type: Boolean,
21628
- default: false
21629
- }
21630
- },
21631
- setup(props, {
21632
- slots
21633
- }) {
21634
- const {
21635
- data,
21636
- check
21637
- } = toRefs(props);
21638
- const {
21639
- toggleSelectNode,
21640
- toggleCheckNode,
21641
- toggleNode,
21642
- getChildren
21643
- } = inject(USE_TREE_TOKEN);
21644
- const ns2 = useNamespace("tree");
22572
+ function _isSlot(s) {
22573
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
22574
+ }
22575
+ const Item = ({
22576
+ setRef
22577
+ }, {
22578
+ slots
22579
+ }) => {
22580
+ var _a;
22581
+ const children = flattenChildren((_a = slots.default) == null ? void 0 : _a.call(slots));
22582
+ return children && children.length ? cloneVNode(children[0], {
22583
+ ref: setRef
22584
+ }) : children;
22585
+ };
22586
+ Item.props = {
22587
+ setRef: {
22588
+ type: Function
22589
+ }
22590
+ };
22591
+ function renderChildren(list2, startIndex, endIndex, setNodeRef, {
22592
+ getKey
22593
+ }, renderFunc) {
22594
+ if (renderFunc === void 0) {
22595
+ return "";
22596
+ }
22597
+ return list2.slice(startIndex, endIndex + 1).map((item, index2) => {
22598
+ const eleIndex = startIndex + index2;
22599
+ const node = renderFunc(item, eleIndex, {});
22600
+ const key = getKey(item);
22601
+ return createVNode(Item, {
22602
+ "key": key,
22603
+ "setRef": (ele) => setNodeRef(item, ele)
22604
+ }, _isSlot(node) ? node : {
22605
+ default: () => [node]
22606
+ });
22607
+ });
22608
+ }
22609
+ const ScrollStyle = {
22610
+ overflowY: "auto",
22611
+ overflowAnchor: "none"
22612
+ };
22613
+ var VirtualList = defineComponent({
22614
+ name: "DVirtualList",
22615
+ props: virtualListProps,
22616
+ setup(props, ctx2) {
21645
22617
  const {
21646
- nodeClass,
21647
- nodeStyle,
21648
- nodeContentClass,
21649
- nodeVLineClass,
21650
- nodeVLineStyle,
21651
- nodeHLineClass
21652
- } = useTreeNode(data);
21653
- const halfChecked = computed(() => {
21654
- const children = getChildren == null ? void 0 : getChildren(data.value);
21655
- const checkedChildren = children == null ? void 0 : children.filter((item) => item.checked);
21656
- if (["upward", "both"].includes(check.value)) {
21657
- return checkedChildren.length > 0 && checkedChildren.length < children.length;
22618
+ isVirtual,
22619
+ inVirtual
22620
+ } = useVirtual(props);
22621
+ const state = reactive({
22622
+ scrollTop: 0,
22623
+ scrollMoving: false
22624
+ });
22625
+ const data = computed(() => {
22626
+ return props.data || [];
22627
+ });
22628
+ const mergedData = shallowRef([]);
22629
+ watch(data, () => {
22630
+ mergedData.value = toRaw(data.value).slice();
22631
+ }, {
22632
+ immediate: true
22633
+ });
22634
+ const itemKey = shallowRef(null);
22635
+ watch(() => props.itemKey, (val) => {
22636
+ if (typeof val === "function") {
22637
+ itemKey.value = val;
22638
+ } else {
22639
+ if (val) {
22640
+ itemKey.value = (item) => item == null ? void 0 : item[val];
22641
+ }
22642
+ }
22643
+ }, {
22644
+ immediate: true
22645
+ });
22646
+ const componentRef = ref();
22647
+ const fillerInnerRef = ref();
22648
+ const barRef = ref();
22649
+ const getKey = (item) => {
22650
+ if (!itemKey.value || !props.itemKey) {
22651
+ return;
22652
+ }
22653
+ return itemKey.value(item);
22654
+ };
22655
+ const [setInstance, collectHeight, heights, updatedMark] = useHeights(mergedData, getKey);
22656
+ const calRes = reactive({
22657
+ scrollHeight: void 0,
22658
+ start: 0,
22659
+ end: 0,
22660
+ offset: void 0
22661
+ });
22662
+ const offsetHeight = ref(0);
22663
+ onMounted(() => {
22664
+ nextTick(() => {
22665
+ var _a;
22666
+ offsetHeight.value = ((_a = fillerInnerRef.value) == null ? void 0 : _a.offsetHeight) || 0;
22667
+ });
22668
+ });
22669
+ onUpdated(() => {
22670
+ nextTick(() => {
22671
+ var _a;
22672
+ offsetHeight.value = ((_a = fillerInnerRef.value) == null ? void 0 : _a.offsetHeight) || 0;
22673
+ });
22674
+ });
22675
+ watch([isVirtual, mergedData], () => {
22676
+ if (!isVirtual.value) {
22677
+ Object.assign(calRes, {
22678
+ scrollHeight: void 0,
22679
+ start: 0,
22680
+ end: mergedData.value.length - 1,
22681
+ offset: void 0
22682
+ });
22683
+ }
22684
+ }, {
22685
+ immediate: true
22686
+ });
22687
+ watch([isVirtual, mergedData, offsetHeight, inVirtual], () => {
22688
+ if (isVirtual.value && !inVirtual.value) {
22689
+ Object.assign(calRes, {
22690
+ scrollHeight: offsetHeight.value,
22691
+ start: 0,
22692
+ end: mergedData.value.length - 1,
22693
+ offset: void 0
22694
+ });
22695
+ }
22696
+ }, {
22697
+ immediate: true
22698
+ });
22699
+ watch([inVirtual, isVirtual, () => state.scrollTop, mergedData, updatedMark, () => props.height, offsetHeight], () => {
22700
+ if (!isVirtual.value || !inVirtual.value) {
22701
+ return;
22702
+ }
22703
+ let itemTop = 0;
22704
+ let startIndex;
22705
+ let startOffset;
22706
+ let endIndex;
22707
+ const mergedDataValue = unref(mergedData);
22708
+ const scrollTop = state.scrollTop;
22709
+ const {
22710
+ height
22711
+ } = props;
22712
+ const scrollTopHeight = scrollTop + height;
22713
+ for (let i = 0; i < mergedDataValue.length; i += 1) {
22714
+ const mergedDataItem = mergedDataValue[i];
22715
+ let cacheHeight;
22716
+ if (props.itemKey) {
22717
+ const key = getKey(mergedDataItem);
22718
+ cacheHeight = heights.get(key);
22719
+ }
22720
+ if (cacheHeight === void 0) {
22721
+ cacheHeight = props.itemHeight || 20;
22722
+ }
22723
+ const currentItemBottom = itemTop + cacheHeight;
22724
+ if (startIndex === void 0 && currentItemBottom >= scrollTop) {
22725
+ startIndex = i;
22726
+ startOffset = itemTop;
22727
+ }
22728
+ if (endIndex === void 0 && currentItemBottom > scrollTopHeight) {
22729
+ endIndex = i;
22730
+ }
22731
+ itemTop = currentItemBottom;
22732
+ }
22733
+ if (startIndex === void 0) {
22734
+ startIndex = 0;
22735
+ startOffset = 0;
22736
+ }
22737
+ if (endIndex === void 0) {
22738
+ endIndex = mergedDataValue.length - 1;
22739
+ }
22740
+ endIndex = Math.min(endIndex + 1, mergedDataValue.length);
22741
+ Object.assign(calRes, {
22742
+ scrollHeight: itemTop,
22743
+ start: startIndex,
22744
+ end: endIndex,
22745
+ offset: startOffset
22746
+ });
22747
+ }, {
22748
+ immediate: true
22749
+ });
22750
+ const maxScrollHeight = computed(() => (calRes.scrollHeight || 0) - props.height);
22751
+ const keepInRange = (newScrollTop) => {
22752
+ let newTop = newScrollTop;
22753
+ if (!Number.isNaN(maxScrollHeight.value)) {
22754
+ newTop = Math.min(newTop, maxScrollHeight.value);
22755
+ }
22756
+ newTop = Math.max(newTop, 0);
22757
+ return newTop;
22758
+ };
22759
+ const isScrollAtTop = computed(() => state.scrollTop <= 0);
22760
+ const isScrollAtBottom = computed(() => state.scrollTop >= maxScrollHeight.value);
22761
+ const originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
22762
+ const syncScrollTop = (newTop) => {
22763
+ let value;
22764
+ if (typeof newTop === "function") {
22765
+ value = newTop(state.scrollTop);
21658
22766
  } else {
22767
+ value = newTop;
22768
+ }
22769
+ const alignedTop = keepInRange(value);
22770
+ if (componentRef.value) {
22771
+ componentRef.value.scrollTop = alignedTop;
22772
+ }
22773
+ state.scrollTop = alignedTop;
22774
+ };
22775
+ const onScrollBar = (newScrollTop) => {
22776
+ const newTop = newScrollTop;
22777
+ syncScrollTop(newTop);
22778
+ };
22779
+ const onComponentScroll = (e) => {
22780
+ var _a, _b;
22781
+ const {
22782
+ scrollTop: newScrollTop
22783
+ } = e.currentTarget;
22784
+ if (Math.abs(newScrollTop - state.scrollTop) >= 1) {
22785
+ syncScrollTop(newScrollTop);
22786
+ }
22787
+ (_b = (_a = barRef == null ? void 0 : barRef.value) == null ? void 0 : _a.onShowBar) == null ? void 0 : _b.call(_a);
22788
+ ctx2.emit("scroll", e);
22789
+ };
22790
+ const [onRawWheel, onFireFoxScroll] = useFrameWheel(isVirtual, isScrollAtTop, isScrollAtBottom, (offsetY) => {
22791
+ syncScrollTop((top) => {
22792
+ const newTop = top + offsetY;
22793
+ return newTop;
22794
+ });
22795
+ });
22796
+ useMobileTouchMove(isVirtual, componentRef, (deltaY, smoothOffset) => {
22797
+ if (originScroll(deltaY, !!smoothOffset)) {
21659
22798
  return false;
21660
22799
  }
22800
+ onRawWheel({
22801
+ deltaY
22802
+ });
22803
+ return true;
21661
22804
  });
21662
- return () => {
21663
- var _a, _b, _c;
21664
- const checkboxProps2 = {
21665
- key: (_a = data.value) == null ? void 0 : _a.id,
21666
- disabled: (_b = data.value) == null ? void 0 : _b.disableCheck,
21667
- halfchecked: halfChecked.value,
21668
- modelValue: (_c = data.value) == null ? void 0 : _c.checked,
21669
- "onUpdate:modelValue": () => {
21670
- toggleCheckNode(data.value);
21671
- },
21672
- onClick: (event) => {
21673
- event.stopPropagation();
22805
+ const onMozMousePixelScroll = (e) => {
22806
+ if (isVirtual.value) {
22807
+ e.preventDefault();
22808
+ }
22809
+ };
22810
+ const removeEventListener = () => {
22811
+ if (componentRef.value) {
22812
+ componentRef.value.removeEventListener("wheel", onRawWheel, {
22813
+ passive: false
22814
+ });
22815
+ componentRef.value.removeEventListener("DOMMouseScroll", onFireFoxScroll);
22816
+ componentRef.value.removeEventListener("MozMousePixelScroll", onMozMousePixelScroll);
22817
+ }
22818
+ };
22819
+ watchEffect(() => {
22820
+ nextTick(() => {
22821
+ if (componentRef.value) {
22822
+ removeEventListener();
22823
+ componentRef.value.addEventListener("wheel", onRawWheel, {
22824
+ passive: false
22825
+ });
22826
+ componentRef.value.addEventListener("DOMMouseScroll", onFireFoxScroll);
22827
+ componentRef.value.addEventListener("MozMousePixelScroll", onMozMousePixelScroll);
21674
22828
  }
21675
- };
21676
- return createVNode("div", {
21677
- "class": nodeClass.value,
21678
- "style": nodeStyle.value
21679
- }, [createVNode("span", {
21680
- "class": nodeVLineClass.value,
21681
- "style": nodeVLineStyle.value
21682
- }, null), createVNode("div", {
21683
- "class": nodeContentClass.value,
21684
- "onClick": () => {
21685
- toggleSelectNode(data.value);
22829
+ });
22830
+ });
22831
+ onBeforeUnmount(() => {
22832
+ removeEventListener();
22833
+ });
22834
+ const componentStyle = computed(() => {
22835
+ let cs = null;
22836
+ if (props.height) {
22837
+ cs = __spreadValues({
22838
+ maxHeight: isVirtual.value ? props.height + "px" : void 0
22839
+ }, ScrollStyle);
22840
+ if (isVirtual.value) {
22841
+ cs.overflowY = "hidden";
22842
+ if (state.scrollMoving) {
22843
+ cs.pointerEvents = "none";
22844
+ }
21686
22845
  }
21687
- }, [createVNode("span", {
21688
- "class": nodeHLineClass.value
21689
- }, null), slots.icon ? renderSlot(useSlots(), "icon", {
21690
- nodeData: data,
21691
- toggleNode
21692
- }) : createVNode(DTreeNodeToggle, {
21693
- "data": data.value
21694
- }, null), createVNode("div", {
21695
- "class": ns2.em("node-content", "value-wrapper"),
22846
+ }
22847
+ return cs;
22848
+ });
22849
+ watch([() => calRes.start, () => calRes.end, mergedData], () => {
22850
+ const renderList = mergedData.value.slice(calRes.start, calRes.end + 1);
22851
+ ctx2.emit("show-change", renderList, mergedData.value);
22852
+ }, {
22853
+ flush: "post"
22854
+ });
22855
+ return () => {
22856
+ const Component = props.component;
22857
+ return createVNode("div", {
21696
22858
  "style": {
21697
- height: `${NODE_HEIGHT}px`
22859
+ position: "relative"
21698
22860
  }
21699
- }, [check.value && createVNode(Checkbox, checkboxProps2, null), slots.default ? renderSlot(useSlots(), "default", {
21700
- nodeData: data
21701
- }) : createVNode(DTreeNodeContent, {
21702
- "data": data
21703
- }, null)])])]);
22861
+ }, [createVNode(Component, {
22862
+ "style": componentStyle.value,
22863
+ "ref": componentRef,
22864
+ "onScroll": onComponentScroll
22865
+ }, {
22866
+ default: () => [createVNode(ResizeObserverContainer, {
22867
+ "height": calRes.scrollHeight,
22868
+ "offset": calRes.offset,
22869
+ "onInnerResize": collectHeight,
22870
+ "ref": fillerInnerRef
22871
+ }, {
22872
+ default: () => renderChildren(mergedData.value, calRes.start, calRes.end, setInstance, {
22873
+ getKey
22874
+ }, ctx2.slots.item)
22875
+ })]
22876
+ }), isVirtual.value && createVNode(ScrollBar, {
22877
+ "ref": barRef,
22878
+ "scrollTop": state.scrollTop,
22879
+ "height": props.height,
22880
+ "scrollHeight": calRes.scrollHeight,
22881
+ "count": mergedData.value.length,
22882
+ "onScroll": onScrollBar,
22883
+ "onStartMove": () => {
22884
+ state.scrollMoving = true;
22885
+ },
22886
+ "onStopMove": () => {
22887
+ state.scrollMoving = false;
22888
+ }
22889
+ }, null)]);
21704
22890
  };
21705
22891
  }
21706
22892
  });
@@ -21747,7 +22933,7 @@ function omit(obj, ...keys) {
21747
22933
  }
21748
22934
  function generateInnerTree(tree2, key = "children", level = 0, path = []) {
21749
22935
  level++;
21750
- return tree2.reduce((acc, item) => {
22936
+ return tree2.reduce((acc, item, currentIndex) => {
21751
22937
  var _a, _b;
21752
22938
  const newItem = Object.assign({}, item);
21753
22939
  if (newItem.id === void 0) {
@@ -21755,6 +22941,8 @@ function generateInnerTree(tree2, key = "children", level = 0, path = []) {
21755
22941
  newItem.idType = "random";
21756
22942
  }
21757
22943
  newItem.level = level;
22944
+ newItem.parentChildNode = tree2.length;
22945
+ newItem.currentIndex = currentIndex;
21758
22946
  if (path.length > 0 && ((_a = path[path.length - 1]) == null ? void 0 : _a.level) >= level) {
21759
22947
  while (((_b = path[path.length - 1]) == null ? void 0 : _b.level) >= level) {
21760
22948
  path.pop();
@@ -21777,11 +22965,21 @@ const DEFAULT_CONFIG = {
21777
22965
  recursive: true
21778
22966
  };
21779
22967
  function useCore() {
22968
+ const nodeMap = /* @__PURE__ */ new Map();
21780
22969
  return function useCore2(data) {
21781
22970
  const getLevel = (node) => {
21782
22971
  return data.value.find((item) => item.id === node.id).level;
21783
22972
  };
21784
22973
  const getChildren = (node, userConfig = DEFAULT_CONFIG) => {
22974
+ if (node.isLeaf) {
22975
+ return [];
22976
+ }
22977
+ if (node.id && nodeMap.has(node.id)) {
22978
+ const cacheNode = nodeMap.get(node.id);
22979
+ if (cacheNode) {
22980
+ return cacheNode;
22981
+ }
22982
+ }
21785
22983
  const getInnerExpendedTree = () => {
21786
22984
  return computed(() => {
21787
22985
  let excludeNodes = [];
@@ -21791,7 +22989,7 @@ function useCore() {
21791
22989
  if (excludeNodes.map((innerNode) => innerNode.id).includes(item.id)) {
21792
22990
  continue;
21793
22991
  }
21794
- if (item.expanded !== true) {
22992
+ if (item.expanded !== true && !item.isLeaf) {
21795
22993
  excludeNodes = getChildren(item);
21796
22994
  }
21797
22995
  result22.push(item);
@@ -21810,6 +23008,9 @@ function useCore() {
21810
23008
  result2.push(treeData.value[i]);
21811
23009
  }
21812
23010
  }
23011
+ if (node.id) {
23012
+ nodeMap.set(node.id, result2);
23013
+ }
21813
23014
  return result2;
21814
23015
  };
21815
23016
  const getParent = (node) => {
@@ -21839,11 +23040,16 @@ function useCore() {
21839
23040
  return data.value.find((item) => item.id === node.id);
21840
23041
  };
21841
23042
  const setNodeValue = (node, key, value) => {
23043
+ nodeMap.clear();
21842
23044
  data.value[getIndex(node)][key] = value;
21843
23045
  };
21844
23046
  const setTree = (newTree) => {
23047
+ nodeMap.clear();
21845
23048
  data.value = generateInnerTree(newTree);
21846
23049
  };
23050
+ onUnmounted(() => {
23051
+ nodeMap.clear();
23052
+ });
21847
23053
  return {
21848
23054
  getLevel,
21849
23055
  getChildren,
@@ -22040,6 +23246,9 @@ const treeProps = {
22040
23246
  check: {
22041
23247
  type: [Boolean, String],
22042
23248
  default: false
23249
+ },
23250
+ height: {
23251
+ type: [Number, String]
22043
23252
  }
22044
23253
  };
22045
23254
  var tree = "";
@@ -22076,28 +23285,43 @@ var Tree = defineComponent({
22076
23285
  expose({
22077
23286
  treeFactory
22078
23287
  });
23288
+ const renderDTreeNode = (treeNode) => slots.default ? renderSlot(useSlots(), "default", {
23289
+ treeFactory,
23290
+ nodeData: treeNode
23291
+ }) : createVNode(DTreeNode, {
23292
+ "data": treeNode,
23293
+ "check": check.value
23294
+ }, {
23295
+ default: () => slots.content ? renderSlot(useSlots(), "content", {
23296
+ nodeData: treeNode
23297
+ }) : createVNode(DTreeNodeContent, {
23298
+ "data": treeNode
23299
+ }, null),
23300
+ icon: () => slots.icon ? renderSlot(useSlots(), "icon", {
23301
+ nodeData: treeNode,
23302
+ toggleNode
23303
+ }) : createVNode(DTreeNodeToggle, {
23304
+ "data": treeNode
23305
+ }, null)
23306
+ });
22079
23307
  return () => {
22080
- return createVNode("div", {
23308
+ const Component = props.height ? VirtualList : "div";
23309
+ const treeData = getExpendedTree == null ? void 0 : getExpendedTree().value;
23310
+ const vSlotsProps = {
23311
+ default: props.height || (() => treeData == null ? void 0 : treeData.map(renderDTreeNode)),
23312
+ item: props.height && ((treeNode) => renderDTreeNode(treeNode))
23313
+ };
23314
+ let virtualListProps2 = {};
23315
+ if (props.height) {
23316
+ virtualListProps2 = {
23317
+ height: props.height,
23318
+ data: treeData,
23319
+ itemHeight: NODE_HEIGHT
23320
+ };
23321
+ }
23322
+ return createVNode(Component, mergeProps({
22081
23323
  "class": ns2.b()
22082
- }, [getExpendedTree == null ? void 0 : getExpendedTree().value.map((treeNode) => slots.default ? renderSlot(useSlots(), "default", {
22083
- treeFactory,
22084
- nodeData: treeNode
22085
- }) : createVNode(DTreeNode, {
22086
- "data": treeNode,
22087
- "check": check.value
22088
- }, {
22089
- default: () => slots.content ? renderSlot(useSlots(), "content", {
22090
- nodeData: treeNode
22091
- }) : createVNode(DTreeNodeContent, {
22092
- "data": treeNode
22093
- }, null),
22094
- icon: () => slots.icon ? renderSlot(useSlots(), "icon", {
22095
- nodeData: treeNode,
22096
- toggleNode
22097
- }) : createVNode(DTreeNodeToggle, {
22098
- "data": treeNode
22099
- }, null)
22100
- }))]);
23324
+ }, virtualListProps2), vSlotsProps);
22101
23325
  };
22102
23326
  }
22103
23327
  });
@@ -22176,17 +23400,29 @@ const uploadProps = {
22176
23400
  type: Function,
22177
23401
  default: void 0
22178
23402
  },
22179
- "on-error": {
23403
+ onError: {
23404
+ type: Function,
23405
+ default: void 0
23406
+ },
23407
+ onSuccess: {
22180
23408
  type: Function,
22181
23409
  default: void 0
22182
23410
  },
22183
- "on-success": {
23411
+ onExceed: {
22184
23412
  type: Function,
22185
23413
  default: void 0
22186
23414
  },
22187
23415
  oneTimeUpload: {
22188
23416
  type: Boolean,
22189
23417
  default: false
23418
+ },
23419
+ limit: {
23420
+ type: Number,
23421
+ default: 0
23422
+ },
23423
+ httpRequest: {
23424
+ type: Function,
23425
+ default: void 0
22190
23426
  }
22191
23427
  };
22192
23428
  const getAllFilesBeyondMaximalFileSizeMsg = (maximalSize) => `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
@@ -22502,7 +23738,9 @@ var Upload = defineComponent({
22502
23738
  modelValue,
22503
23739
  multiple,
22504
23740
  accept,
22505
- webkitdirectory
23741
+ webkitdirectory,
23742
+ limit,
23743
+ httpRequest
22506
23744
  } = toRefs(props);
22507
23745
  const ns2 = useNamespace("upload");
22508
23746
  const inputGroupNs = useNamespace("input-group");
@@ -22525,7 +23763,7 @@ var Upload = defineComponent({
22525
23763
  _oneTimeUpload,
22526
23764
  getSameNameFiles
22527
23765
  } = useUpload();
22528
- const isDropOVer = ref(false);
23766
+ const isDropOver = ref(false);
22529
23767
  const alertMsg = (errorMsg) => {
22530
23768
  NotificationService.open({
22531
23769
  type: "warning",
@@ -22553,7 +23791,7 @@ var Upload = defineComponent({
22553
23791
  }
22554
23792
  };
22555
23793
  const onFileOver = (event) => {
22556
- isDropOVer.value = event;
23794
+ isDropOver.value = event;
22557
23795
  ctx2.emit("fileOver", event);
22558
23796
  };
22559
23797
  const deleteUploadedFile = (file) => {
@@ -22564,7 +23802,7 @@ var Upload = defineComponent({
22564
23802
  ctx2.emit("update:modelValue", newUploadedFiles);
22565
23803
  };
22566
23804
  const onDeleteFile = (event, file, status2) => {
22567
- event.stopPropagation();
23805
+ event == null ? void 0 : event.stopPropagation();
22568
23806
  if (status2 === UploadStatus.uploaded) {
22569
23807
  deleteUploadedFile(file);
22570
23808
  }
@@ -22593,20 +23831,32 @@ var Upload = defineComponent({
22593
23831
  removeFiles();
22594
23832
  return;
22595
23833
  }
23834
+ if (typeof (httpRequest == null ? void 0 : httpRequest.value) === "function") {
23835
+ const files = fileUploaders.value.map((tempFileUploader) => tempFileUploader.file);
23836
+ httpRequest.value(files);
23837
+ return;
23838
+ }
22596
23839
  const uploadObservable = oneTimeUpload.value ? _oneTimeUpload() : upload2(fileUploader);
22597
23840
  uploadObservable == null ? void 0 : uploadObservable.then((results2) => {
22598
- props["on-success"] && props["on-success"](results2);
23841
+ props.onSuccess && props.onSuccess(results2);
22599
23842
  const newFiles = results2.map((result2) => result2.file);
22600
23843
  const newUploadedFiles = [...newFiles, ...modelValue.value];
22601
23844
  ctx2.emit("update:modelValue", newUploadedFiles);
23845
+ props.onChange && props.onChange(newFiles, newUploadedFiles);
22602
23846
  }).catch((error) => {
22603
- props["on-error"] && props["on-error"](error);
23847
+ props.onError && props.onError(error);
23848
+ props.onChange && props.onChange([error.file], modelValue.value);
22604
23849
  });
22605
23850
  });
22606
23851
  };
22607
23852
  const _dealFiles = (promise) => {
22608
23853
  resetSameNameFiles();
22609
23854
  promise.then((files) => {
23855
+ if (limit.value && modelValue.value.length + files.length > limit.value) {
23856
+ props.onExceed && props.onExceed(files, modelValue.value);
23857
+ return;
23858
+ }
23859
+ props.onChange && props.onChange(files, modelValue.value);
22610
23860
  files.forEach((file) => {
22611
23861
  if (!multiple.value) {
22612
23862
  removeFiles();
@@ -22638,15 +23888,27 @@ var Upload = defineComponent({
22638
23888
  }));
22639
23889
  };
22640
23890
  const onFileDrop = (files) => {
22641
- isDropOVer.value = false;
23891
+ isDropOver.value = false;
22642
23892
  _dealFiles(triggerDropFiles(files));
22643
23893
  ctx2.emit("fileDrop", files);
22644
23894
  };
23895
+ const submit = (event, fileUploader) => {
23896
+ fileUpload(event, fileUploader);
23897
+ };
23898
+ const clearFiles = (event) => {
23899
+ fileUploaders.value.forEach((fileUploader) => {
23900
+ onDeleteFile(event, fileUploader.file, fileUploader.status);
23901
+ });
23902
+ };
23903
+ ctx2.expose({
23904
+ submit,
23905
+ clearFiles
23906
+ });
22645
23907
  return () => {
22646
23908
  var _a, _b, _c, _d;
22647
23909
  return createVNode("div", null, [withDirectives(createVNode("div", {
22648
23910
  "class": ns2.b(),
22649
- "style": `border: ${isDropOVer.value ? "1px solid #15bf15" : "0"}`
23911
+ "style": `border: ${isDropOver.value ? "1px solid #15bf15" : "0"}`
22650
23912
  }, [((_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a)) ? createVNode("div", {
22651
23913
  "onClick": handleClick
22652
23914
  }, [ctx2.slots.default()]) : createVNode("div", {
@@ -22820,6 +24082,7 @@ const installs = [
22820
24082
  TabsInstall,
22821
24083
  TagInstall,
22822
24084
  TextareaInstall,
24085
+ TimeSelectInstall,
22823
24086
  TimelineInstall,
22824
24087
  TooltipInstall,
22825
24088
  TreeInstall,
@@ -22831,4 +24094,4 @@ var vueDevui = {
22831
24094
  installs.forEach((p) => app.use(p));
22832
24095
  }
22833
24096
  };
22834
- export { Alert, Aside, AutoComplete, Avatar, Badge, Button, ButtonGroup, Card, Checkbox, CheckboxButton, CheckboxGroup, Col, Collapse, CollapseItem, Column, Content, Countdown, DatePicker, Drawer, DrawerService, Dropdown, DropdownMenu, EditableSelect, FixedOverlay, FlexibleOverlay, Footer$1 as Footer, Form, FormItem, FormOperation, Fullscreen, Header$1 as Header, DIcon as Icon, IconGroup, ImagePreviewDirective, ImagePreviewService, DInput as Input, InputNumber, Layout, loadingDirective as Loading, loading as LoadingService, Modal, Notification, NotificationService, Option, Pagination, Panel, PanelBody, PanelFooter, PanelHeader, Popover, Progress, Radio, RadioButton, RadioGroup, Rate, Result, RippleDirective, Row, Search, Select, Skeleton, SkeletonItem, Slider, Splitter, Statistic, Status, StickSlider, Switch, Tab, Table, Tabs, Tag, Textarea, Timeline, TimelineItem, Tooltip, Tree, Upload, vueDevui as default };
24097
+ export { Alert, Aside, AutoComplete, Avatar, Badge, Button, ButtonGroup, Card, Checkbox, CheckboxButton, CheckboxGroup, Col, Collapse, CollapseItem, Column, Content, Countdown, DatePicker, Drawer, DrawerService, Dropdown, DropdownMenu, EditableSelect, FixedOverlay, FlexibleOverlay, Footer$1 as Footer, Form, FormItem, FormOperation, Fullscreen, Header$1 as Header, DIcon as Icon, IconGroup, ImagePreviewDirective, ImagePreviewService, DInput as Input, InputNumber, Layout, loadingDirective as Loading, loading as LoadingService, Modal, Notification, NotificationService, Option, Pagination, Panel, PanelBody, PanelFooter, PanelHeader, Popover, Progress, Radio, RadioButton, RadioGroup, Rate, Result, RippleDirective, Row, Search, Select, Skeleton, SkeletonItem, Slider, Splitter, Statistic, Status, StickSlider, Switch, Tab, Table, Tabs, Tag, Textarea, TimeSelect, Timeline, TimelineItem, Tooltip, Tree, Upload, vueDevui as default };