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

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