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

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 (155) hide show
  1. package/dist/index.cjs.js +36 -36
  2. package/dist/index.esm.js +33 -3
  3. package/dist/index.umd.js +35 -35
  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/index.js +1 -274
  11. package/lib/breadcrumb/index.js +1 -329
  12. package/lib/button/index.js +1 -371
  13. package/lib/card/index.js +1 -326
  14. package/lib/cascader/index.js +1 -2168
  15. package/lib/checkbox/index.js +1 -571
  16. package/lib/code-diff/index.js +1 -5520
  17. package/lib/collapse/index.js +1 -698
  18. package/lib/color-picker/index.js +1 -2816
  19. package/lib/components.js +1 -759
  20. package/lib/container/index.js +1 -369
  21. package/lib/date-picker/index.js +1 -5601
  22. package/lib/dialog/index.js +1 -545
  23. package/lib/directives/index.js +2 -1427
  24. package/lib/directives/index.js.LICENSE.txt +14 -0
  25. package/lib/dist.index.js +1 -166
  26. package/lib/divider/index.js +1 -512
  27. package/lib/dropdown/index.js +1 -414
  28. package/lib/exception/index.js +1 -405
  29. package/lib/fixed-navbar/index.js +1 -214
  30. package/lib/form/index.js +1 -986
  31. package/lib/icon/angle-double-down-line.js +1 -426
  32. package/lib/icon/angle-double-left-line.js +1 -426
  33. package/lib/icon/angle-double-left.js +1 -426
  34. package/lib/icon/angle-double-right-line.js +1 -426
  35. package/lib/icon/angle-double-right.js +1 -426
  36. package/lib/icon/angle-double-up-line.js +1 -426
  37. package/lib/icon/angle-down-fill.js +1 -426
  38. package/lib/icon/angle-down-line.js +1 -426
  39. package/lib/icon/angle-down.js +1 -426
  40. package/lib/icon/angle-left.js +1 -426
  41. package/lib/icon/angle-right.js +1 -426
  42. package/lib/icon/angle-up-fill.js +1 -426
  43. package/lib/icon/angle-up.js +1 -426
  44. package/lib/icon/archive-fill.js +1 -426
  45. package/lib/icon/arrows-left.js +1 -426
  46. package/lib/icon/arrows-right.js +1 -426
  47. package/lib/icon/audio-fill.js +1 -426
  48. package/lib/icon/bk.js +1 -426
  49. package/lib/icon/circle.js +1 -426
  50. package/lib/icon/close-line.js +1 -426
  51. package/lib/icon/close.js +1 -426
  52. package/lib/icon/code.js +1 -426
  53. package/lib/icon/cog-shape.js +1 -426
  54. package/lib/icon/collapse-left.js +1 -426
  55. package/lib/icon/copy.js +1 -426
  56. package/lib/icon/data-shape.js +1 -426
  57. package/lib/icon/del.js +1 -426
  58. package/lib/icon/doc-fill.js +1 -426
  59. package/lib/icon/done.js +1 -426
  60. package/lib/icon/down-shape.js +1 -426
  61. package/lib/icon/down-small.js +1 -426
  62. package/lib/icon/edit-line.js +1 -426
  63. package/lib/icon/ellipsis.js +1 -426
  64. package/lib/icon/enlarge-line.js +1 -426
  65. package/lib/icon/error.js +1 -426
  66. package/lib/icon/excel-fill.js +1 -426
  67. package/lib/icon/exclamation-circle-shape.js +1 -426
  68. package/lib/icon/eye.js +1 -426
  69. package/lib/icon/filliscreen-line.js +1 -426
  70. package/lib/icon/folder-open.js +1 -426
  71. package/lib/icon/folder-shape-open.js +1 -426
  72. package/lib/icon/folder-shape.js +1 -426
  73. package/lib/icon/folder.js +1 -426
  74. package/lib/icon/funnel.js +1 -426
  75. package/lib/icon/help-document-fill.js +1 -426
  76. package/lib/icon/help-fill.js +1 -426
  77. package/lib/icon/help.js +1 -426
  78. package/lib/icon/image-fill.js +1 -426
  79. package/lib/icon/img-placehoulder.js +1 -448
  80. package/lib/icon/index.js +1 -2275
  81. package/lib/icon/info-line.js +1 -448
  82. package/lib/icon/info.js +1 -448
  83. package/lib/icon/left-shape.js +1 -448
  84. package/lib/icon/left-turn-line.js +1 -448
  85. package/lib/icon/narrow-line.js +1 -448
  86. package/lib/icon/original.js +1 -448
  87. package/lib/icon/pdf-fill.js +1 -448
  88. package/lib/icon/play-shape.js +1 -448
  89. package/lib/icon/plus.js +1 -448
  90. package/lib/icon/ppt-fill.js +1 -448
  91. package/lib/icon/qq.js +1 -448
  92. package/lib/icon/right-shape.js +1 -448
  93. package/lib/icon/right-turn-line.js +1 -448
  94. package/lib/icon/search.js +1 -448
  95. package/lib/icon/share.js +1 -448
  96. package/lib/icon/spinner.js +1 -448
  97. package/lib/icon/success.js +1 -448
  98. package/lib/icon/switcher-loading.js +1 -448
  99. package/lib/icon/text-file.js +1 -448
  100. package/lib/icon/text-fill.js +1 -448
  101. package/lib/icon/transfer.js +1 -448
  102. package/lib/icon/tree-application-shape.js +1 -448
  103. package/lib/icon/unfull-screen.js +1 -448
  104. package/lib/icon/unvisible.js +1 -448
  105. package/lib/icon/up-shape.js +1 -448
  106. package/lib/icon/upload.js +1 -448
  107. package/lib/icon/video-fill.js +1 -448
  108. package/lib/icon/warn.js +1 -448
  109. package/lib/icon/weixin.js +1 -448
  110. package/lib/image/index.js +1 -873
  111. package/lib/index.js +1 -169
  112. package/lib/info-box/index.js +1 -1784
  113. package/lib/input/index.js +1 -846
  114. package/lib/link/index.js +1 -226
  115. package/lib/loading/index.js +1 -309
  116. package/lib/menu/index.js +1 -796
  117. package/lib/message/index.js +1 -401
  118. package/lib/modal/index.js +1 -395
  119. package/lib/navigation/index.js +1 -431
  120. package/lib/notify/index.js +1 -430
  121. package/lib/overflow-title/index.js +1 -512
  122. package/lib/pagination/index.js +1 -1026
  123. package/lib/plugin-popover/index.js +1 -2581
  124. package/lib/plugins/index.js +1 -130
  125. package/lib/popover/index.js +1 -2587
  126. package/lib/popover2/index.js +1 -172
  127. package/lib/preset.js +1 -129
  128. package/lib/process/index.js +1 -1417
  129. package/lib/progress/index.js +1 -479
  130. package/lib/radio/index.js +1 -649
  131. package/lib/rate/index.js +1 -358
  132. package/lib/resize-layout/index.js +1 -495
  133. package/lib/search-select/index.js +1 -3388
  134. package/lib/search-select/search-select.css +1 -1
  135. package/lib/search-select/search-select.less +1 -1
  136. package/lib/search-select/search-select.variable.css +1 -1
  137. package/lib/select/index.js +1 -2819
  138. package/lib/shared/index.js +1 -2813
  139. package/lib/sideslider/index.js +1 -1362
  140. package/lib/slider/index.js +1 -2060
  141. package/lib/steps/index.js +1 -1504
  142. package/lib/swiper/index.js +1 -374
  143. package/lib/switcher/index.js +1 -308
  144. package/lib/tab/index.js +1 -919
  145. package/lib/table/index.js +1 -6635
  146. package/lib/table-column/index.js +1 -737
  147. package/lib/tag/index.js +1 -278
  148. package/lib/tag-input/index.js +1 -1897
  149. package/lib/time-picker/index.js +1 -142
  150. package/lib/timeline/index.js +1 -315
  151. package/lib/transfer/index.js +1 -658
  152. package/lib/tree/index.js +1 -2917
  153. package/lib/upload/index.js +1 -3735
  154. package/lib/virtual-render/index.js +1 -825
  155. package/package.json +2 -1
