vue-devui 1.0.0-rc.8 → 1.0.1

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 (228) hide show
  1. package/README.md +188 -149
  2. package/alert/index.es.js +14 -9
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8392 -418
  6. package/auto-complete/index.umd.js +29 -5
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +59 -74
  9. package/avatar/index.umd.js +1 -1
  10. package/badge/index.es.js +10 -4
  11. package/badge/index.umd.js +1 -1
  12. package/badge/style.css +1 -1
  13. package/button/index.es.js +191 -53
  14. package/button/index.umd.js +17 -17
  15. package/button/style.css +1 -1
  16. package/card/index.es.js +7 -3
  17. package/card/index.umd.js +1 -1
  18. package/card/style.css +1 -1
  19. package/checkbox/index.es.js +8050 -241
  20. package/checkbox/index.umd.js +27 -1
  21. package/checkbox/style.css +1 -1
  22. package/{date-picker → collapse}/index.d.ts +0 -0
  23. package/collapse/index.es.js +213 -0
  24. package/collapse/index.umd.js +1 -0
  25. package/{date-picker → collapse}/package.json +1 -1
  26. package/collapse/style.css +1 -0
  27. package/countdown/index.es.js +56 -13
  28. package/countdown/index.umd.js +1 -1
  29. package/date-picker-pro/index.d.ts +7 -0
  30. package/date-picker-pro/index.es.js +12022 -0
  31. package/date-picker-pro/index.umd.js +27 -0
  32. package/date-picker-pro/package.json +7 -0
  33. package/date-picker-pro/style.css +1 -0
  34. package/drawer/index.es.js +24 -7
  35. package/drawer/index.umd.js +1 -1
  36. package/drawer/style.css +1 -1
  37. package/dropdown/index.es.js +190 -165
  38. package/dropdown/index.umd.js +1 -1
  39. package/dropdown/style.css +1 -1
  40. package/editable-select/index.es.js +785 -145
  41. package/editable-select/index.umd.js +1 -1
  42. package/editable-select/style.css +1 -1
  43. package/form/index.es.js +399 -300
  44. package/form/index.umd.js +16 -16
  45. package/form/style.css +1 -1
  46. package/fullscreen/index.es.js +2 -2
  47. package/fullscreen/index.umd.js +1 -1
  48. package/grid/index.es.js +8 -6
  49. package/grid/index.umd.js +1 -1
  50. package/icon/index.es.js +185 -23
  51. package/icon/index.umd.js +1 -1
  52. package/icon/style.css +1 -0
  53. package/image-preview/index.es.js +2 -2
  54. package/image-preview/index.umd.js +1 -1
  55. package/image-preview/style.css +1 -1
  56. package/input/index.es.js +8220 -45
  57. package/input/index.umd.js +27 -1
  58. package/input/style.css +1 -1
  59. package/input-number/index.es.js +279 -204
  60. package/input-number/index.umd.js +1 -1
  61. package/input-number/style.css +1 -1
  62. package/layout/index.es.js +3 -3
  63. package/layout/index.umd.js +1 -1
  64. package/loading/index.es.js +53 -53
  65. package/loading/index.umd.js +1 -1
  66. package/loading/style.css +1 -1
  67. package/mention/index.d.ts +7 -0
  68. package/mention/index.es.js +8319 -0
  69. package/mention/index.umd.js +36 -0
  70. package/mention/package.json +7 -0
  71. package/mention/style.css +1 -0
  72. package/menu/index.d.ts +7 -0
  73. package/menu/index.es.js +921 -0
  74. package/menu/index.umd.js +1 -0
  75. package/menu/package.json +7 -0
  76. package/menu/style.css +1 -0
  77. package/message/index.d.ts +7 -0
  78. package/message/index.es.js +539 -0
  79. package/message/index.umd.js +1 -0
  80. package/message/package.json +7 -0
  81. package/message/style.css +1 -0
  82. package/modal/index.es.js +451 -173
  83. package/modal/index.umd.js +1 -1
  84. package/modal/style.css +1 -1
  85. package/notification/index.es.js +212 -70
  86. package/notification/index.umd.js +1 -1
  87. package/notification/style.css +1 -1
  88. package/nuxt/components/CheckboxButton.js +3 -0
  89. package/nuxt/components/Collapse.js +3 -0
  90. package/nuxt/components/CollapseItem.js +3 -0
  91. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  92. package/nuxt/components/DatePickerPro.js +3 -0
  93. package/nuxt/components/Icon.js +1 -0
  94. package/nuxt/components/IconGroup.js +3 -0
  95. package/nuxt/components/LABEL_DATA.js +3 -0
  96. package/nuxt/components/Mention.js +3 -0
  97. package/nuxt/components/Menu.js +3 -0
  98. package/nuxt/components/MenuItem.js +3 -0
  99. package/nuxt/components/Message.js +3 -0
  100. package/nuxt/components/Option.js +3 -0
  101. package/nuxt/components/OptionGroup.js +3 -0
  102. package/nuxt/components/RadioButton.js +3 -0
  103. package/nuxt/components/Step.js +3 -0
  104. package/nuxt/components/Steps.js +3 -0
  105. package/nuxt/components/SubMenu.js +3 -0
  106. package/nuxt/components/TABLE_TOKEN.js +3 -0
  107. package/nuxt/components/TimePicker.js +3 -0
  108. package/nuxt/components/TimeSelect.js +3 -0
  109. package/nuxt/components/animationInjectionKey.js +3 -0
  110. package/nuxt/components/collapseItemProps.js +3 -0
  111. package/nuxt/components/collapseProps.js +3 -0
  112. package/nuxt/components/datePickerProCommonProps.js +3 -0
  113. package/nuxt/components/datePickerProPanelProps.js +3 -0
  114. package/nuxt/components/datePickerProProps.js +3 -0
  115. package/nuxt/components/iconProps.js +1 -0
  116. package/nuxt/components/mentionProps.js +3 -0
  117. package/nuxt/components/messageProps.js +3 -0
  118. package/nuxt/components/paginationInjectionKey.js +3 -0
  119. package/nuxt/components/roundInjectionKey.js +3 -0
  120. package/nuxt/components/skeletonItemProps.js +3 -0
  121. package/nuxt/components/stepProps.js +3 -0
  122. package/nuxt/components/stepsProps.js +3 -0
  123. package/nuxt/components/svgIconProps.js +3 -0
  124. package/nuxt/components/tableProps.js +3 -0
  125. package/nuxt/components/timerPickerPanelProps.js +3 -0
  126. package/nuxt/components/treeNodeProps.js +3 -0
  127. package/overlay/index.es.js +89 -142
  128. package/overlay/index.umd.js +1 -1
  129. package/overlay/style.css +1 -1
  130. package/package.json +8 -4
  131. package/pagination/index.es.js +10180 -129
  132. package/pagination/index.umd.js +27 -1
  133. package/pagination/style.css +1 -1
  134. package/panel/index.es.js +4 -0
  135. package/panel/index.umd.js +1 -1
  136. package/panel/style.css +1 -1
  137. package/popover/index.es.js +262 -229
  138. package/popover/index.umd.js +15 -15
  139. package/popover/style.css +1 -1
  140. package/progress/index.es.js +2 -2
  141. package/progress/index.umd.js +2 -2
  142. package/progress/style.css +1 -1
  143. package/radio/index.es.js +7954 -156
  144. package/radio/index.umd.js +27 -1
  145. package/radio/style.css +1 -1
  146. package/rate/index.es.js +16 -8
  147. package/rate/index.umd.js +1 -1
  148. package/rate/style.css +1 -1
  149. package/result/index.es.js +170 -22
  150. package/result/index.umd.js +1 -1
  151. package/result/style.css +1 -1
  152. package/search/index.es.js +3829 -1042
  153. package/search/index.umd.js +18 -18
  154. package/search/style.css +1 -1
  155. package/select/index.es.js +9202 -495
  156. package/select/index.umd.js +27 -1
  157. package/select/style.css +1 -1
  158. package/skeleton/index.es.js +89 -263
  159. package/skeleton/index.umd.js +1 -1
  160. package/skeleton/style.css +1 -1
  161. package/slider/index.es.js +118 -145
  162. package/slider/index.umd.js +1 -1
  163. package/slider/style.css +1 -1
  164. package/splitter/index.es.js +454 -233
  165. package/splitter/index.umd.js +13 -13
  166. package/splitter/style.css +1 -1
  167. package/statistic/index.es.js +34 -16
  168. package/statistic/index.umd.js +1 -1
  169. package/statistic/style.css +1 -1
  170. package/status/index.es.js +6 -2
  171. package/status/index.umd.js +1 -1
  172. package/status/style.css +1 -1
  173. package/steps/index.d.ts +7 -0
  174. package/steps/index.es.js +387 -0
  175. package/steps/index.umd.js +1 -0
  176. package/steps/package.json +7 -0
  177. package/steps/style.css +1 -0
  178. package/style.css +1 -1
  179. package/switch/index.es.js +7787 -62
  180. package/switch/index.umd.js +27 -1
  181. package/switch/style.css +1 -1
  182. package/table/index.es.js +5225 -1726
  183. package/table/index.umd.js +18 -18
  184. package/table/style.css +1 -1
  185. package/tabs/index.es.js +303 -102
  186. package/tabs/index.umd.js +1 -1
  187. package/tabs/style.css +1 -1
  188. package/tag/index.es.js +11 -8
  189. package/tag/index.umd.js +1 -1
  190. package/tag/style.css +1 -1
  191. package/textarea/index.es.js +7876 -41
  192. package/textarea/index.umd.js +35 -1
  193. package/textarea/style.css +1 -1
  194. package/time-picker/index.d.ts +7 -0
  195. package/time-picker/index.es.js +9549 -0
  196. package/time-picker/index.umd.js +27 -0
  197. package/time-picker/package.json +7 -0
  198. package/time-picker/style.css +1 -0
  199. package/time-select/index.d.ts +7 -0
  200. package/time-select/index.es.js +9607 -0
  201. package/time-select/index.umd.js +27 -0
  202. package/time-select/package.json +7 -0
  203. package/time-select/style.css +1 -0
  204. package/timeline/index.es.js +170 -22
  205. package/timeline/index.umd.js +1 -1
  206. package/timeline/style.css +1 -1
  207. package/tooltip/index.es.js +286 -238
  208. package/tooltip/index.umd.js +14 -14
  209. package/tooltip/style.css +1 -1
  210. package/tree/index.es.js +11342 -793
  211. package/tree/index.umd.js +27 -1
  212. package/tree/style.css +1 -1
  213. package/upload/index.es.js +458 -102
  214. package/upload/index.umd.js +1 -1
  215. package/upload/style.css +1 -1
  216. package/vue-devui.es.js +20475 -11072
  217. package/vue-devui.umd.js +31 -24
  218. package/date-picker/index.es.js +0 -1097
  219. package/date-picker/index.umd.js +0 -1
  220. package/date-picker/style.css +0 -1
  221. package/nuxt/components/DatePicker.js +0 -3
  222. package/nuxt/components/FormControl.js +0 -3
  223. package/nuxt/components/FormLabel.js +0 -3
  224. package/nuxt/components/Loading.js +0 -3
  225. package/nuxt/components/StickSlider.js +0 -3
  226. package/nuxt/components/formControlProps.js +0 -3
  227. package/nuxt/components/overlayEmits.js +0 -3
  228. package/nuxt/components/overlayProps.js +0 -3
