vue-devui 1.0.0-rc.5 → 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 +22 -8
- 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 +72 -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 +29 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5548 -76
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +56 -29
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +48 -30
- package/checkbox/index.umd.js +1 -1
- package/checkbox/style.css +1 -1
- package/date-picker/index.es.js +91 -145
- 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 +39 -13
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +14 -14
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +958 -1200
- package/form/index.umd.js +18 -18
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +29 -5
- 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 +91 -145
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +27 -5
- package/input-number/index.umd.js +1 -1
- package/input-number/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/CheckboxGroup.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/formControlProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/treeProps.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 +135 -124
- 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 +76 -20
- 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 +34 -10
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/search/index.es.js +103 -153
- package/search/index.umd.js +14 -14
- 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 +52 -16
- 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 +6267 -536
- 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 +42 -15
- package/tooltip/index.umd.js +12 -12
- package/tooltip/style.css +1 -1
- package/{comment → tree}/index.d.ts +0 -0
- package/tree/index.es.js +1030 -0
- package/tree/index.umd.js +1 -0
- package/{comment → tree}/package.json +1 -1
- package/tree/style.css +1 -0
- 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 +5296 -4916
- package/vue-devui.umd.js +22 -22
- package/comment/index.es.js +0 -84
- package/comment/index.umd.js +0 -1
- package/comment/style.css +0 -1
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/commentProps.js +0 -3
- package/nuxt/components/readTipProps.js +0 -3
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -261
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
package/overlay/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 } 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 ns = useNamespace("overlay");
|
|
28
52
|
return () => {
|
|
29
53
|
let _slot;
|
|
30
54
|
return createVNode(Teleport, {
|
|
31
55
|
"to": "#d-overlay-anchor"
|
|
32
56
|
}, {
|
|
33
57
|
default: () => [createVNode(Transition, {
|
|
34
|
-
"name": "
|
|
58
|
+
"name": ns.e("fade")
|
|
35
59
|
}, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
|
|
36
60
|
default: () => [_slot]
|
|
37
61
|
})]
|
|
@@ -74,15 +98,12 @@ const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
|
74
98
|
});
|
|
75
99
|
const overlayEmits = ["update:visible", "backdropClick"];
|
|
76
100
|
function useOverlayLogic(props, ctx) {
|
|
101
|
+
const ns = useNamespace("overlay");
|
|
77
102
|
const backgroundClass = computed(() => {
|
|
78
|
-
return [
|
|
79
|
-
"devui-overlay-background",
|
|
80
|
-
props.backgroundClass,
|
|
81
|
-
!props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
|
|
82
|
-
];
|
|
103
|
+
return [ns.e("background"), props.backgroundClass, !props.hasBackdrop ? ns.em("background", "disabled") : ns.em("background", "color")];
|
|
83
104
|
});
|
|
84
105
|
const overlayClass = computed(() => {
|
|
85
|
-
return
|
|
106
|
+
return ns.b();
|
|
86
107
|
});
|
|
87
108
|
const handleBackdropClick = (event) => {
|
|
88
109
|
var _a;
|
|
@@ -292,6 +313,7 @@ const FlexibleOverlay = defineComponent({
|
|
|
292
313
|
emit,
|
|
293
314
|
expose
|
|
294
315
|
}) {
|
|
316
|
+
const ns = useNamespace("flexible-overlay");
|
|
295
317
|
const {
|
|
296
318
|
arrowRef,
|
|
297
319
|
overlayRef,
|
|
@@ -304,10 +326,10 @@ const FlexibleOverlay = defineComponent({
|
|
|
304
326
|
var _a;
|
|
305
327
|
return props.modelValue && createVNode("div", mergeProps({
|
|
306
328
|
"ref": overlayRef,
|
|
307
|
-
"class":
|
|
329
|
+
"class": ns.b()
|
|
308
330
|
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
|
|
309
331
|
"ref": arrowRef,
|
|
310
|
-
"class": "
|
|
332
|
+
"class": ns.e("arrow")
|
|
311
333
|
}, null)]);
|
|
312
334
|
};
|
|
313
335
|
}
|
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
|
});
|
|
@@ -490,8 +516,31 @@ var Pagination = defineComponent({
|
|
|
490
516
|
props: paginationProps,
|
|
491
517
|
emits: ["pageIndexChange", "pageSizeChange", "update:pageSize", "update:pageIndex"],
|
|
492
518
|
setup(props, {
|
|
493
|
-
emit
|
|
519
|
+
emit,
|
|
520
|
+
slots
|
|
494
521
|
}) {
|
|
522
|
+
const {
|
|
523
|
+
autoHide,
|
|
524
|
+
pageSizeOptions,
|
|
525
|
+
total,
|
|
526
|
+
canChangePageSize,
|
|
527
|
+
lite,
|
|
528
|
+
size,
|
|
529
|
+
pageSizeDirection,
|
|
530
|
+
showPageSelector,
|
|
531
|
+
canViewTotal,
|
|
532
|
+
totalItemText,
|
|
533
|
+
maxItems,
|
|
534
|
+
preLink,
|
|
535
|
+
nextLink,
|
|
536
|
+
showTruePageIndex,
|
|
537
|
+
canJumpPage,
|
|
538
|
+
goToText,
|
|
539
|
+
pageIndex,
|
|
540
|
+
showJumpButton,
|
|
541
|
+
haveConfigMenu
|
|
542
|
+
} = toRefs(props);
|
|
543
|
+
const ns = useNamespace("pagination");
|
|
495
544
|
const totalPages = computed(() => Math.ceil(props.total / props.pageSize));
|
|
496
545
|
const litePageOptions = computed(() => liteSelectOptions(totalPages.value));
|
|
497
546
|
const cursor = computed({
|
|
@@ -532,102 +581,64 @@ var Pagination = defineComponent({
|
|
|
532
581
|
const litePageIndexChange = (page) => {
|
|
533
582
|
changeCursorEmit(page.value);
|
|
534
583
|
};
|
|
535
|
-
return {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
584
|
+
return () => {
|
|
585
|
+
return autoHide.value && Math.min(...pageSizeOptions.value) > total.value ? null : createVNode("div", {
|
|
586
|
+
"class": ns.b()
|
|
587
|
+
}, [
|
|
588
|
+
canChangePageSize.value && !lite.value && createVNode("div", {
|
|
589
|
+
"class": [ns.e("size"), size.value ? ns.em("size", size.value) : ""]
|
|
590
|
+
}, [createVNode(resolveComponent("d-select"), {
|
|
591
|
+
"options": pageSizeOptions.value,
|
|
592
|
+
"modelValue": currentPageSize.value,
|
|
593
|
+
"onValueChange": pageSizeChange,
|
|
594
|
+
"pageSizeDirection": pageSizeDirection.value
|
|
595
|
+
}, null)]),
|
|
596
|
+
(!lite.value || lite.value && showPageSelector.value) && canViewTotal.value && createVNode("div", {
|
|
597
|
+
"class": ns.e("total-size")
|
|
598
|
+
}, [totalItemText.value, createTextVNode(": "), total.value]),
|
|
599
|
+
lite.value && showPageSelector.value && createVNode("div", {
|
|
600
|
+
"class": ns.e("size")
|
|
601
|
+
}, [createVNode(resolveComponent("d-select"), {
|
|
602
|
+
"options": litePageOptions.value,
|
|
603
|
+
"disabled": total.value === 0,
|
|
604
|
+
"modelValue": cursor.value,
|
|
605
|
+
"onValueChange": litePageIndexChange,
|
|
606
|
+
"pageSizeDirection": pageSizeDirection.value
|
|
607
|
+
}, null)]),
|
|
608
|
+
createVNode(resolveComponent("page-num-btn"), mergeProps({
|
|
609
|
+
cursor: cursor.value,
|
|
610
|
+
totalPages: totalPages.value,
|
|
611
|
+
size: size.value,
|
|
612
|
+
lite: lite.value,
|
|
613
|
+
maxItems: maxItems.value,
|
|
614
|
+
preLink: preLink.value,
|
|
615
|
+
nextLink: nextLink.value,
|
|
616
|
+
showTruePageIndex: showTruePageIndex.value
|
|
617
|
+
}, {
|
|
618
|
+
"onChangeCursorEmit": changeCursorEmit
|
|
619
|
+
}), null),
|
|
620
|
+
canJumpPage.value && !lite.value && createVNode(resolveComponent("jump-page"), mergeProps({
|
|
621
|
+
goToText: goToText.value,
|
|
622
|
+
size: size.value,
|
|
623
|
+
pageIndex: pageIndex.value,
|
|
624
|
+
totalPages: totalPages.value,
|
|
625
|
+
cursor: cursor.value,
|
|
626
|
+
showJumpButton: showJumpButton.value
|
|
627
|
+
}, {
|
|
628
|
+
"onChangeCursorEmit": changeCursorEmit
|
|
629
|
+
}), null),
|
|
630
|
+
lite.value && haveConfigMenu.value && createVNode(resolveComponent("config-menu"), {
|
|
631
|
+
currentPageSize: currentPageSize.value,
|
|
632
|
+
pageSizeChange,
|
|
633
|
+
pageSizeOptions: pageSizeOptions.value
|
|
634
|
+
}, {
|
|
635
|
+
default: () => {
|
|
636
|
+
var _a;
|
|
637
|
+
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
|
638
|
+
}
|
|
639
|
+
})
|
|
640
|
+
]);
|
|
543
641
|
};
|
|
544
|
-
},
|
|
545
|
-
render() {
|
|
546
|
-
const {
|
|
547
|
-
total,
|
|
548
|
-
pageIndex,
|
|
549
|
-
pageSizeOptions,
|
|
550
|
-
pageSizeDirection,
|
|
551
|
-
preLink,
|
|
552
|
-
nextLink,
|
|
553
|
-
size,
|
|
554
|
-
canJumpPage,
|
|
555
|
-
canChangePageSize,
|
|
556
|
-
canViewTotal,
|
|
557
|
-
totalItemText,
|
|
558
|
-
goToText,
|
|
559
|
-
maxItems,
|
|
560
|
-
showJumpButton,
|
|
561
|
-
showTruePageIndex,
|
|
562
|
-
lite,
|
|
563
|
-
showPageSelector,
|
|
564
|
-
haveConfigMenu,
|
|
565
|
-
autoHide,
|
|
566
|
-
$slots,
|
|
567
|
-
cursor,
|
|
568
|
-
totalPages,
|
|
569
|
-
currentPageSize,
|
|
570
|
-
pageSizeChange,
|
|
571
|
-
changeCursorEmit,
|
|
572
|
-
litePageOptions,
|
|
573
|
-
litePageIndexChange
|
|
574
|
-
} = this;
|
|
575
|
-
return autoHide && Math.min(...pageSizeOptions) > total ? null : createVNode("div", {
|
|
576
|
-
"class": "devui-pagination"
|
|
577
|
-
}, [
|
|
578
|
-
canChangePageSize && !lite && createVNode("div", {
|
|
579
|
-
"class": ["devui-page-size", size ? "devui-page-size-" + size : ""]
|
|
580
|
-
}, [createVNode(resolveComponent("d-select"), {
|
|
581
|
-
"options": pageSizeOptions,
|
|
582
|
-
"modelValue": currentPageSize,
|
|
583
|
-
"onValueChange": pageSizeChange,
|
|
584
|
-
"pageSizeDirection": pageSizeDirection
|
|
585
|
-
}, null)]),
|
|
586
|
-
(!lite || lite && showPageSelector) && canViewTotal && createVNode("div", {
|
|
587
|
-
"class": "devui-total-size"
|
|
588
|
-
}, [totalItemText, createTextVNode(": "), total]),
|
|
589
|
-
lite && showPageSelector && createVNode("div", {
|
|
590
|
-
"class": "devui-page-size"
|
|
591
|
-
}, [createVNode(resolveComponent("d-select"), {
|
|
592
|
-
"options": litePageOptions,
|
|
593
|
-
"disabled": total === 0,
|
|
594
|
-
"modelValue": cursor,
|
|
595
|
-
"onValueChange": litePageIndexChange,
|
|
596
|
-
"pageSizeDirection": pageSizeDirection
|
|
597
|
-
}, null)]),
|
|
598
|
-
createVNode(resolveComponent("page-num-btn"), mergeProps({
|
|
599
|
-
cursor,
|
|
600
|
-
totalPages,
|
|
601
|
-
size,
|
|
602
|
-
lite,
|
|
603
|
-
maxItems,
|
|
604
|
-
preLink,
|
|
605
|
-
nextLink,
|
|
606
|
-
showTruePageIndex
|
|
607
|
-
}, {
|
|
608
|
-
"onChangeCursorEmit": changeCursorEmit
|
|
609
|
-
}), null),
|
|
610
|
-
canJumpPage && !lite && createVNode(resolveComponent("jump-page"), mergeProps({
|
|
611
|
-
goToText,
|
|
612
|
-
size,
|
|
613
|
-
pageIndex,
|
|
614
|
-
totalPages,
|
|
615
|
-
cursor,
|
|
616
|
-
showJumpButton
|
|
617
|
-
}, {
|
|
618
|
-
"onChangeCursorEmit": changeCursorEmit
|
|
619
|
-
}), null),
|
|
620
|
-
lite && haveConfigMenu && createVNode(resolveComponent("config-menu"), {
|
|
621
|
-
currentPageSize,
|
|
622
|
-
pageSizeChange,
|
|
623
|
-
pageSizeOptions
|
|
624
|
-
}, {
|
|
625
|
-
default: () => {
|
|
626
|
-
var _a;
|
|
627
|
-
return [(_a = $slots.default) == null ? void 0 : _a.call($slots)];
|
|
628
|
-
}
|
|
629
|
-
})
|
|
630
|
-
]);
|
|
631
642
|
}
|
|
632
643
|
});
|
|
633
644
|
var index = {
|
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"});
|