bkui-vue 2.0.1-beta.7 → 2.0.1-beta.70.search.1

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 (153) hide show
  1. package/dist/index.cjs.js +71 -71
  2. package/dist/index.esm.js +19703 -20587
  3. package/dist/index.umd.js +71 -71
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/cascader/cascader.css +3 -3
  7. package/lib/cascader/cascader.less +3 -3
  8. package/lib/cascader/cascader.variable.css +3 -3
  9. package/lib/cascader/index.js +4 -4
  10. package/lib/collapse/collapse.css +0 -11
  11. package/lib/collapse/collapse.d.ts +0 -11
  12. package/lib/collapse/collapse.less +1 -15
  13. package/lib/collapse/collapse.variable.css +0 -11
  14. package/lib/collapse/index.d.ts +0 -23
  15. package/lib/collapse/index.js +1 -9
  16. package/lib/collapse/props.d.ts +0 -8
  17. package/lib/color-picker/color-picker.css +3 -3
  18. package/lib/color-picker/color-picker.less +3 -3
  19. package/lib/color-picker/color-picker.variable.css +3 -3
  20. package/lib/color-picker/index.js +1 -1
  21. package/lib/components.d.ts +0 -1
  22. package/lib/components.js +0 -1
  23. package/lib/date-picker/base/year-table.d.ts +2 -2
  24. package/lib/date-picker/index.js +36 -111
  25. package/lib/date-picker/interface.d.ts +1 -1
  26. package/lib/date-picker/panel/date-range.d.ts +63 -1
  27. package/lib/date-picker/utils.d.ts +0 -4
  28. package/lib/dialog/dialog.css +84 -135
  29. package/lib/dialog/dialog.d.ts +132 -38
  30. package/lib/dialog/dialog.less +76 -9
  31. package/lib/dialog/dialog.variable.css +84 -135
  32. package/lib/dialog/index.d.ts +311 -96
  33. package/lib/dialog/index.js +221 -197
  34. package/lib/dialog/props.d.ts +47 -10
  35. package/lib/info-box/index.d.ts +2 -2
  36. package/lib/info-box/index.js +173 -328
  37. package/lib/info-box/info-box.css +7 -63
  38. package/lib/info-box/info-box.d.ts +16 -18
  39. package/lib/info-box/info-box.less +14 -76
  40. package/lib/info-box/info-box.variable.css +7 -63
  41. package/lib/input/index.js +1 -2
  42. package/lib/modal/hooks.d.ts +1 -1
  43. package/lib/modal/index.d.ts +345 -29
  44. package/lib/modal/index.js +703 -218
  45. package/lib/modal/modal.css +32 -131
  46. package/lib/modal/modal.d.ts +132 -11
  47. package/lib/modal/modal.less +29 -83
  48. package/lib/modal/modal.variable.css +32 -131
  49. package/lib/modal/props.mixin.d.ts +52 -4
  50. package/lib/overflow-title/index.js +52 -46
  51. package/lib/radio/index.d.ts +0 -29
  52. package/lib/radio/index.js +16 -34
  53. package/lib/radio/radio-button.d.ts +0 -10
  54. package/lib/radio/radio-group.d.ts +0 -10
  55. package/lib/radio/radio.d.ts +0 -10
  56. package/lib/rate/rate.css +0 -27
  57. package/lib/rate/rate.less +0 -33
  58. package/lib/rate/rate.variable.css +0 -27
  59. package/lib/rate/star.css +27 -0
  60. package/lib/rate/star.less +34 -0
  61. package/lib/{scrollbar/scrollbar.variable.css → rate/star.variable.css} +19 -67
  62. package/lib/search-select/index.d.ts +58 -78
  63. package/lib/search-select/index.js +311 -211
  64. package/lib/search-select/input.d.ts +6 -5
  65. package/lib/search-select/menu.d.ts +1 -1
  66. package/lib/search-select/search-select.d.ts +19 -43
  67. package/lib/search-select/selected.d.ts +12 -10
  68. package/lib/search-select/utils.d.ts +6 -6
  69. package/lib/select/index.d.ts +19 -0
  70. package/lib/select/index.js +21 -8
  71. package/lib/select/select.css +2 -1
  72. package/lib/select/select.d.ts +9 -0
  73. package/lib/select/select.less +2 -1
  74. package/lib/select/select.variable.css +2 -1
  75. package/lib/shared/index.d.ts +1 -0
  76. package/lib/shared/index.js +48 -4
  77. package/lib/shared/mask.d.ts +11 -0
  78. package/lib/sideslider/index.d.ts +218 -42
  79. package/lib/sideslider/index.js +40 -65
  80. package/lib/sideslider/sideslider.css +86 -17
  81. package/lib/sideslider/sideslider.d.ts +104 -20
  82. package/lib/sideslider/sideslider.less +107 -27
  83. package/lib/sideslider/sideslider.variable.css +86 -17
  84. package/lib/slider/index.d.ts +0 -19
  85. package/lib/slider/index.js +5 -45
  86. package/lib/slider/slider.css +0 -14
  87. package/lib/slider/slider.d.ts +0 -9
  88. package/lib/slider/slider.less +0 -15
  89. package/lib/slider/slider.variable.css +0 -14
  90. package/lib/styles/index.d.ts +1 -0
  91. package/lib/table/components/table-cell.d.ts +2 -3
  92. package/lib/table/components/table-column.d.ts +119 -3
  93. package/lib/table/const.d.ts +4 -4
  94. package/lib/table/index.d.ts +107 -26
  95. package/lib/table/index.js +578 -17818
  96. package/lib/table/plugins/head-filter.css +4 -8
  97. package/lib/table/plugins/head-filter.less +3 -6
  98. package/lib/table/plugins/head-filter.variable.css +4 -8
  99. package/lib/table/plugins/use-active-columns.d.ts +2 -2
  100. package/lib/table/plugins/use-fixed-column.d.ts +1 -1
  101. package/lib/table/plugins/use-pagination.d.ts +1 -3
  102. package/lib/table/props.d.ts +4 -12
  103. package/lib/table/table.css +46 -106
  104. package/lib/table/table.d.ts +0 -11
  105. package/lib/table/table.less +58 -43
  106. package/lib/table/table.variable.css +46 -106
  107. package/lib/table/use-attributes.d.ts +1 -2
  108. package/lib/table/use-column.d.ts +10 -9
  109. package/lib/table/use-common.d.ts +1 -1
  110. package/lib/table/use-render.d.ts +1 -1
  111. package/lib/table-column/index.d.ts +299 -9
  112. package/lib/table-column/index.js +283 -25
  113. package/lib/transfer/index.js +14 -16
  114. package/lib/transfer/transfer.css +9 -9
  115. package/lib/transfer/transfer.less +3 -3
  116. package/lib/transfer/transfer.variable.css +9 -9
  117. package/lib/tree/constant.d.ts +1 -3
  118. package/lib/tree/index.d.ts +0 -44
  119. package/lib/tree/index.js +35 -17554
  120. package/lib/tree/props.d.ts +0 -18
  121. package/lib/tree/tree.css +2 -76
  122. package/lib/tree/tree.d.ts +2 -28
  123. package/lib/tree/tree.less +1 -1
  124. package/lib/tree/tree.variable.css +2 -76
  125. package/lib/tree/use-node-attribute.d.ts +0 -9
  126. package/lib/tree/util.d.ts +1 -1
  127. package/lib/upload/index.js +9 -16
  128. package/lib/upload/upload.type.d.ts +1 -1
  129. package/lib/virtual-render/index.d.ts +0 -27
  130. package/lib/virtual-render/index.js +80 -295
  131. package/lib/virtual-render/props.d.ts +0 -16
  132. package/lib/virtual-render/use-fix-top.d.ts +7 -2
  133. package/lib/virtual-render/v-virtual-render.d.ts +1 -2
  134. package/lib/virtual-render/virtual-render.css +2 -76
  135. package/lib/virtual-render/virtual-render.d.ts +0 -13
  136. package/lib/virtual-render/virtual-render.less +3 -3
  137. package/lib/virtual-render/virtual-render.variable.css +2 -76
  138. package/package.json +1 -1
  139. package/lib/info-box/render-component.d.ts +0 -4
  140. package/lib/modal/mask.d.ts +0 -6
  141. package/lib/scrollbar/index.d.ts +0 -15
  142. package/lib/scrollbar/index.js +0 -18763
  143. package/lib/scrollbar/scrollbar-core/can-use-dom.d.ts +0 -2
  144. package/lib/scrollbar/scrollbar-core/helpers.d.ts +0 -5
  145. package/lib/scrollbar/scrollbar-core/index.d.ts +0 -241
  146. package/lib/scrollbar/scrollbar-core/mouse-wheel.d.ts +0 -5
  147. package/lib/scrollbar/scrollbar-core/scrollbar-width.d.ts +0 -1
  148. package/lib/scrollbar/scrollbar.css +0 -75
  149. package/lib/scrollbar/scrollbar.less +0 -94
  150. package/lib/table/plugins/use-column-template.d.ts +0 -7
  151. package/lib/table/plugins/use-shift-key.d.ts +0 -13
  152. package/lib/tree/use-intersection-observer.d.ts +0 -27
  153. package/lib/virtual-render/use-scrollbar.d.ts +0 -24
