bkui-vue 0.0.1-beta.388 → 0.0.1-beta.389

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 (150) hide show
  1. package/dist/index.cjs.js +22 -22
  2. package/dist/index.esm.js +1 -0
  3. package/dist/index.umd.js +23 -23
  4. package/lib/affix/index.js +353 -1
  5. package/lib/alert/index.js +251 -1
  6. package/lib/animate-number/index.js +226 -1
  7. package/lib/backtop/index.js +260 -1
  8. package/lib/badge/index.js +274 -1
  9. package/lib/breadcrumb/index.js +329 -1
  10. package/lib/button/index.js +371 -1
  11. package/lib/card/index.js +326 -1
  12. package/lib/cascader/index.js +2168 -1
  13. package/lib/checkbox/index.js +571 -1
  14. package/lib/code-diff/index.js +5520 -1
  15. package/lib/collapse/index.js +698 -1
  16. package/lib/color-picker/index.js +2816 -1
  17. package/lib/components.js +759 -1
  18. package/lib/container/index.js +369 -1
  19. package/lib/date-picker/index.js +5601 -1
  20. package/lib/dialog/index.js +545 -1
  21. package/lib/directives/index.js +1428 -2
  22. package/lib/dist.index.js +166 -1
  23. package/lib/divider/index.js +512 -1
  24. package/lib/dropdown/index.js +414 -1
  25. package/lib/exception/index.js +405 -1
  26. package/lib/fixed-navbar/index.js +214 -1
  27. package/lib/form/index.js +986 -1
  28. package/lib/icon/angle-double-down-line.js +426 -1
  29. package/lib/icon/angle-double-left-line.js +426 -1
  30. package/lib/icon/angle-double-left.js +426 -1
  31. package/lib/icon/angle-double-right-line.js +426 -1
  32. package/lib/icon/angle-double-right.js +426 -1
  33. package/lib/icon/angle-double-up-line.js +426 -1
  34. package/lib/icon/angle-down-fill.js +426 -1
  35. package/lib/icon/angle-down-line.js +426 -1
  36. package/lib/icon/angle-down.js +426 -1
  37. package/lib/icon/angle-left.js +426 -1
  38. package/lib/icon/angle-right.js +426 -1
  39. package/lib/icon/angle-up-fill.js +426 -1
  40. package/lib/icon/angle-up.js +426 -1
  41. package/lib/icon/archive-fill.js +426 -1
  42. package/lib/icon/arrows-left.js +426 -1
  43. package/lib/icon/arrows-right.js +426 -1
  44. package/lib/icon/audio-fill.js +426 -1
  45. package/lib/icon/bk.js +426 -1
  46. package/lib/icon/circle.js +426 -1
  47. package/lib/icon/close-line.js +426 -1
  48. package/lib/icon/close.js +426 -1
  49. package/lib/icon/code.js +426 -1
  50. package/lib/icon/cog-shape.js +426 -1
  51. package/lib/icon/collapse-left.js +426 -1
  52. package/lib/icon/copy.js +426 -1
  53. package/lib/icon/data-shape.js +426 -1
  54. package/lib/icon/del.js +426 -1
  55. package/lib/icon/doc-fill.js +426 -1
  56. package/lib/icon/done.js +426 -1
  57. package/lib/icon/down-shape.js +426 -1
  58. package/lib/icon/down-small.js +426 -1
  59. package/lib/icon/edit-line.js +426 -1
  60. package/lib/icon/ellipsis.js +426 -1
  61. package/lib/icon/enlarge-line.js +426 -1
  62. package/lib/icon/error.js +426 -1
  63. package/lib/icon/excel-fill.js +426 -1
  64. package/lib/icon/exclamation-circle-shape.js +426 -1
  65. package/lib/icon/eye.js +426 -1
  66. package/lib/icon/filliscreen-line.js +426 -1
  67. package/lib/icon/folder-open.js +426 -1
  68. package/lib/icon/folder-shape-open.js +426 -1
  69. package/lib/icon/folder-shape.js +426 -1
  70. package/lib/icon/folder.js +426 -1
  71. package/lib/icon/funnel.js +426 -1
  72. package/lib/icon/help-document-fill.js +426 -1
  73. package/lib/icon/help-fill.js +426 -1
  74. package/lib/icon/help.js +426 -1
  75. package/lib/icon/image-fill.js +426 -1
  76. package/lib/icon/img-placehoulder.js +448 -1
  77. package/lib/icon/index.js +2275 -1
  78. package/lib/icon/info-line.js +448 -1
  79. package/lib/icon/info.js +448 -1
  80. package/lib/icon/left-shape.js +448 -1
  81. package/lib/icon/left-turn-line.js +448 -1
  82. package/lib/icon/narrow-line.js +448 -1
  83. package/lib/icon/original.js +448 -1
  84. package/lib/icon/pdf-fill.js +448 -1
  85. package/lib/icon/play-shape.js +448 -1
  86. package/lib/icon/plus.js +448 -1
  87. package/lib/icon/ppt-fill.js +448 -1
  88. package/lib/icon/qq.js +448 -1
  89. package/lib/icon/right-shape.js +448 -1
  90. package/lib/icon/right-turn-line.js +448 -1
  91. package/lib/icon/search.js +448 -1
  92. package/lib/icon/share.js +448 -1
  93. package/lib/icon/spinner.js +448 -1
  94. package/lib/icon/success.js +448 -1
  95. package/lib/icon/switcher-loading.js +448 -1
  96. package/lib/icon/text-file.js +448 -1
  97. package/lib/icon/text-fill.js +448 -1
  98. package/lib/icon/transfer.js +448 -1
  99. package/lib/icon/tree-application-shape.js +448 -1
  100. package/lib/icon/unfull-screen.js +448 -1
  101. package/lib/icon/unvisible.js +448 -1
  102. package/lib/icon/up-shape.js +448 -1
  103. package/lib/icon/upload.js +448 -1
  104. package/lib/icon/video-fill.js +448 -1
  105. package/lib/icon/warn.js +448 -1
  106. package/lib/icon/weixin.js +448 -1
  107. package/lib/image/index.js +873 -1
  108. package/lib/index.js +169 -1
  109. package/lib/info-box/index.js +1784 -1
  110. package/lib/input/index.js +846 -1
  111. package/lib/link/index.js +226 -1
  112. package/lib/loading/index.js +309 -1
  113. package/lib/menu/index.js +796 -1
  114. package/lib/message/index.js +401 -1
  115. package/lib/modal/index.js +395 -1
  116. package/lib/navigation/index.js +431 -1
  117. package/lib/notify/index.js +430 -1
  118. package/lib/overflow-title/index.js +512 -1
  119. package/lib/pagination/index.js +1026 -1
  120. package/lib/plugin-popover/index.js +2448 -1
  121. package/lib/plugins/index.js +130 -1
  122. package/lib/popover/index.js +2454 -1
  123. package/lib/popover2/index.js +172 -1
  124. package/lib/preset.js +129 -1
  125. package/lib/process/index.js +1417 -1
  126. package/lib/progress/index.js +479 -1
  127. package/lib/radio/index.js +649 -1
  128. package/lib/rate/index.js +358 -1
  129. package/lib/resize-layout/index.js +495 -1
  130. package/lib/search-select/index.js +3388 -1
  131. package/lib/select/index.js +2819 -1
  132. package/lib/shared/index.js +2813 -1
  133. package/lib/sideslider/index.js +1362 -1
  134. package/lib/slider/index.js +2060 -1
  135. package/lib/steps/index.js +1504 -1
  136. package/lib/swiper/index.js +374 -1
  137. package/lib/switcher/index.js +308 -1
  138. package/lib/tab/index.js +919 -1
  139. package/lib/table/index.js +6635 -1
  140. package/lib/table-column/index.js +737 -1
  141. package/lib/tag/index.js +278 -1
  142. package/lib/tag-input/index.js +1897 -1
  143. package/lib/time-picker/index.js +142 -1
  144. package/lib/timeline/index.js +315 -1
  145. package/lib/transfer/index.js +658 -1
  146. package/lib/tree/index.js +2917 -1
  147. package/lib/upload/index.js +3735 -1
  148. package/lib/virtual-render/index.js +825 -1
  149. package/package.json +1 -1
  150. package/lib/directives/index.js.LICENSE.txt +0 -14
