bkui-vue 1.0.3-beta.9 → 2.0.1-beta.2

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 (285) hide show
  1. package/dist/index.cjs.js +71 -73
  2. package/dist/index.esm.js +21328 -19060
  3. package/dist/index.umd.js +71 -73
  4. package/dist/locale/en.esm.js +1 -1
  5. package/dist/locale/en.esm.js.map +1 -1
  6. package/dist/locale/en.umd.js +1 -1
  7. package/dist/locale/en.umd.js.map +1 -1
  8. package/dist/locale/zh-cn.esm.js +1 -1
  9. package/dist/locale/zh-cn.esm.js.map +1 -1
  10. package/dist/locale/zh-cn.umd.js +1 -1
  11. package/dist/locale/zh-cn.umd.js.map +1 -1
  12. package/dist/style.css +1 -1
  13. package/dist/style.variable.css +1 -1
  14. package/lib/affix/affix.variable.css +3 -0
  15. package/lib/alert/alert.variable.css +3 -0
  16. package/lib/backtop/backtop.variable.css +3 -0
  17. package/lib/badge/badge.variable.css +3 -0
  18. package/lib/breadcrumb/breadcrumb.variable.css +3 -0
  19. package/lib/button/button.variable.css +3 -0
  20. package/lib/card/card.variable.css +3 -0
  21. package/lib/cascader/cascader.variable.css +3 -0
  22. package/lib/checkbox/checkbox.variable.css +3 -0
  23. package/lib/checkbox/index.js +4 -4
  24. package/lib/code-diff/code-diff.variable.css +3 -0
  25. package/lib/collapse/collapse.css +11 -0
  26. package/lib/collapse/collapse.d.ts +11 -0
  27. package/lib/collapse/collapse.less +15 -1
  28. package/lib/collapse/collapse.variable.css +14 -0
  29. package/lib/collapse/index.d.ts +23 -0
  30. package/lib/collapse/index.js +9 -1
  31. package/lib/collapse/props.d.ts +8 -0
  32. package/lib/collapse-transition/collapse-transition.variable.css +3 -0
  33. package/lib/color-picker/color-picker.variable.css +3 -0
  34. package/lib/components.d.ts +2 -0
  35. package/lib/components.js +3 -1
  36. package/lib/config-provider/config-provider.d.ts +3 -0
  37. package/lib/config-provider/config-provider.variable.css +3 -0
  38. package/lib/config-provider/index.d.ts +4 -0
  39. package/lib/config-provider/token.d.ts +1 -0
  40. package/lib/container/container.variable.css +3 -0
  41. package/lib/date-picker/base/month-table.d.ts +2 -2
  42. package/lib/date-picker/date-picker.d.ts +1 -0
  43. package/lib/date-picker/date-picker.variable.css +3 -0
  44. package/lib/date-picker/index.d.ts +3 -0
  45. package/lib/date-picker/index.js +70 -32
  46. package/lib/date-picker/interface.d.ts +1 -1
  47. package/lib/date-picker/time-picker.d.ts +1 -0
  48. package/lib/date-picker/utils.d.ts +4 -0
  49. package/lib/dialog/dialog.css +176 -150
  50. package/lib/dialog/dialog.d.ts +40 -109
  51. package/lib/dialog/dialog.less +51 -124
  52. package/lib/dialog/dialog.variable.css +179 -150
  53. package/lib/dialog/index.d.ts +99 -263
  54. package/lib/dialog/index.js +244 -246
  55. package/lib/dialog/props.d.ts +10 -35
  56. package/lib/directives/index.js +0 -1
  57. package/lib/divider/divider.variable.css +3 -0
  58. package/lib/dropdown/dropdown.css +3 -1
  59. package/lib/dropdown/dropdown.variable.css +6 -1
  60. package/lib/exception/exception.variable.css +3 -0
  61. package/lib/fixed-navbar/fixed-navbar.variable.css +3 -0
  62. package/lib/form/form.variable.css +3 -0
  63. package/lib/form/index.js +3 -1
  64. package/lib/icon/image-fill.js +82 -167
  65. package/lib/icon/img-error.js +82 -167
  66. package/lib/icon/img-placehoulder.js +82 -167
  67. package/lib/icon/index.d.ts +1 -0
  68. package/lib/icon/index.js +87 -2427
  69. package/lib/icon/info-line.js +82 -167
  70. package/lib/icon/info.js +82 -167
  71. package/lib/icon/left-shape.js +82 -167
  72. package/lib/icon/left-turn-line.js +82 -167
  73. package/lib/icon/loading.js +82 -167
  74. package/lib/icon/narrow-line.js +82 -167
  75. package/lib/icon/original.js +82 -167
  76. package/lib/icon/pdf-fill.js +82 -167
  77. package/lib/icon/play-shape.js +82 -167
  78. package/lib/icon/plus.js +82 -167
  79. package/lib/icon/ppt-fill.js +82 -167
  80. package/lib/icon/qq.js +82 -167
  81. package/lib/icon/right-shape.js +82 -167
  82. package/lib/icon/right-turn-line.js +82 -167
  83. package/lib/icon/search.js +82 -167
  84. package/lib/icon/share.js +82 -167
  85. package/lib/icon/spinner.js +82 -167
  86. package/lib/icon/success.js +82 -167
  87. package/lib/icon/switcher-loading.js +82 -167
  88. package/lib/icon/text-all.d.ts +4 -0
  89. package/lib/icon/text-all.js +191 -0
  90. package/lib/icon/text-file.js +82 -167
  91. package/lib/icon/text-fill.js +82 -167
  92. package/lib/icon/transfer.js +82 -167
  93. package/lib/icon/tree-application-shape.js +82 -167
  94. package/lib/icon/unfull-screen.js +82 -167
  95. package/lib/icon/unvisible.js +82 -167
  96. package/lib/icon/up-shape.js +82 -167
  97. package/lib/icon/upload.js +82 -167
  98. package/lib/icon/video-fill.js +82 -167
  99. package/lib/icon/warn.js +82 -167
  100. package/lib/icon/weixin-pro.js +82 -167
  101. package/lib/icon/weixin.js +82 -167
  102. package/lib/image/image-viewer.variable.css +3 -0
  103. package/lib/image/image.variable.css +3 -0
  104. package/lib/image/index.js +5 -2
  105. package/lib/info-box/index.d.ts +2 -2
  106. package/lib/info-box/index.js +257 -516
  107. package/lib/info-box/info-box.css +58 -28
  108. package/lib/info-box/info-box.d.ts +18 -16
  109. package/lib/info-box/info-box.less +82 -51
  110. package/lib/info-box/info-box.variable.css +61 -28
  111. package/lib/info-box/render-component.d.ts +4 -0
  112. package/lib/input/index.js +7 -1
  113. package/lib/input/input.variable.css +3 -0
  114. package/lib/link/link.variable.css +3 -0
  115. package/lib/loading/loading.variable.css +3 -0
  116. package/lib/locale/index.js +4 -2
  117. package/lib/locale/lang/en.d.ts +1 -0
  118. package/lib/menu/menu.variable.css +3 -0
  119. package/lib/menu/submenu.variable.css +3 -0
  120. package/lib/message/message.variable.css +3 -0
  121. package/lib/modal/hooks.d.ts +6 -0
  122. package/lib/modal/index.d.ts +41 -309
  123. package/lib/modal/index.js +285 -671
  124. package/lib/modal/mask.d.ts +6 -0
  125. package/lib/modal/modal.css +155 -76
  126. package/lib/modal/modal.d.ts +18 -116
  127. package/lib/modal/modal.less +107 -55
  128. package/lib/modal/modal.variable.css +158 -76
  129. package/lib/modal/props.mixin.d.ts +5 -41
  130. package/lib/navigation/navigation.variable.css +3 -0
  131. package/lib/notify/notify.variable.css +3 -0
  132. package/lib/overflow-title/index.js +46 -52
  133. package/lib/pagination/index.js +2 -1
  134. package/lib/pagination/pagination.variable.css +3 -0
  135. package/lib/plugin-popover/index.d.ts +1 -1
  136. package/lib/plugin-popover/index.js +45 -26
  137. package/lib/pop-confirm/index.js +8 -5
  138. package/lib/pop-confirm/pop-confirm.variable.css +3 -0
  139. package/lib/popover/content.d.ts +1 -1
  140. package/lib/popover/index.js +45 -26
  141. package/lib/popover/plugin-popover.d.ts +4 -1
  142. package/lib/popover/popover.css +3 -1
  143. package/lib/popover/popover.less +4 -1
  144. package/lib/popover/popover.variable.css +6 -1
  145. package/lib/preset.d.ts +2 -0
  146. package/lib/process/process.variable.css +3 -0
  147. package/lib/progress/progress.variable.css +3 -0
  148. package/lib/radio/index.d.ts +29 -0
  149. package/lib/radio/index.js +39 -21
  150. package/lib/radio/radio-button.d.ts +10 -0
  151. package/lib/radio/radio-group.d.ts +10 -0
  152. package/lib/radio/radio.d.ts +10 -0
  153. package/lib/radio/radio.variable.css +3 -0
  154. package/lib/rate/rate.variable.css +3 -0
  155. package/lib/rate/star.variable.css +3 -0
  156. package/lib/resize-layout/index.js +1 -1
  157. package/lib/resize-layout/resize-layout.variable.css +3 -0
  158. package/lib/scrollbar/index.d.ts +15 -0
  159. package/lib/scrollbar/index.js +18763 -0
  160. package/lib/scrollbar/scrollbar-core/can-use-dom.d.ts +2 -0
  161. package/lib/scrollbar/scrollbar-core/helpers.d.ts +5 -0
  162. package/lib/scrollbar/scrollbar-core/index.d.ts +241 -0
  163. package/lib/scrollbar/scrollbar-core/mouse-wheel.d.ts +5 -0
  164. package/lib/scrollbar/scrollbar-core/scrollbar-width.d.ts +1 -0
  165. package/lib/scrollbar/scrollbar.css +75 -0
  166. package/lib/scrollbar/scrollbar.less +94 -0
  167. package/lib/scrollbar/scrollbar.variable.css +204 -0
  168. package/lib/search-select/index.d.ts +375 -16
  169. package/lib/search-select/index.js +701 -366
  170. package/lib/search-select/input.d.ts +14 -5
  171. package/lib/search-select/search-select.css +20 -6
  172. package/lib/search-select/search-select.d.ts +129 -7
  173. package/lib/search-select/search-select.less +16 -12
  174. package/lib/search-select/search-select.variable.css +23 -6
  175. package/lib/search-select/selected.d.ts +116 -6
  176. package/lib/search-select/utils.d.ts +19 -6
  177. package/lib/select/index.d.ts +124 -6
  178. package/lib/select/index.js +1336 -72
  179. package/lib/select/option.d.ts +3 -1
  180. package/lib/select/pinyin/core.d.ts +14 -0
  181. package/lib/select/pinyin/dict.d.ts +34 -0
  182. package/lib/select/pinyin/index.d.ts +2 -0
  183. package/lib/select/select.css +55 -12
  184. package/lib/select/select.d.ts +50 -2
  185. package/lib/select/select.less +69 -19
  186. package/lib/select/select.variable.css +58 -12
  187. package/lib/select/selectTagInput.d.ts +7 -0
  188. package/lib/select/type.d.ts +2 -3
  189. package/lib/shared/index.d.ts +0 -1
  190. package/lib/shared/index.js +70 -50
  191. package/lib/shared/utils.d.ts +12 -0
  192. package/lib/shared/vue-types.d.ts +5 -0
  193. package/lib/sideslider/index.d.ts +55 -185
  194. package/lib/sideslider/index.js +81 -55
  195. package/lib/sideslider/sideslider.css +26 -90
  196. package/lib/sideslider/sideslider.d.ts +25 -87
  197. package/lib/sideslider/sideslider.less +56 -132
  198. package/lib/sideslider/sideslider.variable.css +29 -90
  199. package/lib/slider/index.d.ts +19 -0
  200. package/lib/slider/index.js +45 -5
  201. package/lib/slider/slider.css +14 -0
  202. package/lib/slider/slider.d.ts +9 -0
  203. package/lib/slider/slider.less +15 -0
  204. package/lib/slider/slider.variable.css +17 -0
  205. package/lib/steps/steps.variable.css +3 -0
  206. package/lib/styles/mixins/animate.variable.css +3 -0
  207. package/lib/styles/mixins/popper.variable.css +3 -0
  208. package/lib/styles/mixins/scroll.variable.css +3 -0
  209. package/lib/styles/reset.css +1 -3
  210. package/lib/styles/reset.less +3 -6
  211. package/lib/styles/reset.variable.css +4 -3
  212. package/lib/styles/themes/themes.less +5 -0
  213. package/lib/swiper/swiper.variable.css +3 -0
  214. package/lib/switcher/switcher.variable.css +3 -0
  215. package/lib/tab/tab.variable.css +3 -0
  216. package/lib/table/cache.d.ts +11 -3
  217. package/lib/table/components/table-cell.d.ts +3 -2
  218. package/lib/table/components/table-column.d.ts +7 -17
  219. package/lib/table/const.d.ts +4 -4
  220. package/lib/table/index.d.ts +29 -64
  221. package/lib/table/index.js +18068 -613
  222. package/lib/table/plugins/head-filter.css +8 -4
  223. package/lib/table/plugins/head-filter.less +6 -3
  224. package/lib/table/plugins/head-filter.variable.css +11 -4
  225. package/lib/table/plugins/head-sort.variable.css +3 -0
  226. package/lib/table/plugins/settings.variable.css +3 -0
  227. package/lib/table/plugins/use-active-columns.d.ts +2 -2
  228. package/lib/table/plugins/use-column-template.d.ts +7 -0
  229. package/lib/table/plugins/use-draggable.d.ts +2 -2
  230. package/lib/table/plugins/use-fixed-column.d.ts +1 -1
  231. package/lib/table/plugins/use-observer-resize.d.ts +5 -0
  232. package/lib/table/plugins/use-pagination.d.ts +3 -1
  233. package/lib/table/plugins/use-shift-key.d.ts +11 -0
  234. package/lib/table/props.d.ts +17 -7
  235. package/lib/table/table.css +112 -58
  236. package/lib/table/table.d.ts +11 -0
  237. package/lib/table/table.less +46 -58
  238. package/lib/table/table.variable.css +115 -58
  239. package/lib/table/use-attributes.d.ts +6 -43
  240. package/lib/table/use-column.d.ts +9 -10
  241. package/lib/table/use-common.d.ts +1 -1
  242. package/lib/table/use-render.d.ts +1 -1
  243. package/lib/table/utils.d.ts +1 -1
  244. package/lib/table-column/index.d.ts +92 -266
  245. package/lib/table-column/index.js +24 -98
  246. package/lib/tag/tag.variable.css +3 -0
  247. package/lib/tag-input/index.d.ts +4 -4
  248. package/lib/tag-input/tag-input.d.ts +2 -2
  249. package/lib/tag-input/tag-input.variable.css +3 -0
  250. package/lib/tag-input/tag-props.d.ts +1 -1
  251. package/lib/tag-input/tag-render.d.ts +1 -1
  252. package/lib/time-picker/index.d.ts +38 -35
  253. package/lib/time-picker/time-picker.variable.css +3 -0
  254. package/lib/timeline/index.d.ts +80 -44
  255. package/lib/timeline/index.js +54 -65
  256. package/lib/timeline/timeline.d.ts +46 -29
  257. package/lib/timeline/timeline.variable.css +3 -0
  258. package/lib/transfer/transfer.variable.css +3 -0
  259. package/lib/tree/constant.d.ts +3 -1
  260. package/lib/tree/index.d.ts +44 -0
  261. package/lib/tree/index.js +17548 -25
  262. package/lib/tree/props.d.ts +18 -0
  263. package/lib/tree/tree.css +76 -2
  264. package/lib/tree/tree.d.ts +28 -2
  265. package/lib/tree/tree.variable.css +79 -2
  266. package/lib/tree/use-intersection-observer.d.ts +27 -0
  267. package/lib/tree/use-node-attribute.d.ts +9 -0
  268. package/lib/upload/index.d.ts +12 -0
  269. package/lib/upload/index.js +21 -30
  270. package/lib/upload/props.d.ts +3 -0
  271. package/lib/upload/upload-trigger.d.ts +6 -0
  272. package/lib/upload/upload.d.ts +6 -0
  273. package/lib/upload/upload.variable.css +3 -0
  274. package/lib/virtual-render/index.d.ts +36 -9
  275. package/lib/virtual-render/index.js +295 -80
  276. package/lib/virtual-render/props.d.ts +16 -0
  277. package/lib/virtual-render/use-fix-top.d.ts +2 -7
  278. package/lib/virtual-render/use-scrollbar.d.ts +24 -0
  279. package/lib/virtual-render/v-virtual-render.d.ts +2 -1
  280. package/lib/virtual-render/virtual-render.css +76 -2
  281. package/lib/virtual-render/virtual-render.d.ts +16 -3
  282. package/lib/virtual-render/virtual-render.less +3 -3
  283. package/lib/virtual-render/virtual-render.variable.css +79 -2
  284. package/package.json +1 -1
  285. package/lib/shared/mask.d.ts +0 -11
