vue-devui 1.0.0-beta.14 → 1.0.0-beta.17

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 (103) hide show
  1. package/README.md +11 -21
  2. package/accordion/index.es.js +8 -8
  3. package/accordion/index.umd.js +1 -1
  4. package/accordion/style.css +1 -1
  5. package/alert/index.es.js +0 -3
  6. package/alert/index.umd.js +1 -1
  7. package/alert/style.css +1 -1
  8. package/auto-complete/index.es.js +2 -2
  9. package/auto-complete/style.css +1 -1
  10. package/back-top/index.es.js +1 -1
  11. package/back-top/index.umd.js +1 -1
  12. package/button/index.es.js +1 -1
  13. package/button/style.css +1 -1
  14. package/carousel/index.es.js +5 -5
  15. package/carousel/index.umd.js +1 -1
  16. package/cascader/index.es.js +5392 -772
  17. package/cascader/index.umd.js +27 -1
  18. package/checkbox/style.css +1 -1
  19. package/color-picker/index.es.js +5419 -191
  20. package/color-picker/index.umd.js +27 -1
  21. package/color-picker/style.css +1 -1
  22. package/comment/index.es.js +3 -2
  23. package/comment/index.umd.js +1 -1
  24. package/comment/style.css +1 -1
  25. package/countdown/index.es.js +7 -7
  26. package/date-picker/index.es.js +4 -5
  27. package/date-picker/index.umd.js +1 -1
  28. package/date-picker/style.css +1 -1
  29. package/drawer/index.es.js +137 -58
  30. package/drawer/index.umd.js +1 -1
  31. package/drawer/style.css +1 -1
  32. package/editable-select/index.es.js +5 -5
  33. package/form/index.es.js +5432 -245
  34. package/form/index.umd.js +27 -1
  35. package/gantt/index.es.js +3 -15
  36. package/gantt/index.umd.js +1 -1
  37. package/gantt/style.css +1 -1
  38. package/grid/index.es.js +1 -1
  39. package/grid/style.css +1 -1
  40. package/input/index.es.js +4 -5
  41. package/input/index.umd.js +1 -1
  42. package/input/style.css +1 -1
  43. package/input-icon/index.es.js +4 -5
  44. package/input-icon/index.umd.js +1 -1
  45. package/input-icon/style.css +1 -1
  46. package/loading/index.es.js +2 -2
  47. package/modal/index.es.js +1 -1
  48. package/modal/style.css +1 -1
  49. package/nav-sprite/index.es.js +1 -675
  50. package/nav-sprite/index.umd.js +1 -1
  51. package/nuxt/components/CarouselItem.js +3 -0
  52. package/package.json +8 -3
  53. package/pagination/index.es.js +1 -1
  54. package/pagination/style.css +1 -1
  55. package/panel/index.es.js +3 -3
  56. package/panel/index.umd.js +1 -1
  57. package/popover/index.es.js +1 -1
  58. package/quadrant-diagram/index.es.js +5405 -166
  59. package/quadrant-diagram/index.umd.js +27 -1
  60. package/radio/style.css +1 -1
  61. package/read-tip/style.css +1 -1
  62. package/ripple/index.es.js +1 -1
  63. package/search/index.es.js +5410 -172
  64. package/search/index.umd.js +27 -1
  65. package/search/style.css +1 -1
  66. package/select/index.es.js +1 -1
  67. package/select/style.css +1 -1
  68. package/splitter/index.es.js +71 -117
  69. package/splitter/index.umd.js +1 -1
  70. package/statistic/index.es.js +16 -29
  71. package/statistic/index.umd.js +1 -1
  72. package/statistic/style.css +1 -1
  73. package/status/style.css +1 -1
  74. package/sticky/index.umd.js +1 -1
  75. package/style.css +1 -1
  76. package/table/index.es.js +2 -2
  77. package/table/style.css +1 -1
  78. package/tabs/style.css +1 -1
  79. package/tag/index.es.js +2 -2
  80. package/tag/index.umd.js +1 -1
  81. package/tag/style.css +1 -1
  82. package/textarea/style.css +1 -1
  83. package/{theme → theme/theme.scss} +0 -0
  84. package/time-picker/index.es.js +1 -1
  85. package/time-picker/style.css +1 -1
  86. package/toast/index.es.js +5373 -1518
  87. package/toast/index.umd.js +27 -1
  88. package/toast/style.css +1 -1
  89. package/tooltip/index.es.js +70 -116
  90. package/tooltip/index.umd.js +1 -1
  91. package/transfer/index.es.js +5479 -287
  92. package/transfer/index.umd.js +27 -1
  93. package/transfer/style.css +1 -1
  94. package/tree/index.es.js +5772 -190
  95. package/tree/index.umd.js +27 -1
  96. package/tree/style.css +1 -1
  97. package/tree-select/index.es.js +3 -3
  98. package/tree-select/style.css +1 -1
  99. package/upload/index.es.js +5373 -1518
  100. package/upload/index.umd.js +27 -1
  101. package/upload/style.css +1 -1
  102. package/vue-devui.es.js +7708 -9800
  103. package/vue-devui.umd.js +16 -16
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { defineComponent, reactive, ref, onMounted, watch, onBeforeUnmount, renderSlot, useSlots, createVNode, inject, computed, withDirectives, provide, onUnmounted, resolveComponent, onUpdated } from "vue";
7
+ import { defineComponent, reactive, ref, onMounted, onBeforeUnmount, renderSlot, useSlots, createVNode, inject, watch, computed, withDirectives, provide, onUnmounted, resolveComponent, onUpdated } from "vue";
8
8
  const splitterProps = {
9
9
  orientation: {
10
10
  type: String,
@@ -44,140 +44,94 @@ const tooltipProps = {
44
44
  default: "100"
45
45
  }
46
46
  };
47
- const EventListener = {
48
- listen: function(target, eventType, callback) {
49
- if (target.addEventListener) {
50
- target.addEventListener(eventType, callback, false);
51
- return {
52
- remove() {
53
- target.removeEventListener(target, callback, false);
54
- }
55
- };
56
- } else {
57
- target.attchEvent(eventType, callback);
58
- return {
59
- remove() {
60
- target.detachEvent(eventType, callback);
61
- }
62
- };
63
- }
64
- }
65
- };
66
47
  var tooltip = "";
67
48
  var DToolTip = defineComponent({
68
49
  name: "DTooltip",
69
50
  props: tooltipProps,
70
- setup(props, ctx) {
51
+ setup(props) {
71
52
  const position = reactive({
72
53
  left: 0,
73
54
  top: 0
74
55
  });
75
- const show = ref(false);
76
- const slotElement = ref(null);
77
- const tooltip2 = ref(null);
78
- const arrow = ref(null);
79
- const tooltipcontent = ref(null);
80
- let enterEvent;
81
- let leaveEvent;
82
56
  const arrowStyle = (attr, value) => {
83
- arrow.value.style[attr] = value;
84
- };
85
- const delayShowTrue = function(fn, delay = props.mouseEnterDelay) {
86
- let start;
87
- if (parseInt(delay) >= 0) {
88
- return function() {
89
- if (start) {
90
- clearTimeout(start);
91
- }
92
- start = setTimeout(fn, parseInt(delay));
93
- };
94
- } else {
95
- console.error("the value of delay is bigger than 0 and the type of delay must be string!");
96
- return;
97
- }
57
+ document.getElementById("devui-arrow").style[attr] = value;
98
58
  };
59
+ const slotElement = ref(null);
99
60
  onMounted(() => {
100
- if (!show.value) {
101
- tooltip2.value.style.opacity = "0";
102
- }
103
- enterEvent = EventListener.listen(slotElement.value.children[0], "mouseenter", delayShowTrue(function() {
104
- show.value = true;
105
- }, props.mouseEnterDelay));
106
- leaveEvent = EventListener.listen(slotElement.value.children[0], "mouseleave", function() {
107
- if (show.value) {
108
- setTimeout(function() {
109
- show.value = false;
110
- }, props.mouseLeaveDelay);
111
- }
112
- });
113
- });
114
- watch(show, function(newValue, oldValue) {
115
- if (newValue) {
116
- tooltip2.value.style.opacity = "1";
117
- tooltip2.value.style.zIndex = "999";
118
- arrow.value.style.border = "5px solid transparent";
119
- switch (props.position) {
120
- case "top":
121
- position.left = slotElement.value.children[0].offsetLeft - tooltip2.value.offsetWidth / 2 + slotElement.value.children[0].offsetWidth / 2 - 5;
122
- position.top = slotElement.value.children[0].offsetTop - 10 - tooltipcontent.value.offsetHeight;
123
- arrowStyle("borderTop", "5px solid rgb(70, 77, 110)");
124
- arrow.value.style.top = `${tooltipcontent.value.offsetHeight}px`;
125
- arrow.value.style.left = `${tooltipcontent.value.offsetWidth / 2 + 5}px`;
126
- break;
127
- case "right":
128
- position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth;
129
- position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.value.offsetHeight / 2;
130
- arrowStyle("borderRight", "5px solid rgb(70, 77, 110)");
131
- arrow.value.style.top = `${tooltipcontent.value.offsetHeight / 2 - 5}px`;
132
- arrow.value.style.left = "-0px";
133
- break;
134
- case "bottom":
135
- position.top = slotElement.value.children[0].offsetHeight + slotElement.value.children[0].offsetTop + 10;
136
- position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth / 2 - tooltipcontent.value.offsetWidth / 2 - 5;
137
- arrowStyle("borderBottom", "5px solid rgb(70, 77, 110)");
138
- arrow.value.style.top = "-10px";
139
- arrow.value.style.left = `${tooltipcontent.value.offsetWidth / 2 + 5}px`;
140
- break;
141
- case "left":
142
- position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.value.offsetHeight / 2;
143
- position.left = slotElement.value.children[0].offsetLeft - 20 - tooltipcontent.value.offsetWidth;
144
- arrowStyle("borderLeft", "5px solid rgb(70, 77, 110)");
145
- arrow.value.style.left = `${tooltipcontent.value.offsetWidth + 10}px`;
146
- arrow.value.style.top = `${tooltipcontent.value.offsetHeight / 2 - 5}px`;
147
- break;
148
- default:
149
- console.error("The attribute position value is wrong, the value is one of top\u3001right\u3001left\u3001bottom");
150
- break;
151
- }
152
- tooltip2.value.style.top = position.top + "px";
153
- tooltip2.value.style.left = position.left + "px";
154
- } else {
155
- position.top = 0;
156
- position.left = 0;
157
- tooltip2.value.style.opacity = "0";
158
- }
61
+ slotElement.value.children[0].onmouseenter = function() {
62
+ const tooltip2 = document.createElement("div");
63
+ const arrow = document.createElement("div");
64
+ const tooltipcontent = document.createElement("div");
65
+ tooltip2.classList.add("tooltip");
66
+ arrow.classList.add("arrow");
67
+ tooltipcontent.classList.add("tooltipcontent");
68
+ arrow.id = "devui-arrow";
69
+ tooltip2.id = "devui-tooltip1";
70
+ setTimeout(() => {
71
+ document.getElementById("devui-tooltip").appendChild(tooltip2);
72
+ tooltip2.appendChild(arrow);
73
+ tooltip2.appendChild(tooltipcontent);
74
+ tooltipcontent.innerHTML = props.content;
75
+ tooltip2.style.opacity = "1";
76
+ tooltip2.style.zIndex = "999";
77
+ arrow.style.border = "5px solid transparent";
78
+ switch (props.position) {
79
+ case "top":
80
+ position.left = slotElement.value.children[0].offsetLeft - tooltip2.offsetWidth / 2 + slotElement.value.children[0].offsetWidth / 2 - 5;
81
+ position.top = slotElement.value.children[0].offsetTop - 10 - tooltipcontent.offsetHeight;
82
+ arrow.style.top = `${tooltipcontent.offsetHeight}px`;
83
+ arrow.style.left = `${tooltipcontent.offsetWidth / 2 + 5}px`;
84
+ arrow.style.borderTop = "5px solid rgb(70, 77, 110)";
85
+ break;
86
+ case "bottom":
87
+ position.top = slotElement.value.children[0].offsetHeight + slotElement.value.children[0].offsetTop + 10;
88
+ position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth / 2 - tooltipcontent.offsetWidth / 2 - 5;
89
+ arrowStyle("borderBottom", "5px solid rgb(70, 77, 110)");
90
+ arrow.style.top = "-10px";
91
+ arrow.style.left = `${tooltipcontent.offsetWidth / 2 + 5}px`;
92
+ arrow.style.borderBottom = "5px solid rgb(70, 77, 110)";
93
+ break;
94
+ case "left":
95
+ position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.offsetHeight / 2;
96
+ position.left = slotElement.value.children[0].offsetLeft - 20 - tooltipcontent.offsetWidth;
97
+ arrowStyle("borderLeft", "5px solid rgb(70, 77, 110)");
98
+ arrow.style.left = `${tooltipcontent.offsetWidth + 10}px`;
99
+ arrow.style.top = `${tooltipcontent.offsetHeight / 2 - 5}px`;
100
+ arrow.style.borderLeft = "5px solid rgb(70, 77, 110)";
101
+ break;
102
+ case "right":
103
+ position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth;
104
+ position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.offsetHeight / 2;
105
+ arrowStyle("borderRight", "5px solid rgb(70, 77, 110)");
106
+ arrow.style.top = `${tooltipcontent.offsetHeight / 2 - 5}px`;
107
+ arrow.style.left = "-0px";
108
+ arrow.style.borderRight = "5px solid rgb(70, 77, 110)";
109
+ break;
110
+ }
111
+ tooltip2.style.top = position.top + 5 + "px";
112
+ tooltip2.style.left = position.left + "px";
113
+ }, props.mouseEnterDelay);
114
+ };
115
+ slotElement.value.children[0].onmouseleave = function() {
116
+ setTimeout(() => {
117
+ document.getElementById("devui-tooltip1").removeChild(document.getElementById("devui-arrow"));
118
+ document.getElementById("devui-tooltip").removeChild(document.getElementById("devui-tooltip1"));
119
+ }, props.mouseLeaveDelay);
120
+ };
159
121
  });
160
122
  onBeforeUnmount(() => {
161
- enterEvent.remove();
162
- leaveEvent.remove();
123
+ slotElement.value.children[0].onmouseenter = null;
124
+ slotElement.value.children[0].onmouseleave = null;
163
125
  });
164
126
  return () => {
165
127
  const defaultSlot = renderSlot(useSlots(), "default");
166
128
  return createVNode("div", {
167
- "class": "devui-tooltip"
129
+ "class": "devui-tooltip",
130
+ "id": "devui-tooltip"
168
131
  }, [createVNode("div", {
169
132
  "class": "slotElement",
170
133
  "ref": slotElement
171
- }, [defaultSlot]), createVNode("div", {
172
- "class": "tooltip",
173
- "ref": tooltip2
174
- }, [createVNode("div", {
175
- "class": "arrow",
176
- "ref": arrow
177
- }, null), createVNode("div", {
178
- "class": "tooltipcontent",
179
- "ref": tooltipcontent
180
- }, [props.content])])]);
134
+ }, [defaultSlot])]);
181
135
  };
182
136
  }
