vue-devui 1.0.0-rc.6 → 1.0.0-rc.9

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 (168) hide show
  1. package/README.md +5 -0
  2. package/alert/index.es.js +37 -11
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +311 -77
  6. package/auto-complete/index.umd.js +3 -5
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +81 -70
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +29 -4
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5632 -87
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +56 -29
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +364 -234
  21. package/checkbox/index.umd.js +1 -1
  22. package/checkbox/style.css +1 -1
  23. package/date-picker/index.es.js +310 -157
  24. package/date-picker/index.umd.js +1 -1
  25. package/date-picker/style.css +1 -1
  26. package/drawer/index.es.js +28 -3
  27. package/drawer/index.umd.js +1 -1
  28. package/drawer/style.css +1 -1
  29. package/dropdown/index.es.js +125 -45
  30. package/dropdown/index.umd.js +1 -1
  31. package/dropdown/style.css +1 -1
  32. package/editable-select/index.es.js +437 -22
  33. package/editable-select/index.umd.js +1 -1
  34. package/editable-select/style.css +1 -1
  35. package/form/index.es.js +490 -605
  36. package/form/index.umd.js +15 -15
  37. package/form/style.css +1 -1
  38. package/fullscreen/index.es.js +29 -5
  39. package/fullscreen/index.umd.js +1 -1
  40. package/fullscreen/style.css +1 -1
  41. package/grid/index.es.js +71 -50
  42. package/grid/index.umd.js +1 -1
  43. package/grid/style.css +1 -1
  44. package/icon/index.es.js +109 -13
  45. package/icon/index.umd.js +1 -1
  46. package/icon/style.css +1 -0
  47. package/image-preview/index.es.js +34 -11
  48. package/image-preview/index.umd.js +1 -1
  49. package/image-preview/style.css +1 -1
  50. package/input/index.es.js +330 -130
  51. package/input/index.umd.js +1 -1
  52. package/input/style.css +1 -1
  53. package/input-number/index.es.js +272 -199
  54. package/input-number/index.umd.js +1 -1
  55. package/input-number/style.css +1 -1
  56. package/layout/index.es.js +34 -6
  57. package/layout/index.umd.js +1 -1
  58. package/layout/style.css +1 -1
  59. package/loading/index.es.js +34 -10
  60. package/loading/index.umd.js +1 -1
  61. package/loading/style.css +1 -1
  62. package/modal/index.es.js +126 -27
  63. package/modal/index.umd.js +1 -1
  64. package/modal/style.css +1 -1
  65. package/notification/index.es.js +125 -25
  66. package/notification/index.umd.js +1 -1
  67. package/notification/style.css +1 -1
  68. package/nuxt/components/ButtonGroup.js +3 -0
  69. package/nuxt/components/CheckboxButton.js +3 -0
  70. package/nuxt/components/CheckboxGroup.js +3 -0
  71. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  72. package/nuxt/components/FORM_TOKEN.js +3 -0
  73. package/nuxt/components/Icon.js +1 -0
  74. package/nuxt/components/LABEL_DATA.js +3 -0
  75. package/nuxt/components/Option.js +3 -0
  76. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  77. package/nuxt/components/buttonGroupProps.js +3 -0
  78. package/nuxt/components/formControlProps.js +3 -0
  79. package/nuxt/components/formItemProps.js +3 -0
  80. package/nuxt/components/formProps.js +3 -0
  81. package/nuxt/components/iconProps.js +1 -0
  82. package/nuxt/components/svgIconProps.js +3 -0
  83. package/overlay/index.es.js +31 -9
  84. package/overlay/index.umd.js +1 -1
  85. package/overlay/style.css +1 -1
  86. package/package.json +2 -1
  87. package/pagination/index.es.js +135 -124
  88. package/pagination/index.umd.js +1 -1
  89. package/pagination/style.css +1 -1
  90. package/popover/index.es.js +198 -83
  91. package/popover/index.umd.js +16 -16
  92. package/popover/style.css +1 -1
  93. package/progress/index.es.js +76 -20
  94. package/progress/index.umd.js +3 -3
  95. package/progress/style.css +1 -1
  96. package/radio/index.es.js +161 -140
  97. package/radio/index.umd.js +1 -1
  98. package/radio/style.css +1 -1
  99. package/rate/index.es.js +48 -16
  100. package/rate/index.umd.js +1 -1
  101. package/rate/style.css +1 -1
  102. package/result/index.es.js +108 -12
  103. package/result/index.umd.js +1 -1
  104. package/result/style.css +1 -1
  105. package/search/index.es.js +379 -167
  106. package/search/index.umd.js +17 -17
  107. package/search/style.css +1 -1
  108. package/select/index.es.js +7339 -556
  109. package/select/index.umd.js +27 -1
  110. package/select/style.css +1 -1
  111. package/skeleton/index.es.js +37 -12
  112. package/skeleton/index.umd.js +1 -1
  113. package/skeleton/style.css +1 -1
  114. package/slider/index.es.js +34 -10
  115. package/slider/index.umd.js +1 -1
  116. package/slider/style.css +1 -1
  117. package/splitter/index.es.js +201 -84
  118. package/splitter/index.umd.js +14 -14
  119. package/splitter/style.css +1 -1
  120. package/status/index.es.js +26 -2
  121. package/status/index.umd.js +1 -1
  122. package/status/style.css +1 -1
  123. package/style.css +1 -1
  124. package/switch/index.es.js +30 -6
  125. package/switch/index.umd.js +1 -1
  126. package/switch/style.css +1 -1
  127. package/table/index.es.js +6808 -585
  128. package/table/index.umd.js +27 -1
  129. package/table/style.css +1 -1
  130. package/tabs/index.es.js +136 -70
  131. package/tabs/index.umd.js +1 -1
  132. package/tabs/style.css +1 -1
  133. package/tag/index.es.js +31 -7
  134. package/tag/index.umd.js +1 -1
  135. package/tag/style.css +1 -1
  136. package/textarea/index.es.js +5631 -80
  137. package/textarea/index.umd.js +35 -1
  138. package/textarea/style.css +1 -1
  139. package/timeline/index.es.js +108 -12
  140. package/timeline/index.umd.js +1 -1
  141. package/timeline/style.css +1 -1
  142. package/tooltip/index.es.js +190 -74
  143. package/tooltip/index.umd.js +17 -17
  144. package/tooltip/style.css +1 -1
  145. package/tree/index.es.js +376 -256
  146. package/tree/index.umd.js +1 -1
  147. package/tree/style.css +1 -1
  148. package/upload/index.es.js +138 -34
  149. package/upload/index.umd.js +1 -1
  150. package/upload/style.css +1 -1
  151. package/vue-devui.es.js +6770 -5769
  152. package/vue-devui.umd.js +27 -21
  153. package/comment/index.d.ts +0 -7
  154. package/comment/index.es.js +0 -84
  155. package/comment/index.umd.js +0 -1
  156. package/comment/package.json +0 -7
  157. package/comment/style.css +0 -1
  158. package/nuxt/components/Comment.js +0 -3
  159. package/nuxt/components/FormControl.js +0 -3
  160. package/nuxt/components/FormLabel.js +0 -3
  161. package/nuxt/components/ReadTip.js +0 -3
  162. package/nuxt/components/commentProps.js +0 -3
  163. package/nuxt/components/readTipProps.js +0 -3
  164. package/read-tip/index.d.ts +0 -7
  165. package/read-tip/index.es.js +0 -261
  166. package/read-tip/index.umd.js +0 -1
  167. package/read-tip/package.json +0 -7
  168. package/read-tip/style.css +0 -1
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, toRefs, createVNode, computed, watch, Transition, reactive, createApp, onUnmounted, mergeProps, isVNode } from "vue";
20
+ import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, watch, Transition, reactive, createApp, onUnmounted, isVNode } from "vue";
21
21
  const notificationProps = {
22
22
  modelValue: {
23
23
  type: Boolean,
@@ -39,6 +39,10 @@ const notificationProps = {
39
39
  type: Function
40
40
  }
41
41
  };
42
+ function isUrl(value) {
43
+ return /^((http|https):)?\/\//.test(value);
44
+ }
45
+ const DEFAULT_PREFIX = "icon";
42
46
  const iconProps = {
43
47
  name: {
44
48
  type: String,
@@ -46,43 +50,135 @@ const iconProps = {
46
50
  required: true
47
51
  },
48
52
  size: {
49
- type: String,
53
+ type: [Number, String],
50
54
  default: "inherit"
51
55
  },
52
56
  color: {
53
57
  type: String,
54
58
  default: "inherit"
55
59
  },
60
+ component: {
61
+ type: Object,
62
+ default: null
63
+ },
56
64
  classPrefix: {
57
65
  type: String,
58
- default: "icon"
66
+ default: DEFAULT_PREFIX
59
67
  }
60
68
  };
69
+ const svgIconProps = {
70
+ name: {
71
+ type: String,
72
+ default: "",
73
+ required: true
74
+ },
75
+ color: {
76
+ type: String,
77
+ default: "inherit"
78
+ },
79
+ size: {
80
+ type: [Number, String],
81
+ default: "inherit"
82
+ }
83
+ };
84
+ function createBem(namespace, element, modifier) {
85
+ let cls = namespace;
86
+ if (element) {
87
+ cls += `__${element}`;
88
+ }
89
+ if (modifier) {
90
+ cls += `--${modifier}`;
91
+ }
92
+ return cls;
93
+ }
94
+ function useNamespace(block, needDot = false) {
95
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
96
+ const b = () => createBem(namespace);
97
+ const e = (element) => element ? createBem(namespace, element) : "";
98
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
99
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
100
+ return {
101
+ b,
102
+ e,
103
+ m,
104
+ em
105
+ };
106
+ }
107
+ var icon = "";
108
+ var svgIcon = defineComponent({
109
+ name: "DSvgIcon",
110
+ props: svgIconProps,
111
+ setup(props) {
112
+ const {
113
+ name,
114
+ color,
115
+ size
116
+ } = toRefs(props);
117
+ const ns2 = useNamespace("svg-icon");
118
+ const iconName = computed(() => `#icon-${name.value}`);
119
+ const iconSize = computed(() => {
120
+ return typeof size.value === "number" ? `${size.value}px` : size.value;
121
+ });
122
+ const styles = {
123
+ width: iconSize.value,
124
+ height: iconSize.value
125
+ };
126
+ return () => {
127
+ return createVNode("svg", {
128
+ "class": ns2.b(),
129
+ "style": styles
130
+ }, [createVNode("use", {
131
+ "xlink:href": iconName.value,
132
+ "fill": color.value
133
+ }, null)]);
134
+ };
135
+ }
136
+ });
61
137
  var Icon = defineComponent({
62
138
  name: "DIcon",
63
139
  props: iconProps,
64
- setup(props) {
140
+ setup(props, {
141
+ attrs
142
+ }) {
65
143
  const {
144
+ component,
66
145
  name,
67
146
  size,
68
147
  color,
69
148
  classPrefix
70
149
  } = toRefs(props);
71
- return () => {
72
- return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
150
+ const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
151
+ const iconSize = computed(() => {
152
+ return typeof size.value === "number" ? `${size.value}px` : size.value;
153
+ });
154
+ const svgIconDom = () => {
155
+ return createVNode(IconComponent, mergeProps({
156
+ "name": name.value,
157
+ "color": color.value,
158
+ "size": iconSize.value
159
+ }, attrs), null);
160
+ };
161
+ const imgIconDom = () => {
162
+ return createVNode("img", mergeProps({
73
163
  "src": name.value,
74
164
  "alt": name.value.split("/")[name.value.split("/").length - 1],
75
165
  "style": {
76
- width: size.value,
77
- verticalAlign: "text-bottom"
166
+ width: iconSize.value || ""
78
167
  }
79
- }, null) : createVNode("i", {
80
- "class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
168
+ }, attrs), null);
169
+ };
170
+ const fontIconDom = () => {
171
+ const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
172
+ return createVNode("i", mergeProps({
173
+ "class": [classPrefix.value, fontIconClass],
81
174
  "style": {
82
- fontSize: size.value,
175
+ fontSize: iconSize.value,
83
176
  color: color.value
84
177
  }
85
- }, null);
178
+ }, attrs), null);
179
+ };
180
+ return () => {
181
+ return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
86
182
  };
87
183
  }
88
184
  });
@@ -91,8 +187,9 @@ var Close = defineComponent({
91
187
  setup(props, {
92
188
  emit
93
189
  }) {
190
+ const ns2 = useNamespace("notification");
94
191
  return () => createVNode("div", {
95
- "class": "devui-notification-icon-close",
192
+ "class": ns2.e("icon-close"),
96
193
  "onClick": (e) => emit("click", e)
97
194
  }, [createVNode(Icon, {
98
195
  "name": "close",
@@ -100,6 +197,7 @@ var Close = defineComponent({
100
197
  }, null)]);
101
198
  }
102
199
  });
200
+ const ns = useNamespace("notification");
103
201
  function SuccessIcon() {
104
202
  return createVNode("svg", {
105
203
  "width": "16px",
@@ -124,7 +222,7 @@ function SuccessIcon() {
124
222
  "xlink:href": "#path-s"
125
223
  }, null)]), createVNode("use", {
126
224
  "id": "Mask",
127
- "class": "devui-notification-image-success-path",
225
+ "class": ns.e("image-success-path"),
128
226
  "xlink:href": "#path-s"
129
227
  }, null)])]);
