vue-devui 1.0.0-rc.9 → 1.0.2

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 (208) hide show
  1. package/README.md +189 -149
  2. package/alert/index.es.js +12 -7
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8036 -260
  6. package/auto-complete/index.umd.js +29 -3
  7. package/auto-complete/style.css +1 -1
  8. package/badge/index.es.js +8 -2
  9. package/badge/index.umd.js +1 -1
  10. package/badge/style.css +1 -1
  11. package/button/index.es.js +110 -45
  12. package/button/index.umd.js +15 -15
  13. package/button/style.css +1 -1
  14. package/card/index.es.js +5 -1
  15. package/card/index.umd.js +1 -1
  16. package/card/style.css +1 -1
  17. package/checkbox/index.es.js +7778 -81
  18. package/checkbox/index.umd.js +27 -1
  19. package/checkbox/style.css +1 -1
  20. package/{date-picker → collapse}/index.d.ts +0 -0
  21. package/collapse/index.es.js +213 -0
  22. package/collapse/index.umd.js +1 -0
  23. package/{date-picker → collapse}/package.json +1 -1
  24. package/collapse/style.css +1 -0
  25. package/countdown/index.es.js +56 -13
  26. package/countdown/index.umd.js +1 -1
  27. package/date-picker-pro/index.d.ts +7 -0
  28. package/date-picker-pro/index.es.js +12022 -0
  29. package/date-picker-pro/index.umd.js +27 -0
  30. package/date-picker-pro/package.json +7 -0
  31. package/date-picker-pro/style.css +1 -0
  32. package/drawer/index.es.js +22 -5
  33. package/drawer/index.umd.js +1 -1
  34. package/drawer/style.css +1 -1
  35. package/dropdown/index.es.js +92 -123
  36. package/dropdown/index.umd.js +1 -1
  37. package/dropdown/style.css +1 -1
  38. package/editable-select/index.es.js +374 -149
  39. package/editable-select/index.umd.js +1 -1
  40. package/editable-select/style.css +1 -1
  41. package/form/index.es.js +102 -123
  42. package/form/index.umd.js +14 -14
  43. package/form/style.css +1 -1
  44. package/icon/index.es.js +107 -41
  45. package/icon/index.umd.js +1 -1
  46. package/icon/style.css +1 -1
  47. package/image-preview/style.css +1 -1
  48. package/input/index.es.js +8097 -170
  49. package/input/index.umd.js +27 -1
  50. package/input/style.css +1 -1
  51. package/input-number/index.es.js +34 -32
  52. package/input-number/index.umd.js +1 -1
  53. package/input-number/style.css +1 -1
  54. package/layout/index.es.js +1 -1
  55. package/layout/index.umd.js +1 -1
  56. package/loading/index.es.js +51 -51
  57. package/loading/index.umd.js +1 -1
  58. package/loading/style.css +1 -1
  59. package/mention/index.d.ts +7 -0
  60. package/mention/index.es.js +8326 -0
  61. package/mention/index.umd.js +36 -0
  62. package/mention/package.json +7 -0
  63. package/mention/style.css +1 -0
  64. package/menu/index.d.ts +7 -0
  65. package/menu/index.es.js +921 -0
  66. package/menu/index.umd.js +1 -0
  67. package/menu/package.json +7 -0
  68. package/menu/style.css +1 -0
  69. package/message/index.d.ts +7 -0
  70. package/message/index.es.js +539 -0
  71. package/message/index.umd.js +1 -0
  72. package/message/package.json +7 -0
  73. package/message/style.css +1 -0
  74. package/modal/index.es.js +390 -185
  75. package/modal/index.umd.js +1 -1
  76. package/modal/style.css +1 -1
  77. package/notification/index.es.js +148 -79
  78. package/notification/index.umd.js +1 -1
  79. package/notification/style.css +1 -1
  80. package/nuxt/components/Collapse.js +3 -0
  81. package/nuxt/components/CollapseItem.js +3 -0
  82. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  83. package/nuxt/components/DatePickerPro.js +3 -0
  84. package/nuxt/components/IconGroup.js +3 -0
  85. package/nuxt/components/Mention.js +3 -0
  86. package/nuxt/components/Menu.js +3 -0
  87. package/nuxt/components/MenuItem.js +3 -0
  88. package/nuxt/components/Message.js +3 -0
  89. package/nuxt/components/OptionGroup.js +3 -0
  90. package/nuxt/components/RadioButton.js +3 -0
  91. package/nuxt/components/Step.js +3 -0
  92. package/nuxt/components/Steps.js +3 -0
  93. package/nuxt/components/SubMenu.js +3 -0
  94. package/nuxt/components/TABLE_TOKEN.js +3 -0
  95. package/nuxt/components/TimePicker.js +3 -0
  96. package/nuxt/components/TimeSelect.js +3 -0
  97. package/nuxt/components/animationInjectionKey.js +3 -0
  98. package/nuxt/components/collapseItemProps.js +3 -0
  99. package/nuxt/components/collapseProps.js +3 -0
  100. package/nuxt/components/datePickerProCommonProps.js +3 -0
  101. package/nuxt/components/datePickerProPanelProps.js +3 -0
  102. package/nuxt/components/datePickerProProps.js +3 -0
  103. package/nuxt/components/mentionProps.js +3 -0
  104. package/nuxt/components/messageProps.js +3 -0
  105. package/nuxt/components/paginationInjectionKey.js +3 -0
  106. package/nuxt/components/roundInjectionKey.js +3 -0
  107. package/nuxt/components/skeletonItemProps.js +3 -0
  108. package/nuxt/components/stepProps.js +3 -0
  109. package/nuxt/components/stepsProps.js +3 -0
  110. package/nuxt/components/tableProps.js +3 -0
  111. package/nuxt/components/timerPickerPanelProps.js +3 -0
  112. package/nuxt/components/treeNodeProps.js +3 -0
  113. package/overlay/index.es.js +87 -140
  114. package/overlay/index.umd.js +1 -1
  115. package/overlay/style.css +1 -1
  116. package/package.json +7 -4
  117. package/pagination/index.es.js +10180 -129
  118. package/pagination/index.umd.js +27 -1
  119. package/pagination/style.css +1 -1
  120. package/panel/index.es.js +4 -0
  121. package/panel/index.umd.js +1 -1
  122. package/panel/style.css +1 -1
  123. package/popover/index.es.js +111 -164
  124. package/popover/index.umd.js +16 -16
  125. package/popover/style.css +1 -1
  126. package/progress/style.css +1 -1
  127. package/radio/index.es.js +7860 -58
  128. package/radio/index.umd.js +27 -1
  129. package/radio/style.css +1 -1
  130. package/rate/style.css +1 -1
  131. package/result/index.es.js +93 -41
  132. package/result/index.umd.js +1 -1
  133. package/result/style.css +1 -1
  134. package/search/index.es.js +3737 -1206
  135. package/search/index.umd.js +18 -18
  136. package/search/style.css +1 -1
  137. package/select/index.es.js +4446 -2499
  138. package/select/index.umd.js +17 -17
  139. package/select/style.css +1 -1
  140. package/skeleton/index.es.js +87 -261
  141. package/skeleton/index.umd.js +1 -1
  142. package/skeleton/style.css +1 -1
  143. package/slider/index.es.js +116 -143
  144. package/slider/index.umd.js +1 -1
  145. package/slider/style.css +1 -1
  146. package/splitter/index.es.js +284 -152
  147. package/splitter/index.umd.js +16 -16
  148. package/splitter/style.css +1 -1
  149. package/statistic/index.es.js +34 -16
  150. package/statistic/index.umd.js +1 -1
  151. package/statistic/style.css +1 -1
  152. package/status/index.es.js +4 -0
  153. package/status/index.umd.js +1 -1
  154. package/status/style.css +1 -1
  155. package/steps/index.d.ts +7 -0
  156. package/steps/index.es.js +387 -0
  157. package/steps/index.umd.js +1 -0
  158. package/steps/package.json +7 -0
  159. package/steps/style.css +1 -0
  160. package/style.css +1 -1
  161. package/switch/index.es.js +7785 -60
  162. package/switch/index.umd.js +27 -1
  163. package/switch/style.css +1 -1
  164. package/table/index.es.js +4224 -1502
  165. package/table/index.umd.js +17 -17
  166. package/table/style.css +1 -1
  167. package/tabs/index.es.js +281 -83
  168. package/tabs/index.umd.js +1 -1
  169. package/tabs/style.css +1 -1
  170. package/tag/index.es.js +5 -1
  171. package/tag/index.umd.js +1 -1
  172. package/tag/style.css +1 -1
  173. package/textarea/index.es.js +3362 -1061
  174. package/textarea/index.umd.js +19 -19
  175. package/textarea/style.css +1 -1
  176. package/time-picker/index.d.ts +7 -0
  177. package/time-picker/index.es.js +9549 -0
  178. package/time-picker/index.umd.js +27 -0
  179. package/time-picker/package.json +7 -0
  180. package/time-picker/style.css +1 -0
  181. package/time-select/index.d.ts +7 -0
  182. package/time-select/index.es.js +9610 -0
  183. package/time-select/index.umd.js +27 -0
  184. package/time-select/package.json +7 -0
  185. package/time-select/style.css +1 -0
  186. package/timeline/index.es.js +93 -41
  187. package/timeline/index.umd.js +1 -1
  188. package/timeline/style.css +1 -1
  189. package/tooltip/index.es.js +127 -168
  190. package/tooltip/index.umd.js +16 -16
  191. package/tooltip/style.css +1 -1
  192. package/tree/index.es.js +11045 -607
  193. package/tree/index.umd.js +27 -1
  194. package/tree/style.css +1 -1
  195. package/upload/index.es.js +394 -111
  196. package/upload/index.umd.js +1 -1
  197. package/upload/style.css +1 -1
  198. package/vue-devui.es.js +19687 -11762
  199. package/vue-devui.umd.js +24 -23
  200. package/date-picker/index.es.js +0 -1298
  201. package/date-picker/index.umd.js +0 -1
  202. package/date-picker/style.css +0 -1
  203. package/nuxt/components/DatePicker.js +0 -3
  204. package/nuxt/components/Loading.js +0 -3
  205. package/nuxt/components/StickSlider.js +0 -3
  206. package/nuxt/components/formControlProps.js +0 -3
  207. package/nuxt/components/overlayEmits.js +0 -3
  208. package/nuxt/components/overlayProps.js +0 -3
