bkui-vue 1.0.3-beta.67.dialog.3 → 1.0.3-beta.67.dialog.4
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.
- package/dist/index.cjs.js +27 -27
- package/dist/index.esm.js +419 -418
- package/dist/index.umd.js +15 -15
- package/lib/info-box/index.js +27 -17
- package/lib/info-box/info-box.d.ts +1 -0
- package/lib/modal/index.js +35 -32
- package/package.json +1 -1
package/lib/info-box/index.js
CHANGED
@@ -432,7 +432,7 @@ const shared_namespaceObject = x({ ["withInstall"]: () => __WEBPACK_EXTERNAL_MOD
|
|
432
432
|
;// CONCATENATED MODULE: external "vue"
|
433
433
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
434
434
|
var external_vue_y = x => () => x
|
435
|
-
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, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref });
|
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
436
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
437
437
|
function _typeof(o) {
|
438
438
|
"@babel/helpers - typeof";
|
@@ -589,6 +589,7 @@ var genDefaultState = function genDefaultState() {
|
|
589
589
|
title: undefined,
|
590
590
|
subTitle: undefined,
|
591
591
|
content: undefined,
|
592
|
+
footer: undefined,
|
592
593
|
headerAlign: 'center',
|
593
594
|
contentAlign: 'center',
|
594
595
|
footerAlign: 'center',
|
@@ -597,7 +598,7 @@ var genDefaultState = function genDefaultState() {
|
|
597
598
|
escClose: false,
|
598
599
|
closeIcon: true,
|
599
600
|
confirmText: '确定',
|
600
|
-
theme:
|
601
|
+
theme: undefined,
|
601
602
|
confirmButtonTheme: 'primary',
|
602
603
|
cancelText: '',
|
603
604
|
beforeClose: function beforeClose() {
|
@@ -749,6 +750,29 @@ var genDefaultState = function genDefaultState() {
|
|
749
750
|
}
|
750
751
|
return state.content;
|
751
752
|
};
|
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
|
+
};
|
752
776
|
return (0,external_vue_namespaceObject.createVNode)(modal_namespaceObject["default"], {
|
753
777
|
"class": [resolveClassName('infobox'), state["class"]],
|
754
778
|
"isShow": isShow.value,
|
@@ -779,21 +803,7 @@ var genDefaultState = function genDefaultState() {
|
|
779
803
|
footer: function footer() {
|
780
804
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
781
805
|
"class": _defineProperty(_defineProperty({}, resolveClassName('infobox-footer'), true), "is-position-".concat(state.footerAlign), state.footerAlign)
|
782
|
-
}, [
|
783
|
-
"loading": isLoading.value,
|
784
|
-
"theme": state.confirmButtonTheme,
|
785
|
-
"onClick": handleConfirm
|
786
|
-
}, {
|
787
|
-
"default": function _default() {
|
788
|
-
return [state.confirmText];
|
789
|
-
}
|
790
|
-
}), state.cancelText && (0,external_vue_namespaceObject.createVNode)(button_namespaceObject["default"], {
|
791
|
-
"onClick": handleCancel
|
792
|
-
}, {
|
793
|
-
"default": function _default() {
|
794
|
-
return [state.cancelText];
|
795
|
-
}
|
796
|
-
})]);
|
806
|
+
}, [renderFooter()]);
|
797
807
|
},
|
798
808
|
close: function close() {
|
799
809
|
return (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Error, {
|
@@ -9,6 +9,7 @@ export interface Props {
|
|
9
9
|
title?: string | (() => VNode | string) | VNode;
|
10
10
|
subTitle?: string | (() => VNode) | VNode;
|
11
11
|
content?: string | (() => VNode) | VNode;
|
12
|
+
footer?: string | (() => VNode) | VNode;
|
12
13
|
headerAlign?: 'left' | 'center' | 'right';
|
13
14
|
footerAlign?: 'left' | 'center' | 'right';
|
14
15
|
contentAlign?: 'left' | 'center' | 'right';
|
package/lib/modal/index.js
CHANGED
@@ -87,7 +87,7 @@ function _defineProperty(obj, key, value) {
|
|
87
87
|
;// CONCATENATED MODULE: external "vue"
|
88
88
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
89
89
|
var external_vue_y = x => () => x
|
90
|
-
const external_vue_namespaceObject = external_vue_x({ ["Teleport"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Teleport, ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["useAttrs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.useAttrs, ["useSlots"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.useSlots, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
90
|
+
const external_vue_namespaceObject = external_vue_x({ ["Teleport"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Teleport, ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["useAttrs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.useAttrs, ["useSlots"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.useSlots, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
91
91
|
;// CONCATENATED MODULE: external "../config-provider"
|
92
92
|
var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
93
93
|
var config_provider_y = x => () => x
|
@@ -130,41 +130,38 @@ var useContentResize = function useContentResize(root, resizeTarget, props) {
|
|
130
130
|
resolveClassName = _usePrefix.resolveClassName;
|
131
131
|
var isContentScroll = (0,external_vue_namespaceObject.ref)(false);
|
132
132
|
var contentStyles = (0,external_vue_namespaceObject.ref)({});
|
133
|
-
var
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
}
|
155
|
-
}, 30);
|
156
|
-
observer = new ResizeObserver(function () {
|
157
|
-
calcContentScroll();
|
158
|
-
});
|
159
|
-
observer.observe(resizeTarget.value);
|
160
|
-
calcContentScroll();
|
161
|
-
};
|
133
|
+
var calcContentScroll = (0,throttle_namespaceObject["default"])(function () {
|
134
|
+
var _root$value$querySele = root.value.querySelector(".".concat(resolveClassName('modal-header'))).getBoundingClientRect(),
|
135
|
+
headerHeight = _root$value$querySele.height;
|
136
|
+
var _root$value$querySele2 = root.value.querySelector(".".concat(resolveClassName('modal-content'), " div")).getBoundingClientRect(),
|
137
|
+
contentHeight = _root$value$querySele2.height;
|
138
|
+
var _root$value$querySele3 = root.value.querySelector(".".concat(resolveClassName('modal-footer'))).getBoundingClientRect(),
|
139
|
+
footerHeight = _root$value$querySele3.height;
|
140
|
+
var windowInnerHeight = window.innerHeight;
|
141
|
+
isContentScroll.value = windowInnerHeight < headerHeight + contentHeight + footerHeight + 20;
|
142
|
+
if (isContentScroll.value || props.fullscreen) {
|
143
|
+
contentStyles.value = {
|
144
|
+
height: "".concat(windowInnerHeight - headerHeight - footerHeight, "px"),
|
145
|
+
overflow: 'auto',
|
146
|
+
'scrollbar-gutter': 'stable'
|
147
|
+
};
|
148
|
+
// fullscreen 时默认为 true
|
149
|
+
isContentScroll.value = true;
|
150
|
+
} else {
|
151
|
+
contentStyles.value = {};
|
152
|
+
}
|
153
|
+
}, 30);
|
162
154
|
(0,external_vue_namespaceObject.watch)(function () {
|
163
155
|
return props.isShow;
|
164
156
|
}, function () {
|
157
|
+
var observer;
|
165
158
|
if (props.isShow) {
|
166
|
-
|
167
|
-
|
159
|
+
(0,external_vue_namespaceObject.nextTick)(function () {
|
160
|
+
observer = new ResizeObserver(function () {
|
161
|
+
calcContentScroll();
|
162
|
+
});
|
163
|
+
observer.observe(resizeTarget.value);
|
164
|
+
calcContentScroll();
|
168
165
|
});
|
169
166
|
} else {
|
170
167
|
if (observer) {
|
@@ -175,6 +172,12 @@ var useContentResize = function useContentResize(root, resizeTarget, props) {
|
|
175
172
|
}, {
|
176
173
|
immediate: true
|
177
174
|
});
|
175
|
+
(0,external_vue_namespaceObject.onMounted)(function () {
|
176
|
+
window.addEventListener('resize', calcContentScroll);
|
177
|
+
});
|
178
|
+
(0,external_vue_namespaceObject.onBeforeUnmount)(function () {
|
179
|
+
window.removeEventListener('resize', calcContentScroll);
|
180
|
+
});
|
178
181
|
return {
|
179
182
|
contentStyles: contentStyles,
|
180
183
|
isContentScroll: isContentScroll
|