130
228
  }
@@ -142,10 +240,10 @@ function WarningIcon() {
142
240
  "fill": "none",
143
241
  "fill-rule": "evenodd"
144
242
  }, [createVNode("path", {
145
- "class": "devui-icon-warning-outer",
243
+ "class": ns.e("warning-outer"),
146
244
  "d": "M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"
147
245
  }, null), createVNode("path", {
148
- "class": "devui-icon-warning-inner",
246
+ "class": ns.e("warning-inner"),
149
247
  "stroke-width": "0.3",
150
248
  "fill-rule": "nonzero",
151
249
  "d": "M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"
@@ -166,7 +264,7 @@ function InfoIcon() {
166
264
  "fill": "none",
167
265
  "fill-rule": "evenodd"
168
266
  }, [createVNode("path", {
169
- "class": "devui-notification-image-info-path",
267
+ "class": ns.e("image-info-path"),
170
268
  "d": "M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",
171
269
  "id": "info"
172
270
  }, null)])]);
@@ -195,7 +293,7 @@ function ErrorIcon() {
195
293
  "xlink:href": "#path-e"
196
294
  }, null)]), createVNode("use", {
197
295
  "id": "Mask",
198
- "class": "devui-notification-image-error-path",
296
+ "class": ns.e("image-error-path"),
199
297
  "xlink:href": "#path-e"
200
298
  }, null)])]);
