bkui-vue 0.0.1-beta.393 → 0.0.1-beta.395

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 (175) hide show
  1. package/dist/index.cjs.js +36 -36
  2. package/dist/index.esm.js +93 -49
  3. package/dist/index.umd.js +36 -36
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +1 -353
  7. package/lib/alert/index.js +1 -251
  8. package/lib/animate-number/index.js +1 -226
  9. package/lib/backtop/index.js +1 -260
  10. package/lib/badge/badge.css +0 -2
  11. package/lib/badge/badge.less +2 -2
  12. package/lib/badge/badge.variable.css +0 -2
  13. package/lib/badge/index.js +1 -274
  14. package/lib/breadcrumb/index.js +1 -329
  15. package/lib/button/index.js +1 -371
  16. package/lib/card/index.js +1 -326
  17. package/lib/cascader/index.js +1 -2168
  18. package/lib/checkbox/index.js +1 -571
  19. package/lib/code-diff/index.js +1 -5520
  20. package/lib/collapse/collapse-panel.d.ts +11 -0
  21. package/lib/collapse/index.d.ts +20 -5
  22. package/lib/collapse/index.js +1 -698
  23. package/lib/collapse/props.d.ts +5 -0
  24. package/lib/color-picker/index.js +1 -2816
  25. package/lib/components.d.ts +2 -0
  26. package/lib/components.js +1 -759
  27. package/lib/container/index.js +1 -369
  28. package/lib/date-picker/index.js +1 -5601
  29. package/lib/dialog/index.js +1 -545
  30. package/lib/directives/index.js +2 -1427
  31. package/lib/directives/index.js.LICENSE.txt +14 -0
  32. package/lib/dist.index.js +1 -166
  33. package/lib/divider/index.js +1 -512
  34. package/lib/dropdown/index.js +1 -414
  35. package/lib/exception/exception.d.ts +13 -0
  36. package/lib/exception/index.d.ts +2 -0
  37. package/lib/exception/index.js +1 -405
  38. package/lib/fixed-navbar/index.js +1 -214
  39. package/lib/form/index.js +1 -986
  40. package/lib/icon/angle-double-down-line.js +1 -426
  41. package/lib/icon/angle-double-left-line.js +1 -426
  42. package/lib/icon/angle-double-left.js +1 -426
  43. package/lib/icon/angle-double-right-line.js +1 -426
  44. package/lib/icon/angle-double-right.js +1 -426
  45. package/lib/icon/angle-double-up-line.js +1 -426
  46. package/lib/icon/angle-down-fill.js +1 -426
  47. package/lib/icon/angle-down-line.js +1 -426
  48. package/lib/icon/angle-down.js +1 -426
  49. package/lib/icon/angle-left.js +1 -426
  50. package/lib/icon/angle-right.js +1 -426
  51. package/lib/icon/angle-up-fill.js +1 -426
  52. package/lib/icon/angle-up.js +1 -426
  53. package/lib/icon/archive-fill.js +1 -426
  54. package/lib/icon/arrows-left.js +1 -426
  55. package/lib/icon/arrows-right.js +1 -426
  56. package/lib/icon/audio-fill.js +1 -426
  57. package/lib/icon/bk.js +1 -426
  58. package/lib/icon/circle.js +1 -426
  59. package/lib/icon/close-line.js +1 -426
  60. package/lib/icon/close.js +1 -426
  61. package/lib/icon/code.js +1 -426
  62. package/lib/icon/cog-shape.js +1 -426
  63. package/lib/icon/collapse-left.js +1 -426
  64. package/lib/icon/copy.js +1 -426
  65. package/lib/icon/data-shape.js +1 -426
  66. package/lib/icon/del.js +1 -426
  67. package/lib/icon/doc-fill.js +1 -426
  68. package/lib/icon/done.js +1 -426
  69. package/lib/icon/down-shape.js +1 -426
  70. package/lib/icon/down-small.js +1 -426
  71. package/lib/icon/edit-line.js +1 -426
  72. package/lib/icon/ellipsis.js +1 -426
  73. package/lib/icon/enlarge-line.js +1 -426
  74. package/lib/icon/error.js +1 -426
  75. package/lib/icon/excel-fill.js +1 -426
  76. package/lib/icon/exclamation-circle-shape.js +1 -426
  77. package/lib/icon/eye.js +1 -426
  78. package/lib/icon/filliscreen-line.js +1 -426
  79. package/lib/icon/folder-open.js +1 -426
  80. package/lib/icon/folder-shape-open.js +1 -426
  81. package/lib/icon/folder-shape.js +1 -426
  82. package/lib/icon/folder.js +1 -426
  83. package/lib/icon/funnel.js +1 -426
  84. package/lib/icon/help-document-fill.js +1 -426
  85. package/lib/icon/help-fill.js +1 -426
  86. package/lib/icon/help.js +1 -426
  87. package/lib/icon/image-fill.js +1 -426
  88. package/lib/icon/img-placehoulder.js +1 -448
  89. package/lib/icon/index.js +1 -2275
  90. package/lib/icon/info-line.js +1 -448
  91. package/lib/icon/info.js +1 -448
  92. package/lib/icon/left-shape.js +1 -448
  93. package/lib/icon/left-turn-line.js +1 -448
  94. package/lib/icon/narrow-line.js +1 -448
  95. package/lib/icon/original.js +1 -448
  96. package/lib/icon/pdf-fill.js +1 -448
  97. package/lib/icon/play-shape.js +1 -448
  98. package/lib/icon/plus.js +1 -448
  99. package/lib/icon/ppt-fill.js +1 -448
  100. package/lib/icon/qq.js +1 -448
  101. package/lib/icon/right-shape.js +1 -448
  102. package/lib/icon/right-turn-line.js +1 -448
  103. package/lib/icon/search.js +1 -448
  104. package/lib/icon/share.js +1 -448
  105. package/lib/icon/spinner.js +1 -448
  106. package/lib/icon/success.js +1 -448
  107. package/lib/icon/switcher-loading.js +1 -448
  108. package/lib/icon/text-file.js +1 -448
  109. package/lib/icon/text-fill.js +1 -448
  110. package/lib/icon/transfer.js +1 -448
  111. package/lib/icon/tree-application-shape.js +1 -448
  112. package/lib/icon/unfull-screen.js +1 -448
  113. package/lib/icon/unvisible.js +1 -448
  114. package/lib/icon/up-shape.js +1 -448
  115. package/lib/icon/upload.js +1 -448
  116. package/lib/icon/video-fill.js +1 -448
  117. package/lib/icon/warn.js +1 -448
  118. package/lib/icon/weixin.js +1 -448
  119. package/lib/image/index.js +1 -873
  120. package/lib/index.js +1 -169
  121. package/lib/info-box/index.js +1 -1784
  122. package/lib/input/index.d.ts +4 -4
  123. package/lib/input/index.js +1 -846
  124. package/lib/input/input.d.ts +1 -1
  125. package/lib/link/index.js +1 -226
  126. package/lib/loading/index.js +1 -309
  127. package/lib/menu/index.js +1 -796
  128. package/lib/message/index.js +1 -401
  129. package/lib/modal/index.js +1 -395
  130. package/lib/navigation/index.js +1 -431
  131. package/lib/notify/index.js +1 -430
  132. package/lib/overflow-title/index.js +1 -512
  133. package/lib/pagination/index.js +1 -1026
  134. package/lib/plugin-popover/index.js +1 -2581
  135. package/lib/plugins/index.js +1 -130
  136. package/lib/popover/index.js +1 -2587
  137. package/lib/popover2/index.js +1 -172
  138. package/lib/preset.js +1 -129
  139. package/lib/process/index.js +1 -1417
  140. package/lib/progress/index.js +1 -479
  141. package/lib/radio/index.js +1 -649
  142. package/lib/rate/index.js +1 -358
  143. package/lib/resize-layout/index.js +1 -495
  144. package/lib/search-select/index.js +1 -3388
  145. package/lib/search-select/search-select.css +1 -1
  146. package/lib/search-select/search-select.less +1 -1
  147. package/lib/search-select/search-select.variable.css +1 -1
  148. package/lib/select/index.d.ts +9 -9
  149. package/lib/select/index.js +1 -2819
  150. package/lib/select/select.css +0 -1
  151. package/lib/select/select.d.ts +3 -3
  152. package/lib/select/select.less +0 -1
  153. package/lib/select/select.variable.css +0 -1
  154. package/lib/select/selectTagInput.d.ts +1 -1
  155. package/lib/shared/index.js +1 -2813
  156. package/lib/shared/vue-types.d.ts +1 -1
  157. package/lib/sideslider/index.js +1 -1362
  158. package/lib/slider/index.js +1 -2060
  159. package/lib/steps/index.js +1 -1504
  160. package/lib/swiper/index.js +1 -374
  161. package/lib/switcher/index.js +1 -308
  162. package/lib/tab/index.d.ts +10 -6
  163. package/lib/tab/index.js +1 -919
  164. package/lib/tab/props.d.ts +6 -0
  165. package/lib/table/index.js +1 -6635
  166. package/lib/table-column/index.js +1 -737
  167. package/lib/tag/index.js +1 -278
  168. package/lib/tag-input/index.js +1 -1897
  169. package/lib/time-picker/index.js +1 -142
  170. package/lib/timeline/index.js +1 -315
  171. package/lib/transfer/index.js +1 -658
  172. package/lib/tree/index.js +1 -2917
  173. package/lib/upload/index.js +1 -3735
  174. package/lib/virtual-render/index.js +1 -825
  175. package/package.json +2 -1