@@ -1,698 +1 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("../shared"), require("vue"), require("../icon"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["../shared", "vue", "../icon"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("../icon")) : factory(root["../shared"], root["vue"], 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__6870__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ 6870:
16
- /***/ ((module) => {
17
-
18
- module.exports = __WEBPACK_EXTERNAL_MODULE__6870__;
19
-
20
- /***/ }),
21
-
22
- /***/ 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
- /******/ });
37
- /************************************************************************/
38
- /******/ // The module cache
39
- /******/ var __webpack_module_cache__ = {};
40
- /******/
41
- /******/ // The require function
42
- /******/ function __webpack_require__(moduleId) {
43
- /******/ // Check if module is in cache
44
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
45
- /******/ if (cachedModule !== undefined) {
46
- /******/ return cachedModule.exports;
47
- /******/ }
48
- /******/ // Create a new module (and put it into the cache)
49
- /******/ var module = __webpack_module_cache__[moduleId] = {
50
- /******/ // no module.id needed
51
- /******/ // no module.loaded needed
52
- /******/ exports: {}
53
- /******/ };
54
- /******/
55
- /******/ // Execute the module function
56
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
57
- /******/
58
- /******/ // Return the exports of the module
59
- /******/ return module.exports;
60
- /******/ }
61
- /******/
62
- /************************************************************************/
63
- /******/ /* webpack/runtime/define property getters */
64
- /******/ (() => {
65
- /******/ // define getter functions for harmony exports
66
- /******/ __webpack_require__.d = (exports, definition) => {
67
- /******/ for(var key in definition) {
68
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
69
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
70
- /******/ }
71
- /******/ }
72
- /******/ };
73
- /******/ })();
74
- /******/
75
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
76
- /******/ (() => {
77
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
78
- /******/ })();
79
- /******/
80
- /******/ /* webpack/runtime/make namespace object */
81
- /******/ (() => {
82
- /******/ // define __esModule on exports
83
- /******/ __webpack_require__.r = (exports) => {
84
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
85
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
86
- /******/ }
87
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
88
- /******/ };
89
- /******/ })();
90
- /******/
91
- /************************************************************************/
92
- var __webpack_exports__ = {};
93
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
94
- (() => {
95
- // ESM COMPAT FLAG
96
- __webpack_require__.r(__webpack_exports__);
97
-
98
- // EXPORTS
99
- __webpack_require__.d(__webpack_exports__, {
100
- "BkCollapsePanel": () => (/* reexport */ collapse_panel),
101
- "Collapse": () => (/* reexport */ collapse),
102
- "default": () => (/* binding */ src)
103
- });
104
-
105
- // EXTERNAL MODULE: external "../shared"
106
- var external_shared_ = __webpack_require__(4212);
107
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
108
- function _arrayLikeToArray(arr, len) {
109
- if (len == null || len > arr.length) len = arr.length;
110
-
111
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
112
- arr2[i] = arr[i];
113
- }
114
-
115
- return arr2;
116
- }
117
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
118
-
119
- function _arrayWithoutHoles(arr) {
120
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
121
- }
122
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
123
- function _iterableToArray(iter) {
124
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
125
- }
126
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
127
-
128
- function _unsupportedIterableToArray(o, minLen) {
129
- if (!o) return;
130
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
131
- var n = Object.prototype.toString.call(o).slice(8, -1);
132
- if (n === "Object" && o.constructor) n = o.constructor.name;
133
- if (n === "Map" || n === "Set") return Array.from(o);
134
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
135
- }
136
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
137
- function _nonIterableSpread() {
138
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
139
- }
140
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
141
-
142
-
143
-
144
-
145
- function _toConsumableArray(arr) {
146
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
147
- }
148
- // EXTERNAL MODULE: external "vue"
149
- var external_vue_ = __webpack_require__(748);
150
- // EXTERNAL MODULE: external "../icon"
151
- var external_icon_ = __webpack_require__(6870);
152
- ;// CONCATENATED MODULE: ../../packages/collapse/src/props.ts
153
- /*
154
- * Tencent is pleased to support the open source community by making
155
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
156
- *
157
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
158
- *
159
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
160
- *
161
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
162
- *
163
- * ---------------------------------------------------
164
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
165
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
166
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
167
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
168
- *
169
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
170
- * the Software.
171
- *
172
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
173
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
174
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
175
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
176
- * IN THE SOFTWARE.
177
- */
178
-
179
- var propsCollapse = {
180
- /**
181
- * 渲染列表
182
- * 对象数组或者字符串数组,字符串数组默认会增加 name 字段,值为传入的字符串值
183
- */
184
- list: external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.any).def([]),
185
-
186
- /**
187
- * ID字段
188
- */
189
- idFiled: external_shared_.PropTypes.string.def('$index'),
190
-
191
- /**
192
- * Title 字段
193
- */
194
- titleField: external_shared_.PropTypes.string.def('name'),
195
-
196
- /**
197
- * Content 字段,默认渲染内容,不配置时自动读取 content 字段
198
- * 自定义配置slot时可以忽略
199
- */
200
- contentField: external_shared_.PropTypes.string.def('content'),
201
-
202
- /**
203
- * 当前激活Index
204
- */
205
- modelValue: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.number).def([]), external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.string).def([]), external_shared_.PropTypes.number.def(-1)]),
206
-
207
- /**
208
- * 是否使用手风琴效果
209
- */
210
- accordion: external_shared_.PropTypes.bool.def(false)
211
- };
212
- var CollapsePanelEventProps = {
213
- itemClick: {
214
- type: Function
215
- }
216
- };
217
- var propsCollapsePanel = Object.assign({
218
- name: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def(''),
219
- title: external_shared_.PropTypes.any,
220
- content: external_shared_.PropTypes.string,
221
- disabled: external_shared_.PropTypes.bool.def(false),
222
- isFormList: external_shared_.PropTypes.bool.def(false),
223
- renderDirective: (0,external_shared_.renderDirectiveType)(),
224
- modelValue: external_shared_.PropTypes.bool.def(false)
225
- }, CollapsePanelEventProps);
226
- ;// CONCATENATED MODULE: ../../packages/collapse/src/utils.ts
227
-
228
-
229
- /* eslint-disable no-param-reassign */
230
-
231
- /*
232
- * Tencent is pleased to support the open source community by making
233
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
234
- *
235
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
236
- *
237
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
238
- *
239
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
240
- *
241
- * ---------------------------------------------------
242
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
243
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
244
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
245
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
246
- *
247
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
248
- * the Software.
249
- *
250
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
251
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
252
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
253
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
254
- * IN THE SOFTWARE.
255
- */
256
- var trimArr = function trimArr(s) {
257
- return (s || '').split(' ').filter(function (item) {
258
- return !!item.trim();
259
- });
260
- };
261
-
262
- function removeClass(el, cls) {
263
- if (!el || !cls) return;
264
- var classes = trimArr(cls);
265
- var curClass = el.getAttribute('class') || '';
266
-
267
- if (el.classList) {
268
- var _el$classList;
269
-
270
- (_el$classList = el.classList).remove.apply(_el$classList, _toConsumableArray(classes));
271
-
272
- return;
273
- }
274
-
275
- classes.forEach(function (item) {
276
- curClass = curClass.replace(" ".concat(item, " "), ' ');
277
- });
278
- var className = trimArr(curClass).join(' ');
279
- el.setAttribute('class', className);
280
- }
281
- /* istanbul ignore next */
282
-
283
- function addClass(el, cls) {
284
- if (!el) return;
285
- var className = el.getAttribute('class') || '';
286
- var curClass = trimArr(className);
287
- var classes = (cls || '').split(' ').filter(function (item) {
288
- return !curClass.includes(item) && !!item.trim();
289
- });
290
-
291
- if (el.classList) {
292
- var _el$classList2;
293
-
294
- (_el$classList2 = el.classList).add.apply(_el$classList2, _toConsumableArray(classes));
295
- } else {
296
- className += " ".concat(classes.join(' '));
297
- el.setAttribute('class', className);
298
- }
299
- }
300
- var collapseMotion = function collapseMotion(emit) {
301
- return {
302
- css: true,
303
- onBeforeEnter: function onBeforeEnter(el) {
304
- addClass(el, 'collapse-transition');
305
- if (!el.dataset) el.dataset = {};
306
- el.style.height = '0px'; // el.style.maxHeight = '0px';
307
- },
308
- onEnter: function onEnter(el) {
309
- el.dataset.oldOverflow = el.style.overflow;
310
-
311
- if (el.scrollHeight !== 0) {
312
- el.style.height = "".concat(el.scrollHeight, "px");
313
- el.style.maxHeight = "".concat(el.scrollHeight, "px");
314
- } else {
315
- el.style.height = '0px';
316
- }
317
-
318
- el.style.overflow = 'hidden';
319
- },
320
- onAfterEnter: function onAfterEnter(el) {
321
- el.style.height = '';
322
- el.style.maxHeight = '';
323
- el.style.overflow = el.dataset.oldOverflow;
324
- removeClass(el, 'collapse-transition');
325
- emit('before-enter');
326
- },
327
- onBeforeLeave: function onBeforeLeave(el) {
328
- if (!el.dataset) el.dataset = {};
329
- el.dataset.oldOverflow = el.style.overflow;
330
- el.style.height = "".concat(el.scrollHeight, "px");
331
- el.style.maxHeight = "".concat(el.scrollHeight, "px");
332
- el.style.overflow = 'hidden';
333
- },
334
- onLeave: function onLeave(el) {
335
- if (el.scrollHeight !== 0) {
336
- addClass(el, 'collapse-transition');
337
- el.style.transitionProperty = 'height';
338
- el.style.height = '0px';
339
- }
340
- },
341
- onAfterLeave: function onAfterLeave(el) {
342
- removeClass(el, 'collapse-transition');
343
- el.style.height = '';
344
- el.style.maxHeight = '';
345
- el.style.overflow = el.dataset.oldOverflow;
346
- emit('after-leave');
347
- }
348
- };
349
- };
350
- ;// CONCATENATED MODULE: ../../packages/collapse/src/collapse-panel.tsx
351
-
352
-
353
- /*
354
- * Tencent is pleased to support the open source community by making
355
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
356
- *
357
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
358
- *
359
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
360
- *
361
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
362
- *
363
- * ---------------------------------------------------
364
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
365
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
366
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
367
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
368
- *
369
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
370
- * the Software.
371
- *
372
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
373
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
374
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
375
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
376
- * IN THE SOFTWARE.
377
- */
378
-
379
-
380
-
381
-
382
-
383
- function _isSlot(s) {
384
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_.isVNode)(s);
385
- }
386
-
387
- /* harmony default export */ const collapse_panel = ((0,external_vue_.defineComponent)({
388
- name: 'CollapsePanel',
389
- props: propsCollapsePanel,
390
- emits: ['change', 'update:modelValue', 'after-leave', 'before-enter'],
391
- setup: function setup(props, _ref) {
392
- var emit = _ref.emit,
393
- slots = _ref.slots;
394
- var localActiveItems = (0,external_vue_.inject)('localActiveItems');
395
- var handleItemClick = (0,external_vue_.inject)('handleItemClick');
396
- var isActive = (0,external_vue_.ref)(props.modelValue);
397
- (0,external_vue_.watch)(function () {
398
- return props.modelValue;
399
- }, function (newVal) {
400
- isActive.value = newVal;
401
- });
402
- (0,external_vue_.watch)(localActiveItems, function (newVal) {
403
- if (newVal === null || newVal === void 0 ? void 0 : newVal.length) {
404
- isActive.value = newVal.includes(props.name);
405
- }
406
- }, {
407
- immediate: true
408
- });
409
-
410
- function clickItem(props) {
411
- var disabled = props.disabled,
412
- name = props.name,
413
- itemClick = props.itemClick;
414
- if (disabled) return;
415
- var data = {
416
- name: name
417
- };
418
- isActive.value = !isActive.value;
419
- emit('update:modelValue', isActive.value);
420
- emit('change', data);
421
-
422
- if (typeof itemClick === 'function') {
423
- itemClick(data);
424
- } else if (typeof handleItemClick === 'function') {
425
- handleItemClick({
426
- name: name
427
- });
428
- }
429
- }
430
-
431
- var transition = (0,external_vue_.ref)(collapseMotion(emit));
432
-
433
- function getContent() {
434
- if (props.content) {
435
- return props.content;
436
- }
437
-
438
- if (typeof slots.content === 'function') {
439
- return slots.content(external_vue_.h);
440
- }
441
-
442
- return slots.content;
443
- }
444
-
445
- function renderPanel() {
446
- if (props.renderDirective === 'if' && !isActive.value) {
447
- return '';
448
- }
449
-
450
- return (0,external_vue_.withDirectives)((0,external_vue_.createVNode)("div", {
451
- "class": "bk-collapse-content ".concat(isActive.value && 'active' || '')
452
- }, [getContent()]), [[external_vue_.vShow, isActive.value]]);
453
- }
454
-
455
- function renderHeader() {
456
- if (slots.header) {
457
- if (typeof slots.header === 'function') {
458
- return slots.header(external_vue_.h);
459
- }
460
-
461
- return slots.header;
462
- }
463
-
464
- var title;
465
-
466
- if (slots["default"]) {
467
- if (typeof slots["default"] === 'function') {
468
- title = slots["default"](external_vue_.h);
469
- } else {
470
- title = slots["default"];
471
- }
472
- } else {
473
- title = props.title;
474
- }
475
-
476
- return (0,external_vue_.createVNode)("div", {
477
- "class": 'bk-collapse-header'
478
- }, [(0,external_vue_.createVNode)("span", {
479
- "class": 'bk-collapse-title'
480
- }, [title]), (0,external_vue_.createVNode)(external_icon_.AngleRight, {
481
- "class": "bk-collapse-icon ".concat(isActive.value && 'rotate-icon' || '')
482
- }, null)]);
483
- }
484
-
485
- return function () {
486
- var _slot;
487
-
488
- return (0,external_vue_.createVNode)("div", {
489
- "class": "bk-collapse-item ".concat(props.disabled ? 'is-disabled' : '', " ").concat(isActive.value ? 'bk-collapse-item-active' : '')
490
- }, [(0,external_vue_.createVNode)("div", {
491
- "onClick": function onClick() {
492
- return clickItem(props);
493
- }
494
- }, [renderHeader()]), (0,external_vue_.createVNode)(external_vue_.Transition, transition.value, _isSlot(_slot = renderPanel()) ? _slot : {
495
- "default": function _default() {
496
- return [_slot];
497
- }
498
- })]);
499
- };
500
- }
501
- }));
502
- ;// CONCATENATED MODULE: ../../packages/collapse/src/collapse.tsx
503
-
504
-
505
-
506
- /*
507
- * Tencent is pleased to support the open source community by making
508
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
509
- *
510
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
511
- *
512
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
513
- *
514
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
515
- *
516
- * ---------------------------------------------------
517
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
518
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
519
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
520
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
521
- *
522
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
523
- * the Software.
524
- *
525
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
526
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
527
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
528
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
529
- * IN THE SOFTWARE.
530
- */
531
-
532
-
533
-
534
- /* harmony default export */ const collapse = ((0,external_vue_.defineComponent)({
535
- name: 'Collapse',
536
- props: propsCollapse,
537
- emits: ['item-click', 'update:modelValue', 'after-leave', 'before-enter'],
538
- setup: function setup(props, _ref) {
539
- var emit = _ref.emit,
540
- slots = _ref.slots;
541
- var localActiveItems = (0,external_vue_.ref)([]); // 以保证当前的设置生效
542
-
543
- (0,external_vue_.watch)(function () {
544
- return [props.modelValue];
545
- }, function () {
546
- var value = props.modelValue;
547
-
548
- if (Array.isArray(value)) {
549
- localActiveItems.value = _toConsumableArray(value);
550
- } else if (typeof value !== 'undefined') {
551
- localActiveItems.value = [value];
552
- } else {
553
- localActiveItems.value = [];
554
- }
555
- }, {
556
- immediate: true
557
- });
558
-
559
- var handleItemClick = function handleItemClick(item) {
560
- // 手风琴模式,只有一个Active,移除一个新增一个
561
- var name = item.name;
562
-
563
- if (props.accordion) {
564
- var activeItemIndex = localActiveItems.value.findIndex(function (local) {
565
- return local === name;
566
- });
567
-
568
- if (activeItemIndex >= 0) {
569
- localActiveItems.value.splice(activeItemIndex, 1);
570
- } else {
571
- localActiveItems.value = [name];
572
- }
573
- } else {
574
- var _activeItemIndex = localActiveItems.value.findIndex(function (local) {
575
- return local === name;
576
- });
577
-
578
- if (_activeItemIndex >= 0) {
579
- localActiveItems.value.splice(_activeItemIndex, 1);
580
- } else {
581
- localActiveItems.value.push(name);
582
- }
583
- }
584
-
585
- emit('item-click', item);
586
- emit('update:modelValue', localActiveItems.value);
587
- };
588
-
589
- (0,external_vue_.provide)('localActiveItems', localActiveItems);
590
- (0,external_vue_.provide)('handleItemClick', handleItemClick);
591
- var className = 'bk-collapse-wrapper';
592
-
593
- if (!Array.isArray(props.list) || !props.list.length) {
594
- return function () {
595
- return (0,external_vue_.createVNode)('div', {
596
- "class": className
597
- }, [(0,external_vue_.renderSlot)(slots, 'default', {
598
- props: {
599
- isList: true
600
- }
601
- })]);
602
- };
603
- } // 统一格式化传入数据格式为标准渲染格式
604
-
605
-
606
- var collapseData = (0,external_vue_.computed)(function () {
607
- return (props.list || []).map(function (item, index) {
608
- if (typeof item === 'string' || typeof item === 'number' || typeof item === 'boolean') {
609
- return {
610
- $index: index,
611
- name: item
612
- };
613
- }
614
-
615
- return Object.assign({
616
- $index: index
617
- }, item);
618
- });
619
- }); // 判定当前Item是否为激活状态
620
-
621
- var renderItems = function renderItems() {
622
- return collapseData.value.map(function (item, index) {
623
- var _a, _b, _c;
624
-
625
- var name = item[props.idFiled] || index;
626
- var title = item[props.titleField];
627
-
628
- if (slots.title) {
629
- if (typeof slots.title === 'function') {
630
- title = slots.title(item, index);
631
- } else {
632
- title = slots.title;
633
- }
634
- }
635
-
636
- if (slots["default"]) {
637
- title = (_a = slots["default"]) === null || _a === void 0 ? void 0 : _a.call(slots, item, index);
638
- }
639
-
640
- return (0,external_vue_.createVNode)(collapse_panel, {
641
- "key": index,
642
- "item-click": handleItemClick,
643
- "disabled": item.disabled,
644
- "name": name,
645
- "isFormList": true,
646
- "title": title,
647
- "content": (_c = (_b = slots.content) === null || _b === void 0 ? void 0 : _b.call(slots, item, index)) !== null && _c !== void 0 ? _c : item[props.contentField]
648
- }, null);
649
- });
650
- };
651
-
652
- return function () {
653
- return (0,external_vue_.createVNode)("div", {
654
- "class": className
655
- }, [renderItems()]);
656
- };
657
- }
658
- }));
659
- ;// CONCATENATED MODULE: ../../packages/collapse/src/index.ts
660
- /*
661
- * Tencent is pleased to support the open source community by making
662
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
663
- *
664
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
665
- *
666
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
667
- *
668
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
669
- *
670
- * ---------------------------------------------------
671
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
672
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
673
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
674
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
675
- *
676
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
677
- * the Software.
678
- *
679
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
680
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
681
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
682
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
683
- * IN THE SOFTWARE.
684
- */
685
-
686
-
687
-
688
- var BkCollapse = (0,external_shared_.withInstallProps)(collapse, {
689
- CollapsePanel: collapse_panel
690
- });
691
-
692
- /* harmony default export */ const src = (BkCollapse);
693
- })();
694
-
695
- /******/ return __webpack_exports__;
696
- /******/ })()
697
- ;
698
- });
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../icon"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../icon"],t);else{var o="object"==typeof exports?t(require("../shared"),require("vue"),require("../icon")):t(e["../shared"],e.vue,e["../icon"]);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,((e,t,o)=>(()=>{"use strict";var r={6870:e=>{e.exports=o},4212:t=>{t.exports=e},748:e=>{e.exports=t}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,i),o.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{i.r(l),i.d(l,{BkCollapsePanel:()=>p,Collapse:()=>v,default:()=>y});var e=i(4212);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function o(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,o):void 0}}(e)||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.")}()}var r=i(748),n=i(6870),a={list:e.PropTypes.arrayOf(e.PropTypes.any).def([]),idFiled:e.PropTypes.string.def("$index"),titleField:e.PropTypes.string.def("name"),contentField:e.PropTypes.string.def("content"),modelValue:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.number).def([]),e.PropTypes.arrayOf(e.PropTypes.string).def([]),e.PropTypes.number.def(-1)]),accordion:e.PropTypes.bool.def(!1)},s={itemClick:{type:Function}},c=Object.assign({name:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def(""),title:e.PropTypes.any,content:e.PropTypes.string,disabled:e.PropTypes.bool.def(!1),isFormList:e.PropTypes.bool.def(!1),renderDirective:(0,e.renderDirectiveType)(),modelValue:e.PropTypes.bool.def(!1)},s),u=function(e){return(e||"").split(" ").filter((function(e){return!!e.trim()}))};function d(e,t){if(e&&t){var r=u(t),n=e.getAttribute("class")||"";if(e.classList){var i;(i=e.classList).remove.apply(i,o(r))}else{r.forEach((function(e){n=n.replace(" ".concat(e," ")," ")}));var l=u(n).join(" ");e.setAttribute("class",l)}}}function f(e,t){if(e){var r,n=e.getAttribute("class")||"",i=u(n),l=(t||"").split(" ").filter((function(e){return!i.includes(e)&&!!e.trim()}));e.classList?(r=e.classList).add.apply(r,o(l)):(n+=" ".concat(l.join(" ")),e.setAttribute("class",n))}}const p=(0,r.defineComponent)({name:"CollapsePanel",props:c,emits:["change","update:modelValue","after-leave","before-enter"],setup:function(e,t){var o=t.emit,i=t.slots,l=(0,r.inject)("localActiveItems"),a=(0,r.inject)("handleItemClick"),s=(0,r.ref)(e.modelValue);(0,r.watch)((function(){return e.modelValue}),(function(e){s.value=e})),(0,r.watch)(l,(function(t){(null==t?void 0:t.length)&&(s.value=t.includes(e.name))}),{immediate:!0});var c=(0,r.ref)(function(e){return{css:!0,onBeforeEnter:function(e){f(e,"collapse-transition"),e.dataset||(e.dataset={}),e.style.height="0px"},onEnter:function(e){e.dataset.oldOverflow=e.style.overflow,0!==e.scrollHeight?(e.style.height="".concat(e.scrollHeight,"px"),e.style.maxHeight="".concat(e.scrollHeight,"px")):e.style.height="0px",e.style.overflow="hidden"},onAfterEnter:function(t){t.style.height="",t.style.maxHeight="",t.style.overflow=t.dataset.oldOverflow,d(t,"collapse-transition"),e("before-enter")},onBeforeLeave:function(e){e.dataset||(e.dataset={}),e.dataset.oldOverflow=e.style.overflow,e.style.height="".concat(e.scrollHeight,"px"),e.style.maxHeight="".concat(e.scrollHeight,"px"),e.style.overflow="hidden"},onLeave:function(e){0!==e.scrollHeight&&(f(e,"collapse-transition"),e.style.transitionProperty="height",e.style.height="0px")},onAfterLeave:function(t){d(t,"collapse-transition"),t.style.height="",t.style.maxHeight="",t.style.overflow=t.dataset.oldOverflow,e("after-leave")}}}(o));return function(){var t,l,u;return(0,r.createVNode)("div",{class:"bk-collapse-item ".concat(e.disabled?"is-disabled":""," ").concat(s.value?"bk-collapse-item-active":"")},[(0,r.createVNode)("div",{onClick:function(){return function(e){var t=e.disabled,r=e.name,n=e.itemClick;if(!t){var i={name:r};s.value=!s.value,o("update:modelValue",s.value),o("change",i),"function"==typeof n?n(i):"function"==typeof a&&a({name:r})}}(e)}},[i.header?"function"==typeof i.header?i.header(r.h):i.header:(u=i.default?"function"==typeof i.default?i.default(r.h):i.default:e.title,(0,r.createVNode)("div",{class:"bk-collapse-header"},[(0,r.createVNode)("span",{class:"bk-collapse-title"},[u]),(0,r.createVNode)(n.AngleRight,{class:"bk-collapse-icon ".concat(s.value?"rotate-icon":"")},null)]))]),(0,r.createVNode)(r.Transition,c.value,(l=t="if"!==e.renderDirective||s.value?(0,r.withDirectives)((0,r.createVNode)("div",{class:"bk-collapse-content ".concat(s.value?"active":"")},[e.content?e.content:"function"==typeof i.content?i.content(r.h):i.content]),[[r.vShow,s.value]]):"","function"==typeof l||"[object Object]"===Object.prototype.toString.call(l)&&!(0,r.isVNode)(l)?t:{default:function(){return[t]}}))])}}}),v=(0,r.defineComponent)({name:"Collapse",props:a,emits:["item-click","update:modelValue","after-leave","before-enter"],setup:function(e,t){var n=t.emit,i=t.slots,l=(0,r.ref)([]);(0,r.watch)((function(){return[e.modelValue]}),(function(){var t=e.modelValue;Array.isArray(t)?l.value=o(t):l.value=void 0!==t?[t]:[]}),{immediate:!0});var a=function(t){var o=t.name;if(e.accordion){var r=l.value.findIndex((function(e){return e===o}));r>=0?l.value.splice(r,1):l.value=[o]}else{var i=l.value.findIndex((function(e){return e===o}));i>=0?l.value.splice(i,1):l.value.push(o)}n("item-click",t),n("update:modelValue",l.value)};(0,r.provide)("localActiveItems",l),(0,r.provide)("handleItemClick",a);var s="bk-collapse-wrapper";if(!Array.isArray(e.list)||!e.list.length)return function(){return(0,r.createVNode)("div",{class:s},[(0,r.renderSlot)(i,"default",{props:{isList:!0}})])};var c=(0,r.computed)((function(){return(e.list||[]).map((function(e,t){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e?{$index:t,name:e}:Object.assign({$index:t},e)}))}));return function(){return(0,r.createVNode)("div",{class:s},[c.value.map((function(t,o){var n,l,s,c=t[e.idFiled]||o,u=t[e.titleField];return i.title&&(u="function"==typeof i.title?i.title(t,o):i.title),i.default&&(u=null===(n=i.default)||void 0===n?void 0:n.call(i,t,o)),(0,r.createVNode)(p,{key:o,"item-click":a,disabled:t.disabled,name:c,isFormList:!0,title:u,content:null!==(s=null===(l=i.content)||void 0===l?void 0:l.call(i,t,o))&&void 0!==s?s:t[e.contentField]},null)}))])}}}),y=(0,e.withInstallProps)(v,{CollapsePanel:p})})(),l})()));