vue-devui 1.0.0-beta.6 → 1.0.0-beta.7

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 (58) hide show
  1. package/back-top/index.es.js +61 -5
  2. package/back-top/index.umd.js +1 -1
  3. package/back-top/style.css +1 -1
  4. package/button/index.es.js +3 -3
  5. package/button/index.umd.js +1 -1
  6. package/carousel/index.es.js +3 -3
  7. package/carousel/index.umd.js +1 -1
  8. package/comment/index.d.ts +7 -0
  9. package/comment/index.es.js +57 -0
  10. package/comment/index.umd.js +1 -0
  11. package/comment/package.json +7 -0
  12. package/comment/style.css +1 -0
  13. package/date-picker/index.es.js +14 -14
  14. package/date-picker/index.umd.js +1 -1
  15. package/editable-select/index.es.js +3 -3
  16. package/editable-select/index.umd.js +9 -9
  17. package/form/index.es.js +22 -7
  18. package/form/index.umd.js +1 -1
  19. package/icon/index.es.js +3 -3
  20. package/icon/index.umd.js +1 -1
  21. package/input/index.es.js +11 -11
  22. package/input/index.umd.js +1 -1
  23. package/input-icon/index.d.ts +7 -0
  24. package/input-icon/index.es.js +331 -0
  25. package/input-icon/index.umd.js +1 -0
  26. package/input-icon/package.json +7 -0
  27. package/input-icon/style.css +1 -0
  28. package/input-number/index.es.js +3 -3
  29. package/input-number/index.umd.js +1 -1
  30. package/modal/index.es.js +3 -3
  31. package/modal/index.umd.js +1 -1
  32. package/package.json +2 -32
  33. package/search/index.es.js +11 -11
  34. package/search/index.umd.js +1 -1
  35. package/select/index.es.js +3 -3
  36. package/select/index.umd.js +1 -1
  37. package/steps-guide/index.es.js +97 -74
  38. package/steps-guide/index.umd.js +1 -1
  39. package/style.css +1 -1
  40. package/table/index.es.js +1490 -157
  41. package/table/index.umd.js +1 -1
  42. package/table/style.css +1 -1
  43. package/tag/index.es.js +65 -9
  44. package/tag/index.umd.js +1 -1
  45. package/tag/style.css +1 -1
  46. package/time-axis/index.es.js +3 -3
  47. package/time-axis/index.umd.js +1 -1
  48. package/time-picker/index.es.js +3 -3
  49. package/time-picker/index.umd.js +1 -1
  50. package/toast/index.es.js +3 -3
  51. package/toast/index.umd.js +1 -1
  52. package/transfer/index.es.js +299 -60
  53. package/transfer/index.umd.js +1 -1
  54. package/transfer/style.css +1 -1
  55. package/upload/index.es.js +4 -4
  56. package/upload/index.umd.js +1 -1
  57. package/vue-devui.es.js +1153 -324
  58. package/vue-devui.umd.js +17 -17
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 { defineComponent as defineComponent$1, toRefs, computed, createVNode, Fragment, mergeProps, resolveComponent, onMounted, watch, ref, Transition, withDirectives, vShow, createTextVNode, inject, getCurrentInstance, onBeforeUnmount, provide, Comment, reactive, toRef, resolveDirective, onUnmounted, Teleport, renderSlot, isVNode, isRef as isRef$1, useSlots, createApp, h, render, readonly, nextTick as nextTick$1, onUpdated, onBeforeMount, unref as unref$1 } from "vue";
36
+ import { defineComponent as defineComponent$1, toRefs, computed, createVNode, Fragment, mergeProps, resolveComponent, onMounted, watch, ref, Transition, withDirectives, vShow, createTextVNode, inject, getCurrentInstance, onBeforeUnmount, provide, Comment as Comment$1, reactive, toRef, resolveDirective, onUnmounted, Teleport, renderSlot, isVNode, isRef as isRef$1, useSlots, createApp, h, render, readonly, nextTick as nextTick$1, onUpdated, shallowRef, onBeforeMount, unref as unref$1 } from "vue";
37
37
  const accordionProps = {
38
38
  data: {
39
39
  type: Array,
@@ -995,16 +995,64 @@ const backTopProps = {
995
995
  right: {
996
996
  type: String,
997
997
  default: "30px"
998
+ },
999
+ target: {
1000
+ type: String,
1001
+ default: "window"
1002
+ },
1003
+ visibleHeight: {
1004
+ type: Number,
1005
+ default: 300
998
1006
  }
999
1007
  };
1000
1008
  function usePosition(props) {
1001
1009
  const { bottom, right } = props;
1002
1010
  return {
1003
- position: "fixed",
1004
1011
  bottom,
1005
1012
  right
1006
1013
  };
1007
1014
  }
1015
+ function useTarget(props, backTopRef) {
1016
+ const target = props.target;
1017
+ const getTargetEl = () => {
1018
+ const targetEl = document.querySelector(target);
1019
+ if (!targetEl)
1020
+ throw new Error(`props ${target} is not existed`);
1021
+ targetEl.parentElement.style.position = "relative";
1022
+ backTopRef.value.style.position = "absolute";
1023
+ return targetEl;
1024
+ };
1025
+ const currTarget = target === "window" ? window || document.documentElement || document.body : getTargetEl();
1026
+ return currTarget;
1027
+ }
1028
+ function useVisibility(props, backTopRef) {
1029
+ const visibleHeight = props.visibleHeight;
1030
+ const currScrollTop = ref(0);
1031
+ const ThrottleCBFn = function() {
1032
+ currScrollTop.value = currTarget === window ? window.pageYOffset : currTarget.scrollTop;
1033
+ };
1034
+ let currTarget = null;
1035
+ onMounted(() => {
1036
+ currTarget = useTarget(props, backTopRef);
1037
+ useEventListener(currTarget, "scroll", useThrottle(ThrottleCBFn, 150));
1038
+ });
1039
+ const isVisible = computed(() => currScrollTop.value >= visibleHeight);
1040
+ return isVisible;
1041
+ }
1042
+ function useEventListener(target, event, cb) {
1043
+ if (target)
1044
+ target.addEventListener(event, cb);
1045
+ }
1046
+ function useThrottle(fn, delay) {
1047
+ let last2 = null;
1048
+ return (...args) => {
1049
+ const now2 = +Date.now();
1050
+ if (now2 - last2 > delay) {
1051
+ last2 = now2;
1052
+ return fn.apply(this, args);
1053
+ }
1054
+ };
1055
+ }
1008
1056
  var backTop = "";
1009
1057
  var IconTop = "data:image/svg+xml;base64,PHN2ZyB0PSIxNjM2MjU2NTI0MjUxIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjM0NTciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTAgMGgxMDI0djEwMjRIMHoiIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMCIgcC1pZD0iMzQ1OCI+PC9wYXRoPjxwYXRoIGQ9Ik04NzguOTMzMzMzIDY1OC40MTA2NjdhNDEuNjg1MzMzIDQxLjY4NTMzMyAwIDAgMS01OC45NDQgMC4zMmwtMzA3Ljk2OC0zMDQuNjRMMjA0LjAxMDY2NyA2NTguNzczMzMzYTQxLjY4NTMzMyA0MS42ODUzMzMgMCAwIDEtNTguNTYgMC4wNjQgNDAuNjE4NjY3IDQwLjYxODY2NyAwIDAgMS0wLjA2NC01Ny44MTMzMzNsMzM1LjQyNC0zMzEuNzMzMzMzYTQxLjU3ODY2NyA0MS41Nzg2NjcgMCAwIDEgMzEuMDQtMTIuMDEwNjY3IDQxLjQ5MzMzMyA0MS40OTMzMzMgMCAwIDEgMzEuMzYgMTEuOTg5MzMzbDMzNS40MDI2NjYgMzMxLjczMzMzNGMxNS45MzYgMTUuNzg2NjY3IDE2LjA4NTMzMyA0MS40OTMzMzMgMC4zMiA1Ny40MjkzMzN6IiBmaWxsPSIjZmZmZmZmIiBwLWlkPSIzNDU5Ij48L3BhdGg+PHBhdGggZD0iTTU1NC42NjY2NjcgMzYyLjY2NjY2N3Y1MzMuMzMzMzMzYTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAxIDEtODUuMzMzMzM0IDBWMzYyLjY2NjY2N2E0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDg1LjMzMzMzNCAwek0xMjggODUuMzMzMzMzaDc2OGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDAgODUuMzMzMzM0SDEyOGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDAtODUuMzMzMzM0eiIgZmlsbD0iI2ZmZmZmZiIgcC1pZD0iMzQ2MCI+PC9wYXRoPjwvc3ZnPg==";
1010
1058
  var BackTop = defineComponent$1({
@@ -1012,8 +1060,10 @@ var BackTop = defineComponent$1({
1012
1060
  props: backTopProps,
1013
1061
  emits: [],
1014
1062
  setup(props, ctx2) {
1015
- const position = usePosition(props);
1016
1063
  const slots = ctx2.slots;
1064
+ const backTopRef = ref(null);
1065
+ const position = usePosition(props);
1066
+ let isVisible = useVisibility(props, backTopRef);
1017
1067
  const scrollToTop = () => {
1018
1068
  window && window.scrollTo({
1019
1069
  top: 0,
@@ -1023,7 +1073,10 @@ var BackTop = defineComponent$1({
1023
1073
  };
1024
1074
  return () => createVNode("div", {
1025
1075
  "class": "devui-back-top",
1026
- "style": __spreadValues({}, position),
1076
+ "ref": backTopRef,
1077
+ "style": __spreadProps(__spreadValues({}, position), {
1078
+ display: isVisible.value ? "block" : "none"
1079
+ }),
1027
1080
  "onClick": scrollToTop
1028
1081
  }, [createVNode("div", {
1029
1082
  "class": ["devui-back-top-base", slots.default ? "devui-backtop-custom" : "devui-back-top-content"]
@@ -1036,7 +1089,7 @@ BackTop.install = function(app) {
1036
1089
  var BackTopInstall = {
1037
1090
  title: "BackTop \u56DE\u5230\u9876\u90E8",
1038
1091
  category: "\u5BFC\u822A",
1039
- status: "10%",
1092
+ status: "60%",
1040
1093
  install(app) {
1041
1094
  app.use(BackTop);
1042
1095
  }
@@ -1289,7 +1342,7 @@ var Icon = defineComponent$1({
1289
1342
  color,
1290
1343
  classPrefix
1291
1344
  } = this;
1292
- return createVNode(Fragment, null, [/^((https?):)?\/\//.test(name) ? createVNode("img", {
1345
+ return /^((https?):)?\/\//.test(name) ? createVNode("img", {
1293
1346
  "src": name,
1294
1347
  "alt": name.split("/")[name.split("/").length - 1],
1295
1348
  "style": {
@@ -1301,7 +1354,7 @@ var Icon = defineComponent$1({
1301
1354
  fontSize: size,
1302
1355
  color
1303
1356
  }
1304
- }, null)]);
1357
+ }, null);
1305
1358
  }
1306
1359
  });
1307
1360
  Icon.install = function(app) {
@@ -1689,7 +1742,7 @@ var Carousel = defineComponent$1({
1689
1742
  const slot = (_b = (_a = $slots.default) == null ? void 0 : _a.call($slots)) != null ? _b : [];
1690
1743
  let children = slot;
1691
1744
  if (children.length === 1 && children[0].type === Fragment) {
1692
- children = (children[0].children || []).filter((item2) => (item2 == null ? void 0 : item2.type) !== Comment);
1745
+ children = (children[0].children || []).filter((item2) => (item2 == null ? void 0 : item2.type) !== Comment$1);
1693
1746
  }
1694
1747
  if (children.length !== itemCount) {
1695
1748
  changeItemCount(children.length);
@@ -4229,6 +4282,61 @@ var CheckboxInstall = {
4229
4282
  app.use(DCheckboxGroup);
4230
4283
  }
4231
4284
  };
4285
+ const commentProps = {
4286
+ actions: {},
4287
+ author: {},
4288
+ avatar: {},
4289
+ content: {},
4290
+ prefixCls: {},
4291
+ datetime: {}
4292
+ };
4293
+ var comment = "";
4294
+ var Comment = defineComponent$1({
4295
+ name: "DComment",
4296
+ props: commentProps,
4297
+ emits: [],
4298
+ slots: ["actions", "author", "avatar", "content", "datetime"],
4299
+ setup(props, {
4300
+ slots
4301
+ }) {
4302
+ return () => {
4303
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
4304
+ const actions = (_b = props.actions) != null ? _b : (_a = slots.actions) == null ? void 0 : _a.call(slots);
4305
+ const author = (_d = props.author) != null ? _d : (_c = slots.author) == null ? void 0 : _c.call(slots);
4306
+ const avatar2 = (_f = props.avatar) != null ? _f : (_e = slots.avatar) == null ? void 0 : _e.call(slots);
4307
+ const content2 = (_h = props.content) != null ? _h : (_g = slots.content) == null ? void 0 : _g.call(slots);
4308
+ const datetime = (_j = props.datetime) != null ? _j : (_i = slots.datetime) == null ? void 0 : _i.call(slots);
4309
+ return createVNode("div", {
4310
+ "class": "devui-comment"
4311
+ }, [createVNode("div", {
4312
+ "class": "devui-comment-avatar"
4313
+ }, [avatar2]), createVNode("div", {
4314
+ "class": "devui-comment-right"
4315
+ }, [createVNode("div", {
4316
+ "class": "devui-comment-head"
4317
+ }, [createVNode("div", {
4318
+ "class": "devui-comment-author"
4319
+ }, [author]), createVNode("div", {
4320
+ "class": "devui-comment-datetime"
4321
+ }, [datetime])]), createVNode("div", {
4322
+ "class": "devui-comment-content"
4323
+ }, [content2]), createVNode("div", {
4324
+ "class": "devui-comment-actions"
4325
+ }, [actions])])]);
4326
+ };
4327
+ }
4328
+ });
4329
+ Comment.install = function(app) {
4330
+ app.component(Comment.name, Comment);
4331
+ };
4332
+ var CommentInstall = {
4333
+ title: "Comment \u8BC4\u8BBA",
4334
+ category: "\u6570\u636E\u5C55\u793A",
4335
+ status: "50%",
4336
+ install(app) {
4337
+ app.use(Comment);
4338
+ }
4339
+ };
4232
4340
  const getDateTime = (d) => {
4233
4341
  const year = d.getFullYear();
4234
4342
  const month = d.getMonth() + 1;
@@ -4463,27 +4571,27 @@ const inputProps = {
4463
4571
  type: Boolean,
4464
4572
  default: false
4465
4573
  },
4466
- value: {
4574
+ modelValue: {
4467
4575
  type: String,
4468
4576
  default: ""
4469
4577
  },
4470
- "onUpdate:value": {
4578
+ "update:modelValue": {
4471
4579
  type: Function,
4472
4580
  default: void 0
4473
4581
  },
4474
- "onChange": {
4582
+ onChange: {
4475
4583
  type: Function,
4476
4584
  default: void 0
4477
4585
  },
4478
- "onKeydown": {
4586
+ onKeydown: {
4479
4587
  type: Function,
4480
4588
  default: void 0
4481
4589
  },
4482
- "onFocus": {
4590
+ onFocus: {
4483
4591
  type: Function,
4484
4592
  default: void 0
4485
4593
  },
4486
- "onBlur": {
4594
+ onBlur: {
4487
4595
  type: Function,
4488
4596
  default: void 0
4489
4597
  }
@@ -4517,6 +4625,10 @@ const formProps = {
4517
4625
  name: {
4518
4626
  type: String,
4519
4627
  default: ""
4628
+ },
4629
+ messageShowType: {
4630
+ type: String,
4631
+ default: "popover"
4520
4632
  }
4521
4633
  };
4522
4634
  const formItemProps = {
@@ -4576,7 +4688,7 @@ var DInput = defineComponent$1({
4576
4688
  }
4577
4689
  },
4578
4690
  props: inputProps,
4579
- emits: ["update:value", "focus", "blur", "change", "keydown"],
4691
+ emits: ["update:modelValue", "focus", "blur", "change", "keydown"],
4580
4692
  setup(props, ctx2) {
4581
4693
  const formItem2 = inject(formItemInjectionKey, {});
4582
4694
  const hasFormItem = Object.keys(formItem2).length > 0;
@@ -4596,11 +4708,11 @@ var DInput = defineComponent$1({
4596
4708
  }, {
4597
4709
  immediate: true
4598
4710
  });
4599
- watch(() => props.value, (value) => {
4711
+ watch(() => props.modelValue, (value) => {
4600
4712
  value && value.length > 0 && showPreviewIcon.value ? showPwdIcon.value = true : showPwdIcon.value = false;
4601
4713
  });
4602
4714
  const onInput = ($event) => {
4603
- ctx2.emit("update:value", $event.target.value);
4715
+ ctx2.emit("update:modelValue", $event.target.value);
4604
4716
  hasFormItem && formItem2.formItemMitt.emit(dFormItemEvents.input);
4605
4717
  }, onFocus = () => {
4606
4718
  ctx2.emit("focus");
@@ -4630,7 +4742,7 @@ var DInput = defineComponent$1({
4630
4742
  },
4631
4743
  render() {
4632
4744
  const {
4633
- value,
4745
+ modelValue,
4634
4746
  showPreviewIcon,
4635
4747
  showPwdIcon,
4636
4748
  inputCls,
@@ -4651,7 +4763,7 @@ var DInput = defineComponent$1({
4651
4763
  }, [withDirectives(createVNode("input", mergeProps({
4652
4764
  dinput: true
4653
4765
  }, {
4654
- "value": value,
4766
+ "value": modelValue,
4655
4767
  "disabled": disabled,
4656
4768
  "type": inputType,
4657
4769
  "maxlength": maxLength,
@@ -9895,7 +10007,7 @@ var lodash = { exports: {} };
9895
10007
  }
9896
10008
  return func(collection, getIteratee(predicate, 3));
9897
10009
  }
9898
- function filter(collection, predicate) {
10010
+ function filter2(collection, predicate) {
9899
10011
  var func = isArray2(collection) ? arrayFilter2 : baseFilter;
9900
10012
  return func(collection, getIteratee(predicate, 3));
9901
10013
  }
@@ -11295,7 +11407,7 @@ var lodash = { exports: {} };
11295
11407
  lodash2.dropRightWhile = dropRightWhile;
11296
11408
  lodash2.dropWhile = dropWhile;
11297
11409
  lodash2.fill = fill;
11298
- lodash2.filter = filter;
11410
+ lodash2.filter = filter2;
11299
11411
  lodash2.flatMap = flatMap;
11300
11412
  lodash2.flatMapDeep = flatMapDeep;
11301
11413
  lodash2.flatMapDepth = flatMapDepth;
@@ -11974,7 +12086,8 @@ var Form = defineComponent$1({
11974
12086
  labelAlign: props.labelAlign
11975
12087
  },
11976
12088
  rules: props.rules,
11977
- columnsClass: props.columnsClass
12089
+ columnsClass: props.columnsClass,
12090
+ messageShowType: "popover"
11978
12091
  });
11979
12092
  const onSubmit = (e) => {
11980
12093
  e.preventDefault();
@@ -13343,9 +13456,9 @@ var FormControl = defineComponent$1({
13343
13456
  "class": `devui-form-control-container${isHorizontal ? " devui-form-control-container-horizontal" : ""}${feedbackStatus ? " has-feedback" : ""}${feedbackStatus === "error" ? " feedback-error" : ""}`
13344
13457
  }, [createVNode("div", {
13345
13458
  "class": "devui-control-content-wrapper"
13346
- }, [(_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a), createVNode("div", {
13459
+ }, [(_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a), showPopover.value && createVNode("div", {
13347
13460
  "class": "devui-popover-wrapper"
13348
- }, [showPopover.value && createVNode(Popover, {
13461
+ }, [createVNode(Popover, {
13349
13462
  "visible": true,
13350
13463
  "content": tipMessage.value,
13351
13464
  "popType": "error",
@@ -13544,6 +13657,11 @@ function handleValidatePass(el, tipEl) {
13544
13657
  tipEl.style.display = "none";
13545
13658
  handleErrorStrategyPass(el);
13546
13659
  }
13660
+ function getRefName(binding) {
13661
+ const _refs = binding.instance.$refs;
13662
+ const refName = Object.keys(_refs)[0];
13663
+ return refName;
13664
+ }
13547
13665
  function getFormName(binding) {
13548
13666
  const _refs = binding.instance.$refs;
13549
13667
  const key = Object.keys(_refs)[0];
@@ -13573,15 +13691,20 @@ function checkValidPopsition(positionStr) {
13573
13691
  }
13574
13692
  var dValidateRules = {
13575
13693
  mounted(el, binding, vnode) {
13694
+ var _a;
13576
13695
  const isFormTag = el.tagName === "FORM";
13577
13696
  const dfcUID = el.parentNode.parentNode.parentElement.dataset.uid;
13697
+ const refName = getRefName(binding);
13578
13698
  const hasOptions = isObject$1(binding.value) && hasKey(binding.value, "options");
13579
- const {
13699
+ let {
13580
13700
  rules: bindingRules,
13581
13701
  options = {},
13582
13702
  messageShowType = MessageShowTypeEnum.popover
13583
13703
  } = binding.value;
13584
13704
  let { errorStrategy } = binding.value;
13705
+ if (refName) {
13706
+ messageShowType = (_a = binding.instance[refName]["messageShowType"]) != null ? _a : "popover";
13707
+ }
13585
13708
  let {
13586
13709
  updateOn = UpdateOnEnum.change,
13587
13710
  errorStrategy: ErrorStrategy = ErrorStrategyEnum.dirty,
@@ -15067,6 +15190,82 @@ var ImagePreviewInstall = {
15067
15190
  app.config.globalProperties.$imagePreviewService = ImagePreviewService;
15068
15191
  }
15069
15192
  };
15193
+ var inputIcon = "";
15194
+ const inputIconProps = __spreadProps(__spreadValues({}, inputProps), {
15195
+ name: {
15196
+ type: String,
15197
+ value: "calendar",
15198
+ required: false
15199
+ },
15200
+ onIconclick: {
15201
+ type: Function,
15202
+ required: false
15203
+ },
15204
+ iconBgColor: {
15205
+ type: String,
15206
+ value: "transparent"
15207
+ },
15208
+ iconColor: {
15209
+ type: String,
15210
+ value: "#000000"
15211
+ }
15212
+ });
15213
+ var InputIcon = defineComponent$1({
15214
+ name: "DInputIcon",
15215
+ props: inputIconProps,
15216
+ setup(props, ctx2) {
15217
+ const _a = props, {
15218
+ name,
15219
+ onIconclick,
15220
+ onChange,
15221
+ iconBgColor,
15222
+ iconColor
15223
+ } = _a, inputProps2 = __objRest(_a, [
15224
+ "name",
15225
+ "onIconclick",
15226
+ "onChange",
15227
+ "iconBgColor",
15228
+ "iconColor"
15229
+ ]);
15230
+ const state = reactive({
15231
+ value: ""
15232
+ });
15233
+ const onInputChange = (v) => {
15234
+ state.value = v;
15235
+ typeof onChange === "function" && onChange(state.value);
15236
+ };
15237
+ const onIconClick = (e) => {
15238
+ typeof onIconclick === "function" && onIconclick(state.value, e);
15239
+ };
15240
+ return () => {
15241
+ return createVNode("div", {
15242
+ "class": "d-input-icon-container"
15243
+ }, [createVNode("label", null, [createVNode(DInput, mergeProps(inputProps2, {
15244
+ "onChange": onInputChange
15245
+ }), null)]), createVNode("span", {
15246
+ "onClick": onIconClick,
15247
+ "style": {
15248
+ backgroundColor: iconBgColor
15249
+ }
15250
+ }, [createVNode(Icon, {
15251
+ "size": "small",
15252
+ "name": name,
15253
+ "color": iconColor
15254
+ }, null)])]);
15255
+ };
15256
+ }
15257
+ });
15258
+ InputIcon.install = function(app) {
15259
+ app.component(InputIcon.name, InputIcon);
15260
+ };
15261
+ var InputIconInstall = {
15262
+ title: "InputIcon\u8F93\u5165\u6846",
15263
+ category: "\u6570\u636E\u5F55\u5165",
15264
+ status: "75%",
15265
+ install(app) {
15266
+ app.use(InputIcon);
15267
+ }
15268
+ };
15070
15269
  const inputNumberProps = {
15071
15270
  placeholder: {
15072
15271
  type: String,
@@ -20503,6 +20702,10 @@ var StatusInstall = {
20503
20702
  var stepsGuide = "";
20504
20703
  const stepsGuideProps = {
20505
20704
  steps: Array,
20705
+ stepIndex: {
20706
+ type: Number,
20707
+ default: void 0
20708
+ },
20506
20709
  showClose: {
20507
20710
  type: Boolean,
20508
20711
  default: true
@@ -20510,22 +20713,33 @@ const stepsGuideProps = {
20510
20713
  showDots: {
20511
20714
  type: Boolean,
20512
20715
  default: true
20716
+ },
20717
+ scrollToTargetSwitch: {
20718
+ type: Boolean,
20719
+ default: true
20720
+ },
20721
+ zIndex: {
20722
+ type: Number,
20723
+ default: 1100
20724
+ },
20725
+ stepChange: {
20726
+ type: Function,
20727
+ default() {
20728
+ return true;
20729
+ }
20513
20730
  }
20514
20731
  };
20515
- function useStepsGuideNav(steps, stepIndex) {
20516
- const currentStep = computed(() => {
20517
- const _step = steps[stepIndex.value];
20518
- _step.position = _step.position || "top";
20519
- return _step;
20520
- });
20732
+ function useStepsGuidePosition(props, currentStep) {
20521
20733
  const guideClassList = ["devui-steps-guide"];
20522
20734
  const stepsRef = ref(null);
20523
20735
  const guidePosition = reactive({
20524
20736
  left: "",
20525
20737
  top: "",
20526
- zIndex: 1100
20738
+ zIndex: props.zIndex
20527
20739
  });
20528
20740
  const updateGuidePosition = () => {
20741
+ if (!currentStep.value)
20742
+ return;
20529
20743
  const baseTop = window.pageYOffset - document.documentElement.clientTop;
20530
20744
  const baseLeft = window.pageXOffset - document.documentElement.clientLeft;
20531
20745
  const currentStepPosition = currentStep.value.position;
@@ -20571,96 +20785,97 @@ function useStepsGuideNav(steps, stepIndex) {
20571
20785
  }
20572
20786
  guidePosition.left = _left + "px";
20573
20787
  guidePosition.top = _top + "px";
20574
- nextTick$1(() => {
20575
- stepGuideElement.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
20576
- });
20788
+ if (props.scrollToTargetSwitch) {
20789
+ nextTick$1(() => {
20790
+ stepGuideElement.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
20791
+ });
20792
+ }
20577
20793
  };
20578
20794
  return {
20579
- currentStep,
20580
20795
  stepsRef,
20581
20796
  guidePosition,
20582
20797
  guideClassList,
20583
20798
  updateGuidePosition
20584
20799
  };
20585
20800
  }
20586
- function useStepsGuideCtrl(stepsCount, stepIndex, updateGuidePosition) {
20587
- const showSteps = ref(true);
20588
- const closeSteps = () => {
20589
- showSteps.value = false;
20801
+ function useStepsGuideCtrl(props, ctx2, updateGuidePosition, stepIndex) {
20802
+ const stepsCount = computed(() => props.steps.length);
20803
+ const closeGuide = () => {
20804
+ const _index = stepIndex.value;
20805
+ stepIndex.value = -1;
20806
+ nextTick$1(() => {
20807
+ ctx2.emit("guide-close", _index);
20808
+ });
20590
20809
  };
20591
20810
  const setCurrentIndex = (index2) => {
20592
- if (index2 > stepsCount.value || index2 < 0)
20593
- index2 = 0;
20594
- stepIndex.value = index2;
20595
- if (!showSteps.value) {
20596
- showSteps.value = true;
20597
- nextTick$1(() => {
20598
- updateGuidePosition();
20599
- });
20600
- } else {
20601
- updateGuidePosition();
20811
+ if (index2 !== -1 && props.stepChange()) {
20812
+ if (index2 > -1 && index2 < stepsCount.value) {
20813
+ stepIndex.value = index2;
20814
+ console.log(stepIndex.value, index2, stepsCount.value);
20815
+ nextTick$1(() => {
20816
+ console.log(stepIndex.value, index2, stepsCount.value);
20817
+ updateGuidePosition();
20818
+ });
20819
+ } else {
20820
+ console.error(`stepIndex is not within the value range`);
20821
+ }
20602
20822
  }
20823
+ if (index2 === -1)
20824
+ closeGuide();
20603
20825
  };
20604
20826
  return {
20605
- showSteps,
20606
- closeSteps,
20827
+ stepsCount,
20828
+ closeGuide,
20607
20829
  setCurrentIndex
20608
20830
  };
20609
20831
  }
20610
20832
  var StepsGuide = defineComponent$1({
20611
20833
  name: "DStepsGuide",
20612
20834
  props: stepsGuideProps,
20613
- emits: [],
20835
+ emits: ["guide-close", "update:stepIndex"],
20614
20836
  setup(props, ctx2) {
20615
- const stepsCount = computed(() => props.steps.length - 1);
20616
- const stepIndex = ref(0);
20837
+ var _a;
20838
+ const stepIndexData = ref((_a = props.stepIndex) != null ? _a : 0);
20839
+ const stepIndex = computed({
20840
+ set: (val) => {
20841
+ if (props.stepIndex != null) {
20842
+ ctx2.emit("update:stepIndex", val);
20843
+ }
20844
+ stepIndexData.value = val;
20845
+ },
20846
+ get: () => stepIndexData.value
20847
+ });
20848
+ const currentStep = computed(() => {
20849
+ const _step = props.steps[stepIndex.value];
20850
+ if (_step)
20851
+ _step.position = _step.position || "top";
20852
+ return _step;
20853
+ });
20617
20854
  const {
20618
- currentStep,
20619
20855
  stepsRef,
20620
20856
  guidePosition,
20621
20857
  guideClassList,
20622
20858
  updateGuidePosition
20623
- } = useStepsGuideNav(props.steps, stepIndex);
20859
+ } = useStepsGuidePosition(props, currentStep);
20624
20860
  const {
20625
- showSteps,
20626
- closeSteps,
20861
+ stepsCount,
20862
+ closeGuide,
20627
20863
  setCurrentIndex
20628
- } = useStepsGuideCtrl(stepsCount, stepIndex, updateGuidePosition);
20864
+ } = useStepsGuideCtrl(props, ctx2, updateGuidePosition, stepIndex);
20629
20865
  onMounted(() => {
20630
20866
  updateGuidePosition();
20631
20867
  });
20632
- return {
20633
- stepsCount,
20634
- stepIndex,
20635
- showSteps,
20636
- guidePosition,
20637
- guideClassList,
20638
- stepsRef,
20639
- currentStep,
20640
- setCurrentIndex,
20641
- closeSteps
20642
- };
20643
- },
20644
- render(props) {
20645
- const {
20646
- showSteps,
20647
- guidePosition,
20648
- guideClassList,
20649
- currentStep,
20650
- stepIndex,
20651
- stepsCount,
20652
- setCurrentIndex,
20653
- closeSteps,
20654
- showClose,
20655
- showDots
20656
- } = props;
20657
- return showSteps ? createVNode(Teleport, {
20868
+ ctx2.expose({
20869
+ closeGuide,
20870
+ setCurrentIndex
20871
+ });
20872
+ return () => stepIndex.value > -1 && stepsCount.value > 0 ? createVNode(Teleport, {
20658
20873
  "to": "body"
20659
20874
  }, {
20660
20875
  default: () => [createVNode("div", {
20661
20876
  "style": guidePosition,
20662
20877
  "class": guideClassList,
20663
- "ref": "stepsRef"
20878
+ "ref": stepsRef
20664
20879
  }, [createVNode("div", {
20665
20880
  "class": "devui-shining-dot"
20666
20881
  }, null), createVNode("div", {
@@ -20671,45 +20886,52 @@ var StepsGuide = defineComponent$1({
20671
20886
  "class": "devui-guide-container"
20672
20887
  }, [createVNode("p", {
20673
20888
  "class": "devui-title"
20674
- }, [currentStep.title]), showClose ? createVNode("div", {
20889
+ }, [currentStep.value.title]), props.showClose ? createVNode("div", {
20675
20890
  "class": "icon icon-close",
20676
- "onClick": closeSteps
20891
+ "onClick": closeGuide
20677
20892
  }, null) : null, createVNode("div", {
20678
20893
  "class": "devui-content"
20679
- }, [currentStep.content]), createVNode("div", {
20894
+ }, [currentStep.value.content]), createVNode("div", {
20680
20895
  "class": "devui-ctrl"
20681
- }, [showDots ? createVNode("div", {
20896
+ }, [props.showDots ? createVNode("div", {
20682
20897
  "class": "devui-dots"
20683
20898
  }, [props.steps.map((step, index2) => {
20684
20899
  return createVNode("em", {
20685
- "class": ["icon icon-dot-status", currentStep === step ? "devui-active" : ""],
20900
+ "class": ["icon icon-dot-status", currentStep.value === step ? "devui-active" : ""],
20686
20901
  "key": index2
20687
20902
  }, null);
20688
20903
  })]) : null, createVNode("div", {
20689
20904
  "class": "devui-guide-btn"
20690
- }, [stepIndex > 0 ? createVNode("div", {
20905
+ }, [stepIndex.value > 0 ? createVNode("div", {
20691
20906
  "class": "devui-prev-step",
20692
- "onClick": () => setCurrentIndex(--props.stepIndex)
20693
- }, ["\u4E0A\u4E00\u6B65"]) : null, stepIndex === stepsCount ? createVNode("div", {
20694
- "onClick": closeSteps
20907
+ "onClick": () => setCurrentIndex(stepIndex.value - 1)
20908
+ }, ["\u4E0A\u4E00\u6B65"]) : null, stepIndex.value === stepsCount.value - 1 ? createVNode("div", {
20909
+ "onClick": closeGuide
20695
20910
  }, ["\u6211\u77E5\u9053\u5566"]) : createVNode("div", {
20696
20911
  "class": "devui-next-step",
20697
20912
  "onClick": () => {
20698
- setCurrentIndex(++props.stepIndex);
20913
+ setCurrentIndex(stepIndex.value + 1);
20699
20914
  }
20700
20915
  }, ["\u6211\u77E5\u9053\u5566,\u7EE7\u7EED"])])])])])]
20701
20916
  }) : null;
20702
20917
  }
20703
20918
  });
20919
+ var StepsGuideDirective = {
20920
+ mounted(el, binding, vNode) {
20921
+ },
20922
+ updated(el, binding) {
20923
+ }
20924
+ };
20704
20925
  StepsGuide.install = function(app) {
20705
20926
  app.component(StepsGuide.name, StepsGuide);
20706
20927
  };
20707
20928
  var StepsGuideInstall = {
20708
20929
  title: "StepsGuide \u64CD\u4F5C\u6307\u5F15",
20709
20930
  category: "\u5BFC\u822A",
20710
- status: "50%",
20931
+ status: "80%",
20711
20932
  install(app) {
20712
20933
  app.use(StepsGuide);
20934
+ app.directive("StepsGuide", StepsGuideDirective);
20713
20935
  }
20714
20936
  };
20715
20937
  var Sticky = defineComponent$1({
@@ -21014,15 +21236,57 @@ const TableProps = {
21014
21236
  type: Boolean,
21015
21237
  default: false
21016
21238
  },
21017
- headerBg: {
21239
+ scrollable: {
21240
+ type: Boolean,
21241
+ default: false
21242
+ },
21243
+ maxWidth: {
21244
+ type: String
21245
+ },
21246
+ maxHeight: {
21247
+ type: String
21248
+ },
21249
+ tableWidth: {
21250
+ type: String
21251
+ },
21252
+ tableHeight: {
21253
+ type: String
21254
+ },
21255
+ size: {
21256
+ type: String,
21257
+ validator(value) {
21258
+ return value === "sm" || value === "md" || value === "lg";
21259
+ }
21260
+ },
21261
+ rowHoveredHighlight: {
21262
+ type: Boolean,
21263
+ default: true
21264
+ },
21265
+ fixHeader: {
21018
21266
  type: Boolean,
21019
21267
  default: false
21020
21268
  },
21269
+ checkable: {
21270
+ type: Boolean,
21271
+ default: true
21272
+ },
21021
21273
  tableLayout: {
21022
21274
  type: String,
21023
- default: "fixed"
21275
+ default: "auto",
21276
+ validator(v) {
21277
+ return v === "fixed" || v === "auto";
21278
+ }
21279
+ },
21280
+ showLoading: {
21281
+ type: Boolean,
21282
+ default: false
21283
+ },
21284
+ headerBg: {
21285
+ type: Boolean,
21286
+ default: false
21024
21287
  }
21025
21288
  };
21289
+ const TABLE_TOKEN = Symbol();
21026
21290
  function useTable(props) {
21027
21291
  const classes = computed(() => ({
21028
21292
  "devui-table": true,
@@ -21030,170 +21294,541 @@ function useTable(props) {
21030
21294
  "header-bg": props.headerBg,
21031
21295
  "table-layout-auto": props.tableLayout === "auto"
21032
21296
  }));
21033
- return { classes };
21297
+ const style2 = computed(() => ({
21298
+ maxHeight: props.maxHeight,
21299
+ maxWidth: props.maxWidth,
21300
+ height: props.tableHeight,
21301
+ width: props.tableWidth
21302
+ }));
21303
+ return { classes, style: style2 };
21034
21304
  }
21035
- function createStore(props) {
21305
+ const useFixedColumn = (column) => {
21306
+ const stickyCell = computed(() => {
21307
+ const col2 = column.value;
21308
+ if (col2.fixedLeft) {
21309
+ return `devui-sticky-cell left`;
21310
+ }
21311
+ if (col2.fixedRight) {
21312
+ return `devui-sticky-cell right`;
21313
+ }
21314
+ return void 0;
21315
+ });
21316
+ const offsetStyle = computed(() => {
21317
+ const col2 = column.value;
21318
+ if (col2.fixedLeft) {
21319
+ return `left:${col2.fixedLeft}`;
21320
+ }
21321
+ if (col2.fixedRight) {
21322
+ return `right:${col2.fixedRight}`;
21323
+ }
21324
+ return void 0;
21325
+ });
21326
+ return {
21327
+ stickyCell,
21328
+ offsetStyle
21329
+ };
21330
+ };
21331
+ function createStore(dataSource) {
21036
21332
  const _data = ref([]);
21333
+ watch(dataSource, (value) => {
21334
+ _data.value = [...value];
21335
+ }, { deep: true, immediate: true });
21336
+ const { _columns, insertColumn, removeColumn, sortColumn } = createColumnGenerator();
21337
+ const { _checkAll, _checkList, _halfChecked, getCheckedRows } = createSelection(dataSource, _data);
21338
+ const { sortData } = createSorter(dataSource, _data);
21339
+ const { filterData, resetFilterData } = createFilter(dataSource, _data);
21340
+ const { isFixedLeft } = createFixedLogic(_columns);
21341
+ return {
21342
+ states: {
21343
+ _data,
21344
+ _columns,
21345
+ _checkList,
21346
+ _checkAll,
21347
+ _halfChecked,
21348
+ isFixedLeft
21349
+ },
21350
+ insertColumn,
21351
+ sortColumn,
21352
+ removeColumn,
21353
+ getCheckedRows,
21354
+ sortData,
21355
+ filterData,
21356
+ resetFilterData
21357
+ };
21358
+ }
21359
+ const createColumnGenerator = () => {
21037
21360
  const _columns = ref([]);
21038
- updateData();
21039
- watch(() => props.data, updateData, { deep: true });
21040
- function updateData() {
21041
- _data.value = [];
21042
- props.data.forEach((item2) => {
21043
- _data.value.push(item2);
21044
- });
21045
- }
21046
21361
  const insertColumn = (column) => {
21047
21362
  _columns.value.push(column);
21363
+ _columns.value.sort((a, b) => a.order > b.order ? 1 : -1);
21364
+ };
21365
+ const sortColumn = () => {
21366
+ _columns.value.sort((a, b) => a.order > b.order ? 1 : -1);
21367
+ };
21368
+ const removeColumn = (column) => {
21369
+ const i = _columns.value.findIndex((v) => v === column);
21370
+ if (i === -1) {
21371
+ return;
21372
+ }
21373
+ _columns.value.splice(i, 1);
21374
+ };
21375
+ return { _columns, insertColumn, removeColumn, sortColumn };
21376
+ };
21377
+ const createSelection = (dataSource, _data) => {
21378
+ const _checkList = ref([]);
21379
+ const _checkAllRecord = ref(false);
21380
+ const _checkAll = computed({
21381
+ get: () => _checkAllRecord.value,
21382
+ set: (val) => {
21383
+ _checkAllRecord.value = val;
21384
+ for (let i = 0; i < _checkList.value.length; i++) {
21385
+ _checkList.value[i] = val;
21386
+ }
21387
+ }
21388
+ });
21389
+ const _halfChecked = ref(false);
21390
+ watch(dataSource, (value) => {
21391
+ _checkList.value = new Array(value.length).fill(false);
21392
+ }, { deep: true, immediate: true });
21393
+ watch(_checkList, (list) => {
21394
+ if (list.length === 0) {
21395
+ return;
21396
+ }
21397
+ let allTrue = true;
21398
+ let allFalse = true;
21399
+ for (let i = 0; i < list.length; i++) {
21400
+ allTrue && (allTrue = list[i]);
21401
+ allFalse && (allFalse = !list[i]);
21402
+ }
21403
+ _checkAllRecord.value = allTrue;
21404
+ _halfChecked.value = !(allFalse || allTrue);
21405
+ }, { immediate: true, deep: true });
21406
+ const getCheckedRows = () => {
21407
+ return _data.value.filter((_, index2) => _checkList.value[index2]);
21048
21408
  };
21049
21409
  return {
21050
- insertColumn,
21051
- states: {
21052
- _data,
21053
- _columns
21410
+ _checkList,
21411
+ _checkAll,
21412
+ _halfChecked,
21413
+ getCheckedRows
21414
+ };
21415
+ };
21416
+ const createSorter = (dataSource, _data) => {
21417
+ const sortData = (field, direction, compareFn = (field2, a, b) => a[field2] > b[field2]) => {
21418
+ if (direction === "ASC") {
21419
+ _data.value = _data.value.sort((a, b) => compareFn(field, a, b) ? 1 : -1);
21420
+ } else if (direction === "DESC") {
21421
+ _data.value = _data.value.sort((a, b) => !compareFn(field, a, b) ? 1 : -1);
21422
+ } else {
21423
+ _data.value = [...dataSource.value];
21054
21424
  }
21055
21425
  };
21056
- }
21426
+ return { sortData };
21427
+ };
21428
+ const createFilter = (dataSource, _data) => {
21429
+ const fieldSet = new Set();
21430
+ const filterData = (field, results2) => {
21431
+ fieldSet.add(field);
21432
+ const fields = [...fieldSet];
21433
+ _data.value = dataSource.value.filter((item2) => {
21434
+ return fields.reduce((prev, field2) => {
21435
+ return prev && results2.indexOf(item2[field2]) !== -1;
21436
+ }, true);
21437
+ });
21438
+ };
21439
+ const resetFilterData = () => {
21440
+ fieldSet.clear();
21441
+ _data.value = [...dataSource.value];
21442
+ };
21443
+ return { filterData, resetFilterData };
21444
+ };
21445
+ const createFixedLogic = (columns) => {
21446
+ const isFixedLeft = computed(() => {
21447
+ return columns.value.reduce((prev, current) => prev || !!current.fixedLeft, false);
21448
+ });
21449
+ return { isFixedLeft };
21450
+ };
21057
21451
  var ColGroup = defineComponent$1({
21058
21452
  name: "DColGroup",
21059
21453
  setup() {
21060
- const parent2 = inject("table");
21454
+ const parent2 = inject(TABLE_TOKEN);
21061
21455
  const columns = parent2.store.states._columns;
21062
- return {
21063
- columns
21064
- };
21065
- },
21066
- render() {
21067
- const {
21068
- columns
21069
- } = this;
21070
- return createVNode("colgroup", null, [columns.map((column, index2) => {
21456
+ return () => parent2.props.tableLayout === "fixed" ? createVNode("colgroup", null, [parent2.props.checkable ? createVNode("col", {
21457
+ "width": 36
21458
+ }, null) : null, columns.value.map((column, index2) => {
21071
21459
  return createVNode("col", {
21072
21460
  "key": index2,
21073
21461
  "width": column.realWidth
21074
21462
  }, null);
21075
- })]);
21463
+ })]) : null;
21076
21464
  }
21077
21465
  });
21078
- const TableHeaderProps = {
21079
- store: {
21080
- type: Object,
21081
- default: {}
21082
- }
21083
- };
21084
- var header = "";
21085
- var TableHeader = defineComponent$1({
21086
- name: "DTableHeader",
21087
- props: TableHeaderProps,
21088
- setup(props) {
21089
- const {
21090
- store
21091
- } = toRefs(props);
21092
- const columns = store.value.states._columns.value;
21093
- return {
21094
- columns
21095
- };
21466
+ var sort = "";
21467
+ const Sort = defineComponent$1({
21468
+ props: {
21469
+ modelValue: {
21470
+ type: String,
21471
+ default: ""
21472
+ },
21473
+ "onUpdate:modelValue": {
21474
+ type: Function
21475
+ }
21096
21476
  },
21097
- render() {
21098
- const {
21099
- columns
21100
- } = this;
21101
- return createVNode("thead", {
21102
- "class": "devui-thead"
21103
- }, [createVNode("tr", null, [columns.map((column, index2) => {
21104
- return createVNode("th", {
21105
- "key": index2
21106
- }, [column.renderHeader()]);
21107
- })])]);
21477
+ emits: ["update:modelValue"],
21478
+ setup(props, ctx2) {
21479
+ const changeDirection = () => {
21480
+ let direction = "";
21481
+ if (props.modelValue === "ASC") {
21482
+ direction = "DESC";
21483
+ } else if (props.modelValue === "DESC") {
21484
+ direction = "";
21485
+ } else {
21486
+ direction = "ASC";
21487
+ }
21488
+ ctx2.emit("update:modelValue", direction);
21489
+ };
21490
+ return () => createVNode("span", {
21491
+ "onClick": changeDirection,
21492
+ "class": "sort-clickable"
21493
+ }, [createVNode("i", {
21494
+ "class": ["datatable-svg", {
21495
+ "sort-icon-default": !props.modelValue,
21496
+ "sort-icon-asc": props.modelValue === "ASC",
21497
+ "sort-icon-desc": props.modelValue === "DESC"
21498
+ }]
21499
+ }, [createVNode("svg", {
21500
+ "width": "16px",
21501
+ "height": "16px",
21502
+ "viewBox": "0 0 16 16",
21503
+ "version": "1.1",
21504
+ "xmlns": "http://www.w3.org/2000/svg",
21505
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
21506
+ }, [createVNode("defs", null, [createVNode("circle", {
21507
+ "id": "sort-svg-path-1",
21508
+ "cx": "8",
21509
+ "cy": "8",
21510
+ "r": "8"
21511
+ }, null), createVNode("filter", {
21512
+ "x": "-34.4%",
21513
+ "y": "-21.9%",
21514
+ "width": "168.8%",
21515
+ "height": "168.8%",
21516
+ "filterUnits": "objectBoundingBox",
21517
+ "id": "filter-2"
21518
+ }, [createVNode("feOffset", {
21519
+ "dx": "0",
21520
+ "dy": "2",
21521
+ "in": "SourceAlpha",
21522
+ "result": "shadowOffsetOuter1"
21523
+ }, null), createVNode("feGaussianBlur", {
21524
+ "stdDeviation": "1.5",
21525
+ "in": "shadowOffsetOuter1",
21526
+ "result": "shadowBlurOuter1"
21527
+ }, null), createVNode("feColorMatrix", {
21528
+ "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.085309222 0",
21529
+ "type": "matrix",
21530
+ "in": "shadowBlurOuter1"
21531
+ }, null)])]), createVNode("g", {
21532
+ "stroke": "none",
21533
+ "stroke-width": "1",
21534
+ "fill": "none",
21535
+ "fill-rule": "evenodd"
21536
+ }, [createVNode("use", {
21537
+ "fill-rule": "evenodd",
21538
+ "xlink:href": "#sort-svg-path-1"
21539
+ }, null), createVNode("polygon", {
21540
+ "points": "8 4 11 7 5 7"
21541
+ }, null), createVNode("polygon", {
21542
+ "points": "8 12 5 9 11 9"
21543
+ }, null)])])])]);
21108
21544
  }
21109
21545
  });
21110
- const TableBodyProps = {
21111
- store: {
21112
- type: Object,
21113
- default: {}
21546
+ var filter = "";
21547
+ const Filter = defineComponent$1({
21548
+ props: {
21549
+ modelValue: {
21550
+ type: Array,
21551
+ default: []
21552
+ },
21553
+ "onUpdate:modelValue": {
21554
+ type: Function
21555
+ },
21556
+ customTemplate: {
21557
+ type: Function
21558
+ },
21559
+ filterList: {
21560
+ type: Array,
21561
+ required: true
21562
+ },
21563
+ filterMultiple: {
21564
+ type: Boolean,
21565
+ default: true
21566
+ }
21567
+ },
21568
+ emits: ["update:modelValue"],
21569
+ setup(props) {
21570
+ const filterOrigin = ref(null);
21571
+ const onUpdateChecked = (config, value) => {
21572
+ const checkedList = props.modelValue;
21573
+ const update = props["onUpdate:modelValue"];
21574
+ const contained = !!checkedList.find((item2) => item2 === config.value);
21575
+ if (value && !contained) {
21576
+ update == null ? void 0 : update([...checkedList, config.value]);
21577
+ } else if (!value && contained) {
21578
+ update == null ? void 0 : update(checkedList.filter((item2) => config.value !== item2));
21579
+ }
21580
+ };
21581
+ const updateSingleChecked = (config) => {
21582
+ var _a;
21583
+ (_a = props["onUpdate:modelValue"]) == null ? void 0 : _a.call(props, [config.value]);
21584
+ };
21585
+ const dropdownContent = computed(() => {
21586
+ const checkedList = props.modelValue;
21587
+ const isContained = (config) => !!checkedList.find((item2) => item2 === config.value);
21588
+ return () => createVNode("ul", {
21589
+ "class": "devui-dropdown-menu data-table-column-filter-content",
21590
+ "style": "padding:10px"
21591
+ }, [props.filterList.map((item2, index2) => {
21592
+ return createVNode("li", {
21593
+ "style": index2 > 0 ? "margin-top:10px" : ""
21594
+ }, [props.filterMultiple ? createVNode(Checkbox, {
21595
+ "modelValue": isContained(item2),
21596
+ "onUpdate:modelValue": (value) => onUpdateChecked(item2, value)
21597
+ }, {
21598
+ default: () => [item2.name]
21599
+ }) : createVNode("span", {
21600
+ "onClick": () => updateSingleChecked(item2)
21601
+ }, [item2.name])]);
21602
+ })]);
21603
+ });
21604
+ return () => createVNode(Fragment, null, [createVNode("span", {
21605
+ "ref": filterOrigin
21606
+ }, [createVNode("i", {
21607
+ "class": ["filter-icon", {
21608
+ "filter-icon-active": true
21609
+ }]
21610
+ }, [createVNode("svg", {
21611
+ "width": "16px",
21612
+ "height": "16px",
21613
+ "viewBox": "0 0 16 16",
21614
+ "version": "1.1",
21615
+ "xmlns": "http://www.w3.org/2000/svg",
21616
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
21617
+ }, [createVNode("g", {
21618
+ "stroke": "none",
21619
+ "stroke-width": "1",
21620
+ "fill": "none",
21621
+ "fill-rule": "evenodd"
21622
+ }, [createVNode("g", null, [createVNode("polygon", {
21623
+ "points": "10.0085775 7 10.0085775 15 6 13 6 7 2 3 2 1 14 1 14 3"
21624
+ }, null)])])])])]), createVNode(Dropdown, {
21625
+ "origin": filterOrigin.value,
21626
+ "closeScope": "blank"
21627
+ }, {
21628
+ default: () => {
21629
+ var _a, _b;
21630
+ return [(_b = (_a = props.customTemplate) == null ? void 0 : _a.call(props, {
21631
+ value: props.modelValue,
21632
+ onChange: props["onUpdate:modelValue"]
21633
+ })) != null ? _b : dropdownContent.value()];
21634
+ }
21635
+ })]);
21114
21636
  }
21637
+ });
21638
+ var header = "";
21639
+ var body = "";
21640
+ const useSort = (store, column) => {
21641
+ const directionRef = ref("DESC");
21642
+ watch([directionRef, column], ([direction, column2]) => {
21643
+ if (column2.sortable) {
21644
+ store.sortData(column2.field, direction, column2.compareFn);
21645
+ }
21646
+ }, { immediate: true });
21647
+ return directionRef;
21115
21648
  };
21116
- function useTableBody(props) {
21117
- const storeData = props.store.states;
21118
- const rowColumns = computed(() => {
21119
- return storeData._data.value.map((row2) => {
21120
- const obj = Object.assign({}, row2);
21121
- obj.columns = storeData._columns.value;
21122
- return obj;
21123
- });
21649
+ const useFliter = (store, column) => {
21650
+ const filteredRef = shallowRef();
21651
+ watch(filteredRef, (results2) => {
21652
+ store.filterData(column.value.field, results2);
21124
21653
  });
21125
- return { rowColumns };
21126
- }
21127
- var body = "";
21128
- var TableBody = defineComponent$1({
21129
- name: "DTableBody",
21130
- props: TableBodyProps,
21131
- setup(props) {
21654
+ return filteredRef;
21655
+ };
21656
+ var TableHeader = defineComponent$1({
21657
+ name: "DTableHeader",
21658
+ setup() {
21659
+ const table2 = inject(TABLE_TOKEN);
21132
21660
  const {
21133
- rowColumns
21134
- } = useTableBody(props);
21135
- return {
21136
- rowColumns
21661
+ _checkAll: checkAll,
21662
+ _halfChecked: halfChecked,
21663
+ _columns: columns,
21664
+ isFixedLeft
21665
+ } = table2.store.states;
21666
+ const thAttrs = computed(() => isFixedLeft.value ? {
21667
+ class: "devui-sticky-cell left",
21668
+ style: "left:0;"
21669
+ } : null);
21670
+ const checkbox2 = computed(() => table2.props.checkable ? createVNode("th", thAttrs.value, [createVNode(Checkbox, {
21671
+ "style": "padding:10px;",
21672
+ "modelValue": checkAll.value,
21673
+ "onUpdate:modelValue": ($event) => checkAll.value = $event,
21674
+ "halfchecked": halfChecked.value
21675
+ }, null)]) : null);
21676
+ return () => {
21677
+ return createVNode("thead", {
21678
+ "class": "devui-thead"
21679
+ }, [createVNode("tr", null, [checkbox2.value, columns.value.map((column, index2) => createVNode(Th, {
21680
+ "key": index2,
21681
+ "column": column
21682
+ }, null))])]);
21137
21683
  };
21684
+ }
21685
+ });
21686
+ const Th = defineComponent$1({
21687
+ props: {
21688
+ column: {
21689
+ type: Object,
21690
+ required: true
21691
+ }
21138
21692
  },
21139
- render() {
21693
+ setup(props) {
21694
+ const table2 = inject(TABLE_TOKEN);
21140
21695
  const {
21141
- rowColumns
21142
- } = this;
21143
- return createVNode("tbody", {
21696
+ column
21697
+ } = toRefs(props);
21698
+ const directionRef = useSort(table2.store, column);
21699
+ const filteredRef = useFliter(table2.store, column);
21700
+ const {
21701
+ stickyCell,
21702
+ offsetStyle
21703
+ } = useFixedColumn(column);
21704
+ return () => createVNode("th", {
21705
+ "class": stickyCell.value,
21706
+ "style": offsetStyle.value
21707
+ }, [createVNode("div", {
21708
+ "class": "header-container"
21709
+ }, [props.column.renderHeader(), props.column.filterable && createVNode(Filter, {
21710
+ "modelValue": filteredRef.value,
21711
+ "onUpdate:modelValue": ($event) => filteredRef.value = $event,
21712
+ "filterList": props.column.filterList,
21713
+ "customTemplate": props.column.customFilterTemplate
21714
+ }, null)]), props.column.sortable && createVNode(Sort, {
21715
+ "modelValue": directionRef.value,
21716
+ "onUpdate:modelValue": ($event) => directionRef.value = $event
21717
+ }, null)]);
21718
+ }
21719
+ });
21720
+ var TableBody = defineComponent$1({
21721
+ name: "DTableBody",
21722
+ setup() {
21723
+ const table2 = inject(TABLE_TOKEN);
21724
+ const {
21725
+ _data: data,
21726
+ _columns: columns,
21727
+ _checkList: checkList,
21728
+ isFixedLeft
21729
+ } = table2.store.states;
21730
+ const hoverEnabled = computed(() => table2.props.rowHoveredHighlight);
21731
+ const tdAttrs = computed(() => isFixedLeft.value ? {
21732
+ class: "devui-sticky-cell left",
21733
+ style: "left:0;"
21734
+ } : null);
21735
+ const renderCheckbox = (index2) => table2.props.checkable ? createVNode("td", tdAttrs.value, [createVNode(Checkbox, {
21736
+ "modelValue": checkList.value[index2],
21737
+ "onUpdate:modelValue": ($event) => checkList.value[index2] = $event
21738
+ }, null)]) : null;
21739
+ return () => createVNode("tbody", {
21144
21740
  "class": "devui-tbody"
21145
- }, [rowColumns.map((row2, rowIndex) => {
21741
+ }, [data.value.map((row2, rowIndex) => {
21146
21742
  return createVNode("tr", {
21147
- "key": rowIndex
21148
- }, [row2.columns.map((column, index2) => {
21149
- return createVNode("td", {
21150
- "key": index2
21151
- }, [column.renderCell({
21152
- row: row2,
21153
- column,
21154
- $index: index2
21155
- })]);
21156
- })]);
21743
+ "key": rowIndex,
21744
+ "class": {
21745
+ "hover-enabled": hoverEnabled.value
21746
+ }
21747
+ }, [renderCheckbox(rowIndex), columns.value.map((column, index2) => createVNode(TD, {
21748
+ "column": column,
21749
+ "index": index2,
21750
+ "row": row2
21751
+ }, null))]);
21157
21752
  })]);
21158
21753
  }
21159
21754
  });
21755
+ const TD = defineComponent$1({
21756
+ props: {
21757
+ column: {
21758
+ type: Object
21759
+ },
21760
+ row: {
21761
+ type: Object
21762
+ },
21763
+ index: {
21764
+ type: Number
21765
+ }
21766
+ },
21767
+ setup(props) {
21768
+ const column = toRef(props, "column");
21769
+ const {
21770
+ stickyCell,
21771
+ offsetStyle
21772
+ } = useFixedColumn(column);
21773
+ return () => createVNode("td", {
21774
+ "class": stickyCell.value,
21775
+ "style": offsetStyle.value
21776
+ }, [column.value.renderCell(props.row, props.index)]);
21777
+ }
21778
+ });
21160
21779
  var table = "";
21161
21780
  var Table = defineComponent$1({
21162
21781
  name: "DTable",
21163
21782
  props: TableProps,
21164
- setup(props) {
21783
+ setup(props, ctx2) {
21165
21784
  const table2 = getCurrentInstance();
21166
- const store = createStore(props);
21785
+ const store = createStore(toRef(props, "data"));
21167
21786
  table2.store = store;
21787
+ provide(TABLE_TOKEN, table2);
21168
21788
  const {
21169
- classes
21170
- } = useTable(props);
21171
- provide("table", table2);
21172
- return {
21173
21789
  classes,
21174
- store
21175
- };
21176
- },
21177
- render() {
21178
- const {
21179
- classes,
21180
- data,
21181
- store,
21182
- $slots
21183
- } = this;
21184
- return createVNode("div", {
21185
- "class": "devui-table-wrapper"
21186
- }, [$slots.default(), createVNode("table", {
21187
- "class": classes,
21188
- "cellpadding": "0",
21189
- "cellspacing": "0"
21190
- }, [createVNode(ColGroup, null, null), createVNode(TableHeader, {
21191
- "store": store
21192
- }, null), !!data.length && createVNode(TableBody, {
21193
- "store": store
21194
- }, null)]), !data.length && createVNode("div", {
21790
+ style: style2
21791
+ } = useTable(props);
21792
+ const isEmpty2 = computed(() => props.data.length === 0);
21793
+ const fixHeaderCompo = computed(() => {
21794
+ return createVNode("div", {
21795
+ "class": "devui-table-view"
21796
+ }, [createVNode("div", {
21797
+ "style": "overflow: hidden scroll;"
21798
+ }, [createVNode("table", {
21799
+ "class": classes.value,
21800
+ "cellpadding": "0",
21801
+ "cellspacing": "0"
21802
+ }, [createVNode(ColGroup, null, null), createVNode(TableHeader, null, null)])]), createVNode("div", {
21803
+ "class": "scroll-view"
21804
+ }, [createVNode("table", {
21805
+ "class": classes.value,
21806
+ "cellpadding": "0",
21807
+ "cellspacing": "0"
21808
+ }, [createVNode(ColGroup, null, null), !isEmpty2.value && createVNode(TableBody, {
21809
+ "style": "flex: 1"
21810
+ }, null)])])]);
21811
+ });
21812
+ const normalHeaderCompo = computed(() => {
21813
+ return createVNode("table", {
21814
+ "class": classes.value,
21815
+ "cellpadding": "0",
21816
+ "cellspacing": "0"
21817
+ }, [createVNode(ColGroup, null, null), createVNode(TableHeader, {
21818
+ "style": "position: relative"
21819
+ }, null), !isEmpty2.value && createVNode(TableBody, null, null)]);
21820
+ });
21821
+ ctx2.expose({
21822
+ getCheckedRows() {
21823
+ return store.getCheckedRows();
21824
+ }
21825
+ });
21826
+ return () => withDirectives(createVNode("div", {
21827
+ "class": "devui-table-wrapper",
21828
+ "style": style2.value
21829
+ }, [ctx2.slots.default(), props.fixHeader ? fixHeaderCompo.value : normalHeaderCompo.value, isEmpty2.value && createVNode("div", {
21195
21830
  "class": "devui-table-empty"
21196
- }, [createTextVNode("No Data")])]);
21831
+ }, [createTextVNode("No Data")])]), [[resolveDirective("dLoading"), props.showLoading]]);
21197
21832
  }
21198
21833
  });
21199
21834
  const TableColumnProps = {
@@ -21215,6 +21850,36 @@ const TableColumnProps = {
21215
21850
  },
21216
21851
  formatter: {
21217
21852
  type: Function
21853
+ },
21854
+ order: {
21855
+ type: Number,
21856
+ default: 0
21857
+ },
21858
+ sortable: {
21859
+ type: Boolean,
21860
+ default: false
21861
+ },
21862
+ compareFn: {
21863
+ type: Function,
21864
+ default: (field, a, b) => a[field] < b[field]
21865
+ },
21866
+ filterable: {
21867
+ type: Boolean,
21868
+ default: false
21869
+ },
21870
+ filterMultiple: {
21871
+ type: Boolean,
21872
+ default: false
21873
+ },
21874
+ filterList: {
21875
+ type: Array,
21876
+ default: []
21877
+ },
21878
+ fixedLeft: {
21879
+ type: String
21880
+ },
21881
+ fixedRight: {
21882
+ type: String
21218
21883
  }
21219
21884
  };
21220
21885
  function formatWidth(width) {
@@ -21226,59 +21891,84 @@ function formatWidth(width) {
21226
21891
  function formatMinWidth(minWidth) {
21227
21892
  return formatWidth(minWidth) || 80;
21228
21893
  }
21229
- function useRender(props) {
21230
- const formatedWidth = ref(formatWidth(props.width));
21231
- const formatedMinWidth = ref(formatMinWidth(props.minWidth));
21232
- const setColumnWidth = (column) => {
21233
- column.width = formatedWidth.value;
21234
- column.minWidth = formatedMinWidth.value;
21894
+ function createColumn(props, templates) {
21895
+ const {
21896
+ field,
21897
+ header: header2,
21898
+ sortable,
21899
+ width,
21900
+ minWidth,
21901
+ formatter,
21902
+ compareFn,
21903
+ filterable,
21904
+ filterList,
21905
+ filterMultiple,
21906
+ order,
21907
+ fixedLeft,
21908
+ fixedRight
21909
+ } = props;
21910
+ const column = reactive({});
21911
+ watch([field, header2, order], ([field2, header22, order2]) => {
21912
+ column.field = field2;
21913
+ column.header = header22;
21914
+ column.order = order2;
21915
+ }, { immediate: true });
21916
+ watch([sortable, compareFn], ([sortable2, compareFn2]) => {
21917
+ column.sortable = sortable2;
21918
+ column.compareFn = compareFn2;
21919
+ });
21920
+ watch([
21921
+ filterable,
21922
+ filterList,
21923
+ filterMultiple
21924
+ ], ([filterable2, filterList2, filterMultiple2]) => {
21925
+ column.filterable = filterable2;
21926
+ column.filterMultiple = filterMultiple2;
21927
+ column.filterList = filterList2;
21928
+ }, { immediate: true });
21929
+ watch([fixedLeft, fixedRight], ([left, right]) => {
21930
+ column.fixedLeft = left;
21931
+ column.fixedRight = right;
21932
+ }, { immediate: true });
21933
+ watch([width, minWidth], ([width2, minWidth2]) => {
21934
+ column.width = formatWidth(width2);
21935
+ column.minWidth = formatMinWidth(minWidth2);
21235
21936
  column.realWidth = column.width || column.minWidth;
21236
- return column;
21237
- };
21238
- const setColumnRender = (column) => {
21239
- column.renderHeader = () => {
21240
- return defaultRenderHeader(column);
21241
- };
21242
- column.renderCell = (data) => {
21243
- return defaultRenderCell(data);
21244
- };
21245
- };
21246
- return { setColumnWidth, setColumnRender };
21937
+ });
21938
+ onBeforeMount(() => {
21939
+ column.renderHeader = defaultRenderHeader;
21940
+ column.renderCell = defaultRenderCell;
21941
+ column.formatter = formatter.value;
21942
+ column.customFilterTemplate = templates.customFilterTemplate;
21943
+ column.subColumns = templates.subColumns;
21944
+ });
21945
+ return column;
21247
21946
  }
21248
- function defaultRenderHeader(column) {
21249
- return column.header;
21947
+ function defaultRenderHeader() {
21948
+ return h("span", { class: "title" }, this.header);
21250
21949
  }
21251
- function defaultRenderCell({
21252
- row: row2,
21253
- column,
21254
- $index
21255
- }) {
21256
- var _a;
21257
- const value = row2[column.field];
21258
- if (column.formatter) {
21259
- return column.formatter(row2, column, value, $index);
21950
+ function defaultRenderCell(rowData, index2) {
21951
+ var _a, _b;
21952
+ const value = rowData[this.field];
21953
+ if (this.formatter) {
21954
+ return this.formatter(rowData, value, index2);
21260
21955
  }
21261
- return ((_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) || "";
21956
+ return (_b = (_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) != null ? _b : "";
21262
21957
  }
21263
21958
  var Column = defineComponent$1({
21264
21959
  name: "DColumn",
21265
21960
  props: TableColumnProps,
21266
- setup(props) {
21267
- const column = {
21268
- field: props.field,
21269
- header: props.header
21270
- };
21271
- const parent2 = inject("table");
21272
- const {
21273
- setColumnWidth,
21274
- setColumnRender
21275
- } = useRender(props);
21276
- onBeforeMount(() => {
21277
- setColumnWidth(column);
21278
- setColumnRender(column);
21279
- });
21961
+ setup(props, ctx2) {
21962
+ const column = createColumn(toRefs(props), ctx2.slots);
21963
+ const parent2 = inject(TABLE_TOKEN);
21280
21964
  onMounted(() => {
21281
21965
  parent2.store.insertColumn(column);
21966
+ watch(() => column.order, () => {
21967
+ parent2.store.sortColumn();
21968
+ });
21969
+ });
21970
+ onBeforeUnmount(() => {
21971
+ parent2.store.removeColumn(column);
21282
21972
  });
21283
21973
  },
21284
21974
  render() {
@@ -21498,30 +22188,86 @@ const tagProps = {
21498
22188
  color: {
21499
22189
  type: String,
21500
22190
  default: ""
22191
+ },
22192
+ titleContent: {
22193
+ type: String,
22194
+ default: ""
22195
+ },
22196
+ checked: {
22197
+ type: Boolean,
22198
+ default: false
22199
+ },
22200
+ deletable: {
22201
+ type: Boolean,
22202
+ default: false
21501
22203
  }
21502
22204
  };
21503
- function useStyle(props) {
22205
+ function useClass(props) {
22206
+ return computed(() => {
22207
+ const { type: type4, color } = props;
22208
+ return `devui-tag devui-tag-${type4 || (color ? "colorful" : "") || "default"}`;
22209
+ });
22210
+ }
22211
+ function useColor(props) {
21504
22212
  return computed(() => {
21505
- const { type: type4 } = props;
21506
- return `devui-tag devui-tag-${type4 || "default"}`;
22213
+ const { color, type: type4 } = props;
22214
+ const typeMap = {
22215
+ primary: "#5e7ce0",
22216
+ success: "#50d4ab",
22217
+ warning: "#fac20a",
22218
+ danger: "#f66f6a"
22219
+ };
22220
+ const colorMap = {
22221
+ "blue-w98": "#3383ff",
22222
+ "aqua-w98": "#39afcc",
22223
+ "olivine-w98": "#2fa898",
22224
+ "green-w98": "#4eb15e",
22225
+ "yellow-w98": "#b08d1a",
22226
+ "orange-w98": "#d47f35",
22227
+ "red-w98": "#f66f6a",
22228
+ "pink-w98": "#f3689a",
22229
+ "purple-w98": "#a97af8"
22230
+ };
22231
+ if (!color && type4)
22232
+ return typeMap[type4];
22233
+ const themeColor = colorMap[color] || color;
22234
+ return themeColor;
21507
22235
  });
21508
22236
  }
21509
22237
  var tag = "";
21510
22238
  var Tag = defineComponent$1({
21511
22239
  name: "DTag",
21512
22240
  props: tagProps,
21513
- emits: [],
22241
+ emits: ["click"],
21514
22242
  setup(props, {
21515
- slots
22243
+ slots,
22244
+ emit
21516
22245
  }) {
21517
- const tagClass = useStyle(props);
22246
+ const {
22247
+ type: type4,
22248
+ color,
22249
+ checked,
22250
+ titleContent
22251
+ } = toRefs(props);
22252
+ const tagClass = useClass(props);
22253
+ const themeColor = useColor(props);
22254
+ const tagTitle = titleContent.value || "";
22255
+ const Click = () => {
22256
+ emit("click");
22257
+ };
21518
22258
  return () => {
21519
22259
  var _a;
21520
22260
  return createVNode("div", {
21521
- "class": "devui-tag"
22261
+ "class": "devui-tag",
22262
+ "onClick": Click
21522
22263
  }, [createVNode("span", {
21523
22264
  "class": tagClass.value,
21524
- "style": "display: block;"
22265
+ "style": {
22266
+ display: "block",
22267
+ color: checked.value ? "#fff" : themeColor.value,
22268
+ backgroundColor: checked.value ? themeColor.value : type4.value ? "" : !color.value ? "" : "#fff"
22269
+ },
22270
+ "title": tagTitle
21525
22271
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
21526
22272
  };
21527
22273
  }
@@ -23568,7 +24314,7 @@ const EventListener = {
23568
24314
  }
23569
24315
  };
23570
24316
  var tooltip = "";
23571
- var Tooltip = defineComponent$1({
24317
+ var DTooltip = defineComponent$1({
23572
24318
  name: "DTooltip",
23573
24319
  props: tooltipProps,
23574
24320
  setup(props, ctx2) {
@@ -23685,15 +24431,15 @@ var Tooltip = defineComponent$1({
23685
24431
  };
23686
24432
  }
23687
24433
  });
23688
- Tooltip.install = function(app) {
23689
- app.component(Tooltip.name, Tooltip);
24434
+ DTooltip.install = function(app) {
24435
+ app.component(DTooltip.name, DTooltip);
23690
24436
  };
23691
24437
  var TooltipInstall = {
23692
24438
  title: "Tooltip\u63D0\u793A",
23693
24439
  category: "\u53CD\u9988",
23694
24440
  status: "50%",
23695
24441
  install(app) {
23696
- app.use(Tooltip);
24442
+ app.use(DTooltip);
23697
24443
  }
23698
24444
  };
23699
24445
  const transferBaseProps = {
@@ -23725,10 +24471,14 @@ const transferBaseProps = {
23725
24471
  type: Boolean,
23726
24472
  default: () => false
23727
24473
  },
23728
- query: {
24474
+ filter: {
23729
24475
  type: String,
23730
24476
  default: () => ""
23731
24477
  },
24478
+ height: {
24479
+ type: String,
24480
+ default: () => "320px"
24481
+ },
23732
24482
  alltargetState: {
23733
24483
  type: Boolean,
23734
24484
  default: () => false
@@ -23745,6 +24495,14 @@ const transferBaseProps = {
23745
24495
  type: Number,
23746
24496
  default: () => 0
23747
24497
  },
24498
+ showTooltip: {
24499
+ type: Boolean,
24500
+ default: () => false
24501
+ },
24502
+ tooltipPosition: {
24503
+ type: String,
24504
+ default: () => "top"
24505
+ },
23748
24506
  scopedSlots: {
23749
24507
  type: Object
23750
24508
  },
@@ -23778,7 +24536,7 @@ const initState = (props, type4) => {
23778
24536
  allChecked: false,
23779
24537
  disabled: false,
23780
24538
  checkedNum: initModel.model.length,
23781
- query: "",
24539
+ keyword: "",
23782
24540
  checkedValues: initModel.model,
23783
24541
  filterData: initModel.data
23784
24542
  };
@@ -23797,19 +24555,36 @@ var DTransferBase = defineComponent$1({
23797
24555
  components: {
23798
24556
  DSearch,
23799
24557
  DCheckboxGroup,
23800
- DCheckbox: Checkbox
24558
+ DCheckbox: Checkbox,
24559
+ DTooltip
23801
24560
  },
23802
24561
  props: transferBaseProps,
23803
24562
  setup(props, ctx2) {
23804
24563
  const modelValues = computed(() => props.checkedValues);
23805
- const searchQuery = computed(() => props.query);
24564
+ const searchQuery = computed(() => props.filter);
23806
24565
  const baseClass = TransferBaseClass(props);
23807
24566
  const updateSearchQuery = (val) => ctx2.emit("changeQuery", val);
24567
+ const renderCheckbox = (props2, key, showTooltip = false, tooltipPosition = "top") => {
24568
+ const checkbox2 = createVNode(Checkbox, {
24569
+ "class": "devui-transfer-panel-body-list-item",
24570
+ "label": props2.key,
24571
+ "value": props2.value,
24572
+ "disabled": props2.disabled,
24573
+ "key": key
24574
+ }, null);
24575
+ return !showTooltip ? checkbox2 : createVNode(DTooltip, {
24576
+ "position": tooltipPosition,
24577
+ "content": props2.key
24578
+ }, _isSlot$1(checkbox2) ? checkbox2 : {
24579
+ default: () => [checkbox2]
24580
+ });
24581
+ };
23808
24582
  return {
23809
24583
  baseClass,
23810
24584
  searchQuery,
23811
24585
  modelValues,
23812
- updateSearchQuery
24586
+ updateSearchQuery,
24587
+ renderCheckbox
23813
24588
  };
23814
24589
  },
23815
24590
  render() {
@@ -23824,7 +24599,11 @@ var DTransferBase = defineComponent$1({
23824
24599
  updateSearchQuery,
23825
24600
  search: search2,
23826
24601
  searchQuery,
23827
- modelValues
24602
+ modelValues,
24603
+ height,
24604
+ showTooltip,
24605
+ tooltipPosition,
24606
+ renderCheckbox
23828
24607
  } = this;
23829
24608
  return createVNode("div", {
23830
24609
  "class": baseClass
@@ -23849,19 +24628,13 @@ var DTransferBase = defineComponent$1({
23849
24628
  }, null)]), createVNode("div", {
23850
24629
  "class": "devui-transfer-panel-body-list",
23851
24630
  "style": {
23852
- height: `calc(100% - 40px - ${search2 ? 42 : 0}px)`
24631
+ height
23853
24632
  }
23854
24633
  }, [sourceOption.length ? createVNode(DCheckboxGroup, {
23855
24634
  "modelValue": modelValues,
23856
24635
  "onChange": (values) => this.$emit("updateCheckeds", values)
23857
24636
  }, _isSlot$1(_slot = sourceOption.map((item2, idx) => {
23858
- return createVNode(Checkbox, {
23859
- "class": "devui-transfer-panel-body-list-item",
23860
- "label": item2.key,
23861
- "value": item2.value,
23862
- "disabled": item2.disabled,
23863
- "key": idx
23864
- }, null);
24637
+ return renderCheckbox(item2, idx, showTooltip, tooltipPosition);
23865
24638
  })) ? _slot : {
23866
24639
  default: () => [_slot]
23867
24640
  }) : createVNode("div", {
@@ -23946,30 +24719,52 @@ const transferProps = {
23946
24719
  },
23947
24720
  height: {
23948
24721
  type: String,
23949
- default: "320px"
24722
+ default: () => "320px"
23950
24723
  },
23951
24724
  isSearch: {
23952
24725
  type: Boolean,
23953
- default: false
24726
+ default: () => false
23954
24727
  },
23955
24728
  isSourceDroppable: {
23956
24729
  type: Boolean,
23957
- default: false
24730
+ default: () => false
23958
24731
  },
23959
24732
  isTargetDroppable: {
23960
24733
  type: Boolean,
23961
- default: false
24734
+ default: () => false
23962
24735
  },
23963
24736
  disabled: {
23964
24737
  type: Boolean,
23965
- default: false
24738
+ default: () => false
23966
24739
  },
23967
- showOptionTitle: {
24740
+ showTooltip: {
23968
24741
  type: Boolean,
23969
- default: false
24742
+ default: () => false
24743
+ },
24744
+ tooltipPosition: {
24745
+ type: String,
24746
+ default: () => "top"
24747
+ },
24748
+ beforeTransfer: {
24749
+ type: Function
23970
24750
  },
23971
24751
  slots: {
23972
24752
  type: Object
24753
+ },
24754
+ searching: {
24755
+ type: Function
24756
+ },
24757
+ transferToSource: {
24758
+ type: Function
24759
+ },
24760
+ transferToTarget: {
24761
+ type: Function
24762
+ },
24763
+ transferring: {
24764
+ type: Function
24765
+ },
24766
+ afterTransfer: {
24767
+ type: Function
23973
24768
  }
23974
24769
  };
23975
24770
  const headerSlot = (ctx2, name) => {
@@ -23991,10 +24786,16 @@ var Transfer = defineComponent$1({
23991
24786
  },
23992
24787
  props: transferProps,
23993
24788
  setup(props, ctx2) {
23994
- const leftOptions = reactive(initState(props, "source"));
23995
- const rightOptions = reactive(initState(props, "target"));
24789
+ let leftOptions = reactive(initState(props, "source"));
24790
+ let rightOptions = reactive(initState(props, "target"));
23996
24791
  const origin = ref(null);
23997
- watch(() => leftOptions.query, (nVal) => {
24792
+ watch(() => props.sourceOption, () => {
24793
+ leftOptions = reactive(initState(props, "source"));
24794
+ });
24795
+ watch(() => props.targetOption, () => {
24796
+ rightOptions = reactive(initState(props, "target"));
24797
+ });
24798
+ watch(() => leftOptions.keyword, (nVal) => {
23998
24799
  searchFilterData(leftOptions);
23999
24800
  });
24000
24801
  watch(() => leftOptions.checkedValues, (values) => {
@@ -24003,7 +24804,7 @@ var Transfer = defineComponent$1({
24003
24804
  }, {
24004
24805
  deep: true
24005
24806
  });
24006
- watch(() => rightOptions.query, (nVal) => {
24807
+ watch(() => rightOptions.keyword, (nVal) => {
24007
24808
  searchFilterData(rightOptions);
24008
24809
  });
24009
24810
  watch(() => rightOptions.checkedValues, (values) => {
@@ -24019,19 +24820,35 @@ var Transfer = defineComponent$1({
24019
24820
  source.allChecked = value.length === source.data.filter((item2) => !item2.disabled).length ? true : false;
24020
24821
  }
24021
24822
  };
24022
- const updateFilterData = (source, target) => {
24023
- const newData = [];
24024
- source.data = source.data.filter((item2) => {
24025
- const hasInclues = source.checkedValues.includes(item2.value);
24026
- hasInclues && newData.push(item2);
24027
- return !hasInclues;
24028
- });
24029
- target.data = target.data.concat(newData);
24823
+ const updateFilterData = async (source, target, direction) => {
24824
+ if (isFunction2("beforeTransfer")) {
24825
+ const res = await props.beforeTransfer.call(null, source, target);
24826
+ if (typeof res === "boolean" && res === false) {
24827
+ return;
24828
+ }
24829
+ }
24830
+ const hasToSource = isFunction2("transferToSource");
24831
+ const hasToTarget = isFunction2("transferToTarget");
24832
+ const hasTransfering = isFunction2("transferring");
24833
+ if (hasToSource || hasToTarget) {
24834
+ direction === "right" && props.transferToSource.call(null, source, target);
24835
+ direction === "left" && props.transferToTarget.call(null, source, target);
24836
+ } else {
24837
+ source.data = source.data.filter((item2) => {
24838
+ const hasInclues = source.checkedValues.includes(item2.value);
24839
+ hasInclues && target.data.push(item2);
24840
+ return !hasInclues;
24841
+ });
24842
+ }
24843
+ if (hasTransfering) {
24844
+ props.transferring.call(null, target);
24845
+ }
24030
24846
  source.checkedValues = [];
24031
24847
  target.disabled = !target.disabled;
24032
24848
  searchFilterData(source, target);
24033
24849
  searchFilterData(target, source);
24034
24850
  setOrigin("click");
24851
+ isFunction2("afterTransfer") && props.afterTransfer.call(null, target);
24035
24852
  };
24036
24853
  const changeAllSource = (source, value) => {
24037
24854
  if (source.filterData.every((item2) => item2.disabled))
@@ -24053,7 +24870,7 @@ var Transfer = defineComponent$1({
24053
24870
  setOrigin("change");
24054
24871
  };
24055
24872
  const searchFilterData = (source, target) => {
24056
- source.filterData = source.data.filter((item2) => item2.key.indexOf(source.query) !== -1);
24873
+ source.filterData = source.data.filter((item2) => item2.key.indexOf(source.keyword) !== -1);
24057
24874
  if (target) {
24058
24875
  target.allChecked = false;
24059
24876
  }
@@ -24061,25 +24878,35 @@ var Transfer = defineComponent$1({
24061
24878
  const setOrigin = (value) => {
24062
24879
  origin.value = value;
24063
24880
  };
24881
+ const changeQueryHandle = (source, direction, value) => {
24882
+ if ((props == null ? void 0 : props.searching) && typeof props.searching === "function") {
24883
+ props.searching.call(null, direction, value, source);
24884
+ return;
24885
+ }
24886
+ source.keyword = value;
24887
+ };
24888
+ const isFunction2 = (type4) => {
24889
+ return props[type4] && typeof props[type4] === "function";
24890
+ };
24064
24891
  return () => {
24065
24892
  return createVNode("div", {
24066
24893
  "class": "devui-transfer"
24067
24894
  }, [createVNode(DTransferBase, {
24068
- "style": {
24069
- height: props.height
24070
- },
24071
24895
  "sourceOption": leftOptions.filterData,
24072
24896
  "title": props.titles[0],
24073
24897
  "type": "source",
24074
24898
  "search": props.isSearch,
24075
24899
  "allChecked": leftOptions.allChecked,
24076
24900
  "checkedNum": leftOptions.checkedNum,
24077
- "query": leftOptions.query,
24901
+ "filter": leftOptions.keyword,
24902
+ "height": props.height,
24078
24903
  "checkedValues": leftOptions.checkedValues,
24079
24904
  "allCount": leftOptions.data.length,
24905
+ "showTooltip": props.showTooltip,
24906
+ "tooltipPosition": props.tooltipPosition,
24080
24907
  "onChangeAllSource": (value) => changeAllSource(leftOptions, value),
24081
24908
  "onUpdateCheckeds": updateLeftCheckeds,
24082
- "onChangeQuery": (value) => leftOptions.query = value
24909
+ "onChangeQuery": (value) => changeQueryHandle(leftOptions, "left", value)
24083
24910
  }, {
24084
24911
  header: headerSlot(ctx2, "left"),
24085
24912
  body: bodySlot(ctx2, "left")
@@ -24088,29 +24915,29 @@ var Transfer = defineComponent$1({
24088
24915
  "sourceDisabled": rightOptions.checkedNum > 0 ? false : true,
24089
24916
  "targetDisabled": leftOptions.checkedNum > 0 ? false : true,
24090
24917
  "onUpdateSourceData": () => {
24091
- updateFilterData(rightOptions, leftOptions);
24918
+ updateFilterData(rightOptions, leftOptions, "left");
24092
24919
  },
24093
24920
  "onUpdateTargetData": () => {
24094
- updateFilterData(leftOptions, rightOptions);
24921
+ updateFilterData(leftOptions, rightOptions, "right");
24095
24922
  }
24096
24923
  }, {
24097
24924
  operation: opeartionSlot(ctx2)
24098
24925
  }), createVNode(DTransferBase, {
24099
- "style": {
24100
- height: props.height
24101
- },
24102
24926
  "sourceOption": rightOptions.filterData,
24103
24927
  "title": props.titles[1],
24104
24928
  "type": "target",
24105
24929
  "search": props.isSearch,
24106
24930
  "allChecked": rightOptions.allChecked,
24107
24931
  "checkedNum": rightOptions.checkedNum,
24108
- "query": rightOptions.query,
24932
+ "filter": rightOptions.keyword,
24933
+ "height": props.height,
24109
24934
  "checkedValues": rightOptions.checkedValues,
24110
24935
  "allCount": rightOptions.data.length,
24936
+ "showTooltip": props.showTooltip,
24937
+ "tooltipPosition": props.tooltipPosition,
24111
24938
  "onChangeAllSource": (value) => changeAllSource(rightOptions, value),
24112
24939
  "onUpdateCheckeds": updateRightCheckeds,
24113
- "onChangeQuery": (value) => rightOptions.query = value
24940
+ "onChangeQuery": (value) => changeQueryHandle(rightOptions, "right", value)
24114
24941
  }, {
24115
24942
  header: headerSlot(ctx2, "right"),
24116
24943
  body: bodySlot(ctx2, "right")
@@ -25940,7 +26767,7 @@ Upload.install = function(app) {
25940
26767
  var UploadInstall = {
25941
26768
  title: "Upload \u4E0A\u4F20",
25942
26769
  category: "\u6570\u636E\u5F55\u5165",
25943
- status: "80%",
26770
+ status: "\u5DF2\u5B8C\u6210",
25944
26771
  install(app) {
25945
26772
  app.use(Upload);
25946
26773
  }
@@ -25958,6 +26785,7 @@ const installs = [
25958
26785
  CarouselInstall,
25959
26786
  CascaderInstall,
25960
26787
  CheckboxInstall,
26788
+ CommentInstall,
25961
26789
  DatePickerInstall,
25962
26790
  DragdropInstall,
25963
26791
  DrawerInstall,
@@ -25970,6 +26798,7 @@ const installs = [
25970
26798
  IconInstall,
25971
26799
  ImagePreviewInstall,
25972
26800
  InputInstall,
26801
+ InputIconInstall,
25973
26802
  InputNumberInstall,
25974
26803
  LayoutInstall,
25975
26804
  LoadingInstall,
@@ -26014,4 +26843,4 @@ var vueDevui = {
26014
26843
  installs.forEach((p) => app.use(p));
26015
26844
  }
26016
26845
  };
26017
- export { Accordion, Alert, Anchor, Aside, Avatar, BackTop, Badge, Breadcrumb, DButton as Button, Card, Carousel, Cascader, Checkbox, Col, Column, Content, DatePicker, DraggableDirective, Drawer, Dropdown, DroppableDirective, EditableSelect, FixedOverlay, FlexibleOverlay, Footer, Form, FormControl, FormItem, FormLabel, FormOperation, Fullscreen, Gantt, Header, Icon, ImagePreviewDirective, ImagePreviewService, DInput as Input, InputNumber, Layout, loadingDirective as Loading, loading as LoadingService, Modal, MultiUpload, NavSprite, Pagination, Panel, Popover, Progress, QuadrantDiagram, Radio, RadioGroup, Rate, ReadTip, RippleDirective, Row, DSearch as Search, Select, Skeleton, SkeletonItem, Slider, Splitter, Status, StepsGuide, StickSlider, Sticky, Switch, Table, Tabs, Tag, TagInput, Textarea, TimeAxis, TimeAxisItem, TimePicker, Toast, ToastService, Tooltip, Transfer, Tree, TreeSelect, Upload, vueDevui as default };
26846
+ export { Accordion, Alert, Anchor, Aside, Avatar, BackTop, Badge, Breadcrumb, DButton as Button, Card, Carousel, Cascader, Checkbox, Col, Column, Comment, Content, DatePicker, DraggableDirective, Drawer, Dropdown, DroppableDirective, EditableSelect, FixedOverlay, FlexibleOverlay, Footer, Form, FormControl, FormItem, FormLabel, FormOperation, Fullscreen, Gantt, Header, Icon, ImagePreviewDirective, ImagePreviewService, DInput as Input, InputIcon, InputNumber, Layout, loadingDirective as Loading, loading as LoadingService, Modal, MultiUpload, NavSprite, Pagination, Panel, Popover, Progress, QuadrantDiagram, Radio, RadioGroup, Rate, ReadTip, RippleDirective, Row, DSearch as Search, Select, Skeleton, SkeletonItem, Slider, Splitter, Status, StepsGuide, StickSlider, Sticky, Switch, Table, Tabs, Tag, TagInput, Textarea, TimeAxis, TimeAxisItem, TimePicker, Toast, ToastService, DTooltip as Tooltip, Transfer, Tree, TreeSelect, Upload, vueDevui as default };