vue-devui 1.0.0-rc.13 → 1.0.0-rc.16
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.
- package/README.md +161 -156
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +241 -82
- package/auto-complete/index.umd.js +28 -17
- package/auto-complete/style.css +1 -1
- package/avatar/index.umd.js +1 -1
- package/badge/index.umd.js +1 -1
- package/button/index.es.js +21 -42
- package/button/index.umd.js +9 -9
- package/card/index.umd.js +1 -1
- package/checkbox/index.es.js +94 -77
- package/checkbox/index.umd.js +26 -15
- package/collapse/index.es.js +3 -21
- package/collapse/index.umd.js +1 -1
- package/countdown/index.umd.js +1 -1
- package/date-picker-pro/index.es.js +1384 -220
- package/date-picker-pro/index.umd.js +25 -14
- package/date-picker-pro/style.css +1 -1
- package/drawer/index.es.js +4 -17
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.es.js +4 -22
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.es.js +254 -99
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +85 -71
- package/form/index.umd.js +22 -11
- package/fullscreen/index.umd.js +1 -1
- package/grid/index.es.js +7 -20
- package/grid/index.umd.js +1 -1
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +12 -23
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +239 -75
- package/input/index.umd.js +27 -16
- package/input-number/index.es.js +1 -16
- package/input-number/index.umd.js +1 -1
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +15 -38
- package/loading/index.umd.js +1 -1
- package/message/index.d.ts +7 -0
- package/message/index.es.js +534 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.es.js +11 -43
- package/modal/index.umd.js +1 -1
- package/notification/index.es.js +16 -22
- package/notification/index.umd.js +1 -1
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/overlay/index.es.js +1 -1
- package/overlay/index.umd.js +1 -1
- package/package.json +4 -2
- package/pagination/index.es.js +152 -2
- package/pagination/index.umd.js +1 -1
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +1 -1
- package/popover/index.umd.js +4 -4
- package/progress/index.umd.js +3 -3
- package/radio/index.es.js +91 -75
- package/radio/index.umd.js +28 -17
- package/radio/style.css +1 -1
- package/rate/index.umd.js +1 -1
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +5 -18
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +255 -78
- package/search/index.umd.js +27 -16
- package/search/style.css +1 -1
- package/select/index.es.js +283 -114
- package/select/index.umd.js +27 -16
- package/select/style.css +1 -1
- package/skeleton/index.es.js +87 -261
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +175 -32
- package/splitter/index.umd.js +13 -13
- package/statistic/index.es.js +0 -21
- package/statistic/index.umd.js +1 -1
- package/status/index.umd.js +1 -1
- package/steps/index.umd.js +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +85 -71
- package/switch/index.umd.js +25 -14
- package/table/index.es.js +309 -96
- package/table/index.umd.js +25 -14
- package/table/style.css +1 -1
- package/tabs/index.umd.js +1 -1
- package/tag/index.umd.js +1 -1
- package/textarea/index.es.js +88 -72
- package/textarea/index.umd.js +26 -15
- package/time-picker/index.es.js +248 -89
- package/time-picker/index.umd.js +25 -14
- package/time-select/index.es.js +283 -114
- package/time-select/index.umd.js +26 -15
- package/time-select/style.css +1 -1
- package/timeline/index.umd.js +1 -1
- package/tooltip/index.es.js +1 -1
- package/tooltip/index.umd.js +4 -4
- package/tree/index.es.js +422 -110
- package/tree/index.umd.js +25 -14
- package/tree/style.css +1 -1
- package/upload/index.es.js +168 -49
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +13601 -13023
- package/vue-devui.umd.js +32 -21
- package/LICENSE +0 -23
package/input-number/index.es.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var __objRest = (source, exclude) => {
|
|
5
|
-
var target = {};
|
|
6
|
-
for (var prop in source)
|
|
7
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8
|
-
target[prop] = source[prop];
|
|
9
|
-
if (source != null && __getOwnPropSymbols)
|
|
10
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
11
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
12
|
-
target[prop] = source[prop];
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
1
|
import { createVNode, computed, ref, toRefs, reactive, watch, defineComponent, mergeProps } from "vue";
|
|
17
2
|
const inputNumberProps = {
|
|
18
3
|
placeholder: {
|
|
@@ -110,7 +95,7 @@ const isUndefined = (value) => value === void 0;
|
|
|
110
95
|
const isNull = (value) => value === null;
|
|
111
96
|
const ns = useNamespace("input-number");
|
|
112
97
|
function useRender(props, ctx) {
|
|
113
|
-
const
|
|
98
|
+
const { style, class: customClass, ...otherAttrs } = ctx.attrs;
|
|
114
99
|
const customStyle = { style };
|
|
115
100
|
const wrapClass = computed(() => [
|
|
116
101
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(d,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(d=typeof globalThis!="undefined"?globalThis:d||self,t(d.index={},d.Vue))})(this,function(d,t){"use strict";const L={placeholder:{type:String},disabled:{type:Boolean,default:!1},step:{type:Number,default:1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},size:{type:String,default:""},modelValue:{type:Number},precision:{type:Number}};function v(e,o,r){let s=e;return o&&(s+=`__${o}`),r&&(s+=`--${r}`),s}function B(e,o=!1){const r=o?`.devui-${e}`:`devui-${e}`;return{b:()=>v(r),e:n=>n?v(r,n):"",m:n=>n?v(r,"",n):"",em:(n,i)=>n&&i?v(r,n,i):""}}const P=B("input-number");function k(){return t.createVNode("svg",{class:P.e("icon-arrow"),width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("path",{d:"M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z","fill-rule":"nonzero"},null)])])}function z(){return t.createVNode("svg",{class:P.e("icon-arrow"),width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("path",{d:"M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z","fill-rule":"nonzero"},null)])])}const N=e=>typeof e=="number",h=e=>e===void 0,F=e=>e===null,f=B("input-number");function M(e,o){const{style:r,class:s,...c}=o.attrs,m={style:r},p=t.computed(()=>[{[f.b()]:!0},s]),n=t.computed(()=>({[f.e("control-buttons")]:!0,disabled:e.disabled,[f.m(e.size)]:!0})),i=t.computed(()=>({[f.e("input-wrap")]:!0,[f.m(e.size)]:!0})),V=t.computed(()=>({[f.e("input-box")]:!0,disabled:e.disabled}));return{wrapClass:p,customStyle:m,otherAttrs:c,controlButtonsClass:n,inputWrapClass:i,inputInnerClass:V}}function $(e){const o=t.ref(),r=()=>{o.value.focus()},s=()=>{o.value.blur()},c=()=>{o.value.select()};return e.expose({focus:r,blur:s,select:c}),{inputRef:o}}function D(e){let o=0;if(h(e))return o;const r=e.toString(),s=r.indexOf(".");return s!==-1&&(o=r.length-s-1),o}function A(e,o,r){const{min:s,max:c,step:m,disabled:p}=t.toRefs(e),n=t.reactive({currentValue:e.modelValue||"",userInputValue:void 0}),i=t.computed(()=>h(e.precision)?Math.max(D(e.modelValue),D(m.value)):e.precision),V=t.computed(()=>{if(!h(n.userInputValue))return n.userInputValue;let u=n.currentValue;return u===""||h(u)||Number.isNaN(u)?"":(N(u)&&(u=u.toFixed(i.value)),u)}),C=u=>Number.parseFloat(u.toFixed(i.value)),b=(u,a=1)=>N(u)?C(u+m.value*a):n.currentValue,w=(u,a)=>{if(u===""||h(u)||F(u)||Number.isNaN(u))return;let l=Number(u);return l=C(l),(l>c.value||l<s.value)&&(l=l>c.value?c.value:s.value,a&&o.emit("update:modelValue",l)),l},g=u=>{const a=n.currentValue,l=w(u);a!==l&&(n.userInputValue=void 0,o.emit("update:modelValue",l),o.emit("input",l),o.emit("change",l,a),n.currentValue=l)},I=t.computed(()=>N(n.currentValue)&&b(n.currentValue,-1)<e.min),y=t.computed(()=>N(n.currentValue)&&b(n.currentValue)>e.max),S=()=>{if(p.value||y.value)return;r.value.focus();const u=b(n.currentValue||0);g(u)},_=()=>{if(p.value||I.value)return;r.value.focus();const u=b(n.currentValue||0,-1);g(u)};return t.watch(()=>e.modelValue,u=>{n.currentValue=w(u,!0),n.userInputValue=void 0},{immediate:!0}),{inputVal:V,minDisabled:I,maxDisabled:y,onAdd:S,onSubtract:_,onInput:u=>{const a=u.target.value;n.userInputValue=a},onChange:u=>{const a=u.target.value,l=a!==""?Number(a):"";(N(l)&&!Number.isNaN(l)||a==="")&&g(l),n.userInputValue=void 0}}}var E="",x=t.defineComponent({name:"DInputNumber",props:L,emits:["update:modelValue","change","input"],setup(e,o){const{disabled:r}=t.toRefs(e),{wrapClass:s,customStyle:c,otherAttrs:m,controlButtonsClass:p,inputWrapClass:n,inputInnerClass:i}=M(e,o),{inputRef:V}=$(o),{inputVal:C,minDisabled:b,maxDisabled:w,onAdd:g,onSubtract:I,onInput:y,onChange:S}=A(e,o,V);return()=>t.createVNode("div",t.mergeProps({class:s.value},c),[t.createVNode("div",{class:p.value},[t.createVNode("span",{class:["control-button control-inc",{disabled:w.value}],onClick:g},[t.createVNode(k,null,null)]),t.createVNode("span",{class:["control-button control-dec",{disabled:b.value}],onClick:I},[t.createVNode(z,null,null)])]),t.createVNode("div",{class:n.value},[t.createVNode("input",t.mergeProps({type:"number",ref:V,value:C.value,placeholder:e.placeholder,disabled:r.value,class:i.value},m,{onInput:y,onChange:S}),null)])])}}),R={title:"InputNumber \u6570\u5B57\u8F93\u5165\u6846",category:"\u6570\u636E\u5F55\u5165",status:"50%",install(e){e.component(x.name,x)}};d.InputNumber=x,d.default=R,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/layout/index.es.js
CHANGED
package/layout/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(r,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(r=typeof globalThis!="undefined"?globalThis:r||self,o(r.index={},r.Vue))})(this,function(r,o){"use strict";function i(a,e,t){let n=a;return e&&(n+=`__${e}`),t&&(n+=`--${t}`),n}function u(a,e=!1){const t=e?`.devui-${a}`:`devui-${a}`;return{b:()=>i(t),e:d=>d?i(t,d):"",m:d=>d?i(t,"",d):"",em:(d,C)=>d&&C?i(t,d,C):""}}var N="",c=o.defineComponent({name:"DLayout",emits:[],setup(a,{slots:e}){const t=u("layout");return()=>{var y;const n=(y=e.default)==null?void 0:y.call(e),v=`${n.some(d=>d.type.name==="DAside")?t.e("aside"):""} ${t.b()}`;return o.createVNode("div",{class:v},[n])}}}),A="",m=o.defineComponent({name:"DContent",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.e("content")},[(n=e.default)==null?void 0:n.call(e)])}}}),V="",f=o.defineComponent({name:"DHeader",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.e("header")},[(n=e.default)==null?void 0:n.call(e)])}}}),$="",s=o.defineComponent({name:"DFooter",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.e("footer")},[(n=e.default)==null?void 0:n.call(e)])}}}),p=o.defineComponent({name:"DAside",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.em("aside","inner")},[(n=e.default)==null?void 0:n.call(e)])}}}),l={title:"Layout \u5E03\u5C40",category:"\u5E03\u5C40",status:"100%",install(a){a.component(c.name,c),a.component(m.name,m),a.component(f.name,f),a.component(s.name,s),a.component(p.name,p)}};r.Aside=p,r.Content=m,r.Footer=s,r.Header=f,r.Layout=c,r.default=l,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/loading/index.es.js
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
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
|
-
var __publicField = (obj, key, value) => {
|
|
21
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
-
return value;
|
|
23
|
-
};
|
|
24
1
|
import { defineComponent, ref, createVNode, h, render } from "vue";
|
|
25
2
|
class View {
|
|
26
3
|
constructor() {
|
|
27
|
-
|
|
28
|
-
|
|
4
|
+
this.top = "50%";
|
|
5
|
+
this.left = "50%";
|
|
29
6
|
}
|
|
30
7
|
}
|
|
31
8
|
const loadingProps = {
|
|
@@ -43,13 +20,9 @@ const loadingProps = {
|
|
|
43
20
|
};
|
|
44
21
|
class LoadingOptions {
|
|
45
22
|
constructor() {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
__publicField(this, "backdrop", true);
|
|
50
|
-
__publicField(this, "positionType", "relative");
|
|
51
|
-
__publicField(this, "view", new View());
|
|
52
|
-
__publicField(this, "zIndex");
|
|
23
|
+
this.backdrop = true;
|
|
24
|
+
this.positionType = "relative";
|
|
25
|
+
this.view = new View();
|
|
53
26
|
}
|
|
54
27
|
}
|
|
55
28
|
function createBem(namespace, element, modifier) {
|
|
@@ -140,7 +113,7 @@ var Loading = defineComponent({
|
|
|
140
113
|
});
|
|
141
114
|
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
142
115
|
function createComponent(component, props, children = null) {
|
|
143
|
-
const vnode = h(component,
|
|
116
|
+
const vnode = h(component, { ...props }, children);
|
|
144
117
|
const container = document.createElement("div");
|
|
145
118
|
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
146
119
|
render(vnode, container);
|
|
@@ -227,9 +200,12 @@ const removeAttribute = (el) => {
|
|
|
227
200
|
};
|
|
228
201
|
const handleProps = (el, vprops) => {
|
|
229
202
|
var _a;
|
|
230
|
-
const props =
|
|
203
|
+
const props = {
|
|
204
|
+
...new LoadingOptions(),
|
|
205
|
+
...vprops
|
|
206
|
+
};
|
|
231
207
|
const loadingTemplateRef = props.loadingTemplateRef;
|
|
232
|
-
const loadingInstance = createComponent(loadingConstructor$1,
|
|
208
|
+
const loadingInstance = createComponent(loadingConstructor$1, { ...props }, loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
233
209
|
el.style.position = props.positionType;
|
|
234
210
|
el.options = props;
|
|
235
211
|
el.instance = loadingInstance;
|
|
@@ -263,10 +239,11 @@ const loading = {
|
|
|
263
239
|
parent.style.position = options.positionType;
|
|
264
240
|
}
|
|
265
241
|
const isFull = document.body === parent;
|
|
266
|
-
options =
|
|
267
|
-
const instance = createComponent(loadingConstructor,
|
|
242
|
+
options = { ...new LoadingOptions(), ...options };
|
|
243
|
+
const instance = createComponent(loadingConstructor, {
|
|
244
|
+
...options,
|
|
268
245
|
isFull
|
|
269
|
-
}
|
|
246
|
+
}, options.loadingTemplateRef ? () => options.loadingTemplateRef : null);
|
|
270
247
|
cacheTarget.set(parent, instance);
|
|
271
248
|
(_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.open();
|
|
272
249
|
parent.appendChild((_b = instance == null ? void 0 : instance.proxy) == null ? void 0 : _b.$el);
|
package/loading/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(d,r){typeof exports=="object"&&typeof module!="undefined"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(d=typeof globalThis!="undefined"?globalThis:d||self,r(d.index={},d.Vue))})(this,function(d,r){"use strict";class y{constructor(){this.top="50%",this.left="50%"}}const h={message:String,backdrop:Boolean,view:{type:Object,default:()=>new y},zIndex:Number,isFull:{type:Boolean,default:!1}};class m{constructor(){this.backdrop=!0,this.positionType="relative",this.view=new y}}function u(e,o,n){let t=e;return o&&(t+=`__${o}`),n&&(t+=`--${n}`),t}function P(e,o=!1){const n=o?`.devui-${e}`:`devui-${e}`;return{b:()=>u(n),e:c=>c?u(n,c):"",m:c=>c?u(n,"",c):"",em:(c,f)=>c&&f?u(n,c,f):""}}var j="",b=r.defineComponent({name:"DLoading",inheritAttrs:!1,props:h,setup(e){const o={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(o.background="none");const n=r.ref(!1);return{style:o,isShow:n,open:()=>{n.value=!0},close:()=>{n.value=!1}}},render(){var c;const{isShow:e,isFull:o,backdrop:n,style:t,message:s,$slots:a}=this,i=P("loading");return e&&r.createVNode("div",{class:[i.b(),o?i.m("full"):""]},[((c=a.default)==null?void 0:c.call(a))||r.createVNode("div",{class:i.e("wrapper")},[n?r.createVNode("div",{class:i.e("mask")},null):null,r.createVNode("div",{style:t,class:i.e("area")},[r.createVNode("div",{class:i.e("busy-default-spinner")},[r.createVNode("div",{class:i.e("bar1")},null),r.createVNode("div",{class:i.e("bar2")},null),r.createVNode("div",{class:i.e("bar3")},null),r.createVNode("div",{class:i.e("bar4")},null)]),s?r.createVNode("span",{class:i.e("text")},[s]):null])])])}});const v=Symbol("dev_component_container");function w(e,o,n=null){const t=r.h(e,{...o},n),s=document.createElement("div");return t[v]=s,r.render(t,s),t.component}function k(e){r.render(null,e==null?void 0:e.vnode[v])}const O=r.defineComponent(b),l=new WeakSet,g=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},N=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),C=e=>{switch(N(e)){case"promise":return[e];case"array":return e.some(n=>N(n)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},T=e=>{l.delete(e),e.instance.proxy.close(),k(e.instance)},A=(e,o)=>{var n,t,s;if(o.value){const a=C(o.value);if(a==="error")return;(s=(t=(n=e==null?void 0:e.instance)==null?void 0:n.proxy)==null?void 0:t.open)==null||s.call(t),e.appendChild(e.mask),l.add(e),a&&Promise.all(a).catch(i=>{console.error(new Error("Promise handling errors"),i)}).finally(()=>{T(e)})}else T(e)},x=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},S=(e,o)=>{var a;const n={...new m,...o},t=n.loadingTemplateRef,s=w(O,{...n},t?()=>t:null);e.style.position=n.positionType,e.options=n,e.instance=s,e.mask=(a=s==null?void 0:s.proxy)==null?void 0:a.$el},V={mounted:function(e,o,n){S(e,n.props),x(e),!g(o.value)&&A(e,o)},updated:function(e,o,n){!g(o.value)&&l.has(e)||g(o.value)&&!l.has(e)||(!l.has(e)&&S(e,n.props),x(e),A(e,o))}},_=r.defineComponent(b),p=new WeakMap,L={open(e={}){var a,i,c;const o=e.target||document.body;if(p.has(o))return p.get(o);o.style&&(o.style.position=e.positionType);const n=document.body===o;e={...new m,...e};const t=w(_,{...e,isFull:n},e.loadingTemplateRef?()=>e.loadingTemplateRef:null);p.set(o,t),(a=t==null?void 0:t.proxy)==null||a.open(),o.appendChild((i=t==null?void 0:t.proxy)==null?void 0:i.$el);const s=(c=t==null?void 0:t.proxy)==null?void 0:c.close;return t&&(t.loadingInstance=t==null?void 0:t.proxy,t.loadingInstance&&(t.loadingInstance.close=(...f)=>{p.delete(o),s==null||s(...f)})),t}};var $={title:"Loading \u52A0\u8F7D\u63D0\u793A",category:"\u53CD\u9988",status:"100%",install(e){e.directive("dLoading",V),e.config.globalProperties.$loadingService=L}};d.Loading=V,d.LoadingOptions=m,d.LoadingService=L,d.default=$,d.loadingProps=h,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|