vue-devui 1.0.0-rc.6 → 1.0.0-rc.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 (75) hide show
  1. package/README.md +2 -0
  2. package/auto-complete/style.css +1 -1
  3. package/badge/index.es.js +2 -1
  4. package/badge/index.umd.js +1 -1
  5. package/button/index.es.js +3 -2
  6. package/button/index.umd.js +1 -1
  7. package/button/style.css +1 -1
  8. package/card/index.es.js +35 -29
  9. package/card/index.umd.js +1 -1
  10. package/card/style.css +1 -1
  11. package/checkbox/index.es.js +1 -1
  12. package/checkbox/index.umd.js +1 -1
  13. package/date-picker/style.css +1 -1
  14. package/drawer/style.css +1 -1
  15. package/dropdown/style.css +1 -1
  16. package/editable-select/index.es.js +14 -14
  17. package/editable-select/index.umd.js +1 -1
  18. package/editable-select/style.css +1 -1
  19. package/form/index.es.js +113 -483
  20. package/form/index.umd.js +18 -18
  21. package/form/style.css +1 -1
  22. package/fullscreen/index.es.js +1 -1
  23. package/fullscreen/index.umd.js +1 -1
  24. package/image-preview/style.css +1 -1
  25. package/input/style.css +1 -1
  26. package/loading/style.css +1 -1
  27. package/modal/style.css +1 -1
  28. package/notification/style.css +1 -1
  29. package/nuxt/components/CheckboxGroup.js +3 -0
  30. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  31. package/nuxt/components/FORM_TOKEN.js +3 -0
  32. package/nuxt/components/formControlProps.js +3 -0
  33. package/nuxt/components/formItemProps.js +3 -0
  34. package/nuxt/components/formProps.js +3 -0
  35. package/overlay/style.css +1 -1
  36. package/package.json +1 -1
  37. package/pagination/index.es.js +80 -96
  38. package/pagination/index.umd.js +1 -1
  39. package/pagination/style.css +1 -1
  40. package/popover/style.css +1 -1
  41. package/progress/index.es.js +48 -14
  42. package/progress/index.umd.js +3 -3
  43. package/progress/style.css +1 -1
  44. package/rate/index.es.js +3 -3
  45. package/rate/index.umd.js +1 -1
  46. package/rate/style.css +1 -1
  47. package/search/index.es.js +2 -0
  48. package/search/index.umd.js +2 -2
  49. package/search/style.css +1 -1
  50. package/select/style.css +1 -1
  51. package/splitter/style.css +1 -1
  52. package/style.css +1 -1
  53. package/table/index.es.js +3 -2
  54. package/table/index.umd.js +1 -1
  55. package/table/style.css +1 -1
  56. package/tabs/style.css +1 -1
  57. package/textarea/style.css +1 -1
  58. package/tooltip/style.css +1 -1
  59. package/upload/style.css +1 -1
  60. package/vue-devui.es.js +409 -1078
  61. package/vue-devui.umd.js +20 -20
  62. package/comment/index.d.ts +0 -7
  63. package/comment/index.es.js +0 -84
  64. package/comment/index.umd.js +0 -1
  65. package/comment/package.json +0 -7
  66. package/comment/style.css +0 -1
  67. package/nuxt/components/Comment.js +0 -3
  68. package/nuxt/components/ReadTip.js +0 -3
  69. package/nuxt/components/commentProps.js +0 -3
  70. package/nuxt/components/readTipProps.js +0 -3
  71. package/read-tip/index.d.ts +0 -7
  72. package/read-tip/index.es.js +0 -261
  73. package/read-tip/index.umd.js +0 -1
  74. package/read-tip/package.json +0 -7
  75. package/read-tip/style.css +0 -1
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, h, render, inject, createTextVNode, resolveDirective, unref, watch, onUnmounted, mergeProps, toRefs, provide, Teleport, isVNode, computed, toRef, resolveComponent, reactive, createApp, renderSlot, Fragment, withModifiers, onBeforeUnmount, useSlots, onUpdated, getCurrentInstance, onBeforeMount } from "vue";
36
+ import { createVNode, defineComponent, ref, onMounted, Transition, withDirectives, vShow, nextTick, h, render, inject, createTextVNode, resolveDirective, unref, watch, onUnmounted, mergeProps, toRefs, provide, Teleport, isVNode, computed, toRef, resolveComponent, reactive, createApp, renderSlot, Fragment, withModifiers, onBeforeUnmount, useSlots, effect, onUpdated, getCurrentInstance, onBeforeMount } 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", {
@@ -149,7 +149,7 @@ const alertProps = {
149
149
  default: 0
150
150
  }
151
151
  };
