vue-devui 1.0.0-pre.0 → 1.0.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/README.md +149 -187
  2. package/alert/index.es.js +74 -45
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8182 -296
  6. package/auto-complete/index.umd.js +29 -1
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +153 -146
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +30 -5
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5741 -127
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +59 -35
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8060 -255
  21. package/checkbox/index.umd.js +27 -1
  22. package/checkbox/style.css +1 -1
  23. package/{accordion → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +379 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{anchor → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +5 -7
  29. package/countdown/index.umd.js +1 -1
  30. package/date-picker/index.es.js +8159 -288
  31. package/date-picker/index.umd.js +27 -1
  32. package/date-picker/style.css +1 -1
  33. package/drawer/index.es.js +31 -4
  34. package/drawer/index.umd.js +1 -1
  35. package/drawer/style.css +1 -1
  36. package/dropdown/index.es.js +297 -181
  37. package/dropdown/index.umd.js +1 -1
  38. package/dropdown/style.css +1 -1
  39. package/editable-select/index.es.js +525 -154
  40. package/editable-select/index.umd.js +1 -1
  41. package/editable-select/style.css +1 -1
  42. package/form/index.es.js +1039 -1175
  43. package/form/index.umd.js +15 -15
  44. package/form/style.css +1 -1
  45. package/fullscreen/index.es.js +42 -21
  46. package/fullscreen/index.umd.js +1 -1
  47. package/fullscreen/style.css +1 -1
  48. package/grid/index.es.js +101 -86
  49. package/grid/index.umd.js +1 -1
  50. package/grid/style.css +1 -1
  51. package/icon/index.es.js +197 -56
  52. package/icon/index.umd.js +1 -1
  53. package/icon/style.css +1 -0
  54. package/image-preview/index.es.js +55 -31
  55. package/image-preview/index.umd.js +1 -1
  56. package/image-preview/style.css +1 -1
  57. package/input/index.es.js +8066 -144
  58. package/input/index.umd.js +27 -1
  59. package/input/style.css +1 -1
  60. package/input-number/index.es.js +269 -183
  61. package/input-number/index.umd.js +1 -1
  62. package/input-number/style.css +1 -1
  63. package/layout/index.es.js +40 -25
  64. package/layout/index.umd.js +1 -1
  65. package/layout/style.css +1 -1
  66. package/loading/index.es.js +74 -35
  67. package/loading/index.umd.js +1 -1
  68. package/loading/style.css +1 -1
  69. package/modal/index.es.js +412 -204
  70. package/modal/index.umd.js +1 -1
  71. package/modal/style.css +1 -1
  72. package/notification/index.es.js +307 -57
  73. package/notification/index.umd.js +1 -1
  74. package/notification/style.css +1 -1
  75. package/nuxt/components/ButtonGroup.js +3 -0
  76. package/nuxt/components/CheckboxButton.js +3 -0
  77. package/nuxt/components/CheckboxGroup.js +3 -0
  78. package/nuxt/components/Collapse.js +3 -0
  79. package/nuxt/components/CollapseItem.js +3 -0
  80. package/nuxt/components/DropdownPropsKey.js +3 -0
  81. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  82. package/nuxt/components/FORM_TOKEN.js +3 -0
  83. package/nuxt/components/Icon.js +1 -0
  84. package/nuxt/components/IconGroup.js +3 -0
  85. package/nuxt/components/LABEL_DATA.js +3 -0
  86. package/nuxt/components/LoadingOptions.js +3 -0
  87. package/nuxt/components/Option.js +3 -0
  88. package/nuxt/components/PanelBody.js +3 -0
  89. package/nuxt/components/PanelFooter.js +3 -0
  90. package/nuxt/components/PanelHeader.js +3 -0
  91. package/nuxt/components/RadioButton.js +3 -0
  92. package/nuxt/components/Tab.js +3 -0
  93. package/nuxt/components/Timeline.js +3 -0
  94. package/nuxt/components/TimelineItem.js +3 -0
  95. package/nuxt/components/alertProps.js +3 -0
  96. package/nuxt/components/autoCompleteProps.js +3 -0
  97. package/nuxt/components/avatarProps.js +3 -0
  98. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  99. package/nuxt/components/buttonGroupProps.js +3 -0
  100. package/nuxt/components/cardProps.js +3 -0
  101. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  102. package/nuxt/components/checkboxGroupProps.js +3 -0
  103. package/nuxt/components/checkboxProps.js +3 -0
  104. package/nuxt/components/colProps.js +3 -0
  105. package/nuxt/components/colPropsBaseClass.js +3 -0
  106. package/nuxt/components/colPropsBaseStyle.js +3 -0
  107. package/nuxt/components/collapseItemProps.js +3 -0
  108. package/nuxt/components/collapseProps.js +3 -0
  109. package/nuxt/components/countdownProps.js +3 -0
  110. package/nuxt/components/editableSelectProps.js +3 -0
  111. package/nuxt/components/formItemProps.js +3 -0
  112. package/nuxt/components/formProps.js +3 -0
  113. package/nuxt/components/fullscreenProps.js +3 -0
  114. package/nuxt/components/iconProps.js +3 -0
  115. package/nuxt/components/imagePreviewProps.js +3 -0
  116. package/nuxt/components/inputProps.js +3 -0
  117. package/nuxt/components/loadingProps.js +3 -0
  118. package/nuxt/components/modalProps.js +3 -0
  119. package/nuxt/components/paginationProps.js +3 -0
  120. package/nuxt/components/panelProps.js +3 -0
  121. package/nuxt/components/progressProps.js +3 -0
  122. package/nuxt/components/rateProps.js +3 -0
  123. package/nuxt/components/resultProps.js +3 -0
  124. package/nuxt/components/rowProps.js +3 -0
  125. package/nuxt/components/screenSizes.js +3 -0
  126. package/nuxt/components/searchProps.js +3 -0
  127. package/nuxt/components/skeletonProps.js +3 -0
  128. package/nuxt/components/sliderProps.js +3 -0
  129. package/nuxt/components/splitterProps.js +3 -0
  130. package/nuxt/components/statisticProps.js +3 -0
  131. package/nuxt/components/svgIconProps.js +3 -0
  132. package/nuxt/components/switchProps.js +3 -0
  133. package/nuxt/components/tabsProps.js +3 -0
  134. package/nuxt/components/tagProps.js +3 -0
  135. package/nuxt/components/textareaProps.js +3 -0
  136. package/nuxt/components/timeAxisProps.js +3 -0
  137. package/nuxt/components/treeProps.js +3 -0
  138. package/overlay/index.es.js +127 -149
  139. package/overlay/index.umd.js +1 -1
  140. package/overlay/style.css +1 -1
  141. package/package.json +10 -44
  142. package/pagination/index.es.js +158 -148
  143. package/pagination/index.umd.js +1 -1
  144. package/pagination/style.css +1 -1
  145. package/panel/index.es.js +45 -32
  146. package/panel/index.umd.js +1 -1
  147. package/panel/style.css +1 -1
  148. package/popover/index.es.js +317 -246
  149. package/popover/index.umd.js +15 -15
  150. package/popover/style.css +1 -1
  151. package/progress/index.es.js +110 -56
  152. package/progress/index.umd.js +3 -3
  153. package/progress/style.css +1 -1
  154. package/radio/index.es.js +7964 -157
  155. package/radio/index.umd.js +27 -1
  156. package/radio/style.css +1 -1
  157. package/rate/index.es.js +77 -55
  158. package/rate/index.umd.js +1 -1
  159. package/rate/style.css +1 -1
  160. package/result/index.es.js +184 -57
  161. package/result/index.umd.js +1 -1
  162. package/result/style.css +1 -1
  163. package/ripple/index.es.js +47 -42
  164. package/ripple/index.umd.js +1 -1
  165. package/search/index.es.js +3644 -1122
  166. package/search/index.umd.js +18 -18
  167. package/search/style.css +1 -1
  168. package/select/index.es.js +9144 -597
  169. package/select/index.umd.js +27 -1
  170. package/select/style.css +1 -1
  171. package/skeleton/index.es.js +63 -41
  172. package/skeleton/index.umd.js +1 -1
  173. package/skeleton/style.css +1 -1
  174. package/slider/index.es.js +109 -75
  175. package/slider/index.umd.js +1 -1
  176. package/slider/style.css +1 -1
  177. package/splitter/index.es.js +469 -349
  178. package/splitter/index.umd.js +15 -15
  179. package/splitter/style.css +1 -1
  180. package/statistic/index.es.js +7 -18
  181. package/statistic/index.umd.js +1 -1
  182. package/status/index.es.js +27 -6
  183. package/status/index.umd.js +1 -1
  184. package/status/style.css +1 -1
  185. package/style.css +1 -1
  186. package/switch/index.es.js +7794 -64
  187. package/switch/index.umd.js +27 -1
  188. package/switch/style.css +1 -1
  189. package/table/index.es.js +10119 -1206
  190. package/table/index.umd.js +27 -1
  191. package/table/style.css +1 -1
  192. package/tabs/index.es.js +342 -141
  193. package/tabs/index.umd.js +1 -1
  194. package/tabs/style.css +1 -1
  195. package/tag/index.es.js +49 -24
  196. package/tag/index.umd.js +1 -1
  197. package/tag/style.css +1 -1
  198. package/textarea/index.es.js +7913 -83
  199. package/textarea/index.umd.js +35 -1
  200. package/textarea/style.css +1 -1
  201. package/{anchor → timeline}/index.d.ts +0 -0
  202. package/timeline/index.es.js +425 -0
  203. package/timeline/index.umd.js +1 -0
  204. package/{back-top → timeline}/package.json +1 -1
  205. package/timeline/style.css +1 -0
  206. package/tooltip/index.es.js +308 -236
  207. package/tooltip/index.umd.js +15 -15
  208. package/tooltip/style.css +1 -1
  209. package/tree/index.es.js +4189 -1851
  210. package/tree/index.umd.js +18 -18
  211. package/tree/style.css +1 -1
  212. package/upload/index.es.js +380 -123
  213. package/upload/index.umd.js +1 -1
  214. package/upload/style.css +1 -1
  215. package/vue-devui.es.js +18121 -23161
  216. package/vue-devui.umd.js +25 -15
  217. package/accordion/index.es.js +0 -720
  218. package/accordion/index.umd.js +0 -1
  219. package/accordion/package.json +0 -7
  220. package/accordion/style.css +0 -1
  221. package/anchor/index.es.js +0 -263
  222. package/anchor/index.umd.js +0 -1
  223. package/anchor/style.css +0 -1
  224. package/back-top/index.d.ts +0 -7
  225. package/back-top/index.es.js +0 -128
  226. package/back-top/index.umd.js +0 -1
  227. package/back-top/style.css +0 -1
  228. package/breadcrumb/index.d.ts +0 -7
  229. package/breadcrumb/index.es.js +0 -127
  230. package/breadcrumb/index.umd.js +0 -1
  231. package/breadcrumb/package.json +0 -7
  232. package/breadcrumb/style.css +0 -1
  233. package/carousel/index.d.ts +0 -7
  234. package/carousel/index.es.js +0 -329
  235. package/carousel/index.umd.js +0 -1
  236. package/carousel/package.json +0 -7
  237. package/carousel/style.css +0 -1
  238. package/cascader/index.d.ts +0 -7
  239. package/cascader/index.es.js +0 -5963
  240. package/cascader/index.umd.js +0 -27
  241. package/cascader/package.json +0 -7
  242. package/cascader/style.css +0 -1
  243. package/color-picker/index.d.ts +0 -7
  244. package/color-picker/index.es.js +0 -8187
  245. package/color-picker/index.umd.js +0 -27
  246. package/color-picker/package.json +0 -7
  247. package/color-picker/style.css +0 -1
  248. package/comment/index.d.ts +0 -7
  249. package/comment/index.es.js +0 -86
  250. package/comment/index.umd.js +0 -1
  251. package/comment/package.json +0 -7
  252. package/comment/style.css +0 -1
  253. package/dragdrop/index.d.ts +0 -7
  254. package/dragdrop/index.es.js +0 -157
  255. package/dragdrop/index.umd.js +0 -1
  256. package/dragdrop/package.json +0 -7
  257. package/gantt/index.d.ts +0 -7
  258. package/gantt/index.es.js +0 -523
  259. package/gantt/index.umd.js +0 -1
  260. package/gantt/package.json +0 -7
  261. package/gantt/style.css +0 -1
  262. package/input-icon/index.d.ts +0 -7
  263. package/input-icon/index.es.js +0 -331
  264. package/input-icon/index.umd.js +0 -1
  265. package/input-icon/package.json +0 -7
  266. package/input-icon/style.css +0 -1
  267. package/list/index.d.ts +0 -7
  268. package/list/index.es.js +0 -39
  269. package/list/index.umd.js +0 -1
  270. package/list/package.json +0 -7
  271. package/list/style.css +0 -1
  272. package/nav-sprite/index.d.ts +0 -7
  273. package/nav-sprite/index.es.js +0 -68
  274. package/nav-sprite/index.umd.js +0 -1
  275. package/nav-sprite/package.json +0 -7
  276. package/nuxt/components/Accordion.js +0 -3
  277. package/nuxt/components/Anchor.js +0 -3
  278. package/nuxt/components/BackTop.js +0 -3
  279. package/nuxt/components/Breadcrumb.js +0 -3
  280. package/nuxt/components/Carousel.js +0 -3
  281. package/nuxt/components/CarouselItem.js +0 -3
  282. package/nuxt/components/Cascader.js +0 -3
  283. package/nuxt/components/ColorPicker.js +0 -3
  284. package/nuxt/components/Comment.js +0 -3
  285. package/nuxt/components/FormControl.js +0 -3
  286. package/nuxt/components/FormLabel.js +0 -3
  287. package/nuxt/components/Gantt.js +0 -3
  288. package/nuxt/components/InputIcon.js +0 -3
  289. package/nuxt/components/List.js +0 -3
  290. package/nuxt/components/ListItem.js +0 -3
  291. package/nuxt/components/NavSprite.js +0 -2
  292. package/nuxt/components/QuadrantDiagram.js +0 -3
  293. package/nuxt/components/ReadTip.js +0 -3
  294. package/nuxt/components/StepsGuide.js +0 -3
  295. package/nuxt/components/Sticky.js +0 -2
  296. package/nuxt/components/TagInput.js +0 -3
  297. package/nuxt/components/TimeAxis.js +0 -3
  298. package/nuxt/components/TimeAxisItem.js +0 -3
  299. package/nuxt/components/TimePicker.js +0 -3
  300. package/nuxt/components/Transfer.js +0 -3
  301. package/nuxt/components/TreeSelect.js +0 -3
  302. package/nuxt/components/overlayEmits.js +0 -3
  303. package/nuxt/components/overlayProps.js +0 -3
  304. package/quadrant-diagram/index.d.ts +0 -7
  305. package/quadrant-diagram/index.es.js +0 -5728
  306. package/quadrant-diagram/index.umd.js +0 -27
  307. package/quadrant-diagram/package.json +0 -7
  308. package/quadrant-diagram/style.css +0 -1
  309. package/read-tip/index.d.ts +0 -7
  310. package/read-tip/index.es.js +0 -258
  311. package/read-tip/index.umd.js +0 -1
  312. package/read-tip/package.json +0 -7
  313. package/read-tip/style.css +0 -1
  314. package/steps-guide/index.d.ts +0 -7
  315. package/steps-guide/index.es.js +0 -239
  316. package/steps-guide/index.umd.js +0 -1
  317. package/steps-guide/package.json +0 -7
  318. package/steps-guide/style.css +0 -1
  319. package/sticky/index.d.ts +0 -7
  320. package/sticky/index.es.js +0 -197
  321. package/sticky/index.umd.js +0 -1
  322. package/sticky/package.json +0 -7
  323. package/tag-input/index.d.ts +0 -7
  324. package/tag-input/index.es.js +0 -329
  325. package/tag-input/index.umd.js +0 -1
  326. package/tag-input/package.json +0 -7
  327. package/tag-input/style.css +0 -1
  328. package/time-axis/index.d.ts +0 -7
  329. package/time-axis/index.es.js +0 -299
  330. package/time-axis/index.umd.js +0 -1
  331. package/time-axis/package.json +0 -7
  332. package/time-axis/style.css +0 -1
  333. package/time-picker/index.d.ts +0 -7
  334. package/time-picker/index.es.js +0 -1237
  335. package/time-picker/index.umd.js +0 -1
  336. package/time-picker/package.json +0 -7
  337. package/time-picker/style.css +0 -1
  338. package/transfer/index.d.ts +0 -7
  339. package/transfer/index.es.js +0 -7608
  340. package/transfer/index.umd.js +0 -27
  341. package/transfer/package.json +0 -7
  342. package/transfer/style.css +0 -1
  343. package/tree-select/index.d.ts +0 -7
  344. package/tree-select/index.es.js +0 -623
  345. package/tree-select/index.umd.js +0 -1
  346. package/tree-select/package.json +0 -7
  347. package/tree-select/style.css +0 -1
@@ -1 +1 @@
1
- var _=Object.defineProperty,R=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var x=(n,e,a)=>e in n?_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[e]=a,B=(n,e)=>{for(var a in e||(e={}))$.call(e,a)&&x(n,a,e[a]);if(O)for(var a of O(e))z.call(e,a)&&x(n,a,e[a]);return n},E=(n,e)=>R(n,T(e));(function(n,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):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.index={},n.Vue,n.dom))})(this,function(n,e,a){"use strict";var D="";function P(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const S=e.defineComponent({setup(t,l){return()=>{let r;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},P(r=e.renderSlot(l.slots,"default"))?r:{default:()=>[r]})]})}}}),g={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}},p=["update:visible","backdropClick"],h=E(B({},g),{overlayStyle:{type:[String,Object],default:void 0}}),k={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 V(t,l){const r=e.computed(()=>["devui-overlay-background",t.backgroundClass,t.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),d=e.computed(()=>"devui-overlay"),c=o=>{var s;o.preventDefault(),(s=t.onBackdropClick)==null||s.call(t),t.backdropClose&&l.emit("update:visible",!1)},i=o=>o.cancelBubble=!0;return e.onMounted(()=>{const o=document.body,s=o.style.overflow,y=o.style.position;e.watch([()=>t.visible,()=>t.backgroundBlock],([u,v])=>{if(v){const f=o.getBoundingClientRect().y;u?(o.style.overflowY="scroll",o.style.position=u?"fixed":"",o.style.top=`${f}px`):(o.style.overflowY=s,o.style.position=y,o.style.top="",window.scrollTo(0,-f))}}),e.onUnmounted(()=>{document.body.style.overflow=s})}),{backgroundClass:r,overlayClass:d,handleBackdropClick:c,handleOverlayBubbleCancel:i}}const m=e.defineComponent({name:"DFixedOverlay",props:h,emits:p,setup(t,l){const{backgroundClass:r,overlayClass:d,handleBackdropClick:c,handleOverlayBubbleCancel:i}=V(t,l);return()=>e.createVNode(S,null,{default:()=>[t.visible&&e.createVNode("div",{class:r.value,style:t.backgroundStyle,onClick:c},[e.createVNode("div",{class:d.value,style:t.overlayStyle,onClick:i},[e.renderSlot(l.slots,"default")])])]})}});function C(t){const l=/(auto|scroll|hidden)/;for(let r=t;r=r.parentElement;r.parentElement!==document.body){const d=window.getComputedStyle(r);if(l.test(d.overflow+d.overflowX+d.overflowY))return r}return window}function A(t,l,r,d){let{x:c,y:i}=l;if(!t){const{width:o,height:s}=d;c&&r.includes("start")&&(c=12),c&&r.includes("end")&&(c=Math.round(o-24)),i&&r.includes("start")&&(i=10),i&&r.includes("end")&&(i=s-14)}return{x:c,y:i}}function j(t,l){const r=e.ref(),d=e.ref(),c=(o,s,y,u)=>{const{x:v,y:f}=A(t.isArrowCenter,y,s,u.getBoundingClientRect()),w={top:"bottom",right:"left",bottom:"top",left:"right"}[s.split("-")[0]];Object.assign(o.style,{left:v?`${v}px`:"",top:f?`${f}px`:"",right:"",bottom:"",[w]:"-4px"})},i=async()=>{const o=t.origin,s=e.unref(r.value),y=e.unref(d.value),u=[a.offset(t.offset),a.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&u.push(a.arrow({element:y}));const{x:v,y:f,placement:w,middlewareData:F}=await a.computePosition(o,s,{strategy:"fixed",middleware:u});l("positionChange",w),Object.assign(s.style,{top:`${f}px`,left:`${v}px`}),t.showArrow&&c(y,w,F.arrow,s)};return e.watch(()=>t.modelValue,()=>{const o=C(t.origin);t.modelValue&&t.origin?(e.nextTick(i),o.addEventListener("scroll",i),o!==window&&window.addEventListener("scroll",i),window.addEventListener("resize",i)):(o.removeEventListener("scroll",i),o!==window&&window.removeEventListener("scroll",i),window.removeEventListener("resize",i))}),e.onUnmounted(()=>{const o=C(t.origin);o.removeEventListener("scroll",i),o!==window&&window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}),{arrowRef:d,overlayRef:r}}var M="";const b=e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:k,emits:["update:modelValue","positionChange"],setup(t,{slots:l,attrs:r,emit:d}){const{arrowRef:c,overlayRef:i}=j(t,d);return()=>{var o;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:i,class:"devui-flexible-overlay"},r),[(o=l.default)==null?void 0:o.call(l),t.showArrow&&e.createVNode("div",{ref:c,class:"devui-flexible-overlay-arrow"},null)])}}}),L=typeof window!="undefined";var N={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(t){if(t.component(m.name,m),t.component(b.name,b),L&&!document.getElementById("d-overlay-anchor")){const l=document.createElement("div");l.setAttribute("id","d-overlay-anchor"),l.style.position="fixed",l.style.left="0",l.style.top="0",l.style.zIndex="1000",document.body.appendChild(l)}}};n.FixedOverlay=m,n.FlexibleOverlay=b,n.default=N,n.fixedOverlayProps=h,n.flexibleOverlayProps=k,n.overlayEmits=p,n.overlayProps=g,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
1
+ (function(a,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],l):(a=typeof globalThis!="undefined"?globalThis:a||self,l(a.index={},a.Vue,a.dom))})(this,function(a,l,f){"use strict";const b={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function P(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const e=document.documentElement.scrollTop,t=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${e}px`,document.documentElement.style.width=document.documentElement.style.width||"100%",document.documentElement.style.overflowY="scroll",()=>{t?document.documentElement.setAttribute("style",t):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=e}}}function k(e,t){let n;const i=s=>{s.preventDefault(),t.emit("click",s),e.closeOnClickOverlay&&t.emit("update:modelValue",!1)},o=()=>{n==null||n()};return l.watch(()=>e.modelValue,s=>{s?e.lockScroll&&(n=P()):o()}),l.onUnmounted(o),{onClick:i}}function y(e,t,n){let i=e;return t&&(i+=`__${t}`),n&&(i+=`--${n}`),i}function g(e,t=!1){const n=t?`.devui-${e}`:`devui-${e}`;return{b:()=>y(n),e:d=>d?y(n,d):"",m:d=>d?y(n,"",d):"",em:(d,c)=>d&&c?y(n,d,c):""}}var j="";const O=l.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:b,emits:["update:modelValue","click"],setup(e,t){const{modelValue:n}=l.toRefs(e),i=g("fixed-overlay"),{onClick:o}=k(e,t);return()=>l.createVNode(l.Transition,{name:i.m("fade")},{default:()=>{var s,r;return[n.value&&l.createVNode("div",l.mergeProps({class:i.b()},t.attrs,{onClick:o}),[(r=(s=t.slots).default)==null?void 0:r.call(s)])]}})}}),A={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 L(e){const t=/(auto|scroll|hidden)/;for(let n=e;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 $(e,t,n,i){let{x:o,y:s}=t;if(!e){const{width:r,height:d}=i;o&&n.includes("start")&&(o=12),o&&n.includes("end")&&(o=Math.round(r-24)),s&&n.includes("start")&&(s=10),s&&n.includes("end")&&(s=d-14)}return{x:o,y:s}}function F(e,t){const n=l.ref(),i=l.ref();let o=null;const s=(d,c,u,m)=>{const{x:w,y:v}=$(e.isArrowCenter,u,c,m.getBoundingClientRect()),h={top:"bottom",right:"left",bottom:"top",left:"right"}[c.split("-")[0]];Object.assign(d.style,{left:w?`${w}px`:"",top:v?`${v}px`:"",right:"",bottom:"",[h]:"-4px"})},r=async()=>{const d=e.origin,c=l.unref(n.value),u=l.unref(i.value),m=[f.offset(e.offset),f.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&m.push(f.arrow({element:u})),e.shiftOffset!==void 0&&m.push(f.shift());const{x:w,y:v,placement:h,middlewareData:V}=await f.computePosition(d,c,{strategy:"fixed",middleware:m});let p=w,x=v;if(e.shiftOffset!==void 0){const{x:C,y:B}=V.shift;C<0&&(p-=e.shiftOffset),C>0&&(p+=e.shiftOffset),B<0&&(x-=e.shiftOffset),B>0&&(x+=e.shiftOffset)}t("positionChange",h),Object.assign(c.style,{top:`${x}px`,left:`${p}px`}),e.showArrow&&s(u,h,V.arrow,c)};return l.watch(()=>e.modelValue,()=>{e.modelValue&&e.origin?(o=L(e.origin),l.nextTick(r),o==null||o.addEventListener("scroll",r),o!==window&&window.addEventListener("scroll",r),window.addEventListener("resize",r)):(o==null||o.removeEventListener("scroll",r),o!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r))}),l.onUnmounted(()=>{o==null||o.removeEventListener("scroll",r),o!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r)}),{arrowRef:i,overlayRef:n,updatePosition:r}}var N="";const E=l.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:A,emits:["update:modelValue","positionChange"],setup(e,{slots:t,attrs:n,emit:i,expose:o}){const s=g("flexible-overlay"),{arrowRef:r,overlayRef:d,updatePosition:c}=F(e,i);return o({updatePosition:c}),()=>{var u;return e.modelValue&&l.createVNode("div",l.mergeProps({ref:d,class:s.b()},n),[(u=t.default)==null?void 0:u.call(t),e.showArrow&&l.createVNode("div",{ref:r,class:s.e("arrow")},null)])}}}),S=typeof window!="undefined";var T={title:"Overlay \u906E\u7F69\u5C42",category:"\u901A\u7528",status:"100%",install(e){if(e.component(O.name,O),e.component(E.name,E),S&&!document.getElementById("d-overlay-anchor")){const t=document.createElement("div");t.setAttribute("id","d-overlay-anchor"),t.style.position="fixed",t.style.left="0",t.style.top="0",t.style.zIndex="1000",document.body.appendChild(t)}}};a.FixedOverlay=O,a.FlexibleOverlay=E,a.default=T,a.fixedOverlayProps=b,a.flexibleOverlayProps=A,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
package/overlay/style.css CHANGED
@@ -1 +1 @@
1
- .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}@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-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(0, 0, 0, .2));z-index:1000}.devui-flexible-overlay-arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}
1
+ .devui-fixed-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1050}.devui-fixed-overlay--fade-enter-active,.devui-fixed-overlay--fade-leave-active{transition:opacity .1s cubic-bezier(0,0,1,1)}.devui-fixed-overlay--fade-enter-from,.devui-fixed-overlay--fade-leave-to{opacity:0}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 4px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-length-connected-overlay, 0 4px 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-devui",
3
- "version": "1.0.0-pre.0",
3
+ "version": "1.0.0-rc.10",
4
4
  "license": "MIT",
5
5
  "description": "DevUI components based on Vite and Vue3",
6
6
  "keywords": [
@@ -15,61 +15,27 @@
15
15
  "jsx",
16
16
  "devui"
17
17
  ],
18
+ "homepage": "https://vue-devui.github.io/",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git@github.com:DevCloudFE/vue-devui.git"
22
+ },
18
23
  "main": "vue-devui.umd.js",
19
24
  "module": "vue-devui.es.js",
20
25
  "style": "style.css",
21
26
  "dependencies": {
22
27
  "@devui-design/icons": "^1.3.0",
23
- "@floating-ui/dom": "^0.4.0",
28
+ "@floating-ui/dom": "^0.4.4",
24
29
  "@types/lodash-es": "^4.17.4",
30
+ "@vue/shared": "^3.2.33",
25
31
  "@vueuse/core": "^7.7.1",
26
32
  "async-validator": "^4.0.2",
27
- "devui-theme": "workspace:^0.0.1",
33
+ "devui-theme": "^0.0.1",
28
34
  "fs-extra": "^10.0.0",
29
35
  "lodash": "^4.17.21",
30
36
  "lodash-es": "^4.17.20",
31
37
  "mitt": "^3.0.0",
32
38
  "vue": "^3.1.1",
33
39
  "vue-router": "^4.0.3"
34
- },
35
- "devDependencies": {
36
- "@babel/parser": "^7.15.5",
37
- "@babel/preset-env": "^7.14.5",
38
- "@babel/preset-typescript": "^7.14.5",
39
- "@babel/traverse": "^7.15.4",
40
- "@commitlint/cli": "^11.0.0",
41
- "@commitlint/config-conventional": "^11.0.0",
42
- "@docsearch/css": "^3.0.0-alpha.50",
43
- "@docsearch/js": "^3.0.0-alpha.50",
44
- "@types/chalk": "^2.2.0",
45
- "@types/commander": "^2.12.2",
46
- "@types/jest": "^26.0.23",
47
- "@types/ora": "^3.2.0",
48
- "@typescript-eslint/eslint-plugin": "^4.27.0",
49
- "@typescript-eslint/parser": "^4.27.0",
50
- "@vitejs/plugin-vue": "^1.3.0",
51
- "@vitejs/plugin-vue-jsx": "^1.1.0",
52
- "@vue/babel-plugin-jsx": "^1.0.6",
53
- "@vue/compiler-sfc": "^3.0.5",
54
- "@vue/test-utils": "^2.0.0-rc.9",
55
- "@vuedx/typecheck": "^0.4.1",
56
- "@vuedx/typescript-plugin-vue": "^0.4.1",
57
- "babel-jest": "^27.0.2",
58
- "chalk": "^4.1.2",
59
- "commander": "^8.1.0",
60
- "devui-cli": "workspace:^0.0.2",
61
- "inquirer": "^8.1.2",
62
- "jest": "^27.0.4",
63
- "ora": "^5.4.1",
64
- "patch-vue-directive-ssr": "^0.0.1",
65
- "sass": "^1.32.2",
66
- "shelljs": "^0.8.4",
67
- "typescript": "^4.3.2",
68
- "vite": "^2.4.4",
69
- "vite-plugin-md": "^0.6.0",
70
- "vite-svg-loader": "^2.2.0",
71
- "vitepress": "0.20.1",
72
- "vitepress-theme-demoblock": "1.3.2",
73
- "vue-tsc": "^0.2.2"
74
40
  }
75
- }
41
+ }
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, onMounted, onUnmounted, withDirectives, createVNode, createTextVNode, resolveDirective, toRefs, watch, resolveComponent, computed, Fragment, mergeProps, nextTick } from "vue";
2
- const componentProps = {
2
+ const paginationProps = {
3
3
  pageSize: {
4
4
  type: Number,
5
5
  default: 10
@@ -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, needDot = false) {
204
+ const namespace = needDot ? `.devui-${block}` : `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
@@ -202,15 +225,15 @@ var ConfigMenu = defineComponent({
202
225
  setup() {
203
226
  const paginationConfig = ref(null);
204
227
  const isShowConfig = ref(false);
228
+ const closeConfigMenu = (e) => {
229
+ isShowConfig.value = isShowConfig.value ? false : !!e;
230
+ };
205
231
  onMounted(() => {
206
232
  on(paginationConfig.value, "click", closeConfigMenu);
207
233
  });
208
234
  onUnmounted(() => {
209
235
  off(paginationConfig.value, "click", closeConfigMenu);
210
236
  });
211
- const closeConfigMenu = (e) => {
212
- isShowConfig.value = isShowConfig.value ? false : !!e;
213
- };
214
237
  return {
215
238
  paginationConfig,
216
239
  isShowConfig,
@@ -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": "devui-pagination-config",
255
+ "class": ns.e("config"),
232
256
  "ref": "paginationConfig"
233
257
  }, [createVNode("div", {
234
- "class": "devui-setup-icon"
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": "devui-config-container"
263
+ "class": ns.e("config-container")
240
264
  }, [(_a = $slots.default) == null ? void 0 : _a.call($slots), createVNode("div", {
241
- "class": "pagination-config-item"
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": "devui-page-number"
269
+ "class": ns.e("number")
246
270
  }, [pageSizeOptions.map((v) => {
247
271
  return createVNode("div", {
248
272
  "class": {
@@ -279,25 +303,25 @@ var JumpPage = defineComponent({
279
303
  totalPages,
280
304
  cursor
281
305
  } = toRefs(props);
282
- const inputNum = ref(pageIndex.value);
283
- watch(() => pageIndex.value, (val) => {
306
+ const inputNum = ref(pageIndex == null ? void 0 : pageIndex.value);
307
+ watch(() => pageIndex == null ? void 0 : pageIndex.value, (val) => {
284
308
  inputNum.value = val;
285
309
  });
286
- let curPage = pageIndex.value;
310
+ let curPage = pageIndex == null ? void 0 : pageIndex.value;
287
311
  const jumpPageChange = (currentPage) => {
288
312
  curPage = +currentPage;
289
313
  inputNum.value = currentPage;
290
314
  if (isNaN(currentPage)) {
291
315
  setTimeout(() => {
292
- inputNum.value = pageIndex.value;
316
+ inputNum.value = pageIndex == null ? void 0 : pageIndex.value;
293
317
  }, 300);
294
318
  }
295
319
  };
296
320
  const jump = (e) => {
297
- if (curPage > totalPages.value) {
321
+ if (curPage > (totalPages == null ? void 0 : totalPages.value)) {
298
322
  return;
299
323
  }
300
- if ((e === "btn" || e.key === "Enter") && cursor.value !== curPage) {
324
+ if ((e === "btn" || e.key === "Enter") && (cursor == null ? void 0 : cursor.value) !== curPage) {
301
325
  emit("changeCursorEmit", curPage);
302
326
  }
303
327
  };
@@ -316,24 +340,26 @@ var JumpPage = defineComponent({
316
340
  jump,
317
341
  showJumpButton
318
342
  } = this;
343
+ const ns = useNamespace("pagination");
344
+ const inputProps = {
345
+ class: [ns.e("input"), size ? ns.em("input", size) : ""],
346
+ size,
347
+ modelValue: String(inputNum),
348
+ "onUpdate:modelValue": jumpPageChange,
349
+ onKeydown: jump
350
+ };
319
351
  return createVNode("div", {
320
- "class": "devui-jump-container"
352
+ "class": ns.e("jump-container")
321
353
  }, [
322
354
  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),
355
+ createVNode(resolveComponent("d-input"), inputProps, null),
330
356
  goToText === "\u8DF3\u81F3" && "\u9875",
331
357
  showJumpButton && createVNode("div", {
332
- "class": ["devui-jump-button", size ? "devui-jump-size-" + size : "devui-jump-size-default"],
358
+ "class": [ns.e("jump-button"), size ? ns.em("jump-size", size) : ns.em("jump-size", "default")],
333
359
  "onClick": jump.bind(null, "btn"),
334
360
  "title": goToText
335
361
  }, [createVNode("div", {
336
- "class": "devui-pagination-go"
362
+ "class": ns.e("go")
337
363
  }, null)])
338
364
  ]);
339
365
  }
@@ -360,8 +386,9 @@ var PageNumBtn = defineComponent({
360
386
  }) {
361
387
  const showPageNum = computed(() => handlePages(props.cursor, props.maxItems, props.totalPages));
362
388
  const changeCursor = (pageSize) => {
363
- if (isNaN(pageSize))
389
+ if (isNaN(pageSize)) {
364
390
  return;
391
+ }
365
392
  const page = pageSize < 1 ? 1 : pageSize > props.totalPages ? props.totalPages : pageSize | 0;
366
393
  emit("changeCursorEmit", page);
367
394
  };
@@ -398,32 +425,33 @@ var PageNumBtn = defineComponent({
398
425
  nextChange,
399
426
  showTruePageIndex
400
427
  } = this;
428
+ const ns = useNamespace("pagination");
401
429
  return createVNode("ul", {
402
- "class": ["devui-pagination-list", size ? "devui-pagination-" + size : ""]
430
+ "class": [ns.e("list"), size ? ns.m(size) : ""]
403
431
  }, [createVNode("li", {
404
432
  "onClick": prevChange.bind(null, -1),
405
433
  "class": {
406
- "devui-pagination-item": true,
434
+ [ns.e("item")]: true,
407
435
  disabled: cursor <= 1
408
436
  }
409
437
  }, [createVNode("a", {
410
438
  "innerHTML": preLink,
411
- "class": "devui-pagination-link"
439
+ "class": ns.e("link")
412
440
  }, null)]), !lite && createVNode(Fragment, null, [
413
441
  createVNode("li", {
414
442
  "onClick": changeCursor.bind(null, 1),
415
443
  "class": {
416
- "devui-pagination-item": true,
444
+ [ns.e("item")]: true,
417
445
  active: cursor === 1
418
446
  }
419
447
  }, [createVNode("a", {
420
- "class": "devui-pagination-link"
448
+ "class": ns.e("link")
421
449
  }, [createTextVNode("1")])]),
422
450
  showPageNum[0] > 2 && createVNode("li", {
423
451
  "onClick": prevChange.bind(null, showPageNum[0] - 1),
424
- "class": "devui-pagination-item"
452
+ "class": ns.e("item")
425
453
  }, [createVNode("a", {
426
- "class": "devui-pagination-link"
454
+ "class": ns.e("link")
427
455
  }, [createTextVNode("...")])]),
428
456
  (() => {
429
457
  const list = [];
@@ -432,48 +460,48 @@ var PageNumBtn = defineComponent({
432
460
  "onClick": changeCursor.bind(null, i),
433
461
  "key": i,
434
462
  "class": {
435
- "devui-pagination-item": true,
463
+ [ns.e("item")]: true,
436
464
  active: cursor === i
437
465
  }
438
466
  }, [createVNode("a", {
439
- "class": "devui-pagination-link"
467
+ "class": ns.e("link")
440
468
  }, [i])]));
441
469
  }
442
470
  return list;
443
471
  })(),
444
472
  showPageNum[1] < totalPages - 1 && createVNode("li", {
445
473
  "onClick": nextChange.bind(null, showPageNum[1] + 1),
446
- "class": "devui-pagination-item"
474
+ "class": ns.e("item")
447
475
  }, [createVNode("a", {
448
- "class": "devui-pagination-link"
476
+ "class": ns.e("link")
449
477
  }, [createTextVNode("...")])]),
450
478
  showPageNum[1] < totalPages && createVNode("li", {
451
479
  "onClick": changeCursor.bind(null, totalPages),
452
480
  "class": {
453
- "devui-pagination-item": true,
481
+ [ns.e("item")]: true,
454
482
  active: cursor === totalPages
455
483
  }
456
484
  }, [createVNode("a", {
457
- "class": "devui-pagination-link"
485
+ "class": ns.e("link")
458
486
  }, [totalPages])]),
459
487
  showTruePageIndex && cursor > totalPages && totalPages > 0 && createVNode(Fragment, null, [cursor > totalPages + 1 && createVNode("li", {
460
- "class": "devui-pagination-item disabled"
488
+ "class": [ns.e("item"), "disabled"]
461
489
  }, [createVNode("a", {
462
- "class": "devui-pagination-link"
490
+ "class": ns.e("link")
463
491
  }, [createTextVNode("...")])]), createVNode("li", {
464
- "class": "devui-pagination-item disabled active"
492
+ "class": [ns.e("item"), "disabled", "active"]
465
493
  }, [createVNode("a", {
466
- "class": "devui-pagination-link"
494
+ "class": ns.e("link")
467
495
  }, [cursor])])])
468
496
  ]), createVNode("li", {
469
497
  "onClick": nextChange.bind(null, -1),
470
498
  "class": {
471
- "devui-pagination-item": true,
499
+ [ns.e("item")]: true,
472
500
  disabled: cursor >= totalPages
473
501
  }
474
502
  }, [createVNode("a", {
475
503
  "innerHTML": nextLink,
476
- "class": "devui-pagination-link"
504
+ "class": ns.e("link")
477
505
  }, null)])]);
478
506
  }
479
507
  });
@@ -485,11 +513,35 @@ var Pagination = defineComponent({
485
513
  JumpPage,
486
514
  PageNumBtn
487
515
  },
488
- props: componentProps,
516
+ props: paginationProps,
489
517
  emits: ["pageIndexChange", "pageSizeChange", "update:pageSize", "update:pageIndex"],
490
518
  setup(props, {
491
- emit
519
+ emit,
520
+ slots
492
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");
544
+ const totalPages = computed(() => Math.ceil(props.total / props.pageSize));
493
545
  const litePageOptions = computed(() => liteSelectOptions(totalPages.value));
494
546
  const cursor = computed({
495
547
  get() {
@@ -511,7 +563,6 @@ var Pagination = defineComponent({
511
563
  emit("update:pageSize", val);
512
564
  }
513
565
  });
514
- const totalPages = computed(() => Math.ceil(props.total / props.pageSize));
515
566
  const changeCursorEmit = (val) => {
516
567
  cursor.value = val;
517
568
  emit("pageIndexChange", val);
@@ -530,113 +581,72 @@ var Pagination = defineComponent({
530
581
  const litePageIndexChange = (page) => {
531
582
  changeCursorEmit(page.value);
532
583
  };
533
- return {
534
- cursor,
535
- totalPages,
536
- changeCursorEmit,
537
- currentPageSize,
538
- pageSizeChange,
539
- litePageOptions,
540
- litePageIndexChange
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
+ ]);
541
641
  };
542
- },
543
- render() {
544
- const {
545
- total,
546
- pageIndex,
547
- pageSizeOptions,
548
- pageSizeDirection,
549
- preLink,
550
- nextLink,
551
- size,
552
- canJumpPage,
553
- canChangePageSize,
554
- canViewTotal,
555
- totalItemText,
556
- goToText,
557
- maxItems,
558
- showJumpButton,
559
- showTruePageIndex,
560
- lite,
561
- showPageSelector,
562
- haveConfigMenu,
563
- autoHide,
564
- $slots,
565
- cursor,
566
- totalPages,
567
- currentPageSize,
568
- pageSizeChange,
569
- changeCursorEmit,
570
- litePageOptions,
571
- litePageIndexChange
572
- } = this;
573
- return autoHide && Math.min(...pageSizeOptions) > total ? null : createVNode("div", {
574
- "class": "devui-pagination"
575
- }, [
576
- canChangePageSize && !lite && createVNode("div", {
577
- "class": ["devui-page-size", size ? "devui-page-size-" + size : ""]
578
- }, [createVNode(resolveComponent("d-select"), {
579
- "options": pageSizeOptions,
580
- "modelValue": currentPageSize,
581
- "onValueChange": pageSizeChange,
582
- "pageSizeDirection": pageSizeDirection
583
- }, null)]),
584
- (!lite || lite && showPageSelector) && canViewTotal && createVNode("div", {
585
- "class": "devui-total-size"
586
- }, [totalItemText, createTextVNode(": "), total]),
587
- lite && showPageSelector && createVNode("div", {
588
- "class": "devui-page-size"
589
- }, [createVNode(resolveComponent("d-select"), {
590
- "options": litePageOptions,
591
- "disabled": total === 0,
592
- "modelValue": cursor,
593
- "onValueChange": litePageIndexChange,
594
- "pageSizeDirection": pageSizeDirection
595
- }, null)]),
596
- createVNode(resolveComponent("page-num-btn"), mergeProps({
597
- cursor,
598
- totalPages,
599
- size,
600
- lite,
601
- maxItems,
602
- preLink,
603
- nextLink,
604
- showTruePageIndex
605
- }, {
606
- "onChangeCursorEmit": changeCursorEmit
607
- }), null),
608
- canJumpPage && !lite && createVNode(resolveComponent("jump-page"), mergeProps({
609
- goToText,
610
- size,
611
- pageIndex,
612
- totalPages,
613
- cursor,
614
- showJumpButton
615
- }, {
616
- "onChangeCursorEmit": changeCursorEmit
617
- }), null),
618
- lite && haveConfigMenu && createVNode(resolveComponent("config-menu"), {
619
- currentPageSize,
620
- pageSizeChange,
621
- pageSizeOptions
622
- }, {
623
- default: () => {
624
- var _a;
625
- return [(_a = $slots.default) == null ? void 0 : _a.call($slots)];
626
- }
627
- })
628
- ]);
629
642
  }
630
643
  });
631
- Pagination.install = (app) => {
632
- app.component(Pagination.name, Pagination);
633
- };
634
644
  var index = {
635
645
  title: "Pagination \u5206\u9875",
636
646
  category: "\u5BFC\u822A",
637
647
  status: "100%",
638
648
  install(app) {
639
- app.use(Pagination);
649
+ app.component(Pagination.name, Pagination);
640
650
  }
641
651
  };
642
- export { Pagination, index as default };
652
+ export { Pagination, index as default, paginationProps };