bkui-vue 1.0.3-beta.68 → 1.0.3-beta.68.dialog.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 (96) hide show
  1. package/dist/index.cjs.js +70 -70
  2. package/dist/index.esm.js +19847 -19003
  3. package/dist/index.umd.js +70 -70
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/components.d.ts +1 -0
  7. package/lib/components.js +1 -0
  8. package/lib/dialog/dialog.css +139 -84
  9. package/lib/dialog/dialog.d.ts +32 -133
  10. package/lib/dialog/dialog.less +9 -76
  11. package/lib/dialog/dialog.variable.css +139 -84
  12. package/lib/dialog/index.d.ts +84 -314
  13. package/lib/dialog/index.js +207 -221
  14. package/lib/dialog/props.d.ts +8 -48
  15. package/lib/info-box/index.d.ts +2 -2
  16. package/lib/info-box/index.js +328 -173
  17. package/lib/info-box/info-box.css +63 -7
  18. package/lib/info-box/info-box.d.ts +18 -16
  19. package/lib/info-box/info-box.less +76 -14
  20. package/lib/info-box/info-box.variable.css +63 -7
  21. package/lib/info-box/render-component.d.ts +4 -0
  22. package/lib/input/index.js +2 -1
  23. package/lib/modal/hooks.d.ts +1 -1
  24. package/lib/modal/index.d.ts +16 -350
  25. package/lib/modal/index.js +218 -703
  26. package/lib/modal/mask.d.ts +6 -0
  27. package/lib/modal/modal.css +135 -32
  28. package/lib/modal/modal.d.ts +6 -134
  29. package/lib/modal/modal.less +88 -29
  30. package/lib/modal/modal.variable.css +135 -32
  31. package/lib/modal/props.mixin.d.ts +2 -53
  32. package/lib/overflow-title/index.js +46 -52
  33. package/lib/pop-confirm/index.js +5 -8
  34. package/lib/scrollbar/index.d.ts +15 -0
  35. package/lib/scrollbar/index.js +18763 -0
  36. package/lib/scrollbar/scrollbar-core/can-use-dom.d.ts +2 -0
  37. package/lib/scrollbar/scrollbar-core/helpers.d.ts +5 -0
  38. package/lib/scrollbar/scrollbar-core/index.d.ts +241 -0
  39. package/lib/scrollbar/scrollbar-core/mouse-wheel.d.ts +5 -0
  40. package/lib/scrollbar/scrollbar-core/scrollbar-width.d.ts +1 -0
  41. package/lib/scrollbar/scrollbar.css +75 -0
  42. package/lib/scrollbar/scrollbar.less +94 -0
  43. package/lib/scrollbar/scrollbar.variable.css +204 -0
  44. package/lib/shared/index.d.ts +0 -1
  45. package/lib/shared/index.js +1 -48
  46. package/lib/sideslider/index.d.ts +31 -222
  47. package/lib/sideslider/index.js +65 -40
  48. package/lib/sideslider/sideslider.css +17 -86
  49. package/lib/sideslider/sideslider.d.ts +14 -105
  50. package/lib/sideslider/sideslider.less +27 -107
  51. package/lib/sideslider/sideslider.variable.css +17 -86
  52. package/lib/slider/index.d.ts +19 -0
  53. package/lib/slider/index.js +45 -5
  54. package/lib/slider/slider.css +14 -0
  55. package/lib/slider/slider.d.ts +9 -0
  56. package/lib/slider/slider.less +15 -0
  57. package/lib/slider/slider.variable.css +14 -0
  58. package/lib/table/components/table-cell.d.ts +3 -2
  59. package/lib/table/components/table-column.d.ts +2 -2
  60. package/lib/table/const.d.ts +1 -1
  61. package/lib/table/index.d.ts +25 -2
  62. package/lib/table/index.js +237 -85
  63. package/lib/table/plugins/head-filter.css +8 -4
  64. package/lib/table/plugins/head-filter.less +6 -3
  65. package/lib/table/plugins/head-filter.variable.css +8 -4
  66. package/lib/table/plugins/use-fixed-column.d.ts +1 -1
  67. package/lib/table/plugins/use-pagination.d.ts +3 -1
  68. package/lib/table/plugins/use-shift-key.d.ts +11 -0
  69. package/lib/table/props.d.ts +11 -3
  70. package/lib/table/table.css +106 -46
  71. package/lib/table/table.d.ts +11 -0
  72. package/lib/table/table.less +43 -58
  73. package/lib/table/table.variable.css +106 -46
  74. package/lib/table/use-attributes.d.ts +2 -1
  75. package/lib/table/use-column.d.ts +6 -6
  76. package/lib/table/use-render.d.ts +1 -1
  77. package/lib/table-column/index.d.ts +6 -6
  78. package/lib/table-column/index.js +6 -2
  79. package/lib/tree/index.d.ts +23 -0
  80. package/lib/tree/index.js +9 -3
  81. package/lib/tree/props.d.ts +8 -0
  82. package/lib/tree/tree.css +76 -2
  83. package/lib/tree/tree.d.ts +11 -0
  84. package/lib/tree/tree.variable.css +76 -2
  85. package/lib/virtual-render/index.d.ts +27 -0
  86. package/lib/virtual-render/index.js +285 -76
  87. package/lib/virtual-render/props.d.ts +16 -0
  88. package/lib/virtual-render/use-fix-top.d.ts +2 -7
  89. package/lib/virtual-render/use-scrollbar.d.ts +24 -0
  90. package/lib/virtual-render/v-virtual-render.d.ts +2 -1
  91. package/lib/virtual-render/virtual-render.css +76 -2
  92. package/lib/virtual-render/virtual-render.d.ts +13 -0
  93. package/lib/virtual-render/virtual-render.less +3 -3
  94. package/lib/virtual-render/virtual-render.variable.css +76 -2
  95. package/package.json +1 -1
  96. package/lib/shared/mask.d.ts +0 -11