@@ -0,0 +1,3 @@
1
+ import '../../collapse/style.css'
2
+
3
+ export { collapseItemProps as default } from '../../collapse/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../collapse/style.css'
2
+
3
+ export { collapseProps as default } from '../../collapse/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../date-picker-pro/style.css'
2
+
3
+ export { datePickerProCommonProps as default } from '../../date-picker-pro/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../date-picker-pro/style.css'
2
+
3
+ export { datePickerProPanelProps as default } from '../../date-picker-pro/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../date-picker-pro/style.css'
2
+
3
+ export { datePickerProProps as default } from '../../date-picker-pro/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../mention/style.css'
2
+
3
+ export { mentionProps as default } from '../../mention/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../message/style.css'
2
+
3
+ export { messageProps as default } from '../../message/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../pagination/style.css'
2
+
3
+ export { paginationInjectionKey as default } from '../../pagination/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../skeleton/style.css'
2
+
3
+ export { roundInjectionKey as default } from '../../skeleton/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../skeleton/style.css'
2
+
3
+ export { skeletonItemProps as default } from '../../skeleton/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../steps/style.css'
2
+
3
+ export { stepProps as default } from '../../steps/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../steps/style.css'
2
+
3
+ export { stepsProps as default } from '../../steps/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../table/style.css'
2
+
3
+ export { tableProps as default } from '../../table/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../date-picker-pro/style.css'
2
+
3
+ export { timerPickerPanelProps as default } from '../../date-picker-pro/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../tree/style.css'
2
+
3
+ export { treeNodeProps as default } from '../../tree/index.es.js'
@@ -1,24 +1,60 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps } from "vue";
1
+ import { watch, onUnmounted, defineComponent, toRefs, createVNode, Transition, mergeProps, ref, unref, nextTick, withModifiers } from "vue";
21
2
  import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