@@ -21,7 +21,18 @@ var __publicField = (obj, key, value) => {
21
21
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
22
  return value;
23
23
  };
24
- import { defineComponent, ref, createVNode, h, render } from "vue";
24
+ import { h, render, defineComponent, ref, createVNode } from "vue";
25
+ const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
26
+ function createComponent(component, props, children = null) {
27
+ const vnode = h(component, __spreadValues({}, props), children);
28
+ const container = document.createElement("div");
29
+ vnode[COMPONENT_CONTAINER_SYMBOL] = container;
30
+ render(vnode, container);
31
+ return vnode.component;
32
+ }
33
+ function unmountComponent(ComponnetInstance) {
34
+ render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
35
+ }
25
36
  class View {
26
37
  constructor() {
27
38
  __publicField(this, "top", "50%");
@@ -62,8 +73,8 @@ function createBem(namespace, element, modifier) {
62
73
  }
63
74
  return cls;
64
75
  }
65
- function useNamespace(block) {
66
- const namespace = `devui-${block}`;
76
+ function useNamespace(block, needDot = false) {
77
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
67
78
  const b = () => createBem(namespace);
68
79
  const e = (element) => element ? createBem(namespace, element) : "";
69
80
  const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
@@ -77,7 +88,7 @@ function useNamespace(block) {
77
88
  }
78
89
  var loading$1 = "";
79
90
  var Loading = defineComponent({
80
- name: "DLoading",
91
+ name: "Loading",
81
92
  inheritAttrs: false,
82
93
  props: loadingProps,
83
94
  setup(props) {
@@ -138,18 +149,40 @@ var Loading = defineComponent({
138
149
  }, [message]) : null])])]);
