bkui-vue 0.0.2-beta.75 → 0.0.2-beta.77

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