bkui-vue 0.0.3-beta.5 → 1.0.0
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 +36 -36
- package/dist/index.esm.js +9724 -9973
- package/dist/index.umd.js +36 -36
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/index.js +16 -15
- package/lib/alert/index.js +25 -24
- package/lib/animate-number/index.js +7 -7
- package/lib/backtop/index.js +23 -22
- package/lib/badge/index.js +22 -21
- package/lib/breadcrumb/index.js +31 -30
- package/lib/button/index.js +42 -34
- package/lib/card/index.js +44 -37
- package/lib/cascader/index.js +105 -86
- package/lib/checkbox/index.js +39 -38
- package/lib/code-diff/code-diff.css +0 -1
- package/lib/code-diff/code-diff.d.ts +1 -0
- package/lib/code-diff/code-diff.less +1 -1
- package/lib/code-diff/code-diff.variable.css +0 -1
- package/lib/code-diff/index.js +152 -15
- package/lib/collapse/index.js +46 -45
- package/lib/collapse-transition/index.js +10 -10
- package/lib/color-picker/index.js +51 -50
- package/lib/components.js +63 -504
- package/lib/config-provider/index.js +30 -26
- package/lib/config-provider/use-global-config.d.ts +2 -2
- package/lib/container/index.js +28 -27
- package/lib/date-picker/index.js +72 -66
- package/lib/dialog/dialog.css +61 -35
- package/lib/dialog/dialog.d.ts +20 -11
- package/lib/dialog/dialog.less +2 -2
- package/lib/dialog/dialog.variable.css +61 -35
- package/lib/dialog/index.d.ts +38 -22
- package/lib/dialog/index.js +68 -54
- package/lib/dialog/props.d.ts +8 -4
- package/lib/directives/index.js +24 -24
- package/lib/dist.index.js +5 -61
- package/lib/divider/index.js +16 -15
- package/lib/dropdown/index.js +39 -32
- package/lib/exception/index.js +20 -19
- package/lib/fixed-navbar/index.js +16 -15
- package/lib/form/index.js +60 -59
- package/lib/hooks.js +8 -48
- package/lib/icon/angle-double-down-line.js +2 -2
- package/lib/icon/angle-double-left-line.js +2 -2
- package/lib/icon/angle-double-left.js +2 -2
- package/lib/icon/angle-double-right-line.js +2 -2
- package/lib/icon/angle-double-right.js +2 -2
- package/lib/icon/angle-double-up-line.js +2 -2
- package/lib/icon/angle-down-fill.js +2 -2
- package/lib/icon/angle-down-line.js +2 -2
- package/lib/icon/angle-down.js +2 -2
- package/lib/icon/angle-left.js +2 -2
- package/lib/icon/angle-right.js +2 -2
- package/lib/icon/angle-up-fill.js +2 -2
- package/lib/icon/angle-up.js +2 -2
- package/lib/icon/archive-fill.js +2 -2
- package/lib/icon/arrows-left.js +2 -2
- package/lib/icon/arrows-right.js +2 -2
- package/lib/icon/assistant.js +2 -2
- package/lib/icon/audio-fill.js +2 -2
- package/lib/icon/bk.js +2 -2
- package/lib/icon/circle.js +2 -2
- package/lib/icon/close-line.js +2 -2
- package/lib/icon/close.js +2 -2
- package/lib/icon/code.js +2 -2
- package/lib/icon/cog-shape.js +2 -2
- package/lib/icon/collapse-left.js +2 -2
- package/lib/icon/copy-shape.js +2 -2
- package/lib/icon/copy.js +2 -2
- package/lib/icon/data-shape.js +2 -2
- package/lib/icon/del.js +2 -2
- package/lib/icon/doc-fill.js +2 -2
- package/lib/icon/done.js +2 -2
- package/lib/icon/down-shape.js +2 -2
- package/lib/icon/down-small.js +2 -2
- package/lib/icon/edit-line.js +2 -2
- package/lib/icon/ellipsis.js +2 -2
- package/lib/icon/enlarge-line.js +2 -2
- package/lib/icon/error.js +2 -2
- package/lib/icon/excel-fill.js +2 -2
- package/lib/icon/exclamation-circle-shape.js +2 -2
- package/lib/icon/eye.js +2 -2
- package/lib/icon/filliscreen-line.js +2 -2
- package/lib/icon/fix-line.js +2 -2
- package/lib/icon/fix-shape.js +2 -2
- package/lib/icon/folder-open.js +2 -2
- package/lib/icon/folder-shape-open.js +2 -2
- package/lib/icon/folder-shape.js +2 -2
- package/lib/icon/folder.js +2 -2
- package/lib/icon/funnel.js +2 -2
- package/lib/icon/grag-fill.js +2 -2
- package/lib/icon/help-document-fill.js +2 -2
- package/lib/icon/help-fill.js +2 -2
- package/lib/icon/help.js +2 -2
- package/lib/icon/image-fill.js +15 -15
- package/lib/icon/img-error.js +15 -15
- package/lib/icon/img-placehoulder.js +15 -15
- package/lib/icon/index.js +386 -386
- package/lib/icon/info-line.js +15 -15
- package/lib/icon/info.js +15 -15
- package/lib/icon/left-shape.js +15 -15
- package/lib/icon/left-turn-line.js +15 -15
- package/lib/icon/loading.js +15 -15
- package/lib/icon/narrow-line.js +15 -15
- package/lib/icon/original.js +15 -15
- package/lib/icon/pdf-fill.js +15 -15
- package/lib/icon/play-shape.js +15 -15
- package/lib/icon/plus.js +15 -15
- package/lib/icon/ppt-fill.js +15 -15
- package/lib/icon/qq.js +15 -15
- package/lib/icon/right-shape.js +15 -15
- package/lib/icon/right-turn-line.js +15 -15
- package/lib/icon/search.js +15 -15
- package/lib/icon/share.js +15 -15
- package/lib/icon/spinner.js +15 -15
- package/lib/icon/success.js +15 -15
- package/lib/icon/switcher-loading.js +15 -15
- package/lib/icon/text-file.js +15 -15
- package/lib/icon/text-fill.js +15 -15
- package/lib/icon/transfer.js +15 -15
- package/lib/icon/tree-application-shape.js +15 -15
- package/lib/icon/unfull-screen.js +15 -15
- package/lib/icon/unvisible.js +15 -15
- package/lib/icon/up-shape.js +15 -15
- package/lib/icon/upload.js +15 -15
- package/lib/icon/video-fill.js +15 -15
- package/lib/icon/warn.js +15 -15
- package/lib/icon/weixin-pro.js +15 -15
- package/lib/icon/weixin.js +15 -15
- package/lib/image/index.js +43 -43
- package/lib/index.js +8 -72
- package/lib/info-box/index.d.ts +1 -0
- package/lib/info-box/index.js +177 -17384
- package/lib/info-box/info-box.css +10 -10
- package/lib/info-box/info-box.d.ts +4 -3
- package/lib/info-box/info-box.less +37 -34
- package/lib/info-box/info-box.variable.css +10 -10
- package/lib/input/index.js +62 -61
- package/lib/link/index.js +16 -15
- package/lib/loading/index.js +28 -27
- package/lib/locale/index.js +2 -2
- package/lib/menu/index.js +24 -23
- package/lib/message/index.js +41 -40
- package/lib/modal/index.d.ts +108 -65
- package/lib/modal/index.js +193 -135
- package/lib/modal/modal.css +36 -10
- package/lib/modal/modal.d.ts +40 -22
- package/lib/modal/modal.less +34 -0
- package/lib/modal/modal.variable.css +36 -10
- package/lib/modal/props.mixin.d.ts +8 -4
- package/lib/navigation/index.js +17 -16
- package/lib/notify/index.js +34 -33
- package/lib/overflow-title/index.js +31 -24
- package/lib/pagination/index.js +68 -54
- package/lib/plugin-popover/index.js +55 -55
- package/lib/plugins/index.js +2 -2
- package/lib/pop-confirm/index.js +43 -30
- package/lib/popover/index.js +59 -58
- package/lib/popover2/index.js +5 -5
- package/lib/preset.d.ts +2 -281
- package/lib/preset.js +16 -58
- package/lib/process/index.js +28 -28
- package/lib/progress/index.js +29 -28
- package/lib/radio/index.js +41 -40
- package/lib/rate/index.js +25 -24
- package/lib/resize-layout/index.d.ts +3 -3
- package/lib/resize-layout/index.js +28 -27
- package/lib/resize-layout/resize-layout.d.ts +1 -1
- package/lib/search-select/index.js +71 -53
- package/lib/select/index.js +172 -134
- package/lib/shared/index.d.ts +1 -2
- package/lib/shared/index.js +638 -1285
- package/lib/shared/mask.d.ts +11 -0
- package/lib/sideslider/index.d.ts +38 -22
- package/lib/sideslider/index.js +23 -17
- package/lib/sideslider/sideslider.css +12 -11
- package/lib/sideslider/sideslider.d.ts +20 -11
- package/lib/sideslider/sideslider.less +79 -77
- package/lib/sideslider/sideslider.variable.css +12 -11
- package/lib/slider/index.js +37 -24
- package/lib/steps/index.js +31 -30
- package/lib/swiper/index.js +17 -16
- package/lib/switcher/index.js +32 -31
- package/lib/tab/index.js +55 -54
- package/lib/table/components/table-column.d.ts +1 -0
- package/lib/table/index.d.ts +1 -0
- package/lib/table/index.js +200 -147
- package/lib/table/props.d.ts +1 -0
- package/lib/table/use-column.d.ts +3 -0
- package/lib/table-column/index.d.ts +3 -0
- package/lib/table-column/index.js +43 -43
- package/lib/tag/index.js +22 -21
- package/lib/tag-input/index.js +81 -67
- package/lib/time-picker/index.js +10 -9
- package/lib/timeline/index.js +14 -14
- package/lib/transfer/index.js +52 -38
- package/lib/tree/index.js +93 -74
- package/lib/upload/index.js +64 -50
- package/lib/virtual-render/index.js +36 -35
- package/package.json +8 -4
- package/lib/shared/mask-manager.d.ts +0 -89
- package/lib/shared/pop-manager.d.ts +0 -41
package/lib/modal/index.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
import
|
1
|
+
import "./modal.less";
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
|
2
3
|
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
3
|
-
import * as
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
|
4
5
|
import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
5
6
|
/******/ // The require scope
|
6
7
|
/******/ var __webpack_require__ = {};
|
@@ -28,15 +29,15 @@ var __webpack_exports__ = {};
|
|
28
29
|
|
29
30
|
// EXPORTS
|
30
31
|
__webpack_require__.d(__webpack_exports__, {
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
BkModal: () => (/* binding */ BkModal),
|
33
|
+
"default": () => (/* binding */ src),
|
34
|
+
propsMixin: () => (/* reexport */ propsMixin)
|
34
35
|
});
|
35
36
|
|
36
37
|
;// CONCATENATED MODULE: external "../shared"
|
37
38
|
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
38
39
|
var y = x => () => x
|
39
|
-
const
|
40
|
+
const shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.bkZIndexManager, ["dialogTypeUnion"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.dialogTypeUnion, ["isElement"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.isElement, ["mask"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.mask, ["renderDirectiveType"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.renderDirectiveType, ["withInstallProps"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstallProps });
|
40
41
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
41
42
|
function _typeof(obj) {
|
42
43
|
"@babel/helpers - typeof";
|
@@ -85,11 +86,11 @@ function _defineProperty(obj, key, value) {
|
|
85
86
|
;// CONCATENATED MODULE: external "vue"
|
86
87
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
87
88
|
var external_vue_y = x => () => x
|
88
|
-
const external_vue_namespaceObject = external_vue_x({ ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent });
|
89
|
+
const external_vue_namespaceObject = external_vue_x({ ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
|
89
90
|
;// CONCATENATED MODULE: external "../config-provider"
|
90
|
-
var
|
91
|
-
var
|
92
|
-
const
|
91
|
+
var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
92
|
+
var config_provider_y = x => () => x
|
93
|
+
const config_provider_namespaceObject = config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
|
93
94
|
;// CONCATENATED MODULE: external "vue-types"
|
94
95
|
var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
95
96
|
var external_vue_types_y = x => () => x
|
@@ -131,51 +132,53 @@ var ModalSizeEnum;
|
|
131
132
|
})(ModalSizeEnum || (ModalSizeEnum = {}));
|
132
133
|
var propsMixin = {
|
133
134
|
// 是否显示弹框
|
134
|
-
isShow:
|
135
|
-
width:
|
136
|
-
height:
|
135
|
+
isShow: shared_namespaceObject.PropTypes.bool.def(false),
|
136
|
+
width: shared_namespaceObject.PropTypes.oneOfType([String, Number]).def('50%'),
|
137
|
+
height: shared_namespaceObject.PropTypes.oneOfType([String, Number]).def('50%'),
|
137
138
|
// 配置自定义样式类名
|
138
|
-
extCls:
|
139
|
+
extCls: shared_namespaceObject.PropTypes.string || shared_namespaceObject.PropTypes.array,
|
139
140
|
// 弹框出现时,是否允许页面滚动
|
140
|
-
scrollable:
|
141
|
+
scrollable: shared_namespaceObject.PropTypes.bool.def(true),
|
141
142
|
// 是否允许出现遮罩
|
142
|
-
showMask:
|
143
|
+
showMask: shared_namespaceObject.PropTypes.bool.def(true),
|
143
144
|
// 是否显示右上角的关闭 icon
|
144
|
-
closeIcon:
|
145
|
+
closeIcon: shared_namespaceObject.PropTypes.bool.def(true),
|
145
146
|
// 是否允许 esc 按键关闭弹框
|
146
|
-
escClose:
|
147
|
+
escClose: shared_namespaceObject.PropTypes.bool.def(true),
|
147
148
|
// 是否全屏
|
148
|
-
fullscreen:
|
149
|
+
fullscreen: shared_namespaceObject.PropTypes.bool.def(false),
|
149
150
|
// 弹框尺寸
|
150
151
|
size: (0,external_vue_types_namespaceObject.toType)('size', {}),
|
151
152
|
// 是否可拖拽
|
152
|
-
draggable:
|
153
|
+
draggable: shared_namespaceObject.PropTypes.bool.def(true),
|
153
154
|
// 是否允许点击遮罩关闭弹窗
|
154
|
-
quickClose:
|
155
|
+
quickClose: shared_namespaceObject.PropTypes.bool.def(true),
|
155
156
|
// 是否显示在body内(即与id#app同级
|
156
|
-
transfer:
|
157
|
+
transfer: shared_namespaceObject.PropTypes.oneOfType([Boolean, String, HTMLElement]).def(false),
|
157
158
|
// 弹出层z-index,实际显示的值会自动+1。为了抱证在遮罩上正常显示
|
158
|
-
zIndex:
|
159
|
+
zIndex: shared_namespaceObject.PropTypes.oneOfType([String, Number]),
|
159
160
|
// 内容区最大高度
|
160
|
-
maxHeight:
|
161
|
+
maxHeight: shared_namespaceObject.PropTypes.string,
|
161
162
|
// 弹出方向
|
162
|
-
direction:
|
163
|
+
direction: shared_namespaceObject.PropTypes.string,
|
163
164
|
// title
|
164
|
-
title:
|
165
|
+
title: shared_namespaceObject.PropTypes.string.def(''),
|
165
166
|
// 动画类型
|
166
|
-
animateType:
|
167
|
+
animateType: shared_namespaceObject.PropTypes.string.def('slide'),
|
167
168
|
// 弹框的渲染方式
|
168
|
-
renderDirective: (0,
|
169
|
+
renderDirective: (0,shared_namespaceObject.renderDirectiveType)(),
|
169
170
|
// 关闭前回调
|
170
|
-
beforeClose:
|
171
|
+
beforeClose: shared_namespaceObject.PropTypes.custom(function () {
|
171
172
|
return true;
|
172
173
|
}),
|
173
174
|
// 对话框类型
|
174
|
-
dialogType: (0,
|
175
|
+
dialogType: (0,shared_namespaceObject.dialogTypeUnion)(),
|
175
176
|
// 是否允许多个弹框同时存在
|
176
|
-
multiInstance:
|
177
|
+
multiInstance: shared_namespaceObject.PropTypes.bool.def(true),
|
177
178
|
// info-box
|
178
|
-
infoType:
|
179
|
+
infoType: shared_namespaceObject.PropTypes.theme(),
|
180
|
+
left: shared_namespaceObject.PropTypes.string,
|
181
|
+
top: shared_namespaceObject.PropTypes.string
|
179
182
|
};
|
180
183
|
;// CONCATENATED MODULE: ../../packages/modal/src/modal.tsx
|
181
184
|
|
@@ -215,106 +218,148 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
215
218
|
name: 'Modal',
|
216
219
|
props: _objectSpread({}, propsMixin),
|
217
220
|
emits: ['quick-close', 'quickClose', 'hidden', 'shown', 'close'],
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
height: this.dialogHeight,
|
221
|
+
setup: function setup(props, ctx) {
|
222
|
+
var visible = (0,external_vue_namespaceObject.ref)(false);
|
223
|
+
var zIndex = (0,external_vue_namespaceObject.ref)(props.zIndex);
|
224
|
+
var refRoot = (0,external_vue_namespaceObject.ref)();
|
225
|
+
var refMask = (0,external_vue_namespaceObject.ref)();
|
226
|
+
var backgroundColor = (0,external_vue_namespaceObject.ref)('rgba(0,0,0,0.6)');
|
227
|
+
var closeTimer;
|
228
|
+
var dialogWidth = (0,external_vue_namespaceObject.computed)(function () {
|
229
|
+
return /^\d+\.?\d*$/.test("".concat(props.width)) ? "".concat(props.width, "px") : props.width;
|
230
|
+
});
|
231
|
+
var dialogHeight = (0,external_vue_namespaceObject.computed)(function () {
|
232
|
+
return /^\d+\.?\d*$/.test("".concat(props.height)) ? "".concat(props.height, "px") : props.height;
|
233
|
+
});
|
234
|
+
var compStyle = (0,external_vue_namespaceObject.computed)(function () {
|
235
|
+
return _defineProperty({
|
236
|
+
width: dialogWidth.value,
|
237
|
+
height: dialogHeight.value,
|
236
238
|
minHeigth: "".concat(200, "px"),
|
237
|
-
display:
|
238
|
-
zIndex:
|
239
|
-
|
240
|
-
|
241
|
-
|
239
|
+
display: visible.value ? 'inherit' : 'none',
|
240
|
+
zIndex: zIndex.value || 'inherit',
|
241
|
+
left: props.left,
|
242
|
+
top: props.top
|
243
|
+
}, props.direction, 0);
|
244
|
+
});
|
245
|
+
var enableTeleport = (0,external_vue_namespaceObject.ref)(!!props.transfer);
|
246
|
+
var teleportTo = (0,external_vue_namespaceObject.ref)('body');
|
247
|
+
var resolveTransfer = function resolveTransfer() {
|
248
|
+
if (props.transfer) {
|
249
|
+
if (typeof props.transfer === 'boolean') {
|
250
|
+
teleportTo.value = 'body';
|
251
|
+
return;
|
252
|
+
}
|
253
|
+
teleportTo.value = props.transfer;
|
254
|
+
}
|
255
|
+
};
|
256
|
+
resolveTransfer();
|
257
|
+
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
258
|
+
resolveClassName = _usePrefix.resolveClassName;
|
259
|
+
var resolveClosetModal = function resolveClosetModal() {
|
260
|
+
var _refRoot$value;
|
261
|
+
if (enableTeleport.value) {
|
262
|
+
if (typeof teleportTo.value === 'string') {
|
263
|
+
var target = document.querySelector(teleportTo.value);
|
264
|
+
target === null || target === void 0 ? void 0 : target.appendChild(refRoot.value);
|
265
|
+
return;
|
266
|
+
}
|
267
|
+
if ((0,shared_namespaceObject.isElement)(teleportTo.value)) {
|
268
|
+
teleportTo.value.appendChild(refRoot.value);
|
269
|
+
return;
|
270
|
+
}
|
271
|
+
}
|
272
|
+
var className = ".".concat(resolveClassName('modal-ctx'));
|
273
|
+
var parentNode = (_refRoot$value = refRoot.value) === null || _refRoot$value === void 0 || (_refRoot$value = _refRoot$value.parentElement) === null || _refRoot$value === void 0 ? void 0 : _refRoot$value.closest(className);
|
274
|
+
if (parentNode) {
|
275
|
+
enableTeleport.value = true;
|
276
|
+
teleportTo.value = 'body';
|
277
|
+
var _target = document.querySelector(teleportTo.value);
|
278
|
+
_target === null || _target === void 0 ? void 0 : _target.appendChild(refRoot.value);
|
279
|
+
}
|
280
|
+
};
|
281
|
+
var fullscreenStyle = (0,external_vue_namespaceObject.computed)(function () {
|
242
282
|
return {
|
243
283
|
width: "".concat(100, "%"),
|
244
284
|
height: "".concat(100, "%")
|
245
285
|
};
|
246
|
-
}
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
_this.$emit('hidden'); // 为false直接触发hidden事件,在上层有200ms的延时
|
261
|
-
_this.visible = val;
|
262
|
-
}, 250);
|
286
|
+
});
|
287
|
+
var closeModal = function closeModal() {
|
288
|
+
shared_namespaceObject.mask.hideMask({
|
289
|
+
el: refRoot.value,
|
290
|
+
mask: refMask.value,
|
291
|
+
showMask: props.showMask,
|
292
|
+
backgroundColor: backgroundColor.value
|
293
|
+
});
|
294
|
+
closeTimer = setTimeout(function () {
|
295
|
+
// 直接设为false会失去离开的动画效果,这里延迟设置
|
296
|
+
ctx.emit('hidden'); // 为false直接触发hidden事件,在上层有200ms的延时
|
297
|
+
if (enableTeleport.value) {
|
298
|
+
var _refRoot$value2;
|
299
|
+
(_refRoot$value2 = refRoot.value) === null || _refRoot$value2 === void 0 ? void 0 : _refRoot$value2.remove();
|
263
300
|
}
|
264
|
-
},
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
var hideMaskStyle = {
|
275
|
-
'background-color': 'rgba(0,0,0,0)'
|
276
|
-
};
|
277
|
-
var appendStyle = _this2.showMask ? {} : hideMaskStyle;
|
278
|
-
_this2.bkPopIndexManager.show(_this2.$el, _this2.showMask, appendStyle, !!_this2.transfer, _this2.zIndex, function (_e) {
|
279
|
-
_this2.handleClickOutSide();
|
280
|
-
});
|
281
|
-
_this2.$emit('shown');
|
282
|
-
});
|
283
|
-
} else {
|
284
|
-
var _this$bkPopIndexManag, _this$bkPopIndexManag2, _this$bkPopIndexManag3;
|
285
|
-
(_this$bkPopIndexManag = this.bkPopIndexManager) === null || _this$bkPopIndexManag === void 0 ? void 0 : _this$bkPopIndexManag.removeLastEvent();
|
286
|
-
(_this$bkPopIndexManag2 = this.bkPopIndexManager) === null || _this$bkPopIndexManag2 === void 0 ? void 0 : _this$bkPopIndexManag2.hide(this.$el, !!this.transfer);
|
287
|
-
(_this$bkPopIndexManag3 = this.bkPopIndexManager) === null || _this$bkPopIndexManag3 === void 0 ? void 0 : _this$bkPopIndexManag3.destroy();
|
301
|
+
}, 250);
|
302
|
+
};
|
303
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
304
|
+
return props.isShow;
|
305
|
+
}, function (val) {
|
306
|
+
if (val) {
|
307
|
+
closeTimer && clearTimeout(closeTimer);
|
308
|
+
closeTimer = null;
|
309
|
+
if (!props.zIndex) {
|
310
|
+
zIndex.value = shared_namespaceObject.bkZIndexManager.getModalNextIndex();
|
288
311
|
}
|
289
|
-
|
312
|
+
visible.value = true;
|
313
|
+
(0,external_vue_namespaceObject.nextTick)(function () {
|
314
|
+
ctx.emit('shown');
|
315
|
+
resolveClosetModal();
|
316
|
+
shared_namespaceObject.mask.showMask({
|
317
|
+
el: refRoot.value,
|
318
|
+
mask: refMask.value,
|
319
|
+
showMask: props.showMask,
|
320
|
+
backgroundColor: backgroundColor.value
|
321
|
+
});
|
322
|
+
});
|
323
|
+
return;
|
324
|
+
}
|
325
|
+
visible.value = false;
|
326
|
+
closeModal();
|
327
|
+
}, {
|
290
328
|
immediate: true
|
291
|
-
}
|
292
|
-
},
|
293
|
-
mounted: function mounted() {
|
294
|
-
var _this$$el;
|
295
|
-
var popConfig = _objectSpread(_objectSpread({}, this.$props), {
|
296
|
-
transfer: this.transfer === 'parent' ? (_this$$el = this.$el) === null || _this$$el === void 0 ? void 0 : _this$$el.parentElement : this.transfer
|
297
329
|
});
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
}
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
330
|
+
var handleBeforeClose = function handleBeforeClose(callbackFn) {
|
331
|
+
if (typeof props.beforeClose === 'function') {
|
332
|
+
if (props.beforeClose() !== true) {
|
333
|
+
return;
|
334
|
+
}
|
335
|
+
}
|
336
|
+
callbackFn === null || callbackFn === void 0 ? void 0 : callbackFn();
|
337
|
+
};
|
338
|
+
var handleClickOutSide = function handleClickOutSide(e) {
|
339
|
+
e.stopImmediatePropagation();
|
340
|
+
e.stopPropagation();
|
341
|
+
e.preventDefault();
|
342
|
+
if (props.quickClose) {
|
343
|
+
handleBeforeClose(function () {
|
344
|
+
ctx.emit('close');
|
345
|
+
ctx.emit('quick-close');
|
346
|
+
ctx.emit('quickClose');
|
347
|
+
});
|
313
348
|
}
|
314
|
-
}
|
349
|
+
};
|
350
|
+
return {
|
351
|
+
visible: visible,
|
352
|
+
compStyle: compStyle,
|
353
|
+
fullscreenStyle: fullscreenStyle,
|
354
|
+
handleClickOutSide: handleClickOutSide,
|
355
|
+
refRoot: refRoot,
|
356
|
+
refMask: refMask,
|
357
|
+
showMask: props.showMask
|
358
|
+
};
|
315
359
|
},
|
316
360
|
render: function render() {
|
317
|
-
var _this
|
361
|
+
var _this$extCls,
|
362
|
+
_this$$slots$header,
|
318
363
|
_this$$slots$header2,
|
319
364
|
_this$$slots,
|
320
365
|
_this$$slots$default,
|
@@ -326,34 +371,47 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
326
371
|
_this$$slots$close,
|
327
372
|
_this$$slots$close2,
|
328
373
|
_this$$slots4,
|
329
|
-
|
330
|
-
var
|
331
|
-
resolveClassName =
|
374
|
+
_this = this;
|
375
|
+
var _usePrefix2 = (0,config_provider_namespaceObject.usePrefix)(),
|
376
|
+
resolveClassName = _usePrefix2.resolveClassName;
|
332
377
|
var maxHeight = this.maxHeight ? {
|
333
378
|
maxHeight: this.maxHeight
|
334
379
|
} : {};
|
335
380
|
var bodyClass = "".concat(resolveClassName('modal-body'), " ").concat(this.animateType === 'slide' ? this.direction : '');
|
336
381
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
337
|
-
"
|
382
|
+
"ref": "refRoot",
|
383
|
+
"class": [resolveClassName('modal-ctx'), this.visible ? '--show' : '--hide'],
|
384
|
+
"style": {
|
385
|
+
zIndex: this.compStyle.zIndex
|
386
|
+
}
|
387
|
+
}, [this.showMask ? (0,external_vue_namespaceObject.createVNode)("div", {
|
388
|
+
"ref": "refMask",
|
389
|
+
"class": [resolveClassName('modal-ctx-mask'), this.visible ? '--show' : '--hide'],
|
390
|
+
"onClick": this.handleClickOutSide,
|
391
|
+
"style": {
|
392
|
+
zIndex: this.compStyle.zIndex
|
393
|
+
}
|
394
|
+
}, null) : '', (0,external_vue_namespaceObject.createVNode)("div", {
|
395
|
+
"class": [resolveClassName('modal-wrapper'), (_this$extCls = this.extCls) !== null && _this$extCls !== void 0 ? _this$extCls : '', this.size, this.fullscreen ? 'fullscreen' : ''],
|
338
396
|
"style": [this.compStyle, this.fullscreen ? this.fullscreenStyle : '']
|
339
397
|
}, [(0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Transition, {
|
340
398
|
"name": this.animateType
|
341
399
|
}, {
|
342
400
|
"default": function _default() {
|
343
|
-
return [
|
401
|
+
return [_this.visible ? (0,external_vue_namespaceObject.createVNode)("div", {
|
344
402
|
"class": bodyClass
|
345
403
|
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
346
404
|
"class": resolveClassName('modal-header')
|
347
|
-
}, [(_this$$slots$header = (_this$$slots$header2 = (_this$$slots =
|
405
|
+
}, [(_this$$slots$header = (_this$$slots$header2 = (_this$$slots = _this.$slots).header) === null || _this$$slots$header2 === void 0 ? void 0 : _this$$slots$header2.call(_this$$slots)) !== null && _this$$slots$header !== void 0 ? _this$$slots$header : '']), (0,external_vue_namespaceObject.createVNode)("div", {
|
348
406
|
"class": resolveClassName('modal-content'),
|
349
|
-
"style": [
|
350
|
-
}, [(_this$$slots$default = (_this$$slots$default2 = (_this$$slots2 =
|
407
|
+
"style": [_this.dialogType === 'show' ? 'padding-bottom: 20px' : '', _objectSpread({}, maxHeight)]
|
408
|
+
}, [(_this$$slots$default = (_this$$slots$default2 = (_this$$slots2 = _this.$slots)["default"]) === null || _this$$slots$default2 === void 0 ? void 0 : _this$$slots$default2.call(_this$$slots2)) !== null && _this$$slots$default !== void 0 ? _this$$slots$default : '']), _this.dialogType === 'show' ? '' : (0,external_vue_namespaceObject.createVNode)("div", {
|
351
409
|
"class": resolveClassName('modal-footer')
|
352
|
-
}, [(_this$$slots$footer = (_this$$slots$footer2 = (_this$$slots3 =
|
410
|
+
}, [(_this$$slots$footer = (_this$$slots$footer2 = (_this$$slots3 = _this.$slots).footer) === null || _this$$slots$footer2 === void 0 ? void 0 : _this$$slots$footer2.call(_this$$slots3)) !== null && _this$$slots$footer !== void 0 ? _this$$slots$footer : '']), _this.closeIcon && (0,external_vue_namespaceObject.createVNode)("div", {
|
353
411
|
"class": resolveClassName('modal-close')
|
354
|
-
}, [(_this$$slots$close = (_this$$slots$close2 = (_this$$slots4 =
|
412
|
+
}, [(_this$$slots$close = (_this$$slots$close2 = (_this$$slots4 = _this.$slots).close) === null || _this$$slots$close2 === void 0 ? void 0 : _this$$slots$close2.call(_this$$slots4)) !== null && _this$$slots$close !== void 0 ? _this$$slots$close : ''])]) : ''];
|
355
413
|
}
|
356
|
-
})]);
|
414
|
+
})])]);
|
357
415
|
}
|
358
416
|
}));
|
359
417
|
;// CONCATENATED MODULE: ../../packages/modal/src/index.ts
|
@@ -385,12 +443,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
385
443
|
|
386
444
|
|
387
445
|
|
388
|
-
var BkModal = (0,
|
446
|
+
var BkModal = (0,shared_namespaceObject.withInstallProps)(modal, {
|
389
447
|
propsMixin: propsMixin
|
390
448
|
}, true);
|
391
449
|
/* harmony default export */ const src = (BkModal);
|
392
450
|
|
393
|
-
var __webpack_exports__BkModal = __webpack_exports__
|
394
|
-
var __webpack_exports__default = __webpack_exports__
|
395
|
-
var __webpack_exports__propsMixin = __webpack_exports__.
|
451
|
+
var __webpack_exports__BkModal = __webpack_exports__.BkModal;
|
452
|
+
var __webpack_exports__default = __webpack_exports__["default"];
|
453
|
+
var __webpack_exports__propsMixin = __webpack_exports__.propsMixin;
|
396
454
|
export { __webpack_exports__BkModal as BkModal, __webpack_exports__default as default, __webpack_exports__propsMixin as propsMixin };
|
package/lib/modal/modal.css
CHANGED
@@ -1,42 +1,67 @@
|
|
1
|
-
.bk-modal-
|
1
|
+
.bk-modal-ctx.bk-info-wrapper .bk-modal-wrapper {
|
2
2
|
width: 440px;
|
3
3
|
}
|
4
|
-
.bk-modal-
|
4
|
+
.bk-modal-ctx.bk-info-wrapper .bk-modal-wrapper.normal {
|
5
5
|
width: 440px;
|
6
6
|
}
|
7
|
-
.bk-modal-
|
7
|
+
.bk-modal-ctx.bk-info-wrapper .bk-modal-wrapper.small {
|
8
8
|
width: 400px;
|
9
9
|
}
|
10
|
-
.bk-modal-
|
10
|
+
.bk-modal-ctx.bk-info-wrapper .bk-modal-wrapper .bk-modal-body {
|
11
11
|
border-radius: 2px;
|
12
12
|
}
|
13
|
-
.bk-modal-
|
13
|
+
.bk-modal-ctx.bk-info-wrapper .bk-modal-wrapper .bk-dialog-header {
|
14
14
|
padding: 24px 24px 0;
|
15
15
|
}
|
16
|
-
.bk-modal-
|
16
|
+
.bk-modal-ctx.bk-info-wrapper .bk-modal-wrapper .bk-dialog-header .bk-dialog-title {
|
17
17
|
height: 27px;
|
18
18
|
margin: 15px 0 10px;
|
19
19
|
}
|
20
|
-
.bk-modal-
|
20
|
+
.bk-modal-ctx.bk-info-wrapper .bk-modal-wrapper .bk-modal-content {
|
21
21
|
height: 100%;
|
22
22
|
max-height: 100%;
|
23
23
|
min-height: 100%;
|
24
24
|
padding: 0 50px 10px;
|
25
25
|
word-break: break-all;
|
26
26
|
}
|
27
|
-
.bk-modal-
|
27
|
+
.bk-modal-ctx.bk-info-wrapper .bk-modal-wrapper .bk-modal-content .bk-info-sub-title {
|
28
28
|
margin-bottom: 10px;
|
29
29
|
text-align: center;
|
30
30
|
word-break: break-all;
|
31
31
|
}
|
32
|
-
.bk-modal-
|
32
|
+
.bk-modal-ctx.bk-info-wrapper .bk-modal-wrapper .bk-modal-footer {
|
33
33
|
padding: 0 65px 33px;
|
34
34
|
background-color: #fff;
|
35
35
|
border-top: none;
|
36
36
|
}
|
37
|
-
.bk-modal-
|
37
|
+
.bk-modal-ctx.bk-info-wrapper .bk-modal-wrapper .bk-modal-footer .bk-dialog-footer button {
|
38
38
|
min-width: 88px;
|
39
39
|
}
|
40
|
+
.bk-modal-ctx {
|
41
|
+
pointer-events: auto;
|
42
|
+
top: 0px;
|
43
|
+
left: 0px;
|
44
|
+
width: 100%;
|
45
|
+
height: 100%;
|
46
|
+
}
|
47
|
+
.bk-modal-ctx.--show {
|
48
|
+
position: fixed;
|
49
|
+
}
|
50
|
+
.bk-modal-ctx.--hide {
|
51
|
+
display: none;
|
52
|
+
}
|
53
|
+
.bk-modal-ctx .bk-modal-ctx-mask {
|
54
|
+
display: none;
|
55
|
+
left: 0;
|
56
|
+
top: 0;
|
57
|
+
width: 100%;
|
58
|
+
height: 100%;
|
59
|
+
background-color: rgba(0, 0, 0, 0.6);
|
60
|
+
}
|
61
|
+
.bk-modal-ctx .bk-modal-ctx-mask.--show {
|
62
|
+
position: fixed;
|
63
|
+
display: inherit;
|
64
|
+
}
|
40
65
|
.bk-modal-wrapper {
|
41
66
|
position: absolute;
|
42
67
|
top: 50%;
|
@@ -70,6 +95,7 @@
|
|
70
95
|
}
|
71
96
|
.bk-modal-wrapper .bk-modal-body {
|
72
97
|
height: 100%;
|
98
|
+
width: 100%;
|
73
99
|
background: #fff;
|
74
100
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
75
101
|
}
|
package/lib/modal/modal.d.ts
CHANGED
@@ -54,9 +54,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
54
54
|
transfer: import("vue-types").VueTypeDef<string | boolean | HTMLElement> & {
|
55
55
|
default: string | boolean | (() => HTMLElement);
|
56
56
|
};
|
57
|
-
zIndex: import("vue-types").VueTypeDef<string | number
|
58
|
-
default: string | number;
|
59
|
-
};
|
57
|
+
zIndex: import("vue-types").VueTypeDef<string | number>;
|
60
58
|
maxHeight: import("vue-types").VueTypeValidableDef<string> & {
|
61
59
|
default: string;
|
62
60
|
};
|
@@ -83,19 +81,34 @@ declare const _default: import("vue").DefineComponent<{
|
|
83
81
|
} & {
|
84
82
|
default: boolean;
|
85
83
|
};
|
86
|
-
infoType: import("vue-types").VueTypeDef<"
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
dialogHeight(): String | Number;
|
94
|
-
compStyle(): any;
|
95
|
-
fullscreenStyle(): any;
|
84
|
+
infoType: import("vue-types").VueTypeDef<"success" | "warning" | "danger" | "primary">;
|
85
|
+
left: import("vue-types").VueTypeValidableDef<string> & {
|
86
|
+
default: string;
|
87
|
+
};
|
88
|
+
top: import("vue-types").VueTypeValidableDef<string> & {
|
89
|
+
default: string;
|
90
|
+
};
|
96
91
|
}, {
|
97
|
-
|
98
|
-
|
92
|
+
visible: import("vue").Ref<boolean>;
|
93
|
+
compStyle: import("vue").ComputedRef<{
|
94
|
+
[x: string]: string | number;
|
95
|
+
width: string | number;
|
96
|
+
height: string | number;
|
97
|
+
minHeigth: string;
|
98
|
+
display: string;
|
99
|
+
zIndex: string | number;
|
100
|
+
left: string;
|
101
|
+
top: string;
|
102
|
+
}>;
|
103
|
+
fullscreenStyle: import("vue").ComputedRef<{
|
104
|
+
width: string;
|
105
|
+
height: string;
|
106
|
+
}>;
|
107
|
+
handleClickOutSide: (e: MouseEvent) => void;
|
108
|
+
refRoot: import("vue").Ref<HTMLElement>;
|
109
|
+
refMask: import("vue").Ref<HTMLElement>;
|
110
|
+
showMask: boolean;
|
111
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "shown" | "hidden" | "quick-close" | "quickClose")[], "close" | "shown" | "hidden" | "quick-close" | "quickClose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
99
112
|
isShow: import("vue-types").VueTypeValidableDef<boolean> & {
|
100
113
|
default: boolean;
|
101
114
|
} & {
|
@@ -151,9 +164,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
151
164
|
transfer: import("vue-types").VueTypeDef<string | boolean | HTMLElement> & {
|
152
165
|
default: string | boolean | (() => HTMLElement);
|
153
166
|
};
|
154
|
-
zIndex: import("vue-types").VueTypeDef<string | number
|
155
|
-
default: string | number;
|
156
|
-
};
|
167
|
+
zIndex: import("vue-types").VueTypeDef<string | number>;
|
157
168
|
maxHeight: import("vue-types").VueTypeValidableDef<string> & {
|
158
169
|
default: string;
|
159
170
|
};
|
@@ -180,7 +191,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
180
191
|
} & {
|
181
192
|
default: boolean;
|
182
193
|
};
|
183
|
-
infoType: import("vue-types").VueTypeDef<"
|
194
|
+
infoType: import("vue-types").VueTypeDef<"success" | "warning" | "danger" | "primary">;
|
195
|
+
left: import("vue-types").VueTypeValidableDef<string> & {
|
196
|
+
default: string;
|
197
|
+
};
|
198
|
+
top: import("vue-types").VueTypeValidableDef<string> & {
|
199
|
+
default: string;
|
200
|
+
};
|
184
201
|
}>> & {
|
185
202
|
onClose?: (...args: any[]) => any;
|
186
203
|
onShown?: (...args: any[]) => any;
|
@@ -193,19 +210,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
193
210
|
height: string | number;
|
194
211
|
maxHeight: string;
|
195
212
|
extCls: string | unknown[];
|
213
|
+
top: string;
|
214
|
+
left: string;
|
196
215
|
isShow: boolean;
|
197
|
-
zIndex: string | number;
|
198
216
|
draggable: boolean;
|
199
217
|
transfer: string | boolean | HTMLElement;
|
200
|
-
showMask: boolean;
|
201
|
-
multiInstance: boolean;
|
202
218
|
direction: string;
|
203
219
|
renderDirective: "show" | "if";
|
204
220
|
quickClose: boolean;
|
205
221
|
scrollable: boolean;
|
222
|
+
showMask: boolean;
|
206
223
|
closeIcon: boolean;
|
207
224
|
escClose: boolean;
|
208
225
|
fullscreen: boolean;
|
209
226
|
animateType: string;
|
227
|
+
multiInstance: boolean;
|
210
228
|
}, {}>;
|
211
229
|
export default _default;
|