139
150
  }
140
151
  });
141
- const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
142
- function createComponent(component, props, children = null) {
143
- const vnode = h(component, __spreadValues({}, props), children);
144
- const container = document.createElement("div");
145
- vnode[COMPONENT_CONTAINER_SYMBOL] = container;
146
- render(vnode, container);
147
- return vnode.component;
148
- }
149
- function unmountComponent(ComponnetInstance) {
150
- render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
151
- }
152
152
  const loadingConstructor$1 = defineComponent(Loading);
153
+ const cacheTarget = /* @__PURE__ */ new WeakMap();
154
+ const loading = {
155
+ open(options = {}) {
156
+ var _a, _b, _c;
157
+ const parent = options.target || document.body;
158
+ if (cacheTarget.has(parent)) {
159
+ return cacheTarget.get(parent);
160
+ }
161
+ if (parent.style) {
162
+ parent.style.position = options.positionType;
163
+ }
164
+ const isFull = document.body === parent;
165
+ options = __spreadValues(__spreadValues({}, new LoadingOptions()), options);
166
+ const instance = createComponent(loadingConstructor$1, __spreadProps(__spreadValues({}, options), {
167
+ isFull
168
+ }), options.loadingTemplateRef ? () => options.loadingTemplateRef : null);
169
+ cacheTarget.set(parent, instance);
170
+ (_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.open();
171
+ parent.appendChild((_b = instance == null ? void 0 : instance.proxy) == null ? void 0 : _b.$el);
172
+ const close = (_c = instance == null ? void 0 : instance.proxy) == null ? void 0 : _c.close;
173
+ if (instance) {
174
+ instance.loadingInstance = instance == null ? void 0 : instance.proxy;
175
+ if (instance.loadingInstance) {
176
+ instance.loadingInstance.close = (...args) => {
177
+ cacheTarget.delete(parent);
178
+ close == null ? void 0 : close(...args);
179
+ };
180
+ }
181
+ }
182
+ return instance;
183
+ }
184
+ };
185
+ const loadingConstructor = defineComponent(Loading);
153
186
  const cacheInstance = /* @__PURE__ */ new WeakSet();
154
187
  const isEmpty = (val) => {
155
188
  if (!val) {
@@ -229,13 +262,13 @@ const handleProps = (el, vprops) => {
229
262
  var _a;
230
263
  const props = __spreadValues(__spreadValues({}, new LoadingOptions()), vprops);
231
264
  const loadingTemplateRef = props.loadingTemplateRef;
232
- const loadingInstance = createComponent(loadingConstructor$1, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
233
- el.style.position = props.positionType;
265
+ const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
266
+ el.style.position = props.positionType || "relative";
234
267
  el.options = props;
235
268
  el.instance = loadingInstance;
236
269
  el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
237
270
  };
238
- const loadingDirective = {
271
+ const LoadingDirective = {
239
272
  mounted: function(el, binding, vnode) {
240
273
  handleProps(el, vnode.props);
241
274
  removeAttribute(el);
@@ -250,46 +283,13 @@ const loadingDirective = {
250
283
  toggleLoading(el, binding);
251
284
  }
252
285
  };
253
- const loadingConstructor = defineComponent(Loading);
254
- const cacheTarget = /* @__PURE__ */ new WeakMap();
255
- const loading = {
256
- open(options = {}) {
257
- var _a, _b, _c;
258
- const parent = options.target || document.body;
259
- if (cacheTarget.has(parent)) {
260
- return cacheTarget.get(parent);
261
- }
262
- if (parent.style) {
263
- parent.style.position = options.positionType;
264
- }
265
- const isFull = document.body === parent;
266
- options = __spreadValues(__spreadValues({}, new LoadingOptions()), options);
267
- const instance = createComponent(loadingConstructor, __spreadProps(__spreadValues({}, options), {
268
- isFull
269
- }), options.loadingTemplateRef ? () => options.loadingTemplateRef : null);
270
- cacheTarget.set(parent, instance);
271
- (_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.open();
272
- parent.appendChild((_b = instance == null ? void 0 : instance.proxy) == null ? void 0 : _b.$el);
273
- const close = (_c = instance == null ? void 0 : instance.proxy) == null ? void 0 : _c.close;
274
- if (instance) {
275
- instance.loadingInstance = instance == null ? void 0 : instance.proxy;
276
- if (instance.loadingInstance) {
277
- instance.loadingInstance.close = (...args) => {
278
- cacheTarget.delete(parent);
279
- close == null ? void 0 : close(...args);
280
- };
281
- }
282
- }
283
- return instance;
284
- }
285
- };
286
286
  var index = {
287
287
  title: "Loading \u52A0\u8F7D\u63D0\u793A",
288
288
  category: "\u53CD\u9988",
289
289
  status: "100%",
290
290
  install(app) {
291
- app.directive("dLoading", loadingDirective);
291
+ app.directive("loading", LoadingDirective);
292
292
  app.config.globalProperties.$loadingService = loading;
293
293
  }
294
294
  };
295
- export { loadingDirective as Loading, LoadingOptions, loading as LoadingService, index as default, loadingProps };
295
+ export { LoadingDirective, LoadingOptions, loading as LoadingService, index as default, loadingProps };
@@ -1 +1 @@
1
- var B=Object.defineProperty,D=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var h=(a,t,c)=>t in a?B(a,t,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[t]=c,p=(a,t)=>{for(var c in t||(t={}))I.call(t,c)&&h(a,c,t[c]);if(O)for(var c of O(t))W.call(t,c)&&h(a,c,t[c]);return a},C=(a,t)=>D(a,F(t));var l=(a,t,c)=>(h(a,typeof t!="symbol"?t+"":t,c),c);(function(a,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(a=typeof globalThis!="undefined"?globalThis:a||self,t(a.index={},a.Vue))})(this,function(a,t){"use strict";class c{constructor(){l(this,"top","50%");l(this,"left","50%")}}const v={message:String,backdrop:Boolean,view:{type:Object,default:()=>new c},zIndex:Number,isFull:{type:Boolean,default:!1}};class y{constructor(){l(this,"target");l(this,"message");l(this,"loadingTemplateRef");l(this,"backdrop",!0);l(this,"positionType","relative");l(this,"view",new c);l(this,"zIndex")}}function m(e,o,r){let n=e;return o&&(n+=`__${o}`),r&&(n+=`--${r}`),n}function _(e){const o=`devui-${e}`;return{b:()=>m(o),e:s=>s?m(o,s):"",m:s=>s?m(o,"",s):"",em:(s,u)=>s&&u?m(o,s,u):""}}var q="",w=t.defineComponent({name:"DLoading",inheritAttrs:!1,props:v,setup(e){const o={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(o.background="none");const r=t.ref(!1);return{style:o,isShow:r,open:()=>{r.value=!0},close:()=>{r.value=!1}}},render(){var u;const{isShow:e,isFull:o,backdrop:r,style:n,message:i,$slots:d}=this,s=_("loading");return e&&t.createVNode("div",{class:[s.b(),o?s.m("full"):""]},[((u=d.default)==null?void 0:u.call(d))||t.createVNode("div",{class:s.e("wrapper")},[r?t.createVNode("div",{class:s.e("mask")},null):null,t.createVNode("div",{style:n,class:s.e("area")},[t.createVNode("div",{class:s.e("busy-default-spinner")},[t.createVNode("div",{class:s.e("bar1")},null),t.createVNode("div",{class:s.e("bar2")},null),t.createVNode("div",{class:s.e("bar3")},null),t.createVNode("div",{class:s.e("bar4")},null)]),i?t.createVNode("span",{class:s.e("text")},[i]):null])])])}});const N=Symbol("dev_component_container");function T(e,o,r=null){const n=t.h(e,p({},o),r),i=document.createElement("div");return n[N]=i,t.render(n,i),n.component}function $(e){t.render(null,e==null?void 0:e.vnode[N])}const j=t.defineComponent(w),f=new WeakSet,b=e=>{if(!e)return!0;if(Array.isArray(e))return e.length===0;if(e instanceof Set||e instanceof Map)return e.size===0;if(e instanceof Promise)return!1;if(typeof e=="object")try{return Object.keys(e).length===0}catch{return!1}return!1},A=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),z=e=>{switch(A(e)){case"promise":return[e];case"array":return e.some(r=>A(r)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},x=e=>{f.delete(e),e.instance.proxy.close(),$(e.instance)},S=(e,o)=>{var r,n,i;if(o.value){const d=z(o.value);if(d==="error")return;(i=(n=(r=e==null?void 0:e.instance)==null?void 0:r.proxy)==null?void 0:n.open)==null||i.call(n),e.appendChild(e.mask),f.add(e),d&&Promise.all(d).catch(s=>{console.error(new Error("Promise handling errors"),s)}).finally(()=>{x(e)})}else x(e)},V=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},k=(e,o)=>{var d;const r=p(p({},new y),o),n=r.loadingTemplateRef,i=T(j,p({},r),n?()=>n:null);e.style.position=r.positionType,e.options=r,e.instance=i,e.mask=(d=i==null?void 0:i.proxy)==null?void 0:d.$el},L={mounted:function(e,o,r){k(e,r.props),V(e),!b(o.value)&&S(e,o)},updated:function(e,o,r){!b(o.value)&&f.has(e)||b(o.value)&&!f.has(e)||(!f.has(e)&&k(e,r.props),V(e),S(e,o))}},E=t.defineComponent(w),g=new WeakMap,P={open(e={}){var d,s,u;const o=e.target||document.body;if(g.has(o))return g.get(o);o.style&&(o.style.position=e.positionType);const r=document.body===o;e=p(p({},new y),e);const n=T(E,C(p({},e),{isFull:r}),e.loadingTemplateRef?()=>e.loadingTemplateRef:null);g.set(o,n),(d=n==null?void 0:n.proxy)==null||d.open(),o.appendChild((s=n==null?void 0:n.proxy)==null?void 0:s.$el);const i=(u=n==null?void 0:n.proxy)==null?void 0:u.close;return n&&(n.loadingInstance=n==null?void 0:n.proxy,n.loadingInstance&&(n.loadingInstance.close=(...R)=>{g.delete(o),i==null||i(...R)})),n}};var M={title:"Loading \u52A0\u8F7D\u63D0\u793A",category:"\u53CD\u9988",status:"100%",install(e){e.directive("dLoading",L),e.config.globalProperties.$loadingService=P}};a.Loading=L,a.LoadingOptions=y,a.LoadingService=P,a.default=M,a.loadingProps=v,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
1
+ var B=Object.defineProperty,D=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var v=(s,t,c)=>t in s?B(s,t,{enumerable:!0,configurable:!0,writable:!0,value:c}):s[t]=c,p=(s,t)=>{for(var c in t||(t={}))I.call(t,c)&&v(s,c,t[c]);if(C)for(var c of C(t))W.call(t,c)&&v(s,c,t[c]);return s},_=(s,t)=>D(s,F(t));var u=(s,t,c)=>(v(s,typeof t!="symbol"?t+"":t,c),c);(function(s,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(s=typeof globalThis!="undefined"?globalThis:s||self,t(s.index={},s.Vue))})(this,function(s,t){"use strict";const c=Symbol("dev_component_container");function w(e,o,r=null){const n=t.h(e,p({},o),r),a=document.createElement("div");return n[c]=a,t.render(n,a),n.component}function $(e){t.render(null,e==null?void 0:e.vnode[c])}class N{constructor(){u(this,"top","50%");u(this,"left","50%")}}const T={message:String,backdrop:Boolean,view:{type:Object,default:()=>new N},zIndex:Number,isFull:{type:Boolean,default:!1}};class b{constructor(){u(this,"target");u(this,"message");u(this,"loadingTemplateRef");u(this,"backdrop",!0);u(this,"positionType","relative");u(this,"view",new N);u(this,"zIndex")}}function m(e,o,r){let n=e;return o&&(n+=`__${o}`),r&&(n+=`--${r}`),n}function j(e,o=!1){const r=o?`.devui-${e}`:`devui-${e}`;return{b:()=>m(r),e:l=>l?m(r,l):"",m:l=>l?m(r,"",l):"",em:(l,y)=>l&&y?m(r,l,y):""}}var q="",A=t.defineComponent({name:"Loading",inheritAttrs:!1,props:T,setup(e){const o={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(o.background="none");const r=t.ref(!1);return{style:o,isShow:r,open:()=>{r.value=!0},close:()=>{r.value=!1}}},render(){var l;const{isShow:e,isFull:o,backdrop:r,style:n,message:a,$slots:d}=this,i=j("loading");return e&&t.createVNode("div",{class:[i.b(),o?i.m("full"):""]},[((l=d.default)==null?void 0:l.call(d))||t.createVNode("div",{class:i.e("wrapper")},[r?t.createVNode("div",{class:i.e("mask")},null):null,t.createVNode("div",{style:n,class:i.e("area")},[t.createVNode("div",{class:i.e("busy-default-spinner")},[t.createVNode("div",{class:i.e("bar1")},null),t.createVNode("div",{class:i.e("bar2")},null),t.createVNode("div",{class:i.e("bar3")},null),t.createVNode("div",{class:i.e("bar4")},null)]),a?t.createVNode("span",{class:i.e("text")},[a]):null])])])}});const z=t.defineComponent(A),g=new WeakMap,x={open(e={}){var d,i,l;const o=e.target||document.body;if(g.has(o))return g.get(o);o.style&&(o.style.position=e.positionType);const r=document.body===o;e=p(p({},new b),e);const n=w(z,_(p({},e),{isFull:r}),e.loadingTemplateRef?()=>e.loadingTemplateRef:null);g.set(o,n),(d=n==null?void 0:n.proxy)==null||d.open(),o.appendChild((i=n==null?void 0:n.proxy)==null?void 0:i.$el);const a=(l=n==null?void 0:n.proxy)==null?void 0:l.close;return n&&(n.loadingInstance=n==null?void 0:n.proxy,n.loadingInstance&&(n.loadingInstance.close=(...y)=>{g.delete(o),a==null||a(...y)})),n}},E=t.defineComponent(A),f=new WeakSet,h=e=>{if(!e)return!0;if(Array.isArray(e))return e.length===0;if(e instanceof Set||e instanceof Map)return e.size===0;if(e instanceof Promise)return!1;if(typeof e=="object")try{return Object.keys(e).length===0}catch{return!1}return!1},S=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),M=e=>{switch(S(e)){case"promise":return[e];case"array":return e.some(r=>S(r)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},V=e=>{f.delete(e),e.instance.proxy.close(),$(e.instance)},L=(e,o)=>{var r,n,a;if(o.value){const d=M(o.value);if(d==="error")return;(a=(n=(r=e==null?void 0:e.instance)==null?void 0:r.proxy)==null?void 0:n.open)==null||a.call(n),e.appendChild(e.mask),f.add(e),d&&Promise.all(d).catch(i=>{console.error(new Error("Promise handling errors"),i)}).finally(()=>{V(e)})}else V(e)},P=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},k=(e,o)=>{var d;const r=p(p({},new b),o),n=r.loadingTemplateRef,a=w(E,p({},r),n?()=>n:null);e.style.position=r.positionType||"relative",e.options=r,e.instance=a,e.mask=(d=a==null?void 0:a.proxy)==null?void 0:d.$el},O={mounted:function(e,o,r){k(e,r.props),P(e),!h(o.value)&&L(e,o)},updated:function(e,o,r){!h(o.value)&&f.has(e)||h(o.value)&&!f.has(e)||(!f.has(e)&&k(e,r.props),P(e),L(e,o))}};var R={title:"Loading \u52A0\u8F7D\u63D0\u793A",category:"\u53CD\u9988",status:"100%",install(e){e.directive("loading",O),e.config.globalProperties.$loadingService=x}};s.LoadingDirective=O,s.LoadingOptions=b,s.LoadingService=x,s.default=R,s.loadingProps=T,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
package/loading/style.css CHANGED
@@ -1 +1 @@
1
- @keyframes devui-busy-spinner-anim{0%{transform:rotate(0) scale(1)}50%{transform:rotate(180deg) scale(1.5)}to{transform:rotate(360deg) scale(1)}}.devui-loading__mask{position:absolute;left:0;right:0;bottom:0;top:0;background-color:var(--devui-line, #adb0b8);opacity:.3}.devui-loading__wrapper{text-align:center}.devui-loading--full{position:fixed;left:0;right:0;bottom:0;top:0;z-index:9999}.devui-loading--hidden{overflow:hidden}.devui-loading__text{margin-left:10px}.devui-loading__area{position:absolute;transform:translate(-50%,-50%);padding:12px 14px;background:var(--devui-base-bg, #ffffff);border-radius:var(--devui-border-radius-card, 6px)}.devui-loading__busy-default-spinner{position:relative;display:inline-block;width:15px;height:15px;animation:devui-busy-spinner-anim 1s linear infinite}.devui-loading__busy-default-spinner div{position:absolute;left:44.5%;top:37%;width:6px;height:6px;border-radius:50%}.devui-loading__busy-default-spinner .devui-loading__bar1{top:0;left:0;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}.devui-loading__busy-default-spinner .devui-loading__bar2{top:0;left:9px;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-loading__busy-default-spinner .devui-loading__bar3{top:9px;left:0;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-loading__busy-default-spinner .devui-loading__bar4{top:9px;left:9px;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}
1
+ @keyframes devui-busy-spinner-anim{0%{transform:rotate(0) scale(1)}50%{transform:rotate(180deg) scale(1.5)}to{transform:rotate(360deg) scale(1)}}.devui-loading__mask{z-index:var(--devui-z-index-full-page-overlay, 1080);position:absolute;left:0;right:0;bottom:0;top:0;background-color:var(--devui-line, #d7d8da);opacity:.3}.devui-loading__wrapper{text-align:center}.devui-loading--full{position:fixed;left:0;right:0;bottom:0;top:0;z-index:var(--devui-z-index-full-page-overlay, 1080)}.devui-loading--hidden{overflow:hidden}.devui-loading__text{margin-left:10px}.devui-loading__area{position:absolute;transform:translate(-50%,-50%);padding:12px 14px;background:var(--devui-base-bg, #ffffff);border-radius:var(--devui-border-radius-card, 6px)}.devui-loading__busy-default-spinner{position:relative;display:inline-block;width:15px;height:15px;animation:devui-busy-spinner-anim 1s linear infinite}.devui-loading__busy-default-spinner div{position:absolute;left:44.5%;top:37%;width:6px;height:6px;border-radius:50%}.devui-loading__busy-default-spinner .devui-loading__bar1{top:0;left:0;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}.devui-loading__busy-default-spinner .devui-loading__bar2{top:0;left:9px;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-loading__busy-default-spinner .devui-loading__bar3{top:9px;left:0;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-loading__busy-default-spinner .devui-loading__bar4{top:9px;left:9px;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}
@@ -0,0 +1,7 @@
1
+ import { App } from 'vue';
2
+ declare function install(app: App): void
3
+ declare const _default: {
4
+ install: typeof install;
5
+ version: string;
6
+ };
7
+ export default _default;