183
137
  });
@@ -292,10 +246,10 @@ const splitterBarProps = {
292
246
  var splitterBar = "";
293
247
  var DSplitterBar = defineComponent({
294
248
  name: "DSplitterBar",
295
- props: splitterBarProps,
296
249
  components: {
297
250
  DToolTip
298
251
  },
252
+ props: splitterBarProps,
299
253
  setup(props) {
300
254
  const store = inject("splitterStore");
301
255
  const state = reactive({
@@ -607,7 +561,7 @@ var Splitter = defineComponent({
607
561
  provide("splitterStore", store);
608
562
  const domRef = ref();
609
563
  const refreshSplitterContainerSize = () => {
610
- if (!domRef)
564
+ if (!domRef.value)
611
565
  return;
612
566
  let containerSize = 0;
613
567
  if (props.orientation === "vertical") {
@@ -1 +1 @@
1
- var I=Object.defineProperty;var J=(v,s,C)=>s in v?I(v,s,{enumerable:!0,configurable:!0,writable:!0,value:C}):v[s]=C;var j=(v,s,C)=>(J(v,typeof s!="symbol"?s+"":s,C),C);(function(v,s){typeof exports=="object"&&typeof module!="undefined"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(v=typeof globalThis!="undefined"?globalThis:v||self,s(v.index={},v.Vue))})(this,function(v,s){"use strict";const C={orientation:{type:String,default:"horizontal"},splitBarSize:{type:String,default:"2px"},disabledBarSize:{type:String,default:"1px"},showCollapseButton:{type:Boolean,default:!0}},F={position:{type:String,default:"top"},showAnimation:{type:Boolean,default:!0},content:{type:String},mouseLeaveDelay:{type:String,default:"150"},mouseEnterDelay:{type:String,default:"100"}},R={listen:function(e,n,o){return e.addEventListener?(e.addEventListener(n,o,!1),{remove(){e.removeEventListener(e,o,!1)}}):(e.attchEvent(n,o),{remove(){e.detachEvent(n,o)}})}};var Q="",$=s.defineComponent({name:"DTooltip",props:F,setup(e,n){const o=s.reactive({left:0,top:0}),i=s.ref(!1),t=s.ref(null),r=s.ref(null),c=s.ref(null),p=s.ref(null);let h,m;const g=(a,u)=>{c.value.style[a]=u},d=function(a,u=e.mouseEnterDelay){let z;if(parseInt(u)>=0)return function(){z&&clearTimeout(z),z=setTimeout(a,parseInt(u))};console.error("the value of delay is bigger than 0 and the type of delay must be string!")};return s.onMounted(()=>{i.value||(r.value.style.opacity="0"),h=R.listen(t.value.children[0],"mouseenter",d(function(){i.value=!0},e.mouseEnterDelay)),m=R.listen(t.value.children[0],"mouseleave",function(){i.value&&setTimeout(function(){i.value=!1},e.mouseLeaveDelay)})}),s.watch(i,function(a,u){if(a){switch(r.value.style.opacity="1",r.value.style.zIndex="999",c.value.style.border="5px solid transparent",e.position){case"top":o.left=t.value.children[0].offsetLeft-r.value.offsetWidth/2+t.value.children[0].offsetWidth/2-5,o.top=t.value.children[0].offsetTop-10-p.value.offsetHeight,g("borderTop","5px solid rgb(70, 77, 110)"),c.value.style.top=`${p.value.offsetHeight}px`,c.value.style.left=`${p.value.offsetWidth/2+5}px`;break;case"right":o.left=t.value.children[0].offsetLeft+t.value.children[0].offsetWidth,o.top=t.value.children[0].offsetTop+t.value.children[0].offsetHeight/2-p.value.offsetHeight/2,g("borderRight","5px solid rgb(70, 77, 110)"),c.value.style.top=`${p.value.offsetHeight/2-5}px`,c.value.style.left="-0px";break;case"bottom":o.top=t.value.children[0].offsetHeight+t.value.children[0].offsetTop+10,o.left=t.value.children[0].offsetLeft+t.value.children[0].offsetWidth/2-p.value.offsetWidth/2-5,g("borderBottom","5px solid rgb(70, 77, 110)"),c.value.style.top="-10px",c.value.style.left=`${p.value.offsetWidth/2+5}px`;break;case"left":o.top=t.value.children[0].offsetTop+t.value.children[0].offsetHeight/2-p.value.offsetHeight/2,o.left=t.value.children[0].offsetLeft-20-p.value.offsetWidth,g("borderLeft","5px solid rgb(70, 77, 110)"),c.value.style.left=`${p.value.offsetWidth+10}px`,c.value.style.top=`${p.value.offsetHeight/2-5}px`;break;default:console.error("The attribute position value is wrong, the value is one of top\u3001right\u3001left\u3001bottom");break}r.value.style.top=o.top+"px",r.value.style.left=o.left+"px"}else o.top=0,o.left=0,r.value.style.opacity="0"}),s.onBeforeUnmount(()=>{h.remove(),m.remove()}),()=>{const a=s.renderSlot(s.useSlots(),"default");return s.createVNode("div",{class:"devui-tooltip"},[s.createVNode("div",{class:"slotElement",ref:t},[a]),s.createVNode("div",{class:"tooltip",ref:r},[s.createVNode("div",{class:"arrow",ref:c},null),s.createVNode("div",{class:"tooltipcontent",ref:p},[e.content])])])}}});function B(e,n){const o={},i=Object.keys(n);return i.forEach(t=>{o[t]=e.style[t]}),i.forEach(t=>{e.style[t]=n[t]}),o}function D(e,n){return e.classList?e.classList.contains(n):` ${e.className} `.indexOf(` ${n} `)>-1}function N(e,n){e.classList?e.classList.add(n):D(e,n)||(e.className=`${e.className} ${n}`)}function E(e,n){if(e.classList)e.classList.remove(n);else if(D(e,n)){const o=e.className;e.className=` ${o} `.replace(` ${n} `," ")}}const q={mounted(e,{value:n}){e.$value=n,n.enableResize&&G(e)},unmounted(e,{value:n}){n.enableResize&&Y(e,"mousedown",V)}};function G(e){X(e,"mousedown",V)}function X(e,n,o){e.addEventListener&&e.addEventListener(n,o)}function Y(e,n,o){e.removeEventListener&&e.removeEventListener(n,o)}function V(e){var t;const n=(t=e==null?void 0:e.target)==null?void 0:t.$value;if(!n)return;X(document,"mousemove",o),X(document,"mouseup",i),n.onPressEvent(T(e));function o(r){n.onDragEvent(T(r))}function i(r){Y(document,"mousemove",o),Y(document,"mouseup",i),n.onReleaseEvent(T(r))}}function T(e){return{pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,type:e.type,originalEvent:e}}const O={index:{type:Number},orientation:{type:String,required:!0},splitBarSize:{type:String,required:!0},disabledBarSize:{type:String,default:"1px"},showCollapseButton:{type:Boolean}};var Z="",U=s.defineComponent({name:"DSplitterBar",props:O,components:{DToolTip:$},setup(e){const n=s.inject("splitterStore"),o=s.reactive({wrapperClass:`devui-splitter-bar devui-splitter-bar-${e.orientation}`}),i=s.ref();s.watch([()=>e.splitBarSize,i],([l,f])=>{f instanceof HTMLElement&&B(f,{flexBasis:l})},{immediate:!0}),s.watch([()=>n.state.panes,i],([l,f])=>{n.isStaticBar(e.index)?B(f,{flexBasis:e.disabledBarSize}):o.wrapperClass+=" resizable"},{deep:!0});const t={pageX:0,pageY:0,originalX:0,originalY:0};let r;const c={enableResize:!0,onPressEvent:function({originalEvent:l}){l.stopPropagation(),!!n.isResizable(e.index)&&(r=n.dragState(e.index),t.originalX=l.pageX,t.originalY=l.pageY)},onDragEvent:function({originalEvent:l}){if(l.stopPropagation(),!n.isResizable(e.index))return;t.pageX=l.pageX,t.pageY=l.pageY;let f;e.orientation==="vertical"?f=t.pageY-t.originalY:f=t.pageX-t.originalX,n.setSize(r,f)},onReleaseEvent:function({originalEvent:l}){if(l.stopPropagation(),!n.isResizable(e.index))return;t.pageX=l.pageX,t.pageY=l.pageY;let f;e.orientation==="vertical"?f=t.pageY-t.originalY:f=t.pageX-t.originalX,n.setSize(r,f)}},p=(l,f)=>{const y=n.getPane(l),S=n.getPane(f);return{pane:y,nearPane:S}},h=(l,f,y)=>{var P,W,M,k;const S=((W=(P=l==null?void 0:l.component)==null?void 0:P.props)==null?void 0:W.collapsible)&&y,x=(k=(M=l==null?void 0:l.component)==null?void 0:M.props)==null?void 0:k.collapsed,w=f.collapsed;return{"devui-collapse":S,collapsed:x,hidden:w}},m=s.computed(()=>{var S,x;const{pane:l,nearPane:f}=p(e.index,e.index+1),y=((x=(S=l==null?void 0:l.component)==null?void 0:S.props)==null?void 0:x.collapseDirection)!=="after"||e.index===0;return h(l,f,y)}),g=s.computed(()=>{var S,x;const{pane:l,nearPane:f}=p(e.index+1,e.index),y=((x=(S=l==null?void 0:l.component)==null?void 0:S.props)==null?void 0:x.collapseDirection)!=="before"||e.index+1===n.state.paneCount-1;return h(l,f,y)}),d=()=>{var S,x,w,P;const{pane:l,nearPane:f}=p(e.index,e.index+1);((x=(S=l==null?void 0:l.component)==null?void 0:S.props)==null?void 0:x.collapsed)||((P=(w=f==null?void 0:f.component)==null?void 0:w.props)==null?void 0:P.collapsed)?N(i.value,"none-resizable"):E(i.value,"none-resizable")},a=l=>{n.tooglePane(e.index,e.index+1,l),d()},u=l=>{n.tooglePane(e.index+1,e.index,l),d()},z=()=>{a(!0),u(!0)};s.onMounted(()=>{z()});const b=()=>{var S,x,w,P;const{pane:l,nearPane:f}=p(e.index,e.index+1);return((x=(S=l==null?void 0:l.component)==null?void 0:S.props)==null?void 0:x.collapsed)||((P=(w=f==null?void 0:f.component)==null?void 0:w.props)==null?void 0:P.collapsed)?"\u5C55\u5F00":"\u6536\u8D77"};return()=>s.withDirectives(s.createVNode("div",{class:o.wrapperClass,ref:i},[e.showCollapseButton&&s.createVNode($,{content:b()},{default:()=>[s.createVNode("div",{class:["prev",m.value],onClick:()=>{a()}},null)]}),s.createVNode("div",{class:"devui-resize-handle"},null),e.showCollapseButton&&s.createVNode($,{content:b()},{default:()=>[s.createVNode("div",{class:["next",g.value],onClick:()=>u()},null)]})]),[[q,c]])}});class _{constructor(){j(this,"state");this.state=s.reactive({panes:[],splitterContainerSize:0,paneCount:0})}setPanes({panes:n}){this.state.panes=n.map((o,i)=>{var t;return o.component&&(o.component.exposed.order.value=i*2),o.getPaneSize=(t=o==null?void 0:o.component)==null?void 0:t.exposed.getPaneSize,o}),this.state.paneCount=n.length}setSplitter({containerSize:n}){this.state.splitterContainerSize=n}getPane(n){if(!this.state.panes||n<0||n>=this.state.panes.length)throw new Error("no pane can return.");return this.state.panes[n]}dragState(n){const o=this.getPane(n),i=this.getPane(n+1),t=o.getPaneSize()+i.getPaneSize();return{prev:{index:n,initialSize:o.getPaneSize(),minSize:this.toPixels(o.component.props.minSize)||t-this.toPixels(i.component.props.maxSize)||0,maxSize:this.toPixels(o.component.props.maxSize)||t-this.toPixels(i.component.props.minSize)||t},next:{index:n+1,initialSize:i.getPaneSize(),minSize:this.toPixels(i.component.props.minSize)||t-this.toPixels(o.component.props.maxSize)||0,maxSize:this.toPixels(i.component.props.maxSize)||t-this.toPixels(o.component.props.minSize)||t}}}clamp(n,o,i){return Math.min(o,Math.max(n,i))}resize(n,o){const i=this.getPane(n.index),t=this.state.splitterContainerSize,r=this.clamp(n.minSize,n.maxSize,n.initialSize+o);let c="";this.isPercent(i.component.props.size)?c=r/t*100+"%":c=r+"px",i.component.props.size=c,i.component.emit("sizeChange",c)}isResizable(n){var r,c,p,h,m,g,d,a;const o=this.getPane(n),i=this.getPane(n+1),t=((c=(r=o==null?void 0:o.component)==null?void 0:r.props)==null?void 0:c.collapsed)||((h=(p=i==null?void 0:i.component)==null?void 0:p.props)==null?void 0:h.collapsed);return((g=(m=o==null?void 0:o.component)==null?void 0:m.props)==null?void 0:g.resizable)&&((a=(d=i==null?void 0:i.component)==null?void 0:d.props)==null?void 0:a.resizable)&&!t}isStaticBar(n){var t,r,c,p;const o=this.getPane(n),i=this.getPane(n+1);return!(((r=(t=o==null?void 0:o.component)==null?void 0:t.props)==null?void 0:r.resizable)&&((p=(c=i==null?void 0:i.component)==null?void 0:c.props)==null?void 0:p.resizable))}isPercent(n){return/%$/.test(n)}toPixels(n){let o=parseFloat(n);return this.isPercent(n)&&(o=this.state.splitterContainerSize*o/100),o}tooglePane(n,o,i){var c,p,h,m,g,d,a,u,z,b,l,f,y;const t=this.getPane(n),r=this.getPane(o);((p=(c=t==null?void 0:t.component)==null?void 0:c.props)==null?void 0:p.collapsible)&&(t.component.props.collapsed=i?(m=(h=t==null?void 0:t.component)==null?void 0:h.props)==null?void 0:m.collapsed:!((d=(g=t==null?void 0:t.component)==null?void 0:g.props)==null?void 0:d.collapsed),(b=(a=r==null?void 0:r.component)==null?void 0:a.exposed)==null||b.toggleNearPaneFlexGrow((z=(u=t==null?void 0:t.component)==null?void 0:u.props)==null?void 0:z.collapsed),(y=t==null?void 0:t.component)==null||y.emit("collapsedChange",(f=(l=t==null?void 0:t.component)==null?void 0:l.props)==null?void 0:f.collapsed))}setSize(n,o){const i=this.getPane(n.prev.index),t=this.getPane(n.next.index);i.component.props.size&&t.component.props.size?(this.resize(n.prev,o),this.resize(n.next,-o)):t.component.props.size?this.resize(n.next,-o):this.resize(n.prev,o)}}var ee="",L=s.defineComponent({name:"DSplitter",components:{DSplitterBar:U},props:C,emits:[],setup(e,n){var p,h;const o=new _,i=s.reactive({panes:[]});i.panes=((h=(p=n.slots).DSplitterPane)==null?void 0:h.call(p))||[],o.setPanes({panes:i.panes}),s.provide("orientation",e.orientation),s.provide("splitterStore",o);const t=s.ref(),r=()=>{if(!t)return;let m=0;e.orientation==="vertical"?m=t.value.clientHeight:m=t.value.clientWidth,o.setSplitter({containerSize:m})},c=new ResizeObserver(r);return s.watch(t,m=>{!m||(r(),c.observe(t.value))}),s.onUnmounted(()=>{c.disconnect()}),()=>{const{splitBarSize:m,orientation:g,showCollapseButton:d}=e,a=["devui-splitter",`devui-splitter-${g}`];return s.createVNode("div",{class:a,ref:t},[i.panes,i.panes.filter((u,z,b)=>z!==b.length-1).map((u,z)=>s.createVNode(s.resolveComponent("d-splitter-bar"),{key:z,style:`order: ${z*2+1}`,splitBarSize:m,orientation:g,index:z,showCollapseButton:d},null))])}}});const A={size:{type:String},minSize:{type:String},maxSize:{type:String},resizable:{type:Boolean,default:!0},collapsible:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},collapseDirection:{type:String,default:"both"},shrink:{type:Boolean,default:!1},shrinkWidth:{type:Number,default:36}};var te="",H=s.defineComponent({name:"DSplitterPane",props:A,emits:["sizeChange","collapsedChange"],setup(e,{slots:n,expose:o}){const i=s.inject("splitterStore"),t=s.ref(),r=s.ref();s.watch([r,t],([d,a])=>{!a||B(a,{order:d})});const c=(d,a)=>{if(!a)return;a.style.flexBasis=d;const u="devui-splitter-pane-fixed";d?N(a,u):E(a,u)};s.watch([()=>e.size,t],([d,a])=>{c(d,a)},{immediate:!0});const p=s.inject("orientation");let h="";s.onMounted(()=>{h=e.size,i.setPanes({panes:i.state.panes})}),s.onUpdated(()=>{i.setPanes({panes:i.state.panes})});const m=()=>{const d=t.value;if(!!d)return p==="vertical"?d.offsetHeight:d.offsetWidth};return s.watch([()=>e.collapsed,t],([d,a])=>{if(!a)return;const u="devui-splitter-pane-hidden";d?N(a,u):E(a,u),d&&e.shrink?(E(a,u),B(a,{flexBasis:`${e.shrinkWidth}px`})):B(a,{flexBasis:h})},{immediate:!0}),o({order:r,getPaneSize:m,toggleNearPaneFlexGrow:d=>{const a=t.value;if(!(a instanceof HTMLElement))return;const u="devui-splitter-pane-grow";D(a,u)?E(a,u):d&&N(a,u)}}),()=>{var d;return s.createVNode("div",{class:"devui-splitter-pane",ref:t},[(d=n.default)==null?void 0:d.call(n)])}}});L.install=function(e){e.component(L.name,L),e.component(H.name,H)};var K={title:"Splitter \u5206\u5272\u5668",category:"\u5E03\u5C40",status:"100%",install(e){e.use(L)}};v.Splitter=L,v.default=K,Object.defineProperty(v,"__esModule",{value:!0}),v[Symbol.toStringTag]="Module"});
1
+ var A=Object.defineProperty;var K=(h,s,P)=>s in h?A(h,s,{enumerable:!0,configurable:!0,writable:!0,value:P}):h[s]=P;var k=(h,s,P)=>(K(h,typeof s!="symbol"?s+"":s,P),P);(function(h,s){typeof exports=="object"&&typeof module!="undefined"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(h=typeof globalThis!="undefined"?globalThis:h||self,s(h.index={},h.Vue))})(this,function(h,s){"use strict";const P={orientation:{type:String,default:"horizontal"},splitBarSize:{type:String,default:"2px"},disabledBarSize:{type:String,default:"1px"},showCollapseButton:{type:Boolean,default:!0}},j={position:{type:String,default:"top"},showAnimation:{type:Boolean,default:!0},content:{type:String},mouseLeaveDelay:{type:String,default:"150"},mouseEnterDelay:{type:String,default:"100"}};var J="",N=s.defineComponent({name:"DTooltip",props:j,setup(t){const e=s.reactive({left:0,top:0}),i=(o,r)=>{document.getElementById("devui-arrow").style[o]=r},n=s.ref(null);return s.onMounted(()=>{n.value.children[0].onmouseenter=function(){const o=document.createElement("div"),r=document.createElement("div"),a=document.createElement("div");o.classList.add("tooltip"),r.classList.add("arrow"),a.classList.add("tooltipcontent"),r.id="devui-arrow",o.id="devui-tooltip1",setTimeout(()=>{switch(document.getElementById("devui-tooltip").appendChild(o),o.appendChild(r),o.appendChild(a),a.innerHTML=t.content,o.style.opacity="1",o.style.zIndex="999",r.style.border="5px solid transparent",t.position){case"top":e.left=n.value.children[0].offsetLeft-o.offsetWidth/2+n.value.children[0].offsetWidth/2-5,e.top=n.value.children[0].offsetTop-10-a.offsetHeight,r.style.top=`${a.offsetHeight}px`,r.style.left=`${a.offsetWidth/2+5}px`,r.style.borderTop="5px solid rgb(70, 77, 110)";break;case"bottom":e.top=n.value.children[0].offsetHeight+n.value.children[0].offsetTop+10,e.left=n.value.children[0].offsetLeft+n.value.children[0].offsetWidth/2-a.offsetWidth/2-5,i("borderBottom","5px solid rgb(70, 77, 110)"),r.style.top="-10px",r.style.left=`${a.offsetWidth/2+5}px`,r.style.borderBottom="5px solid rgb(70, 77, 110)";break;case"left":e.top=n.value.children[0].offsetTop+n.value.children[0].offsetHeight/2-a.offsetHeight/2,e.left=n.value.children[0].offsetLeft-20-a.offsetWidth,i("borderLeft","5px solid rgb(70, 77, 110)"),r.style.left=`${a.offsetWidth+10}px`,r.style.top=`${a.offsetHeight/2-5}px`,r.style.borderLeft="5px solid rgb(70, 77, 110)";break;case"right":e.left=n.value.children[0].offsetLeft+n.value.children[0].offsetWidth,e.top=n.value.children[0].offsetTop+n.value.children[0].offsetHeight/2-a.offsetHeight/2,i("borderRight","5px solid rgb(70, 77, 110)"),r.style.top=`${a.offsetHeight/2-5}px`,r.style.left="-0px",r.style.borderRight="5px solid rgb(70, 77, 110)";break}o.style.top=e.top+5+"px",o.style.left=e.left+"px"},t.mouseEnterDelay)},n.value.children[0].onmouseleave=function(){setTimeout(()=>{document.getElementById("devui-tooltip1").removeChild(document.getElementById("devui-arrow")),document.getElementById("devui-tooltip").removeChild(document.getElementById("devui-tooltip1"))},t.mouseLeaveDelay)}}),s.onBeforeUnmount(()=>{n.value.children[0].onmouseenter=null,n.value.children[0].onmouseleave=null}),()=>{const o=s.renderSlot(s.useSlots(),"default");return s.createVNode("div",{class:"devui-tooltip",id:"devui-tooltip"},[s.createVNode("div",{class:"slotElement",ref:n},[o])])}}});function B(t,e){const i={},n=Object.keys(e);return n.forEach(o=>{i[o]=t.style[o]}),n.forEach(o=>{t.style[o]=e[o]}),i}function X(t,e){return t.classList?t.classList.contains(e):` ${t.className} `.indexOf(` ${e} `)>-1}function $(t,e){t.classList?t.classList.add(e):X(t,e)||(t.className=`${t.className} ${e}`)}function E(t,e){if(t.classList)t.classList.remove(e);else if(X(t,e)){const i=t.className;t.className=` ${i} `.replace(` ${e} `," ")}}const F={mounted(t,{value:e}){t.$value=e,e.enableResize&&q(t)},unmounted(t,{value:e}){e.enableResize&&D(t,"mousedown",T)}};function q(t){Y(t,"mousedown",T)}function Y(t,e,i){t.addEventListener&&t.addEventListener(e,i)}function D(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)}function T(t){var o;const e=(o=t==null?void 0:t.target)==null?void 0:o.$value;if(!e)return;Y(document,"mousemove",i),Y(document,"mouseup",n),e.onPressEvent(R(t));function i(r){e.onDragEvent(R(r))}function n(r){D(document,"mousemove",i),D(document,"mouseup",n),e.onReleaseEvent(R(r))}}function R(t){return{pageX:t.pageX,pageY:t.pageY,clientX:t.clientX,clientY:t.clientY,offsetX:t.offsetX,offsetY:t.offsetY,type:t.type,originalEvent:t}}const G={index:{type:Number},orientation:{type:String,required:!0},splitBarSize:{type:String,required:!0},disabledBarSize:{type:String,default:"1px"},showCollapseButton:{type:Boolean}};var Q="",I=s.defineComponent({name:"DSplitterBar",components:{DToolTip:N},props:G,setup(t){const e=s.inject("splitterStore"),i=s.reactive({wrapperClass:`devui-splitter-bar devui-splitter-bar-${t.orientation}`}),n=s.ref();s.watch([()=>t.splitBarSize,n],([l,p])=>{p instanceof HTMLElement&&B(p,{flexBasis:l})},{immediate:!0}),s.watch([()=>e.state.panes,n],([l,p])=>{e.isStaticBar(t.index)?B(p,{flexBasis:t.disabledBarSize}):i.wrapperClass+=" resizable"},{deep:!0});const o={pageX:0,pageY:0,originalX:0,originalY:0};let r;const a={enableResize:!0,onPressEvent:function({originalEvent:l}){l.stopPropagation(),!!e.isResizable(t.index)&&(r=e.dragState(t.index),o.originalX=l.pageX,o.originalY=l.pageY)},onDragEvent:function({originalEvent:l}){if(l.stopPropagation(),!e.isResizable(t.index))return;o.pageX=l.pageX,o.pageY=l.pageY;let p;t.orientation==="vertical"?p=o.pageY-o.originalY:p=o.pageX-o.originalX,e.setSize(r,p)},onReleaseEvent:function({originalEvent:l}){if(l.stopPropagation(),!e.isResizable(t.index))return;o.pageX=l.pageX,o.pageY=l.pageY;let p;t.orientation==="vertical"?p=o.pageY-o.originalY:p=o.pageX-o.originalX,e.setSize(r,p)}},f=(l,p)=>{const x=e.getPane(l),g=e.getPane(p);return{pane:x,nearPane:g}},S=(l,p,x)=>{var C,M,W,V;const g=((M=(C=l==null?void 0:l.component)==null?void 0:C.props)==null?void 0:M.collapsible)&&x,z=(V=(W=l==null?void 0:l.component)==null?void 0:W.props)==null?void 0:V.collapsed,w=p.collapsed;return{"devui-collapse":g,collapsed:z,hidden:w}},m=s.computed(()=>{var g,z;const{pane:l,nearPane:p}=f(t.index,t.index+1),x=((z=(g=l==null?void 0:l.component)==null?void 0:g.props)==null?void 0:z.collapseDirection)!=="after"||t.index===0;return S(l,p,x)}),y=s.computed(()=>{var g,z;const{pane:l,nearPane:p}=f(t.index+1,t.index),x=((z=(g=l==null?void 0:l.component)==null?void 0:g.props)==null?void 0:z.collapseDirection)!=="before"||t.index+1===e.state.paneCount-1;return S(l,p,x)}),d=()=>{var g,z,w,C;const{pane:l,nearPane:p}=f(t.index,t.index+1);((z=(g=l==null?void 0:l.component)==null?void 0:g.props)==null?void 0:z.collapsed)||((C=(w=p==null?void 0:p.component)==null?void 0:w.props)==null?void 0:C.collapsed)?$(n.value,"none-resizable"):E(n.value,"none-resizable")},c=l=>{e.tooglePane(t.index,t.index+1,l),d()},u=l=>{e.tooglePane(t.index+1,t.index,l),d()},v=()=>{c(!0),u(!0)};s.onMounted(()=>{v()});const b=()=>{var g,z,w,C;const{pane:l,nearPane:p}=f(t.index,t.index+1);return((z=(g=l==null?void 0:l.component)==null?void 0:g.props)==null?void 0:z.collapsed)||((C=(w=p==null?void 0:p.component)==null?void 0:w.props)==null?void 0:C.collapsed)?"\u5C55\u5F00":"\u6536\u8D77"};return()=>s.withDirectives(s.createVNode("div",{class:i.wrapperClass,ref:n},[t.showCollapseButton&&s.createVNode(N,{content:b()},{default:()=>[s.createVNode("div",{class:["prev",m.value],onClick:()=>{c()}},null)]}),s.createVNode("div",{class:"devui-resize-handle"},null),t.showCollapseButton&&s.createVNode(N,{content:b()},{default:()=>[s.createVNode("div",{class:["next",y.value],onClick:()=>u()},null)]})]),[[F,a]])}});class O{constructor(){k(this,"state");this.state=s.reactive({panes:[],splitterContainerSize:0,paneCount:0})}setPanes({panes:e}){this.state.panes=e.map((i,n)=>{var o;return i.component&&(i.component.exposed.order.value=n*2),i.getPaneSize=(o=i==null?void 0:i.component)==null?void 0:o.exposed.getPaneSize,i}),this.state.paneCount=e.length}setSplitter({containerSize:e}){this.state.splitterContainerSize=e}getPane(e){if(!this.state.panes||e<0||e>=this.state.panes.length)throw new Error("no pane can return.");return this.state.panes[e]}dragState(e){const i=this.getPane(e),n=this.getPane(e+1),o=i.getPaneSize()+n.getPaneSize();return{prev:{index:e,initialSize:i.getPaneSize(),minSize:this.toPixels(i.component.props.minSize)||o-this.toPixels(n.component.props.maxSize)||0,maxSize:this.toPixels(i.component.props.maxSize)||o-this.toPixels(n.component.props.minSize)||o},next:{index:e+1,initialSize:n.getPaneSize(),minSize:this.toPixels(n.component.props.minSize)||o-this.toPixels(i.component.props.maxSize)||0,maxSize:this.toPixels(n.component.props.maxSize)||o-this.toPixels(i.component.props.minSize)||o}}}clamp(e,i,n){return Math.min(i,Math.max(e,n))}resize(e,i){const n=this.getPane(e.index),o=this.state.splitterContainerSize,r=this.clamp(e.minSize,e.maxSize,e.initialSize+i);let a="";this.isPercent(n.component.props.size)?a=r/o*100+"%":a=r+"px",n.component.props.size=a,n.component.emit("sizeChange",a)}isResizable(e){var r,a,f,S,m,y,d,c;const i=this.getPane(e),n=this.getPane(e+1),o=((a=(r=i==null?void 0:i.component)==null?void 0:r.props)==null?void 0:a.collapsed)||((S=(f=n==null?void 0:n.component)==null?void 0:f.props)==null?void 0:S.collapsed);return((y=(m=i==null?void 0:i.component)==null?void 0:m.props)==null?void 0:y.resizable)&&((c=(d=n==null?void 0:n.component)==null?void 0:d.props)==null?void 0:c.resizable)&&!o}isStaticBar(e){var o,r,a,f;const i=this.getPane(e),n=this.getPane(e+1);return!(((r=(o=i==null?void 0:i.component)==null?void 0:o.props)==null?void 0:r.resizable)&&((f=(a=n==null?void 0:n.component)==null?void 0:a.props)==null?void 0:f.resizable))}isPercent(e){return/%$/.test(e)}toPixels(e){let i=parseFloat(e);return this.isPercent(e)&&(i=this.state.splitterContainerSize*i/100),i}tooglePane(e,i,n){var a,f,S,m,y,d,c,u,v,b,l,p,x;const o=this.getPane(e),r=this.getPane(i);((f=(a=o==null?void 0:o.component)==null?void 0:a.props)==null?void 0:f.collapsible)&&(o.component.props.collapsed=n?(m=(S=o==null?void 0:o.component)==null?void 0:S.props)==null?void 0:m.collapsed:!((d=(y=o==null?void 0:o.component)==null?void 0:y.props)==null?void 0:d.collapsed),(b=(c=r==null?void 0:r.component)==null?void 0:c.exposed)==null||b.toggleNearPaneFlexGrow((v=(u=o==null?void 0:o.component)==null?void 0:u.props)==null?void 0:v.collapsed),(x=o==null?void 0:o.component)==null||x.emit("collapsedChange",(p=(l=o==null?void 0:o.component)==null?void 0:l.props)==null?void 0:p.collapsed))}setSize(e,i){const n=this.getPane(e.prev.index),o=this.getPane(e.next.index);n.component.props.size&&o.component.props.size?(this.resize(e.prev,i),this.resize(e.next,-i)):o.component.props.size?this.resize(e.next,-i):this.resize(e.prev,i)}}var Z="",L=s.defineComponent({name:"DSplitter",components:{DSplitterBar:I},props:P,emits:[],setup(t,e){var f,S;const i=new O,n=s.reactive({panes:[]});n.panes=((S=(f=e.slots).DSplitterPane)==null?void 0:S.call(f))||[],i.setPanes({panes:n.panes}),s.provide("orientation",t.orientation),s.provide("splitterStore",i);const o=s.ref(),r=()=>{if(!o.value)return;let m=0;t.orientation==="vertical"?m=o.value.clientHeight:m=o.value.clientWidth,i.setSplitter({containerSize:m})},a=new ResizeObserver(r);return s.watch(o,m=>{!m||(r(),a.observe(o.value))}),s.onUnmounted(()=>{a.disconnect()}),()=>{const{splitBarSize:m,orientation:y,showCollapseButton:d}=t,c=["devui-splitter",`devui-splitter-${y}`];return s.createVNode("div",{class:c,ref:o},[n.panes,n.panes.filter((u,v,b)=>v!==b.length-1).map((u,v)=>s.createVNode(s.resolveComponent("d-splitter-bar"),{key:v,style:`order: ${v*2+1}`,splitBarSize:m,orientation:y,index:v,showCollapseButton:d},null))])}}});const U={size:{type:String},minSize:{type:String},maxSize:{type:String},resizable:{type:Boolean,default:!0},collapsible:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},collapseDirection:{type:String,default:"both"},shrink:{type:Boolean,default:!1},shrinkWidth:{type:Number,default:36}};var ee="",H=s.defineComponent({name:"DSplitterPane",props:U,emits:["sizeChange","collapsedChange"],setup(t,{slots:e,expose:i}){const n=s.inject("splitterStore"),o=s.ref(),r=s.ref();s.watch([r,o],([d,c])=>{!c||B(c,{order:d})});const a=(d,c)=>{if(!c)return;c.style.flexBasis=d;const u="devui-splitter-pane-fixed";d?$(c,u):E(c,u)};s.watch([()=>t.size,o],([d,c])=>{a(d,c)},{immediate:!0});const f=s.inject("orientation");let S="";s.onMounted(()=>{S=t.size,n.setPanes({panes:n.state.panes})}),s.onUpdated(()=>{n.setPanes({panes:n.state.panes})});const m=()=>{const d=o.value;if(!!d)return f==="vertical"?d.offsetHeight:d.offsetWidth};return s.watch([()=>t.collapsed,o],([d,c])=>{if(!c)return;const u="devui-splitter-pane-hidden";d?$(c,u):E(c,u),d&&t.shrink?(E(c,u),B(c,{flexBasis:`${t.shrinkWidth}px`})):B(c,{flexBasis:S})},{immediate:!0}),i({order:r,getPaneSize:m,toggleNearPaneFlexGrow:d=>{const c=o.value;if(!(c instanceof HTMLElement))return;const u="devui-splitter-pane-grow";X(c,u)?E(c,u):d&&$(c,u)}}),()=>{var d;return s.createVNode("div",{class:"devui-splitter-pane",ref:o},[(d=e.default)==null?void 0:d.call(e)])}}});L.install=function(t){t.component(L.name,L),t.component(H.name,H)};var _={title:"Splitter \u5206\u5272\u5668",category:"\u5E03\u5C40",status:"100%",install(t){t.use(L)}};h.Splitter=L,h.default=_,Object.defineProperty(h,"__esModule",{value:!0}),h[Symbol.toStringTag]="Module"});
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { defineComponent, ref, computed, onMounted, watch, createVNode, mergeProps } from "vue";
7
+ import { defineComponent, ref, computed, onMounted, watch, createVNode, mergeProps, createTextVNode } from "vue";
8
8
  const statisticProps = {
9
9
  title: {
10
10
  type: String,
@@ -26,14 +26,7 @@ const statisticProps = {
26
26
  type: String,
27
27
  default: ""
28
28
  },
29
- showGroupSeparator: {
30
- type: Boolean,
31
- default: true
32
- },
33
- titleStyle: {
34
- type: Object
35
- },
36
- contentStyle: {
29
+ valueStyle: {
37
30
  type: Object
38
31
  },
39
32
  animationDuration: {
@@ -49,25 +42,17 @@ const statisticProps = {
49
42
  },
50
43
  start: {
51
44
  type: Boolean,
52
- default: false
45
+ default: true
53
46
  },
54
47
  extra: {
55
48
  type: String,
56
49
  default: ""
57
- },
58
- easing: {
59
- type: String,
60
- default: "easeOutCubic"
61
- },
62
- delay: {
63
- type: Number,
64
- default: 0
65
50
  }
66
51
  };
67
- const separator = (SeparatorString, groupSeparator, showGroupSeparator) => {
52
+ const separator = (SeparatorString, groupSeparator) => {
68
53
  const res = SeparatorString.replace(/\d+/, function(n) {
69
54
  return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
70
- return $1 + `${showGroupSeparator ? groupSeparator : ""}`;
55
+ return $1 + `${groupSeparator}`;
71
56
  });
72
57
  });
73
58
  return res;
@@ -77,13 +62,13 @@ const isHasDot = (value) => {
77
62
  return (value + "").indexOf(".") !== -1;
78
63
  }
79
64
  };
80
- const analysisValueType = (value, propsValue, groupSeparator, splitPrecisionNumber, showGroupSeparator) => {
65
+ const analysisValueType = (value, propsValue, groupSeparator, splitPrecisionNumber) => {
81
66
  const fixedNumber = propsValue.toString().indexOf(".") !== -1 ? propsValue.toString().length - propsValue.toString().indexOf(".") - 1 : 0;
82
67
  if (typeof value === "number") {
83
68
  if (isHasDot(value)) {
84
- return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator, showGroupSeparator) : separator(value.toFixed(fixedNumber).toString(), groupSeparator, showGroupSeparator);
69
+ return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator) : separator(value.toFixed(fixedNumber).toString(), groupSeparator);
85
70
  } else {
86
- return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator, showGroupSeparator) : separator(value.toString(), groupSeparator, showGroupSeparator);
71
+ return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator) : separator(value.toString(), groupSeparator);
87
72
  }
88
73
  } else {
89
74
  return value;
@@ -220,9 +205,9 @@ var Statistic = defineComponent({
220
205
  to: {
221
206
  value: to
222
207
  },
223
- delay: props.delay,
208
+ delay: 0,
224
209
  duration: props.animationDuration,
225
- easing: props.easing,
210
+ easing: "easeOutCubic",
226
211
  onUpdate: (keys) => {
227
212
  innerValue.value = keys.value;
228
213
  },
@@ -234,7 +219,7 @@ var Statistic = defineComponent({
234
219
  }
235
220
  };
236
221
  const statisticValue = computed(() => {
237
- return analysisValueType(innerValue.value, props.value, props.groupSeparator, props.precision, props.showGroupSeparator);
222
+ return analysisValueType(innerValue.value, props.value, props.groupSeparator, props.precision);
238
223
  });
239
224
  onMounted(() => {
240
225
  if (props.animation && props.start) {
@@ -247,7 +232,7 @@ var Statistic = defineComponent({
247
232
  }
248
233
  });
249
234
  return () => {
250
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
235
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
251
236
  return createVNode("div", mergeProps({
252
237
  "class": "devui-statistic"
253
238
  }, ctx.attrs), [createVNode("div", {
@@ -255,14 +240,16 @@ var Statistic = defineComponent({
255
240
  "style": props.titleStyle
256
241
  }, [((_b = (_a2 = ctx.slots).title) == null ? void 0 : _b.call(_a2)) || props.title]), createVNode("div", {
257
242
  "class": "devui-statistic-content",
258
- "style": props.contentStyle
243
+ "style": props.valueStyle
259
244
  }, [props.prefix || ((_d = (_c = ctx.slots).prefix) == null ? void 0 : _d.call(_c)) ? createVNode("span", {
260
245
  "class": "devui-statistic-prefix"
261
246
  }, [((_f = (_e = ctx.slots).prefix) == null ? void 0 : _f.call(_e)) || props.prefix]) : null, createVNode("span", {
262
247
  "class": "devui-statistic--value"
263
248
  }, [statisticValue.value]), props.suffix || ((_h = (_g = ctx.slots).suffix) == null ? void 0 : _h.call(_g)) ? createVNode("span", {
264
249
  "class": "devui-statistic-suffix"
265
- }, [((_j = (_i = ctx.slots).suffix) == null ? void 0 : _j.call(_i)) || props.suffix]) : null]), ((_l = (_k = ctx.slots).extra) == null ? void 0 : _l.call(_k)) || props.extra]);
250
+ }, [((_j = (_i = ctx.slots).suffix) == null ? void 0 : _j.call(_i)) || props.suffix]) : null]), props.extra || ((_l = (_k = ctx.slots).extra) == null ? void 0 : _l.call(_k)) ? createVNode("div", {
251
+ "class": "devui-statistic-extra"
252
+ }, [createTextVNode(" "), ((_n = (_m = ctx.slots).extra) == null ? void 0 : _n.call(_m)) || props.extra]) : null]);
266
253
  };
267
254
  }
268
255
  });
@@ -1 +1 @@
1
- var q=Object.defineProperty;var B=(a,e,f)=>e in a?q(a,e,{enumerable:!0,configurable:!0,writable:!0,value:f}):a[e]=f;var s=(a,e,f)=>(B(a,typeof e!="symbol"?e+"":e,f),f);(function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.index={},a.Vue))})(this,function(a,e){"use strict";const f={title:{type:String,default:""},value:{type:[Number,String]},prefix:{type:String},suffix:{type:String},precision:{type:Number},groupSeparator:{type:String,default:""},showGroupSeparator:{type:Boolean,default:!0},titleStyle:{type:Object},contentStyle:{type:Object},animationDuration:{type:Number,default:2e3},valueFrom:{type:Number},animation:{type:Boolean,default:!1},start:{type:Boolean,default:!1},extra:{type:String,default:""},easing:{type:String,default:"easeOutCubic"},delay:{type:Number,default:0}},g=(t,i,n)=>t.replace(/\d+/,function(u){return u.replace(/(\d)(?=(\d{3})+$)/g,function(h){return h+`${n?i:""}`})}),w=t=>{if(!isNaN(t))return(t+"").indexOf(".")!==-1},C=(t,i,n,r,u)=>{const h=i.toString().indexOf(".")!==-1?i.toString().length-i.toString().indexOf(".")-1:0;return typeof t=="number"?w(t)?g(r?t.toFixed(r).toString():t.toFixed(h).toString(),n,u):g(r?t.toFixed(r).toString():t.toString(),n,u):t},c=Math.pow,v=Math.sqrt,D=function(t){return 1-c(1-t,3)},E=t=>t,V=function(t){return t===1?1:1-c(2,-10*t)},A=function(t){return t===0?0:t===1?1:t<.5?c(2,20*t-10)/2:(2-c(2,-20*t+10))/2},I=function(t){return t===0?0:c(2,10*t-10)},M=function(t){return t<.5?(1-v(1-c(2*t,2)))/2:(v(1-c(-2*t+2,2))+1)/2};var _=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",easeOutCubic:D,linear:E,easeOutExpo:V,easeInOutExpo:A,easeInExpo:I,easeInOutCirc:M});class j{constructor(i){s(this,"from");s(this,"to");s(this,"duration");s(this,"delay");s(this,"easing");s(this,"onStart");s(this,"onUpdate");s(this,"onFinish");s(this,"startTime");s(this,"started");s(this,"finished");s(this,"timer");s(this,"time");s(this,"elapsed");s(this,"keys");const{from:n,to:r,duration:u,delay:h,easing:S,onStart:l,onUpdate:d,onFinish:m}=i;for(const o in n)r[o]===void 0&&(r[o]=n[o]);for(const o in r)n[o]===void 0&&(n[o]=r[o]);this.from=n,this.to=r,this.duration=u,this.delay=h,this.easing=S,this.onStart=l,this.onUpdate=d,this.onFinish=m,this.startTime=Date.now()+this.delay,this.started=!1,this.finished=!1,this.timer=null,this.keys={}}update(){if(this.time=Date.now(),!(this.time<this.startTime)&&!this.finished){if(this.elapsed===this.duration){this.finished||(this.finished=!0,this.onFinish&&this.onFinish(this.keys));return}this.elapsed=this.time-this.startTime,this.elapsed=this.elapsed>this.duration?this.duration:this.elapsed;for(const i in this.to)this.keys[i]=this.from[i]+(this.to[i]-this.from[i])*_[this.easing](this.elapsed/this.duration);this.started||(this.onStart&&this.onStart(this.keys),this.started=!0),this.onUpdate(this.keys)}}start(){this.startTime=Date.now()+this.delay;const i=()=>{this.update(),this.timer=requestAnimationFrame(i),this.finished&&(cancelAnimationFrame(this.timer),this.timer=null)};i()}stop(){cancelAnimationFrame(this.timer),this.timer=null}}var $="",y=e.defineComponent({name:"DStatistic",inheritAttrs:!1,props:f,setup(t,i){var S;const n=e.ref((S=t.valueFrom)!=null?S:t.value),r=e.ref(null),u=(l=(m=>(m=t.valueFrom)!=null?m:0)(),d=typeof t.value=="number"?t.value:Number(t.value))=>{l!==d&&(r.value=new j({from:{value:l},to:{value:d},delay:t.delay,duration:t.animationDuration,easing:t.easing,onUpdate:o=>{n.value=o.value},onFinish:()=>{n.value=d}}),r.value.start())},h=e.computed(()=>C(n.value,t.value,t.groupSeparator,t.precision,t.showGroupSeparator));return e.onMounted(()=>{t.animation&&t.start&&u()}),e.watch(()=>t.start,l=>{l&&!r.value&&u()}),()=>{var l,d,m,o,x,F,O,b,p,N,T,k;return e.createVNode("div",e.mergeProps({class:"devui-statistic"},i.attrs),[e.createVNode("div",{class:"devui-statistic-title",style:t.titleStyle},[((d=(l=i.slots).title)==null?void 0:d.call(l))||t.title]),e.createVNode("div",{class:"devui-statistic-content",style:t.contentStyle},[t.prefix||((o=(m=i.slots).prefix)==null?void 0:o.call(m))?e.createVNode("span",{class:"devui-statistic-prefix"},[((F=(x=i.slots).prefix)==null?void 0:F.call(x))||t.prefix]):null,e.createVNode("span",{class:"devui-statistic--value"},[h.value]),t.suffix||((b=(O=i.slots).suffix)==null?void 0:b.call(O))?e.createVNode("span",{class:"devui-statistic-suffix"},[((N=(p=i.slots).suffix)==null?void 0:N.call(p))||t.suffix]):null]),((k=(T=i.slots).extra)==null?void 0:k.call(T))||t.extra])}}});y.install=function(t){t.component(y.name,y)};var U={title:"Statistic \u7EDF\u8BA1\u6570\u503C",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.use(y)}};a.Statistic=y,a.default=U,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
1
+ var $=Object.defineProperty;var z=(a,e,f)=>e in a?$(a,e,{enumerable:!0,configurable:!0,writable:!0,value:f}):a[e]=f;var n=(a,e,f)=>(z(a,typeof e!="symbol"?e+"":e,f),f);(function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.index={},a.Vue))})(this,function(a,e){"use strict";const f={title:{type:String,default:""},value:{type:[Number,String]},prefix:{type:String},suffix:{type:String},precision:{type:Number},groupSeparator:{type:String,default:""},valueStyle:{type:Object},animationDuration:{type:Number,default:2e3},valueFrom:{type:Number},animation:{type:Boolean,default:!1},start:{type:Boolean,default:!0},extra:{type:String,default:""}},y=(t,i)=>t.replace(/\d+/,function(s){return s.replace(/(\d)(?=(\d{3})+$)/g,function(l){return l+`${i}`})}),C=t=>{if(!isNaN(t))return(t+"").indexOf(".")!==-1},D=(t,i,r,s)=>{const l=i.toString().indexOf(".")!==-1?i.toString().length-i.toString().indexOf(".")-1:0;return typeof t=="number"?C(t)?y(s?t.toFixed(s).toString():t.toFixed(l).toString(),r):y(s?t.toFixed(s).toString():t.toString(),r):t},c=Math.pow,v=Math.sqrt,E=function(t){return 1-c(1-t,3)},A=t=>t,I=function(t){return t===1?1:1-c(2,-10*t)},M=function(t){return t===0?0:t===1?1:t<.5?c(2,20*t-10)/2:(2-c(2,-20*t+10))/2},_=function(t){return t===0?0:c(2,10*t-10)},U=function(t){return t<.5?(1-v(1-c(2*t,2)))/2:(v(1-c(-2*t+2,2))+1)/2};var j=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",easeOutCubic:E,linear:A,easeOutExpo:I,easeInOutExpo:M,easeInExpo:_,easeInOutCirc:U});class q{constructor(i){n(this,"from");n(this,"to");n(this,"duration");n(this,"delay");n(this,"easing");n(this,"onStart");n(this,"onUpdate");n(this,"onFinish");n(this,"startTime");n(this,"started");n(this,"finished");n(this,"timer");n(this,"time");n(this,"elapsed");n(this,"keys");const{from:r,to:s,duration:l,delay:g,easing:S,onStart:u,onUpdate:d,onFinish:h}=i;for(const o in r)s[o]===void 0&&(s[o]=r[o]);for(const o in s)r[o]===void 0&&(r[o]=s[o]);this.from=r,this.to=s,this.duration=l,this.delay=g,this.easing=S,this.onStart=u,this.onUpdate=d,this.onFinish=h,this.startTime=Date.now()+this.delay,this.started=!1,this.finished=!1,this.timer=null,this.keys={}}update(){if(this.time=Date.now(),!(this.time<this.startTime)&&!this.finished){if(this.elapsed===this.duration){this.finished||(this.finished=!0,this.onFinish&&this.onFinish(this.keys));return}this.elapsed=this.time-this.startTime,this.elapsed=this.elapsed>this.duration?this.duration:this.elapsed;for(const i in this.to)this.keys[i]=this.from[i]+(this.to[i]-this.from[i])*j[this.easing](this.elapsed/this.duration);this.started||(this.onStart&&this.onStart(this.keys),this.started=!0),this.onUpdate(this.keys)}}start(){this.startTime=Date.now()+this.delay;const i=()=>{this.update(),this.timer=requestAnimationFrame(i),this.finished&&(cancelAnimationFrame(this.timer),this.timer=null)};i()}stop(){cancelAnimationFrame(this.timer),this.timer=null}}var H="",m=e.defineComponent({name:"DStatistic",inheritAttrs:!1,props:f,setup(t,i){var S;const r=e.ref((S=t.valueFrom)!=null?S:t.value),s=e.ref(null),l=(u=(h=>(h=t.valueFrom)!=null?h:0)(),d=typeof t.value=="number"?t.value:Number(t.value))=>{u!==d&&(s.value=new q({from:{value:u},to:{value:d},delay:0,duration:t.animationDuration,easing:"easeOutCubic",onUpdate:o=>{r.value=o.value},onFinish:()=>{r.value=d}}),s.value.start())},g=e.computed(()=>D(r.value,t.value,t.groupSeparator,t.precision));return e.onMounted(()=>{t.animation&&t.start&&l()}),e.watch(()=>t.start,u=>{u&&!s.value&&l()}),()=>{var u,d,h,o,x,F,p,O,b,N,T,k,V,w;return e.createVNode("div",e.mergeProps({class:"devui-statistic"},i.attrs),[e.createVNode("div",{class:"devui-statistic-title",style:t.titleStyle},[((d=(u=i.slots).title)==null?void 0:d.call(u))||t.title]),e.createVNode("div",{class:"devui-statistic-content",style:t.valueStyle},[t.prefix||((o=(h=i.slots).prefix)==null?void 0:o.call(h))?e.createVNode("span",{class:"devui-statistic-prefix"},[((F=(x=i.slots).prefix)==null?void 0:F.call(x))||t.prefix]):null,e.createVNode("span",{class:"devui-statistic--value"},[g.value]),t.suffix||((O=(p=i.slots).suffix)==null?void 0:O.call(p))?e.createVNode("span",{class:"devui-statistic-suffix"},[((N=(b=i.slots).suffix)==null?void 0:N.call(b))||t.suffix]):null]),t.extra||((k=(T=i.slots).extra)==null?void 0:k.call(T))?e.createVNode("div",{class:"devui-statistic-extra"},[e.createTextVNode(" "),((w=(V=i.slots).extra)==null?void 0:w.call(V))||t.extra]):null])}}});m.install=function(t){t.component(m.name,m)};var B={title:"Statistic \u7EDF\u8BA1\u6570\u503C",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.use(m)}};a.Statistic=m,a.default=B,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
@@ -1 +1 @@
1
- .devui-statistic{box-sizing:border-box;margin:0;padding:0;font-size:14px;line-height:1.5715;list-style:none}.devui-statistic-title{margin-bottom:4px;opacity:.7;font-size:14px}.devui-statistic-content{font-size:24px;display:flex;align-items:center}.devui-statistic-prefix{margin-right:6px;display:flex;align-items:center}.devui-statistic-suffix{margin-left:6px;display:flex;align-items:center}.devui-statistic--value{display:inline-block}
1
+ .devui-statistic{box-sizing:border-box;margin:0;padding:0;font-size:14px;line-height:1.5715;list-style:none}.devui-statistic-title{margin-bottom:4px;font-size:14px}.devui-statistic-content{font-size:24px;display:flex;align-items:center}.devui-statistic-prefix{margin-right:6px;display:flex;align-items:center}.devui-statistic-suffix{margin-left:6px;display:flex;align-items:center}.devui-statistic--value{display:inline-block}
package/status/style.css CHANGED
@@ -1 +1 @@
1
- .devui-font-size-base{font-size:var(--devui-font-size, 12px)}.devui-font-base{font-size:var(--devui-font-size, 12px);font-weight:normal;line-height:1.5}.devui-font-size-modal-title{font-size:var(--devui-font-size-modal-title, 18px)}.devui-font-modal-title{font-size:var(--devui-font-size-modal-title, 18px);font-weight:bold;line-height:1.5}.devui-font-size-page-title{font-size:var(--devui-font-size-page-title, 16px)}.devui-font-page-title{font-size:var(--devui-font-size-page-title, 16px);font-weight:bold;line-height:1.5}.devui-font-size-secondary-title{font-size:var(--devui-font-size-card-title, 14px)}.devui-font-secondary-title{font-size:var(--devui-font-size-card-title, 14px);font-weight:bold;line-height:1.5}.devui-status{line-height:20px;height:20px;display:flex;align-items:center}.devui-status:before{display:inline-block;content:"";width:10px;height:10px;margin-right:5px;border-radius:100%}.devui-status.devui-status-bg-success:before{background-color:var(--devui-success, #50d4ab)}.devui-status.devui-status-bg-error:before{background-color:var(--devui-danger, #f66f6a)}.devui-status.devui-status-bg-warning:before{background-color:var(--devui-warning, #fac20a)}.devui-status.devui-status-bg-initial:before{background-color:var(--devui-initial, #e9edfa)}.devui-status.devui-status-bg-waiting:before{background-color:var(--devui-waiting, #9faad7)}.devui-status.devui-status-bg-running:before{background-color:var(--devui-info, #5e7ce0)}.devui-status.devui-status-bg-invalid:before{background-color:var(--devui-dividing-line, #dfe1e6)}
1
+ .devui-font-size-base{font-size:var(--devui-font-size, 12px)}.devui-font-base{font-size:var(--devui-font-size, 12px);font-weight:400;line-height:1.5}.devui-font-size-modal-title{font-size:var(--devui-font-size-modal-title, 18px)}.devui-font-modal-title{font-size:var(--devui-font-size-modal-title, 18px);font-weight:700;line-height:1.5}.devui-font-size-page-title{font-size:var(--devui-font-size-page-title, 16px)}.devui-font-page-title{font-size:var(--devui-font-size-page-title, 16px);font-weight:700;line-height:1.5}.devui-font-size-secondary-title{font-size:var(--devui-font-size-card-title, 14px)}.devui-font-secondary-title{font-size:var(--devui-font-size-card-title, 14px);font-weight:700;line-height:1.5}.devui-status{line-height:20px;height:20px;display:flex;align-items:center}.devui-status:before{display:inline-block;content:"";width:10px;height:10px;margin-right:5px;border-radius:100%}.devui-status.devui-status-bg-success:before{background-color:var(--devui-success, #50d4ab)}.devui-status.devui-status-bg-error:before{background-color:var(--devui-danger, #f66f6a)}.devui-status.devui-status-bg-warning:before{background-color:var(--devui-warning, #fac20a)}.devui-status.devui-status-bg-initial:before{background-color:var(--devui-initial, #e9edfa)}.devui-status.devui-status-bg-waiting:before{background-color:var(--devui-waiting, #9faad7)}.devui-status.devui-status-bg-running:before{background-color:var(--devui-info, #5e7ce0)}.devui-status.devui-status-bg-invalid:before{background-color:var(--devui-dividing-line, #dfe1e6)}
@@ -1 +1 @@
1
- (function(a,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(a=typeof globalThis!="undefined"?globalThis:a||self,i(a.index={},a.Vue))})(this,function(a,i){"use strict";var r=i.defineComponent({name:"DSticky",props:{zIndex:{type:Number},container:{type:Object},view:{type:Object,default:()=>({top:0,bottom:0})},scrollTarget:{type:Object}},emits:["statusChange"],setup(e,h){const{slots:C}=h;let c,d,f,g;const B=16,S=100;let u,R=0;const s=i.reactive({status:"normal"});i.watch(()=>e.zIndex,()=>{w()}),i.watch(()=>e.container,()=>{w()}),i.watch(()=>e.scrollTarget,()=>{w()}),i.watch(()=>s.status,()=>{h.emit("statusChange",s.status)},{immediate:!0});const w=()=>{u=p.value.parentElement,e.container?c=e.container:c=u,p.value.style.zIndex=e.zIndex,d=e.scrollTarget||window,d.addEventListener("scroll",x),I(d)},I=l=>{const t=l===window?[document.documentElement,document.body]:[l];let o=!1;t.forEach(n=>{n.scrollTop&&n.scrollTop>0&&(o=!0)}),o&&setTimeout(v)},y=l=>{const t=p.value||document.createElement("div");switch(l){case"normal":t.style.top="auto",t.style.left="auto",t.style.position="static";break;case"follow":const n=d&&d!==window?d.getBoundingClientRect().top:0;t.style.top=+n+(e.view&&e.view.top||0)+"px",t.style.left=t.getBoundingClientRect().left+"px",t.style.position="fixed";break;case"stay":t.style.top=T(t,u,"top")+"px",t.style.left="auto",t.style.position="relative";break;case"remain":t.style.position!=="fixed"&&t.style.position!=="absolute"&&(t.style.top=T(t,u,"top")+"px",t.style.left="auto",t.style.position="absolute"),t.style.top=k(t,u,c)+"px",t.style.left=T(t,u,"left")+"px",t.style.position="relative";break}},x=()=>{const l=E,t=Date.now();f&&clearTimeout(f),g||(g=t),t-g>S?(l(),g=null,f=null):f=setTimeout(()=>{l(),g=null,f=null},B)},E=()=>{c.getBoundingClientRect().left-(R||0)!=0?(s.status="stay",R=c.getBoundingClientRect().left):v()},v=()=>{const l=d,t=p.value||document.createElement("div"),o=d&&d!==window?l.getBoundingClientRect().top:0,n=window.getComputedStyle(c);u.getBoundingClientRect().top-o>(e.view&&e.view.top||0)||c.getBoundingClientRect().top+parseInt(n.paddingTop,10)+parseInt(n.borderTopWidth,10)-o>=(e.view&&e.view.top||0)?(s.status="normal",y(s.status)):c.getBoundingClientRect().bottom-parseInt(n.paddingBottom,10)-parseInt(n.borderBottomWidth,10)<o+(e.view&&e.view.top||0)+t.getBoundingClientRect().height+(e.view&&e.view.bottom||0)?(s.status="remain",y(s.status)):c.getBoundingClientRect().top+parseInt(n.paddingTop,10)-o<(e.view&&e.view.top||0)&&(s.status="follow",y(s.status))},T=(l,t,o)=>{const n={left:["left","Left"],top:["top","Top"]};if(window&&window.getComputedStyle){const m=window.getComputedStyle(t);return l.getBoundingClientRect()[n[o][0]]-t.getBoundingClientRect()[n[o][0]]-parseInt(m[o==="left"?"paddingLeft":"paddingTop"],10)-parseInt(m[o==="left"?"borderLeftWidth":"borderTopWidth"],10)}},k=(l,t,o)=>{if(window&&window.getComputedStyle){const n=window.getComputedStyle(o),m=o.getBoundingClientRect().height-l.getBoundingClientRect().height+o.getBoundingClientRect().top-t.getBoundingClientRect().top-parseInt(n.paddingTop,10)-parseInt(n.borderTopWidth,10)-parseInt(n.paddingBottom,10)-parseInt(n.borderBottomWidth,10);return m<0?0:m}};i.onMounted(()=>{w()});const p=i.ref();return()=>i.createVNode("div",{ref:p},[C.default?C.default():""])}});r.install=function(e){e.component(r.name,r)};var b={title:"Sticky \u4FBF\u8D34",category:"\u901A\u7528",status:"50%",install(e){e.use(r)}};a.Sticky=r,a.default=b,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
1
+ (function(a,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(a=typeof globalThis!="undefined"?globalThis:a||self,i(a.index={},a.Vue))})(this,function(a,i){"use strict";var r=i.defineComponent({name:"DSticky",props:{zIndex:{type:Number},container:{type:Object},view:{type:Object,default:()=>({top:0,bottom:0})},scrollTarget:{type:Object}},emits:["statusChange"],setup(e,h){const{slots:C}=h;let c,d,f,g;const B=16,S=100;let u,R=0;const s=i.reactive({status:"normal"});i.watch(()=>e.zIndex,()=>{w()}),i.watch(()=>e.container,()=>{w()}),i.watch(()=>e.scrollTarget,()=>{w()}),i.watch(()=>s.status,()=>{h.emit("statusChange",s.status)},{immediate:!0});const w=()=>{u=p.value.parentElement,e.container?c=e.container:c=u,p.value.style.zIndex=e.zIndex,d=e.scrollTarget||window,d.addEventListener("scroll",x),I(d)},I=l=>{const t=l===window?[document.documentElement,document.body]:[l];let o=!1;t.forEach(n=>{n.scrollTop&&n.scrollTop>0&&(o=!0)}),o&&setTimeout(v)},y=l=>{const t=p.value||document.createElement("div");switch(l){case"normal":t.style.top="auto",t.style.left="auto",t.style.position="static";break;case"follow":const n=d&&d!==window?d.getBoundingClientRect().top:0;t.style.top=+n+(e.view&&e.view.top||0)+"px",t.style.left=t.getBoundingClientRect().left+"px",t.style.position="fixed";break;case"stay":t.style.top=T(t,u,"top")+"px",t.style.left="auto",t.style.position="relative";break;case"remain":t.style.position!=="fixed"&&t.style.position!=="absolute"&&(t.style.top=T(t,u,"top")+"px",t.style.left="auto",t.style.position="absolute"),t.style.top=k(t,u,c)+"px",t.style.left=T(t,u,"left")+"px",t.style.position="relative";break}},x=()=>{const l=E,t=Date.now();f&&clearTimeout(f),g||(g=t),t-g>S?(l(),g=null,f=null):f=setTimeout(()=>{l(),g=null,f=null},B)},E=()=>{c.getBoundingClientRect().left-(R||0)!==0?(s.status="stay",R=c.getBoundingClientRect().left):v()},v=()=>{const l=d,t=p.value||document.createElement("div"),o=d&&d!==window?l.getBoundingClientRect().top:0,n=window.getComputedStyle(c);u.getBoundingClientRect().top-o>(e.view&&e.view.top||0)||c.getBoundingClientRect().top+parseInt(n.paddingTop,10)+parseInt(n.borderTopWidth,10)-o>=(e.view&&e.view.top||0)?(s.status="normal",y(s.status)):c.getBoundingClientRect().bottom-parseInt(n.paddingBottom,10)-parseInt(n.borderBottomWidth,10)<o+(e.view&&e.view.top||0)+t.getBoundingClientRect().height+(e.view&&e.view.bottom||0)?(s.status="remain",y(s.status)):c.getBoundingClientRect().top+parseInt(n.paddingTop,10)-o<(e.view&&e.view.top||0)&&(s.status="follow",y(s.status))},T=(l,t,o)=>{const n={left:["left","Left"],top:["top","Top"]};if(window&&window.getComputedStyle){const m=window.getComputedStyle(t);return l.getBoundingClientRect()[n[o][0]]-t.getBoundingClientRect()[n[o][0]]-parseInt(m[o==="left"?"paddingLeft":"paddingTop"],10)-parseInt(m[o==="left"?"borderLeftWidth":"borderTopWidth"],10)}},k=(l,t,o)=>{if(window&&window.getComputedStyle){const n=window.getComputedStyle(o),m=o.getBoundingClientRect().height-l.getBoundingClientRect().height+o.getBoundingClientRect().top-t.getBoundingClientRect().top-parseInt(n.paddingTop,10)-parseInt(n.borderTopWidth,10)-parseInt(n.paddingBottom,10)-parseInt(n.borderBottomWidth,10);return m<0?0:m}};i.onMounted(()=>{w()});const p=i.ref();return()=>i.createVNode("div",{ref:p},[C.default?C.default():""])}});r.install=function(e){e.component(r.name,r)};var b={title:"Sticky \u4FBF\u8D34",category:"\u901A\u7528",status:"50%",install(e){e.use(r)}};a.Sticky=r,a.default=b,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});