@@ -2,13 +2,9 @@ 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_lodash_isFunction_f90b20d6__ from "lodash/isFunction";
6
- import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_button_a2ea7c9a__ from "../button";
7
- import "../button/button.less";
8
5
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
9
- import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
10
- import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_modal_d1344388__ from "../modal";
11
- import "../modal/modal.less";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_dialog_497cb4c3__ from "../dialog";
7
+ import "../dialog/dialog.less";
12
8
  /******/ var __webpack_modules__ = ({
13
9
 
14
10
  /***/ 7609:
@@ -429,10 +425,6 @@ __webpack_require__.d(__webpack_exports__, {
429
425
  var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
430
426
  var y = x => () => x
431
427
  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 });
436
428
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
437
429
  function _typeof(o) {
438
430
  "@babel/helpers - typeof";
@@ -512,38 +504,28 @@ function _asyncToGenerator(fn) {
512
504
  // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
513
505
  var regenerator = __webpack_require__(2841);
514
506
  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
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"] });
519
- ;// CONCATENATED MODULE: external "../button"
520
- var button_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
521
- var button_y = x => () => x
522
- const button_namespaceObject = button_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_button_a2ea7c9a__["default"] });
523
- ;// CONCATENATED MODULE: external "../button/button.less"
524
- var button_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
525
- var button_less_y = x => () => x
526
- const button_less_namespaceObject = button_less_x({ });
507
+ ;// CONCATENATED MODULE: external "vue"
508
+ var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
509
+ var external_vue_y = x => () => x
510
+ const external_vue_namespaceObject = external_vue_x({ ["createApp"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createApp, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef });
527
511
  ;// CONCATENATED MODULE: external "../config-provider"
528
512
  var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
529
513
  var config_provider_y = x => () => x
530
514
  const config_provider_namespaceObject = config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
531
- ;// CONCATENATED MODULE: external "../icon"
532
- var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
533
- var icon_y = x => () => x
534
- const icon_namespaceObject = icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Error, ["Spinner"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Spinner, ["Success"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Success, ["Warn"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Warn });
535
- ;// CONCATENATED MODULE: external "../modal"
536
- var modal_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
537
- var modal_y = x => () => x
538
- const modal_namespaceObject = modal_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_modal_d1344388__["default"] });
539
- ;// CONCATENATED MODULE: external "../modal/modal.less"
540
- var modal_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
541
- var modal_less_y = x => () => x
542
- const modal_less_namespaceObject = modal_less_x({ });
543
- ;// CONCATENATED MODULE: ../../packages/info-box/src/render-component.tsx
515
+ ;// CONCATENATED MODULE: external "../dialog"
516
+ var dialog_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
517
+ var dialog_y = x => () => x
518
+ const dialog_namespaceObject = dialog_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_dialog_497cb4c3__["default"] });
519
+ ;// CONCATENATED MODULE: external "../dialog/dialog.less"
520
+ var dialog_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
521
+ var dialog_less_y = x => () => x
522
+ const dialog_less_namespaceObject = dialog_less_x({ });
523
+ ;// CONCATENATED MODULE: ../../packages/info-box/src/info-box.tsx
544
524
 