@@ -2,9 +2,10 @@ import "../styles/reset.css";
2
2
  import "./info-box.less";
3
3
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
4
4
  import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
5
- import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_lodash_isFunction_f90b20d6__ from "lodash/isFunction";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_button_a2ea7c9a__ from "../button";
7
7
  import "../button/button.less";
8
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
8
9
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
9
10
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_modal_d1344388__ from "../modal";
10
11
  import "../modal/modal.less";
@@ -427,7 +428,11 @@ __webpack_require__.d(__webpack_exports__, {
427
428
  ;// CONCATENATED MODULE: external "../shared"
428
429
  var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
429
430
  var y = x => () => x
430
- const shared_namespaceObject = x({ ["AlignEnum"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.AlignEnum, ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["ThemeEnum"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.ThemeEnum, ["alignType"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.alignType, ["dialogTypeUnion"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.dialogTypeUnion, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstall });
431
+ const shared_namespaceObject = x({ ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstall });
432
+ ;// CONCATENATED MODULE: external "vue"
433
+ var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
434
+ var external_vue_y = x => () => x
435
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["createApp"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createApp, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref });
431
436
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
432
437
  function _typeof(o) {
433
438
  "@babel/helpers - typeof";
@@ -507,14 +512,10 @@ function _asyncToGenerator(fn) {
507
512
  // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
508
513
  var regenerator = __webpack_require__(2841);
509
514
  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
510
- ;// CONCATENATED MODULE: external "vue"
511
- var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
512
- var external_vue_y = x => () => x
513
- const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createApp"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createApp, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
514
- ;// CONCATENATED MODULE: external "../config-provider"
515
- var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
516
- var config_provider_y = x => () => x
517
- const config_provider_namespaceObject = config_provider_x({ ["useLocale"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.useLocale, ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
515
+ ;// CONCATENATED MODULE: external "lodash/isFunction"
516
+ var isFunction_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
517
+ var isFunction_y = x => () => x
518
+ const isFunction_namespaceObject = isFunction_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_isFunction_f90b20d6__["default"] });
518
519
  ;// CONCATENATED MODULE: external "../button"
519
520
  var button_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
520
521
  var button_y = x => () => x
@@ -523,6 +524,10 @@ const button_namespaceObject = button_x({ ["default"]: () => __WEBPACK_EXTERNAL_
523
524
  var button_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
524
525
  var button_less_y = x => () => x
525
526
  const button_less_namespaceObject = button_less_x({ });
527
+ ;// CONCATENATED MODULE: external "../config-provider"
528
+ var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
529
+ var config_provider_y = x => () => x
530
+ const config_provider_namespaceObject = config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
526
531
  ;// CONCATENATED MODULE: external "../icon"
527
532
  var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
528
533
  var icon_y = x => () => x
@@ -530,76 +535,14 @@ const icon_namespaceObject = icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE
530
535
  ;// CONCATENATED MODULE: external "../modal"
531
536
  var modal_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
532
537
  var modal_y = x => () => x
533
- const modal_namespaceObject = modal_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_modal_d1344388__["default"], ["propsMixin"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_modal_d1344388__.propsMixin });
538
+ const modal_namespaceObject = modal_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_modal_d1344388__["default"] });
534
539
  ;// CONCATENATED MODULE: external "../modal/modal.less"
535
540
  var modal_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
536
541
  var modal_less_y = x => () => x
537
542
  const modal_less_namespaceObject = modal_less_x({ });
538
- ;// CONCATENATED MODULE: ../../packages/dialog/src/props.ts
539
-
540
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
541
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
542
- /*
543
- * Tencent is pleased to support the open source community by making
544
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
545
- *
546
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
547
- *
548
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
549
- *
550
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
551
- *
552
- * ---------------------------------------------------
553
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
554
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
555
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
556
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
557
- *
558
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
559
- * the Software.
560
- *
561
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
562
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
563
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
564
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
565
- * IN THE SOFTWARE.
566
- */
543
+ ;// CONCATENATED MODULE: ../../packages/info-box/src/render-component.tsx
567
544
 
568
545
 
569
- var props = _objectSpread(_objectSpread({}, modal_namespaceObject.propsMixin), {}, {
570
- width: shared_namespaceObject.PropTypes.oneOfType([String, Number]).def(''),
571
- height: shared_namespaceObject.PropTypes.oneOfType([String, Number]).def(''),
572
- // 确认按钮文字
573
- // confirmText: PropTypes.string.def('确定'),
574
- confirmText: shared_namespaceObject.PropTypes.string,
575
- // 取消按钮文字
576
- // cancelText: PropTypes.string.def('取消'),
577
- cancelText: shared_namespaceObject.PropTypes.string,
578
- // 步骤按钮文字
579
- // prevText: PropTypes.string.def('上一步'),
580
- prevText: shared_namespaceObject.PropTypes.string,
581
- // nextText: PropTypes.string.def('下一步'),
582
- nextText: shared_namespaceObject.PropTypes.string,
583
- // 当前步骤
584
- current: shared_namespaceObject.PropTypes.number.def(1),
585
- // 总步数
586
- totalStep: shared_namespaceObject.PropTypes.number,
587
- // 弹框的标题
588
- title: shared_namespaceObject.PropTypes.string.def('title'),
589
- // 显示 header 的位置
590
- headerAlign: (0,shared_namespaceObject.alignType)().def(shared_namespaceObject.AlignEnum.LEFT),
591
- // 显示 footer 的位置
592
- footerAlign: (0,shared_namespaceObject.alignType)().def(shared_namespaceObject.AlignEnum.RIGHT),
593
- // 颜色 按钮类型
594
- theme: shared_namespaceObject.PropTypes.theme().def(shared_namespaceObject.ThemeEnum.PRIMARY),
595
- // 对话框类型
596
- dialogType: (0,shared_namespaceObject.dialogTypeUnion)(),
597
- // 按钮loading
598
- isLoading: shared_namespaceObject.PropTypes.bool.def(false)
599
- });
600
- /* harmony default export */ const src_props = (props);
601
- ;// CONCATENATED MODULE: ../../packages/dialog/src/dialog.tsx
602
-
603
546
 
604
547
 
605
548
  /*
@@ -635,327 +578,243 @@ var props = _objectSpread(_objectSpread({}, modal_namespaceObject.propsMixin), {
635
578
 
636
579
 
637
580
 
638
- function _isSlot(s) {
639
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
640
- }
641
- /* harmony default export */ const src_dialog = ((0,external_vue_namespaceObject.defineComponent)({
642
- // eslint-disable-next-line vue/no-reserved-component-names
643
- name: 'Dialog',
644
- props: src_props,
645
- emits: ['closed', 'update:isShow', 'confirm', 'prev', 'next', 'value-change'],
646
- setup: function setup(props, _ref) {
647
- var emit = _ref.emit;
648
- var t = (0,config_provider_namespaceObject.useLocale)('dialog');
649
- var localConfirmText = (0,external_vue_namespaceObject.computed)(function () {
650
- if (props.confirmText === undefined) {
651
- return t.value.ok;
652
- }
653
- return props.confirmText;
654
- });
655
- var localCancelText = (0,external_vue_namespaceObject.computed)(function () {
656
- if (props.cancelText === undefined) {
657
- return t.value.cancel;
658
- }
659
- return props.cancelText;
660
- });
661
- var localPrevText = (0,external_vue_namespaceObject.computed)(function () {
662
- if (props.prevText === undefined) {
663
- return t.value.prev;
664
- }
665
- return props.prevText;
666
- });
667
- var localNextText = (0,external_vue_namespaceObject.computed)(function () {
668
- if (props.nextText === undefined) {
669
- return t.value.next;
670
- }
671
- return props.nextText;
672
- });
673
- var data = (0,external_vue_namespaceObject.reactive)({
674
- positionX: 0,
675
- positionY: 0,
676
- moveStyle: {
677
- top: '50%',
678
- left: '50%'
679
- }
680
- });
681
- var isModalShow = (0,external_vue_namespaceObject.ref)(props.isShow);
682
- (0,external_vue_namespaceObject.onMounted)(function () {
683
- if (props.escClose) {
684
- addEventListener('keydown', escCloseHandler);
685
- }
686
- });
687
- (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
688
- if (props.escClose) {
689
- removeEventListener('keydown', escCloseHandler);
690
- }
691
- });
692
- (0,external_vue_namespaceObject.watch)(function () {
693
- return props.isShow;
694
- }, function (val) {
695
- if (!val) {
696
- setTimeout(function () {
697
- data.moveStyle = {
698
- top: '50%',
699
- left: '50%'
700
- };
701
- data.positionX = 0;
702
- data.positionY = 0;
703
- isModalShow.value = false;
704
- }, 250);
705
- } else {
706
- isModalShow.value = true;
707
- }
708
- emit('value-change', val);
709
- });
710
- // 关闭弹框
711
- var handleClose = /*#__PURE__*/function () {
581
+ var genDefaultState = function genDefaultState() {
582
+ return {
583
+ isShow: false,
584
+ width: 400,
585
+ extCls: undefined,
586
+ "class": undefined,
587
+ infoType: undefined,
588
+ type: undefined,
589
+ title: undefined,
590
+ subTitle: undefined,
591
+ content: undefined,
592
+ footer: undefined,
593
+ headerAlign: 'center',
594
+ contentAlign: 'center',
595
+ footerAlign: 'center',
596
+ showMask: true,
597
+ quickClose: false,
598
+ escClose: false,
599
+ closeIcon: true,
600
+ confirmText: '确定',
601
+ theme: undefined,
602
+ confirmButtonTheme: 'primary',
603
+ cancelText: '',
604
+ beforeClose: function beforeClose() {
605
+ return true;
606
+ },
607
+ onConfirm: function onConfirm() {},
608
+ onCancel: function onCancel() {},
609
+ onClose: function onClose() {}
610
+ };
611
+ };
612
+ /* harmony default export */ const render_component = ((0,external_vue_namespaceObject.defineComponent)({
613
+ name: 'InfoBox',
614
+ setup: function setup(_props, _ref) {
615
+ var expose = _ref.expose;
616
+ var state = (0,external_vue_namespaceObject.reactive)(genDefaultState());
617
+ var isShow = (0,external_vue_namespaceObject.ref)(false);
618
+ var isLoading = (0,external_vue_namespaceObject.ref)(false);
619
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
620
+ resolveClassName = _usePrefix.resolveClassName;
621
+ var handleConfirm = /*#__PURE__*/function () {
712
622
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee() {
713
- var shouldClose;
623
+ var willClose;
714
624
  return regenerator_default().wrap(function _callee$(_context) {
715
625
  while (1) switch (_context.prev = _context.next) {
716
626
  case 0:
717
- shouldClose = true;
718
- if (!(typeof props.beforeClose === 'function')) {
719
- _context.next = 5;
720
- break;
721
- }
627
+ isLoading.value = true;
628
+ _context.prev = 1;
722
629
  _context.next = 4;
723
- return props.beforeClose();
630
+ return state.beforeClose('confirm');
724
631
  case 4:
725
- shouldClose = _context.sent;
726
- case 5:
727
- if (shouldClose) {
728
- emit('update:isShow', false);
729
- emit('closed');
730
- isModalShow.value = false;
632
+ willClose = _context.sent;
633
+ if (willClose) {
634
+ _context.next = 7;
635
+ break;
731
636
  }
732
- case 6:
637
+ return _context.abrupt("return");
638
+ case 7:
639
+ _context.next = 9;
640
+ return state.onConfirm();
641
+ case 9:
642
+ isShow.value = false;
643
+ case 10:
644
+ _context.prev = 10;
645
+ isLoading.value = false;
646
+ return _context.finish(10);
647
+ case 13:
733
648
  case "end":
734
649
  return _context.stop();
735
650
  }
736
- }, _callee);
651
+ }, _callee, null, [[1,, 10, 13]]);
737
652
  }));
738
- return function handleClose() {
653
+ return function handleConfirm() {
739
654
  return _ref2.apply(this, arguments);
740
655
  };
741
656
  }();
742
- var handleConfirm = function handleConfirm() {
743
- emit('update:isShow', false);
744
- emit('confirm');
745
- // isModalShow.value = false; 影响异步关闭
746
- };
747
- var hasFooter = (0,external_vue_namespaceObject.computed)(function () {
748
- return ['process', 'operation', 'confirm'].includes(props.dialogType);
749
- });
750
- // 按 esc 关闭弹框
751
- var escCloseHandler = function escCloseHandler(e) {
752
- if (props.isShow && props.closeIcon) {
753
- if (e.keyCode === 27) {
754
- handleClose();
657
+ var handleCancel = /*#__PURE__*/function () {
658
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2() {
659
+ var willClose;
660
+ return regenerator_default().wrap(function _callee2$(_context2) {
661
+ while (1) switch (_context2.prev = _context2.next) {
662
+ case 0:
663
+ _context2.next = 2;
664
+ return state.beforeClose('cancel');
665
+ case 2:
666
+ willClose = _context2.sent;
667
+ if (willClose) {
668
+ _context2.next = 5;
669
+ break;
670
+ }
671
+ return _context2.abrupt("return");
672
+ case 5:
673
+ _context2.next = 7;
674
+ return state.onCancel();
675
+ case 7:
676
+ isShow.value = false;
677
+ case 8:
678
+ case "end":
679
+ return _context2.stop();
680
+ }
681
+ }, _callee2);
682
+ }));
683
+ return function handleCancel() {
684
+ return _ref3.apply(this, arguments);
685
+ };
686
+ }();
687
+ expose({
688
+ show: function show() {
689
+ isShow.value = true;
690
+ },
691
+ hide: function hide() {
692
+ isShow.value = false;
693
+ },
694
+ update: function update(payload) {
695
+ Object.assign(state, payload);
696
+ // 配置项变更 infoType 变更为 type
697
+ if (payload.infoType) {
698
+ state.type = payload.infoType;
755
699
  }
756
- }
757
- };
758
- // 上一步
759
- var handlePrevStep = function handlePrevStep() {
760
- emit('prev');
761
- };
762
- // 下一步
763
- var handleNextStep = function handleNextStep() {
764
- emit('next');
765
- };
766
- // 拖拽事件
767
- var moveHandler = function moveHandler(e) {
768
- if (props.fullscreen) {
769
- return false;
770
- }
771
- if (!props.draggable) {
772
- return false;
773
- }
774
- var odiv = e.target;
775
- var parentHeight = e.currentTarget.parentNode.parentNode.offsetHeight;
776
- var parentWidth = e.currentTarget.parentNode.parentNode.offsetWidth;
777
- var disX;
778
- var disY;
779
- if (data.positionX !== 0 && data.positionY !== 0) {
780
- disX = e.clientX - data.positionX;
781
- disY = e.clientY - data.positionY;
782
- } else {
783
- disX = e.clientX - odiv.offsetLeft;
784
- disY = e.clientY - odiv.offsetTop;
785
- }
786
- document.onmousemove = function (e) {
787
- var boxLeft = window.innerWidth - parentWidth;
788
- var boxTop = window.innerHeight - parentHeight;
789
- var left = e.clientX - disX;
790
- var top = e.clientY - disY;
791
- if (boxLeft / 2 - left <= 0) {
792
- left = boxLeft / 2;
793
- } else if (boxLeft / 2 + left <= 0) {
794
- left = -boxLeft / 2;
700
+ // 配置项变更 onClose 变更为 onCancel
701
+ if (payload.onClose) {
702
+ state.onCancel = payload.onClose;
703
+ }
704
+ // 配置项变更 subTitle 变更为 content
705
+ if (payload.subTitle) {
706
+ state.content = payload.subTitle;
795
707
  }
796
- if (boxTop / 2 - top <= 0) {
797
- top = boxTop / 2;
798
- } else if (boxTop / 2 + top <= 0) {
799
- top = -boxTop / 2;
708
+ // 配置项变更 theme 变更为 confirmButtonTheme
709
+ if (payload.theme) {
710
+ state.confirmButtonTheme = payload.theme;
800
711
  }
801
- data.positionX = left;
802
- data.positionY = top;
803
- data.moveStyle.left = "calc(50% + ".concat(left, "px)");
804
- data.moveStyle.top = "calc(50% + ".concat(top, "px)");
712
+ // 配置项变更 extCls 变更为 class
713
+ if (payload.extCls) {
714
+ state["class"] = payload.extCls;
715
+ }
716
+ }
717
+ });
718
+ return function () {
719
+ var renderIcon = function renderIcon() {
720
+ if (!state.type) {
721
+ return null;
722
+ }
723
+ var iconMap = {
724
+ loading: (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Spinner, {
725
+ "class": [resolveClassName('infobox-icon'), 'loading']
726
+ }, null),
727
+ warning: (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Warn, {
728
+ "class": [resolveClassName('infobox-icon'), 'warning']
729
+ }, null),
730
+ success: (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Success, {
731
+ "class": [resolveClassName('infobox-icon'), 'success']
732
+ }, null),
733
+ danger: (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Close, {
734
+ "class": [resolveClassName('infobox-icon'), 'danger']
735
+ }, null)
736
+ };
737
+ return (0,external_vue_namespaceObject.createVNode)("div", {
738
+ "class": resolveClassName('infobox-type')
739
+ }, [iconMap[state.type]]);
805
740
  };
806
- document.onmouseup = function () {
807
- document.onmousemove = null;
808
- document.onmouseup = null;
741
+ var renderTitle = function renderTitle() {
742
+ if ((0,isFunction_namespaceObject["default"])(state.title)) {
743
+ return state.title();
744
+ }
745
+ return state.title;
809
746
  };
810
- };
811
- var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
812
- resolveClassName = _usePrefix.resolveClassName;
813
- return {
814
- data: data,
815
- handleClose: handleClose,
816
- handleConfirm: handleConfirm,
817
- escCloseHandler: escCloseHandler,
818
- moveHandler: moveHandler,
819
- handlePrevStep: handlePrevStep,
820
- handleNextStep: handleNextStep,
821
- hasFooter: hasFooter,
822
- isModalShow: isModalShow,
823
- localConfirmText: localConfirmText,
824
- localCancelText: localCancelText,
825
- localPrevText: localPrevText,
826
- localNextText: localNextText,
827
- resolveClassName: resolveClassName
828
- };
829
- },
830
- render: function render() {
831
- var _this = this;
832
- var renderIcon = function renderIcon() {
833
- var iconMap = {
834
- loading: (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Spinner, {
835
- "class": [_this.resolveClassName('info-icon'), 'primary']
836
- }, null),
837
- warning: (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Warn, {
838
- "class": [_this.resolveClassName('info-icon'), 'warning']
839
- }, null),
840
- success: (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Success, {
841
- "class": [_this.resolveClassName('info-icon'), 'success']
842
- }, null),
843
- danger: (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Close, {
844
- "class": [_this.resolveClassName('info-icon'), 'danger']
845
- }, null)
747
+ var renderContent = function renderContent() {
748
+ if ((0,isFunction_namespaceObject["default"])(state.content)) {
749
+ return state.content();
750
+ }
751
+ return state.content;
846
752
  };
847
- return iconMap[_this.infoType];
848
- };
849
- var dialogSlot = {
850
- header: function header() {
851
- var _this$$slots$tools, _this$$slots$tools2, _this$$slots, _this$$slots$header, _this$$slots$header2, _this$$slots2;
852
- return [(0,external_vue_namespaceObject.createVNode)("div", {
853
- "class": [_this.resolveClassName('dialog-tool'), _this.fullscreen || !_this.draggable ? '' : 'move', _this.draggable ? 'content-dragging' : ''],
854
- "onMousedown": _this.moveHandler
855
- }, [(_this$$slots$tools = (_this$$slots$tools2 = (_this$$slots = _this.$slots).tools) === null || _this$$slots$tools2 === void 0 ? void 0 : _this$$slots$tools2.call(_this$$slots)) !== null && _this$$slots$tools !== void 0 ? _this$$slots$tools : '']), (0,external_vue_namespaceObject.createVNode)("div", {
856
- "class": _this.resolveClassName('dialog-header')
857
- }, [(0,external_vue_namespaceObject.createVNode)("div", {
858
- "class": _this.resolveClassName('header-icon')
859
- }, [_this.infoType ? renderIcon() : (0,external_vue_namespaceObject.createVNode)("slot", {
860
- "name": "info-icon"
861
- }, null)]), (0,external_vue_namespaceObject.createVNode)("span", {
862
- "class": _this.resolveClassName('dialog-title'),
863
- "style": "text-align: ".concat(_this.headerAlign)
864
- }, [(_this$$slots$header = (_this$$slots$header2 = (_this$$slots2 = _this.$slots).header) === null || _this$$slots$header2 === void 0 ? void 0 : _this$$slots$header2.call(_this$$slots2)) !== null && _this$$slots$header !== void 0 ? _this$$slots$header : _this.title])])];
865
- },
866
- "default": function _default() {
867
- var _this$$slots$default, _this$$slots$default2, _this$$slots3;
868
- return (_this$$slots$default = (_this$$slots$default2 = (_this$$slots3 = _this.$slots)["default"]) === null || _this$$slots$default2 === void 0 ? void 0 : _this$$slots$default2.call(_this$$slots3)) !== null && _this$$slots$default !== void 0 ? _this$$slots$default : 'default';
869
- },
870
- footer: function footer() {
871
- var _this$$slots$footer, _this$$slots$footer2, _this$$slots4, _this$$slots$footer3, _this$$slots$footer4, _this$$slots5, _this$$slots$footer5, _this$$slots$footer6, _this$$slots6;
872
- return (0,external_vue_namespaceObject.createVNode)("div", {
873
- "class": _this.resolveClassName('dialog-footer'),
874
- "style": "text-align: ".concat(_this.footerAlign)
875
- }, [_this.dialogType === 'process' ? (_this$$slots$footer = (_this$$slots$footer2 = (_this$$slots4 = _this.$slots).footer) === null || _this$$slots$footer2 === void 0 ? void 0 : _this$$slots$footer2.call(_this$$slots4)) !== null && _this$$slots$footer !== void 0 ? _this$$slots$footer : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [_this.current === 1 ? '' : (0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
876
- "class": _this.resolveClassName('dialog-perv'),
877
- "onClick": _this.handlePrevStep
878
- }, {
879
- "default": function _default() {
880
- return [_this.localPrevText];
881
- }
882
- }), _this.current === _this.totalStep ? '' : (0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
883
- "class": _this.resolveClassName('dialog-next'),
884
- "onClick": _this.handleNextStep
885
- }, {
886
- "default": function _default() {
887
- return [_this.localNextText];
888
- }
889
- }), _this.current === _this.totalStep ? (0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
890
- "onClick": _this.handleConfirm,
891
- "theme": _this.theme,
892
- "loading": _this.isLoading
893
- }, {
894
- "default": function _default() {
895
- return [_this.localConfirmText];
896
- }
897
- }) : '', (0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
898
- "class": _this.resolveClassName('dialog-cancel'),
899
- "onClick": _this.handleClose,
900
- "disabled": _this.isLoading
901
- }, {
902
- "default": function _default() {
903
- return [_this.localCancelText];
904
- }
905
- })]) : '', _this.dialogType === 'operation' ? (_this$$slots$footer3 = (_this$$slots$footer4 = (_this$$slots5 = _this.$slots).footer) === null || _this$$slots$footer4 === void 0 ? void 0 : _this$$slots$footer4.call(_this$$slots5)) !== null && _this$$slots$footer3 !== void 0 ? _this$$slots$footer3 : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
906
- "onClick": _this.handleConfirm,
907
- "theme": _this.theme,
908
- "loading": _this.isLoading
909
- }, {
910
- "default": function _default() {
911
- return [_this.localConfirmText];
912
- }
913
- }), (0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
914
- "class": _this.resolveClassName('dialog-cancel'),
915
- "onClick": _this.handleClose,
916
- "disabled": _this.isLoading
753
+ var renderFooter = function renderFooter() {
754
+ if ((0,isFunction_namespaceObject["default"])(state.footer)) {
755
+ return state.footer();
756
+ }
757
+ if (state.footer) {
758
+ return state.footer;
759
+ }
760
+ return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [state.confirmText && (0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
761
+ "loading": isLoading.value,
762
+ "theme": state.confirmButtonTheme,
763
+ "onClick": handleConfirm
917
764
  }, {
918
765
  "default": function _default() {
919
- return [_this.localCancelText];
766
+ return [state.confirmText];
920
767
  }
921
- })]) : '', _this.dialogType === 'confirm' ? (_this$$slots$footer5 = (_this$$slots$footer6 = (_this$$slots6 = _this.$slots).footer) === null || _this$$slots$footer6 === void 0 ? void 0 : _this$$slots$footer6.call(_this$$slots6)) !== null && _this$$slots$footer5 !== void 0 ? _this$$slots$footer5 : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
922
- "onClick": _this.handleConfirm,
923
- "theme": _this.theme,
924
- "loading": _this.isLoading
768
+ }), state.cancelText && (0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
769
+ "onClick": handleCancel
925
770
  }, {
926
771
  "default": function _default() {
927
- return [_this.localConfirmText];
772
+ return [state.cancelText];
928
773
  }
929
- })]) : '']);
930
- },
931
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
932
- close: function close() {
933
- return (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Error, {
934
- "onClick": _this.handleClose
935
- }, null);
936
- }
774
+ })]);
775
+ };
776
+ return (0,external_vue_namespaceObject.createVNode)(modal_namespaceObject["default"], {
777
+ "class": [resolveClassName('infobox'), state["class"]],
778
+ "isShow": isShow.value,
779
+ "animateType": "fadein",
780
+ "transfer": true,
781
+ "quickClose": false,
782
+ "width": state.width,
783
+ "closeIcon": state.closeIcon
784
+ }, {
785
+ header: function header() {
786
+ return (0,external_vue_namespaceObject.createVNode)("div", {
787
+ "class": resolveClassName('infobox-header')
788
+ }, [renderIcon(), (0,external_vue_namespaceObject.createVNode)("div", {
789
+ "class": resolveClassName('infobox-title'),
790
+ "style": {
791
+ textAlign: state.headerAlign
792
+ }
793
+ }, [renderTitle()])]);
794
+ },
795
+ "default": function _default() {
796
+ return state.content && (0,external_vue_namespaceObject.createVNode)("div", {
797
+ "class": resolveClassName('infobox-content'),
798
+ "style": {
799
+ textAlign: state.contentAlign
800
+ }
801
+ }, [renderContent()]);
802
+ },
803
+ footer: function footer() {
804
+ return (0,external_vue_namespaceObject.createVNode)("div", {
805
+ "class": _defineProperty(_defineProperty({}, resolveClassName('infobox-footer'), true), "is-position-".concat(state.footerAlign), state.footerAlign)
806
+ }, [renderFooter()]);
807
+ },
808
+ close: function close() {
809
+ return (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Error, {
810
+ "onClick": handleCancel
811
+ }, null);
812
+ }
813
+ });
937
814
  };
938
- var className = "".concat(this.resolveClassName('dialog-wrapper '), " ").concat(this.scrollable ? 'scroll-able' : '', " ").concat(this.multiInstance ? 'multi-instance' : '', " ").concat(this.hasFooter ? 'has-footer' : 'no-footer');
939
- return (0,external_vue_namespaceObject.createVNode)(modal_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)(this.$props, {
940
- "class": className,
941
- "onClose": this.handleClose,
942
- "isShow": this.isModalShow,
943
- "left": this.data.moveStyle.left,
944
- "top": this.data.moveStyle.top
945
- }), _isSlot(dialogSlot) ? dialogSlot : {
946
- "default": function _default() {
947
- return [dialogSlot];
948
- }
949
- });
950
815
  }