3
+ const fixedOverlayProps = {
4
+ modelValue: {
5
+ type: Boolean,
6
+ default: false
7
+ },
8
+ lockScroll: {
9
+ type: Boolean,
10
+ default: true
11
+ },
12
+ closeOnClickOverlay: {
13
+ type: Boolean,
14
+ default: true
15
+ }
16
+ };
17
+ function lockScroll() {
18
+ if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
19
+ const scrollTop = document.documentElement.scrollTop;
20
+ const style = document.documentElement.getAttribute("style");
21
+ document.documentElement.style.position = "fixed";
22
+ document.documentElement.style.top = `-${scrollTop}px`;
23
+ document.documentElement.style.width = document.documentElement.style.width || "100%";
24
+ document.documentElement.style.overflowY = "scroll";
25
+ return () => {
26
+ if (style) {
27
+ document.documentElement.setAttribute("style", style);
28
+ } else {
29
+ document.documentElement.removeAttribute("style");
30
+ }
31
+ document.documentElement.scrollTop = scrollTop;
32
+ };
33
+ }
34
+ return;
35
+ }
36
+ function useFixedOverlay(props, ctx) {
37
+ let lockScrollCb;
38
+ const onClick = (event) => {
39
+ event.preventDefault();
40
+ ctx.emit("click", event);
41
+ if (props.closeOnClickOverlay) {
42
+ ctx.emit("update:modelValue", false);
43
+ }
44
+ };
45
+ const removeBodyAdditions = () => {
46
+ lockScrollCb == null ? void 0 : lockScrollCb();
47
+ };
48
+ watch(() => props.modelValue, (val) => {
49
+ if (val) {
50
+ props.lockScroll && (lockScrollCb = lockScroll());
51
+ } else {
52
+ removeBodyAdditions();
53
+ }
54
+ });
55
+ onUnmounted(removeBodyAdditions);
56
+ return { onClick };
57
+ }
22
58
  function createBem(namespace, element, modifier) {
23
59
  let cls = namespace;
24
60
  if (element) {
@@ -42,130 +78,31 @@ function useNamespace(block, needDot = false) {
42
78
  em
43
79
  };
44
80
  }
45
- var baseOverlay = "";
46
- function _isSlot(s) {
47
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
48
- }
49
- const CommonOverlay = defineComponent({
50
- setup(props, ctx) {
51
- const ns = useNamespace("overlay");
52
- return () => {
53
- let _slot;
54
- return createVNode(Teleport, {
55
- "to": "#d-overlay-anchor"
56
- }, {
57
- default: () => [createVNode(Transition, {
58
- "name": ns.e("fade")
59
- }, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
60
- default: () => [_slot]
61
- })]
62
- });
63
- };
64
- }
65
- });
66
- const overlayProps = {
67
- visible: {
68
- type: Boolean
69
- },
70
- backgroundBlock: {
71
- type: Boolean,
72
- default: false
73
- },
74
- backgroundClass: {
75
- type: String,
76
- default: ""
77
- },
78
- backgroundStyle: {
79
- type: [String, Object]
80
- },
81
- onBackdropClick: {
82
- type: Function
83
- },
84
- backdropClose: {
85
- type: Boolean,
86
- default: true
87
- },
88
- hasBackdrop: {
89
- type: Boolean,
90
- default: true
91
- }
92
- };
93
- const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
94
- overlayStyle: {
95
- type: [String, Object],
96
- default: void 0
97
- }
98
- });
99
- const overlayEmits = ["update:visible", "backdropClick"];
100
- function useOverlayLogic(props, ctx) {
101
- const ns = useNamespace("overlay");
102
- const backgroundClass = computed(() => {
103
- return [ns.e("background"), props.backgroundClass, !props.hasBackdrop ? ns.em("background", "disabled") : ns.em("background", "color")];
104
- });
105
- const overlayClass = computed(() => {
106
- return ns.b();
107
- });
108
- const handleBackdropClick = (event) => {
109
- var _a;
110
- event.preventDefault();
111
- (_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
112
- if (props.backdropClose) {
113
- ctx.emit("update:visible", false);
114
- }
115
- };
116
- const handleOverlayBubbleCancel = (event) => event.cancelBubble = true;
117
- onMounted(() => {
118
- const body = document.body;
119
- const originOverflow = body.style.overflow;
120
- const originPosition = body.style.position;
121
- watch([() => props.visible, () => props.backgroundBlock], ([visible, backgroundBlock]) => {
122
- if (backgroundBlock) {
123
- const top = body.getBoundingClientRect().y;
124
- if (visible) {
125
- body.style.overflowY = "scroll";
126
- body.style.position = visible ? "fixed" : "";
127
- body.style.top = `${top}px`;
128
- } else {
129
- body.style.overflowY = originOverflow;
130
- body.style.position = originPosition;
131
- body.style.top = "";
132
- window.scrollTo(0, -top);
133
- }
134
- }
135
- });
136
- onUnmounted(() => {
137
- document.body.style.overflow = originOverflow;
138
- });
139
- });
140
- return {
141
- backgroundClass,
142
- overlayClass,
143
- handleBackdropClick,
144
- handleOverlayBubbleCancel
145
- };
146
- }
147
81
  var fixedOverlay = "";
148
82
  const FixedOverlay = defineComponent({
149
83
  name: "DFixedOverlay",
84
+ inheritAttrs: false,
150
85
  props: fixedOverlayProps,
151
- emits: overlayEmits,
86
+ emits: ["update:modelValue", "click"],
152
87
  setup(props, ctx) {
153
88
  const {
154
- backgroundClass,
155
- overlayClass,
156
- handleBackdropClick,
157
- handleOverlayBubbleCancel
158
- } = useOverlayLogic(props, ctx);
159
- return () => createVNode(CommonOverlay, null, {
160
- default: () => [props.visible && createVNode("div", {
161
- "class": backgroundClass.value,
162
- "style": props.backgroundStyle,
163
- "onClick": handleBackdropClick
164
- }, [createVNode("div", {
165
- "class": overlayClass.value,
166
- "style": props.overlayStyle,
167
- "onClick": handleOverlayBubbleCancel
168
- }, [renderSlot(ctx.slots, "default")])])]
89
+ modelValue
90
+ } = toRefs(props);
91
+ const ns = useNamespace("fixed-overlay");
92
+ const {
93
+ onClick
94
+ } = useFixedOverlay(props, ctx);
95
+ return () => createVNode(Transition, {
96
+ "name": ns.m("fade")
97
+ }, {
98
+ default: () => {
99
+ var _a, _b;
100
+ return [modelValue.value && createVNode("div", mergeProps({
101
+ "class": ns.b()
102
+ }, ctx.attrs, {
103
+ "onClick": onClick
104
+ }), [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])];
105
+ }
169
106
  });
170
107
  }
171
108
  });
@@ -200,6 +137,10 @@ const flexibleOverlayProps = {
200
137
  isArrowCenter: {
201
138
  type: Boolean,
202
139
  default: true
140
+ },
141
+ clickEventBubble: {
142
+ type: Boolean,
143
+ default: false
203
144
  }
204
145
  };
205
146
  function getScrollParent(element) {
@@ -314,6 +255,9 @@ const FlexibleOverlay = defineComponent({
314
255
  expose
315
256
  }) {
316
257
  const ns = useNamespace("flexible-overlay");
258
+ const {
259
+ clickEventBubble
260
+ } = toRefs(props);
317
261
  const {
318
262
  arrowRef,
319
263
  overlayRef,
@@ -327,7 +271,10 @@ const FlexibleOverlay = defineComponent({
327
271
  return props.modelValue && createVNode("div", mergeProps({
328
272
  "ref": overlayRef,
329
273
  "class": ns.b()
330
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
274
+ }, attrs, {
275
+ "onClick": withModifiers(() => ({}), [clickEventBubble.value ? "" : "stop"]),
276
+ "onPointerup": withModifiers(() => ({}), ["stop"])
277
+ }), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
331
278
  "ref": arrowRef,
332
279
  "class": ns.e("arrow")
333
280
  }, null)]);
@@ -353,4 +300,4 @@ var index = {
353
300
  }
354
301
  }
355
302
  };
356
- export { FixedOverlay, FlexibleOverlay, index as default, fixedOverlayProps, flexibleOverlayProps, overlayEmits, overlayProps };
303
+ export { FixedOverlay, FlexibleOverlay, index as default, fixedOverlayProps, flexibleOverlayProps };
@@ -1 +1 @@
1
- var M=Object.defineProperty,q=Object.defineProperties;var X=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var P=(r,t,c)=>t in r?M(r,t,{enumerable:!0,configurable:!0,writable:!0,value:c}):r[t]=c,N=(r,t)=>{for(var c in t||(t={}))I.call(t,c)&&P(r,c,t[c]);if(j)for(var c of j(t))U.call(t,c)&&P(r,c,t[c]);return r},L=(r,t)=>q(r,X(t));(function(r,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],t):(r=typeof globalThis!="undefined"?globalThis:r||self,t(r.index={},r.Vue,r.dom))})(this,function(r,t,c){"use strict";function m(e,l,o){let a=e;return l&&(a+=`__${l}`),o&&(a+=`--${o}`),a}function h(e,l=!1){const o=l?`.devui-${e}`:`devui-${e}`;return{b:()=>m(o),e:n=>n?m(o,n):"",m:n=>n?m(o,"",n):"",em:(n,d)=>n&&d?m(o,n,d):""}}var G="";function $(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const F=t.defineComponent({setup(e,l){const o=h("overlay");return()=>{let a;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:o.e("fade")},$(a=t.renderSlot(l.slots,"default"))?a:{default:()=>[a]})]})}}}),k={visible:{type:Boolean},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},onBackdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}},x=L(N({},k),{overlayStyle:{type:[String,Object],default:void 0}}),B=["update:visible","backdropClick"];function R(e,l){const o=h("overlay"),a=t.computed(()=>[o.e("background"),e.backgroundClass,e.hasBackdrop?o.em("background","color"):o.em("background","disabled")]),i=t.computed(()=>o.b()),f=n=>{var d;n.preventDefault(),(d=e.onBackdropClick)==null||d.call(e),e.backdropClose&&l.emit("update:visible",!1)},s=n=>n.cancelBubble=!0;return t.onMounted(()=>{const n=document.body,d=n.style.overflow,u=n.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([y,v])=>{if(v){const w=n.getBoundingClientRect().y;y?(n.style.overflowY="scroll",n.style.position=y?"fixed":"",n.style.top=`${w}px`):(n.style.overflowY=d,n.style.position=u,n.style.top="",window.scrollTo(0,-w))}}),t.onUnmounted(()=>{document.body.style.overflow=d})}),{backgroundClass:a,overlayClass:i,handleBackdropClick:f,handleOverlayBubbleCancel:s}}var H="";const g=t.defineComponent({name:"DFixedOverlay",props:x,emits:B,setup(e,l){const{backgroundClass:o,overlayClass:a,handleBackdropClick:i,handleOverlayBubbleCancel:f}=R(e,l);return()=>t.createVNode(F,null,{default:()=>[e.visible&&t.createVNode("div",{class:o.value,style:e.backgroundStyle,onClick:i},[t.createVNode("div",{class:a.value,style:e.overlayStyle,onClick:f},[t.renderSlot(l.slots,"default")])])]})}}),E={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function T(e){const l=/(auto|scroll|hidden)/;for(let o=e;o=o.parentElement;o.parentElement!==document.body){const a=window.getComputedStyle(o);if(l.test(a.overflow+a.overflowX+a.overflowY))return o}return window}function _(e,l,o,a){let{x:i,y:f}=l;if(!e){const{width:s,height:n}=a;i&&o.includes("start")&&(i=12),i&&o.includes("end")&&(i=Math.round(s-24)),f&&o.includes("start")&&(f=10),f&&o.includes("end")&&(f=n-14)}return{x:i,y:f}}function Y(e,l){const o=t.ref(),a=t.ref();let i=null;const f=(n,d,u,y)=>{const{x:v,y:w}=_(e.isArrowCenter,u,d,y.getBoundingClientRect()),b={top:"bottom",right:"left",bottom:"top",left:"right"}[d.split("-")[0]];Object.assign(n.style,{left:v?`${v}px`:"",top:w?`${w}px`:"",right:"",bottom:"",[b]:"-4px"})},s=async()=>{const n=e.origin,d=t.unref(o.value),u=t.unref(a.value),y=[c.offset(e.offset),c.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&y.push(c.arrow({element:u})),e.shiftOffset!==void 0&&y.push(c.shift());const{x:v,y:w,placement:b,middlewareData:S}=await c.computePosition(n,d,{strategy:"fixed",middleware:y});let p=v,C=w;if(e.shiftOffset!==void 0){const{x:V,y:A}=S.shift;V<0&&(p-=e.shiftOffset),V>0&&(p+=e.shiftOffset),A<0&&(C-=e.shiftOffset),A>0&&(C+=e.shiftOffset)}l("positionChange",b),Object.assign(d.style,{top:`${C}px`,left:`${p}px`}),e.showArrow&&f(u,b,S.arrow,d)};return t.watch(()=>e.modelValue,()=>{e.modelValue&&e.origin?(i=T(e.origin),t.nextTick(s),i==null||i.addEventListener("scroll",s),i!==window&&window.addEventListener("scroll",s),window.addEventListener("resize",s)):(i==null||i.removeEventListener("scroll",s),i!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s))}),t.onUnmounted(()=>{i==null||i.removeEventListener("scroll",s),i!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}),{arrowRef:a,overlayRef:o,updatePosition:s}}var J="";const O=t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:E,emits:["update:modelValue","positionChange"],setup(e,{slots:l,attrs:o,emit:a,expose:i}){const f=h("flexible-overlay"),{arrowRef:s,overlayRef:n,updatePosition:d}=Y(e,a);return i({updatePosition:d}),()=>{var u;return e.modelValue&&t.createVNode("div",t.mergeProps({ref:n,class:f.b()},o),[(u=l.default)==null?void 0:u.call(l),e.showArrow&&t.createVNode("div",{ref:s,class:f.e("arrow")},null)])}}}),z=typeof window!="undefined";var D={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(e){if(e.component(g.name,g),e.component(O.name,O),z&&!document.getElementById("d-overlay-anchor")){const l=document.createElement("div");l.setAttribute("id","d-overlay-anchor"),l.style.position="fixed",l.style.left="0",l.style.top="0",l.style.zIndex="1000",document.body.appendChild(l)}}};r.FixedOverlay=g,r.FlexibleOverlay=O,r.default=D,r.fixedOverlayProps=x,r.flexibleOverlayProps=E,r.overlayEmits=B,r.overlayProps=k,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});
1
+ (function(a,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],l):(a=typeof globalThis!="undefined"?globalThis:a||self,l(a.index={},a.Vue,a.dom))})(this,function(a,l,m){"use strict";const x={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function k(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const e=document.documentElement.scrollTop,t=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${e}px`,document.documentElement.style.width=document.documentElement.style.width||"100%",document.documentElement.style.overflowY="scroll",()=>{t?document.documentElement.setAttribute("style",t):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=e}}}function P(e,t){let o;const i=s=>{s.preventDefault(),t.emit("click",s),e.closeOnClickOverlay&&t.emit("update:modelValue",!1)},n=()=>{o==null||o()};return l.watch(()=>e.modelValue,s=>{s?e.lockScroll&&(o=k()):n()}),l.onUnmounted(n),{onClick:i}}function y(e,t,o){let i=e;return t&&(i+=`__${t}`),o&&(i+=`--${o}`),i}function g(e,t=!1){const o=t?`.devui-${e}`:`devui-${e}`;return{b:()=>y(o),e:d=>d?y(o,d):"",m:d=>d?y(o,"",d):"",em:(d,c)=>d&&c?y(o,d,c):""}}var T="";const E=l.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:x,emits:["update:modelValue","click"],setup(e,t){const{modelValue:o}=l.toRefs(e),i=g("fixed-overlay"),{onClick:n}=P(e,t);return()=>l.createVNode(l.Transition,{name:i.m("fade")},{default:()=>{var s,r;return[o.value&&l.createVNode("div",l.mergeProps({class:i.b()},t.attrs,{onClick:n}),[(r=(s=t.slots).default)==null?void 0:r.call(s)])]}})}}),A={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0},clickEventBubble:{type:Boolean,default:!1}};function L(e){const t=/(auto|scroll|hidden)/;for(let o=e;o=o.parentElement;o.parentElement!==document.body){const i=window.getComputedStyle(o);if(t.test(i.overflow+i.overflowX+i.overflowY))return o}return window}function $(e,t,o,i){let{x:n,y:s}=t;if(!e){const{width:r,height:d}=i;n&&o.includes("start")&&(n=12),n&&o.includes("end")&&(n=Math.round(r-24)),s&&o.includes("start")&&(s=10),s&&o.includes("end")&&(s=d-14)}return{x:n,y:s}}function F(e,t){const o=l.ref(),i=l.ref();let n=null;const s=(d,c,u,f)=>{const{x:w,y:v}=$(e.isArrowCenter,u,c,f.getBoundingClientRect()),h={top:"bottom",right:"left",bottom:"top",left:"right"}[c.split("-")[0]];Object.assign(d.style,{left:w?`${w}px`:"",top:v?`${v}px`:"",right:"",bottom:"",[h]:"-4px"})},r=async()=>{const d=e.origin,c=l.unref(o.value),u=l.unref(i.value),f=[m.offset(e.offset),m.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&f.push(m.arrow({element:u})),e.shiftOffset!==void 0&&f.push(m.shift());const{x:w,y:v,placement:h,middlewareData:C}=await m.computePosition(d,c,{strategy:"fixed",middleware:f});let b=w,p=v;if(e.shiftOffset!==void 0){const{x:V,y:B}=C.shift;V<0&&(b-=e.shiftOffset),V>0&&(b+=e.shiftOffset),B<0&&(p-=e.shiftOffset),B>0&&(p+=e.shiftOffset)}t("positionChange",h),Object.assign(c.style,{top:`${p}px`,left:`${b}px`}),e.showArrow&&s(u,h,C.arrow,c)};return l.watch(()=>e.modelValue,()=>{e.modelValue&&e.origin?(n=L(e.origin),l.nextTick(r),n==null||n.addEventListener("scroll",r),n!==window&&window.addEventListener("scroll",r),window.addEventListener("resize",r)):(n==null||n.removeEventListener("scroll",r),n!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r))}),l.onUnmounted(()=>{n==null||n.removeEventListener("scroll",r),n!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r)}),{arrowRef:i,overlayRef:o,updatePosition:r}}var j="";const O=l.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:A,emits:["update:modelValue","positionChange"],setup(e,{slots:t,attrs:o,emit:i,expose:n}){const s=g("flexible-overlay"),{clickEventBubble:r}=l.toRefs(e),{arrowRef:d,overlayRef:c,updatePosition:u}=F(e,i);return n({updatePosition:u}),()=>{var f;return e.modelValue&&l.createVNode("div",l.mergeProps({ref:c,class:s.b()},o,{onClick:l.withModifiers(()=>({}),[r.value?"":"stop"]),onPointerup:l.withModifiers(()=>({}),["stop"])}),[(f=t.default)==null?void 0:f.call(t),e.showArrow&&l.createVNode("div",{ref:d,class:s.e("arrow")},null)])}}}),R=typeof window!="undefined";var S={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(e){if(e.component(E.name,E),e.component(O.name,O),R&&!document.getElementById("d-overlay-anchor")){const t=document.createElement("div");t.setAttribute("id","d-overlay-anchor"),t.style.position="fixed",t.style.left="0",t.style.top="0",t.style.zIndex="1000",document.body.appendChild(t)}}};a.FixedOverlay=E,a.FlexibleOverlay=O,a.default=S,a.fixedOverlayProps=x,a.flexibleOverlayProps=A,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
package/overlay/style.css CHANGED
@@ -1 +1 @@
1
- @keyframes d-overlay-fade{0%{opacity:0}to{opacity:1}}.devui-overlay__fade-enter{opacity:0}.devui-overlay__fade-enter-active{animation-name:d-overlay-fade;animation-duration:.3s}.devui-overlay__fade-leave{opacity:1}.devui-overlay__fade-leave-active{animation-name:d-overlay-fade;animation-duration:.3s;animation-direction:reverse}.devui-overlay__background{position:fixed;top:0;left:0;height:100vh;width:100vw;display:flex}.devui-overlay__background--color{background:rgba(0,0,0,.4)}.devui-overlay__background .devui-overlay{position:relative;z-index:1000;pointer-events:auto}.devui-overlay__background--disabled{pointer-events:none}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-connected-overlay, 0 2px 8px 0) var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1000}.devui-flexible-overlay__arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}
1
+ .devui-fixed-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1050}.devui-fixed-overlay--fade-enter-active,.devui-fixed-overlay--fade-leave-active{transition:opacity .1s cubic-bezier(0,0,1,1)}.devui-fixed-overlay--fade-enter-from,.devui-fixed-overlay--fade-leave-to{opacity:0}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-length-connected-overlay, 0 4px 8px 0) var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1000}.devui-flexible-overlay__arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-devui",
3
- "version": "1.0.0-rc.9",
3
+ "version": "1.0.2",
4
4
  "license": "MIT",
5
5
  "description": "DevUI components based on Vite and Vue3",
6
6
  "keywords": [
@@ -23,19 +23,22 @@
23
23
  "main": "vue-devui.umd.js",
24
24
  "module": "vue-devui.es.js",
25
25
  "style": "style.css",
26
+ "peerDependencies": {
27
+ "vue": "^3.2"
28
+ },
26
29
  "dependencies": {
27
30
  "@devui-design/icons": "^1.3.0",
28
31
  "@floating-ui/dom": "^0.4.4",
29
32
  "@types/lodash-es": "^4.17.4",
30
33
  "@vue/shared": "^3.2.33",
31
- "@vueuse/core": "^7.7.1",
32
- "async-validator": "^4.0.2",
34
+ "@vueuse/core": "8.9.4",
35
+ "async-validator": "^4.0.7",
36
+ "dayjs": "^1.11.3",
33
37
  "devui-theme": "^0.0.1",
34
38
  "fs-extra": "^10.0.0",
35
39
  "lodash": "^4.17.21",
36
40
  "lodash-es": "^4.17.20",
37
41
  "mitt": "^3.0.0",
38
- "vue": "^3.1.1",
39
42
  "vue-router": "^4.0.3"
40
43
  }
41
44
  }