545
525
 
546
526
 
527
+ 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; }
528
+ 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; }
547
529
 
548
530
  /*
549
531
  * Tencent is pleased to support the open source community by making
@@ -574,315 +556,178 @@ const modal_less_namespaceObject = modal_less_x({ });
574
556
 
575
557
 
576
558
 
577
-
578
-
579
-
580
-
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 () {
622
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee() {
623
- var willClose;
624
- return regenerator_default().wrap(function _callee$(_context) {
625
- while (1) switch (_context.prev = _context.next) {
626
- case 0:
627
- isLoading.value = true;
628
- _context.prev = 1;
629
- _context.next = 4;
630
- return state.beforeClose('confirm');
631
- case 4:
632
- willClose = _context.sent;
633
- if (willClose) {
559
+ var InfoBox = function InfoBox(config) {
560
+ var container = document.createElement('div');
561
+ var modalFuncProps = (0,external_vue_namespaceObject.shallowRef)(config);
562
+ var isShow = (0,external_vue_namespaceObject.ref)(modalFuncProps.value.isShow !== false);
563
+ var app;
564
+ var dialogConfirm;
565
+ var dialog = (0,external_vue_namespaceObject.defineComponent)({
566
+ name: 'DialogConfirm',
567
+ setup: function setup(_props, _ref) {
568
+ var expose = _ref.expose;
569
+ var isLoading = false;
570
+ var beforeHiddenFn = [];
571
+ var resolveUserCallbackFnBeforeClose = /*#__PURE__*/function () {
572
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(userCallbackFn) {
573
+ return regenerator_default().wrap(function _callee$(_context) {
574
+ while (1) switch (_context.prev = _context.next) {
575
+ case 0:
576
+ if (!(typeof userCallbackFn === 'function')) {
577
+ _context.next = 7;
578
+ break;
579
+ }
580
+ if (!(userCallbackFn instanceof Promise)) {
581
+ _context.next = 6;
582
+ break;
583
+ }
584
+ _context.next = 4;
585
+ return userCallbackFn();
586
+ case 4:
634
587
  _context.next = 7;
635
588
  break;
636
- }
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:
648
- case "end":
649
- return _context.stop();
650
- }
651
- }, _callee, null, [[1,, 10, 13]]);
652
- }));
653
- return function handleConfirm() {
654
- return _ref2.apply(this, arguments);
655
- };
656
- }();
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;
699
- }
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;
707
- }
708
- // 配置项变更 theme 变更为 confirmButtonTheme
709
- if (payload.theme) {
710
- state.confirmButtonTheme = payload.theme;
711
- }
712
- // 配置项变更 extCls 变更为 class
713
- if (payload.extCls) {
714
- state["class"] = payload.extCls;
715
- }
589
+ case 6:
590
+ beforeHiddenFn.push(userCallbackFn);
591
+ case 7:
592
+ isShow.value = false;
593
+ case 8:
594
+ case "end":
595
+ return _context.stop();
596
+ }
597
+ }, _callee);
598
+ }));
599
+ return function resolveUserCallbackFnBeforeClose(_x) {
600
+ return _ref2.apply(this, arguments);
601
+ };
602
+ }();
603
+ var onClosed = /*#__PURE__*/function () {
604
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2() {
605
+ var _modalFuncProps$value;
606
+ return regenerator_default().wrap(function _callee2$(_context2) {
607
+ while (1) switch (_context2.prev = _context2.next) {
608
+ case 0:
609
+ resolveUserCallbackFnBeforeClose((_modalFuncProps$value = modalFuncProps.value) === null || _modalFuncProps$value === void 0 ? void 0 : _modalFuncProps$value.onClosed);
610
+ case 1:
611
+ case "end":
612
+ return _context2.stop();
613
+ }
614
+ }, _callee2);
615
+ }));
616
+ return function onClosed() {
617
+ return _ref3.apply(this, arguments);
618
+ };
619
+ }();
620
+ var onConfirm = /*#__PURE__*/function () {
621
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee3() {
622
+ var _modalFuncProps$value2;
623
+ return regenerator_default().wrap(function _callee3$(_context3) {
624
+ while (1) switch (_context3.prev = _context3.next) {
625
+ case 0:
626
+ isLoading = true;
627
+ _context3.next = 3;
628
+ return resolveUserCallbackFnBeforeClose((_modalFuncProps$value2 = modalFuncProps.value) === null || _modalFuncProps$value2 === void 0 ? void 0 : _modalFuncProps$value2.onConfirm);
629
+ case 3:
630
+ isLoading = false;
631
+ case 4:
632
+ case "end":
633
+ return _context3.stop();
634
+ }
635
+ }, _callee3);
636
+ }));
637
+ return function onConfirm() {
638
+ return _ref4.apply(this, arguments);
639
+ };
640
+ }();
641
+ function update(newValue) {
642
+ modalFuncProps.value = _objectSpread(_objectSpread({}, modalFuncProps.value), newValue);
716
643
  }
