bkui-vue 0.0.2-beta.37 → 0.0.2-beta.39

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