152
- var alert$1 = "";
152
+ var alert = "";
153
153
  var Alert = defineComponent({
154
154
  name: "DAlert",
155
155
  props: alertProps,
@@ -605,13 +605,13 @@ var Loading = defineComponent({
605
605
  inheritAttrs: false,
606
606
  props: loadingProps,
607
607
  setup(props) {
608
- const style2 = {
608
+ const style = {
609
609
  top: props.view.top,
610
610
  left: props.view.left,
611
611
  zIndex: props.zIndex
612
612
  };
613
613
  if (!props.message) {
614
- style2.background = "none";
614
+ style.background = "none";
615
615
  }
616
616
  const isShow = ref(false);
617
617
  const open = () => {
@@ -621,7 +621,7 @@ var Loading = defineComponent({
621
621
  isShow.value = false;
622
622
  };
623
623
  return {
624
- style: style2,
624
+ style,
625
625
  isShow,
626
626
  open,
627
627
  close: close2
@@ -633,7 +633,7 @@ var Loading = defineComponent({
633
633
  isShow,
634
634
  isFull,
635
635
  backdrop,
636
- style: style2,
636
+ style,
637
637
  message,
638
638
  $slots
639
639
  } = this;
@@ -644,7 +644,7 @@ var Loading = defineComponent({
644
644
  }, [backdrop ? createVNode("div", {
645
645
  "class": "devui-loading-mask"
646
646
  }, null) : null, createVNode("div", {
647
- "style": style2,
647
+ "style": style,
648
648
  "class": "devui-loading-area"
649
649
  }, [createVNode("div", {
650
650
  "class": "devui-busy-default-spinner"
@@ -946,8 +946,8 @@ const flexibleOverlayProps = {
946
946
  function getScrollParent(element) {
947
947
  const overflowRegex = /(auto|scroll|hidden)/;
948
948
  for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
949
- const style2 = window.getComputedStyle(parent);
950
- if (overflowRegex.test(style2.overflow + style2.overflowX + style2.overflowY)) {
949
+ const style = window.getComputedStyle(parent);
950
+ if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
951
951
  return parent;
952
952
  }
953
953
  }
@@ -1551,7 +1551,8 @@ const badgeProps = {
1551
1551
  },
1552
1552
  status: {
1553
1553
  type: String,
1554
- validator: (val) => badgeStatusType.includes(val)
1554
+ validator: (val) => badgeStatusType.includes(val),
1555
+ default: "info"
1555
1556
  },
1556
1557
  position: {
1557
1558
  type: String,
@@ -1577,7 +1578,7 @@ var Badge = defineComponent({
1577
1578
  const base = "devui-badge-content";
1578
1579
  return [base, props.showDot ? `${base}-dot` : `${base}-count`, props.status && `${base}-${props.status}`, ctx2.slots.default && props.position && `${base}-${props.position}`, ctx2.slots.default && `${base}-fixed`].join(" ");
1579
1580
  });
1580
- const style2 = computed(() => {
1581
+ const style = computed(() => {
1581
1582
  const styleMap = {
1582
1583
  bgColor: "background",
1583
1584
  textColor: "color"
@@ -1609,7 +1610,7 @@ var Badge = defineComponent({
1609
1610
  "class": "devui-badge"
1610
1611
  }, [(_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a), createVNode("div", {
1611
1612
  "class": className2.value,
1612
- "style": style2.value
1613
+ "style": style.value
1613
1614
  }, [text.value])]);
1614
1615
  };
1615
1616
  }
@@ -1716,11 +1717,12 @@ function useButton(props, ctx2) {
1716
1717
  [`devui-btn-${props.variant}-${props.color || defaultColor}`]: true,
1717
1718
  [`devui-btn-${props.size}`]: true,
1718
1719
  "devui-btn-icon-wrap": props.icon,
1719
- "devui-btn-icon": props.icon && !hasContent.value && props.variant !== "solid"
1720
+ "devui-btn-icon": props.icon && !hasContent.value && props.variant !== "solid",
1721
+ "devui-btn-is-loading": props.loading
1720
1722
  }));
1721
1723
  const iconClass = computed(() => {
1722
1724
  if (!props.icon) {
1723
- return;
1725
+ return "";
1724
1726
  }
1725
1727
  const origin = "devui-icon-fix icon";
1726
1728
  if (hasContent.value) {
@@ -1794,38 +1796,44 @@ var card = "";
1794
1796
  var Card = defineComponent({
1795
1797
  name: "DCard",
1796
1798
  props: cardProps,
1797
- render() {
1798
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
1799
+ setup(props, {
1800
+ slots
1801
+ }) {
1799
1802
  const {
1800
1803
  align,
1801
1804
  src
1802
- } = this;
1803
- const alignCls = {
1804
- "d-card-actions": true,
1805
- "devui-card-actions": true,
1806
- [`devui-card-actions-align-${align}`]: align !== "start"
1805
+ } = toRefs(props);
1806
+ const alignClass = computed(() => {
1807
+ return {
1808
+ "d-card-actions": true,
1809
+ "devui-card-actions": true,
1810
+ [`devui-card-actions-align-${align.value}`]: align.value !== "start"
1811
+ };
1812
+ });
1813
+ return () => {
1814
+ var _a, _b, _c, _d, _e, _f, _g;
1815
+ return createVNode("div", {
1816
+ "class": "card-container devui-card"
1817
+ }, [(_a = slots.default) == null ? void 0 : _a.call(slots), createVNode("div", {
1818
+ "class": "devui-card-header"
1819
+ }, [((_b = slots.avatar) == null ? void 0 : _b.call(slots)) ? createVNode("div", {
1820
+ "class": "devui-card-avatar"
1821
+ }, [(_c = slots.avatar) == null ? void 0 : _c.call(slots)]) : "", createVNode("div", {
1822
+ "class": "devui-card-header-title-area"
1823
+ }, [createVNode("div", {
1824
+ "class": "devui-card-title"
1825
+ }, [(_d = slots.title) == null ? void 0 : _d.call(slots)]), createVNode("div", {
1826
+ "class": "devui-card-subtitle"
1827
+ }, [(_e = slots.subtitle) == null ? void 0 : _e.call(slots)])])]), src.value !== "" ? createVNode("img", {
1828
+ "src": src.value,
1829
+ "alt": "",
1830
+ "class": "devui-card-meta"
1831
+ }, null) : "", createVNode("div", {
1832
+ "class": "devui-card-content"
1833
+ }, [(_f = slots.content) == null ? void 0 : _f.call(slots)]), createVNode("div", {
1834
+ "class": alignClass.value
1835
+ }, [slots.actions ? (_g = slots.actions) == null ? void 0 : _g.call(slots) : ""])]);
1807
1836
  };
1808
- return createVNode("div", {
1809
- "class": "card-container devui-card"
1810
- }, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a), createVNode("div", {
1811
- "class": "devui-card-header"
1812
- }, [((_d = (_c = this.$slots).cardAvatar) == null ? void 0 : _d.call(_c)) ? createVNode("div", {
1813
- "class": "devui-card-avatar"
1814
- }, [(_f = (_e = this.$slots).cardAvatar) == null ? void 0 : _f.call(_e)]) : "", createVNode("div", {
1815
- "class": "devui-card-header-title-area"
1816
- }, [createVNode("div", {
1817
- "class": "devui-card-title"
1818
- }, [(_h = (_g = this.$slots).cardTitle) == null ? void 0 : _h.call(_g)]), createVNode("div", {
1819
- "class": "devui-card-subtitle"
1820
- }, [(_j = (_i = this.$slots).cardSubtitle) == null ? void 0 : _j.call(_i)])])]), src !== "" ? createVNode("img", {
1821
- "src": src,
1822
- "alt": "",
1823
- "class": "devui-card-meta"
1824
- }, null) : "", createVNode("div", {
1825
- "class": "devui-card-content"
1826
- }, [(_l = (_k = this.$slots).cardContent) == null ? void 0 : _l.call(_k)]), createVNode("div", {
1827
- "class": alignCls
1828
- }, [this.$slots.cardActions ? (_n = (_m = this.$slots).cardActions) == null ? void 0 : _n.call(_m) : ""])]);
1829
1837
  }
1830
1838
  });
1831
1839
  var CardInstall = {
@@ -2186,88 +2194,6 @@ var CheckboxInstall = {
2186
2194
  app.component(CheckboxGroup.name, CheckboxGroup);
2187
2195
  }
2188
2196
  };
2189
- const commentProps = {
2190
- actions: {
2191
- type: Object,
2192
- default: null
2193
- },
2194
- author: {
2195
- type: Object,
2196
- default: null
2197
- },
2198
- avatar: {
2199
- type: Object,
2200
- default: null
2201
- },
2202
- content: {
2203
- type: Object,
2204
- default: null
2205
- },
2206
- datetime: {
2207
- type: Object,
2208
- default: null
2209
- }
2210
- };
2211
- var comment = "";
2212
- var Comment = defineComponent({
2213
- name: "DComment",
2214
- props: commentProps,
2215
- emits: [],
2216
- slots: ["actions", "author", "avatar", "content", "datetime"],
2217
- setup(props, {
2218
- slots
2219
- }) {
2220
- return () => {
2221
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2222
- const getAction = (actions2) => {
2223
- if (!actions2 || !actions2.length) {
2224
- return null;
2225
- }
2226
- const actionList = actions2.map((action, index2) => createVNode("li", {
2227
- "key": `devui-comment-action-${index2}`,
2228
- "class": `devui-comment-action-${index2}`
2229
- }, [action]));
2230
- return actionList;
2231
- };
2232
- const actions = (_b = props.actions) != null ? _b : (_a = slots.actions) == null ? void 0 : _a.call(slots);
2233
- const author = (_d = props.author) != null ? _d : (_c = slots.author) == null ? void 0 : _c.call(slots);
2234
- const avatar2 = (_f = props.avatar) != null ? _f : (_e = slots.avatar) == null ? void 0 : _e.call(slots);
2235
- const content2 = (_h = props.content) != null ? _h : (_g = slots.content) == null ? void 0 : _g.call(slots);
2236
- const datetime = (_j = props.datetime) != null ? _j : (_i = slots.datetime) == null ? void 0 : _i.call(slots);
2237
- const avatarDom = createVNode("div", {
2238
- "class": `devui-comment-avatar`
2239
- }, [typeof avatar2 === "string" ? createVNode("img", {
2240
- "src": avatar2,
2241
- "alt": "comment-avatar"
2242
- }, null) : avatar2]);
2243
- const actionsList = Array.isArray(actions) ? actions : [actions];
2244
- const actionDom = actions ? createVNode("ul", {
2245
- "class": `devui-comment-actions`
2246
- }, [getAction(actionsList)]) : null;
2247
- return createVNode("div", {
2248
- "class": "devui-comment"
2249
- }, [avatarDom, createVNode("div", {
2250
- "class": "devui-comment-right"
2251
- }, [createVNode("div", {
2252
- "class": "devui-comment-head"
2253
- }, [createVNode("div", {
2254
- "class": "devui-comment-author"
2255
- }, [author]), createVNode("div", {
2256
- "class": "devui-comment-datetime"
2257
- }, [datetime])]), createVNode("div", {
2258
- "class": "devui-comment-content"
2259
- }, [content2]), actionDom])]);
2260
- };
2261
- }
2262
- });
2263
- var CommentInstall = {
2264
- title: "Comment \u8BC4\u8BBA",
2265
- category: "\u6570\u636E\u5C55\u793A",
2266
- status: "100%",
2267
- install(app) {
2268
- app.component(Comment.name, Comment);
2269
- }
2270
- };
2271
2197
  const countdownProps = {
2272
2198
  value: {
2273
2199
  type: Number,
@@ -2712,6 +2638,12 @@ const formItemProps = {
2712
2638
  type: Boolean,
2713
2639
  default: false
2714
2640
  },
2641
+ messageType: {
2642
+ type: String
2643
+ },
2644
+ popPosition: {
2645
+ type: Array
2646
+ },
2715
2647
  rules: {
2716
2648
  type: [Object, Array]
2717
2649
  }
@@ -3625,14 +3557,14 @@ var DrawerOverlay = defineComponent({
3625
3557
  function lockScroll() {
3626
3558
  if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
3627
3559
  const scrollTop = document.documentElement.scrollTop;
3628
- const style2 = document.documentElement.getAttribute("style");
3560
+ const style = document.documentElement.getAttribute("style");
3629
3561
  document.documentElement.style.position = "fixed";
3630
3562
  document.documentElement.style.top = `-${scrollTop}px`;
3631
3563
  document.documentElement.style.width = document.documentElement.style.width || "100%";
3632
3564
  document.documentElement.style.overflowY = "scroll";
3633
3565
  return () => {
3634
- if (style2) {
3635
- document.documentElement.setAttribute("style", style2);
3566
+ if (style) {
3567
+ document.documentElement.setAttribute("style", style);
3636
3568
  } else {
3637
3569
  document.documentElement.removeAttribute("style");
3638
3570
  }
@@ -4347,7 +4279,8 @@ const editableSelectProps = {
4347
4279
  default: "Search"
4348
4280
  },
4349
4281
  modelValue: {
4350
- type: String
4282
+ type: String,
4283
+ default: ""
4351
4284
  },
4352
4285
  width: {
4353
4286
  type: Number
@@ -4390,6 +4323,7 @@ const useInput = (inputValue, ctx2) => {
4390
4323
  const handleInput = (event) => {
4391
4324
  const value = event.target.value;
4392
4325
  inputValue.value = value;
4326
+ ctx2.emit("update:modelValue", value);
4393
4327
  onInputChange(value);
4394
4328
  };
4395
4329
  return {
@@ -4438,14 +4372,11 @@ const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, op
4438
4372
  };
4439
4373
  const handleEnter = () => {
4440
4374
  const len = filteredOptions.value.length;
4441
- if (!visible.value) {
4442
- toggleMenu();
4443
- } else if (!len || len === 1) {
4444
- closeMenu();
4445
- } else if (len && len !== 1) {
4446
- handleClick(filteredOptions.value[hoverIndex.value]);
4447
- closeMenu();
4375
+ if (!visible.value || !len) {
4376
+ return toggleMenu();
4448
4377
  }
4378
+ len && len === 1 ? handleClick(filteredOptions.value[0]) : handleClick(filteredOptions.value[hoverIndex.value]);
4379
+ return closeMenu();
4449
4380
  };
4450
4381
  const handleKeyboardNavigation = (direction) => {
4451
4382
  const len = filteredOptions.value.length;
@@ -4483,7 +4414,6 @@ const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, op
4483
4414
  const keyCode = event.key || event.code;
4484
4415
  switch (keyCode) {
4485
4416
  case "Escape":
4486
- event.preventDefault();
4487
4417
  handleEscape();
4488
4418
  break;
4489
4419
  case "Enter":
@@ -4505,9 +4435,9 @@ var EditableSelect = defineComponent({
4505
4435
  setup(props, ctx2) {
4506
4436
  const dropdownRef = ref();
4507
4437
  const origin = ref();
4508
- const position = ref(["bottom", "left"]);
4438
+ const position = ref(["bottom"]);
4509
4439
  const visible = ref(false);
4510
- const inputValue = ref(props.modelValue || "");
4440
+ const inputValue = ref(props.modelValue);
4511
4441
  const loading2 = ref(props.loading);
4512
4442
  const normalizeOptions = computed(() => {
4513
4443
  return props.options.map((option2) => {
@@ -4582,6 +4512,9 @@ var EditableSelect = defineComponent({
4582
4512
  const selectCls = className$1("devui-editable-select devui-form-group devui-has-feedback", {
4583
4513
  "devui-select-open": visible.value === true
4584
4514
  });
4515
+ const inputCls = className$1("devui-form-control devui-dropdown-origin", {
4516
+ "devui-dropdown-origin-open": visible.value === true
4517
+ });
4585
4518
  return withDirectives(createVNode("div", {
4586
4519
  "class": selectCls,
4587
4520
  "ref": origin,
@@ -4589,7 +4522,7 @@ var EditableSelect = defineComponent({
4589
4522
  width: props.width + "px"
4590
4523
  }
4591
4524
  }, [createVNode("input", {
4592
- "class": "devui-form-control devui-dropdown-origin devui-dropdown-origin-open",
4525
+ "class": inputCls,
4593
4526
  "onClick": withModifiers(toggleMenu, ["self"]),
4594
4527
  "onInput": handleInput,
4595
4528
  "onKeydown": handleKeydown,
@@ -4611,12 +4544,11 @@ var EditableSelect = defineComponent({
4611
4544
  "hasBackdrop": false
4612
4545
  }, {
4613
4546
  default: () => [createVNode("div", {
4614
- "class": "devui-editable-select-dropdown",
4615
4547
  "style": {
4616
4548
  width: props.width + "px"
4617
4549
  }
4618
4550
  }, [withDirectives(createVNode("div", {
4619
- "class": "devui-dropdown-menu"
4551
+ "class": "devui-dropdown-menu "
4620
4552
  }, [createVNode("ul", {
4621
4553
  "ref": dropdownRef,
4622
4554
  "class": "devui-list-unstyled scroll-height",
@@ -4649,22 +4581,6 @@ var EditableSelectInstall = {
4649
4581
  app.component(EditableSelect.name, EditableSelect);
4650
4582
  }
4651
4583
  };
4652
- function mitt(n) {
4653
- return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
4654
- var i = n.get(t);
4655
- i ? i.push(e) : n.set(t, [e]);
4656
- }, off: function(t, e) {
4657
- var i = n.get(t);
4658
- i && (e ? i.splice(i.indexOf(e) >>> 0, 1) : n.set(t, []));
4659
- }, emit: function(t, e) {
4660
- var i = n.get(t);
4661
- i && i.slice().map(function(n2) {
4662
- n2(e);
4663
- }), (i = n.get("*")) && i.slice().map(function(n2) {
4664
- n2(t, e);
4665
- });
4666
- } };
4667
- }
4668
4584
  const formProps = {
4669
4585
  data: {
4670
4586
  type: Object,
@@ -4685,27 +4601,16 @@ const formProps = {
4685
4601
  rules: {
4686
4602
  type: Object
4687
4603
  },
4688
- messageShowType: {
4604
+ messageType: {
4689
4605
  type: String,
4690
4606
  default: "popover"
4607
+ },
4608
+ popPosition: {
4609
+ type: Array,
4610
+ default: ["right", "bottom"]
4691
4611
  }
4692
4612
  };
4693
- const dFormEvents = {
4694
- addField: "d.form.addField",
4695
- removeField: "d.form.removeField"
4696
- };
4697
4613
  const FORM_TOKEN = Symbol("dForm");
4698
- var eventBus = mitt();
4699
- const EventBus = eventBus;
4700
- function isObject(obj) {
4701
- return Object.prototype.toString.call(obj).slice(8, -1) === "Object";
4702
- }
4703
- function hasKey(obj, key) {
4704
- if (!isObject(obj)) {
4705
- return false;
4706
- }
4707
- return Object.prototype.hasOwnProperty.call(obj, key);
4708
- }
4709
4614
  function createBem(namespace, element, modifier) {
4710
4615
  let cls = namespace;
4711
4616
  if (element) {
@@ -5481,7 +5386,7 @@ var lodash = { exports: {} };
5481
5386
  function object4() {
5482
5387
  }
5483
5388
  return function(proto) {
5484
- if (!isObject2(proto)) {
5389
+ if (!isObject(proto)) {
5485
5390
  return {};
5486
5391
  }
5487
5392
  if (objectCreate) {
@@ -5843,7 +5748,7 @@ var lodash = { exports: {} };
5843
5748
  if (result3 !== undefined$1) {
5844
5749
  return result3;
5845
5750
  }
5846
- if (!isObject2(value)) {
5751
+ if (!isObject(value)) {
5847
5752
  return value;
5848
5753
  }
5849
5754
  var isArr = isArray(value);
@@ -6190,7 +6095,7 @@ var lodash = { exports: {} };
6190
6095
  return true;
6191
6096
  }
6192
6097
  function baseIsNative(value) {
6193
- if (!isObject2(value) || isMasked(value)) {
6098
+ if (!isObject(value) || isMasked(value)) {
6194
6099
  return false;
6195
6100
  }
6196
6101
  var pattern4 = isFunction(value) ? reIsNative : reIsHostCtor;
@@ -6230,7 +6135,7 @@ var lodash = { exports: {} };
6230
6135
  return result3;
6231
6136
  }
6232
6137
  function baseKeysIn(object4) {
6233
- if (!isObject2(object4)) {
6138
+ if (!isObject(object4)) {
6234
6139
  return nativeKeysIn(object4);
6235
6140
  }
6236
6141
  var isProto = isPrototype(object4), result3 = [];
@@ -6275,7 +6180,7 @@ var lodash = { exports: {} };
6275
6180
  }
6276
6181
  baseFor(source, function(srcValue, key) {
6277
6182
  stack || (stack = new Stack());
6278
- if (isObject2(srcValue)) {
6183
+ if (isObject(srcValue)) {
6279
6184
  baseMergeDeep(object4, source, key, srcIndex, baseMerge, customizer, stack);
6280
6185
  } else {
6281
6186
  var newValue = customizer ? customizer(safeGet(object4, key), srcValue, key + "", object4, source, stack) : undefined$1;
@@ -6315,7 +6220,7 @@ var lodash = { exports: {} };
6315
6220
  newValue = objValue;
6316
6221
  if (isArguments(objValue)) {
6317
6222
  newValue = toPlainObject(objValue);
6318
- } else if (!isObject2(objValue) || isFunction(objValue)) {
6223
+ } else if (!isObject(objValue) || isFunction(objValue)) {
6319
6224
  newValue = initCloneObject(srcValue);
6320
6225
  }
6321
6226
  } else {
@@ -6454,7 +6359,7 @@ var lodash = { exports: {} };
6454
6359
  return shuffleSelf(array4, baseClamp(n, 0, array4.length));
6455
6360
  }
6456
6361
  function baseSet(object4, path, value, customizer) {
6457
- if (!isObject2(object4)) {
6362
+ if (!isObject(object4)) {
6458
6363
  return object4;
6459
6364
  }
6460
6365
  path = castPath(path, object4);
@@ -6468,7 +6373,7 @@ var lodash = { exports: {} };
6468
6373
  var objValue = nested[key];
6469
6374
  newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
6470
6375
  if (newValue === undefined$1) {
6471
- newValue = isObject2(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
6376
+ newValue = isObject(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
6472
6377
  }
6473
6378
  }
6474
6379
  assignValue(nested, key, newValue);
@@ -6918,7 +6823,7 @@ var lodash = { exports: {} };
6918
6823
  return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
6919
6824
  }
6920
6825
  var thisBinding = baseCreate(Ctor.prototype), result3 = Ctor.apply(thisBinding, args);
6921
- return isObject2(result3) ? result3 : thisBinding;
6826
+ return isObject(result3) ? result3 : thisBinding;
6922
6827
  };
6923
6828
  }
6924
6829
  function createCurry(func, bitmask, arity) {
@@ -7232,7 +7137,7 @@ var lodash = { exports: {} };
7232
7137
  return objValue;
7233
7138
  }
7234
7139
  function customDefaultsMerge(objValue, srcValue, key, object4, source, stack) {
7235
- if (isObject2(objValue) && isObject2(srcValue)) {
7140
+ if (isObject(objValue) && isObject(srcValue)) {
7236
7141
  stack.set(srcValue, objValue);
7237
7142
  baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack);
7238
7143
  stack["delete"](srcValue);
@@ -7580,7 +7485,7 @@ var lodash = { exports: {} };
7580
7485
  return !!length && (type4 == "number" || type4 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
7581
7486
  }
7582
7487
  function isIterateeCall(value, index2, object4) {
7583
- if (!isObject2(object4)) {
7488
+ if (!isObject(object4)) {
7584
7489
  return false;
7585
7490
  }
7586
7491
  var type4 = typeof index2;
@@ -7623,7 +7528,7 @@ var lodash = { exports: {} };
7623
7528
  return value === proto;
7624
7529
  }
7625
7530
  function isStrictComparable(value) {
7626
- return value === value && !isObject2(value);
7531
+ return value === value && !isObject(value);
7627
7532
  }
7628
7533
  function matchesStrictComparable(key, srcValue) {
7629
7534
  return function(object4) {
@@ -8505,7 +8410,7 @@ var lodash = { exports: {} };
8505
8410
  throw new TypeError2(FUNC_ERROR_TEXT);
8506
8411
  }
8507
8412
  wait = toNumber(wait) || 0;
8508
- if (isObject2(options)) {
8413
+ if (isObject(options)) {
8509
8414
  leading = !!options.leading;
8510
8415
  maxing = "maxWait" in options;
8511
8416
  maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
@@ -8675,7 +8580,7 @@ var lodash = { exports: {} };
8675
8580
  if (typeof func != "function") {
8676
8581
  throw new TypeError2(FUNC_ERROR_TEXT);
8677
8582
  }
8678
- if (isObject2(options)) {
8583
+ if (isObject(options)) {
8679
8584
  leading = "leading" in options ? !!options.leading : leading;
8680
8585
  trailing = "trailing" in options ? !!options.trailing : trailing;
8681
8586
  }
@@ -8783,7 +8688,7 @@ var lodash = { exports: {} };
8783
8688
  return typeof value == "number" && nativeIsFinite(value);
8784
8689
  }
8785
8690
  function isFunction(value) {
8786
- if (!isObject2(value)) {
8691
+ if (!isObject(value)) {
8787
8692
  return false;
8788
8693
  }
8789
8694
  var tag2 = baseGetTag(value);
@@ -8795,7 +8700,7 @@ var lodash = { exports: {} };
8795
8700
  function isLength(value) {
8796
8701
  return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
8797
8702
  }
8798
- function isObject2(value) {
8703
+ function isObject(value) {
8799
8704
  var type4 = typeof value;
8800
8705
  return value != null && (type4 == "object" || type4 == "function");
8801
8706
  }
@@ -8902,9 +8807,9 @@ var lodash = { exports: {} };
8902
8807
  if (isSymbol(value)) {
8903
8808
  return NAN;
8904
8809
  }
8905
- if (isObject2(value)) {
8810
+ if (isObject(value)) {
8906
8811
  var other = typeof value.valueOf == "function" ? value.valueOf() : value;
8907
- value = isObject2(other) ? other + "" : other;
8812
+ value = isObject(other) ? other + "" : other;
8908
8813
  }
8909
8814
  if (typeof value != "string") {
8910
8815
  return value === 0 ? value : +value;
@@ -9125,7 +9030,7 @@ var lodash = { exports: {} };
9125
9030
  var Ctor = object4 && object4.constructor;
9126
9031
  if (isArrLike) {
9127
9032
  accumulator = isArr ? new Ctor() : [];
9128
- } else if (isObject2(object4)) {
9033
+ } else if (isObject(object4)) {
9129
9034
  accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object4)) : {};
9130
9035
  } else {
9131
9036
  accumulator = {};
@@ -9407,7 +9312,7 @@ var lodash = { exports: {} };
9407
9312
  }
9408
9313
  function truncate(string3, options) {
9409
9314
  var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
9410
- if (isObject2(options)) {
9315
+ if (isObject(options)) {
9411
9316
  var separator2 = "separator" in options ? options.separator : separator2;
9412
9317
  length = "length" in options ? toInteger(options.length) : length;
9413
9318
  omission = "omission" in options ? baseToString(options.omission) : omission;
@@ -9537,13 +9442,13 @@ var lodash = { exports: {} };
9537
9442
  });
9538
9443
  function mixin(object4, source, options) {
9539
9444
  var props = keys(source), methodNames = baseFunctions(source, props);
9540
- if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) {
9445
+ if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
9541
9446
  options = source;
9542
9447
  source = object4;
9543
9448
  object4 = this;
9544
9449
  methodNames = baseFunctions(source, keys(source));
9545
9450
  }
9546
- var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object4);
9451
+ var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object4);
9547
9452
  arrayEach(methodNames, function(methodName) {
9548
9453
  var func = source[methodName];
9549
9454
  object4[methodName] = func;
@@ -9889,7 +9794,7 @@ var lodash = { exports: {} };
9889
9794
  lodash2.isNil = isNil;
9890
9795
  lodash2.isNull = isNull;
9891
9796
  lodash2.isNumber = isNumber;
9892
- lodash2.isObject = isObject2;
9797
+ lodash2.isObject = isObject;
9893
9798
  lodash2.isObjectLike = isObjectLike;
9894
9799
  lodash2.isPlainObject = isPlainObject;
9895
9800
  lodash2.isRegExp = isRegExp;
@@ -10200,16 +10105,8 @@ function useFormValidation(itemContexts) {
10200
10105
  var Form = defineComponent({
10201
10106
  name: "DForm",
10202
10107
  props: formProps,
10203
- emits: ["submit"],
10204
10108
  setup(props, ctx2) {
10205
- const formMitt = mitt();
10206
10109
  const ns = useNamespace("form");
10207
- const {
10208
- data,
10209
- layout: layout2,
10210
- labelSize,
10211
- labelAlign
10212
- } = toRefs(props);
10213
10110
  const {
10214
10111
  itemContexts,
10215
10112
  addItemContext,
@@ -10219,34 +10116,17 @@ var Form = defineComponent({
10219
10116
  validate,
10220
10117
  validateFields
10221
10118
  } = useFormValidation(itemContexts);
10222
- formMitt.on(dFormEvents.addField, (field) => {
10223
- });
10224
- formMitt.on(dFormEvents.removeField, (field) => {
10225
- if (field.prop)
10226
- ;
10227
- });
10228
- provide(FORM_TOKEN, reactive({
10229
- formData: data,
10230
- formMitt,
10231
- labelData: {
10232
- layout: layout2,
10233
- labelSize,
10234
- labelAlign
10235
- },
10236
- rules: props.rules,
10237
- messageShowType: "popover",
10119
+ const onSubmit = (e) => {
10120
+ e.preventDefault();
10121
+ };
10122
+ provide(FORM_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
10238
10123
  addItemContext,
10239
10124
  removeItemContext
10240
- }));
10125
+ })));
10241
10126
  ctx2.expose({
10242
10127
  validate,
10243
10128
  validateFields
10244
10129
  });
10245
- const onSubmit = (e) => {
10246
- e.preventDefault();
10247
- ctx2.emit("submit", e);
10248
- EventBus.emit(`formSubmit:${props.name}`);
10249
- };
10250
10130
  return () => {
10251
10131
  var _a, _b;
10252
10132
  return createVNode("form", {
@@ -10554,17 +10434,18 @@ function HelpTipsIcon() {
10554
10434
  }, null)])])]);
10555
10435
  }
10556
10436
  function useFormLabel() {
10557
- const { labelData } = inject(FORM_TOKEN);
10437
+ const formContext = inject(FORM_TOKEN);
10558
10438
  const formItemContext = inject(FORM_ITEM_TOKEN);
10559
10439
  const ns = useNamespace("form");
10560
10440
  const labelClasses = computed(() => ({
10561
10441
  [`${ns.e("label")}`]: true,
10562
- [`${ns.em("label", "vertical")}`]: labelData.layout === "vertical",
10563
- [`${ns.em("label", labelData.labelSize)}`]: labelData.layout === "horizontal",
10564
- [`${ns.em("label", labelData.labelAlign)}`]: labelData.layout === "horizontal"
10442
+ [`${ns.em("label", "vertical")}`]: formContext.layout === "vertical",
10443
+ [`${ns.em("label", formContext.labelSize)}`]: formContext.layout === "horizontal",
10444
+ [`${ns.em("label", formContext.labelAlign)}`]: formContext.layout === "horizontal"
10565
10445
  }));
10566
10446
  const labelInnerClasses = computed(() => ({
10567
- [`${ns.em("label", "required")}`]: formItemContext.required
10447
+ [`${ns.e("label-span")}`]: true,
10448
+ [`${ns.em("label", "required")}`]: formItemContext.isRequired
10568
10449
  }));
10569
10450
  return { labelClasses, labelInnerClasses };
10570
10451
  }
@@ -11049,7 +10930,7 @@ var pattern$1 = function pattern(rule, value, source, errors, options) {
11049
10930
  }
11050
10931
  }
11051
10932
  };
11052
- var rules$1 = {
10933
+ var rules = {
11053
10934
  required: required$1,
11054
10935
  whitespace,
11055
10936
  type: type$1,
@@ -11064,13 +10945,13 @@ var string = function string2(rule, value, callback, source, options) {
11064
10945
  if (isEmptyValue(value, "string") && !rule.required) {
11065
10946
  return callback();
11066
10947
  }
11067
- rules$1.required(rule, value, source, errors, options, "string");
10948
+ rules.required(rule, value, source, errors, options, "string");
11068
10949
  if (!isEmptyValue(value, "string")) {
11069
- rules$1.type(rule, value, source, errors, options);
11070
- rules$1.range(rule, value, source, errors, options);
11071
- rules$1.pattern(rule, value, source, errors, options);
10950
+ rules.type(rule, value, source, errors, options);
10951
+ rules.range(rule, value, source, errors, options);
10952
+ rules.pattern(rule, value, source, errors, options);
11072
10953
  if (rule.whitespace === true) {
11073
- rules$1.whitespace(rule, value, source, errors, options);
10954
+ rules.whitespace(rule, value, source, errors, options);
11074
10955
  }
11075
10956
  }
11076
10957
  }
@@ -11083,9 +10964,9 @@ var method2 = function method3(rule, value, callback, source, options) {
11083
10964
  if (isEmptyValue(value) && !rule.required) {
11084
10965
  return callback();
11085
10966
  }
11086
- rules$1.required(rule, value, source, errors, options);
10967
+ rules.required(rule, value, source, errors, options);
11087
10968
  if (value !== void 0) {
11088
- rules$1.type(rule, value, source, errors, options);
10969
+ rules.type(rule, value, source, errors, options);
11089
10970
  }
11090
10971
  }
11091
10972
  callback(errors);
@@ -11100,10 +10981,10 @@ var number2 = function number3(rule, value, callback, source, options) {
11100
10981
  if (isEmptyValue(value) && !rule.required) {
11101
10982
  return callback();
11102
10983
  }
11103
- rules$1.required(rule, value, source, errors, options);
10984
+ rules.required(rule, value, source, errors, options);
11104
10985
  if (value !== void 0) {
11105
- rules$1.type(rule, value, source, errors, options);
11106
- rules$1.range(rule, value, source, errors, options);
10986
+ rules.type(rule, value, source, errors, options);
10987
+ rules.range(rule, value, source, errors, options);
11107
10988
  }
11108
10989
  }
11109
10990
  callback(errors);
@@ -11115,9 +10996,9 @@ var _boolean = function _boolean2(rule, value, callback, source, options) {
11115
10996
  if (isEmptyValue(value) && !rule.required) {
11116
10997
  return callback();
11117
10998
  }
11118
- rules$1.required(rule, value, source, errors, options);
10999
+ rules.required(rule, value, source, errors, options);
11119
11000
  if (value !== void 0) {
11120
- rules$1.type(rule, value, source, errors, options);
11001
+ rules.type(rule, value, source, errors, options);
11121
11002
  }
11122
11003
  }
11123
11004
  callback(errors);
@@ -11129,9 +11010,9 @@ var regexp2 = function regexp3(rule, value, callback, source, options) {
11129
11010
  if (isEmptyValue(value) && !rule.required) {
11130
11011
  return callback();
11131
11012
  }
11132
- rules$1.required(rule, value, source, errors, options);
11013
+ rules.required(rule, value, source, errors, options);
11133
11014
  if (!isEmptyValue(value)) {
11134
- rules$1.type(rule, value, source, errors, options);
11015
+ rules.type(rule, value, source, errors, options);
11135
11016
  }
11136
11017
  }
11137
11018
  callback(errors);
@@ -11143,10 +11024,10 @@ var integer2 = function integer3(rule, value, callback, source, options) {
11143
11024
  if (isEmptyValue(value) && !rule.required) {
11144
11025
  return callback();
11145
11026
  }
11146
- rules$1.required(rule, value, source, errors, options);
11027
+ rules.required(rule, value, source, errors, options);
11147
11028
  if (value !== void 0) {
11148
- rules$1.type(rule, value, source, errors, options);
11149
- rules$1.range(rule, value, source, errors, options);
11029
+ rules.type(rule, value, source, errors, options);
11030
+ rules.range(rule, value, source, errors, options);
11150
11031
  }
11151
11032
  }
11152
11033
  callback(errors);
@@ -11158,10 +11039,10 @@ var floatFn = function floatFn2(rule, value, callback, source, options) {
11158
11039
  if (isEmptyValue(value) && !rule.required) {
11159
11040
  return callback();
11160
11041
  }
11161
- rules$1.required(rule, value, source, errors, options);
11042
+ rules.required(rule, value, source, errors, options);
11162
11043
  if (value !== void 0) {
11163
- rules$1.type(rule, value, source, errors, options);
11164
- rules$1.range(rule, value, source, errors, options);
11044
+ rules.type(rule, value, source, errors, options);
11045
+ rules.range(rule, value, source, errors, options);
11165
11046
  }
11166
11047
  }
11167
11048
  callback(errors);
@@ -11173,10 +11054,10 @@ var array2 = function array3(rule, value, callback, source, options) {
11173
11054
  if ((value === void 0 || value === null) && !rule.required) {
11174
11055
  return callback();
11175
11056
  }
11176
- rules$1.required(rule, value, source, errors, options, "array");
11057
+ rules.required(rule, value, source, errors, options, "array");
11177
11058
  if (value !== void 0 && value !== null) {
11178
- rules$1.type(rule, value, source, errors, options);
11179
- rules$1.range(rule, value, source, errors, options);
11059
+ rules.type(rule, value, source, errors, options);
11060
+ rules.range(rule, value, source, errors, options);
11180
11061
  }
11181
11062
  }
11182
11063
  callback(errors);
@@ -11188,9 +11069,9 @@ var object2 = function object3(rule, value, callback, source, options) {
11188
11069
  if (isEmptyValue(value) && !rule.required) {
11189
11070
  return callback();
11190
11071
  }
11191
- rules$1.required(rule, value, source, errors, options);
11072
+ rules.required(rule, value, source, errors, options);
11192
11073
  if (value !== void 0) {
11193
- rules$1.type(rule, value, source, errors, options);
11074
+ rules.type(rule, value, source, errors, options);
11194
11075
  }
11195
11076
  }
11196
11077
  callback(errors);
@@ -11203,9 +11084,9 @@ var enumerable2 = function enumerable3(rule, value, callback, source, options) {
11203
11084
  if (isEmptyValue(value) && !rule.required) {
11204
11085
  return callback();
11205
11086
  }
11206
- rules$1.required(rule, value, source, errors, options);
11087
+ rules.required(rule, value, source, errors, options);
11207
11088
  if (value !== void 0) {
11208
- rules$1[ENUM](rule, value, source, errors, options);
11089
+ rules[ENUM](rule, value, source, errors, options);
11209
11090
  }
11210
11091
  }
11211
11092
  callback(errors);
@@ -11217,9 +11098,9 @@ var pattern2 = function pattern3(rule, value, callback, source, options) {
11217
11098
  if (isEmptyValue(value, "string") && !rule.required) {
11218
11099
  return callback();
11219
11100
  }
11220
- rules$1.required(rule, value, source, errors, options);
11101
+ rules.required(rule, value, source, errors, options);
11221
11102
  if (!isEmptyValue(value, "string")) {
11222
- rules$1.pattern(rule, value, source, errors, options);
11103
+ rules.pattern(rule, value, source, errors, options);
11223
11104
  }
11224
11105
  }
11225
11106
  callback(errors);
@@ -11231,7 +11112,7 @@ var date2 = function date3(rule, value, callback, source, options) {
11231
11112
  if (isEmptyValue(value, "date") && !rule.required) {
11232
11113
  return callback();
11233
11114
  }
11234
- rules$1.required(rule, value, source, errors, options);
11115
+ rules.required(rule, value, source, errors, options);
11235
11116
  if (!isEmptyValue(value, "date")) {
11236
11117
  var dateObject;
11237
11118
  if (value instanceof Date) {
@@ -11239,9 +11120,9 @@ var date2 = function date3(rule, value, callback, source, options) {
11239
11120
  } else {
11240
11121
  dateObject = new Date(value);
11241
11122
  }
11242
- rules$1.type(rule, dateObject, source, errors, options);
11123
+ rules.type(rule, dateObject, source, errors, options);
11243
11124
  if (dateObject) {
11244
- rules$1.range(rule, dateObject.getTime(), source, errors, options);
11125
+ rules.range(rule, dateObject.getTime(), source, errors, options);
11245
11126
  }
11246
11127
  }
11247
11128
  }
@@ -11250,7 +11131,7 @@ var date2 = function date3(rule, value, callback, source, options) {
11250
11131
  var required2 = function required3(rule, value, callback, source, options) {
11251
11132
  var errors = [];
11252
11133
  var type4 = Array.isArray(value) ? "array" : typeof value;
11253
- rules$1.required(rule, value, source, errors, options, type4);
11134
+ rules.required(rule, value, source, errors, options, type4);
11254
11135
  callback(errors);
11255
11136
  };
11256
11137
  var type2 = function type3(rule, value, callback, source, options) {
@@ -11261,9 +11142,9 @@ var type2 = function type3(rule, value, callback, source, options) {
11261
11142
  if (isEmptyValue(value, ruleType) && !rule.required) {
11262
11143
  return callback();
11263
11144
  }
11264
- rules$1.required(rule, value, source, errors, options, ruleType);
11145
+ rules.required(rule, value, source, errors, options, ruleType);
11265
11146
  if (!isEmptyValue(value, ruleType)) {
11266
- rules$1.type(rule, value, source, errors, options);
11147
+ rules.type(rule, value, source, errors, options);
11267
11148
  }
11268
11149
  }
11269
11150
  callback(errors);
@@ -11275,7 +11156,7 @@ var any = function any2(rule, value, callback, source, options) {
11275
11156
  if (isEmptyValue(value) && !rule.required) {
11276
11157
  return callback();
11277
11158
  }
11278
- rules$1.required(rule, value, source, errors, options);
11159
+ rules.required(rule, value, source, errors, options);
11279
11160
  }
11280
11161
  callback(errors);
11281
11162
  };
@@ -11599,15 +11480,16 @@ Schema.register = function register(type4, validator) {
11599
11480
  Schema.warning = warning;
11600
11481
  Schema.messages = messages;
11601
11482
  Schema.validators = validators;
11602
- function useFormItem() {
11603
- const formContext = reactive(inject(FORM_TOKEN));
11604
- const labelData = reactive(formContext.labelData);
11483
+ function useFormItem(messageType, _rules, validateState) {
11484
+ const formContext = inject(FORM_TOKEN);
11605
11485
  const ns = useNamespace("form");
11606
11486
  const itemClasses = computed(() => ({
11607
- [`${ns.em("item", "horizontal")}`]: labelData.layout === "horizontal",
11608
- [`${ns.em("item", "vertical")}`]: labelData.layout === "vertical"
11487
+ [`${ns.em("item", "horizontal")}`]: formContext.layout === "horizontal",
11488
+ [`${ns.em("item", "vertical")}`]: formContext.layout === "vertical",
11489
+ [`${ns.em("item", "error")}`]: messageType.value === "text" && validateState.value === "error"
11609
11490
  }));
11610
- return { itemClasses };
11491
+ const isRequired = computed(() => _rules.value.some((rule) => Boolean(rule.required)));
11492
+ return { itemClasses, isRequired };
11611
11493
  }
11612
11494
  function useFormItemRule(props) {
11613
11495
  const formContext = inject(FORM_TOKEN);
@@ -11635,7 +11517,7 @@ function useFormItemValidate(props, _rules) {
11635
11517
  return typeof props.field === "string" ? props.field : "";
11636
11518
  });
11637
11519
  const fieldValue = computed(() => {
11638
- const formData = formContext.formData;
11520
+ const formData = formContext.data;
11639
11521
  if (!formData || !props.field) {
11640
11522
  return;
11641
11523
  }
@@ -11702,9 +11584,15 @@ var FormItem = defineComponent({
11702
11584
  props: formItemProps,
11703
11585
  setup(props, ctx2) {
11704
11586
  const formContext = inject(FORM_TOKEN);
11705
- const {
11706
- itemClasses
11707
- } = useFormItem();
11587
+ const _a = toRefs(props), {
11588
+ messageType: itemMessageType,
11589
+ popPosition: itemPopPosition
11590
+ } = _a, otherProps = __objRest(_a, [
11591
+ "messageType",
11592
+ "popPosition"
11593
+ ]);
11594
+ const messageType = computed(() => (itemMessageType == null ? void 0 : itemMessageType.value) || formContext.messageType);
11595
+ const popPosition = computed(() => (itemPopPosition == null ? void 0 : itemPopPosition.value) || formContext.popPosition);
11708
11596
  const {
11709
11597
  _rules
11710
11598
  } = useFormItemRule(props);
@@ -11713,7 +11601,14 @@ var FormItem = defineComponent({
11713
11601
  validateMessage,
11714
11602
  validate
11715
11603
  } = useFormItemValidate(props, _rules);
11716
- const context = reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
11604
+ const {
11605
+ itemClasses,
11606
+ isRequired
11607
+ } = useFormItem(messageType, _rules, validateState);
11608
+ const context = reactive(__spreadProps(__spreadValues({}, otherProps), {
11609
+ messageType,
11610
+ popPosition,
11611
+ isRequired,
11717
11612
  validateState,
11718
11613
  validateMessage,
11719
11614
  validate
@@ -11728,10 +11623,10 @@ var FormItem = defineComponent({
11728
11623
  formContext == null ? void 0 : formContext.removeItemContext(context);
11729
11624
  });
11730
11625
  return () => {
11731
- var _a, _b;
11626
+ var _a2, _b;
11732
11627
  return createVNode("div", {
11733
11628
  "class": itemClasses.value
11734
- }, [(_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a)]);
11629
+ }, [(_b = (_a2 = ctx2.slots).default) == null ? void 0 : _b.call(_a2)]);
11735
11630
  };
11736
11631
  }
11737
11632
  });
@@ -11744,18 +11639,25 @@ const formControlProps = {
11744
11639
  default: ""
11745
11640
  }
11746
11641
  };
11642
+ var PopoverInstall = {
11643
+ title: "Popover \u60AC\u6D6E\u63D0\u793A",
11644
+ category: "\u53CD\u9988",
11645
+ status: "100%",
11646
+ install(app) {
11647
+ app.component(Popover.name, Popover);
11648
+ }
11649
+ };
11747
11650
  function useFormControl(props) {
11748
11651
  const formContext = inject(FORM_TOKEN);
11749
- const labelData = reactive(formContext.labelData);
11750
11652
  const ns = useNamespace("form");
11751
11653
  const { feedbackStatus } = toRefs(props);
11752
11654
  const controlClasses = computed(() => ({
11753
11655
  [`${ns.e("control")}`]: true,
11754
- [`${ns.em("control", "horizontal")}`]: labelData.layout === "horizontal"
11656
+ [`${ns.em("control", "horizontal")}`]: formContext.layout === "horizontal"
11755
11657
  }));
11756
11658
  const controlContainerClasses = computed(() => ({
11757
11659
  [`${ns.e("control-container")}`]: true,
11758
- [`${ns.em("control-container", "horizontal")}`]: labelData.layout === "horizontal",
11660
+ [`${ns.em("control-container", "horizontal")}`]: formContext.layout === "horizontal",
11759
11661
  [`${ns.em("control-container", "has-feedback")}`]: Boolean(feedbackStatus.value),
11760
11662
  [`${ns.em("control-container", "feedback-error")}`]: Boolean(feedbackStatus.value === "error")
11761
11663
  }));
@@ -11763,8 +11665,11 @@ function useFormControl(props) {
11763
11665
  }
11764
11666
  function useFormControlValidate() {
11765
11667
  const formItemContext = inject(FORM_ITEM_TOKEN);
11668
+ const showPopover = computed(() => formItemContext.messageType === "popover" && formItemContext.validateState === "error");
11669
+ const showMessage = computed(() => formItemContext.messageType === "text" && formItemContext.validateState === "error");
11766
11670
  const errorMessage = computed(() => formItemContext.validateMessage);
11767
- return { errorMessage };
11671
+ const popPosition = computed(() => formItemContext.popPosition);
11672
+ return { showPopover, showMessage, errorMessage, popPosition };
11768
11673
  }
11769
11674
  var formControl = "";
11770
11675
  var FormControl = defineComponent({
@@ -11772,49 +11677,56 @@ var FormControl = defineComponent({
11772
11677
  props: formControlProps,
11773
11678
  setup(props, ctx2) {
11774
11679
  const formControl2 = ref();
11775
- const uid = lodash.exports.uniqueId("dfc-");
11776
11680
  const ns = useNamespace("form");
11777
11681
  const {
11778
11682
  controlClasses,
11779
11683
  controlContainerClasses
11780
11684
  } = useFormControl(props);
11781
11685
  const {
11782
- errorMessage
11686
+ showPopover,
11687
+ showMessage,
11688
+ errorMessage,
11689
+ popPosition
11783
11690
  } = useFormControlValidate();
11784
- return () => {
11785
- var _a, _b;
11786
- return createVNode("div", {
11787
- "class": controlClasses.value,
11788
- "ref": formControl2,
11789
- "data-uid": uid
11790
- }, [createVNode("div", {
11791
- "class": controlContainerClasses.value
11792
- }, [createVNode("div", {
11793
- "class": ns.e("control-content"),
11794
- "id": uid
11795
- }, [(_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a)])]), createVNode("div", {
11796
- "class": ns.e("control-info")
11797
- }, [errorMessage.value && createVNode("div", {
11798
- "class": "error-message"
11799
- }, [errorMessage.value]), props.extraInfo && createVNode("div", {
11800
- "class": ns.e("control-extra")
11801
- }, [props.extraInfo])])]);
11802
- };
11691
+ return () => createVNode("div", {
11692
+ "class": controlClasses.value,
11693
+ "ref": formControl2
11694
+ }, [createVNode("div", {
11695
+ "class": controlContainerClasses.value
11696
+ }, [createVNode(Popover, {
11697
+ "is-open": showPopover.value,
11698
+ "trigger": "manually",
11699
+ "content": errorMessage.value,
11700
+ "pop-type": "error",
11701
+ "position": popPosition.value
11702
+ }, {
11703
+ reference: () => {
11704
+ var _a, _b;
11705
+ return createVNode("div", {
11706
+ "class": ns.e("control-content")
11707
+ }, [(_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a)]);
11708
+ }
11709
+ })]), createVNode("div", {
11710
+ "class": ns.e("control-info")
11711
+ }, [showMessage.value && createVNode("div", {
11712
+ "class": "error-message"
11713
+ }, [errorMessage.value]), props.extraInfo && createVNode("div", {
11714
+ "class": ns.e("control-extra")
11715
+ }, [props.extraInfo])])]);
11803
11716
  }
11804
11717
  });
11805
11718
  var formOperation = "";
11806
11719
  var FormOperation = defineComponent({
11807
11720
  name: "DFormOperation",
11808
11721
  setup(props, ctx2) {
11809
- const formContext = reactive(inject(FORM_TOKEN));
11810
- const labelData = reactive(formContext.labelData);
11722
+ const formContext = inject(FORM_TOKEN);
11811
11723
  const LabelSizeMap = {
11812
11724
  sm: 80,
11813
11725
  md: 100,
11814
11726
  lg: 150
11815
11727
  };
11816
11728
  const styles = computed(() => ({
11817
- marginLeft: labelData.layout === "horizontal" ? `${LabelSizeMap[labelData.labelSize] + 16}px` : void 0
11729
+ marginLeft: formContext.layout === "horizontal" ? `${LabelSizeMap[formContext.labelSize] + 16}px` : void 0
11818
11730
  }));
11819
11731
  return () => {
11820
11732
  var _a, _b;
@@ -11825,360 +11737,12 @@ var FormOperation = defineComponent({
11825
11737
  };
11826
11738
  }
11827
11739
  });
11828
- var style = "";
11829
- function getAvaliableRuleObj(ruleName, value) {
11830
- if (!ruleName) {
11831
- console.error("[v-d-validate] validator's key is invalid");
11832
- return null;
11833
- }
11834
- switch (ruleName) {
11835
- case "maxlength":
11836
- return {
11837
- type: "string",
11838
- max: value,
11839
- asyncValidator: (rule, val) => {
11840
- return new Promise((resolve, reject) => {
11841
- if (val.length > value) {
11842
- reject("\u6700\u5927\u957F\u5EA6\u4E3A" + value);
11843
- } else {
11844
- resolve("\u6821\u9A8C\u901A\u8FC7");
11845
- }
11846
- });
11847
- }
11848
- };
11849
- case "minlength":
11850
- return {
11851
- type: "string",
11852
- min: value,
11853
- asyncValidator: (rule, val) => {
11854
- return new Promise((resolve, reject) => {
11855
- if (val.length < value) {
11856
- reject("\u6700\u5C0F\u957F\u5EA6\u4E3A" + value);
11857
- } else {
11858
- resolve("\u6821\u9A8C\u901A\u8FC7");
11859
- }
11860
- });
11861
- }
11862
- };
11863
- case "min":
11864
- return {
11865
- type: "number",
11866
- asyncValidator: (rule, val) => {
11867
- return new Promise((resolve, reject) => {
11868
- if (val < value) {
11869
- reject("\u6700\u5C0F\u503C\u4E3A" + value);
11870
- } else {
11871
- resolve("\u6821\u9A8C\u901A\u8FC7");
11872
- }
11873
- });
11874
- }
11875
- };
11876
- case "max":
11877
- return {
11878
- type: "number",
11879
- asyncValidator: (rule, val) => {
11880
- return new Promise((resolve, reject) => {
11881
- if (val > value) {
11882
- reject("\u6700\u5927\u503C\u4E3A" + value);
11883
- } else {
11884
- resolve("\u6821\u9A8C\u901A\u8FC7");
11885
- }
11886
- });
11887
- }
11888
- };
11889
- case "required":
11890
- return {
11891
- reqiured: true,
11892
- asyncValidator: (rule, val) => {
11893
- return new Promise((resolve, reject) => {
11894
- if (!val) {
11895
- reject("\u5FC5\u586B\u9879");
11896
- } else {
11897
- resolve("\u6821\u9A8C\u901A\u8FC7");
11898
- }
11899
- });
11900
- }
11901
- };
11902
- case "requiredTrue":
11903
- return {
11904
- asyncValidator: (rule, val) => {
11905
- return new Promise((resolve, reject) => {
11906
- if (!val) {
11907
- reject("\u5FC5\u987B\u4E3Atrue\u503C");
11908
- } else {
11909
- resolve("\u6821\u9A8C\u901A\u8FC7");
11910
- }
11911
- });
11912
- }
11913
- };
11914
- case "email":
11915
- return {
11916
- type: "email",
11917
- message: "\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E"
11918
- };
11919
- case "pattern":
11920
- return {
11921
- type: "regexp",
11922
- pattern: value,
11923
- message: "\u53EA\u80FD\u5305\u542B\u6570\u5B57\u4E0E\u5927\u5C0F\u5199\u5B57\u7B26",
11924
- validator: (rule, val) => value.test(val)
11925
- };
11926
- case "whitespace":
11927
- return {
11928
- message: "\u8F93\u5165\u4E0D\u80FD\u5168\u90E8\u4E3A\u7A7A\u683C\u6216\u7A7A\u5B57\u7B26",
11929
- validator: (rule, val) => !!val.trim()
11930
- };
11931
- default:
11932
- return {
11933
- [ruleName]: value
11934
- };
11935
- }
11936
- }
11937
- function getKeyValueOfObjectList(obj) {
11938
- const kvArr = [];
11939
- for (const key in obj) {
11940
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
11941
- kvArr.push({
11942
- key,
11943
- value: obj[key]
11944
- });
11945
- }
11946
- }
11947
- return kvArr;
11948
- }
11949
- function handleErrorStrategy(el) {
11950
- const classList = [...el.classList];
11951
- classList.push("devui-validate-rules-error-pristine");
11952
- el.setAttribute("class", classList.join(" "));
11953
- }
11954
- function handleErrorStrategyPass(el) {
11955
- const classList = [...el.classList];
11956
- const index2 = classList.indexOf("devui-validate-rules-error-pristine");
11957
- index2 !== -1 && classList.splice(index2, 1);
11958
- el.setAttribute("class", classList.join(" "));
11959
- }
11960
- function getFormControlUID(el) {
11961
- if (el.tagName.toLocaleLowerCase() === "body") {
11962
- return "";
11963
- }
11964
- if (el.parentElement.id.startsWith("dfc-")) {
11965
- return el.parentElement.id;
11966
- } else {
11967
- getFormControlUID(el.parentElement);
11968
- }
11969
- }
11970
- function handleValidateError({
11971
- el,
11972
- tipEl,
11973
- message = "",
11974
- isFormTag,
11975
- messageShowType,
11976
- dfcUID,
11977
- popPosition = "right-bottom",
11978
- updateOn
11979
- }) {
11980
- if (isFormTag && messageShowType === "toast") {
11981
- alert(message);
11982
- return;
11983
- }
11984
- if (!dfcUID) {
11985
- dfcUID = getFormControlUID(el);
11986
- }
11987
- if (messageShowType === "popover") {
11988
- EventBus.emit("showPopoverErrorMessage", {
11989
- showPopover: true,
11990
- message,
11991
- uid: dfcUID,
11992
- popPosition,
11993
- updateOn
11994
- });
11995
- return;
11996
- }
11997
- tipEl.innerText = "" + message;
11998
- tipEl.style.display = "inline-flex";
11999
- tipEl.setAttribute("class", "devui-validate-tip");
12000
- handleErrorStrategy(el);
12001
- }
12002
- function handleValidatePass(el, tipEl) {
12003
- tipEl.style.display = "none";
12004
- handleErrorStrategyPass(el);
12005
- }
12006
- function getRefName(binding) {
12007
- const _refs = binding.instance.$refs;
12008
- const refName = Object.keys(_refs)[0];
12009
- return refName;
12010
- }
12011
- function getFormName(binding) {
12012
- const _refs = binding.instance.$refs;
12013
- const key = Object.keys(_refs)[0];
12014
- return _refs[key]["name"];
12015
- }
12016
- function validateFn({
12017
- validator,
12018
- modelValue,
12019
- el,
12020
- tipEl,
12021
- isFormTag,
12022
- messageShowType,
12023
- dfcUID,
12024
- popPosition,
12025
- updateOn
12026
- }) {
12027
- validator.validate({ modelName: modelValue }).then(() => {
12028
- handleValidatePass(el, tipEl);
12029
- }).catch((err) => {
12030
- const { errors } = err;
12031
- if (!errors || errors.length === 0) {
12032
- return;
12033
- }
12034
- let msg = "";
12035
- if (typeof errors[0].message === "object") {
12036
- msg = errors[0].message.default;
12037
- } else {
12038
- msg = errors[0].message;
12039
- }
12040
- handleValidateError({ el, tipEl, message: msg, isFormTag, messageShowType, dfcUID, popPosition, updateOn });
12041
- });
12042
- }
12043
- function checkValidPopsition(positionStr) {
12044
- const validPosition = [
12045
- "left",
12046
- "right",
12047
- "top",
12048
- "bottom",
12049
- "left-top",
12050
- "left-bottom",
12051
- "top-left",
12052
- "top-right",
12053
- "right-top",
12054
- "right-bottom",
12055
- "bottom-left",
12056
- "bottom-right"
12057
- ];
12058
- const isValid = validPosition.includes(positionStr);
12059
- !isValid && console.warn(`invalid popPosition value '${positionStr}'.`);
12060
- return isValid;
12061
- }
12062
- var dValidateRules = {
12063
- mounted(el, binding, vnode) {
12064
- var _a;
12065
- const isFormTag = el.tagName === "FORM";
12066
- const dfcUID = el.parentNode.parentNode.parentElement.dataset.uid;
12067
- const refName = getRefName(binding);
12068
- const hasOptions = isObject(binding.value) && hasKey(binding.value, "options");
12069
- let { rules: bindingRules, options = {}, messageShowType = "popover" } = binding.value;
12070
- let { errorStrategy } = binding.value;
12071
- if (refName) {
12072
- messageShowType = (_a = binding.instance[refName]["messageShowType"]) != null ? _a : "popover";
12073
- }
12074
- let {
12075
- updateOn = "change",
12076
- errorStrategy: ErrorStrategy = "dirty",
12077
- asyncDebounceTime = 300,
12078
- popPosition = ["right", "bottom"]
12079
- } = options;
12080
- if (messageShowType === "popover") {
12081
- if (Array.isArray(popPosition)) {
12082
- popPosition = popPosition.length > 1 ? popPosition.join("-") : popPosition[0];
12083
- if (!checkValidPopsition(popPosition)) {
12084
- popPosition = "right-bottom";
12085
- }
12086
- } else if (!checkValidPopsition(popPosition)) {
12087
- popPosition = "right-bottom";
12088
- }
12089
- }
12090
- if (!errorStrategy) {
12091
- errorStrategy = ErrorStrategy;
12092
- }
12093
- let customRule = {};
12094
- if (hasOptions) {
12095
- customRule = bindingRules != null ? bindingRules : binding.value;
12096
- } else {
12097
- customRule = binding.value;
12098
- }
12099
- const isCustomValidator = customRule && isObject(customRule) && (hasKey(customRule, "validators") || hasKey(customRule, "asyncValidators"));
12100
- const rules2 = Array.isArray(customRule) ? customRule : [customRule];
12101
- const tipEl = document.createElement("span");
12102
- if (messageShowType !== "none") {
12103
- el.parentNode.append(tipEl);
12104
- }
12105
- const descriptor = {
12106
- modelName: []
12107
- };
12108
- rules2.forEach((rule) => {
12109
- const kvObjList = !Array.isArray(rule) && getKeyValueOfObjectList(rule);
12110
- let ruleObj = {};
12111
- let avaliableRuleObj = {};
12112
- kvObjList.forEach((item) => {
12113
- avaliableRuleObj = getAvaliableRuleObj(item.key, item.value);
12114
- ruleObj = __spreadValues(__spreadValues({}, ruleObj), avaliableRuleObj);
12115
- });
12116
- descriptor.modelName.push(ruleObj);
12117
- });
12118
- if (isCustomValidator) {
12119
- const { validators: validators2, asyncValidators } = customRule;
12120
- validators2 && validators2.forEach((item) => {
12121
- const ruleObj = {
12122
- message: (item == null ? void 0 : item.message) || "",
12123
- validator: (rule, value) => item.validator(rule, value)
12124
- };
12125
- descriptor.modelName.push(ruleObj);
12126
- });
12127
- asyncValidators && asyncValidators.forEach((item) => {
12128
- const ruleObj = {
12129
- message: (item == null ? void 0 : item.message) || "",
12130
- asyncValidator: (rule, value) => {
12131
- return new Promise(lodash.exports.debounce((resolve, reject) => {
12132
- const res = item.asyncValidator(rule, value);
12133
- if (res) {
12134
- resolve("");
12135
- } else {
12136
- reject(rule.message);
12137
- }
12138
- }, asyncDebounceTime));
12139
- }
12140
- };
12141
- descriptor.modelName.push(ruleObj);
12142
- });
12143
- }
12144
- const validator = new Schema(descriptor);
12145
- const htmlEventValidateHandler = (e) => {
12146
- const modelValue = e.target.value;
12147
- if (messageShowType === "popover") {
12148
- EventBus.emit("showPopoverErrorMessage", {
12149
- showPopover: false,
12150
- message: "",
12151
- uid: dfcUID,
12152
- popPosition,
12153
- updateOn
12154
- });
12155
- }
12156
- validateFn({ validator, modelValue, el, tipEl, isFormTag: false, messageShowType, dfcUID, popPosition, updateOn });
12157
- };
12158
- vnode.children[0].el.addEventListener(updateOn, htmlEventValidateHandler);
12159
- if (messageShowType === "popover" && updateOn === "change") {
12160
- vnode.children[0].el.addEventListener("focus", () => {
12161
- EventBus.emit("showPopoverErrorMessage", { showPopover: false, uid: dfcUID, updateOn });
12162
- });
12163
- }
12164
- if (errorStrategy === "pristine") {
12165
- handleErrorStrategy(el);
12166
- vnode.children[0].props.value = "" + vnode.children[0].props.value;
12167
- }
12168
- const formName = getFormName(binding);
12169
- formName && EventBus.on(`formSubmit:${formName}`, () => {
12170
- const modelValue = isFormTag ? "" : vnode.children[0].el.value;
12171
- validateFn({ validator, modelValue, el, tipEl, isFormTag, messageShowType, updateOn: "submit" });
12172
- });
12173
- }
12174
- };
12175
11740
  var FormInstall = {
12176
11741
  title: "Form \u8868\u5355",
12177
11742
  category: "\u6570\u636E\u5F55\u5165",
12178
11743
  status: "75%",
12179
11744
  install(app) {
12180
11745
  app.component(Form.name, Form);
12181
- app.directive("d-validate-rules", dValidateRules);
12182
11746
  app.component(FormLabel.name, FormLabel);
12183
11747
  app.component(FormItem.name, FormItem);
12184
11748
  app.component(FormControl.name, FormControl);
@@ -12306,7 +11870,7 @@ var Fullscreen = defineComponent({
12306
11870
  props: fullscreenProps,
12307
11871
  emits: ["update:modelValue"],
12308
11872
  setup(props, ctx2) {
12309
- const slotElement = ref(null);
11873
+ const slotElement = ref();
12310
11874
  useFullscreen(props, slotElement, ctx2);
12311
11875
  useKeydown(props, ctx2);
12312
11876
  return () => {
@@ -14330,8 +13894,30 @@ var Pagination = defineComponent({
14330
13894
  props: paginationProps,
14331
13895
  emits: ["pageIndexChange", "pageSizeChange", "update:pageSize", "update:pageIndex"],
14332
13896
  setup(props, {
14333
- emit
13897
+ emit,
13898
+ slots
14334
13899
  }) {
13900
+ const {
13901
+ autoHide,
13902
+ pageSizeOptions,
13903
+ total,
13904
+ canChangePageSize,
13905
+ lite,
13906
+ size,
13907
+ pageSizeDirection,
13908
+ showPageSelector,
13909
+ canViewTotal,
13910
+ totalItemText,
13911
+ maxItems,
13912
+ preLink,
13913
+ nextLink,
13914
+ showTruePageIndex,
13915
+ canJumpPage,
13916
+ goToText,
13917
+ pageIndex,
13918
+ showJumpButton,
13919
+ haveConfigMenu
13920
+ } = toRefs(props);
14335
13921
  const totalPages = computed(() => Math.ceil(props.total / props.pageSize));
14336
13922
  const litePageOptions = computed(() => liteSelectOptions(totalPages.value));
14337
13923
  const cursor = computed({
@@ -14372,102 +13958,64 @@ var Pagination = defineComponent({
14372
13958
  const litePageIndexChange = (page) => {
14373
13959
  changeCursorEmit(page.value);
14374
13960
  };
14375
- return {
14376
- cursor,
14377
- totalPages,
14378
- changeCursorEmit,
14379
- currentPageSize,
14380
- pageSizeChange,
14381
- litePageOptions,
14382
- litePageIndexChange
13961
+ return () => {
13962
+ return autoHide.value && Math.min(...pageSizeOptions.value) > total.value ? null : createVNode("div", {
13963
+ "class": "devui-pagination"
13964
+ }, [
13965
+ canChangePageSize.value && !lite.value && createVNode("div", {
13966
+ "class": ["devui-page-size", size.value ? "devui-page-size-" + size.value : ""]
13967
+ }, [createVNode(resolveComponent("d-select"), {
13968
+ "options": pageSizeOptions.value,
13969
+ "modelValue": currentPageSize.value,
13970
+ "onValueChange": pageSizeChange,
13971
+ "pageSizeDirection": pageSizeDirection.value
13972
+ }, null)]),
13973
+ (!lite.value || lite.value && showPageSelector.value) && canViewTotal.value && createVNode("div", {
13974
+ "class": "devui-total-size"
13975
+ }, [totalItemText.value, createTextVNode(": "), total.value]),
13976
+ lite.value && showPageSelector.value && createVNode("div", {
13977
+ "class": "devui-page-size"
13978
+ }, [createVNode(resolveComponent("d-select"), {
13979
+ "options": litePageOptions.value,
13980
+ "disabled": total.value === 0,
13981
+ "modelValue": cursor.value,
13982
+ "onValueChange": litePageIndexChange,
13983
+ "pageSizeDirection": pageSizeDirection.value
13984
+ }, null)]),
13985
+ createVNode(resolveComponent("page-num-btn"), mergeProps({
13986
+ cursor: cursor.value,
13987
+ totalPages: totalPages.value,
13988
+ size: size.value,
13989
+ lite: lite.value,
13990
+ maxItems: maxItems.value,
13991
+ preLink: preLink.value,
13992
+ nextLink: nextLink.value,
13993
+ showTruePageIndex: showTruePageIndex.value
13994
+ }, {
13995
+ "onChangeCursorEmit": changeCursorEmit
13996
+ }), null),
13997
+ canJumpPage.value && !lite.value && createVNode(resolveComponent("jump-page"), mergeProps({
13998
+ goToText: goToText.value,
13999
+ size: size.value,
14000
+ pageIndex: pageIndex.value,
14001
+ totalPages: totalPages.value,
14002
+ cursor: cursor.value,
14003
+ showJumpButton: showJumpButton.value
14004
+ }, {
14005
+ "onChangeCursorEmit": changeCursorEmit
14006
+ }), null),
14007
+ lite.value && haveConfigMenu.value && createVNode(resolveComponent("config-menu"), {
14008
+ currentPageSize: currentPageSize.value,
14009
+ pageSizeChange,
14010
+ pageSizeOptions: pageSizeOptions.value
14011
+ }, {
14012
+ default: () => {
14013
+ var _a;
14014
+ return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
14015
+ }
14016
+ })
14017
+ ]);
14383
14018
  };
14384
- },
14385
- render() {
14386
- const {
14387
- total,
14388
- pageIndex,
14389
- pageSizeOptions,
14390
- pageSizeDirection,
14391
- preLink,
14392
- nextLink,
14393
- size,
14394
- canJumpPage,
14395
- canChangePageSize,
14396
- canViewTotal,
14397
- totalItemText,
14398
- goToText,
14399
- maxItems,
14400
- showJumpButton,
14401
- showTruePageIndex,
14402
- lite,
14403
- showPageSelector,
14404
- haveConfigMenu,
14405
- autoHide,
14406
- $slots,
14407
- cursor,
14408
- totalPages,
14409
- currentPageSize,
14410
- pageSizeChange,
14411
- changeCursorEmit,
14412
- litePageOptions,
14413
- litePageIndexChange
14414
- } = this;
14415
- return autoHide && Math.min(...pageSizeOptions) > total ? null : createVNode("div", {
14416
- "class": "devui-pagination"
14417
- }, [
14418
- canChangePageSize && !lite && createVNode("div", {
14419
- "class": ["devui-page-size", size ? "devui-page-size-" + size : ""]
14420
- }, [createVNode(resolveComponent("d-select"), {
14421
- "options": pageSizeOptions,
14422
- "modelValue": currentPageSize,
14423
- "onValueChange": pageSizeChange,
14424
- "pageSizeDirection": pageSizeDirection
14425
- }, null)]),
14426
- (!lite || lite && showPageSelector) && canViewTotal && createVNode("div", {
14427
- "class": "devui-total-size"
14428
- }, [totalItemText, createTextVNode(": "), total]),
14429
- lite && showPageSelector && createVNode("div", {
14430
- "class": "devui-page-size"
14431
- }, [createVNode(resolveComponent("d-select"), {
14432
- "options": litePageOptions,
14433
- "disabled": total === 0,
14434
- "modelValue": cursor,
14435
- "onValueChange": litePageIndexChange,
14436
- "pageSizeDirection": pageSizeDirection
14437
- }, null)]),
14438
- createVNode(resolveComponent("page-num-btn"), mergeProps({
14439
- cursor,
14440
- totalPages,
14441
- size,
14442
- lite,
14443
- maxItems,
14444
- preLink,
14445
- nextLink,
14446
- showTruePageIndex
14447
- }, {
14448
- "onChangeCursorEmit": changeCursorEmit
14449
- }), null),
14450
- canJumpPage && !lite && createVNode(resolveComponent("jump-page"), mergeProps({
14451
- goToText,
14452
- size,
14453
- pageIndex,
14454
- totalPages,
14455
- cursor,
14456
- showJumpButton
14457
- }, {
14458
- "onChangeCursorEmit": changeCursorEmit
14459
- }), null),
14460
- lite && haveConfigMenu && createVNode(resolveComponent("config-menu"), {
14461
- currentPageSize,
14462
- pageSizeChange,
14463
- pageSizeOptions
14464
- }, {
14465
- default: () => {
14466
- var _a;
14467
- return [(_a = $slots.default) == null ? void 0 : _a.call($slots)];
14468
- }
14469
- })
14470
- ]);
14471
14019
  }
14472
14020
  });
14473
14021
  var PaginationInstall = {
@@ -14694,14 +14242,57 @@ var PanelInstall = {
14694
14242
  app.component(PanelFooter.name, PanelFooter);
14695
14243
  }
14696
14244
  };
14697
- var PopoverInstall = {
14698
- title: "Popover \u60AC\u6D6E\u63D0\u793A",
14699
- category: "\u53CD\u9988",
14700
- status: "100%",
14701
- install(app) {
14702
- app.component(Popover.name, Popover);
14245
+ function hasClass(el, className2) {
14246
+ if (el.classList) {
14247
+ return el.classList.contains(className2);
14703
14248
  }
14704
- };
14249
+ const originClass = el.className;
14250
+ return ` ${originClass} `.indexOf(` ${className2} `) > -1;
14251
+ }
14252
+ function addClass(el, className2) {
14253
+ if (el.classList) {
14254
+ el.classList.add(className2);
14255
+ } else {
14256
+ if (!hasClass(el, className2)) {
14257
+ el.className = `${el.className} ${className2}`;
14258
+ }
14259
+ }
14260
+ }
14261
+ function removeClass(el, className2) {
14262
+ if (el.classList) {
14263
+ el.classList.remove(className2);
14264
+ } else {
14265
+ if (hasClass(el, className2)) {
14266
+ const originClass = el.className;
14267
+ el.className = ` ${originClass} `.replace(` ${className2} `, " ");
14268
+ }
14269
+ }
14270
+ }
14271
+ function randomId(n = 8) {
14272
+ const str = "abcdefghijklmnopqrstuvwxyz0123456789";
14273
+ let result2 = "";
14274
+ for (let i = 0; i < n; i++) {
14275
+ result2 += str[parseInt((Math.random() * str.length).toString())];
14276
+ }
14277
+ return result2;
14278
+ }
14279
+ function setStyle(element, style) {
14280
+ const oldStyle = {};
14281
+ const styleKeys = Object.keys(style);
14282
+ styleKeys.forEach((key) => {
14283
+ oldStyle[key] = element.style[key];
14284
+ });
14285
+ styleKeys.forEach((key) => {
14286
+ element.style[key] = style[key];
14287
+ });
14288
+ return oldStyle;
14289
+ }
14290
+ function middleNum(num, min = 0, max = 100) {
14291
+ let middle = 0;
14292
+ middle = Math.min(num, max);
14293
+ middle = Math.max(middle, min);
14294
+ return middle;
14295
+ }
14705
14296
  const progressProps = {
14706
14297
  height: {
14707
14298
  type: String,
@@ -14730,6 +14321,14 @@ const progressProps = {
14730
14321
  showContent: {
14731
14322
  type: Boolean,
14732
14323
  default: true
14324
+ },
14325
+ percentageTextPlacement: {
14326
+ type: String,
14327
+ default: "inside"
14328
+ },
14329
+ percentageTextColor: {
14330
+ type: String,
14331
+ default: ""
14733
14332
  }
14734
14333
  };
14735
14334
  var progress = "";
@@ -14741,11 +14340,17 @@ var Progress = defineComponent({
14741
14340
  height,
14742
14341
  percentage,
14743
14342
  percentageText,
14343
+ percentageTextPlacement,
14344
+ percentageTextColor,
14744
14345
  barBgColor,
14745
14346
  isCircle,
14746
14347
  strokeWidth,
14747
14348
  showContent
14748
14349
  } = toRefs(props);
14350
+ const normalPercentage = ref(0);
14351
+ effect(() => {
14352
+ normalPercentage.value = middleNum(percentage.value);
14353
+ });
14749
14354
  const data = reactive({
14750
14355
  pathString: "",
14751
14356
  trailPath: null,
@@ -14770,25 +14375,28 @@ var Progress = defineComponent({
14770
14375
  };
14771
14376
  data.strokePath = {
14772
14377
  stroke: barBgColor || null,
14773
- strokeDasharray: `${percentage.value / 100 * len}px ${len}px`,
14378
+ strokeDasharray: `${normalPercentage.value / 100 * len}px ${len}px`,
14774
14379
  strokeDashoffset: `0`,
14775
14380
  transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
14776
14381
  };
14777
14382
  };
14778
14383
  setCircleProgress();
14779
- watch([height, percentage, percentageText, barBgColor, isCircle, strokeWidth, showContent], () => {
14384
+ watch([height, normalPercentage, percentageText, percentageTextPlacement, percentageTextColor, barBgColor, isCircle, strokeWidth, showContent], () => {
14780
14385
  setCircleProgress();
14781
14386
  });
14782
14387
  return {
14783
- data
14388
+ data,
14389
+ normalPercentage
14784
14390
  };
14785
14391
  },
14786
14392
  render() {
14787
14393
  var _a;
14788
14394
  const {
14789
14395
  height,
14790
- percentage,
14396
+ normalPercentage,
14791
14397
  percentageText,
14398
+ percentageTextPlacement,
14399
+ percentageTextColor,
14792
14400
  barBgColor,
14793
14401
  isCircle,
14794
14402
  strokeWidth,
@@ -14796,28 +14404,39 @@ var Progress = defineComponent({
14796
14404
  data,
14797
14405
  $slots
14798
14406
  } = this;
14407
+ const isOutside = percentageTextPlacement === "outside";
14408
+ const isInsideBg = percentageTextPlacement === "insideBg";
14409
+ const createPercentageText = () => {
14410
+ return createVNode("span", {
14411
+ "style": {
14412
+ lineHeight: height,
14413
+ color: percentageTextColor
14414
+ }
14415
+ }, [percentageText]);
14416
+ };
14799
14417
  const progressLine = createVNode("div", {
14418
+ "class": "devui-progress-content"
14419
+ }, [createVNode("div", {
14800
14420
  "class": "devui-progress--line",
14801
14421
  "style": {
14802
14422
  height,
14803
14423
  borderRadius: height
14804
14424
  }
14805
14425
  }, [createVNode("div", {
14806
- "class": "devui-progress-bar",
14426
+ "class": ["devui-progress-bar", percentageTextPlacement],
14807
14427
  "style": {
14808
14428
  height,
14809
14429
  borderRadius: height,
14810
- width: `${percentage}%`,
14430
+ width: `${normalPercentage}%`,
14811
14431
  backgroundColor: barBgColor
14812
14432
  }
14813
- }, null), createVNode("span", {
14433
+ }, [!isOutside && !isInsideBg ? createPercentageText() : null]), isInsideBg ? createPercentageText() : null]), isOutside && !!percentageText ? createPercentageText() : null]);
14434
+ const textElement = createVNode("span", {
14435
+ "class": "devui-progress-circle-text",
14814
14436
  "style": {
14815
- lineHeight: height
14437
+ color: percentageTextColor
14816
14438
  }
14817
- }, [percentageText])]);
14818
- const textElement = createVNode("span", {
14819
- "class": "devui-progress-circle-text"
14820
- }, [percentage, createTextVNode("%")]);
14439
+ }, [normalPercentage, createTextVNode("%")]);
14821
14440
  const progressCircle = createVNode("div", {
14822
14441
  "class": "devui-progress-circle"
14823
14442
  }, [createVNode("svg", {
@@ -14835,7 +14454,7 @@ var Progress = defineComponent({
14835
14454
  "stroke-linecap": "round",
14836
14455
  "fill-opacity": "0",
14837
14456
  "stroke": barBgColor,
14838
- "stroke-width": percentage ? strokeWidth : 0,
14457
+ "stroke-width": normalPercentage ? strokeWidth : 0,
14839
14458
  "style": data.strokePath
14840
14459
  }, null)]), showContent && ((_a = $slots.default) == null ? void 0 : _a.call($slots)), showContent && !$slots.default && textElement]);
14841
14460
  return createVNode("div", {
@@ -15185,7 +14804,8 @@ var Rate = defineComponent({
15185
14804
  } = this;
15186
14805
  return createVNode("div", {
15187
14806
  "class": "devui-star-container",
15188
- "onMouseleave": onMouseleave
14807
+ "onMouseleave": onMouseleave,
14808
+ "style": `--star-color: ${color}`
15189
14809
  }, [totalLevelArray.map((item, index2) => createVNode("div", {
15190
14810
  "class": `devui-star-align devui-pointer ${read ? "devui-only-read" : ""}`,
15191
14811
  "key": index2,
@@ -15231,9 +14851,8 @@ var Rate = defineComponent({
15231
14851
  width: item.width
15232
14852
  }
15233
14853
  }, [character]), !character && !icon && createVNode("span", {
15234
- "class": `devui-star-color-active devui-active-star devui-star-color-${type4}`,
14854
+ "class": ["devui-star-color-active", "devui-active-star", !color ? `devui-star-color-${type4}` : "devui-star-color-customize"],
15235
14855
  "style": {
15236
- color,
15237
14856
  width: item.width
15238
14857
  }
15239
14858
  }, [createVNode("svg", {
@@ -15263,249 +14882,6 @@ var RateInstall = {
15263
14882
  app.component(Rate.name, Rate);
15264
14883
  }
15265
14884
  };
15266
- const readTipProps = {
15267
- readTipOptions: {
15268
- type: Object
15269
- },
15270
- defaultTemplateProps: {
15271
- type: Object
15272
- }
15273
- };
15274
- var readTip = "";
15275
- var TipsTemplate = defineComponent({
15276
- name: "DReadTipTemplate",
15277
- props: readTipProps,
15278
- emits: [],
15279
- setup(props, ctx2) {
15280
- const {
15281
- defaultTemplateProps
15282
- } = toRefs(props);
15283
- let rule = defaultTemplateProps.value;
15284
- const query = (rule == null ? void 0 : rule.id) ? `#${rule.id}` : rule.selector;
15285
- const styles = reactive({});
15286
- if (typeof rule.dataFn === "function") {
15287
- const dataFn = rule.dataFn({
15288
- element: document.querySelector(query),
15289
- rule
15290
- });
15291
- rule = __spreadValues(__spreadValues({}, rule), dataFn);
15292
- }
15293
- const temp = ref(null);
15294
- const deviation = (x) => {
15295
- let deviationConstant = x > 24 ? 0 : -(x / 2) + 2;
15296
- if (x <= 10) {
15297
- deviationConstant = -10;
15298
- }
15299
- return deviationConstant;
15300
- };
15301
- onMounted(() => {
15302
- var _a, _b;
15303
- const domBounding = (_a = document.querySelector(query)) == null ? void 0 : _a.getBoundingClientRect();
15304
- const {
15305
- width,
15306
- height
15307
- } = domBounding;
15308
- const distance = 10;
15309
- let positionTop = 0;
15310
- const heightDeviation = deviation(height);
15311
- const widthDeviation = deviation(width);
15312
- let positionLeft = 0;
15313
- const targetDom = (_b = document.querySelector(".read-tip-container")) == null ? void 0 : _b.getBoundingClientRect();
15314
- if (rule.appendToBody) {
15315
- positionTop = domBounding.y + document.documentElement.scrollTop;
15316
- positionLeft = domBounding.x;
15317
- }
15318
- switch (rule.position) {
15319
- case "top":
15320
- styles.top = positionTop - targetDom.height - distance + "px";
15321
- styles.left = positionLeft + widthDeviation + "px";
15322
- break;
15323
- case "left":
15324
- styles.top = positionTop + heightDeviation + "px";
15325
- styles.left = positionLeft - targetDom.width - distance + "px";
15326
- break;
15327
- case "bottom":
15328
- styles.top = positionTop + domBounding.height + distance + "px";
15329
- styles.left = positionLeft + widthDeviation + "px";
15330
- break;
15331
- case "right":
15332
- styles.top = positionTop + heightDeviation + "px";
15333
- styles.left = positionLeft + domBounding.width + distance + "px";
15334
- break;
15335
- }
15336
- });
15337
- return () => {
15338
- return createVNode(Teleport, {
15339
- "to": rule.appendToBody ? "body" : query
15340
- }, {
15341
- default: () => {
15342
- var _a, _b;
15343
- return [createVNode("div", {
15344
- "ref": temp,
15345
- "class": ["read-tip-container", rule.position, rule.overlayClassName],
15346
- "style": styles
15347
- }, [createVNode("span", {
15348
- "class": "after"
15349
- }, null), rule.contentTemplate ? (_b = (_a = ctx2.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a) : createVNode(Fragment, null, [createVNode("div", {
15350
- "class": "title"
15351
- }, [rule.title]), createVNode("div", {
15352
- "class": "content"
15353
- }, [rule.content])])])];
15354
- }
15355
- });
15356
- };
15357
- }
15358
- });
15359
- const rules = (ruleList) => {
15360
- if (ruleList === null) {
15361
- return [];
15362
- }
15363
- if (typeof ruleList === "object" && !Array.isArray(ruleList)) {
15364
- ruleList = [ruleList];
15365
- }
15366
- ruleList = [...ruleList];
15367
- Array.isArray(ruleList) && ruleList.map((rule) => {
15368
- rule.status = false;
15369
- });
15370
- return ruleList;
15371
- };
15372
- var ReadTip = defineComponent({
15373
- name: "DReadTip",
15374
- props: readTipProps,
15375
- emits: [],
15376
- setup(props, ctx2) {
15377
- const defaultOptions2 = {
15378
- trigger: "hover",
15379
- showAnimate: false,
15380
- mouseenterTime: 100,
15381
- mouseleaveTime: 100,
15382
- position: "top",
15383
- overlayClassName: "",
15384
- appendToBody: true,
15385
- rules: {
15386
- selector: null
15387
- }
15388
- };
15389
- const options = __spreadValues(__spreadValues({}, defaultOptions2), props.readTipOptions);
15390
- const defaultSlot = ref(null);
15391
- const refRules = reactive(rules(options.rules));
15392
- const onMouseenter = (rule) => () => {
15393
- setTimeout(() => {
15394
- if (rule.id) {
15395
- const a = refRules.find((u) => u.id === rule.id);
15396
- a.status = true;
15397
- }
15398
- rule.status = true;
15399
- }, rule.mouseenterTime || options.mouseenterTime);
15400
- };
15401
- const onMouseleave = (rule) => () => {
15402
- setTimeout(() => {
15403
- if (rule.id) {
15404
- const a = refRules.find((u) => u.id === rule.id);
15405
- a.status = false;
15406
- }
15407
- rule.status = false;
15408
- }, rule.mouseleaveTime || options.mouseleaveTime);
15409
- };
15410
- const init = (ruleList, trigger = "hover") => {
15411
- ruleList.map((rule) => {
15412
- var _a;
15413
- rule.status = false;
15414
- trigger = rule.trigger || trigger;
15415
- rule.overlayClassName = rule.overlayClassName || options.overlayClassName;
15416
- rule.position = rule.position || options.position;
15417
- rule.contentTemplate = !!ctx2.slots.contentTemplate;
15418
- if (!("appendToBody" in rule)) {
15419
- rule.appendToBody = options.appendToBody;
15420
- }
15421
- const doms = (_a = defaultSlot.value) == null ? void 0 : _a.querySelectorAll(rule.selector);
15422
- [...doms].map((dom, index2) => {
15423
- if (rule.appendToBody === false) {
15424
- dom.style.position = "relative";
15425
- }
15426
- let newRule = reactive({
15427
- id: null
15428
- });
15429
- const id = rule.selector.slice(rule.selector[0] === "." ? 1 : 0) + index2;
15430
- if (index2 > 0) {
15431
- newRule = __spreadValues({}, rule);
15432
- dom.id = id;
15433
- newRule.id = id;
15434
- ruleList.push(newRule);
15435
- }
15436
- if (trigger === "hover") {
15437
- dom.addEventListener("mouseenter", onMouseenter(newRule.id ? newRule : rule));
15438
- dom.addEventListener("mouseleave", onMouseleave(newRule.id ? newRule : rule));
15439
- }
15440
- });
15441
- });
15442
- return ruleList;
15443
- };
15444
- function show(_, rule) {
15445
- rule.status = true;
15446
- }
15447
- const clickFn = () => {
15448
- refRules.forEach((element) => {
15449
- element.status = false;
15450
- });
15451
- };
15452
- onMounted(() => {
15453
- init(refRules, options.trigger);
15454
- document.addEventListener("click", clickFn, true);
15455
- });
15456
- onUnmounted(() => {
15457
- document.removeEventListener("click", clickFn);
15458
- });
15459
- const onClick = (e) => {
15460
- var _a;
15461
- for (const rule of refRules) {
15462
- const doms = (_a = defaultSlot.value) == null ? void 0 : _a.querySelectorAll(rule.selector);
15463
- for (const dom of doms) {
15464
- if (doms.length > 1) {
15465
- if (dom === e.target && rule.id) {
15466
- show(dom, rule);
15467
- return;
15468
- } else if (dom === e.target && !rule.id && !dom.id) {
15469
- show(dom, rule);
15470
- return;
15471
- }
15472
- } else if (dom === e.target) {
15473
- show(dom, rule);
15474
- return;
15475
- } else {
15476
- rule.status = false;
15477
- }
15478
- }
15479
- }
15480
- };
15481
- return () => {
15482
- var _a, _b;
15483
- return createVNode("div", {
15484
- "class": "devui-read-tip"
15485
- }, [createVNode("div", {
15486
- "ref": defaultSlot,
15487
- "onClick": onClick
15488
- }, [(_b = (_a = ctx2.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a)]), refRules.map((rule) => createVNode("div", {
15489
- "data-test": "todo"
15490
- }, [rule.status && createVNode(TipsTemplate, {
15491
- "defaultTemplateProps": __spreadValues({}, rule)
15492
- }, {
15493
- default: () => {
15494
- var _a2, _b2;
15495
- return [rule.contentTemplate && ((_b2 = (_a2 = ctx2.slots) == null ? void 0 : _a2.contentTemplate) == null ? void 0 : _b2.call(_a2))];
15496
- }
15497
- })]))]);
15498
- };
15499
- }
15500
- });
15501
- var ReadTipInstall = {
15502
- title: "ReadTip \u9605\u8BFB\u63D0\u793A",
15503
- category: "\u53CD\u9988",
15504
- status: "100%",
15505
- install(app) {
15506
- app.component(ReadTip.name, ReadTip);
15507
- }
15508
- };
15509
14885
  const resultProps = {
15510
14886
  icon: {
15511
14887
  type: String,
@@ -15779,6 +15155,7 @@ const searchProps = {
15779
15155
  };
15780
15156
  const SIZE_CLASS = {
15781
15157
  lg: "lg",
15158
+ md: "md",
15782
15159
  sm: "sm"
15783
15160
  };
15784
15161
  const ICON_POSITION = {
@@ -15869,6 +15246,7 @@ var Search = defineComponent({
15869
15246
  autoFocus: props.autoFocus,
15870
15247
  modelValue: keywords.value,
15871
15248
  placeholder: props.placeholder,
15249
+ maxLength: props.maxLength,
15872
15250
  cssClass: props.cssClass,
15873
15251
  onKeydown: onInputKeydown,
15874
15252
  "onUpdate:modelValue": onInputUpdate
@@ -16803,43 +16181,6 @@ var Tooltip = defineComponent({
16803
16181
  };
16804
16182
  }
16805
16183
  });
16806
- function setStyle(element, style2) {
16807
- const oldStyle = {};
16808
- const styleKeys = Object.keys(style2);
16809
- styleKeys.forEach((key) => {
16810
- oldStyle[key] = element.style[key];
16811
- });
16812
- styleKeys.forEach((key) => {
16813
- element.style[key] = style2[key];
16814
- });
16815
- return oldStyle;
16816
- }
16817
- function hasClass(el, className2) {
16818
- if (el.classList) {
16819
- return el.classList.contains(className2);
16820
- }
16821
- const originClass = el.className;
16822
- return ` ${originClass} `.indexOf(` ${className2} `) > -1;
16823
- }
16824
- function addClass(el, className2) {
16825
- if (el.classList) {
16826
- el.classList.add(className2);
16827
- } else {
16828
- if (!hasClass(el, className2)) {
16829
- el.className = `${el.className} ${className2}`;
16830
- }
16831
- }
16832
- }
16833
- function removeClass(el, className2) {
16834
- if (el.classList) {
16835
- el.classList.remove(className2);
16836
- } else {
16837
- if (hasClass(el, className2)) {
16838
- const originClass = el.className;
16839
- el.className = ` ${originClass} `.replace(` ${className2} `, " ");
16840
- }
16841
- }
16842
- }
16843
16184
  function normalizeEvent(evt) {
16844
16185
  return {
16845
16186
  pageX: evt.pageX,
@@ -17953,13 +17294,13 @@ function useTable(props) {
17953
17294
  [ns.m(`${props.size}`)]: true,
17954
17295
  [ns.m(`${props.borderType}`)]: Boolean(props.borderType)
17955
17296
  }));
17956
- const style2 = computed(() => ({
17297
+ const style = computed(() => ({
17957
17298
  maxHeight: props.maxHeight,
17958
17299
  maxWidth: props.maxWidth,
17959
17300
  height: props.tableHeight,
17960
17301
  width: props.tableWidth
17961
17302
  }));
17962
- return { classes, style: style2 };
17303
+ return { classes, style };
17963
17304
  }
17964
17305
  const useFixedColumn = (column) => {
17965
17306
  const ns = useNamespace("table");
@@ -18815,7 +18156,7 @@ var Table = defineComponent({
18815
18156
  provide(TABLE_TOKEN, table2);
18816
18157
  const {
18817
18158
  classes,
18818
- style: style2
18159
+ style
18819
18160
  } = useTable(props);
18820
18161
  const isEmpty2 = computed(() => props.data.length === 0);
18821
18162
  const ns = useNamespace("table");
@@ -18834,7 +18175,7 @@ var Table = defineComponent({
18834
18175
  var _a, _b;
18835
18176
  return withDirectives(createVNode("div", {
18836
18177
  "class": ns.b(),
18837
- "style": style2.value
18178
+ "style": style.value
18838
18179
  }, [createVNode("div", {
18839
18180
  "ref": hiddenColumns,
18840
18181
  "class": "hidden-columns"
@@ -19694,21 +19035,21 @@ var Timeline = defineComponent({
19694
19035
  props
19695
19036
  });
19696
19037
  const timeAxis = ref();
19697
- const style2 = reactive({
19038
+ const style = reactive({
19698
19039
  marginLeft: "0px",
19699
19040
  height: "auto"
19700
19041
  });
19701
19042
  const setStyle2 = () => {
19702
- style2.height = "auto";
19703
- style2.marginLeft = "0px";
19043
+ style.height = "auto";
19044
+ style.marginLeft = "0px";
19704
19045
  if (props.direction === "horizontal") {
19705
19046
  nextTick(() => {
19706
19047
  var _a;
19707
19048
  const element = timeAxis.value;
19708
19049
  if (props.center) {
19709
- style2.marginLeft = (((_a = element == null ? void 0 : element.firstElementChild) == null ? void 0 : _a.clientWidth) || 0) / 2 + "px";
19050
+ style.marginLeft = (((_a = element == null ? void 0 : element.firstElementChild) == null ? void 0 : _a.clientWidth) || 0) / 2 + "px";
19710
19051
  }
19711
- style2.height = Math.max(...Array.from(element == null ? void 0 : element.querySelectorAll(".devui-timeline-item-data-top")).map((el) => el.clientHeight), ...Array.from(element == null ? void 0 : element.querySelectorAll(".devui-timeline-item-data-bottom")).map((el) => el.clientHeight)) * 2 + Math.max(...Array.from(element == null ? void 0 : element.querySelectorAll(".devui-timeline-item-axis")).map((el) => el.clientHeight)) + "px";
19052
+ style.height = Math.max(...Array.from(element == null ? void 0 : element.querySelectorAll(".devui-timeline-item-data-top")).map((el) => el.clientHeight), ...Array.from(element == null ? void 0 : element.querySelectorAll(".devui-timeline-item-data-bottom")).map((el) => el.clientHeight)) * 2 + Math.max(...Array.from(element == null ? void 0 : element.querySelectorAll(".devui-timeline-item-axis")).map((el) => el.clientHeight)) + "px";
19712
19053
  });
19713
19054
  }
19714
19055
  };
@@ -19774,7 +19115,7 @@ var Timeline = defineComponent({
19774
19115
  return createVNode("div", {
19775
19116
  "class": `devui-timeline devui-timeline-${getDirection()} ${props.center ? "devui-timeline-" + getDirection() + "-center" : ""} `,
19776
19117
  "ref": timeAxis,
19777
- "style": style2
19118
+ "style": style
19778
19119
  }, [renderItem()]);
19779
19120
  };
19780
19121
  }
@@ -20081,14 +19422,6 @@ function useToggle() {
20081
19422
  };
20082
19423
  };
20083
19424
  }
20084
- function randomId(n = 8) {
20085
- const str = "abcdefghijklmnopqrstuvwxyz0123456789";
20086
- let result2 = "";
20087
- for (let i = 0; i < n; i++) {
20088
- result2 += str[parseInt((Math.random() * str.length).toString())];
20089
- }
20090
- return result2;
20091
- }
20092
19425
  function omit(obj, ...keys) {
20093
19426
  return Object.entries(obj).filter((item) => !keys.includes(item[0])).reduce((acc, item) => Object.assign({}, acc, { [item[0]]: item[1] }), {});
20094
19427
  }
@@ -21124,7 +20457,6 @@ const installs = [
21124
20457
  ButtonInstall,
21125
20458
  CardInstall,
21126
20459
  CheckboxInstall,
21127
- CommentInstall,
21128
20460
  CountdownInstall,
21129
20461
  DatePickerInstall,
21130
20462
  DrawerInstall,
@@ -21148,7 +20480,6 @@ const installs = [
21148
20480
  ProgressInstall,
21149
20481
  RadioInstall,
21150
20482
  RateInstall,
21151
- ReadTipInstall,
21152
20483
  ResultInstall,
21153
20484
  RippleInstall,
21154
20485
  SearchInstall,
@@ -21174,4 +20505,4 @@ var vueDevui = {
21174
20505
  installs.forEach((p) => app.use(p));
21175
20506
  }
21176
20507
  };
21177
- export { Alert, Aside, AutoComplete, Avatar, Badge, Button, Card, Checkbox, Col, Column, Comment, Content, Countdown, DatePicker, Drawer, DrawerService, Dropdown, DropdownMenu, EditableSelect, FixedOverlay, FlexibleOverlay, Footer$1 as Footer, Form, FormControl, FormItem, FormLabel, FormOperation, Fullscreen, Header$1 as Header, DIcon as Icon, ImagePreviewDirective, ImagePreviewService, DInput as Input, InputNumber, Layout, loadingDirective as Loading, loading as LoadingService, Modal, Notification, NotificationService, Pagination, Panel, PanelBody, PanelFooter, PanelHeader, Popover, Progress, Radio, RadioGroup, Rate, ReadTip, 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 };
20508
+ export { Alert, Aside, AutoComplete, Avatar, Badge, Button, Card, Checkbox, CheckboxGroup, Col, Column, Content, Countdown, DatePicker, Drawer, DrawerService, Dropdown, DropdownMenu, EditableSelect, FixedOverlay, FlexibleOverlay, Footer$1 as Footer, Form, FormControl, FormItem, FormLabel, FormOperation, Fullscreen, Header$1 as Header, DIcon as Icon, ImagePreviewDirective, ImagePreviewService, DInput as Input, InputNumber, Layout, loadingDirective as Loading, loading as LoadingService, Modal, Notification, NotificationService, Pagination, Panel, PanelBody, PanelFooter, PanelHeader, Popover, Progress, Radio, 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 };