717
- });
718
- return function () {
719
- var renderIcon = function renderIcon() {
720
- if (!state.type) {
721
- return null;
644
+ expose({
645
+ update: update
646
+ });
647
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
648
+ resolveClassName = _usePrefix.resolveClassName;
649
+ var getContent = function getContent() {
650
+ var children = [];
651
+ var subTitleBox = [];
652
+ if (modalFuncProps.value.subTitle) {
653
+ switch (_typeof(modalFuncProps.value.subTitle)) {
654
+ case 'string':
655
+ children.push(modalFuncProps.value.subTitle);
656
+ break;
657
+ case 'function':
658
+ children.push(modalFuncProps.value.subTitle());
659
+ break;
660
+ default:
661
+ children.push(modalFuncProps.value.subTitle);
662
+ break;
663
+ }
722
664
  }
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]]);
740
- };
741
- var renderTitle = function renderTitle() {
742
- if ((0,isFunction_namespaceObject["default"])(state.title)) {
743
- return state.title();
665
+ if (children.length) {
666
+ subTitleBox.push((0,external_vue_namespaceObject.h)('div', {
667
+ "class": resolveClassName('info-sub-title'),
668
+ style: "text-Align:".concat(modalFuncProps.value.contentAlign || 'center')
669
+ }, children));
744
670
  }
745
- return state.title;
671
+ return subTitleBox;
746
672
  };
747
- var renderContent = function renderContent() {
748
- if ((0,isFunction_namespaceObject["default"])(state.content)) {
749
- return state.content();
750
- }
751
- return state.content;
673
+ var onHidden = function onHidden() {
674
+ beforeHiddenFn.forEach(function (fn) {
675
+ return fn();
676
+ });
677
+ beforeHiddenFn.length = 0;
678
+ unmountApp();
679
+ container.remove();
752
680
  };
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
764
- }, {
765
- "default": function _default() {
766
- return [state.confirmText];
767
- }
768
- }), state.cancelText && (0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
769
- "onClick": handleCancel
770
- }, {
771
- "default": function _default() {
772
- return [state.cancelText];
773
- }
774
- })]);
681
+ return function () {
682
+ return (0,external_vue_namespaceObject.createVNode)(dialog_namespaceObject["default"], _objectSpread(_objectSpread({
683
+ "class": resolveClassName('info-wrapper'),
684
+ headerAlign: 'center',
685
+ footerAlign: 'center',
686
+ fullscreen: false,
687
+ isLoading: isLoading
688
+ }, modalFuncProps.value), {}, {
689
+ isShow: isShow.value,
690
+ transfer: false,
691
+ quickClose: false,
692
+ onClosed: onClosed,
693
+ onConfirm: onConfirm,
694
+ onHidden: onHidden
695
+ }), getContent);
775
696
  };
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
- });
814
- };
815
- }
816
- }));
817
- ;// CONCATENATED MODULE: ../../packages/info-box/src/info-box.ts
818
- /*
819
- * Tencent is pleased to support the open source community by making
820
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
821
- *
822
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
823
- *
824
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
825
- *
826
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
827
- *
828
- * ---------------------------------------------------
829
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
830
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
831
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
832
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
833
- *
834
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
835
- * the Software.
836
- *
837
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
838
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
839
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
840
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
841
- * IN THE SOFTWARE.
842
- */
843
-
844
-
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
853
- });
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();
697
+ }
698
+ });
699
+ var beforeShow = function beforeShow() {
700
+ if (!app) {
701
+ document.body.append(container);
702
+ app = (0,external_vue_namespaceObject.createApp)(dialog);
703
+ dialogConfirm = app.mount(container);
704
+ }
868
705
  };
