vue-devui 1.0.0-rc.7 → 1.0.0-rc.8
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 +3 -0
- package/alert/index.es.js +37 -11
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +62 -26
- package/auto-complete/index.umd.js +5 -5
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +32 -6
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +27 -3
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5548 -77
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +34 -13
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +47 -29
- package/checkbox/index.umd.js +1 -1
- package/checkbox/style.css +1 -1
- package/date-picker/index.es.js +90 -138
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +28 -3
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +36 -12
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/form/index.es.js +208 -73
- package/form/index.umd.js +12 -12
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +28 -4
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +68 -49
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/image-preview/index.es.js +34 -11
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +90 -138
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/layout/index.es.js +34 -6
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +34 -10
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +41 -15
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +40 -13
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/overlay/index.es.js +31 -9
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +1 -1
- package/pagination/index.es.js +59 -32
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/popover/index.es.js +53 -24
- package/popover/index.umd.js +13 -13
- package/popover/style.css +1 -1
- package/progress/index.es.js +31 -9
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +32 -7
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +32 -8
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/search/index.es.js +100 -146
- package/search/index.umd.js +13 -13
- package/search/style.css +1 -1
- package/select/index.es.js +74 -51
- package/select/index.umd.js +1 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +37 -12
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +34 -10
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +52 -24
- package/splitter/index.umd.js +15 -15
- package/splitter/style.css +1 -1
- package/status/index.es.js +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +30 -6
- package/switch/index.umd.js +1 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +5710 -265
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +32 -8
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +27 -2
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +93 -76
- package/textarea/index.umd.js +1 -1
- package/textarea/style.css +1 -1
- package/tooltip/index.es.js +41 -14
- package/tooltip/index.umd.js +12 -12
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +60 -51
- package/tree/index.umd.js +1 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +53 -22
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +3703 -3560
- package/vue-devui.umd.js +20 -20
package/overlay/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
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,d)=>t in r?M(r,t,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[t]=d,N=(r,t)=>{for(var d in t||(t={}))I.call(t,d)&&P(r,d,t[d]);if(j)for(var d of j(t))U.call(t,d)&&P(r,d,t[d]);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,d){"use strict";function m(e,o,n){let s=e;return o&&(s+=`__${o}`),n&&(s+=`--${n}`),s}function h(e){const o=`devui-${e}`;return{b:()=>m(o),e:i=>i?m(o,i):"",m:i=>i?m(o,"",i):"",em:(i,a)=>i&&a?m(o,i,a):""}}var G="";function F(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const $=t.defineComponent({setup(e,o){const n=h("overlay");return()=>{let s;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:n.e("fade")},F(s=t.renderSlot(o.slots,"default"))?s:{default:()=>[s]})]})}}}),C={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({},C),{overlayStyle:{type:[String,Object],default:void 0}}),B=["update:visible","backdropClick"];function R(e,o){const n=h("overlay"),s=t.computed(()=>[n.e("background"),e.backgroundClass,e.hasBackdrop?n.em("background","color"):n.em("background","disabled")]),l=t.computed(()=>n.b()),c=a=>{var f;a.preventDefault(),(f=e.onBackdropClick)==null||f.call(e),e.backdropClose&&o.emit("update:visible",!1)},i=a=>a.cancelBubble=!0;return t.onMounted(()=>{const a=document.body,f=a.style.overflow,u=a.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([y,b])=>{if(b){const w=a.getBoundingClientRect().y;y?(a.style.overflowY="scroll",a.style.position=y?"fixed":"",a.style.top=`${w}px`):(a.style.overflowY=f,a.style.position=u,a.style.top="",window.scrollTo(0,-w))}}),t.onUnmounted(()=>{document.body.style.overflow=f})}),{backgroundClass:s,overlayClass:l,handleBackdropClick:c,handleOverlayBubbleCancel:i}}var H="";const g=t.defineComponent({name:"DFixedOverlay",props:x,emits:B,setup(e,o){const{backgroundClass:n,overlayClass:s,handleBackdropClick:l,handleOverlayBubbleCancel:c}=R(e,o);return()=>t.createVNode($,null,{default:()=>[e.visible&&t.createVNode("div",{class:n.value,style:e.backgroundStyle,onClick:l},[t.createVNode("div",{class:s.value,style:e.overlayStyle,onClick:c},[t.renderSlot(o.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 o=/(auto|scroll|hidden)/;for(let n=e;n=n.parentElement;n.parentElement!==document.body){const s=window.getComputedStyle(n);if(o.test(s.overflow+s.overflowX+s.overflowY))return n}return window}function _(e,o,n,s){let{x:l,y:c}=o;if(!e){const{width:i,height:a}=s;l&&n.includes("start")&&(l=12),l&&n.includes("end")&&(l=Math.round(i-24)),c&&n.includes("start")&&(c=10),c&&n.includes("end")&&(c=a-14)}return{x:l,y:c}}function Y(e,o){const n=t.ref(),s=t.ref();let l=null;const c=(a,f,u,y)=>{const{x:b,y:w}=_(e.isArrowCenter,u,f,y.getBoundingClientRect()),v={top:"bottom",right:"left",bottom:"top",left:"right"}[f.split("-")[0]];Object.assign(a.style,{left:b?`${b}px`:"",top:w?`${w}px`:"",right:"",bottom:"",[v]:"-4px"})},i=async()=>{const a=e.origin,f=t.unref(n.value),u=t.unref(s.value),y=[d.offset(e.offset),d.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&y.push(d.arrow({element:u})),e.shiftOffset!==void 0&&y.push(d.shift());const{x:b,y:w,placement:v,middlewareData:S}=await d.computePosition(a,f,{strategy:"fixed",middleware:y});let p=b,k=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&&(k-=e.shiftOffset),A>0&&(k+=e.shiftOffset)}o("positionChange",v),Object.assign(f.style,{top:`${k}px`,left:`${p}px`}),e.showArrow&&c(u,v,S.arrow,f)};return t.watch(()=>e.modelValue,()=>{e.modelValue&&e.origin?(l=T(e.origin),t.nextTick(i),l==null||l.addEventListener("scroll",i),l!==window&&window.addEventListener("scroll",i),window.addEventListener("resize",i)):(l==null||l.removeEventListener("scroll",i),l!==window&&window.removeEventListener("scroll",i),window.removeEventListener("resize",i))}),t.onUnmounted(()=>{l==null||l.removeEventListener("scroll",i),l!==window&&window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}),{arrowRef:s,overlayRef:n,updatePosition:i}}var J="";const O=t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:E,emits:["update:modelValue","positionChange"],setup(e,{slots:o,attrs:n,emit:s,expose:l}){const c=h("flexible-overlay"),{arrowRef:i,overlayRef:a,updatePosition:f}=Y(e,s);return l({updatePosition:f}),()=>{var u;return e.modelValue&&t.createVNode("div",t.mergeProps({ref:a,class:c.b()},n),[(u=o.default)==null?void 0:u.call(o),e.showArrow&&t.createVNode("div",{ref:i,class:c.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 o=document.createElement("div");o.setAttribute("id","d-overlay-anchor"),o.style.position="fixed",o.style.left="0",o.style.top="0",o.style.zIndex="1000",document.body.appendChild(o)}}};r.FixedOverlay=g,r.FlexibleOverlay=O,r.default=D,r.fixedOverlayProps=x,r.flexibleOverlayProps=E,r.overlayEmits=B,r.overlayProps=C,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-
|
|
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
package/pagination/index.es.js
CHANGED
|
@@ -190,6 +190,29 @@ const clickoutsideDirective = {
|
|
|
190
190
|
delete el[ctx];
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
|
+
function createBem(namespace, element, modifier) {
|
|
194
|
+
let cls = namespace;
|
|
195
|
+
if (element) {
|
|
196
|
+
cls += `__${element}`;
|
|
197
|
+
}
|
|
198
|
+
if (modifier) {
|
|
199
|
+
cls += `--${modifier}`;
|
|
200
|
+
}
|
|
201
|
+
return cls;
|
|
202
|
+
}
|
|
203
|
+
function useNamespace(block) {
|
|
204
|
+
const namespace = `devui-${block}`;
|
|
205
|
+
const b = () => createBem(namespace);
|
|
206
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
207
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
208
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
209
|
+
return {
|
|
210
|
+
b,
|
|
211
|
+
e,
|
|
212
|
+
m,
|
|
213
|
+
em
|
|
214
|
+
};
|
|
215
|
+
}
|
|
193
216
|
var ConfigMenu = defineComponent({
|
|
194
217
|
directives: {
|
|
195
218
|
clickoutside: clickoutsideDirective
|
|
@@ -227,22 +250,23 @@ var ConfigMenu = defineComponent({
|
|
|
227
250
|
isShowConfig,
|
|
228
251
|
$slots
|
|
229
252
|
} = this;
|
|
253
|
+
const ns = useNamespace("pagination");
|
|
230
254
|
return withDirectives(createVNode("div", {
|
|
231
|
-
"class": "
|
|
255
|
+
"class": ns.e("config"),
|
|
232
256
|
"ref": "paginationConfig"
|
|
233
257
|
}, [createVNode("div", {
|
|
234
|
-
"class": "
|
|
258
|
+
"class": ns.e("setup-icon")
|
|
235
259
|
}, [createVNode("i", {
|
|
236
260
|
"class": "icon-setting",
|
|
237
261
|
"style": "font-weight: bold;"
|
|
238
262
|
}, null)]), isShowConfig && createVNode("div", {
|
|
239
|
-
"class": "
|
|
263
|
+
"class": ns.e("config-container")
|
|
240
264
|
}, [(_a = $slots.default) == null ? void 0 : _a.call($slots), createVNode("div", {
|
|
241
|
-
"class": "
|
|
265
|
+
"class": ns.e("config-item")
|
|
242
266
|
}, [createVNode("div", {
|
|
243
267
|
"class": "config-item-title"
|
|
244
268
|
}, [createTextVNode("\u6BCF\u9875\u6761\u6570")]), createVNode("div", {
|
|
245
|
-
"class": "
|
|
269
|
+
"class": ns.e("number")
|
|
246
270
|
}, [pageSizeOptions.map((v) => {
|
|
247
271
|
return createVNode("div", {
|
|
248
272
|
"class": {
|
|
@@ -316,25 +340,26 @@ var JumpPage = defineComponent({
|
|
|
316
340
|
jump,
|
|
317
341
|
showJumpButton
|
|
318
342
|
} = this;
|
|
343
|
+
const ns = useNamespace("pagination");
|
|
319
344
|
const inputProps = {
|
|
320
|
-
class: ["
|
|
345
|
+
class: [ns.e("input"), size ? ns.em("input", size) : ""],
|
|
321
346
|
size,
|
|
322
347
|
modelValue: String(inputNum),
|
|
323
348
|
"onUpdate:modelValue": jumpPageChange,
|
|
324
349
|
onKeydown: jump
|
|
325
350
|
};
|
|
326
351
|
return createVNode("div", {
|
|
327
|
-
"class": "
|
|
352
|
+
"class": ns.e("jump-container")
|
|
328
353
|
}, [
|
|
329
354
|
goToText,
|
|
330
355
|
createVNode(resolveComponent("d-input"), inputProps, null),
|
|
331
356
|
goToText === "\u8DF3\u81F3" && "\u9875",
|
|
332
357
|
showJumpButton && createVNode("div", {
|
|
333
|
-
"class": ["
|
|
358
|
+
"class": [ns.e("jump-button"), size ? ns.em("jump-size", size) : ns.em("jump-size", "default")],
|
|
334
359
|
"onClick": jump.bind(null, "btn"),
|
|
335
360
|
"title": goToText
|
|
336
361
|
}, [createVNode("div", {
|
|
337
|
-
"class": "
|
|
362
|
+
"class": ns.e("go")
|
|
338
363
|
}, null)])
|
|
339
364
|
]);
|
|
340
365
|
}
|
|
@@ -400,32 +425,33 @@ var PageNumBtn = defineComponent({
|
|
|
400
425
|
nextChange,
|
|
401
426
|
showTruePageIndex
|
|
402
427
|
} = this;
|
|
428
|
+
const ns = useNamespace("pagination");
|
|
403
429
|
return createVNode("ul", {
|
|
404
|
-
"class": ["
|
|
430
|
+
"class": [ns.e("list"), size ? ns.m(size) : ""]
|
|
405
431
|
}, [createVNode("li", {
|
|
406
432
|
"onClick": prevChange.bind(null, -1),
|
|
407
433
|
"class": {
|
|
408
|
-
"
|
|
434
|
+
[ns.e("item")]: true,
|
|
409
435
|
disabled: cursor <= 1
|
|
410
436
|
}
|
|
411
437
|
}, [createVNode("a", {
|
|
412
438
|
"innerHTML": preLink,
|
|
413
|
-
"class": "
|
|
439
|
+
"class": ns.e("link")
|
|
414
440
|
}, null)]), !lite && createVNode(Fragment, null, [
|
|
415
441
|
createVNode("li", {
|
|
416
442
|
"onClick": changeCursor.bind(null, 1),
|
|
417
443
|
"class": {
|
|
418
|
-
"
|
|
444
|
+
[ns.e("item")]: true,
|
|
419
445
|
active: cursor === 1
|
|
420
446
|
}
|
|
421
447
|
}, [createVNode("a", {
|
|
422
|
-
"class": "
|
|
448
|
+
"class": ns.e("link")
|
|
423
449
|
}, [createTextVNode("1")])]),
|
|
424
450
|
showPageNum[0] > 2 && createVNode("li", {
|
|
425
451
|
"onClick": prevChange.bind(null, showPageNum[0] - 1),
|
|
426
|
-
"class": "
|
|
452
|
+
"class": ns.e("item")
|
|
427
453
|
}, [createVNode("a", {
|
|
428
|
-
"class": "
|
|
454
|
+
"class": ns.e("link")
|
|
429
455
|
}, [createTextVNode("...")])]),
|
|
430
456
|
(() => {
|
|
431
457
|
const list = [];
|
|
@@ -434,48 +460,48 @@ var PageNumBtn = defineComponent({
|
|
|
434
460
|
"onClick": changeCursor.bind(null, i),
|
|
435
461
|
"key": i,
|
|
436
462
|
"class": {
|
|
437
|
-
"
|
|
463
|
+
[ns.e("item")]: true,
|
|
438
464
|
active: cursor === i
|
|
439
465
|
}
|
|
440
466
|
}, [createVNode("a", {
|
|
441
|
-
"class": "
|
|
467
|
+
"class": ns.e("link")
|
|
442
468
|
}, [i])]));
|
|
443
469
|
}
|
|
444
470
|
return list;
|
|
445
471
|
})(),
|
|
446
472
|
showPageNum[1] < totalPages - 1 && createVNode("li", {
|
|
447
473
|
"onClick": nextChange.bind(null, showPageNum[1] + 1),
|
|
448
|
-
"class": "
|
|
474
|
+
"class": ns.e("item")
|
|
449
475
|
}, [createVNode("a", {
|
|
450
|
-
"class": "
|
|
476
|
+
"class": ns.e("link")
|
|
451
477
|
}, [createTextVNode("...")])]),
|
|
452
478
|
showPageNum[1] < totalPages && createVNode("li", {
|
|
453
479
|
"onClick": changeCursor.bind(null, totalPages),
|
|
454
480
|
"class": {
|
|
455
|
-
"
|
|
481
|
+
[ns.e("item")]: true,
|
|
456
482
|
active: cursor === totalPages
|
|
457
483
|
}
|
|
458
484
|
}, [createVNode("a", {
|
|
459
|
-
"class": "
|
|
485
|
+
"class": ns.e("link")
|
|
460
486
|
}, [totalPages])]),
|
|
461
487
|
showTruePageIndex && cursor > totalPages && totalPages > 0 && createVNode(Fragment, null, [cursor > totalPages + 1 && createVNode("li", {
|
|
462
|
-
"class": "
|
|
488
|
+
"class": [ns.e("item"), "disabled"]
|
|
463
489
|
}, [createVNode("a", {
|
|
464
|
-
"class": "
|
|
490
|
+
"class": ns.e("link")
|
|
465
491
|
}, [createTextVNode("...")])]), createVNode("li", {
|
|
466
|
-
"class": "
|
|
492
|
+
"class": [ns.e("item"), "disabled", "active"]
|
|
467
493
|
}, [createVNode("a", {
|
|
468
|
-
"class": "
|
|
494
|
+
"class": ns.e("link")
|
|
469
495
|
}, [cursor])])])
|
|
470
496
|
]), createVNode("li", {
|
|
471
497
|
"onClick": nextChange.bind(null, -1),
|
|
472
498
|
"class": {
|
|
473
|
-
"
|
|
499
|
+
[ns.e("item")]: true,
|
|
474
500
|
disabled: cursor >= totalPages
|
|
475
501
|
}
|
|
476
502
|
}, [createVNode("a", {
|
|
477
503
|
"innerHTML": nextLink,
|
|
478
|
-
"class": "
|
|
504
|
+
"class": ns.e("link")
|
|
479
505
|
}, null)])]);
|
|
480
506
|
}
|
|
481
507
|
});
|
|
@@ -514,6 +540,7 @@ var Pagination = defineComponent({
|
|
|
514
540
|
showJumpButton,
|
|
515
541
|
haveConfigMenu
|
|
516
542
|
} = toRefs(props);
|
|
543
|
+
const ns = useNamespace("pagination");
|
|
517
544
|
const totalPages = computed(() => Math.ceil(props.total / props.pageSize));
|
|
518
545
|
const litePageOptions = computed(() => liteSelectOptions(totalPages.value));
|
|
519
546
|
const cursor = computed({
|
|
@@ -556,10 +583,10 @@ var Pagination = defineComponent({
|
|
|
556
583
|
};
|
|
557
584
|
return () => {
|
|
558
585
|
return autoHide.value && Math.min(...pageSizeOptions.value) > total.value ? null : createVNode("div", {
|
|
559
|
-
"class":
|
|
586
|
+
"class": ns.b()
|
|
560
587
|
}, [
|
|
561
588
|
canChangePageSize.value && !lite.value && createVNode("div", {
|
|
562
|
-
"class": ["
|
|
589
|
+
"class": [ns.e("size"), size.value ? ns.em("size", size.value) : ""]
|
|
563
590
|
}, [createVNode(resolveComponent("d-select"), {
|
|
564
591
|
"options": pageSizeOptions.value,
|
|
565
592
|
"modelValue": currentPageSize.value,
|
|
@@ -567,10 +594,10 @@ var Pagination = defineComponent({
|
|
|
567
594
|
"pageSizeDirection": pageSizeDirection.value
|
|
568
595
|
}, null)]),
|
|
569
596
|
(!lite.value || lite.value && showPageSelector.value) && canViewTotal.value && createVNode("div", {
|
|
570
|
-
"class": "
|
|
597
|
+
"class": ns.e("total-size")
|
|
571
598
|
}, [totalItemText.value, createTextVNode(": "), total.value]),
|
|
572
599
|
lite.value && showPageSelector.value && createVNode("div", {
|
|
573
|
-
"class": "
|
|
600
|
+
"class": ns.e("size")
|
|
574
601
|
}, [createVNode(resolveComponent("d-select"), {
|
|
575
602
|
"options": litePageOptions.value,
|
|
576
603
|
"disabled": total.value === 0,
|
package/pagination/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(p,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(p=typeof globalThis!="undefined"?globalThis:p||self,e(p.index={},p.Vue))})(this,function(p,e){"use strict";const w={pageSize:{type:Number,default:10},total:{type:Number,default:0},pageSizeOptions:{type:Array,default:()=>[5,10,20,50]},pageSizeDirection:{type:Array,default:()=>["centerDown","centerUp"]},pageIndex:{type:Number,default:1},maxItems:{type:Number,default:10},preLink:{type:String,default:"<"},nextLink:{type:String,default:">"},size:{type:String,default:""},canJumpPage:{type:Boolean,default:!1},canChangePageSize:{type:Boolean,default:!1},canViewTotal:{type:Boolean,default:!1},totalItemText:{type:String,default:"\u6240\u6709\u6761\u76EE"},goToText:{type:String,default:"\u8DF3\u81F3"},showJumpButton:{type:Boolean,default:!1},showTruePageIndex:{type:Boolean,default:!1},lite:{type:Boolean,default:!1},showPageSelector:{type:Boolean,default:!0},haveConfigMenu:{type:Boolean,default:!1},autoFixPageIndex:{type:Boolean,default:!0},autoHide:{type:Boolean,default:!1},"onUpdate:pageIndex":{type:Function},"onUpdate:pageSize":{type:Function},onPageIndexChange:{type:Function},onPageSizeChange:{type:Function}},L=(t,a,n)=>{const i=t,c=a;if(c>=n)return[2,n];const l=c-2;let o=i-(l>>1),s=i+(l-1>>1);return o<2&&(o=2,s=c-2),s>n&&(o=n-c+3,s=n),[o,s]};function j(t){return new Array(t||1).fill(0).map((a,n)=>({name:`${n+1}/${t}`,value:n+1}))}function b(t,a,n){document.addEventListener?t&&a&&n&&t.addEventListener(a,n,!1):t&&a&&n&&t.attachEvent("on"+a,n)}function M(t,a,n){document.removeEventListener?t&&a&&n&&t.removeEventListener(a,n,!1):t&&a&&n&&t.detachEvent("on"+a,n)}const D=typeof window!="undefined",m=Symbol("@@clickoutside"),k=new Map;let B,z=0,I=!0;function E(t,a,n){return D&&I&&(I=!1,b(document,"mousedown",i=>{B=i}),b(document,"mouseup",i=>{for(const[c,l]of k)l[m].documentHandler(i,B)})),function(i,c){!n||!a.instance||!i.target||!c.target||t.contains(i.target)||t.contains(c.target)||t===i.target||t[m].bindingFn&&t[m].bindingFn()}}const H={beforeMount:function(t,a,n){z++,k.set(z,t),t[m]={nid:z,documentHandler:E(t,a,n),bindingFn:a.value}},updated:function(t,a,n){t[m].documentHandler=E(t,a,n),t[m].bindingFn=a.value},unmounted:function(t){k.delete(t[m].nid),delete t[m]}};function V(t,a,n){let i=t;return a&&(i+=`__${a}`),n&&(i+=`--${n}`),i}function P(t){const a=`devui-${t}`;return{b:()=>V(a),e:o=>o?V(a,o):"",m:o=>o?V(a,"",o):"",em:(o,s)=>o&&s?V(a,o,s):""}}var J=e.defineComponent({directives:{clickoutside:H},props:{currentPageSize:Number,pageSizeChange:Function,pageSizeOptions:Array},setup(){const t=e.ref(null),a=e.ref(!1),n=i=>{a.value=a.value?!1:!!i};return e.onMounted(()=>{b(t.value,"click",n)}),e.onUnmounted(()=>{M(t.value,"click",n)}),{paginationConfig:t,isShowConfig:a,closeConfigMenu:n}},render(){var s;const{closeConfigMenu:t,currentPageSize:a,pageSizeChange:n,pageSizeOptions:i,isShowConfig:c,$slots:l}=this,o=P("pagination");return e.withDirectives(e.createVNode("div",{class:o.e("config"),ref:"paginationConfig"},[e.createVNode("div",{class:o.e("setup-icon")},[e.createVNode("i",{class:"icon-setting",style:"font-weight: bold;"},null)]),c&&e.createVNode("div",{class:o.e("config-container")},[(s=l.default)==null?void 0:s.call(l),e.createVNode("div",{class:o.e("config-item")},[e.createVNode("div",{class:"config-item-title"},[e.createTextVNode("\u6BCF\u9875\u6761\u6570")]),e.createVNode("div",{class:o.e("number")},[i.map(u=>e.createVNode("div",{class:{choosed:u===a},key:u,onClick:n.bind(null,{value:u})},[u]))])])])]),[[e.resolveDirective("clickoutside"),t]])}});const O={goToText:String,size:{type:String,default:""},pageIndex:Number,showJumpButton:Boolean,totalPages:Number,cursor:Number,onChangeCursorEmit:Function};var A=e.defineComponent({props:O,emits:["changeCursorEmit"],setup(t,{emit:a}){const{pageIndex:n,totalPages:i,cursor:c}=e.toRefs(t),l=e.ref(n==null?void 0:n.value);e.watch(()=>n==null?void 0:n.value,d=>{l.value=d});let o=n==null?void 0:n.value;return{inputNum:l,jumpPageChange:d=>{o=+d,l.value=d,isNaN(d)&&setTimeout(()=>{l.value=n==null?void 0:n.value},300)},jump:d=>{o>(i==null?void 0:i.value)||(d==="btn"||d.key==="Enter")&&(c==null?void 0:c.value)!==o&&a("changeCursorEmit",o)}}},render(){const{goToText:t,size:a,inputNum:n,jumpPageChange:i,jump:c,showJumpButton:l}=this,o=P("pagination"),s={class:[o.e("input"),a?o.em("input",a):""],size:a,modelValue:String(n),"onUpdate:modelValue":i,onKeydown:c};return e.createVNode("div",{class:o.e("jump-container")},[t,e.createVNode(e.resolveComponent("d-input"),s,null),t==="\u8DF3\u81F3"&&"\u9875",l&&e.createVNode("div",{class:[o.e("jump-button"),a?o.em("jump-size",a):o.em("jump-size","default")],onClick:c.bind(null,"btn"),title:t},[e.createVNode("div",{class:o.e("go")},null)])])}});const U={size:{type:String,default:""},preLink:String,nextLink:String,lite:Boolean,cursor:Number,maxItems:Number,totalPages:Number,onChangeCursorEmit:Function,showTruePageIndex:Boolean};var _=e.defineComponent({props:U,emits:["changeCursorEmit"],setup(t,{emit:a}){return{showPageNum:e.computed(()=>L(t.cursor,t.maxItems,t.totalPages)),changeCursor:o=>{if(isNaN(o))return;const s=o<1?1:o>t.totalPages?t.totalPages:o|0;a("changeCursorEmit",s)},prevChange:o=>{if(t.cursor>1){const s=o===-1?t.cursor-1:o;a("changeCursorEmit",s)}},nextChange:o=>{if(t.cursor<t.totalPages){const s=o===-1?t.cursor+1:o;a("changeCursorEmit",s)}}}},render(){const{size:t,preLink:a,nextLink:n,lite:i,changeCursor:c,cursor:l,showPageNum:o,prevChange:s,totalPages:u,nextChange:d,showTruePageIndex:x}=this,r=P("pagination");return e.createVNode("ul",{class:[r.e("list"),t?r.m(t):""]},[e.createVNode("li",{onClick:s.bind(null,-1),class:{[r.e("item")]:!0,disabled:l<=1}},[e.createVNode("a",{innerHTML:a,class:r.e("link")},null)]),!i&&e.createVNode(e.Fragment,null,[e.createVNode("li",{onClick:c.bind(null,1),class:{[r.e("item")]:!0,active:l===1}},[e.createVNode("a",{class:r.e("link")},[e.createTextVNode("1")])]),o[0]>2&&e.createVNode("li",{onClick:s.bind(null,o[0]-1),class:r.e("item")},[e.createVNode("a",{class:r.e("link")},[e.createTextVNode("...")])]),(()=>{const S=[];for(let f=o[0];f<=o[1];f++)S.push(e.createVNode("li",{onClick:c.bind(null,f),key:f,class:{[r.e("item")]:!0,active:l===f}},[e.createVNode("a",{class:r.e("link")},[f])]));return S})(),o[1]<u-1&&e.createVNode("li",{onClick:d.bind(null,o[1]+1),class:r.e("item")},[e.createVNode("a",{class:r.e("link")},[e.createTextVNode("...")])]),o[1]<u&&e.createVNode("li",{onClick:c.bind(null,u),class:{[r.e("item")]:!0,active:l===u}},[e.createVNode("a",{class:r.e("link")},[u])]),x&&l>u&&u>0&&e.createVNode(e.Fragment,null,[l>u+1&&e.createVNode("li",{class:[r.e("item"),"disabled"]},[e.createVNode("a",{class:r.e("link")},[e.createTextVNode("...")])]),e.createVNode("li",{class:[r.e("item"),"disabled","active"]},[e.createVNode("a",{class:r.e("link")},[l])])])]),e.createVNode("li",{onClick:d.bind(null,-1),class:{[r.e("item")]:!0,disabled:l>=u}},[e.createVNode("a",{innerHTML:n,class:r.e("link")},null)])])}}),te="",v=e.defineComponent({name:"DPagination",components:{ConfigMenu:J,JumpPage:A,PageNumBtn:_},props:w,emits:["pageIndexChange","pageSizeChange","update:pageSize","update:pageIndex"],setup(t,{emit:a,slots:n}){const{autoHide:i,pageSizeOptions:c,total:l,canChangePageSize:o,lite:s,size:u,pageSizeDirection:d,showPageSelector:x,canViewTotal:r,totalItemText:S,maxItems:f,preLink:R,nextLink:q,showTruePageIndex:K,canJumpPage:G,goToText:Q,pageIndex:W,showJumpButton:X,haveConfigMenu:Y}=e.toRefs(t),h=P("pagination"),C=e.computed(()=>Math.ceil(t.total/t.pageSize)),Z=e.computed(()=>j(C.value)),N=e.computed({get(){return!t.showTruePageIndex&&t.pageIndex>C.value?(a("update:pageIndex",C.value||1),C.value||1):t.pageIndex||1},set(g){a("update:pageIndex",g)}}),T=e.computed({get(){return t.pageSize},set(g){a("update:pageSize",g)}}),y=g=>{N.value=g,a("pageIndexChange",g)},F=g=>{T.value=g.value,t.autoFixPageIndex&&e.nextTick(()=>{N.value>C.value&&y(C.value)}),a("pageSizeChange",g.value)},ee=g=>{y(g.value)};return()=>i.value&&Math.min(...c.value)>l.value?null:e.createVNode("div",{class:h.b()},[o.value&&!s.value&&e.createVNode("div",{class:[h.e("size"),u.value?h.em("size",u.value):""]},[e.createVNode(e.resolveComponent("d-select"),{options:c.value,modelValue:T.value,onValueChange:F,pageSizeDirection:d.value},null)]),(!s.value||s.value&&x.value)&&r.value&&e.createVNode("div",{class:h.e("total-size")},[S.value,e.createTextVNode(": "),l.value]),s.value&&x.value&&e.createVNode("div",{class:h.e("size")},[e.createVNode(e.resolveComponent("d-select"),{options:Z.value,disabled:l.value===0,modelValue:N.value,onValueChange:ee,pageSizeDirection:d.value},null)]),e.createVNode(e.resolveComponent("page-num-btn"),e.mergeProps({cursor:N.value,totalPages:C.value,size:u.value,lite:s.value,maxItems:f.value,preLink:R.value,nextLink:q.value,showTruePageIndex:K.value},{onChangeCursorEmit:y}),null),G.value&&!s.value&&e.createVNode(e.resolveComponent("jump-page"),e.mergeProps({goToText:Q.value,size:u.value,pageIndex:W.value,totalPages:C.value,cursor:N.value,showJumpButton:X.value},{onChangeCursorEmit:y}),null),s.value&&Y.value&&e.createVNode(e.resolveComponent("config-menu"),{currentPageSize:T.value,pageSizeChange:F,pageSizeOptions:c.value},{default:()=>{var g;return[(g=n.default)==null?void 0:g.call(n)]}})])}}),$={title:"Pagination \u5206\u9875",category:"\u5BFC\u822A",status:"100%",install(t){t.component(v.name,v)}};p.Pagination=v,p.default=$,p.paginationProps=w,Object.defineProperty(p,"__esModule",{value:!0}),p[Symbol.toStringTag]="Module"});
|
package/pagination/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.devui-pagination{font-size:var(--devui-font-size, 12px)}.devui-pagination .devui-
|
|
1
|
+
@charset "UTF-8";.devui-pagination{font-size:var(--devui-font-size, 12px)}.devui-pagination .devui-pagination__size{display:inline-block;max-width:100px;line-height:24px;margin:0 12px 0 0;position:relative;vertical-align:middle}.devui-pagination .devui-pagination__size.devui-pagination__size--sm{max-width:80px}.devui-pagination .devui-pagination__size.devui-pagination__size--sm .devui-select-input{height:24px}.devui-pagination .devui-pagination__size.devui-pagination__size--lg{max-width:100px}.devui-pagination .devui-pagination__size.devui-pagination__size--lg .devui-select-input,.devui-pagination .devui-pagination__size.devui-pagination__size--lg .devui-select-item{height:46px}.devui-pagination .devui-select-input{height:26px}.devui-pagination .devui-pagination__total-size{display:inline-block;position:relative;vertical-align:middle;margin:0 12px 0 0;color:var(--devui-text-weak, #575d6c)}.devui-pagination .devui-pagination__list,.devui-pagination .devui-pagination__item{padding:0;margin:0;list-style:none}.devui-pagination a{text-decoration:none;color:#3eaf7c}.devui-pagination .devui-pagination__list{vertical-align:middle;display:inline-flex;align-items:center}.devui-pagination .devui-pagination__list li.devui-pagination__item{cursor:pointer}.devui-pagination .devui-pagination__list li.devui-pagination__item.active a.devui-pagination__link{text-decoration:none;background-color:var(--devui-list-item-active-bg, #5e7ce0);color:var(--devui-list-item-active-text, #ffffff)}.devui-pagination .devui-pagination__list li.devui-pagination__item.disabled a.devui-pagination__link{cursor:not-allowed;opacity:.5;background-color:#fff;color:var(--devui-text-weak, #575d6c)}.devui-pagination .devui-pagination__list li.devui-pagination__item .devui-pagination__link{margin-left:5px;padding:3px 7px;line-height:1.5;border-radius:var(--devui-border-radius, 2px);color:var(--devui-text-weak, #575d6c);display:flex;align-items:center;transition:background-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-pagination .devui-pagination__list li.devui-pagination__item .devui-pagination__link:hover{text-decoration:none;background-color:var(--devui-list-item-hover-bg, #f2f5fc);color:var(--devui-list-item-hover-text, #526ecc)}.devui-pagination .devui-pagination__sm>li.devui-pagination__item>a.devui-pagination__link{padding:0 5px;min-width:18px;height:22px;line-height:1.5;font-size:var(--devui-font-size-sm, 12px)}.devui-pagination .devui-pagination__lg>li.devui-pagination__item>a.devui-pagination__link{padding:0 12px;height:38px;font-size:var(--devui-font-size-lg, 14px);line-height:1.5}.devui-pagination .devui-pagination__jump-container{display:inline-flex;position:relative;margin:0 12px;vertical-align:middle;align-items:center}.devui-pagination .devui-pagination__jump-container .devui-input{display:inline-block;width:42px;vertical-align:middle;margin:0 4px}.devui-pagination .devui-pagination__jump-container .devui-input--lg{width:56px}.devui-pagination .devui-pagination__jump-button{display:inline-flex;vertical-align:middle;width:24px;height:24px;border-radius:var(--devui-border-radius, 2px);border:1px solid var(--devui-line, #adb0b8);cursor:pointer;margin-left:4px;align-items:center;justify-content:center}.devui-pagination .devui-pagination__jump-button .devui-pagination__go{width:0;height:0;border-top:6px solid transparent;border-left:6px solid var(--devui-icon-text, #252b3a);border-bottom:6px solid transparent}.devui-pagination .devui-pagination__jump-button:hover{border-color:var(--devui-brand-active, #526ecc)}.devui-pagination .devui-pagination__jump-button:hover .devui-pagination__go{border-left-color:var(--devui-brand-active, #526ecc)}.devui-pagination .devui-pagination__jump-size--default{width:28px;height:28px}.devui-pagination .devui-pagination__jump-size--default .devui-pagination__go{width:0;height:0;border-top:8px solid transparent;border-left:10px solid var(--devui-icon-text, #252b3a);border-bottom:8px solid transparent}.devui-pagination .devui-pagination__jump-size--sm{width:24px;height:24px}.devui-pagination .devui-pagination__jump-size--sm .devui-pagination__go{width:0;height:0;border-top:6px solid transparent;border-left:6px solid var(--devui-icon-text, #252b3a);border-bottom:6px solid transparent}.devui-pagination .devui-pagination__jump-size--sm .devui-pagination__link{height:30px;line-height:32px}.devui-pagination .devui-pagination__jump-size--lg{width:46px;height:46px}.devui-pagination .devui-pagination__jump-size--lg .devui-pagination__go{width:0;height:0;border-top:14px solid transparent;border-left:14px solid var(--devui-icon-text, #252b3a);border-bottom:14px solid transparent}.devui-pagination .devui-pagination__config{color:var(--devui-text, #252b3a);position:relative;display:inline-block;vertical-align:middle;margin:0 4px}.devui-pagination .devui-pagination__setup-icon{line-height:30px;cursor:pointer;display:flex}.devui-pagination .devui-pagination__config-container{padding:4px 0;box-shadow:var(--devui-shadow-connected-overlay, 0 2px 8px 0) var(--devui-shadow, rgba(37, 43, 58, .2));border-radius:var(--devui-border-radius, 2px);width:150px;background-color:var(--devui-connected-overlay-bg, #ffffff);line-height:26px;position:absolute;left:-136px;top:28px;cursor:auto;z-index:var(--devui-z-index-dropdown, 1052);user-select:none}.devui-pagination .devui-pagination__config-item{padding-bottom:8px;padding-top:4px;border-bottom:1px solid var(--devui-line, #adb0b8)}.devui-pagination .devui-pagination__config-item:last-child{border-bottom:none}.devui-pagination .config-item-title{color:var(--devui-line, #adb0b8);padding-left:8px;font-size:var(--devui-font-size, 12px);line-height:1.5}.devui-pagination .devui-pagination__number{padding-left:8px;margin-top:4px;display:flex}.devui-pagination .devui-pagination__number div{color:var(--devui-text, #252b3a);cursor:pointer;border-top:1px solid var(--devui-line, #adb0b8);border-bottom:1px solid var(--devui-line, #adb0b8);border-right:1px solid var(--devui-line, #adb0b8);text-align:center;height:26px;width:26px}.devui-pagination .devui-pagination__number div:first-child{border-left:1px solid var(--devui-line, #adb0b8)}.devui-pagination .devui-pagination__number div:hover{background-color:var(--devui-list-item-hover-bg, #f2f5fc);color:var(--devui-list-item-hover-text, #526ecc)}.devui-pagination .devui-pagination__number div.choosed{color:var(--devui-list-item-active-text, #ffffff);background-color:var(--devui-list-item-active-bg, #5e7ce0)!important;cursor:auto!important}.devui-pagination .config-item-words{color:var(--devui-text, #252b3a);padding-left:8px;font-size:var(--devui-font-size, 12px);margin-top:4px}.devui-pagination .config-item-words:hover{background-color:var(--devui-area, #f8f8f8);cursor:pointer}
|
package/popover/index.es.js
CHANGED
|
@@ -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, toRefs, Fragment } 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) {
|
|
33
|
+
const namespace = `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 ns2 = 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": "
|
|
58
|
+
"name": ns2.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 ns2 = 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 [ns2.e("background"), props.backgroundClass, !props.hasBackdrop ? ns2.em("background", "disabled") : ns2.em("background", "color")];
|
|
83
104
|
});
|
|
84
105
|
const overlayClass = computed(() => {
|
|
85
|
-
return
|
|
106
|
+
return ns2.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 ns2 = 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":
|
|
329
|
+
"class": ns2.b()
|
|
308
330
|
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
|
|
309
331
|
"ref": arrowRef,
|
|
310
|
-
"class": "
|
|
332
|
+
"class": ns2.e("arrow")
|
|
311
333
|
}, null)]);
|
|
312
334
|
};
|
|
313
335
|
}
|
|
@@ -5834,11 +5856,12 @@ function usePopoverEvent(props, visible, origin) {
|
|
|
5834
5856
|
origin.value.addEventListener("mouseleave", onMouseleave);
|
|
5835
5857
|
}
|
|
5836
5858
|
});
|
|
5837
|
-
return { placement, handlePositionChange };
|
|
5859
|
+
return { placement, handlePositionChange, onMouseenter, onMouseleave };
|
|
5838
5860
|
}
|
|
5861
|
+
const ns = useNamespace("popover");
|
|
5839
5862
|
function SuccessIcon() {
|
|
5840
5863
|
return createVNode("svg", {
|
|
5841
|
-
"class": "
|
|
5864
|
+
"class": [ns.e("icon"), ns.em("icon", "success")],
|
|
5842
5865
|
"viewBox": "0 0 16 16",
|
|
5843
5866
|
"version": "1.1",
|
|
5844
5867
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
@@ -5862,7 +5885,7 @@ function SuccessIcon() {
|
|
|
5862
5885
|
}
|
|
5863
5886
|
function WarningIcon() {
|
|
5864
5887
|
return createVNode("svg", {
|
|
5865
|
-
"class": "
|
|
5888
|
+
"class": [ns.e("icon"), ns.em("icon", "warning")],
|
|
5866
5889
|
"viewBox": "0 0 16 16",
|
|
5867
5890
|
"version": "1.1",
|
|
5868
5891
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
@@ -5872,14 +5895,14 @@ function WarningIcon() {
|
|
|
5872
5895
|
"fill": "none",
|
|
5873
5896
|
"fill-rule": "evenodd"
|
|
5874
5897
|
}, [createVNode("polygon", {
|
|
5875
|
-
"points": "7.5 1.74501946 1.39184847 13.5954649 7.08947368
|
|
5898
|
+
"points": "7.5 1.74501946 1.39184847 13.5954649 7.08947368 14.2207621 13.9973698 13.5954649 10.9383683 5.61273879 8.40084114 1.27624313"
|
|
5876
5899
|
}, null), createVNode("path", {
|
|
5877
|
-
"d": "M8.51325441,0.127397589 C8.70423071,0.228333932
|
|
5900
|
+
"d": "M8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.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 Z M8.87894737,11.2105263 L7.08947368,11.2105263 L7.08947368,13 L8.87894737,13 L8.87894737,11.2105263 Z M8.96842105,4.5 L7,4.5 L7.08947368,9.86842105 L8.87894737,9.86842105 L8.96842105,4.5 Z"
|
|
5878
5901
|
}, null)])]);
|
|
5879
5902
|
}
|
|
5880
5903
|
function InfoIcon() {
|
|
5881
5904
|
return createVNode("svg", {
|
|
5882
|
-
"class": "
|
|
5905
|
+
"class": [ns.e("icon"), ns.em("icon", "info")],
|
|
5883
5906
|
"viewBox": "0 0 16 16",
|
|
5884
5907
|
"version": "1.1",
|
|
5885
5908
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
@@ -5895,12 +5918,12 @@ function InfoIcon() {
|
|
|
5895
5918
|
}, null), createVNode("g", {
|
|
5896
5919
|
"stroke-width": "1"
|
|
5897
5920
|
}, [createVNode("path", {
|
|
5898
|
-
"d": "M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16
|
|
5921
|
+
"d": "M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z M9,5 L7,5 L7,3 L9,3 L9,5 Z M9,12.6 L7,12.6 L7,6.6 L9,6.6 L9,12.6 Z"
|
|
5899
5922
|
}, null)])])]);
|
|
5900
5923
|
}
|
|
5901
5924
|
function ErrorIcon() {
|
|
5902
5925
|
return createVNode("svg", {
|
|
5903
|
-
"class": "
|
|
5926
|
+
"class": [ns.e("icon"), ns.em("icon", "error")],
|
|
5904
5927
|
"width": "16px",
|
|
5905
5928
|
"height": "16px",
|
|
5906
5929
|
"viewBox": "0 0 16 16",
|
|
@@ -5916,7 +5939,7 @@ function ErrorIcon() {
|
|
|
5916
5939
|
"cy": "8",
|
|
5917
5940
|
"r": "7"
|
|
5918
5941
|
}, null), createVNode("path", {
|
|
5919
|
-
"d": "M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8
|
|
5942
|
+
"d": "M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z M9,12.6 L7,12.6 L7,10.6 L9,10.6 L9,12.6 Z M9,9.1 L7,9.1 L6.9,3.1 L9.1,3.1 L9,9.1 Z",
|
|
5920
5943
|
"fill-rule": "nonzero"
|
|
5921
5944
|
}, null)])]);
|
|
5922
5945
|
}
|
|
@@ -5929,8 +5952,9 @@ var PopoverIcon = defineComponent({
|
|
|
5929
5952
|
}
|
|
5930
5953
|
},
|
|
5931
5954
|
setup(props) {
|
|
5955
|
+
const ns2 = useNamespace("popover");
|
|
5932
5956
|
return () => props.type && props.type !== "default" && createVNode("span", {
|
|
5933
|
-
"class": "
|
|
5957
|
+
"class": ns2.e("icon-wrap")
|
|
5934
5958
|
}, [props.type === "success" && createVNode(SuccessIcon, null, null), props.type === "warning" && createVNode(WarningIcon, null, null), props.type === "info" && createVNode(InfoIcon, null, null), props.type === "error" && createVNode(ErrorIcon, null, null)]);
|
|
5935
5959
|
}
|
|
5936
5960
|
});
|
|
@@ -5956,21 +5980,24 @@ var Popover = defineComponent({
|
|
|
5956
5980
|
const visible = ref(false);
|
|
5957
5981
|
const {
|
|
5958
5982
|
placement,
|
|
5959
|
-
handlePositionChange
|
|
5983
|
+
handlePositionChange,
|
|
5984
|
+
onMouseenter,
|
|
5985
|
+
onMouseleave
|
|
5960
5986
|
} = usePopoverEvent(props, visible, origin);
|
|
5961
5987
|
const {
|
|
5962
5988
|
overlayStyles
|
|
5963
5989
|
} = usePopover(props, visible, placement, origin, popoverRef);
|
|
5990
|
+
const ns2 = useNamespace("popover");
|
|
5964
5991
|
return () => {
|
|
5965
5992
|
var _a;
|
|
5966
5993
|
return createVNode(Fragment, null, [createVNode("div", {
|
|
5967
5994
|
"ref": origin,
|
|
5968
|
-
"class": "
|
|
5995
|
+
"class": ns2.e("reference")
|
|
5969
5996
|
}, [(_a = slots.reference) == null ? void 0 : _a.call(slots)]), createVNode(Teleport, {
|
|
5970
5997
|
"to": "body"
|
|
5971
5998
|
}, {
|
|
5972
5999
|
default: () => [createVNode(Transition, {
|
|
5973
|
-
"name": showAnimation.value ? `
|
|
6000
|
+
"name": showAnimation.value ? ns2.m(`fade-${placement.value}`) : ""
|
|
5974
6001
|
}, {
|
|
5975
6002
|
default: () => [createVNode(FlexibleOverlay, mergeProps({
|
|
5976
6003
|
"modelValue": visible.value,
|
|
@@ -5980,12 +6007,14 @@ var Popover = defineComponent({
|
|
|
5980
6007
|
"position": position.value,
|
|
5981
6008
|
"align": align.value,
|
|
5982
6009
|
"offset": offset2.value,
|
|
5983
|
-
"class": ["
|
|
6010
|
+
"class": [ns2.e("content"), popType.value !== "default" ? "is-icon" : ""],
|
|
5984
6011
|
"show-arrow": true,
|
|
5985
6012
|
"is-arrow-center": false,
|
|
5986
6013
|
"style": overlayStyles.value
|
|
5987
6014
|
}, attrs, {
|
|
5988
|
-
"onPositionChange": handlePositionChange
|
|
6015
|
+
"onPositionChange": handlePositionChange,
|
|
6016
|
+
"onMouseenter": onMouseenter,
|
|
6017
|
+
"onMouseleave": onMouseleave
|
|
5989
6018
|
}), {
|
|
5990
6019
|
default: () => {
|
|
5991
6020
|
var _a2;
|