951
816
  }));
952
- ;// CONCATENATED MODULE: ../../packages/info-box/src/info-box.tsx
953
-
954
-
955
-
956
- function info_box_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
957
- function info_box_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? info_box_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : info_box_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
958
-
817
+ ;// CONCATENATED MODULE: ../../packages/info-box/src/info-box.ts
959
818
  /*
960
819
  * Tencent is pleased to support the open source community by making
961
820
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -983,165 +842,47 @@ function info_box_objectSpread(e) { for (var r = 1; r < arguments.length; r++) {
983
842
  */
984
843
 
985
844
 
986
-
987
- var InfoBox = function InfoBox(config) {
988
- var container = document.createElement('div');
989
- var modalFuncProps = (0,external_vue_namespaceObject.shallowRef)(config);
990
- var isShow = (0,external_vue_namespaceObject.ref)(modalFuncProps.value.isShow !== false);
991
- var app;
992
- var dialog = (0,external_vue_namespaceObject.defineComponent)({
993
- name: 'DialogConfirm',
994
- setup: function setup(_props, _ref) {
995
- var expose = _ref.expose;
996
- var beforeHiddenFn = [];
997
- var resolveUserCallbackFnBeforeClose = /*#__PURE__*/function () {
998
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(userCallbackFn) {
999
- return regenerator_default().wrap(function _callee$(_context) {
1000
- while (1) switch (_context.prev = _context.next) {
1001
- case 0:
1002
- if (!(typeof userCallbackFn === 'function')) {
1003
- _context.next = 7;
1004
- break;
1005
- }
1006
- if (!(userCallbackFn instanceof Promise)) {
1007
- _context.next = 6;
1008
- break;
1009
- }
1010
- _context.next = 4;
1011
- return userCallbackFn();
1012
- case 4:
1013
- _context.next = 7;
1014
- break;
1015
- case 6:
1016
- beforeHiddenFn.push(userCallbackFn);
1017
- case 7:
1018
- isShow.value = false;
1019
- case 8:
1020
- case "end":
1021
- return _context.stop();
1022
- }
1023
- }, _callee);
1024
- }));
1025
- return function resolveUserCallbackFnBeforeClose(_x) {
1026
- return _ref2.apply(this, arguments);
1027
- };
1028
- }();
1029
- var onClosed = /*#__PURE__*/function () {
1030
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2() {
1031
- var _modalFuncProps$value;
1032
- return regenerator_default().wrap(function _callee2$(_context2) {
1033
- while (1) switch (_context2.prev = _context2.next) {
1034
- case 0:
1035
- resolveUserCallbackFnBeforeClose((_modalFuncProps$value = modalFuncProps.value) === null || _modalFuncProps$value === void 0 ? void 0 : _modalFuncProps$value.onClosed);
1036
- case 1:
1037
- case "end":
1038
- return _context2.stop();
1039
- }
1040
- }, _callee2);
1041
- }));
1042
- return function onClosed() {
1043
- return _ref3.apply(this, arguments);
1044
- };
1045
- }();
1046
- var onConfirm = /*#__PURE__*/function () {
1047
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee3() {
1048
- var _modalFuncProps$value2;
1049
- return regenerator_default().wrap(function _callee3$(_context3) {
1050
- while (1) switch (_context3.prev = _context3.next) {
1051
- case 0:
1052
- resolveUserCallbackFnBeforeClose((_modalFuncProps$value2 = modalFuncProps.value) === null || _modalFuncProps$value2 === void 0 ? void 0 : _modalFuncProps$value2.onConfirm);
1053
- case 1:
1054
- case "end":
1055
- return _context3.stop();
1056
- }
1057
- }, _callee3);
1058
- }));
1059
- return function onConfirm() {
1060
- return _ref4.apply(this, arguments);
1061
- };
1062
- }();
1063
- function update(newValue) {
1064
- modalFuncProps.value = info_box_objectSpread(info_box_objectSpread({}, modalFuncProps.value), newValue);
1065
- }
1066
- expose({
1067
- update: update
1068
- });
1069
- var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
1070
- resolveClassName = _usePrefix.resolveClassName;
1071
- var getContent = function getContent() {
1072
- var children = [];
1073
- var subTitleBox = [];
1074
- if (modalFuncProps.value.subTitle) {
1075
- switch (_typeof(modalFuncProps.value.subTitle)) {
1076
- case 'string':
1077
- children.push(modalFuncProps.value.subTitle);
1078
- break;
1079
- case 'function':
1080
- children.push(modalFuncProps.value.subTitle());
1081
- break;
1082
- default:
1083
- children.push(modalFuncProps.value.subTitle);
1084
- break;
1085
- }
1086
- }
1087
- if (children.length) {
1088
- subTitleBox.push((0,external_vue_namespaceObject.h)('div', {
1089
- "class": resolveClassName('info-sub-title'),
1090
- style: "text-Align:".concat(modalFuncProps.value.contentAlign || 'center')
1091
- }, children));
1092
- }
1093
- return subTitleBox;
1094
- };
1095
- var onHidden = function onHidden() {
1096
- beforeHiddenFn.forEach(function (fn) {
1097
- return fn();
845
+ var appRef = (0,external_vue_namespaceObject.ref)();
846
+ var getInstance = function getInstance() {
847
+ if (!appRef.value) {
848
+ var container = document.createElement('div');
849
+ var infoboxInstance = (0,external_vue_namespaceObject.createApp)({
850
+ render: function render() {
851
+ return (0,external_vue_namespaceObject.h)(render_component, {
852
+ ref: appRef
1098
853
  });
1099
- beforeHiddenFn.length = 0;
1100
- container.remove();
1101
- };
1102
- return function () {
1103
- return (0,external_vue_namespaceObject.createVNode)(src_dialog, info_box_objectSpread(info_box_objectSpread({
1104
- "class": resolveClassName('info-wrapper'),
1105
- headerAlign: 'center',
1106
- footerAlign: 'center',
1107
- fullscreen: false
1108
- }, modalFuncProps.value), {}, {
1109
- isShow: isShow.value,
1110
- transfer: false,
1111
- onClosed: onClosed,
1112
- onConfirm: onConfirm,
1113
- onHidden: onHidden
1114
- }), getContent);
1115
- };
1116
- }
1117
- });
1118
- var beforeShow = function beforeShow() {
1119
- if (!app) {
1120
- document.body.append(container);
1121
- app = (0,external_vue_namespaceObject.createApp)(dialog).mount(container);
1122
- }
854
+ }
855
+ });
856
+ document.body.appendChild(container);
857
+ infoboxInstance.mount(container);
858
+ }
859
+ return appRef.value;
860
+ };
861
+ var InfoBox = function InfoBox(config) {
862
+ var instance = getInstance();
863
+ var configCache = Object.assign(genDefaultState(), config);
864
+ var show = function show() {
865
+ var _instance, _instance2;
866
+ (_instance = instance) === null || _instance === void 0 || _instance.update(configCache);
867
+ (_instance2 = instance) === null || _instance2 === void 0 || _instance2.show();
1123
868
  };
1124
- if (isShow.value) {
1125
- beforeShow();
869
+ // 被调用时默认会弹出,当不需要默认弹出时需要明确传入 isShow: false 作为参数
870
+ if (config.isShow !== false) {
871
+ show();
1126
872
  }
1127
873
  return {
1128
- show: function show() {
1129
- beforeShow();
1130
- isShow.value = true;
1131
- },
874
+ show: show,
1132
875
  hide: function hide() {
1133
- isShow.value = false;
876
+ var _instance3;
877
+ (_instance3 = instance) === null || _instance3 === void 0 || _instance3.hide();
1134
878
  },
1135
879
  update: function update(config) {
1136
- var _app;
1137
- beforeShow();
1138
- (_app = app) === null || _app === void 0 || _app.update(config);
880
+ var _instance4;
881
+ Object.assign(configCache, config);
882
+ (_instance4 = instance) === null || _instance4 === void 0 || _instance4.update(configCache);
1139
883
  },
1140
884
  destroy: function destroy() {
1141
- var _app2;
1142
- container.remove();
1143
- (_app2 = app) === null || _app2 === void 0 || _app2.unmount();
1144
- app = null;
885
+ instance = null;
1145
886
  }
1146
887
  };
1147
888
  };