@@ -1 +1,1026 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../select","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,e["../select"],e["../icon"],e["../popover"]);for(var a in n)("object"==typeof exports?exports:e)[a]=n[a]}}(self,((e,t,n,a,r)=>(()=>{"use strict";var i={6870:e=>{e.exports=a},5537:e=>{e.exports=r},6422:e=>{e.exports=n},4212:t=>{t.exports=e},748:e=>{e.exports=t}},o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,l),n.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{l.r(u),l.d(u,{BkPagination:()=>v,default:()=>m});var e=l(4212);function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(i.push(a.value),!t||i.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var r=l(748),i=l(6422),o=l.n(i),c=l(6870),s=l(5537),d=l.n(s);var f={modelValue:e.PropTypes.number.def(1),count:e.PropTypes.number.def(0).isRequired,limit:e.PropTypes.number.def(10),limitList:e.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:e.PropTypes.bool.def(!0),type:e.PropTypes.oneOf(["default","compact"]).def("default"),location:e.PropTypes.oneOf(["left","right"]).def("right"),align:e.PropTypes.oneOf(["left","center","right"]).def("left"),size:e.PropTypes.size(),small:e.PropTypes.bool.def(!1),showTotalCount:e.PropTypes.bool.def(!0),prevText:e.PropTypes.string,nextText:e.PropTypes.string,disabled:e.PropTypes.bool.def(!1),beforeChange:e.PropTypes.func,layout:e.PropTypes.custom((function(e){var t={total:!0,list:!0,limit:!0};return e.some((function(e){return t[e]}))}),"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])};const p=(0,r.defineComponent)({name:"Pagination",props:f,emits:["update:modelValue","change","update:limit","limitChange"],setup:function(e,t){var n=(0,r.ref)(0),l=(0,r.toRefs)(e),u=l.count,s=l.limit,f=function(){var e=(0,r.getCurrentInstance)().proxy,t=(0,r.ref)(1),n=(0,r.computed)((function(){return 1===t.value})),a=(0,r.computed)((function(){return t.value===e.totalPageNum})),i=(0,r.ref)(!1),o=(0,r.ref)(!1),l=(0,r.computed)((function(){i.value=!1,o.value=!1;var n=[];if(e.totalPageNum<=7){for(var a=2;a<=e.totalPageNum-1;a++)n.push(a);return n}var r=Math.floor(2.5);e.totalPageNum>5&&(i.value=t.value-r>2,o.value=t.value+r<e.totalPageNum-1);for(var l=Math.min(e.totalPageNum-5,Math.max(2,t.value-r)),u=l;u<l+5;u++)n.push(u);return n}));(0,r.watch)((function(){return e.modelValue}),(function(n){(0,r.nextTick)((function(){n>=1&&n<=e.totalPageNum?t.value=n:t.value=n<1?1:e.totalPageNum}))}),{immediate:!0}),(0,r.nextTick)((function(){(0,r.watch)((function(){return e.totalPageNum}),(function(e){t.value>e&&(t.value=e)}))}));var u=function(){n.value||(t.value=t.value-1)},s=function(){a.value||(t.value=t.value+1)},d=function(e){e!==t.value&&(t.value=e)},f=function(){t.value=Math.max(1,t.value-5)},p=function(){t.value=Math.min(e.totalPageNum,t.value+5)};return{current:t,render:function(v){var m=v.isFirst,g=v.isLast;return(0,r.createVNode)("div",{class:{"bk-pagination-list":!0,"is-first":m,"is-last":g}},[(0,r.createVNode)("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":n.value},onClick:u},[e.prevText||(0,r.createVNode)(c.AngleLeft,null,null)]),(0,r.createVNode)("div",{class:{"bk-pagination-list-item":!0,"is-active":1===t.value},key:"1",onClick:function(){return d(1)}},[(0,r.createTextVNode)("1")]),i.value&&(0,r.createVNode)("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:f},[(0,r.createVNode)(c.Ellipsis,null,null)]),l.value.map((function(e){return(0,r.createVNode)("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e},key:e,onClick:function(){return d(e)}},[e])})),o.value&&(0,r.createVNode)("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:p},[(0,r.createVNode)(c.Ellipsis,null,null)]),e.totalPageNum>1&&(0,r.createVNode)("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:function(){return d(e.totalPageNum)}},[e.totalPageNum]),(0,r.createVNode)("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":a.value},onClick:s},[e.nextText||(0,r.createVNode)(c.AngleRight,null,null)])])}}}(),p=f.current,v=f.render,m=function(){var e=(0,r.getCurrentInstance)().proxy,t=(0,r.ref)(null),n=(0,r.ref)(!1),a=(0,r.ref)(1),i=(0,r.computed)((function(){return 1===a.value})),o=(0,r.computed)((function(){return a.value===e.totalPageNum})),l=0,u=(0,r.computed)((function(){for(var t=[],n=1;n<=e.totalPageNum;n++)t.push(n);return t}));(0,r.watch)((function(){return e.modelValue}),(function(t){(0,r.nextTick)((function(){t>=1&&t<=e.totalPageNum?a.value=t:a.value=t<1?1:e.totalPageNum,l=a.value}))}),{immediate:!0}),(0,r.nextTick)((function(){(0,r.watch)((function(){return e.totalPageNum}),(function(e){a.value>e&&(a.value=e)}))}));var s=function(){i.value||(a.value=a.value-1)},f=function(){o.value||(a.value=a.value+1)},p=function(){n.value=!0},v=function(){n.value=!1,t.value.textContent="".concat(l),l!==a.value&&(a.value=l)},m=function(t){var n=t.target,r=Number(n.textContent);!r||r<1||r>e.totalPageNum||r===a.value||(l=r)},g=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),v())};return{current:a,render:function(){return(0,r.createVNode)("div",{class:"bk-pagination-small-list"},[(0,r.createVNode)("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":i.value},onClick:s},[(0,r.createVNode)(c.AngleLeft,null,null)]),(0,r.createVNode)(d(),{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:function(){return(0,r.createVNode)("div",{class:{"bk-pagination-picker":!0,"is-focused":n.value}},[(0,r.createVNode)("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:p,onBlur:v,onInput:m,onKeydown:g},[a.value]),(0,r.createVNode)("span",null,[(0,r.createTextVNode)("/")]),(0,r.createVNode)("span",{class:"bk-pagination-small-list-total"},[e.totalPageNum])])},content:function(){return(0,r.createVNode)("div",{class:"bk-pagination-picker-list"},[u.value.map((function(e){return(0,r.createVNode)("div",{class:{item:!0,"is-actived":e===a.value},key:e,onClick:function(){return function(e){l=e,v()}(e)}},[e])}))])}}),(0,r.createVNode)("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":o.value},onClick:f},[(0,r.createVNode)(c.AngleRight,null,null)])])}}}(),g=m.current,b=m.render,h=function(){var e=(0,r.getCurrentInstance)().proxy,t=(0,r.ref)(e.limit);(0,r.watch)((function(){return e.limit}),(function(e){t.value=e})),(0,r.watch)((function(){return e.limitList}),(function(e){(0,r.nextTick)((function(){if(!e.includes(t.value)){var n=a(e,1);t.value=n[0]}}))}),{immediate:!0});var n=function(e){t.value=e};return{limit:t,render:function(a){var l,u,c=a.isFirst,s=a.isLast;return e.showLimit?(0,r.createVNode)("div",(0,r.mergeProps)({class:{"bk-pagination-limit":!0,"is-first":c,"is-last":s}},{disabled:e.disabled}),[(0,r.createVNode)("div",null,[(0,r.createTextVNode)("每页")]),(0,r.createVNode)(o(),{class:"bk-pagination-limit-select",clearable:!1,size:"small",withValidate:!1,modelValue:t.value,onChange:n,disabled:e.disabled},(u=l=e.limitList.map((function(e,t){return(0,r.createVNode)(i.BkOption,{value:e,label:"".concat(e),key:"".concat(t,"_").concat(e)},null)})),"function"==typeof u||"[object Object]"===Object.prototype.toString.call(u)&&!(0,r.isVNode)(u)?l:{default:function(){return[l]}})),(0,r.createVNode)("div",null,[(0,r.createTextVNode)("条")])]):null}}}(),y=h.limit,N=h.render;return(0,r.watch)([u,y,s],(function(e){var t=a(e,2),r=t[0],i=t[1],o=Math.ceil(r/i);n.value=o<1?1:o}),{immediate:!0}),(0,r.watch)(p,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),(0,r.watch)(g,(function(n){e.small&&(t.emit("update:modelValue",n),t.emit("change",n))})),(0,r.watch)(y,(function(e){t.emit("limitChange",e)})),{totalPageNum:n,renderTotal:function(e){var t=e.isFirst,n=e.isLast,a=(0,r.getCurrentInstance)().props;return a.showTotalCount?(0,r.createVNode)("div",(0,r.mergeProps)({class:{"bk-pagination-total":!0,"is-first":t,"is-last":n}},{disabled:a.disabled}),[(0,r.createTextVNode)("共计"),(0,r.createVNode)("div",{class:"bk-pagination-total-num"},[a.count]),(0,r.createTextVNode)("条")]):null},renderList:v,renderLimit:N,renderSmallList:b}},render:function(){var n,a=this,i=(0,e.classes)((t(n={"bk-pagination":!0},"bk-pagination--".concat(this.size),!0),t(n,"is-align-".concat(this.align),!0),n)),o={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return(0,r.createVNode)("div",{class:i},[this.layout.map((function(e,t){return o[e]({isFirst:0===t,isLast:t===a.layout.length-1})}))])}});var v=(0,e.withInstall)(p);const m=v})(),u})()));
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("../shared"), require("vue"), require("../select"), require("../icon"), require("../popover"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["../shared", "vue", "../select", "../icon", "../popover"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("../select"), require("../icon"), require("../popover")) : factory(root["../shared"], root["vue"], root["../select"], root["../icon"], root["../popover"]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__6422__, __WEBPACK_EXTERNAL_MODULE__6870__, __WEBPACK_EXTERNAL_MODULE__5537__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 6870:
16
+ /***/ ((module) => {
17
+
18
+ module.exports = __WEBPACK_EXTERNAL_MODULE__6870__;
19
+
20
+ /***/ }),
21
+
22
+ /***/ 5537:
23
+ /***/ ((module) => {
24
+
25
+ module.exports = __WEBPACK_EXTERNAL_MODULE__5537__;
26
+
27
+ /***/ }),
28
+
29
+ /***/ 6422:
30
+ /***/ ((module) => {
31
+
32
+ module.exports = __WEBPACK_EXTERNAL_MODULE__6422__;
33
+
34
+ /***/ }),
35
+
36
+ /***/ 4212:
37
+ /***/ ((module) => {
38
+
39
+ module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
40
+
41
+ /***/ }),
42
+
43
+ /***/ 748:
44
+ /***/ ((module) => {
45
+
46
+ module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
47
+
48
+ /***/ })
49
+
50
+ /******/ });
51
+ /************************************************************************/
52
+ /******/ // The module cache
53
+ /******/ var __webpack_module_cache__ = {};
54
+ /******/
55
+ /******/ // The require function
56
+ /******/ function __webpack_require__(moduleId) {
57
+ /******/ // Check if module is in cache
58
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
59
+ /******/ if (cachedModule !== undefined) {
60
+ /******/ return cachedModule.exports;
61
+ /******/ }
62
+ /******/ // Create a new module (and put it into the cache)
63
+ /******/ var module = __webpack_module_cache__[moduleId] = {
64
+ /******/ // no module.id needed
65
+ /******/ // no module.loaded needed
66
+ /******/ exports: {}
67
+ /******/ };
68
+ /******/
69
+ /******/ // Execute the module function
70
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
71
+ /******/
72
+ /******/ // Return the exports of the module
73
+ /******/ return module.exports;
74
+ /******/ }
75
+ /******/
76
+ /************************************************************************/
77
+ /******/ /* webpack/runtime/compat get default export */
78
+ /******/ (() => {
79
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
80
+ /******/ __webpack_require__.n = (module) => {
81
+ /******/ var getter = module && module.__esModule ?
82
+ /******/ () => (module['default']) :
83
+ /******/ () => (module);
84
+ /******/ __webpack_require__.d(getter, { a: getter });
85
+ /******/ return getter;
86
+ /******/ };
87
+ /******/ })();
88
+ /******/
89
+ /******/ /* webpack/runtime/define property getters */
90
+ /******/ (() => {
91
+ /******/ // define getter functions for harmony exports
92
+ /******/ __webpack_require__.d = (exports, definition) => {
93
+ /******/ for(var key in definition) {
94
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
95
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
96
+ /******/ }
97
+ /******/ }
98
+ /******/ };
99
+ /******/ })();
100
+ /******/
101
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
102
+ /******/ (() => {
103
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
104
+ /******/ })();
105
+ /******/
106
+ /******/ /* webpack/runtime/make namespace object */
107
+ /******/ (() => {
108
+ /******/ // define __esModule on exports
109
+ /******/ __webpack_require__.r = (exports) => {
110
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
111
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
112
+ /******/ }
113
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
114
+ /******/ };
115
+ /******/ })();
116
+ /******/
117
+ /************************************************************************/
118
+ var __webpack_exports__ = {};
119
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
120
+ (() => {
121
+ // ESM COMPAT FLAG
122
+ __webpack_require__.r(__webpack_exports__);
123
+
124
+ // EXPORTS
125
+ __webpack_require__.d(__webpack_exports__, {
126
+ "BkPagination": () => (/* binding */ BkPagination),
127
+ "default": () => (/* binding */ src)
128
+ });
129
+
130
+ // EXTERNAL MODULE: external "../shared"
131
+ var external_shared_ = __webpack_require__(4212);
132
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
133
+ function _defineProperty(obj, key, value) {
134
+ if (key in obj) {
135
+ Object.defineProperty(obj, key, {
136
+ value: value,
137
+ enumerable: true,
138
+ configurable: true,
139
+ writable: true
140
+ });
141
+ } else {
142
+ obj[key] = value;
143
+ }
144
+
145
+ return obj;
146
+ }
147
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
148
+ function _arrayWithHoles(arr) {
149
+ if (Array.isArray(arr)) return arr;
150
+ }
151
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
152
+ function _iterableToArrayLimit(arr, i) {
153
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
154
+
155
+ if (_i == null) return;
156
+ var _arr = [];
157
+ var _n = true;
158
+ var _d = false;
159
+
160
+ var _s, _e;
161
+
162
+ try {
163
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
164
+ _arr.push(_s.value);
165
+
166
+ if (i && _arr.length === i) break;
167
+ }
168
+ } catch (err) {
169
+ _d = true;
170
+ _e = err;
171
+ } finally {
172
+ try {
173
+ if (!_n && _i["return"] != null) _i["return"]();
174
+ } finally {
175
+ if (_d) throw _e;
176
+ }
177
+ }
178
+
179
+ return _arr;
180
+ }
181
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
182
+ function _arrayLikeToArray(arr, len) {
183
+ if (len == null || len > arr.length) len = arr.length;
184
+
185
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
186
+ arr2[i] = arr[i];
187
+ }
188
+
189
+ return arr2;
190
+ }
191
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
192
+
193
+ function _unsupportedIterableToArray(o, minLen) {
194
+ if (!o) return;
195
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
196
+ var n = Object.prototype.toString.call(o).slice(8, -1);
197
+ if (n === "Object" && o.constructor) n = o.constructor.name;
198
+ if (n === "Map" || n === "Set") return Array.from(o);
199
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
200
+ }
201
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
202
+ function _nonIterableRest() {
203
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
204
+ }
205
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
206
+
207
+
208
+
209
+
210
+ function _slicedToArray(arr, i) {
211
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
212
+ }
213
+ // EXTERNAL MODULE: external "vue"
214
+ var external_vue_ = __webpack_require__(748);
215
+ // EXTERNAL MODULE: external "../select"
216
+ var external_select_ = __webpack_require__(6422);
217
+ var external_select_default = /*#__PURE__*/__webpack_require__.n(external_select_);
218
+ ;// CONCATENATED MODULE: ../../packages/pagination/src/use-limit.tsx
219
+
220
+
221
+
222
+ /*
223
+ * Tencent is pleased to support the open source community by making
224
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
225
+ *
226
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
227
+ *
228
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
229
+ *
230
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
231
+ *
232
+ * ---------------------------------------------------
233
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
234
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
235
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
236
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
237
+ *
238
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
239
+ * the Software.
240
+ *
241
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
242
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
243
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
244
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
245
+ * IN THE SOFTWARE.
246
+ */
247
+
248
+
249
+
250
+ function _isSlot(s) {
251
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_.isVNode)(s);
252
+ }
253
+
254
+ /* harmony default export */ const use_limit = (function () {
255
+ var _getCurrentInstance = (0,external_vue_.getCurrentInstance)(),
256
+ proxy = _getCurrentInstance.proxy;
257
+
258
+ var localLimit = (0,external_vue_.ref)(proxy.limit);
259
+ /**
260
+ * @desc 同步props.limit的变化
261
+ */
262
+
263
+ (0,external_vue_.watch)(function () {
264
+ return proxy.limit;
265
+ }, function (limit) {
266
+ localLimit.value = limit;
267
+ });
268
+ /**
269
+ * @desc 同步props.limitlist的变化并判断props.limit的合法性
270
+ */
271
+
272
+ (0,external_vue_.watch)(function () {
273
+ return proxy.limitList;
274
+ }, function (limitList) {
275
+ (0,external_vue_.nextTick)(function () {
276
+ if (!limitList.includes(localLimit.value)) {
277
+ var _limitList = _slicedToArray(limitList, 1);
278
+
279
+ localLimit.value = _limitList[0];
280
+ }
281
+ });
282
+ }, {
283
+ immediate: true
284
+ });
285
+ /**
286
+ * @desc 选择每页条数
287
+ */
288
+
289
+ var handleLimitChange = function handleLimitChange(limit) {
290
+ localLimit.value = limit;
291
+ };
292
+
293
+ var render = function render(_ref) {
294
+ var _slot;
295
+
296
+ var isFirst = _ref.isFirst,
297
+ isLast = _ref.isLast;
298
+
299
+ if (!proxy.showLimit) {
300
+ return null;
301
+ }
302
+
303
+ return (0,external_vue_.createVNode)("div", (0,external_vue_.mergeProps)({
304
+ "class": {
305
+ 'bk-pagination-limit': true,
306
+ 'is-first': isFirst,
307
+ 'is-last': isLast
308
+ }
309
+ }, {
310
+ disabled: proxy.disabled
311
+ }), [(0,external_vue_.createVNode)("div", null, [(0,external_vue_.createTextVNode)("\u6BCF\u9875")]), (0,external_vue_.createVNode)((external_select_default()), {
312
+ "class": "bk-pagination-limit-select",
313
+ "clearable": false,
314
+ "size": "small",
315
+ "withValidate": false,
316
+ "modelValue": localLimit.value,
317
+ "onChange": handleLimitChange,
318
+ "disabled": proxy.disabled
319
+ }, _isSlot(_slot = proxy.limitList.map(function (num, index) {
320
+ return (0,external_vue_.createVNode)(external_select_.BkOption, {
321
+ "value": num,
322
+ "label": "".concat(num),
323
+ "key": "".concat(index, "_").concat(num)
324
+ }, null);
325
+ })) ? _slot : {
326
+ "default": function _default() {
327
+ return [_slot];
328
+ }
329
+ }), (0,external_vue_.createVNode)("div", null, [(0,external_vue_.createTextVNode)("\u6761")])]);
330
+ };
331
+
332
+ return {
333
+ limit: localLimit,
334
+ render: render
335
+ };
336
+ });
337
+ // EXTERNAL MODULE: external "../icon"
338
+ var external_icon_ = __webpack_require__(6870);
339
+ ;// CONCATENATED MODULE: ../../packages/pagination/src/use-list.tsx
340
+
341
+
342
+ /*
343
+ * Tencent is pleased to support the open source community by making
344
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
345
+ *
346
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
347
+ *
348
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
349
+ *
350
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
351
+ *
352
+ * ---------------------------------------------------
353
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
354
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
355
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
356
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
357
+ *
358
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
359
+ * the Software.
360
+ *
361
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
362
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
363
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
364
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
365
+ * IN THE SOFTWARE.
366
+ */
367
+
368
+
369
+ var PAGE_ITEMS_NUM = 5;
370
+ /* harmony default export */ const use_list = (function () {
371
+ var _getCurrentInstance = (0,external_vue_.getCurrentInstance)(),
372
+ proxy = _getCurrentInstance.proxy;
373
+
374
+ var localCurrent = (0,external_vue_.ref)(1);
375
+ var isPagePreDisabled = (0,external_vue_.computed)(function () {
376
+ return localCurrent.value === 1;
377
+ });
378
+ var isPageNextDisabled = (0,external_vue_.computed)(function () {
379
+ return localCurrent.value === proxy.totalPageNum;
380
+ });
381
+ var showPreBatch = (0,external_vue_.ref)(false);
382
+ var showNextBatch = (0,external_vue_.ref)(false);
383
+ var list = (0,external_vue_.computed)(function () {
384
+ showPreBatch.value = false;
385
+ showNextBatch.value = false;
386
+ var stack = [];
387
+
388
+ if (proxy.totalPageNum <= PAGE_ITEMS_NUM + 2) {
389
+ for (var i = 2; i <= proxy.totalPageNum - 1; i++) {
390
+ stack.push(i);
391
+ }
392
+
393
+ return stack;
394
+ }
395
+
396
+ var pageItemsNumHalf = Math.floor(PAGE_ITEMS_NUM / 2);
397
+
398
+ if (proxy.totalPageNum > PAGE_ITEMS_NUM) {
399
+ showPreBatch.value = localCurrent.value - pageItemsNumHalf > 2;
400
+ showNextBatch.value = localCurrent.value + pageItemsNumHalf < proxy.totalPageNum - 1;
401
+ }
402
+
403
+ var start = Math.min(proxy.totalPageNum - PAGE_ITEMS_NUM, Math.max(2, localCurrent.value - pageItemsNumHalf));
404
+
405
+ for (var _i = start; _i < start + PAGE_ITEMS_NUM; _i++) {
406
+ stack.push(_i);
407
+ }
408
+
409
+ return stack;
410
+ });
411
+ (0,external_vue_.watch)(function () {
412
+ return proxy.modelValue;
413
+ }, function (modelValue) {
414
+ // nextTick延后执行,保证proxy.totalPageNum计算正确
415
+ (0,external_vue_.nextTick)(function () {
416
+ if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
417
+ localCurrent.value = modelValue;
418
+ } else if (modelValue < 1) {
419
+ localCurrent.value = 1;
420
+ } else {
421
+ localCurrent.value = proxy.totalPageNum;
422
+ }
423
+ });
424
+ }, {
425
+ immediate: true
426
+ }); // 切换limit时会导致totalPageNum变小旧的current可能会超出范围,修正localCurrent
427
+
428
+ (0,external_vue_.nextTick)(function () {
429
+ (0,external_vue_.watch)(function () {
430
+ return proxy.totalPageNum;
431
+ }, function (totalPageNum) {
432
+ if (localCurrent.value > totalPageNum) {
433
+ localCurrent.value = totalPageNum;
434
+ }
435
+ });
436
+ });
437
+ /**
438
+ * @desc 上一页
439
+ */
440
+
441
+ var handlePrePage = function handlePrePage() {
442
+ if (isPagePreDisabled.value) {
443
+ return;
444
+ }
445
+
446
+ localCurrent.value = localCurrent.value - 1;
447
+ };
448
+ /**
449
+ * @desc 下一页
450
+ */
451
+
452
+
453
+ var handleNextPage = function handleNextPage() {
454
+ if (isPageNextDisabled.value) {
455
+ return;
456
+ }
457
+
458
+ localCurrent.value = localCurrent.value + 1;
459
+ };
460
+ /**
461
+ * @desc 跳转指定页码
462
+ * @param { Number } totalPageNum
463
+ */
464
+
465
+
466
+ var handleItemClick = function handleItemClick(totalPageNum) {
467
+ if (totalPageNum === localCurrent.value) {
468
+ return;
469
+ }
470
+
471
+ localCurrent.value = totalPageNum;
472
+ };
473
+ /**
474
+ * @desc 上一批分页
475
+ */
476
+
477
+
478
+ var handlePreBatch = function handlePreBatch() {
479
+ localCurrent.value = Math.max(1, localCurrent.value - PAGE_ITEMS_NUM);
480
+ };
481
+ /**
482
+ * @desc 下一批分页
483
+ */
484
+
485
+
486
+ var handleNextBatch = function handleNextBatch() {
487
+ localCurrent.value = Math.min(proxy.totalPageNum, localCurrent.value + PAGE_ITEMS_NUM);
488
+ };
489
+
490
+ var render = function render(_ref) {
491
+ var isFirst = _ref.isFirst,
492
+ isLast = _ref.isLast;
493
+ return (0,external_vue_.createVNode)("div", {
494
+ "class": {
495
+ 'bk-pagination-list': true,
496
+ 'is-first': isFirst,
497
+ 'is-last': isLast
498
+ }
499
+ }, [(0,external_vue_.createVNode)("div", {
500
+ "class": {
501
+ 'bk-pagination-list-pre': true,
502
+ 'is-disabled': isPagePreDisabled.value
503
+ },
504
+ "onClick": handlePrePage
505
+ }, [proxy.prevText || (0,external_vue_.createVNode)(external_icon_.AngleLeft, null, null)]), (0,external_vue_.createVNode)("div", {
506
+ "class": {
507
+ 'bk-pagination-list-item': true,
508
+ 'is-active': localCurrent.value === 1
509
+ },
510
+ "key": "1",
511
+ "onClick": function onClick() {
512
+ return handleItemClick(1);
513
+ }
514
+ }, [(0,external_vue_.createTextVNode)("1")]), showPreBatch.value && (0,external_vue_.createVNode)("div", {
515
+ "key": "pre-batch",
516
+ "class": "bk-pagination-list-pre-batch",
517
+ "onClick": handlePreBatch
518
+ }, [(0,external_vue_.createVNode)(external_icon_.Ellipsis, null, null)]), list.value.map(function (num) {
519
+ return (0,external_vue_.createVNode)("div", {
520
+ "class": {
521
+ 'bk-pagination-list-item': true,
522
+ 'is-active': localCurrent.value === num
523
+ },
524
+ "key": num,
525
+ "onClick": function onClick() {
526
+ return handleItemClick(num);
527
+ }
528
+ }, [num]);
529
+ }), showNextBatch.value && (0,external_vue_.createVNode)("div", {
530
+ "key": "next-batch",
531
+ "class": "bk-pagination-list-next-batch",
532
+ "onClick": handleNextBatch
533
+ }, [(0,external_vue_.createVNode)(external_icon_.Ellipsis, null, null)]), proxy.totalPageNum > 1 && (0,external_vue_.createVNode)("div", {
534
+ "class": {
535
+ 'bk-pagination-list-item': true,
536
+ 'is-active': localCurrent.value === proxy.totalPageNum
537
+ },
538
+ "key": "last",
539
+ "onClick": function onClick() {
540
+ return handleItemClick(proxy.totalPageNum);
541
+ }
542
+ }, [proxy.totalPageNum]), (0,external_vue_.createVNode)("div", {
543
+ "class": {
544
+ 'bk-pagination-list-pre': true,
545
+ 'is-disabled': isPageNextDisabled.value
546
+ },
547
+ "onClick": handleNextPage
548
+ }, [proxy.nextText || (0,external_vue_.createVNode)(external_icon_.AngleRight, null, null)])]);
549
+ };
550
+
551
+ return {
552
+ current: localCurrent,
553
+ render: render
554
+ };
555
+ });
556
+ // EXTERNAL MODULE: external "../popover"
557
+ var external_popover_ = __webpack_require__(5537);
558
+ var external_popover_default = /*#__PURE__*/__webpack_require__.n(external_popover_);
559
+ ;// CONCATENATED MODULE: ../../packages/pagination/src/use-small-list.tsx
560
+
561
+
562
+ /*
563
+ * Tencent is pleased to support the open source community by making
564
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
565
+ *
566
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
567
+ *
568
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
569
+ *
570
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
571
+ *
572
+ * ---------------------------------------------------
573
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
574
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
575
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
576
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
577
+ *
578
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
579
+ * the Software.
580
+ *
581
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
582
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
583
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
584
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
585
+ * IN THE SOFTWARE.
586
+ */
587
+
588
+
589
+
590
+ /* harmony default export */ const use_small_list = (function () {
591
+ var _getCurrentInstance = (0,external_vue_.getCurrentInstance)(),
592
+ proxy = _getCurrentInstance.proxy;
593
+
594
+ var inputRef = (0,external_vue_.ref)(null);
595
+ var isFocused = (0,external_vue_.ref)(false);
596
+ var localCurrent = (0,external_vue_.ref)(1);
597
+ var isPagePreDisabled = (0,external_vue_.computed)(function () {
598
+ return localCurrent.value === 1;
599
+ });
600
+ var isPageNextDisabled = (0,external_vue_.computed)(function () {
601
+ return localCurrent.value === proxy.totalPageNum;
602
+ }); // 缓存input输入,失焦或者enter键触发提交
603
+
604
+ var inputMemo = 0; // 页码可选列表
605
+
606
+ var list = (0,external_vue_.computed)(function () {
607
+ var stack = [];
608
+
609
+ for (var i = 1; i <= proxy.totalPageNum; i++) {
610
+ stack.push(i);
611
+ }
612
+
613
+ return stack;
614
+ });
615
+ (0,external_vue_.watch)(function () {
616
+ return proxy.modelValue;
617
+ }, function (modelValue) {
618
+ // nextTick延后执行,保证proxy.totalPageNum计算正确
619
+ (0,external_vue_.nextTick)(function () {
620
+ if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
621
+ localCurrent.value = modelValue;
622
+ } else if (modelValue < 1) {
623
+ localCurrent.value = 1;
624
+ } else {
625
+ localCurrent.value = proxy.totalPageNum;
626
+ }
627
+
628
+ inputMemo = localCurrent.value;
629
+ });
630
+ }, {
631
+ immediate: true
632
+ }); // 切换limit时会导致totalPageNum变小旧的current可能会超出范围,修正localCurrent
633
+
634
+ (0,external_vue_.nextTick)(function () {
635
+ (0,external_vue_.watch)(function () {
636
+ return proxy.totalPageNum;
637
+ }, function (totalPageNum) {
638
+ if (localCurrent.value > totalPageNum) {
639
+ localCurrent.value = totalPageNum;
640
+ }
641
+ });
642
+ });
643
+ /**
644
+ * @desc 上一页
645
+ */
646
+
647
+ var handlePrePage = function handlePrePage() {
648
+ if (isPagePreDisabled.value) {
649
+ return;
650
+ }
651
+
652
+ localCurrent.value = localCurrent.value - 1;
653
+ };
654
+ /**
655
+ * @desc 下一页
656
+ */
657
+
658
+
659
+ var handleNextPage = function handleNextPage() {
660
+ if (isPageNextDisabled.value) {
661
+ return;
662
+ }
663
+
664
+ localCurrent.value = localCurrent.value + 1;
665
+ };
666
+ /**
667
+ * @desc 获得焦点
668
+ */
669
+
670
+
671
+ var handlePageEditorFocus = function handlePageEditorFocus() {
672
+ isFocused.value = true;
673
+ };
674
+ /**
675
+ * @desc 失去焦点
676
+ */
677
+
678
+
679
+ var handlePageEditorBlur = function handlePageEditorBlur() {
680
+ isFocused.value = false;
681
+ inputRef.value.textContent = "".concat(inputMemo);
682
+
683
+ if (inputMemo !== localCurrent.value) {
684
+ localCurrent.value = inputMemo;
685
+ }
686
+ };
687
+ /**
688
+ * @desc 键盘输入
689
+ * @param { Event } event
690
+ */
691
+
692
+
693
+ var handlePageEditorInput = function handlePageEditorInput(event) {
694
+ var $target = event.target;
695
+ var value = Number($target.textContent); // 无效值不抛出事件
696
+
697
+ if (!value || value < 1 || value > proxy.totalPageNum || value === localCurrent.value) {
698
+ return;
699
+ }
700
+
701
+ ;
702
+ inputMemo = value;
703
+ };
704
+ /**
705
+ * @desc 处理Enter事件
706
+ * @param { KeyboardEvent } event
707
+ */
708
+
709
+
710
+ var handlePageEditorKeydown = function handlePageEditorKeydown(event) {
711
+ // 阻止默认enter事件(keycode判断可能会被弃用)
712
+ if (['Enter', 'NumpadEnter'].includes(event.code)) {
713
+ event.preventDefault();
714
+ handlePageEditorBlur();
715
+ }
716
+ };
717
+ /**
718
+ * @desc 更新
719
+ */
720
+
721
+
722
+ var handlePageChange = function handlePageChange(item) {
723
+ inputMemo = item;
724
+ handlePageEditorBlur();
725
+ };
726
+
727
+ var render = function render() {
728
+ return (0,external_vue_.createVNode)("div", {
729
+ "class": "bk-pagination-small-list"
730
+ }, [(0,external_vue_.createVNode)("div", {
731
+ "class": {
732
+ 'bk-pagination-btn-pre': true,
733
+ 'is-disabled': isPagePreDisabled.value
734
+ },
735
+ "onClick": handlePrePage
736
+ }, [(0,external_vue_.createVNode)(external_icon_.AngleLeft, null, null)]), (0,external_vue_.createVNode)((external_popover_default()), {
737
+ "theme": "light",
738
+ "trigger": "click",
739
+ "arrow": false,
740
+ "width": 56,
741
+ "boundary": "body",
742
+ "placement": "bottom"
743
+ }, {
744
+ "default": function _default() {
745
+ return (0,external_vue_.createVNode)("div", {
746
+ "class": {
747
+ 'bk-pagination-picker': true,
748
+ 'is-focused': isFocused.value
749
+ }
750
+ }, [(0,external_vue_.createVNode)("span", {
751
+ "ref": inputRef,
752
+ "class": "bk-pagination-editor",
753
+ "contenteditable": true,
754
+ "spellcheck": "false",
755
+ "onFocus": handlePageEditorFocus,
756
+ "onBlur": handlePageEditorBlur,
757
+ "onInput": handlePageEditorInput,
758
+ "onKeydown": handlePageEditorKeydown
759
+ }, [localCurrent.value]), (0,external_vue_.createVNode)("span", null, [(0,external_vue_.createTextVNode)("/")]), (0,external_vue_.createVNode)("span", {
760
+ "class": "bk-pagination-small-list-total"
761
+ }, [proxy.totalPageNum])]);
762
+ },
763
+ content: function content() {
764
+ return (0,external_vue_.createVNode)("div", {
765
+ "class": "bk-pagination-picker-list"
766
+ }, [list.value.map(function (item) {
767
+ return (0,external_vue_.createVNode)("div", {
768
+ "class": {
769
+ item: true,
770
+ 'is-actived': item === localCurrent.value
771
+ },
772
+ "key": item,
773
+ "onClick": function onClick() {
774
+ return handlePageChange(item);
775
+ }
776
+ }, [item]);
777
+ })]);
778
+ }
779
+ }), (0,external_vue_.createVNode)("div", {
780
+ "class": {
781
+ 'bk-pagination-btn-next': true,
782
+ 'is-disabled': isPageNextDisabled.value
783
+ },
784
+ "onClick": handleNextPage
785
+ }, [(0,external_vue_.createVNode)(external_icon_.AngleRight, null, null)])]);
786
+ };
787
+
788
+ return {
789
+ current: localCurrent,
790
+ render: render
791
+ };
792
+ });
793
+ ;// CONCATENATED MODULE: ../../packages/pagination/src/use-total.tsx
794
+
795
+
796
+ /*
797
+ * Tencent is pleased to support the open source community by making
798
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
799
+ *
800
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
801
+ *
802
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
803
+ *
804
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
805
+ *
806
+ * ---------------------------------------------------
807
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
808
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
809
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
810
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
811
+ *
812
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
813
+ * the Software.
814
+ *
815
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
816
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
817
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
818
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
819
+ * IN THE SOFTWARE.
820
+ */
821
+
822
+ /* harmony default export */ const use_total = (function () {
823
+ return function (_ref) {
824
+ var isFirst = _ref.isFirst,
825
+ isLast = _ref.isLast;
826
+
827
+ var _getCurrentInstance = (0,external_vue_.getCurrentInstance)(),
828
+ props = _getCurrentInstance.props;
829
+
830
+ if (!props.showTotalCount) {
831
+ return null;
832
+ }
833
+
834
+ return (0,external_vue_.createVNode)("div", (0,external_vue_.mergeProps)({
835
+ "class": {
836
+ 'bk-pagination-total': true,
837
+ 'is-first': isFirst,
838
+ 'is-last': isLast
839
+ }
840
+ }, {
841
+ disabled: props.disabled
842
+ }), [(0,external_vue_.createTextVNode)("\u5171\u8BA1"), (0,external_vue_.createVNode)("div", {
843
+ "class": "bk-pagination-total-num"
844
+ }, [props.count]), (0,external_vue_.createTextVNode)("\u6761")]);
845
+ };
846
+ });
847
+ ;// CONCATENATED MODULE: ../../packages/pagination/src/pagination.tsx
848
+
849
+
850
+
851
+
852
+ /*
853
+ * Tencent is pleased to support the open source community by making
854
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
855
+ *
856
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
857
+ *
858
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
859
+ *
860
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
861
+ *
862
+ * ---------------------------------------------------
863
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
864
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
865
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
866
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
867
+ *
868
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
869
+ * the Software.
870
+ *
871
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
872
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
873
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
874
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
875
+ * IN THE SOFTWARE.
876
+ */
877
+
878
+
879
+
880
+
881
+
882
+
883
+ var paginationProps = {
884
+ modelValue: external_shared_.PropTypes.number.def(1),
885
+ count: external_shared_.PropTypes.number.def(0).isRequired,
886
+ limit: external_shared_.PropTypes.number.def(10),
887
+ limitList: external_shared_.PropTypes.arrayOf(Number).def([10, 20, 50, 100]),
888
+ showLimit: external_shared_.PropTypes.bool.def(true),
889
+ type: external_shared_.PropTypes.oneOf(['default', 'compact']).def('default'),
890
+ location: external_shared_.PropTypes.oneOf(['left', 'right']).def('right'),
891
+ align: external_shared_.PropTypes.oneOf(['left', 'center', 'right']).def('left'),
892
+ size: external_shared_.PropTypes.size(),
893
+ small: external_shared_.PropTypes.bool.def(false),
894
+ showTotalCount: external_shared_.PropTypes.bool.def(true),
895
+ prevText: external_shared_.PropTypes.string,
896
+ nextText: external_shared_.PropTypes.string,
897
+ disabled: external_shared_.PropTypes.bool.def(false),
898
+ beforeChange: external_shared_.PropTypes.func,
899
+ layout: external_shared_.PropTypes.custom(function (value) {
900
+ var layoutNameMap = {
901
+ total: true,
902
+ list: true,
903
+ limit: true
904
+ };
905
+ return value.some(function (item) {
906
+ return layoutNameMap[item];
907
+ });
908
+ }, 'layout 的值只支持 * total、list、limit *').def(['total', 'list', 'limit'])
909
+ };
910
+ /* harmony default export */ const pagination = ((0,external_vue_.defineComponent)({
911
+ name: 'Pagination',
912
+ props: paginationProps,
913
+ emits: ['update:modelValue', 'change', 'update:limit', 'limitChange'],
914
+ setup: function setup(props, context) {
915
+ var totalPageNum = (0,external_vue_.ref)(0);
916
+
917
+ var _toRefs = (0,external_vue_.toRefs)(props),
918
+ count = _toRefs.count,
919
+ limit = _toRefs.limit;
920
+
921
+ var renderTotal = use_total();
922
+
923
+ var _useList = use_list(),
924
+ listCurrent = _useList.current,
925
+ renderList = _useList.render;
926
+
927
+ var _useSmallList = use_small_list(),
928
+ smallListCurrent = _useSmallList.current,
929
+ renderSmallList = _useSmallList.render;
930
+
931
+ var _useLimit = use_limit(),
932
+ localLimit = _useLimit.limit,
933
+ renderLimit = _useLimit.render;
934
+
935
+ (0,external_vue_.watch)([count, localLimit, limit], function (_ref) {
936
+ var _ref2 = _slicedToArray(_ref, 2),
937
+ count = _ref2[0],
938
+ localLimit = _ref2[1];
939
+
940
+ var total = Math.ceil(count / localLimit);
941
+ totalPageNum.value = total < 1 ? 1 : total;
942
+ }, {
943
+ immediate: true
944
+ });
945
+ (0,external_vue_.watch)(listCurrent, function (listCurrent) {
946
+ context.emit('update:modelValue', listCurrent);
947
+ context.emit('change', listCurrent);
948
+ });
949
+ (0,external_vue_.watch)(smallListCurrent, function (smallListCurrent) {
950
+ if (!props.small) {
951
+ return;
952
+ }
953
+
954
+ context.emit('update:modelValue', smallListCurrent);
955
+ context.emit('change', smallListCurrent);
956
+ });
957
+ (0,external_vue_.watch)(localLimit, function (localLimit) {
958
+ context.emit('limitChange', localLimit);
959
+ });
960
+ return {
961
+ totalPageNum: totalPageNum,
962
+ renderTotal: renderTotal,
963
+ renderList: renderList,
964
+ renderLimit: renderLimit,
965
+ renderSmallList: renderSmallList
966
+ };
967
+ },
968
+ render: function render() {
969
+ var _classes,
970
+ _this = this;
971
+
972
+ var paginationClass = (0,external_shared_.classes)((_classes = {
973
+ 'bk-pagination': true
974
+ }, _defineProperty(_classes, "bk-pagination--".concat(this.size), true), _defineProperty(_classes, "is-align-".concat(this.align), true), _classes));
975
+ var layoutMap = {
976
+ total: this.renderTotal,
977
+ list: this.small ? this.renderSmallList : this.renderList,
978
+ limit: this.renderLimit
979
+ };
980
+ return (0,external_vue_.createVNode)("div", {
981
+ "class": paginationClass
982
+ }, [this.layout.map(function (layout, index) {
983
+ return layoutMap[layout]({
984
+ isFirst: index === 0,
985
+ isLast: index === _this.layout.length - 1
986
+ });
987
+ })]);
988
+ }
989
+ }));
990
+ ;// CONCATENATED MODULE: ../../packages/pagination/src/index.ts
991
+ /*
992
+ * Tencent is pleased to support the open source community by making
993
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
994
+ *
995
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
996
+ *
997
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
998
+ *
999
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1000
+ *
1001
+ * ---------------------------------------------------
1002
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1003
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1004
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1005
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1006
+ *
1007
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1008
+ * the Software.
1009
+ *
1010
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1011
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1012
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1013
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1014
+ * IN THE SOFTWARE.
1015
+ */
1016
+
1017
+
1018
+ var BkPagination = (0,external_shared_.withInstall)(pagination);
1019
+ /* harmony default export */ const src = (BkPagination);
1020
+
1021
+ })();
1022
+
1023
+ /******/ return __webpack_exports__;
1024
+ /******/ })()
1025
+ ;
1026
+ });