bkui-vue 0.0.1-beta.468 → 0.0.1-beta.469

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