869
- // 被调用时默认会弹出,当不需要默认弹出时需要明确传入 isShow: false 作为参数
870
- if (config.isShow !== false) {
871
- show();
706
+ var unmountApp = function unmountApp() {
707
+ var _app;
708
+ (_app = app) === null || _app === void 0 || _app.unmount();
709
+ app = null;
710
+ };
711
+ if (isShow.value) {
712
+ beforeShow();
872
713
  }
873
714
  return {
874
- show: show,
715
+ show: function show() {
716
+ beforeShow();
717
+ isShow.value = true;
718
+ },
875
719
  hide: function hide() {
876
- var _instance3;
877
- (_instance3 = instance) === null || _instance3 === void 0 || _instance3.hide();
720
+ isShow.value = false;
721
+ unmountApp();
878
722
  },
879
723
  update: function update(config) {
880
- var _instance4;
881
- Object.assign(configCache, config);
882
- (_instance4 = instance) === null || _instance4 === void 0 || _instance4.update(configCache);
724
+ var _dialogConfirm;
725
+ beforeShow();
726
+ (_dialogConfirm = dialogConfirm) === null || _dialogConfirm === void 0 || _dialogConfirm.update(config);
883
727
  },
884
728
  destroy: function destroy() {
885
- instance = null;
729
+ container.remove();
730
+ unmountApp();
886
731
  }
887
732
  };
888
733
  };