package/lib/tab/index.js CHANGED
@@ -1,919 +1 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("../shared"), require("vue"), require("vue-types"), require("../icon/"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["../shared", "vue", "vue-types", "../icon/"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("vue-types"), require("../icon/")) : factory(root["../shared"], root["vue"], root["vue-types"], root["../icon/"]);
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__210__, __WEBPACK_EXTERNAL_MODULE__7685__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ 7685:
16
- /***/ ((module) => {
17
-
18
- module.exports = __WEBPACK_EXTERNAL_MODULE__7685__;
19
-
20
- /***/ }),
21
-
22
- /***/ 4212:
23
- /***/ ((module) => {
24
-
25
- module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
26
-
27
- /***/ }),
28
-
29
- /***/ 748:
30
- /***/ ((module) => {
31
-
32
- module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
33
-
34
- /***/ }),
35
-
36
- /***/ 210:
37
- /***/ ((module) => {
38
-
39
- module.exports = __WEBPACK_EXTERNAL_MODULE__210__;
40
-
41
- /***/ })
42
-
43
- /******/ });
44
- /************************************************************************/
45
- /******/ // The module cache
46
- /******/ var __webpack_module_cache__ = {};
47
- /******/
48
- /******/ // The require function
49
- /******/ function __webpack_require__(moduleId) {
50
- /******/ // Check if module is in cache
51
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
52
- /******/ if (cachedModule !== undefined) {
53
- /******/ return cachedModule.exports;
54
- /******/ }
55
- /******/ // Create a new module (and put it into the cache)
56
- /******/ var module = __webpack_module_cache__[moduleId] = {
57
- /******/ // no module.id needed
58
- /******/ // no module.loaded needed
59
- /******/ exports: {}
60
- /******/ };
61
- /******/
62
- /******/ // Execute the module function
63
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
64
- /******/
65
- /******/ // Return the exports of the module
66
- /******/ return module.exports;
67
- /******/ }
68
- /******/
69
- /************************************************************************/
70
- /******/ /* webpack/runtime/define property getters */
71
- /******/ (() => {
72
- /******/ // define getter functions for harmony exports
73
- /******/ __webpack_require__.d = (exports, definition) => {
74
- /******/ for(var key in definition) {
75
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
76
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
77
- /******/ }
78
- /******/ }
79
- /******/ };
80
- /******/ })();
81
- /******/
82
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
83
- /******/ (() => {
84
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
85
- /******/ })();
86
- /******/
87
- /******/ /* webpack/runtime/make namespace object */
88
- /******/ (() => {
89
- /******/ // define __esModule on exports
90
- /******/ __webpack_require__.r = (exports) => {
91
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
92
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
93
- /******/ }
94
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
95
- /******/ };
96
- /******/ })();
97
- /******/
98
- /************************************************************************/
99
- var __webpack_exports__ = {};
100
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
101
- (() => {
102
- // ESM COMPAT FLAG
103
- __webpack_require__.r(__webpack_exports__);
104
-
105
- // EXPORTS
106
- __webpack_require__.d(__webpack_exports__, {
107
- "BkTab": () => (/* binding */ BkTab),
108
- "BkTabPanel": () => (/* reexport */ tab_panel),
109
- "default": () => (/* binding */ src)
110
- });
111
-
112
- // EXTERNAL MODULE: external "../shared"
113
- var external_shared_ = __webpack_require__(4212);
114
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
115
- function _arrayLikeToArray(arr, len) {
116
- if (len == null || len > arr.length) len = arr.length;
117
-
118
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
119
- arr2[i] = arr[i];
120
- }
121
-
122
- return arr2;
123
- }
124
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
125
-
126
- function _arrayWithoutHoles(arr) {
127
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
128
- }
129
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
130
- function _iterableToArray(iter) {
131
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
132
- }
133
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
134
-
135
- function _unsupportedIterableToArray(o, minLen) {
136
- if (!o) return;
137
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
138
- var n = Object.prototype.toString.call(o).slice(8, -1);
139
- if (n === "Object" && o.constructor) n = o.constructor.name;
140
- if (n === "Map" || n === "Set") return Array.from(o);
141
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
142
- }
143
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
144
- function _nonIterableSpread() {
145
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
146
- }
147
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
148
-
149
-
150
-
151
-
152
- function _toConsumableArray(arr) {
153
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
154
- }
155
- // EXTERNAL MODULE: external "vue"
156
- var external_vue_ = __webpack_require__(748);
157
- // EXTERNAL MODULE: external "vue-types"
158
- var external_vue_types_ = __webpack_require__(210);
159
- ;// CONCATENATED MODULE: ../../packages/tab/src/props.ts
160
-
161
-
162
- var TabTypeEnum;
163
-
164
- (function (TabTypeEnum) {
165
- TabTypeEnum["CARD"] = "card";
166
- TabTypeEnum["BORDER_CARD"] = "border-card";
167
- TabTypeEnum["UNBORDER_CARD"] = "unborder-card";
168
- TabTypeEnum["CARD_TAB"] = "card-tab";
169
- })(TabTypeEnum || (TabTypeEnum = {}));
170
-
171
- var PositionEnum;
172
-
173
- (function (PositionEnum) {
174
- PositionEnum["LEFT"] = "left";
175
- PositionEnum["RIGHT"] = "right";
176
- PositionEnum["TOP"] = "top";
177
- })(PositionEnum || (PositionEnum = {}));
178
-
179
- var tabPositionType = (0,external_vue_types_.toType)('position', {}).def(PositionEnum.TOP);
180
- var SortTypeEnum;
181
-
182
- (function (SortTypeEnum) {
183
- SortTypeEnum["REPLACE"] = "replace";
184
- SortTypeEnum["INSERT"] = "insert";
185
- })(SortTypeEnum || (SortTypeEnum = {}));
186
-
187
- var sortTypeUnion = (0,external_vue_types_.toType)('sortType', {}).def(SortTypeEnum.REPLACE);
188
- var tabNavEventProps = {
189
- tabAdd: {
190
- type: Function,
191
- "default": function _default() {
192
- return {};
193
- }
194
- },
195
- tabChange: {
196
- type: Function,
197
- "default": function _default(name) {
198
- return name;
199
- }
200
- },
201
- tabRemove: {
202
- type: Function,
203
- "default": function _default(name) {
204
- return name;
205
- }
206
- },
207
- tabSort: {
208
- type: Function,
209
- "default": function _default() {
210
- return {};
211
- } // default: (dragTabIndex: number, dropTabIndex: number, sortType: string):
212
- // {dragTabIndex: number, dropTabIndex: number, sortType: string} => ({ dragTabIndex, dropTabIndex, sortType }),
213
-
214
- },
215
- tabDrag: {
216
- type: Function,
217
- "default": function _default() {
218
- return {};
219
- }
220
- }
221
- };
222
- var tabEventProps = {
223
- add: {
224
- type: Function,
225
- "default": function _default() {
226
- return {};
227
- }
228
- },
229
- change: {
230
- type: Function,
231
- "default": function _default() {
232
- return {};
233
- }
234
- },
235
- remove: {
236
- type: Function,
237
- "default": function _default() {
238
- return {};
239
- }
240
- },
241
- sort: {
242
- type: Function,
243
- "default": function _default() {
244
- return {};
245
- }
246
- },
247
- drag: {
248
- type: Function,
249
- "default": function _default() {
250
- return {};
251
- }
252
- } // ...TabNavEventProps,
253
-
254
- };
255
- var tabProps = {
256
- active: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def(''),
257
- type: (0,external_vue_types_.toType)('type', {}).def(TabTypeEnum.BORDER_CARD),
258
- tabPosition: tabPositionType,
259
- closable: Boolean,
260
- addable: Boolean,
261
- sortable: Boolean,
262
- sortType: sortTypeUnion,
263
- labelHeight: external_shared_.PropTypes.number.def(50),
264
- scrollStep: external_shared_.PropTypes.number.def(200),
265
- extCls: external_shared_.PropTypes.string.def(''),
266
- validateActive: external_shared_.PropTypes.bool.def(true),
267
- showHeader: external_shared_.PropTypes.bool.def(true),
268
- changeOnHover: external_shared_.PropTypes.bool.def(false),
269
- changeOnHoverDelay: external_shared_.PropTypes.number.def(1000)
270
- };
271
- var tabNavProps = Object.assign({
272
- active: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def(''),
273
- // panels: PropTypes.arrayOf(PropTypes.any).def([]),
274
- panels: {
275
- type: Array,
276
- "default": function _default() {
277
- return [];
278
- }
279
- },
280
- tabPosition: tabPositionType,
281
- closable: Boolean,
282
- addable: Boolean,
283
- sortable: Boolean,
284
- sortType: sortTypeUnion,
285
- labelHeight: external_shared_.PropTypes.number.def(50),
286
- scrollStep: external_shared_.PropTypes.number.def(200),
287
- validateActive: external_shared_.PropTypes.bool.def(true),
288
- changeOnHover: external_shared_.PropTypes.bool.def(false),
289
- changeOnHoverDelay: external_shared_.PropTypes.number.def(1000)
290
- }, tabNavEventProps);
291
- var tabPanelProps = {
292
- name: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def(''),
293
- label: external_shared_.PropTypes.string || external_shared_.PropTypes.func,
294
- closable: external_shared_.PropTypes.bool,
295
- visible: external_shared_.PropTypes.bool.def(true),
296
- disabled: external_shared_.PropTypes.bool,
297
- sortable: external_shared_.PropTypes.bool,
298
- renderDirective: (0,external_shared_.renderDirectiveType)(),
299
- panel: external_shared_.PropTypes.string || external_shared_.PropTypes.func
300
- };
301
- // EXTERNAL MODULE: external "../icon/"
302
- var _ = __webpack_require__(7685);
303
- ;// CONCATENATED MODULE: ../../packages/tab/src/tab-nav.tsx
304
-
305
-
306
- /*
307
- * Tencent is pleased to support the open source community by making
308
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
309
- *
310
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
311
- *
312
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
313
- *
314
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
315
- *
316
- * ---------------------------------------------------
317
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
318
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
319
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
320
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
321
- *
322
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
323
- * the Software.
324
- *
325
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
326
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
327
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
328
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
329
- * IN THE SOFTWARE.
330
- */
331
-
332
-
333
-
334
-
335
- /* harmony default export */ const tab_nav = ((0,external_vue_.defineComponent)({
336
- name: 'TabNav',
337
- props: tabNavProps,
338
- setup: function setup(props) {
339
- var navs = (0,external_vue_.computed)(function () {
340
- if (!Array.isArray(props.panels) || !props.panels.length) {
341
- return [];
342
- }
343
-
344
- var list = [];
345
- var hasFindActive = false;
346
- props.panels.filter(function (item, index) {
347
- if (!item.props) {
348
- return null;
349
- }
350
-
351
- var _item$props = item.props,
352
- name = _item$props.name,
353
- label = _item$props.label,
354
- closable = _item$props.closable,
355
- visible = _item$props.visible,
356
- disabled = _item$props.disabled,
357
- sortable = _item$props.sortable;
358
-
359
- if (!visible) {
360
- return false;
361
- }
362
-
363
- if (props.active === name) {
364
- hasFindActive = true;
365
- }
366
-
367
- var renderLabel = function renderLabel(label) {
368
- if (item.slots.label) {
369
- return (0,external_vue_.h)(item.slots.label);
370
- }
371
-
372
- if ([undefined, ''].includes(label)) {
373
- return "\u9009\u9879\u5361".concat(index + 1);
374
- }
375
-
376
- if (typeof label === 'string') {
377
- return label;
378
- }
379
-
380
- if (typeof label === 'function') {
381
- return (0,external_vue_.h)(label);
382
- }
383
-
384
- return label;
385
- };
386
-
387
- list.push({
388
- name: name,
389
- closable: closable,
390
- visible: visible,
391
- disabled: disabled,
392
- sortable: sortable,
393
- tabLabel: renderLabel(label)
394
- });
395
- return true;
396
- });
397
-
398
- if (!hasFindActive && props.validateActive) {
399
- props.panels[0].props && props.tabChange(props.panels[0].props.name);
400
- }
401
-
402
- return list;
403
- });
404
- var dragenterIndex = (0,external_vue_.ref)(-1);
405
- var dragStartIndex = (0,external_vue_.ref)(-1);
406
- var draggingEle = (0,external_vue_.ref)('');
407
-
408
- var distinctRoots = function distinctRoots(el1, el2) {
409
- return el1 === el2;
410
- };
411
-
412
- var methods = {
413
- /**
414
- * @description 判断拖动的元素是否是在同一个tab。
415
- * 使用guid,相比 el1.parentNode === el2.parentNode 判断,性能要高
416
- * @param e {event} 触发的元素
417
- * @return {boolean}
418
- */
419
- handleTabAdd: function handleTabAdd(e) {
420
- props.tabAdd(e);
421
- },
422
- dragstart: function dragstart(index, $event) {
423
- dragStartIndex.value = index;
424
- draggingEle.value = props.guid; // 拖动鼠标效果
425
-
426
- Object.assign($event.dataTransfer, {
427
- effectAllowed: 'move'
428
- }); // $event.dataTransfer.setData('text/plain', index)
429
-
430
- props.tabDrag(index, $event);
431
- },
432
- dragenter: function dragenter(index) {
433
- // 缓存目标元素索引,方便添加样式
434
- if (distinctRoots(draggingEle.value, props.guid)) {
435
- dragenterIndex.value = index;
436
- }
437
- },
438
- dragend: function dragend() {
439
- dragenterIndex.value = -1;
440
- dragStartIndex.value = -1;
441
- draggingEle.value = null;
442
- },
443
- drop: function drop(index, sortType) {
444
- // 不是同一个tab,返回——暂时不支持跨tab拖动
445
- if (!distinctRoots(draggingEle.value, props.guid)) {
446
- return false;
447
- }
448
-
449
- props.tabSort(dragStartIndex.value, index, sortType);
450
- },
451
- handleTabChange: function handleTabChange(name) {
452
- props.tabChange(name);
453
- },
454
- handleTabRemove: function handleTabRemove(index, panel) {
455
- props.tabRemove(index, panel);
456
- }
457
- };
458
- return Object.assign(Object.assign({}, methods), {
459
- navs: navs,
460
- dragenterIndex: dragenterIndex,
461
- dragStartIndex: dragStartIndex,
462
- draggingEle: draggingEle,
463
- guid: Math.random().toString(16).substr(4) + Math.random().toString(16).substr(4)
464
- });
465
- },
466
- render: function render() {
467
- var _this = this;
468
-
469
- var active = this.active,
470
- closable = this.closable,
471
- addable = this.addable,
472
- sortable = this.sortable,
473
- sortType = this.sortType,
474
- labelHeight = this.labelHeight,
475
- dragstart = this.dragstart,
476
- dragenter = this.dragenter,
477
- dragend = this.dragend,
478
- drop = this.drop;
479
-
480
- var renderNavs = function renderNavs() {
481
- return _this.navs.map(function (item, index) {
482
- if (!item) {
483
- return null;
484
- }
485
-
486
- var name = item.name,
487
- disabled = item.disabled,
488
- tabLabel = item.tabLabel;
489
-
490
- var getNavItemClass = function getNavItemClass() {
491
- var classNames = [(0,external_shared_.resolveClassName)('tab-header-item')];
492
-
493
- if (disabled) {
494
- classNames.push((0,external_shared_.resolveClassName)('tab-header--disabled'));
495
- }
496
-
497
- if (active === name) {
498
- classNames.push((0,external_shared_.resolveClassName)('tab-header--active'));
499
- }
500
-
501
- return classNames.join(' ');
502
- }; // const getValue = (value, value2) => (typeof value === 'boolean' ? value : value2);
503
-
504
-
505
- var getValue = function getValue(curentValue, parentValue) {
506
- return curentValue || parentValue;
507
- };
508
-
509
- return (0,external_vue_.createVNode)("div", {
510
- "key": name,
511
- "onClick": function onClick() {
512
- return _this.handleTabChange(name);
513
- },
514
- "draggable": getValue(item.sortable, sortable),
515
- "onDragstart": function onDragstart(e) {
516
- return dragstart(index, e);
517
- },
518
- "onDragenter": function onDragenter(e) {
519
- e.preventDefault();
520
- dragenter(index);
521
- },
522
- "onDragleave": function onDragleave(e) {
523
- e.preventDefault();
524
- },
525
- "onDragover": function onDragover(e) {
526
- e.preventDefault();
527
- },
528
- "onDragend": function onDragend(e) {
529
- e.preventDefault();
530
- dragend();
531
- },
532
- "onDrop": function onDrop(e) {
533
- e.preventDefault();
534
- drop(index, sortType);
535
- },
536
- "class": getNavItemClass()
537
- }, [(0,external_vue_.createVNode)("div", null, [tabLabel]), getValue(item.closable, closable) && (0,external_vue_.createVNode)(_.Close, {
538
- "class": (0,external_shared_.resolveClassName)('tab-header-item-close'),
539
- "onClick": function onClick() {
540
- return _this.handleTabRemove(index, item);
541
- }
542
- }, null)]);
543
- });
544
- };
545
-
546
- var renderSlot = function renderSlot() {
547
- var _a, _b;
548
-
549
- var list = [];
550
-
551
- if (typeof _this.$slots.add === 'function') {
552
- list.push((_b = (_a = _this.$slots).add) === null || _b === void 0 ? void 0 : _b.call(_a, external_vue_.h));
553
- } else if (addable) {
554
- list.push((0,external_vue_.createVNode)("div", {
555
- "onClick": _this.handleTabAdd
556
- }, [(0,external_vue_.createVNode)(_.Plus, {
557
- "style": "display:flex;",
558
- "width": 26,
559
- "height": 26
560
- }, null)]));
561
- }
562
-
563
- if (list.length) {
564
- return (0,external_vue_.createVNode)("div", {
565
- "class": (0,external_shared_.resolveClassName)('tab-header-operation')
566
- }, [list.map(function (item, index) {
567
- return (0,external_vue_.createVNode)("div", {
568
- "class": (0,external_shared_.resolveClassName)('tab-header-item'),
569
- "key": index
570
- }, [item]);
571
- })]);
572
- }
573
-
574
- return null;
575
- };
576
-
577
- return (0,external_vue_.createVNode)("div", {
578
- "style": {
579
- lineHeight: "".concat(labelHeight, "px")
580
- },
581
- "class": (0,external_shared_.resolveClassName)('tab-header')
582
- }, [(0,external_vue_.createVNode)("div", {
583
- "class": (0,external_shared_.resolveClassName)('tab-header-nav')
584
- }, [renderNavs()]), renderSlot(), typeof this.$slots.setting === 'function' && (0,external_vue_.createVNode)("div", {
585
- "class": (0,external_shared_.resolveClassName)('tab-header-setting')
586
- }, [this.$slots.setting()])]);
587
- }
588
- }));
589
- ;// CONCATENATED MODULE: ../../packages/tab/src/tab.tsx
590
-
591
-
592
-
593
- /*
594
- * Tencent is pleased to support the open source community by making
595
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
596
- *
597
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
598
- *
599
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
600
- *
601
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
602
- *
603
- * ---------------------------------------------------
604
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
605
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
606
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
607
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
608
- *
609
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
610
- * the Software.
611
- *
612
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
613
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
614
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
615
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
616
- * IN THE SOFTWARE.
617
- */
618
-
619
-
620
-
621
-
622
- /* harmony default export */ const tab = ((0,external_vue_.defineComponent)({
623
- name: 'Tab',
624
- components: {
625
- TabNav: tab_nav
626
- },
627
- props: tabProps,
628
- emits: [// 兼容老方法
629
- 'add-panel', 'tab-change', 'remove-panel', 'sort-change', 'on-drag-tab', // 新方法
630
- 'add', 'change', 'remove', 'update:active', 'sort', 'drag'],
631
- setup: function setup(_props, _ref) {
632
- var slots = _ref.slots,
633
- emit = _ref.emit;
634
- var isMounted = (0,external_vue_.ref)(false);
635
- var panels = (0,external_vue_.ref)([]);
636
- var instance = (0,external_vue_.getCurrentInstance)(); // 动态插入tabPanel
637
-
638
- var getPaneInstanceFromSlot = function getPaneInstanceFromSlot(vnode) {
639
- var panelInstanceList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
640
- var children = vnode.children;
641
- (children || []).forEach(function (node) {
642
- var type = node.type;
643
- type = type.name || type;
644
-
645
- if (type === 'TabPanel' && node.component) {
646
- panelInstanceList.push(node.component);
647
- } else if (type === external_vue_.Fragment || type === 'template') {
648
- getPaneInstanceFromSlot(node, panelInstanceList);
649
- }
650
- });
651
- return panelInstanceList;
652
- };
653
-
654
- var setPanelInstances = function setPanelInstances() {
655
- if (slots["default"]) {
656
- var children = instance.subTree.children[1].children;
657
- if (!children) return;
658
- var content = children[0];
659
- var panelInstanceList = getPaneInstanceFromSlot(content);
660
- var isChanged = panelInstanceList.length !== panels.value.length;
661
-
662
- if (isChanged) {
663
- panels.value = panelInstanceList;
664
- }
665
- }
666
- };
667
-
668
- (0,external_vue_.onMounted)(function () {
669
- setPanelInstances();
670
- isMounted.value = true;
671
- });
672
- (0,external_vue_.onUpdated)(function () {
673
- setPanelInstances();
674
- });
675
- var methods = {
676
- tabAdd: function tabAdd(e) {
677
- emit('add', {
678
- e: e
679
- });
680
- emit('add-panel', {
681
- e: e
682
- });
683
- },
684
- tabChange: function tabChange(name) {
685
- // emit('xxx') 会调用onXxx函数, 所以不必在主动调用onXxx函数了
686
- emit('change', name);
687
- emit('tab-change', name);
688
- emit('update:active', name);
689
- },
690
- tabRemove: function tabRemove(index, panel) {
691
- // emit('xxx') 会调用onXxx函数, 所以不必在主动调用onXxx函数了
692
- emit('remove', index, panel);
693
- emit('remove-panel', index, panel);
694
- },
695
- tabSort: function tabSort(dragTabIndex, dropTabIndex, sortType) {
696
- var list = panels.value; // 如果是插队模式
697
-
698
- if (sortType === SortTypeEnum.INSERT) {
699
- if (dragTabIndex < dropTabIndex) {
700
- list.splice(dropTabIndex + 1, 0, panels[dragTabIndex]);
701
- list.splice(dragTabIndex, 1);
702
- } else if (dragTabIndex > dropTabIndex) {
703
- list.splice(dropTabIndex, 0, panels[dragTabIndex]);
704
- list.splice(dragTabIndex + 1, 1);
705
- } else {
706
- return false;
707
- }
708
- } else {
709
- var swap = list[dropTabIndex];
710
- list[dropTabIndex] = list[dragTabIndex];
711
- list[dragTabIndex] = swap;
712
- }
713
-
714
- panels.value = _toConsumableArray(list); // emit('xxx') 会调用onXxx函数, 所以不必在主动调用onXxx函数了
715
-
716
- emit('sort', dragTabIndex, dropTabIndex, sortType);
717
- emit('sort-change', dragTabIndex, dropTabIndex, sortType);
718
- },
719
- tabDrag: function tabDrag(dragTabIndex, dragEvent) {
720
- // emit('xxx') 会调用onXxx函数, 所以不必在主动调用onXxx函数了
721
- emit('drag', dragTabIndex, dragEvent);
722
- emit('on-drag-tab', dragTabIndex, dragEvent);
723
- }
724
- };
725
- return Object.assign(Object.assign({}, methods), {
726
- isMounted: isMounted,
727
- panels: panels
728
- });
729
- },
730
- render: function render() {
731
- var _this = this;
732
-
733
- var _a, _b;
734
-
735
- var getTabBoxClass = function getTabBoxClass() {
736
- var arr = [(0,external_shared_.resolveClassName)('tab'), _this.extCls];
737
-
738
- if (_this.tabPosition === PositionEnum.TOP) {
739
- arr.push((0,external_shared_.resolveClassName)("tab--".concat(_this.tabPosition)), (0,external_shared_.resolveClassName)("tab--".concat(_this.type)));
740
- } else {
741
- arr.push((0,external_shared_.resolveClassName)("tab--".concat(_this.tabPosition)));
742
-
743
- if (_this.type === TabTypeEnum.CARD_TAB) {
744
- arr.push((0,external_shared_.resolveClassName)('tab--vertical-tab'));
745
- }
746
- }
747
-
748
- return arr;
749
- };
750
-
751
- var getTabHeader = function getTabHeader() {
752
- var panels = _this.panels,
753
- active = _this.active,
754
- type = _this.type,
755
- closable = _this.closable,
756
- addable = _this.addable,
757
- sortable = _this.sortable,
758
- sortType = _this.sortType,
759
- labelHeight = _this.labelHeight,
760
- scrollStep = _this.scrollStep,
761
- validateActive = _this.validateActive,
762
- changeOnHover = _this.changeOnHover,
763
- changeOnHoverDelay = _this.changeOnHoverDelay,
764
- tabPosition = _this.tabPosition,
765
- tabAdd = _this.tabAdd,
766
- tabChange = _this.tabChange,
767
- tabRemove = _this.tabRemove,
768
- tabSort = _this.tabSort,
769
- tabDrag = _this.tabDrag;
770
- var props = {
771
- panels: panels,
772
- active: active,
773
- type: type,
774
- closable: closable,
775
- addable: addable,
776
- sortable: sortable,
777
- sortType: sortType,
778
- labelHeight: labelHeight,
779
- scrollStep: scrollStep,
780
- validateActive: validateActive,
781
- changeOnHover: changeOnHover,
782
- changeOnHoverDelay: changeOnHoverDelay,
783
- tabPosition: tabPosition,
784
- // function
785
- tabAdd: tabAdd,
786
- tabChange: tabChange,
787
- tabRemove: tabRemove,
788
- tabSort: tabSort,
789
- tabDrag: tabDrag
790
- };
791
-
792
- if (!panels || !Array.isArray(panels)) {
793
- return null;
794
- }
795
-
796
- return (0,external_vue_.createVNode)(tab_nav, props, _this.$slots);
797
- };
798
-
799
- return (0,external_vue_.createVNode)("div", {
800
- "class": getTabBoxClass()
801
- }, [getTabHeader(), (0,external_vue_.createVNode)("div", {
802
- "class": (0,external_shared_.resolveClassName)('tab-content')
803
- }, [(_b = (_a = this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a)])]);
804
- }
805
- }));
806
- ;// CONCATENATED MODULE: ../../packages/tab/src/tab-panel.tsx
807
-
808
-
809
- /*
810
- * Tencent is pleased to support the open source community by making
811
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
812
- *
813
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
814
- *
815
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
816
- *
817
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
818
- *
819
- * ---------------------------------------------------
820
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
821
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
822
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
823
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
824
- *
825
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
826
- * the Software.
827
- *
828
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
829
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
830
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
831
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
832
- * IN THE SOFTWARE.
833
- */
834
-
835
-
836
-
837
- /* harmony default export */ const tab_panel = ((0,external_vue_.defineComponent)({
838
- name: 'TabPanel',
839
- props: tabPanelProps,
840
- render: function render() {
841
- var _this = this;
842
-
843
- var active = this.name === this.$parent.active;
844
-
845
- var getContent = function getContent() {
846
- // 不渲染
847
- if (!_this.visible || _this.renderDirective === 'if' && !active) {
848
- return null;
849
- }
850
-
851
- if (typeof _this.panel === 'function') {
852
- return _this.panel(external_vue_.h);
853
- }
854
-
855
- if (typeof _this.$slots["default"] === 'function') {
856
- return _this.$slots["default"](null);
857
- }
858
-
859
- if (typeof _this.$slots.panel === 'function') {
860
- return _this.$slots.panel(null);
861
- }
862
-
863
- return null;
864
- };
865
-
866
- return (0,external_vue_.withDirectives)((0,external_vue_.createVNode)("div", {
867
- "ref": 'content',
868
- "class": (0,external_shared_.resolveClassName)('tab-panel')
869
- }, [getContent()]), [[external_vue_.vShow, active]]);
870
- }
871
- }));
872
- ;// CONCATENATED MODULE: ../../packages/tab/src/index.ts
873
- /*
874
- * Tencent is pleased to support the open source community by making
875
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
876
- *
877
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
878
- *
879
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
880
- *
881
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
882
- *
883
- * ---------------------------------------------------
884
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
885
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
886
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
887
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
888
- *
889
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
890
- * the Software.
891
- *
892
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
893
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
894
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
895
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
896
- * IN THE SOFTWARE.
897
- */
898
-
899
- /* import { withInstall } from '@bkui-vue/shared';
900
- const BkTab = withInstall(Tab);
901
- const BkTabPanel = withInstall(TabPanel);
902
- export {
903
- BkTab,
904
- BkTabPanel,
905
- };*/
906
-
907
-
908
-
909
- var BkTab = (0,external_shared_.withInstallProps)(tab, {
910
- TabPanel: tab_panel
911
- });
912
-
913
- /* harmony default export */ const src = (BkTab);
914
- })();
915
-
916
- /******/ return __webpack_exports__;
917
- /******/ })()
918
- ;
919
- });
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue-types"),require("vue"),require("../icon/"));else if("function"==typeof define&&define.amd)define(["../shared","vue-types","vue","../icon/"],t);else{var a="object"==typeof exports?t(require("../shared"),require("vue-types"),require("vue"),require("../icon/")):t(e["../shared"],e["vue-types"],e.vue,e["../icon/"]);for(var n in a)("object"==typeof exports?exports:e)[n]=a[n]}}(self,((e,t,a,n)=>(()=>{"use strict";var r={7685:e=>{e.exports=n},4212:t=>{t.exports=e},748:e=>{e.exports=a},210:e=>{e.exports=t}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return r[e](a,a.exports,s),a.exports}s.d=(e,t)=>{for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{s.r(l),s.d(l,{BkTab:()=>m,BkTabPanel:()=>g,PositionEnum:()=>t,SortTypeEnum:()=>r,default:()=>T});var e,t,a=s(4212),n=s(210);!function(e){e.CARD="card",e.BORDER_CARD="border-card",e.UNBORDER_CARD="unborder-card",e.CARD_TAB="card-tab"}(e||(e={})),function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top"}(t||(t={}));var r,o=(0,n.toType)("position",{}).def(t.TOP);!function(e){e.REPLACE="replace",e.INSERT="insert"}(r||(r={}));var i=(0,n.toType)("sortType",{}).def(r.REPLACE),u={tabAdd:{type:Function,default:function(){return{}}},tabChange:{type:Function,default:function(e){return e}},tabRemove:{type:Function,default:function(e){return e}},tabSort:{type:Function,default:function(){return{}}},tabDrag:{type:Function,default:function(){return{}}}},d={active:a.PropTypes.oneOfType([a.PropTypes.number,a.PropTypes.string]).def(""),type:(0,n.toType)("type",{}).def(e.BORDER_CARD),tabPosition:o,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:i,labelHeight:a.PropTypes.number.def(50),scrollStep:a.PropTypes.number.def(200),extCls:a.PropTypes.string.def(""),validateActive:a.PropTypes.bool.def(!0),showHeader:a.PropTypes.bool.def(!0),changeOnHover:a.PropTypes.bool.def(!1),changeOnHoverDelay:a.PropTypes.number.def(1e3)},p=Object.assign({active:a.PropTypes.oneOfType([a.PropTypes.number,a.PropTypes.string]).def(""),panels:{type:Array,default:function(){return[]}},tabPosition:o,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:i,labelHeight:a.PropTypes.number.def(50),scrollStep:a.PropTypes.number.def(200),validateActive:a.PropTypes.bool.def(!0),changeOnHover:a.PropTypes.bool.def(!1),changeOnHoverDelay:a.PropTypes.number.def(1e3)},u),c={name:a.PropTypes.oneOfType([a.PropTypes.number,a.PropTypes.string]).def(""),label:a.PropTypes.string||a.PropTypes.func,closable:a.PropTypes.bool,visible:a.PropTypes.bool.def(!0),disabled:a.PropTypes.bool,sortable:a.PropTypes.bool,renderDirective:(0,a.renderDirectiveType)(),panel:a.PropTypes.string||a.PropTypes.func};function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var f=s(748),v=s(7685);const y=(0,f.defineComponent)({name:"TabNav",props:p,setup:function(e){var t=(0,f.computed)((function(){if(!Array.isArray(e.panels)||!e.panels.length)return[];var t=[],a=!1;return e.panels.filter((function(n,r){if(!n.props)return null;var o=n.props,s=o.name,l=o.label,i=o.closable,u=o.visible,d=o.disabled,p=o.sortable;return!!u&&(e.active===s&&(a=!0),t.push({name:s,closable:i,visible:u,disabled:d,sortable:p,tabLabel:function(e){return n.slots.label?(0,f.h)(n.slots.label):[void 0,""].includes(e)?"选项卡".concat(r+1):"string"==typeof e?e:"function"==typeof e?(0,f.h)(e):e}(l)}),!0)})),!a&&e.validateActive&&e.panels[0].props&&e.tabChange(e.panels[0].props.name),t})),a=(0,f.ref)(-1),n=(0,f.ref)(-1),r=(0,f.ref)(""),o=function(e,t){return e===t},s={handleTabAdd:function(t){e.tabAdd(t)},dragstart:function(t,a){n.value=t,r.value=e.guid,Object.assign(a.dataTransfer,{effectAllowed:"move"}),e.tabDrag(t,a)},dragenter:function(t){o(r.value,e.guid)&&(a.value=t)},dragend:function(){a.value=-1,n.value=-1,r.value=null},drop:function(t,a){if(!o(r.value,e.guid))return!1;e.tabSort(n.value,t,a)},handleTabChange:function(t){e.tabChange(t)},handleTabRemove:function(t,a){e.tabRemove(t,a)}};return Object.assign(Object.assign({},s),{navs:t,dragenterIndex:a,dragStartIndex:n,draggingEle:r,guid:Math.random().toString(16).substr(4)+Math.random().toString(16).substr(4)})},render:function(){var e,t,n,r=this,o=this.active,s=this.closable,l=this.addable,i=this.sortable,u=this.sortType,d=this.labelHeight,p=this.dragstart,c=this.dragenter,b=this.dragend,y=this.drop;return(0,f.createVNode)("div",{style:{lineHeight:"".concat(d,"px")},class:(0,a.resolveClassName)("tab-header")},[(0,f.createVNode)("div",{class:(0,a.resolveClassName)("tab-header-nav")},[r.navs.map((function(e,t){if(!e)return null;var n,l=e.name,d=e.disabled,h=e.tabLabel,g=function(e,t){return e||t};return(0,f.createVNode)("div",{key:l,onClick:function(){return r.handleTabChange(l)},draggable:g(e.sortable,i),onDragstart:function(e){return p(t,e)},onDragenter:function(e){e.preventDefault(),c(t)},onDragleave:function(e){e.preventDefault()},onDragover:function(e){e.preventDefault()},onDragend:function(e){e.preventDefault(),b()},onDrop:function(e){e.preventDefault(),y(t,u)},class:(n=[(0,a.resolveClassName)("tab-header-item")],d&&n.push((0,a.resolveClassName)("tab-header--disabled")),o===l&&n.push((0,a.resolveClassName)("tab-header--active")),n.join(" "))},[(0,f.createVNode)("div",null,[h]),g(e.closable,s)&&(0,f.createVNode)(v.Close,{class:(0,a.resolveClassName)("tab-header-item-close"),onClick:function(){return r.handleTabRemove(t,e)}},null)])}))]),(n=[],"function"==typeof r.$slots.add?n.push(null===(t=(e=r.$slots).add)||void 0===t?void 0:t.call(e,f.h)):l&&n.push((0,f.createVNode)("div",{onClick:r.handleTabAdd},[(0,f.createVNode)(v.Plus,{style:"display:flex;",width:26,height:26},null)])),n.length?(0,f.createVNode)("div",{class:(0,a.resolveClassName)("tab-header-operation")},[n.map((function(e,t){return(0,f.createVNode)("div",{class:(0,a.resolveClassName)("tab-header-item"),key:t},[e])}))]):null),"function"==typeof this.$slots.setting&&(0,f.createVNode)("div",{class:(0,a.resolveClassName)("tab-header-setting")},[this.$slots.setting()])])}}),h=(0,f.defineComponent)({name:"Tab",components:{TabNav:y},props:d,emits:["add-panel","tab-change","remove-panel","sort-change","on-drag-tab","add","change","remove","update:active","sort","drag"],setup:function(e,t){var a=t.slots,n=t.emit,o=(0,f.ref)(!1),s=(0,f.ref)([]),l=(0,f.getCurrentInstance)(),i=function e(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=t.children;return(n||[]).forEach((function(t){var n=t.type;"TabPanel"===(n=n.name||n)&&t.component?a.push(t.component):n!==f.Fragment&&"template"!==n||e(t,a)})),a},u=function(){if(a.default){var e=l.subTree.children[1].children;if(!e)return;var t=e[0],n=i(t);n.length!==s.value.length&&(s.value=n)}};(0,f.onMounted)((function(){u(),o.value=!0})),(0,f.onUpdated)((function(){u()}));var d={tabAdd:function(e){n("add",{e}),n("add-panel",{e})},tabChange:function(e){n("change",e),n("tab-change",e),n("update:active",e)},tabRemove:function(e,t){n("remove",e,t),n("remove-panel",e,t)},tabSort:function(e,t,a){var o,l=s.value;if(a===r.INSERT)if(e<t)l.splice(t+1,0,s[e]),l.splice(e,1);else{if(!(e>t))return!1;l.splice(t,0,s[e]),l.splice(e+1,1)}else{var i=l[t];l[t]=l[e],l[e]=i}s.value=function(e){if(Array.isArray(e))return b(e)}(o=l)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?b(e,t):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n("sort",e,t,a),n("sort-change",e,t,a)},tabDrag:function(e,t){n("drag",e,t),n("on-drag-tab",e,t)}};return Object.assign(Object.assign({},d),{isMounted:o,panels:s})},render:function(){var n,r,o,s,l,i=this;return(0,f.createVNode)("div",{class:(l=[(0,a.resolveClassName)("tab"),i.extCls],i.tabPosition===t.TOP?l.push((0,a.resolveClassName)("tab--".concat(i.tabPosition)),(0,a.resolveClassName)("tab--".concat(i.type))):(l.push((0,a.resolveClassName)("tab--".concat(i.tabPosition))),i.type===e.CARD_TAB&&l.push((0,a.resolveClassName)("tab--vertical-tab"))),l)},[(o=i.panels,s={panels:o,active:i.active,type:i.type,closable:i.closable,addable:i.addable,sortable:i.sortable,sortType:i.sortType,labelHeight:i.labelHeight,scrollStep:i.scrollStep,validateActive:i.validateActive,changeOnHover:i.changeOnHover,changeOnHoverDelay:i.changeOnHoverDelay,tabPosition:i.tabPosition,tabAdd:i.tabAdd,tabChange:i.tabChange,tabRemove:i.tabRemove,tabSort:i.tabSort,tabDrag:i.tabDrag},o&&Array.isArray(o)?(0,f.createVNode)(y,s,i.$slots):null),(0,f.createVNode)("div",{class:(0,a.resolveClassName)("tab-content")},[null===(r=(n=this.$slots).default)||void 0===r?void 0:r.call(n)])])}}),g=(0,f.defineComponent)({name:"TabPanel",props:c,render:function(){var e=this,t=this.name===this.$parent.active;return(0,f.withDirectives)((0,f.createVNode)("div",{ref:"content",class:(0,a.resolveClassName)("tab-panel")},[!e.visible||"if"===e.renderDirective&&!t?null:"function"==typeof e.panel?e.panel(f.h):"function"==typeof e.$slots.default?e.$slots.default(null):"function"==typeof e.$slots.panel?e.$slots.panel(null):null]),[[f.vShow,t]])}});var m=(0,a.withInstallProps)(h,{TabPanel:g});const T=m})(),l})()));