vue-devui 1.0.0-rc.2 → 1.0.0-rc.3
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 +129 -126
- package/auto-complete/index.es.js +98 -43
- package/auto-complete/index.umd.js +5 -3
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +77 -81
- package/avatar/index.umd.js +1 -1
- package/button/index.es.js +4 -3
- package/button/index.umd.js +1 -1
- package/card/index.es.js +3 -6
- package/card/index.umd.js +1 -1
- package/checkbox/index.es.js +5 -11
- package/checkbox/index.umd.js +1 -1
- package/comment/index.es.js +2 -5
- package/comment/index.umd.js +1 -1
- package/countdown/index.es.js +3 -6
- package/countdown/index.umd.js +1 -1
- package/editable-select/index.es.js +2 -5
- package/editable-select/index.umd.js +1 -1
- package/grid/index.es.js +30 -36
- package/grid/index.umd.js +1 -1
- package/image-preview/index.es.js +19 -19
- package/image-preview/index.umd.js +1 -1
- package/input/index.es.js +2 -5
- package/input/index.umd.js +1 -1
- package/layout/index.es.js +6 -21
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +20 -12
- package/loading/index.umd.js +1 -1
- package/modal/index.es.js +54 -46
- package/modal/index.umd.js +1 -1
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/commentProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/readTipProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tagInputProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/overlay/index.es.js +5 -5
- package/overlay/index.umd.js +1 -1
- package/package.json +1 -1
- package/pagination/index.es.js +14 -13
- package/pagination/index.umd.js +1 -1
- package/popover/index.es.js +5 -5
- package/popover/index.umd.js +12 -12
- package/progress/index.es.js +33 -35
- package/progress/index.umd.js +3 -3
- package/rate/index.es.js +4 -7
- package/rate/index.umd.js +1 -1
- package/read-tip/index.es.js +2 -5
- package/read-tip/index.umd.js +1 -1
- package/result/index.es.js +2 -5
- package/result/index.umd.js +1 -1
- package/search/index.es.js +11 -11
- package/search/index.umd.js +8 -8
- package/skeleton/index.es.js +3 -6
- package/skeleton/index.umd.js +1 -1
- package/splitter/index.es.js +8 -11
- package/splitter/index.umd.js +15 -15
- package/statistic/index.es.js +7 -18
- package/statistic/index.umd.js +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +3 -6
- package/switch/index.umd.js +1 -1
- package/tag-input/index.es.js +3 -6
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.es.js +2 -5
- package/textarea/index.umd.js +1 -1
- package/timeline/index.es.js +8 -14
- package/timeline/index.umd.js +1 -1
- package/upload/index.es.js +60 -57
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +11986 -24782
- package/vue-devui.umd.js +24 -22
package/loading/index.es.js
CHANGED
|
@@ -115,8 +115,8 @@ var Loading = defineComponent({
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
118
|
-
function createComponent(
|
|
119
|
-
const vnode = h(
|
|
118
|
+
function createComponent(component, props, children = null) {
|
|
119
|
+
const vnode = h(component, __spreadValues({}, props), children);
|
|
120
120
|
const container = document.createElement("div");
|
|
121
121
|
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
122
122
|
render(vnode, container);
|
|
@@ -196,13 +196,14 @@ const removeAttribute = (el) => {
|
|
|
196
196
|
el.removeAttribute("loadingtemplateref");
|
|
197
197
|
};
|
|
198
198
|
const handleProps = (el, vprops) => {
|
|
199
|
+
var _a;
|
|
199
200
|
const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
|
|
200
201
|
const loadingTemplateRef = props.loadingTemplateRef;
|
|
201
202
|
const loadingInstance = createComponent(loadingConstructor$1, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
202
203
|
el.style.position = props.positionType;
|
|
203
204
|
el.options = props;
|
|
204
205
|
el.instance = loadingInstance;
|
|
205
|
-
el.mask = loadingInstance.proxy.$el;
|
|
206
|
+
el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
|
|
206
207
|
};
|
|
207
208
|
const loadingDirective = {
|
|
208
209
|
mounted: function(el, binding, vnode) {
|
|
@@ -222,25 +223,32 @@ const loadingConstructor = defineComponent(Loading);
|
|
|
222
223
|
const cacheTarget = /* @__PURE__ */ new WeakMap();
|
|
223
224
|
const loading = {
|
|
224
225
|
open(options = {}) {
|
|
226
|
+
var _a, _b, _c;
|
|
225
227
|
const parent = options.target || document.body;
|
|
226
228
|
if (cacheTarget.has(parent)) {
|
|
227
229
|
return cacheTarget.get(parent);
|
|
228
230
|
}
|
|
229
|
-
parent.style
|
|
231
|
+
if (parent.style) {
|
|
232
|
+
parent.style.position = options.positionType;
|
|
233
|
+
}
|
|
230
234
|
const isFull = document.body === parent;
|
|
231
235
|
options = __spreadValues(__spreadValues({}, new LoadingProps()), options);
|
|
232
236
|
const instance = createComponent(loadingConstructor, __spreadProps(__spreadValues({}, options), {
|
|
233
237
|
isFull
|
|
234
238
|
}), options.loadingTemplateRef ? () => options.loadingTemplateRef : null);
|
|
235
239
|
cacheTarget.set(parent, instance);
|
|
236
|
-
instance.proxy.open();
|
|
237
|
-
parent.appendChild(instance.proxy.$el);
|
|
238
|
-
const close = instance.proxy.close;
|
|
239
|
-
instance
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
240
|
+
(_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.open();
|
|
241
|
+
parent.appendChild((_b = instance == null ? void 0 : instance.proxy) == null ? void 0 : _b.$el);
|
|
242
|
+
const close = (_c = instance == null ? void 0 : instance.proxy) == null ? void 0 : _c.close;
|
|
243
|
+
if (instance) {
|
|
244
|
+
instance.loadingInstance = instance == null ? void 0 : instance.proxy;
|
|
245
|
+
if (instance.loadingInstance) {
|
|
246
|
+
instance.loadingInstance.close = (...args) => {
|
|
247
|
+
cacheTarget.delete(parent);
|
|
248
|
+
close == null ? void 0 : close(...args);
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
244
252
|
return instance;
|
|
245
253
|
}
|
|
246
254
|
};
|
package/loading/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _=Object.defineProperty,D=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var m=(i,t,s)=>t in i?_(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s,c=(i,t)=>{for(var s in t||(t={}))F.call(t,s)&&m(i,s,t[s]);if(P)for(var s of P(t))I.call(t,s)&&m(i,s,t[s]);return i},L=(i,t)=>D(i,B(t));var d=(i,t,s)=>(m(i,typeof t!="symbol"?t+"":t,s),s);(function(i,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis!="undefined"?globalThis:i||self,t(i.index={},i.Vue))})(this,function(i,t){"use strict";class s{constructor(){d(this,"top","50%");d(this,"left","50%")}}const C={message:String,backdrop:Boolean,view:{type:Object,default:()=>new s},zIndex:Number,isFull:{type:Boolean,default:!1}};class y{constructor(){d(this,"target");d(this,"message");d(this,"loadingTemplateRef");d(this,"backdrop",!0);d(this,"positionType","relative");d(this,"view",new s);d(this,"zIndex")}}var $="",v=t.defineComponent({name:"DLoading",inheritAttrs:!1,props:C,setup(e){const n={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(n.background="none");const r=t.ref(!1);return{style:n,isShow:r,open:()=>{r.value=!0},close:()=>{r.value=!1}}},render(){var p;const{isShow:e,isFull:n,backdrop:r,style:o,message:a,$slots:l}=this;return e&&t.createVNode("div",{class:["devui-loading-contanier",n?"devui-loading--full":""]},[((p=l.default)==null?void 0:p.call(l))||t.createVNode("div",{class:"devui-loading-wrapper"},[r?t.createVNode("div",{class:"devui-loading-mask"},null):null,t.createVNode("div",{style:o,class:"devui-loading-area"},[t.createVNode("div",{class:"devui-busy-default-spinner"},[t.createVNode("div",{class:"devui-loading-bar1"},null),t.createVNode("div",{class:"devui-loading-bar2"},null),t.createVNode("div",{class:"devui-loading-bar3"},null),t.createVNode("div",{class:"devui-loading-bar4"},null)]),a?t.createVNode("span",{class:"devui-loading-text"},[a]):null])])])}});const b=Symbol("dev_component_container");function h(e,n,r=null){const o=t.h(e,c({},n),r),a=document.createElement("div");return o[b]=a,t.render(o,a),o.component}function O(e){t.render(null,e==null?void 0:e.vnode[b])}const j=t.defineComponent(v),u=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},w=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),z=e=>{switch(w(e)){case"promise":return[e];case"array":return e.some(r=>w(r)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},T=e=>{u.delete(e),e.instance.proxy.close(),O(e.instance)},N=(e,n)=>{if(n.value){const r=z(n.value);if(r==="error")return;e.instance.proxy.open(),e.appendChild(e.mask),u.add(e),r&&Promise.all(r).catch(o=>{console.error(new Error("Promise handling errors"),o)}).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")},A=(e,n)=>{var l;const r=c(c({},new y),n),o=r.loadingTemplateRef,a=h(j,c({},r),o?()=>o:null);e.style.position=r.positionType,e.options=r,e.instance=a,e.mask=(l=a==null?void 0:a.proxy)==null?void 0:l.$el},S={mounted:function(e,n,r){A(e,r.props),x(e),!g(n.value)&&N(e,n)},updated:function(e,n,r){!g(n.value)&&u.has(e)||g(n.value)&&!u.has(e)||(!u.has(e)&&A(e,r.props),x(e),N(e,n))}},E=t.defineComponent(v),f=new WeakMap,V={open(e={}){var l,p,k;const n=e.target||document.body;if(f.has(n))return f.get(n);n.style&&(n.style.position=e.positionType);const r=document.body===n;e=c(c({},new y),e);const o=h(E,L(c({},e),{isFull:r}),e.loadingTemplateRef?()=>e.loadingTemplateRef:null);f.set(n,o),(l=o==null?void 0:o.proxy)==null||l.open(),n.appendChild((p=o==null?void 0:o.proxy)==null?void 0:p.$el);const a=(k=o==null?void 0:o.proxy)==null?void 0:k.close;return o&&(o.loadingInstance=o==null?void 0:o.proxy,o.loadingInstance&&(o.loadingInstance.close=(...R)=>{f.delete(n),a==null||a(...R)})),o}};var M={title:"Loading \u52A0\u8F7D\u63D0\u793A",category:"\u53CD\u9988",status:"100%",install(e){e.directive("dLoading",S),e.config.globalProperties.$loadingService=V}};i.Loading=S,i.LoadingService=V,i.default=M,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|
package/modal/index.es.js
CHANGED
|
@@ -294,6 +294,7 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
294
294
|
function useOverlay(props, emit) {
|
|
295
295
|
const overlayRef = ref();
|
|
296
296
|
const arrowRef = ref();
|
|
297
|
+
let originParent = null;
|
|
297
298
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
298
299
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
299
300
|
const staticSide = {
|
|
@@ -332,21 +333,20 @@ function useOverlay(props, emit) {
|
|
|
332
333
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
333
334
|
};
|
|
334
335
|
watch(() => props.modelValue, () => {
|
|
335
|
-
const originParent = getScrollParent(props.origin);
|
|
336
336
|
if (props.modelValue && props.origin) {
|
|
337
|
+
originParent = getScrollParent(props.origin);
|
|
337
338
|
nextTick(updatePosition);
|
|
338
|
-
originParent.addEventListener("scroll", updatePosition);
|
|
339
|
+
originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
|
|
339
340
|
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
340
341
|
window.addEventListener("resize", updatePosition);
|
|
341
342
|
} else {
|
|
342
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
343
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
343
344
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
344
345
|
window.removeEventListener("resize", updatePosition);
|
|
345
346
|
}
|
|
346
347
|
});
|
|
347
348
|
onUnmounted(() => {
|
|
348
|
-
|
|
349
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
349
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
350
350
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
351
351
|
window.removeEventListener("resize", updatePosition);
|
|
352
352
|
});
|
|
@@ -446,36 +446,39 @@ var Modal = defineComponent({
|
|
|
446
446
|
expose({
|
|
447
447
|
handleVisibleChange
|
|
448
448
|
});
|
|
449
|
-
return () =>
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
449
|
+
return () => {
|
|
450
|
+
const fixedOverlayProps2 = {
|
|
451
|
+
visible: modelValue.value,
|
|
452
|
+
"onUpdate:visible": handleVisibleChange,
|
|
453
|
+
"background-class": "devui-modal-mask",
|
|
454
|
+
"background-block": lockScroll.value,
|
|
455
|
+
"backdrop-close": closeOnClickOverlay.value
|
|
456
|
+
};
|
|
457
|
+
return createVNode(FixedOverlay, fixedOverlayProps2, {
|
|
458
|
+
default: () => [createVNode(Transition, {
|
|
459
|
+
"name": "devui-modal-wipe"
|
|
460
|
+
}, {
|
|
461
|
+
default: () => {
|
|
462
|
+
var _a;
|
|
463
|
+
return [createVNode("div", mergeProps({
|
|
464
|
+
"class": "devui-modal"
|
|
465
|
+
}, attrs), [createVNode(Icon, {
|
|
466
|
+
"name": "close",
|
|
467
|
+
"class": "btn-close",
|
|
468
|
+
"size": "var(--devui-font-size-md,12px)",
|
|
469
|
+
"onClick": () => handleVisibleChange(false)
|
|
470
|
+
}, null), slots.header ? slots.header() : title.value && createVNode(Header, null, {
|
|
471
|
+
default: () => [title.value]
|
|
472
|
+
}), createVNode(Body, null, {
|
|
473
|
+
default: () => {
|
|
474
|
+
var _a2;
|
|
475
|
+
return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
|
|
476
|
+
}
|
|
477
|
+
}), (_a = slots.footer) == null ? void 0 : _a.call(slots)])];
|
|
478
|
+
}
|
|
479
|
+
})]
|
|
480
|
+
});
|
|
481
|
+
};
|
|
479
482
|
}
|
|
480
483
|
});
|
|
481
484
|
var Footer = defineComponent({
|
|
@@ -515,31 +518,36 @@ class ModalService extends CommonModalService {
|
|
|
515
518
|
const anchor = document.createElement("div");
|
|
516
519
|
this.anchorContainer.appendChild(anchor);
|
|
517
520
|
const _a = props, { header, content, footer } = _a, resProps = __objRest(_a, ["header", "content", "footer"]);
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
hide();
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
const renderOrigin = (props2, onUpdateModelValue = needHideOrNot) => {
|
|
524
|
-
return this.renderModal(anchor, __spreadProps(__spreadValues({}, props2), {
|
|
521
|
+
const renderOrigin = (propsValue, onUpdateModelValue) => {
|
|
522
|
+
return this.renderModal(anchor, __spreadProps(__spreadValues({}, propsValue), {
|
|
525
523
|
modelValue: true,
|
|
526
524
|
"onUpdate:modelValue": onUpdateModelValue
|
|
527
525
|
}), { header, default: content, footer });
|
|
528
526
|
};
|
|
529
527
|
const hide = () => {
|
|
530
|
-
var _a2, _b;
|
|
528
|
+
var _a2, _b, _c;
|
|
529
|
+
const innerNeedHideOrNot = (value) => {
|
|
530
|
+
if (!value) {
|
|
531
|
+
hide();
|
|
532
|
+
}
|
|
533
|
+
};
|
|
531
534
|
renderOrigin(resProps, (value) => {
|
|
532
535
|
if (!value) {
|
|
533
536
|
this.renderModal(anchor, __spreadProps(__spreadValues({}, resProps), { modelValue: false }));
|
|
534
537
|
this.renderNull(anchor);
|
|
535
538
|
} else {
|
|
536
|
-
renderOrigin(resProps);
|
|
539
|
+
renderOrigin(resProps, innerNeedHideOrNot);
|
|
537
540
|
}
|
|
538
541
|
});
|
|
539
|
-
(_b = (_a2 = vm.component.exposed).handleVisibleChange) == null ? void 0 :
|
|
542
|
+
(_c = (_b = (_a2 = vm == null ? void 0 : vm.component) == null ? void 0 : _a2.exposed) == null ? void 0 : _b.handleVisibleChange) == null ? void 0 : _c.call(_b, false);
|
|
543
|
+
};
|
|
544
|
+
const needHideOrNot = (value) => {
|
|
545
|
+
if (!value) {
|
|
546
|
+
hide();
|
|
547
|
+
}
|
|
540
548
|
};
|
|
541
549
|
this.renderModal(anchor, { modelValue: false });
|
|
542
|
-
vm = renderOrigin(resProps);
|
|
550
|
+
vm = renderOrigin(resProps, needHideOrNot);
|
|
543
551
|
return { hide };
|
|
544
552
|
}
|
|
545
553
|
}
|
package/modal/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var J=Object.defineProperty,Q=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var N=(a,e,d)=>e in a?J(a,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):a[e]=d,k=(a,e)=>{for(var d in e||(e={}))M.call(e,d)&&N(a,d,e[d]);if(C)for(var d of C(e))P.call(e,d)&&N(a,d,e[d]);return a},V=(a,e)=>Q(a,W(e));var A=(a,e)=>{var d={};for(var p in a)M.call(a,p)&&e.indexOf(p)<0&&(d[p]=a[p]);if(a!=null&&C)for(var p of C(a))e.indexOf(p)<0&&P.call(a,p)&&(d[p]=a[p]);return d};var j=(a,e,d)=>(N(a,typeof e!="symbol"?e+"":e,d),d);(function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.index={},a.Vue,a.dom))})(this,function(a,e,d){"use strict";const p={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function}},D={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var L=e.defineComponent({name:"DIcon",props:D,setup(o){const{name:t,size:n,color:i,classPrefix:l}=e.toRefs(o);return()=>/^((https?):)?\/\//.test(t.value)?e.createVNode("img",{src:t.value,alt:t.value.split("/")[t.value.split("/").length-1],style:{width:n.value,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${l.value} ${l.value}-${t.value}`,style:{fontSize:n.value,color:i.value}},null)}}),Z="";function R(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}const T=e.defineComponent({setup(o,t){return()=>{let n;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},R(n=e.renderSlot(t.slots,"default"))?n:{default:()=>[n]})]})}}}),_=V(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}}),{overlayStyle:{type:[String,Object],default:void 0}}),z=["update:visible","backdropClick"];function F(o,t){const n=e.computed(()=>["devui-overlay-background",o.backgroundClass,o.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),i=e.computed(()=>"devui-overlay"),l=r=>{var c;r.preventDefault(),(c=o.onBackdropClick)==null||c.call(o),o.backdropClose&&t.emit("update:visible",!1)},u=r=>r.cancelBubble=!0;return e.onMounted(()=>{const r=document.body,c=r.style.overflow,s=r.style.position;e.watch([()=>o.visible,()=>o.backgroundBlock],([m,v])=>{if(v){const f=r.getBoundingClientRect().y;m?(r.style.overflowY="scroll",r.style.position=m?"fixed":"",r.style.top=`${f}px`):(r.style.overflowY=c,r.style.position=s,r.style.top="",window.scrollTo(0,-f))}}),e.onUnmounted(()=>{document.body.style.overflow=c})}),{backgroundClass:n,overlayClass:i,handleBackdropClick:l,handleOverlayBubbleCancel:u}}var te="";const $=e.defineComponent({name:"DFixedOverlay",props:_,emits:z,setup(o,t){const{backgroundClass:n,overlayClass:i,handleBackdropClick:l,handleOverlayBubbleCancel:u}=F(o,t);return()=>e.createVNode(T,null,{default:()=>[o.visible&&e.createVNode("div",{class:n.value,style:o.backgroundStyle,onClick:l},[e.createVNode("div",{class:i.value,style:o.overlayStyle,onClick:u},[e.renderSlot(t.slots,"default")])])]})}}),q={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function H(o){const t=/(auto|scroll|hidden)/;for(let n=o;n=n.parentElement;n.parentElement!==document.body){const i=window.getComputedStyle(n);if(t.test(i.overflow+i.overflowX+i.overflowY))return n}return window}function I(o,t,n,i){let{x:l,y:u}=t;if(!o){const{width:r,height:c}=i;l&&n.includes("start")&&(l=12),l&&n.includes("end")&&(l=Math.round(r-24)),u&&n.includes("start")&&(u=10),u&&n.includes("end")&&(u=c-14)}return{x:l,y:u}}function U(o,t){const n=e.ref(),i=e.ref();let l=null;const u=(c,s,m,v)=>{const{x:f,y}=I(o.isArrowCenter,m,s,v.getBoundingClientRect()),b={top:"bottom",right:"left",bottom:"top",left:"right"}[s.split("-")[0]];Object.assign(c.style,{left:f?`${f}px`:"",top:y?`${y}px`:"",right:"",bottom:"",[b]:"-4px"})},r=async()=>{const c=o.origin,s=e.unref(n.value),m=e.unref(i.value),v=[d.shift(),d.offset(o.offset),d.autoPlacement({alignment:o.align,allowedPlacements:o.position})];o.showArrow&&v.push(d.arrow({element:m}));const{x:f,y,placement:b,middlewareData:g}=await d.computePosition(c,s,{strategy:"fixed",middleware:v});t("positionChange",b),Object.assign(s.style,{top:`${y}px`,left:`${f}px`}),o.showArrow&&u(m,b,g.arrow,s)};return e.watch(()=>o.modelValue,()=>{o.modelValue&&o.origin?(l=H(o.origin),e.nextTick(r),l==null||l.addEventListener("scroll",r),l!==window&&window.addEventListener("scroll",r),window.addEventListener("resize",r)):(l==null||l.removeEventListener("scroll",r),l!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r))}),e.onUnmounted(()=>{l==null||l.removeEventListener("scroll",r),l!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r)}),{arrowRef:i,overlayRef:n,updatePosition:r}}var oe="";e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:q,emits:["update:modelValue","positionChange"],setup(o,{slots:t,attrs:n,emit:i,expose:l}){const{arrowRef:u,overlayRef:r,updatePosition:c}=U(o,i);return l({updatePosition:c}),()=>{var s;return o.modelValue&&e.createVNode("div",e.mergeProps({ref:r,class:"devui-flexible-overlay"},n),[(s=t.default)==null?void 0:s.call(t),o.showArrow&&e.createVNode("div",{ref:u,class:"devui-flexible-overlay-arrow"},null)])}}});const Y=typeof window!="undefined";function K(o,t){function n(){t("update:modelValue",!1)}function i(l){l||(o.beforeClose?o.beforeClose(n):n())}return{handleVisibleChange:i}}var O=e.defineComponent({name:"DModalHeader",setup(o,{slots:t}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-header"},[(n=t.default)==null?void 0:n.call(t)])}}}),x=e.defineComponent({name:"DModalBody",setup(o,{slots:t}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-body"},[(n=t.default)==null?void 0:n.call(t)])}}}),ne="",w=e.defineComponent({name:"DModal",inheritAttrs:!1,props:p,emits:["update:modelValue"],setup(o,{slots:t,attrs:n,emit:i,expose:l}){const{modelValue:u,lockScroll:r,closeOnClickOverlay:c,title:s}=e.toRefs(o),{handleVisibleChange:m}=K(o,i);return l({handleVisibleChange:m}),()=>{const v={visible:u.value,"onUpdate:visible":m,"background-class":"devui-modal-mask","background-block":r.value,"backdrop-close":c.value};return e.createVNode($,v,{default:()=>[e.createVNode(e.Transition,{name:"devui-modal-wipe"},{default:()=>{var f;return[e.createVNode("div",e.mergeProps({class:"devui-modal"},n),[e.createVNode(L,{name:"close",class:"btn-close",size:"var(--devui-font-size-md,12px)",onClick:()=>m(!1)},null),t.header?t.header():s.value&&e.createVNode(O,null,{default:()=>[s.value]}),e.createVNode(x,null,{default:()=>{var y;return[(y=t.default)==null?void 0:y.call(t)]}}),(f=t.footer)==null?void 0:f.call(t)])]}})]})}}}),E=e.defineComponent({name:"DModalFooter",setup(o,{slots:t}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-footer"},[(n=t.default)==null?void 0:n.call(t)])}}});class X{constructor(t){this.anchorContainer=t}renderModal(t,n,i){const l=e.h(this.component(),n,i);return e.render(l,t),l}renderNull(t){setTimeout(()=>{e.render(null,t)},500)}}let h;class B extends X{component(){return w}open(t={}){const n=document.createElement("div");this.anchorContainer.appendChild(n);const v=t,{header:i,content:l,footer:u}=v,r=A(v,["header","content","footer"]),c=(f,y)=>this.renderModal(n,V(k({},f),{modelValue:!0,"onUpdate:modelValue":y}),{header:i,default:l,footer:u}),s=()=>{var y,b,g;const f=S=>{S||s()};c(r,S=>{S?c(r,f):(this.renderModal(n,V(k({},r),{modelValue:!1})),this.renderNull(n))}),(g=(b=(y=h==null?void 0:h.component)==null?void 0:y.exposed)==null?void 0:b.handleVisibleChange)==null||g.call(b,!1)},m=f=>{f||s()};return this.renderModal(n,{modelValue:!1}),h=c(r,m),{hide:s}}}j(B,"token","MODAL_SERVICE_TOKEN");var G={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(o){if(o.component(w.name,w),o.component(O.name,O),o.component(x.name,x),o.component(E.name,E),!Y)return;let t=document.getElementById("d-modal-anchors-container");t||(t=document.createElement("div"),t.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(t)),o.provide(B.token,new B(t))}};a.Modal=w,a.default=G,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
|
package/overlay/index.es.js
CHANGED
|
@@ -210,6 +210,7 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
210
210
|
function useOverlay(props, emit) {
|
|
211
211
|
const overlayRef = ref();
|
|
212
212
|
const arrowRef = ref();
|
|
213
|
+
let originParent = null;
|
|
213
214
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
214
215
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
215
216
|
const staticSide = {
|
|
@@ -248,21 +249,20 @@ function useOverlay(props, emit) {
|
|
|
248
249
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
249
250
|
};
|
|
250
251
|
watch(() => props.modelValue, () => {
|
|
251
|
-
const originParent = getScrollParent(props.origin);
|
|
252
252
|
if (props.modelValue && props.origin) {
|
|
253
|
+
originParent = getScrollParent(props.origin);
|
|
253
254
|
nextTick(updatePosition);
|
|
254
|
-
originParent.addEventListener("scroll", updatePosition);
|
|
255
|
+
originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
|
|
255
256
|
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
256
257
|
window.addEventListener("resize", updatePosition);
|
|
257
258
|
} else {
|
|
258
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
259
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
259
260
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
260
261
|
window.removeEventListener("resize", updatePosition);
|
|
261
262
|
}
|
|
262
263
|
});
|
|
263
264
|
onUnmounted(() => {
|
|
264
|
-
|
|
265
|
-
originParent.removeEventListener("scroll", updatePosition);
|
|
265
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
266
266
|
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
267
267
|
window.removeEventListener("resize", updatePosition);
|
|
268
268
|
});
|
package/overlay/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var R=Object.defineProperty,T=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var x=(l,e,a)=>e in l?R(l,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[e]=a,B=(l,e)=>{for(var a in e||(e={}))z.call(e,a)&&x(l,a,e[a]);if(O)for(var a of O(e))D.call(e,a)&&x(l,a,e[a]);return l},E=(l,e)=>T(l,$(e));(function(l,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],e):(l=typeof globalThis!="undefined"?globalThis:l||self,e(l.index={},l.Vue,l.dom))})(this,function(l,e,a){"use strict";var M="";function S(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const V=e.defineComponent({setup(t,r){return()=>{let i;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},S(i=e.renderSlot(r.slots,"default"))?i:{default:()=>[i]})]})}}}),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}},h=E(B({},p),{overlayStyle:{type:[String,Object],default:void 0}}),k=["update:visible","backdropClick"];function A(t,r){const i=e.computed(()=>["devui-overlay-background",t.backgroundClass,t.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),d=e.computed(()=>"devui-overlay"),n=o=>{var c;o.preventDefault(),(c=t.onBackdropClick)==null||c.call(t),t.backdropClose&&r.emit("update:visible",!1)},s=o=>o.cancelBubble=!0;return e.onMounted(()=>{const o=document.body,c=o.style.overflow,u=o.style.position;e.watch([()=>t.visible,()=>t.backgroundBlock],([f,v])=>{if(v){const y=o.getBoundingClientRect().y;f?(o.style.overflowY="scroll",o.style.position=f?"fixed":"",o.style.top=`${y}px`):(o.style.overflowY=c,o.style.position=u,o.style.top="",window.scrollTo(0,-y))}}),e.onUnmounted(()=>{document.body.style.overflow=c})}),{backgroundClass:i,overlayClass:d,handleBackdropClick:n,handleOverlayBubbleCancel:s}}var q="";const m=e.defineComponent({name:"DFixedOverlay",props:h,emits:k,setup(t,r){const{backgroundClass:i,overlayClass:d,handleBackdropClick:n,handleOverlayBubbleCancel:s}=A(t,r);return()=>e.createVNode(V,null,{default:()=>[t.visible&&e.createVNode("div",{class:i.value,style:t.backgroundStyle,onClick:n},[e.createVNode("div",{class:d.value,style:t.overlayStyle,onClick:s},[e.renderSlot(r.slots,"default")])])]})}}),C={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function j(t){const r=/(auto|scroll|hidden)/;for(let i=t;i=i.parentElement;i.parentElement!==document.body){const d=window.getComputedStyle(i);if(r.test(d.overflow+d.overflowX+d.overflowY))return i}return window}function P(t,r,i,d){let{x:n,y:s}=r;if(!t){const{width:o,height:c}=d;n&&i.includes("start")&&(n=12),n&&i.includes("end")&&(n=Math.round(o-24)),s&&i.includes("start")&&(s=10),s&&i.includes("end")&&(s=c-14)}return{x:n,y:s}}function L(t,r){const i=e.ref(),d=e.ref();let n=null;const s=(c,u,f,v)=>{const{x:y,y:w}=P(t.isArrowCenter,f,u,v.getBoundingClientRect()),b={top:"bottom",right:"left",bottom:"top",left:"right"}[u.split("-")[0]];Object.assign(c.style,{left:y?`${y}px`:"",top:w?`${w}px`:"",right:"",bottom:"",[b]:"-4px"})},o=async()=>{const c=t.origin,u=e.unref(i.value),f=e.unref(d.value),v=[a.shift(),a.offset(t.offset),a.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&v.push(a.arrow({element:f}));const{x:y,y:w,placement:b,middlewareData:_}=await a.computePosition(c,u,{strategy:"fixed",middleware:v});r("positionChange",b),Object.assign(u.style,{top:`${w}px`,left:`${y}px`}),t.showArrow&&s(f,b,_.arrow,u)};return e.watch(()=>t.modelValue,()=>{t.modelValue&&t.origin?(n=j(t.origin),e.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))}),e.onUnmounted(()=>{n==null||n.removeEventListener("scroll",o),n!==window&&window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}),{arrowRef:d,overlayRef:i,updatePosition:o}}var Y="";const g=e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:C,emits:["update:modelValue","positionChange"],setup(t,{slots:r,attrs:i,emit:d,expose:n}){const{arrowRef:s,overlayRef:o,updatePosition:c}=L(t,d);return n({updatePosition:c}),()=>{var u;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:o,class:"devui-flexible-overlay"},i),[(u=r.default)==null?void 0:u.call(r),t.showArrow&&e.createVNode("div",{ref:s,class:"devui-flexible-overlay-arrow"},null)])}}}),N=typeof window!="undefined";var F={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(t){if(t.component(m.name,m),t.component(g.name,g),N&&!document.getElementById("d-overlay-anchor")){const r=document.createElement("div");r.setAttribute("id","d-overlay-anchor"),r.style.position="fixed",r.style.left="0",r.style.top="0",r.style.zIndex="1000",document.body.appendChild(r)}}};l.FixedOverlay=m,l.FlexibleOverlay=g,l.default=F,l.fixedOverlayProps=h,l.flexibleOverlayProps=C,l.overlayEmits=k,l.overlayProps=p,Object.defineProperty(l,"__esModule",{value:!0}),l[Symbol.toStringTag]="Module"});
|
package/package.json
CHANGED
package/pagination/index.es.js
CHANGED
|
@@ -279,25 +279,25 @@ var JumpPage = defineComponent({
|
|
|
279
279
|
totalPages,
|
|
280
280
|
cursor
|
|
281
281
|
} = toRefs(props);
|
|
282
|
-
const inputNum = ref(pageIndex.value);
|
|
283
|
-
watch(() => pageIndex.value, (val) => {
|
|
282
|
+
const inputNum = ref(pageIndex == null ? void 0 : pageIndex.value);
|
|
283
|
+
watch(() => pageIndex == null ? void 0 : pageIndex.value, (val) => {
|
|
284
284
|
inputNum.value = val;
|
|
285
285
|
});
|
|
286
|
-
let curPage = pageIndex.value;
|
|
286
|
+
let curPage = pageIndex == null ? void 0 : pageIndex.value;
|
|
287
287
|
const jumpPageChange = (currentPage) => {
|
|
288
288
|
curPage = +currentPage;
|
|
289
289
|
inputNum.value = currentPage;
|
|
290
290
|
if (isNaN(currentPage)) {
|
|
291
291
|
setTimeout(() => {
|
|
292
|
-
inputNum.value = pageIndex.value;
|
|
292
|
+
inputNum.value = pageIndex == null ? void 0 : pageIndex.value;
|
|
293
293
|
}, 300);
|
|
294
294
|
}
|
|
295
295
|
};
|
|
296
296
|
const jump = (e) => {
|
|
297
|
-
if (curPage > totalPages.value) {
|
|
297
|
+
if (curPage > (totalPages == null ? void 0 : totalPages.value)) {
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
if ((e === "btn" || e.key === "Enter") && cursor.value !== curPage) {
|
|
300
|
+
if ((e === "btn" || e.key === "Enter") && (cursor == null ? void 0 : cursor.value) !== curPage) {
|
|
301
301
|
emit("changeCursorEmit", curPage);
|
|
302
302
|
}
|
|
303
303
|
};
|
|
@@ -316,17 +316,18 @@ var JumpPage = defineComponent({
|
|
|
316
316
|
jump,
|
|
317
317
|
showJumpButton
|
|
318
318
|
} = this;
|
|
319
|
+
const inputProps = {
|
|
320
|
+
class: ["devui-pagination-input", size ? "devui-pagination-input-" + size : ""],
|
|
321
|
+
size,
|
|
322
|
+
modelValue: String(inputNum),
|
|
323
|
+
"onUpdate:modelValue": jumpPageChange,
|
|
324
|
+
onKeydown: jump
|
|
325
|
+
};
|
|
319
326
|
return createVNode("div", {
|
|
320
327
|
"class": "devui-jump-container"
|
|
321
328
|
}, [
|
|
322
329
|
goToText,
|
|
323
|
-
createVNode(resolveComponent("d-input"),
|
|
324
|
-
"class": ["devui-pagination-input", size ? "devui-pagination-input-" + size : ""],
|
|
325
|
-
"size": size,
|
|
326
|
-
"modelValue": String(inputNum),
|
|
327
|
-
"onUpdate:modelValue": jumpPageChange,
|
|
328
|
-
"onKeydown": jump
|
|
329
|
-
}, null),
|
|
330
|
+
createVNode(resolveComponent("d-input"), inputProps, null),
|
|
330
331
|
goToText === "\u8DF3\u81F3" && "\u9875",
|
|
331
332
|
showJumpButton && createVNode("div", {
|
|
332
333
|
"class": ["devui-jump-button", size ? "devui-jump-size-" + size : "devui-jump-size-default"],
|