@@ -1,69 +1,13 @@
1
- .bk-infobox {
2
- font-size: 12px;
1
+ .bk-info-wrapper .bk-modal-wrapper {
2
+ width: 440px;
3
3
  }
4
- .bk-infobox .bk-modal-wrapper {
5
- top: 50%;
6
- left: 50%;
7
- transform: translate(-50%, -50%);
8
- }
9
- .bk-infobox-header {
10
- padding-top: 24px;
11
- }
12
- .bk-infobox-type {
13
- display: flex;
14
- justify-content: center;
15
- align-items: center;
16
- }
17
- .bk-infobox-icon {
18
- width: 42px;
19
- height: 42px;
20
- font-size: 42px;
21
- }
22
- .bk-infobox-icon.success {
23
- color: #2dcb56;
24
- }
25
- .bk-infobox-icon.warning {
26
- color: #ff9c01;
27
- }
28
- .bk-infobox-icon.danger {
29
- color: #ea3636;
30
- }
31
- .bk-infobox-icon.loading {
32
- color: #3a84ff;
33
- }
34
- .bk-infobox-title {
35
- padding-right: 24px;
36
- padding-left: 24px;
37
- margin-top: 24px;
38
- font-size: 20px;
39
- line-height: 32px;
40
- color: #313238;
41
- }
42
- .bk-infobox-content {
43
- padding-right: 24px;
44
- padding-left: 24px;
4
+ .bk-info-wrapper .bk-modal-wrapper .bk-dialog-header .bk-dialog-title {
45
5
  margin-top: 16px;
46
6
  }
47
- .bk-infobox-footer {
48
- display: flex;
49
- padding-right: 24px;
50
- padding-bottom: 24px;
51
- padding-left: 24px;
52
- margin-top: 24px;
53
- align-content: center;
54
- }
55
- .bk-infobox-footer.is-position-right {
56
- justify-content: right;
57
- }
58
- .bk-infobox-footer.is-position-center {
59
- justify-content: center;
60
- }
61
- .bk-infobox-footer.is-position-left {
62
- justify-content: left;
63
- }
64
- .bk-infobox-footer .bk-button {
7
+ .bk-info-wrapper .bk-dialog-footer button {
65
8
  min-width: 88px;
66
9
  }
67
- .bk-infobox-footer .bk-button ~ .bk-button {
68
- margin-left: 8px;
10
+ .bk-info-sub-title {
11
+ text-align: center;
12
+ word-break: break-all;
69
13
  }