201
299
  }
@@ -210,9 +308,10 @@ var TypeIcon = defineComponent({
210
308
  const {
211
309
  type
212
310
  } = toRefs(props);
311
+ const ns2 = useNamespace("notification");
213
312
  const classes = computed(() => ({
214
- "devui-notification-image": true,
215
- [`devui-notification-image-${type.value}`]: true
313
+ [ns2.e("image")]: true,
314
+ [ns2.em("image", type.value)]: true
216
315
  }));
217
316
  return () => createVNode("span", {
218
317
  "class": classes.value
@@ -284,6 +383,7 @@ var Notification = defineComponent({
284
383
  close: close2,
285
384
  handleDestroy
286
385
  } = useEvent(props, emit);
386
+ const ns2 = useNamespace("notification");
287
387
  return () => createVNode(Transition, {
288
388
  "name": "notification-fade",
289
389
  "onAfterLeave": handleDestroy
@@ -291,23 +391,23 @@ var Notification = defineComponent({
291
391
  default: () => {
292
392
  var _a;
293
393
  return [modelValue.value && createVNode("div", {
294
- "class": "devui-notification"
394
+ "class": ns2.b()
295
395
  }, [createVNode("div", {
296
396
  "class": classes.value,
297
397
  "onMouseenter": interrupt,
298
398
  "onMouseleave": removeReset
299
399
  }, [createVNode("div", {
300
- "class": "devui-notification-item"
400
+ "class": ns2.e("item")
301
401
  }, [createVNode(Close, {
302
402
  "onClick": close2
303
403
  }, null), title.value && createVNode(TypeIcon, {
304
404
  "type": type.value
305
405
  }, null), createVNode("div", {
306
- "class": "devui-notification-message"
406
+ "class": ns2.e("message")
307
407
  }, [createVNode("span", {
308
- "class": "devui-notification-title"
408
+ "class": ns2.e("title")
309
409
  }, [title.value]), createVNode("span", {
310
- "class": "devui-notification-content"
410
+ "class": ns2.e("content")
311
411
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])])])])])];
312
412
  }
313
413
  });
@@ -1 +1 @@
1
- var B=Object.defineProperty,R=Object.defineProperties;var Z=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var V=(i,e,l)=>e in i?B(i,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[e]=l,m=(i,e)=>{for(var l in e||(e={}))A.call(e,l)&&V(i,l,e[l]);if(w)for(var l of w(e))E.call(e,l)&&V(i,l,e[l]);return i},g=(i,e)=>R(i,Z(e));(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";const l={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},type:{type:String,default:"normal"},duration:{type:Number,default:3e3},onClose:{type:Function}},N={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var x=e.defineComponent({name:"DIcon",props:N,setup(n){const{name:t,size:o,color:a,classPrefix:r}=e.toRefs(n);return()=>/^((https?):)?\/\//.test(t.value)?e.createVNode("img",{src:t.value,alt:t.value.split("/")[t.value.split("/").length-1],style:{width:o.value,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${r.value} ${r.value}-${t.value}`,style:{fontSize:o.value,color:a.value}},null)}}),y=e.defineComponent({emits:["click"],setup(n,{emit:t}){return()=>e.createVNode("div",{class:"devui-notification-icon-close",onClick:o=>t("click",o)},[e.createVNode(x,{name:"close",size:"14px"},null)])}});function k(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("defs",null,[e.createVNode("polygon",{id:"path-s",points:"6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"},null)]),e.createVNode("g",{id:"correct",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",{"xlink:href":"#path-s"},null)]),e.createVNode("use",{id:"Mask",class:"devui-notification-image-success-path","xlink:href":"#path-s"},null)])])}function v(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:"devui-icon-warning-outer",d:"M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"},null),e.createVNode("path",{class:"devui-icon-warning-inner","stroke-width":"0.3","fill-rule":"nonzero",d:"M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"},null)])])}function L(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{id:"info",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:"devui-notification-image-info-path",d:"M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",id:"info"},null)])])}function C(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("defs",null,[e.createVNode("polygon",{id:"path-e",points:"8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"},null)]),e.createVNode("g",{id:"error",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",{"xlink:href":"#path-e"},null)]),e.createVNode("use",{id:"Mask",class:"devui-notification-image-error-path","xlink:href":"#path-e"},null)])])}var S=e.defineComponent({props:{type:{type:String,default:"normal"}},setup(n){const{type:t}=e.toRefs(n),o=e.computed(()=>({"devui-notification-image":!0,[`devui-notification-image-${t.value}`]:!0}));return()=>e.createVNode("span",{class:o.value},[t.value&&t.value!=="normal"&&(t.value==="success"&&e.createVNode(k,null,null)||t.value==="info"&&e.createVNode(L,null,null)||t.value==="warning"&&e.createVNode(v,null,null)||t.value==="error"&&e.createVNode(C,null,null))])}});function T(n){return{classes:e.computed(()=>({"devui-notification-item-container":!0,[`devui-notification-message-${n.type}`]:!0}))}}function M(n,t){let o=null,a;const r=()=>{var s;clearTimeout(o),o=null,(s=n.onClose)==null||s.call(n),t("update:modelValue",!1)},c=()=>{o&&(clearTimeout(o),o=null)},u=()=>{if(!n.modelValue){const s=n.duration-(Date.now()-a);o=setTimeout(r,s)}},f=()=>{t("destroy")};return e.watch(()=>n.modelValue,s=>{s&&(a=Date.now(),n.duration&&(o=setTimeout(r,n.duration)))}),{interrupt:c,removeReset:u,close:r,handleDestroy:f}}var _="",d=e.defineComponent({name:"DNotification",props:l,emits:["update:modelValue","destroy"],setup(n,{emit:t,slots:o}){const{modelValue:a,title:r,type:c}=e.toRefs(n),{classes:u}=T(n),{interrupt:f,removeReset:s,close:j,handleDestroy:z}=M(n,t);return()=>e.createVNode(e.Transition,{name:"notification-fade",onAfterLeave:z},{default:()=>{var h;return[a.value&&e.createVNode("div",{class:"devui-notification"},[e.createVNode("div",{class:u.value,onMouseenter:f,onMouseleave:s},[e.createVNode("div",{class:"devui-notification-item"},[e.createVNode(y,{onClick:j},null),r.value&&e.createVNode(S,{type:c.value},null),e.createVNode("div",{class:"devui-notification-message"},[e.createVNode("span",{class:"devui-notification-title"},[r.value]),e.createVNode("span",{class:"devui-notification-content"},[(h=o.default)==null?void 0:h.call(o)])])])])])]}})}});function b(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const I={modelValue:!1,duration:3e3,type:"normal"};function D(n,t){const o=document.createElement("div"),a=e.createApp({setup(){return e.onUnmounted(()=>{document.body.removeChild(o)}),()=>e.createVNode(d,e.mergeProps(n,{onDestroy:a.unmount}),b(t)?t:{default:()=>[t]})}});return document.body.appendChild(o),a.mount(o),a}function P(n,t){n.modelValue=!1,t==null||t()}class p{static open(t){const o=t.onClose||null,a=t.content;let r;delete t.content;const c=e.reactive(g(m(m({},I),t),{onClose:()=>{P(c,o)}}));D(c,a),c.modelValue=!0,clearTimeout(r),t.duration&&(r=setTimeout(c.onClose,t.duration))}}var $={title:"Notification \u5168\u5C40\u901A\u77E5",category:"\u53CD\u9988",status:"100%",install(n){n.component(d.name,d),n.config.globalProperties.$notificationService=p}};i.Notification=d,i.NotificationService=p,i.default=$,i.notificationProps=l,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
1
+ var U=Object.defineProperty,q=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var v=Object.getOwnPropertySymbols;var X=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var k=(i,e,u)=>e in i?U(i,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[e]=u,y=(i,e)=>{for(var u in e||(e={}))X.call(e,u)&&k(i,u,e[u]);if(v)for(var u of v(e))W.call(e,u)&&k(i,u,e[u]);return i},C=(i,e)=>q(i,O(e));(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";const u={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},type:{type:String,default:"normal"},duration:{type:Number,default:3e3},onClose:{type:Function}};function L(n){return/^((http|https):)?\/\//.test(n)}const S={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"}},I={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function g(n,t,o){let l=n;return t&&(l+=`__${t}`),o&&(l+=`--${o}`),l}function m(n,t=!1){const o=t?`.devui-${n}`:`devui-${n}`;return{b:()=>g(o),e:r=>r?g(o,r):"",m:r=>r?g(o,"",r):"",em:(r,c)=>r&&c?g(o,r,c):""}}var H="",b=e.defineComponent({name:"DSvgIcon",props:I,setup(n){const{name:t,color:o,size:l}=e.toRefs(n),a=m("svg-icon"),s=e.computed(()=>`#icon-${t.value}`),d=e.computed(()=>typeof l.value=="number"?`${l.value}px`:l.value),r={width:d.value,height:d.value};return()=>e.createVNode("svg",{class:a.b(),style:r},[e.createVNode("use",{"xlink:href":s.value,fill:o.value},null)])}}),D=e.defineComponent({name:"DIcon",props:S,setup(n,{attrs:t}){const{component:o,name:l,size:a,color:s,classPrefix:d}=e.toRefs(n),r=o.value?e.resolveDynamicComponent(o.value):e.resolveDynamicComponent(b),c=e.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),w=()=>e.createVNode(r,e.mergeProps({name:l.value,color:s.value,size:c.value},t),null),V=()=>e.createVNode("img",e.mergeProps({src:l.value,alt:l.value.split("/")[l.value.split("/").length-1],style:{width:c.value||""}},t),null),f=()=>{const N=/^icon-/.test(l.value)?l.value:`${d.value}-${l.value}`;return e.createVNode("i",e.mergeProps({class:[d.value,N],style:{fontSize:c.value,color:s.value}},t),null)};return()=>o.value?w():L(l.value)?V():f()}}),P=e.defineComponent({emits:["click"],setup(n,{emit:t}){const o=m("notification");return()=>e.createVNode("div",{class:o.e("icon-close"),onClick:l=>t("click",l)},[e.createVNode(D,{name:"close",size:"14px"},null)])}});const p=m("notification");function T(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("defs",null,[e.createVNode("polygon",{id:"path-s",points:"6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"},null)]),e.createVNode("g",{id:"correct",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",{"xlink:href":"#path-s"},null)]),e.createVNode("use",{id:"Mask",class:p.e("image-success-path"),"xlink:href":"#path-s"},null)])])}function M(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:p.e("warning-outer"),d:"M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"},null),e.createVNode("path",{class:p.e("warning-inner"),"stroke-width":"0.3","fill-rule":"nonzero",d:"M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"},null)])])}function $(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{id:"info",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:p.e("image-info-path"),d:"M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",id:"info"},null)])])}function z(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("defs",null,[e.createVNode("polygon",{id:"path-e",points:"8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"},null)]),e.createVNode("g",{id:"error",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",{"xlink:href":"#path-e"},null)]),e.createVNode("use",{id:"Mask",class:p.e("image-error-path"),"xlink:href":"#path-e"},null)])])}var E=e.defineComponent({props:{type:{type:String,default:"normal"}},setup(n){const{type:t}=e.toRefs(n),o=m("notification"),l=e.computed(()=>({[o.e("image")]:!0,[o.em("image",t.value)]:!0}));return()=>e.createVNode("span",{class:l.value},[t.value&&t.value!=="normal"&&(t.value==="success"&&e.createVNode(T,null,null)||t.value==="info"&&e.createVNode($,null,null)||t.value==="warning"&&e.createVNode(M,null,null)||t.value==="error"&&e.createVNode(z,null,null))])}});function R(n){return{classes:e.computed(()=>({"devui-notification-item-container":!0,[`devui-notification-message-${n.type}`]:!0}))}}function _(n,t){let o=null,l;const a=()=>{var c;clearTimeout(o),o=null,(c=n.onClose)==null||c.call(n),t("update:modelValue",!1)},s=()=>{o&&(clearTimeout(o),o=null)},d=()=>{if(!n.modelValue){const c=n.duration-(Date.now()-l);o=setTimeout(a,c)}},r=()=>{t("destroy")};return e.watch(()=>n.modelValue,c=>{c&&(l=Date.now(),n.duration&&(o=setTimeout(a,n.duration)))}),{interrupt:s,removeReset:d,close:a,handleDestroy:r}}var J="",h=e.defineComponent({name:"DNotification",props:u,emits:["update:modelValue","destroy"],setup(n,{emit:t,slots:o}){const{modelValue:l,title:a,type:s}=e.toRefs(n),{classes:d}=R(n),{interrupt:r,removeReset:c,close:w,handleDestroy:V}=_(n,t),f=m("notification");return()=>e.createVNode(e.Transition,{name:"notification-fade",onAfterLeave:V},{default:()=>{var N;return[l.value&&e.createVNode("div",{class:f.b()},[e.createVNode("div",{class:d.value,onMouseenter:r,onMouseleave:c},[e.createVNode("div",{class:f.e("item")},[e.createVNode(P,{onClick:w},null),a.value&&e.createVNode(E,{type:s.value},null),e.createVNode("div",{class:f.e("message")},[e.createVNode("span",{class:f.e("title")},[a.value]),e.createVNode("span",{class:f.e("content")},[(N=o.default)==null?void 0:N.call(o)])])])])])]}})}});function j(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const B={modelValue:!1,duration:3e3,type:"normal"};function A(n,t){const o=document.createElement("div"),l=e.createApp({setup(){return e.onUnmounted(()=>{document.body.removeChild(o)}),()=>e.createVNode(h,e.mergeProps(n,{onDestroy:l.unmount}),j(t)?t:{default:()=>[t]})}});return document.body.appendChild(o),l.mount(o),l}function F(n,t){n.modelValue=!1,t==null||t()}class x{static open(t){const o=t.onClose||null,l=t.content;let a;delete t.content;const s=e.reactive(C(y(y({},B),t),{onClose:()=>{F(s,o)}}));A(s,l),s.modelValue=!0,clearTimeout(a),t.duration&&(a=setTimeout(s.onClose,t.duration))}}var Z={title:"Notification \u5168\u5C40\u901A\u77E5",category:"\u53CD\u9988",status:"100%",install(n){n.component(h.name,h),n.config.globalProperties.$notificationService=x}};i.Notification=h,i.NotificationService=x,i.default=Z,i.notificationProps=u,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
@@ -1 +1 @@
1
- .devui-notification{position:fixed;top:50px;right:20px;width:20em;word-break:normal;word-wrap:break-word;z-index:1060}.devui-notification a:link,.devui-notification a:visited{color:var(--devui-link-light, #96adfa)}.devui-notification a:hover,.devui-notification a:active{color:var(--devui-link-light-active, #beccfa)}.devui-notification-item-container{position:relative;margin:0 0 8px;opacity:.95;filter:alpha(opacity=95);box-shadow:var(--devui-shadow-length-feedback-overlay, 0 4px 16px 0) var(--devui-shadow, rgba(0, 0, 0, .2));border-radius:var(--devui-border-radius-feedback, 4px);color:var(--devui-feedback-overlay-text, #dfe1e6);background-color:var(--devui-feedback-overlay-bg, #464d6e)}.devui-notification-item{position:relative;display:block;padding:12px 16px}.devui-notification-icon-close{position:absolute;top:7px;right:10px;cursor:pointer}.devui-notification-icon-close i.icon{color:var(--devui-light-text, #ffffff)!important}.devui-notification-title{font-size:var(--devui-font-size-card-title, 14px);padding:0 0 calc(.5em - 2px) 0;display:block;font-weight:700}.devui-notification-image{position:absolute;display:inline-block;width:16px;height:16px;border-radius:50%;left:16px;top:14px;padding:0;line-height:1}.devui-notification-image.devui-notification-image-warning path.devui-icon-warning-outer{fill:var(--devui-warning-line, #fa9841)}.devui-notification-image.devui-notification-image-warning path.devui-icon-warning-inner{fill:var(--devui-light-text, #ffffff);stroke:var(--devui-light-text, #ffffff)}.devui-notification-image.devui-notification-image-info{background-color:var(--devui-info, #5e7ce0)}.devui-notification-image.devui-notification-image-error{background-color:var(--devui-danger, #f66f6a)}.devui-notification-image.devui-notification-image-success{background-color:var(--devui-success, #50d4ab)}.devui-notification-image .devui-notification-image-info-path,.devui-notification-image .devui-notification-image-error-path,.devui-notification-image .devui-notification-image-success-path{fill:var(--devui-light-text, #ffffff)}.devui-notification-message{margin-left:20px}.devui-notification-message .devui-notification-content{font-size:var(--devui-font-size, 12px);margin-top:4px}.devui-notification-message-common .devui-notification-message{margin-left:0}.devui-notification-message p{font-size:var(--devui-font-size, 12px);margin-top:4px}.notification-fade-enter-active,.notification-fade-leave-active{transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out, cubic-bezier(.5, .05, .5, .95))}.notification-fade-enter-from,.notification-fade-leave-to{transform:translate(100%)}
1
+ .devui-svg-icon{vertical-align:middle}.devui-notification{position:fixed;top:50px;right:20px;width:20em;word-break:normal;word-wrap:break-word;z-index:1060}.devui-notification a:link,.devui-notification a:visited{color:var(--devui-link-light, #96adfa)}.devui-notification a:hover,.devui-notification a:active{color:var(--devui-link-light-active, #beccfa)}.devui-notification-item-container{position:relative;margin:0 0 8px;opacity:.95;filter:alpha(opacity=95);box-shadow:var(--devui-shadow-length-feedback-overlay, 0 4px 16px 0) var(--devui-shadow, rgba(37, 43, 58, .2));border-radius:var(--devui-border-radius-feedback, 4px);color:var(--devui-feedback-overlay-text, #dfe1e6);background-color:var(--devui-feedback-overlay-bg, #464d6e)}.devui-notification__item{position:relative;display:block;padding:12px 16px}.devui-notification__icon-close{position:absolute;top:7px;right:10px;cursor:pointer}.devui-notification__icon-close i.icon{color:var(--devui-light-text, #ffffff)!important}.devui-notification__title{font-size:var(--devui-font-size-card-title, 14px);padding:0 0 calc(.5em - 2px) 0;display:block;font-weight:700}.devui-notification__image{position:absolute;display:inline-block;width:16px;height:16px;border-radius:50%;left:16px;top:14px;padding:0;line-height:1}.devui-notification__image.devui-notification__image--warning path.devui-notification__warning-outer{fill:var(--devui-warning-line, #fa9841)}.devui-notification__image.devui-notification__image--warning path.devui-notification__warning-inner{fill:var(--devui-light-text, #ffffff);stroke:var(--devui-light-text, #ffffff)}.devui-notification__image.devui-notification__image--info{background-color:var(--devui-info, #5e7ce0)}.devui-notification__image.devui-notification__image--error{background-color:var(--devui-danger, #f66f6a)}.devui-notification__image.devui-notification__image--success{background-color:var(--devui-success, #50d4ab)}.devui-notification__image .devui-notification__image-info-path,.devui-notification__image .devui-notification__image-error-path,.devui-notification__image .devui-notification__image-success-path{fill:var(--devui-light-text, #ffffff)}.devui-notification__message{margin-left:20px}.devui-notification__message .devui-notification__content{font-size:var(--devui-font-size, 12px);margin-top:4px}.devui-notification-message-common .devui-notification__message{margin-left:0}.devui-notification__message p{font-size:var(--devui-font-size, 12px);margin-top:4px}.notification-fade-enter-active,.notification-fade-leave-active{transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out, cubic-bezier(.5, .05, .5, .95))}.notification-fade-enter-from,.notification-fade-leave-to{transform:translate(100%)}
@@ -0,0 +1,3 @@
1
+ import '../../button/style.css'
2
+
3
+ export { ButtonGroup as default } from '../../button/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../checkbox/style.css'
2
+
3
+ export { CheckboxButton as default } from '../../checkbox/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../checkbox/style.css'
2
+
3
+ export { CheckboxGroup as default } from '../../checkbox/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../form/style.css'
2
+
3
+ export { FORM_ITEM_TOKEN as default } from '../../form/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../form/style.css'
2
+
3
+ export { FORM_TOKEN as default } from '../../form/index.es.js'
@@ -1,2 +1,3 @@
1
+ import '../../icon/style.css'
1
2
 
2
3
  export { Icon as default } from '../../icon/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../form/style.css'
2
+
3
+ export { LABEL_DATA as default } from '../../form/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../select/style.css'
2
+
3
+ export { Option as default } from '../../select/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../button/style.css'
2
+
3
+ export { buttonGroupInjectionKey as default } from '../../button/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../button/style.css'
2
+
3
+ export { buttonGroupProps as default } from '../../button/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../form/style.css'
2
+
3
+ export { formControlProps as default } from '../../form/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../form/style.css'
2
+
3
+ export { formItemProps as default } from '../../form/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../form/style.css'
2
+
3
+ export { formProps as default } from '../../form/index.es.js'
@@ -1,2 +1,3 @@
1
+ import '../../icon/style.css'
1
2
 
2
3
  export { iconProps as default } from '../../icon/index.es.js'
@@ -0,0 +1,3 @@
1
+ import '../../icon/style.css'
2
+
3
+ export { svgIconProps as default } from '../../icon/index.es.js'
@@ -19,19 +19,43 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps } from "vue";
21
21
  import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
22
+ function createBem(namespace, element, modifier) {
23
+ let cls = namespace;
24
+ if (element) {
25
+ cls += `__${element}`;
26
+ }
27
+ if (modifier) {
28
+ cls += `--${modifier}`;
29
+ }
30
+ return cls;
31
+ }
32
+ function useNamespace(block, needDot = false) {
33
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
34
+ const b = () => createBem(namespace);
35
+ const e = (element) => element ? createBem(namespace, element) : "";
36
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
37
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
38
+ return {
39
+ b,
40
+ e,
41
+ m,
42
+ em
43
+ };
44
+ }
22
45
  var baseOverlay = "";
23
46
  function _isSlot(s) {
24
47
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
25
48
  }
26
49
  const CommonOverlay = defineComponent({
27
50
  setup(props, ctx) {
51
+ const ns = useNamespace("overlay");
28
52
  return () => {
29
53
  let _slot;
30
54
  return createVNode(Teleport, {
31
55
  "to": "#d-overlay-anchor"
32
56
  }, {
33
57
  default: () => [createVNode(Transition, {
34
- "name": "devui-overlay-fade"
58
+ "name": ns.e("fade")
35
59
  }, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
36
60
  default: () => [_slot]
37
61
  })]
@@ -74,15 +98,12 @@ const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
74
98
  });
75
99
  const overlayEmits = ["update:visible", "backdropClick"];
76
100
  function useOverlayLogic(props, ctx) {
101
+ const ns = useNamespace("overlay");
77
102
  const backgroundClass = computed(() => {
78
- return [
79
- "devui-overlay-background",
80
- props.backgroundClass,
81
- !props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
82
- ];
103
+ return [ns.e("background"), props.backgroundClass, !props.hasBackdrop ? ns.em("background", "disabled") : ns.em("background", "color")];
83
104
  });
84
105
  const overlayClass = computed(() => {
85
- return "devui-overlay";
106
+ return ns.b();
86
107
  });
87
108
  const handleBackdropClick = (event) => {
88
109
  var _a;
@@ -292,6 +313,7 @@ const FlexibleOverlay = defineComponent({
292
313
  emit,
293
314
  expose
294
315
  }) {
316
+ const ns = useNamespace("flexible-overlay");
295
317
  const {
296
318
  arrowRef,
297
319
  overlayRef,
@@ -304,10 +326,10 @@ const FlexibleOverlay = defineComponent({
304
326
  var _a;
305
327
  return props.modelValue && createVNode("div", mergeProps({
306
328
  "ref": overlayRef,
307
- "class": "devui-flexible-overlay"
329
+ "class": ns.b()
308
330
  }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
309
331
  "ref": arrowRef,
310
- "class": "devui-flexible-overlay-arrow"
332
+ "class": ns.e("arrow")
311
333
  }, null)]);
312
334
  };
313
335
  }
@@ -1 +1 @@
1
- var z=Object.defineProperty,D=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var A=(l,t,a)=>t in l?z(l,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[t]=a,j=(l,t)=>{for(var a in t||(t={}))q.call(t,a)&&A(l,a,t[a]);if(V)for(var a of V(t))X.call(t,a)&&A(l,a,t[a]);return l},P=(l,t)=>D(l,M(t));(function(l,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):(l=typeof globalThis!="undefined"?globalThis:l||self,t(l.index={},l.Vue,l.dom))})(this,function(l,t,a){"use strict";var I="";function L(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const N=t.defineComponent({setup(e,i){return()=>{let r;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:"devui-overlay-fade"},L(r=t.renderSlot(i.slots,"default"))?r:{default:()=>[r]})]})}}}),p={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}},k=P(j({},p),{overlayStyle:{type:[String,Object],default:void 0}}),C=["update:visible","backdropClick"];function F(e,i){const r=t.computed(()=>["devui-overlay-background",e.backgroundClass,e.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),d=t.computed(()=>"devui-overlay"),n=o=>{var c;o.preventDefault(),(c=e.onBackdropClick)==null||c.call(e),e.backdropClose&&i.emit("update:visible",!1)},s=o=>o.cancelBubble=!0;return t.onMounted(()=>{const o=document.body,c=o.style.overflow,f=o.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([u,y])=>{if(y){const v=o.getBoundingClientRect().y;u?(o.style.overflowY="scroll",o.style.position=u?"fixed":"",o.style.top=`${v}px`):(o.style.overflowY=c,o.style.position=f,o.style.top="",window.scrollTo(0,-v))}}),t.onUnmounted(()=>{document.body.style.overflow=c})}),{backgroundClass:r,overlayClass:d,handleBackdropClick:n,handleOverlayBubbleCancel:s}}var U="";const m=t.defineComponent({name:"DFixedOverlay",props:k,emits:C,setup(e,i){const{backgroundClass:r,overlayClass:d,handleBackdropClick:n,handleOverlayBubbleCancel:s}=F(e,i);return()=>t.createVNode(N,null,{default:()=>[e.visible&&t.createVNode("div",{class:r.value,style:e.backgroundStyle,onClick:n},[t.createVNode("div",{class:d.value,style:e.overlayStyle,onClick:s},[t.renderSlot(i.slots,"default")])])]})}}),x={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 _(e){const i=/(auto|scroll|hidden)/;for(let r=e;r=r.parentElement;r.parentElement!==document.body){const d=window.getComputedStyle(r);if(i.test(d.overflow+d.overflowX+d.overflowY))return r}return window}function R(e,i,r,d){let{x:n,y:s}=i;if(!e){const{width:o,height:c}=d;n&&r.includes("start")&&(n=12),n&&r.includes("end")&&(n=Math.round(o-24)),s&&r.includes("start")&&(s=10),s&&r.includes("end")&&(s=c-14)}return{x:n,y:s}}function T(e,i){const r=t.ref(),d=t.ref();let n=null;const s=(c,f,u,y)=>{const{x:v,y:w}=R(e.isArrowCenter,u,f,y.getBoundingClientRect()),b={top:"bottom",right:"left",bottom:"top",left:"right"}[f.split("-")[0]];Object.assign(c.style,{left:v?`${v}px`:"",top:w?`${w}px`:"",right:"",bottom:"",[b]:"-4px"})},o=async()=>{const c=e.origin,f=t.unref(r.value),u=t.unref(d.value),y=[a.offset(e.offset),a.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&y.push(a.arrow({element:u})),e.shiftOffset!==void 0&&y.push(a.shift());const{x:v,y:w,placement:b,middlewareData:B}=await a.computePosition(c,f,{strategy:"fixed",middleware:y});let g=v,O=w;if(e.shiftOffset!==void 0){const{x:E,y:S}=B.shift;E<0&&(g-=e.shiftOffset),E>0&&(g+=e.shiftOffset),S<0&&(O-=e.shiftOffset),S>0&&(O+=e.shiftOffset)}i("positionChange",b),Object.assign(f.style,{top:`${O}px`,left:`${g}px`}),e.showArrow&&s(u,b,B.arrow,f)};return t.watch(()=>e.modelValue,()=>{e.modelValue&&e.origin?(n=_(e.origin),t.nextTick(o),n==null||n.addEventListener("scroll",o),n!==window&&window.addEventListener("scroll",o),window.addEventListener("resize",o)):(n==null||n.removeEventListener("scroll",o),n!==window&&window.removeEventListener("scroll",o),window.removeEventListener("resize",o))}),t.onUnmounted(()=>{n==null||n.removeEventListener("scroll",o),n!==window&&window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}),{arrowRef:d,overlayRef:r,updatePosition:o}}var G="";const h=t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:x,emits:["update:modelValue","positionChange"],setup(e,{slots:i,attrs:r,emit:d,expose:n}){const{arrowRef:s,overlayRef:o,updatePosition:c}=T(e,d);return n({updatePosition:c}),()=>{var f;return e.modelValue&&t.createVNode("div",t.mergeProps({ref:o,class:"devui-flexible-overlay"},r),[(f=i.default)==null?void 0:f.call(i),e.showArrow&&t.createVNode("div",{ref:s,class:"devui-flexible-overlay-arrow"},null)])}}}),Y=typeof window!="undefined";var $={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(e){if(e.component(m.name,m),e.component(h.name,h),Y&&!document.getElementById("d-overlay-anchor")){const i=document.createElement("div");i.setAttribute("id","d-overlay-anchor"),i.style.position="fixed",i.style.left="0",i.style.top="0",i.style.zIndex="1000",document.body.appendChild(i)}}};l.FixedOverlay=m,l.FlexibleOverlay=h,l.default=$,l.fixedOverlayProps=k,l.flexibleOverlayProps=x,l.overlayEmits=C,l.overlayProps=p,Object.defineProperty(l,"__esModule",{value:!0}),l[Symbol.toStringTag]="Module"});
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"});
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(0, 0, 0, .2));z-index:1000}.devui-flexible-overlay-arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}
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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-devui",
3
- "version": "1.0.0-rc.6",
3
+ "version": "1.0.0-rc.9",
4
4
  "license": "MIT",
5
5
  "description": "DevUI components based on Vite and Vue3",
6
6
  "keywords": [
@@ -27,6 +27,7 @@
27
27
  "@devui-design/icons": "^1.3.0",
28
28
  "@floating-ui/dom": "^0.4.4",
29
29
  "@types/lodash-es": "^4.17.4",
30
+ "@vue/shared": "^3.2.33",
30
31
  "@vueuse/core": "^7.7.1",
31
32
  "async-validator": "^4.0.2",
32
33
  "devui-theme": "^0.0.1",