@@ -2,9 +2,13 @@ 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";
5
8
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
6
- import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_dialog_497cb4c3__ from "../dialog";
7
- import "../dialog/dialog.less";
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";
8
12
  /******/ var __webpack_modules__ = ({
9
13
 
10
14
  /***/ 7609:
@@ -425,6 +429,10 @@ __webpack_require__.d(__webpack_exports__, {
425
429
  var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
426
430
  var y = x => () => x
427
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 });
428
436
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
429
437
  function _typeof(o) {
430
438
  "@babel/helpers - typeof";
@@ -504,28 +512,38 @@ function _asyncToGenerator(fn) {
504
512
  // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
505
513
  var regenerator = __webpack_require__(2841);
506
514
  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
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 });
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({ });
511
527
  ;// CONCATENATED MODULE: external "../config-provider"
512
528
  var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
513
529
  var config_provider_y = x => () => x
514
530
  const config_provider_namespaceObject = config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
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
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
524
544
 
525
545
 
526
546
 
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; }
529
547
 
530
548
  /*
531
549
  * Tencent is pleased to support the open source community by making
@@ -556,178 +574,315 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
556
574
 
557
575
 
558
576
 
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:
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) {
587
634
  _context.next = 7;
588
635
  break;
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);
643
- }
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;
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('confirm');
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();
663
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;
664
703
  }
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));
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
+ }
716
+ }
717
+ });
718
+ return function () {
719
+ var renderIcon = function renderIcon() {
720
+ if (!state.type) {
721
+ return null;
670
722
  }
671
- return subTitleBox;
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]]);
672
740
  };
673
- var onHidden = function onHidden() {
674
- beforeHiddenFn.forEach(function (fn) {
675
- return fn();
676
- });
677
- beforeHiddenFn.length = 0;
678
- unmountApp();
679
- container.remove();
741
+ var renderTitle = function renderTitle() {
742
+ if ((0,isFunction_namespaceObject["default"])(state.title)) {
743
+ return state.title();
744
+ }
745
+ return state.title;
680
746
  };
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);
747
+ var renderContent = function renderContent() {
748
+ if ((0,isFunction_namespaceObject["default"])(state.content)) {
749
+ return state.content();
750
+ }
751
+ return state.content;
696
752
  };
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
- }
705
- };
706
- var unmountApp = function unmountApp() {
707
- var _app;
708
- (_app = app) === null || _app === void 0 || _app.unmount();
709
- app = null;
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
+ })]);
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
+ });
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();
710
868
  };
711
- if (isShow.value) {
712
- beforeShow();
869
+ // 被调用时默认会弹出,当不需要默认弹出时需要明确传入 isShow: false 作为参数
870
+ if (config.isShow !== false) {
871
+ show();
713
872
  }
714
873
  return {
715
- show: function show() {
716
- beforeShow();
717
- isShow.value = true;
718
- },
874
+ show: show,
719
875
  hide: function hide() {
720
- isShow.value = false;
721
- unmountApp();
876
+ var _instance3;
877
+ (_instance3 = instance) === null || _instance3 === void 0 || _instance3.hide();
722
878
  },
723
879
  update: function update(config) {
724
- var _dialogConfirm;
725
- beforeShow();
726
- (_dialogConfirm = dialogConfirm) === null || _dialogConfirm === void 0 || _dialogConfirm.update(config);
880
+ var _instance4;
881
+ Object.assign(configCache, config);
882
+ (_instance4 = instance) === null || _instance4 === void 0 || _instance4.update(configCache);
727
883
  },
728
884
  destroy: function destroy() {
729
- container.remove();
730
- unmountApp();
885
+ instance = null;
731
886
  }
732
887
  };
733
888
  };
@@ -1,13 +1,69 @@
1
- .bk-info-wrapper .bk-modal-wrapper {
2
- width: 440px;
1
+ .bk-infobox {
2
+ font-size: 12px;
3
3
  }
4
- .bk-info-wrapper .bk-modal-wrapper .bk-dialog-header .bk-dialog-title {
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;
5
45
  margin-top: 16px;
6
46
  }
7
- .bk-info-wrapper .bk-dialog-footer button {
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 {
8
65
  min-width: 88px;
9
66
  }
10
- .bk-info-sub-title {
11
- text-align: center;
12
- word-break: break-all;
67
+ .bk-infobox-footer .bk-button ~ .bk-button {
68
+ margin-left: 8px;
13
69
  }