bkui-vue 1.0.3-beta.60.scrollbar.5 → 1.0.3-beta.61.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.
- package/dist/index.cjs.js +61 -63
- package/dist/index.esm.js +19978 -19906
- package/dist/index.umd.js +61 -63
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/components.d.ts +2 -0
- package/lib/components.js +3 -1
- package/lib/date-picker/index.js +1 -1
- package/lib/dialog/dialog.css +140 -80
- package/lib/dialog/dialog.d.ts +41 -121
- package/lib/dialog/dialog.less +10 -65
- package/lib/dialog/dialog.variable.css +140 -80
- package/lib/dialog/index.d.ts +105 -272
- package/lib/dialog/index.js +91 -100
- package/lib/dialog/props.d.ts +8 -48
- package/lib/info-box/index.d.ts +2 -2
- package/lib/info-box/index.js +312 -172
- package/lib/info-box/info-box.css +63 -7
- package/lib/info-box/info-box.d.ts +17 -16
- package/lib/info-box/info-box.less +76 -14
- package/lib/info-box/info-box.variable.css +63 -7
- package/lib/info-box/render-component.d.ts +4 -0
- package/lib/modal/hooks.d.ts +1 -1
- package/lib/modal/index.d.ts +48 -325
- package/lib/modal/index.js +195 -675
- package/lib/modal/mask.d.ts +6 -0
- package/lib/modal/modal.css +132 -34
- package/lib/modal/modal.d.ts +17 -126
- package/lib/modal/modal.less +88 -39
- package/lib/modal/modal.variable.css +132 -34
- package/lib/modal/props.mixin.d.ts +2 -53
- package/lib/scrollbar/index.d.ts +14 -0
- package/lib/scrollbar/index.js +18737 -0
- package/lib/{virtual-render → scrollbar}/scrollbar-core/index.d.ts +31 -8
- package/lib/{virtual-render/bk-scrollbar.css → scrollbar/scrollbar.css} +13 -13
- package/lib/{virtual-render/bk-scrollbar.less → scrollbar/scrollbar.less} +13 -13
- package/lib/{virtual-render/bk-scrollbar.variable.css → scrollbar/scrollbar.variable.css} +13 -13
- package/lib/search-select/index.d.ts +327 -12
- package/lib/search-select/index.js +620 -340
- package/lib/search-select/input.d.ts +6 -1
- package/lib/search-select/search-select.css +20 -6
- package/lib/search-select/search-select.d.ts +109 -4
- package/lib/search-select/search-select.less +16 -12
- package/lib/search-select/search-select.variable.css +20 -6
- package/lib/search-select/selected.d.ts +107 -5
- package/lib/search-select/utils.d.ts +13 -1
- package/lib/select/index.d.ts +23 -0
- package/lib/select/index.js +4 -1
- package/lib/select/select.d.ts +11 -0
- package/lib/shared/index.d.ts +0 -1
- package/lib/shared/index.js +1 -48
- package/lib/sideslider/index.d.ts +31 -222
- package/lib/sideslider/index.js +49 -36
- package/lib/sideslider/sideslider.css +4 -47
- package/lib/sideslider/sideslider.d.ts +14 -105
- package/lib/sideslider/sideslider.less +14 -65
- package/lib/sideslider/sideslider.variable.css +4 -47
- package/lib/table/index.js +37 -28
- package/lib/table/plugins/use-pagination.d.ts +3 -1
- package/lib/table/table.css +14 -13
- package/lib/table/table.less +2 -2
- package/lib/table/table.variable.css +14 -13
- package/lib/table/use-attributes.d.ts +1 -0
- package/lib/timeline/index.js +1 -0
- package/lib/tree/tree.css +13 -13
- package/lib/tree/tree.variable.css +13 -13
- package/lib/upload/index.d.ts +12 -0
- package/lib/upload/index.js +21 -30
- package/lib/upload/props.d.ts +3 -0
- package/lib/upload/upload-trigger.d.ts +6 -0
- package/lib/upload/upload.d.ts +6 -0
- package/lib/virtual-render/index.js +262 -2175
- package/lib/virtual-render/use-scrollbar.d.ts +2 -2
- package/lib/virtual-render/virtual-render.css +13 -13
- package/lib/virtual-render/virtual-render.less +2 -2
- package/lib/virtual-render/virtual-render.variable.css +13 -13
- package/package.json +2 -2
- package/lib/icon/image-fill.js +0 -191
- package/lib/shared/mask.d.ts +0 -11
- package/lib/virtual-render/bk-scrollbar.d.ts +0 -10
- /package/lib/{virtual-render → scrollbar}/scrollbar-core/can-use-dom.d.ts +0 -0
- /package/lib/{virtual-render → scrollbar}/scrollbar-core/helpers.d.ts +0 -0
- /package/lib/{virtual-render → scrollbar}/scrollbar-core/mouse-wheel.d.ts +0 -0
- /package/lib/{virtual-render → scrollbar}/scrollbar-core/scrollbar-width.d.ts +0 -0
package/lib/modal/index.js
CHANGED
@@ -4,396 +4,10 @@ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../sh
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
|
7
|
-
|
8
|
-
/******/ var
|
9
|
-
|
10
|
-
/***/ 7609:
|
11
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
12
|
-
|
13
|
-
var _typeof = (__webpack_require__(7425)["default"]);
|
14
|
-
function _regeneratorRuntime() {
|
15
|
-
"use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
16
|
-
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
17
|
-
return e;
|
18
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19
|
-
var t,
|
20
|
-
e = {},
|
21
|
-
r = Object.prototype,
|
22
|
-
n = r.hasOwnProperty,
|
23
|
-
o = Object.defineProperty || function (t, e, r) {
|
24
|
-
t[e] = r.value;
|
25
|
-
},
|
26
|
-
i = "function" == typeof Symbol ? Symbol : {},
|
27
|
-
a = i.iterator || "@@iterator",
|
28
|
-
c = i.asyncIterator || "@@asyncIterator",
|
29
|
-
u = i.toStringTag || "@@toStringTag";
|
30
|
-
function define(t, e, r) {
|
31
|
-
return Object.defineProperty(t, e, {
|
32
|
-
value: r,
|
33
|
-
enumerable: !0,
|
34
|
-
configurable: !0,
|
35
|
-
writable: !0
|
36
|
-
}), t[e];
|
37
|
-
}
|
38
|
-
try {
|
39
|
-
define({}, "");
|
40
|
-
} catch (t) {
|
41
|
-
define = function define(t, e, r) {
|
42
|
-
return t[e] = r;
|
43
|
-
};
|
44
|
-
}
|
45
|
-
function wrap(t, e, r, n) {
|
46
|
-
var i = e && e.prototype instanceof Generator ? e : Generator,
|
47
|
-
a = Object.create(i.prototype),
|
48
|
-
c = new Context(n || []);
|
49
|
-
return o(a, "_invoke", {
|
50
|
-
value: makeInvokeMethod(t, r, c)
|
51
|
-
}), a;
|
52
|
-
}
|
53
|
-
function tryCatch(t, e, r) {
|
54
|
-
try {
|
55
|
-
return {
|
56
|
-
type: "normal",
|
57
|
-
arg: t.call(e, r)
|
58
|
-
};
|
59
|
-
} catch (t) {
|
60
|
-
return {
|
61
|
-
type: "throw",
|
62
|
-
arg: t
|
63
|
-
};
|
64
|
-
}
|
65
|
-
}
|
66
|
-
e.wrap = wrap;
|
67
|
-
var h = "suspendedStart",
|
68
|
-
l = "suspendedYield",
|
69
|
-
f = "executing",
|
70
|
-
s = "completed",
|
71
|
-
y = {};
|
72
|
-
function Generator() {}
|
73
|
-
function GeneratorFunction() {}
|
74
|
-
function GeneratorFunctionPrototype() {}
|
75
|
-
var p = {};
|
76
|
-
define(p, a, function () {
|
77
|
-
return this;
|
78
|
-
});
|
79
|
-
var d = Object.getPrototypeOf,
|
80
|
-
v = d && d(d(values([])));
|
81
|
-
v && v !== r && n.call(v, a) && (p = v);
|
82
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
83
|
-
function defineIteratorMethods(t) {
|
84
|
-
["next", "throw", "return"].forEach(function (e) {
|
85
|
-
define(t, e, function (t) {
|
86
|
-
return this._invoke(e, t);
|
87
|
-
});
|
88
|
-
});
|
89
|
-
}
|
90
|
-
function AsyncIterator(t, e) {
|
91
|
-
function invoke(r, o, i, a) {
|
92
|
-
var c = tryCatch(t[r], t, o);
|
93
|
-
if ("throw" !== c.type) {
|
94
|
-
var u = c.arg,
|
95
|
-
h = u.value;
|
96
|
-
return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
97
|
-
invoke("next", t, i, a);
|
98
|
-
}, function (t) {
|
99
|
-
invoke("throw", t, i, a);
|
100
|
-
}) : e.resolve(h).then(function (t) {
|
101
|
-
u.value = t, i(u);
|
102
|
-
}, function (t) {
|
103
|
-
return invoke("throw", t, i, a);
|
104
|
-
});
|
105
|
-
}
|
106
|
-
a(c.arg);
|
107
|
-
}
|
108
|
-
var r;
|
109
|
-
o(this, "_invoke", {
|
110
|
-
value: function value(t, n) {
|
111
|
-
function callInvokeWithMethodAndArg() {
|
112
|
-
return new e(function (e, r) {
|
113
|
-
invoke(t, n, e, r);
|
114
|
-
});
|
115
|
-
}
|
116
|
-
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
117
|
-
}
|
118
|
-
});
|
119
|
-
}
|
120
|
-
function makeInvokeMethod(e, r, n) {
|
121
|
-
var o = h;
|
122
|
-
return function (i, a) {
|
123
|
-
if (o === f) throw Error("Generator is already running");
|
124
|
-
if (o === s) {
|
125
|
-
if ("throw" === i) throw a;
|
126
|
-
return {
|
127
|
-
value: t,
|
128
|
-
done: !0
|
129
|
-
};
|
130
|
-
}
|
131
|
-
for (n.method = i, n.arg = a;;) {
|
132
|
-
var c = n.delegate;
|
133
|
-
if (c) {
|
134
|
-
var u = maybeInvokeDelegate(c, n);
|
135
|
-
if (u) {
|
136
|
-
if (u === y) continue;
|
137
|
-
return u;
|
138
|
-
}
|
139
|
-
}
|
140
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
141
|
-
if (o === h) throw o = s, n.arg;
|
142
|
-
n.dispatchException(n.arg);
|
143
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
144
|
-
o = f;
|
145
|
-
var p = tryCatch(e, r, n);
|
146
|
-
if ("normal" === p.type) {
|
147
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
148
|
-
return {
|
149
|
-
value: p.arg,
|
150
|
-
done: n.done
|
151
|
-
};
|
152
|
-
}
|
153
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
154
|
-
}
|
155
|
-
};
|
156
|
-
}
|
157
|
-
function maybeInvokeDelegate(e, r) {
|
158
|
-
var n = r.method,
|
159
|
-
o = e.iterator[n];
|
160
|
-
if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
161
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
162
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
163
|
-
var a = i.arg;
|
164
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
165
|
-
}
|
166
|
-
function pushTryEntry(t) {
|
167
|
-
var e = {
|
168
|
-
tryLoc: t[0]
|
169
|
-
};
|
170
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
171
|
-
}
|
172
|
-
function resetTryEntry(t) {
|
173
|
-
var e = t.completion || {};
|
174
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
175
|
-
}
|
176
|
-
function Context(t) {
|
177
|
-
this.tryEntries = [{
|
178
|
-
tryLoc: "root"
|
179
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
180
|
-
}
|
181
|
-
function values(e) {
|
182
|
-
if (e || "" === e) {
|
183
|
-
var r = e[a];
|
184
|
-
if (r) return r.call(e);
|
185
|
-
if ("function" == typeof e.next) return e;
|
186
|
-
if (!isNaN(e.length)) {
|
187
|
-
var o = -1,
|
188
|
-
i = function next() {
|
189
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
190
|
-
return next.value = t, next.done = !0, next;
|
191
|
-
};
|
192
|
-
return i.next = i;
|
193
|
-
}
|
194
|
-
}
|
195
|
-
throw new TypeError(_typeof(e) + " is not iterable");
|
196
|
-
}
|
197
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
198
|
-
value: GeneratorFunctionPrototype,
|
199
|
-
configurable: !0
|
200
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
201
|
-
value: GeneratorFunction,
|
202
|
-
configurable: !0
|
203
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
204
|
-
var e = "function" == typeof t && t.constructor;
|
205
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
206
|
-
}, e.mark = function (t) {
|
207
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
208
|
-
}, e.awrap = function (t) {
|
209
|
-
return {
|
210
|
-
__await: t
|
211
|
-
};
|
212
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
213
|
-
return this;
|
214
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
215
|
-
void 0 === i && (i = Promise);
|
216
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
217
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
218
|
-
return t.done ? t.value : a.next();
|
219
|
-
});
|
220
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
221
|
-
return this;
|
222
|
-
}), define(g, "toString", function () {
|
223
|
-
return "[object Generator]";
|
224
|
-
}), e.keys = function (t) {
|
225
|
-
var e = Object(t),
|
226
|
-
r = [];
|
227
|
-
for (var n in e) r.push(n);
|
228
|
-
return r.reverse(), function next() {
|
229
|
-
for (; r.length;) {
|
230
|
-
var t = r.pop();
|
231
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
232
|
-
}
|
233
|
-
return next.done = !0, next;
|
234
|
-
};
|
235
|
-
}, e.values = values, Context.prototype = {
|
236
|
-
constructor: Context,
|
237
|
-
reset: function reset(e) {
|
238
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
239
|
-
},
|
240
|
-
stop: function stop() {
|
241
|
-
this.done = !0;
|
242
|
-
var t = this.tryEntries[0].completion;
|
243
|
-
if ("throw" === t.type) throw t.arg;
|
244
|
-
return this.rval;
|
245
|
-
},
|
246
|
-
dispatchException: function dispatchException(e) {
|
247
|
-
if (this.done) throw e;
|
248
|
-
var r = this;
|
249
|
-
function handle(n, o) {
|
250
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
251
|
-
}
|
252
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
253
|
-
var i = this.tryEntries[o],
|
254
|
-
a = i.completion;
|
255
|
-
if ("root" === i.tryLoc) return handle("end");
|
256
|
-
if (i.tryLoc <= this.prev) {
|
257
|
-
var c = n.call(i, "catchLoc"),
|
258
|
-
u = n.call(i, "finallyLoc");
|
259
|
-
if (c && u) {
|
260
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
261
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
262
|
-
} else if (c) {
|
263
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
264
|
-
} else {
|
265
|
-
if (!u) throw Error("try statement without catch or finally");
|
266
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
267
|
-
}
|
268
|
-
}
|
269
|
-
}
|
270
|
-
},
|
271
|
-
abrupt: function abrupt(t, e) {
|
272
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
273
|
-
var o = this.tryEntries[r];
|
274
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
275
|
-
var i = o;
|
276
|
-
break;
|
277
|
-
}
|
278
|
-
}
|
279
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
280
|
-
var a = i ? i.completion : {};
|
281
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
282
|
-
},
|
283
|
-
complete: function complete(t, e) {
|
284
|
-
if ("throw" === t.type) throw t.arg;
|
285
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
286
|
-
},
|
287
|
-
finish: function finish(t) {
|
288
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
289
|
-
var r = this.tryEntries[e];
|
290
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
291
|
-
}
|
292
|
-
},
|
293
|
-
"catch": function _catch(t) {
|
294
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
295
|
-
var r = this.tryEntries[e];
|
296
|
-
if (r.tryLoc === t) {
|
297
|
-
var n = r.completion;
|
298
|
-
if ("throw" === n.type) {
|
299
|
-
var o = n.arg;
|
300
|
-
resetTryEntry(r);
|
301
|
-
}
|
302
|
-
return o;
|
303
|
-
}
|
304
|
-
}
|
305
|
-
throw Error("illegal catch attempt");
|
306
|
-
},
|
307
|
-
delegateYield: function delegateYield(e, r, n) {
|
308
|
-
return this.delegate = {
|
309
|
-
iterator: values(e),
|
310
|
-
resultName: r,
|
311
|
-
nextLoc: n
|
312
|
-
}, "next" === this.method && (this.arg = t), y;
|
313
|
-
}
|
314
|
-
}, e;
|
315
|
-
}
|
316
|
-
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
317
|
-
|
318
|
-
/***/ }),
|
319
|
-
|
320
|
-
/***/ 7425:
|
321
|
-
/***/ ((module) => {
|
322
|
-
|
323
|
-
function _typeof(o) {
|
324
|
-
"@babel/helpers - typeof";
|
325
|
-
|
326
|
-
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
327
|
-
return typeof o;
|
328
|
-
} : function (o) {
|
329
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
330
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
331
|
-
}
|
332
|
-
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
333
|
-
|
334
|
-
/***/ }),
|
335
|
-
|
336
|
-
/***/ 2841:
|
337
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
338
|
-
|
339
|
-
// TODO(Babel 8): Remove this file.
|
340
|
-
|
341
|
-
var runtime = __webpack_require__(7609)();
|
342
|
-
module.exports = runtime;
|
343
|
-
|
344
|
-
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
345
|
-
try {
|
346
|
-
regeneratorRuntime = runtime;
|
347
|
-
} catch (accidentalStrictMode) {
|
348
|
-
if (typeof globalThis === "object") {
|
349
|
-
globalThis.regeneratorRuntime = runtime;
|
350
|
-
} else {
|
351
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
352
|
-
}
|
353
|
-
}
|
354
|
-
|
355
|
-
|
356
|
-
/***/ })
|
357
|
-
|
358
|
-
/******/ });
|
359
|
-
/************************************************************************/
|
360
|
-
/******/ // The module cache
|
361
|
-
/******/ var __webpack_module_cache__ = {};
|
362
|
-
/******/
|
363
|
-
/******/ // The require function
|
364
|
-
/******/ function __webpack_require__(moduleId) {
|
365
|
-
/******/ // Check if module is in cache
|
366
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
367
|
-
/******/ if (cachedModule !== undefined) {
|
368
|
-
/******/ return cachedModule.exports;
|
369
|
-
/******/ }
|
370
|
-
/******/ // Create a new module (and put it into the cache)
|
371
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
372
|
-
/******/ // no module.id needed
|
373
|
-
/******/ // no module.loaded needed
|
374
|
-
/******/ exports: {}
|
375
|
-
/******/ };
|
376
|
-
/******/
|
377
|
-
/******/ // Execute the module function
|
378
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
379
|
-
/******/
|
380
|
-
/******/ // Return the exports of the module
|
381
|
-
/******/ return module.exports;
|
382
|
-
/******/ }
|
7
|
+
/******/ // The require scope
|
8
|
+
/******/ var __webpack_require__ = {};
|
383
9
|
/******/
|
384
10
|
/************************************************************************/
|
385
|
-
/******/ /* webpack/runtime/compat get default export */
|
386
|
-
/******/ (() => {
|
387
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
388
|
-
/******/ __webpack_require__.n = (module) => {
|
389
|
-
/******/ var getter = module && module.__esModule ?
|
390
|
-
/******/ () => (module['default']) :
|
391
|
-
/******/ () => (module);
|
392
|
-
/******/ __webpack_require__.d(getter, { a: getter });
|
393
|
-
/******/ return getter;
|
394
|
-
/******/ };
|
395
|
-
/******/ })();
|
396
|
-
/******/
|
397
11
|
/******/ /* webpack/runtime/define property getters */
|
398
12
|
/******/ (() => {
|
399
13
|
/******/ // define getter functions for harmony exports
|
@@ -413,8 +27,6 @@ try {
|
|
413
27
|
/******/
|
414
28
|
/************************************************************************/
|
415
29
|
var __webpack_exports__ = {};
|
416
|
-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
417
|
-
(() => {
|
418
30
|
|
419
31
|
// EXPORTS
|
420
32
|
__webpack_require__.d(__webpack_exports__, {
|
@@ -426,38 +38,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
426
38
|
;// CONCATENATED MODULE: external "../shared"
|
427
39
|
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
428
40
|
var y = x => () => x
|
429
|
-
const shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.bkZIndexManager, ["
|
430
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
431
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
432
|
-
try {
|
433
|
-
var info = gen[key](arg);
|
434
|
-
var value = info.value;
|
435
|
-
} catch (error) {
|
436
|
-
reject(error);
|
437
|
-
return;
|
438
|
-
}
|
439
|
-
if (info.done) {
|
440
|
-
resolve(value);
|
441
|
-
} else {
|
442
|
-
Promise.resolve(value).then(_next, _throw);
|
443
|
-
}
|
444
|
-
}
|
445
|
-
function _asyncToGenerator(fn) {
|
446
|
-
return function () {
|
447
|
-
var self = this,
|
448
|
-
args = arguments;
|
449
|
-
return new Promise(function (resolve, reject) {
|
450
|
-
var gen = fn.apply(self, args);
|
451
|
-
function _next(value) {
|
452
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
453
|
-
}
|
454
|
-
function _throw(err) {
|
455
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
456
|
-
}
|
457
|
-
_next(undefined);
|
458
|
-
});
|
459
|
-
};
|
460
|
-
}
|
41
|
+
const shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.bkZIndexManager, ["renderDirectiveType"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.renderDirectiveType, ["withInstallProps"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstallProps });
|
461
42
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
462
43
|
function _typeof(o) {
|
463
44
|
"@babel/helpers - typeof";
|
@@ -506,10 +87,7 @@ function _defineProperty(obj, key, value) {
|
|
506
87
|
;// CONCATENATED MODULE: external "vue"
|
507
88
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
508
89
|
var external_vue_y = x => () => x
|
509
|
-
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, ["
|
510
|
-
// EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
|
511
|
-
var regenerator = __webpack_require__(2841);
|
512
|
-
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
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, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
513
91
|
;// CONCATENATED MODULE: external "../config-provider"
|
514
92
|
var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
515
93
|
var config_provider_y = x => () => x
|
@@ -547,43 +125,38 @@ const throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTER
|
|
547
125
|
|
548
126
|
|
549
127
|
|
550
|
-
var useContentResize = function useContentResize(root, props) {
|
128
|
+
var useContentResize = function useContentResize(root, resizeTarget, props) {
|
551
129
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
552
130
|
resolveClassName = _usePrefix.resolveClassName;
|
553
|
-
var slots = (0,external_vue_namespaceObject.useSlots)();
|
554
131
|
var isContentScroll = (0,external_vue_namespaceObject.ref)(false);
|
555
132
|
var contentStyles = (0,external_vue_namespaceObject.ref)({});
|
556
133
|
var observer;
|
557
134
|
var handleContentBoxChange = function handleContentBoxChange() {
|
558
|
-
if (!slots.footer) {
|
559
|
-
return;
|
560
|
-
}
|
561
135
|
var calcContentScroll = (0,throttle_namespaceObject["default"])(function () {
|
562
136
|
var _root$value$querySele = root.value.querySelector(".".concat(resolveClassName('modal-header'))).getBoundingClientRect(),
|
563
137
|
headerHeight = _root$value$querySele.height;
|
564
|
-
var _root$value$querySele2 = root.value.querySelector(".".concat(resolveClassName('modal-content'))).getBoundingClientRect(),
|
138
|
+
var _root$value$querySele2 = root.value.querySelector(".".concat(resolveClassName('modal-content'), " div")).getBoundingClientRect(),
|
565
139
|
contentHeight = _root$value$querySele2.height;
|
566
140
|
var _root$value$querySele3 = root.value.querySelector(".".concat(resolveClassName('modal-footer'))).getBoundingClientRect(),
|
567
141
|
footerHeight = _root$value$querySele3.height;
|
568
142
|
var windowInnerHeight = window.innerHeight;
|
569
|
-
isContentScroll.value = windowInnerHeight < headerHeight + contentHeight + footerHeight;
|
143
|
+
isContentScroll.value = windowInnerHeight < headerHeight + contentHeight + footerHeight + 20;
|
570
144
|
if (isContentScroll.value || props.fullscreen) {
|
571
145
|
contentStyles.value = {
|
572
146
|
height: "".concat(windowInnerHeight - headerHeight - footerHeight, "px"),
|
573
|
-
overflow: '
|
147
|
+
overflow: 'auto',
|
148
|
+
'scrollbar-gutter': 'stable'
|
574
149
|
};
|
150
|
+
// fullscreen 时默认为 true
|
151
|
+
isContentScroll.value = true;
|
575
152
|
} else {
|
576
153
|
contentStyles.value = {};
|
577
154
|
}
|
578
|
-
},
|
579
|
-
observer = new
|
155
|
+
}, 30);
|
156
|
+
observer = new ResizeObserver(function () {
|
580
157
|
calcContentScroll();
|
581
158
|
});
|
582
|
-
observer.observe(
|
583
|
-
subtree: true,
|
584
|
-
attributes: true,
|
585
|
-
childList: true
|
586
|
-
});
|
159
|
+
observer.observe(resizeTarget.value);
|
587
160
|
calcContentScroll();
|
588
161
|
};
|
589
162
|
(0,external_vue_namespaceObject.watch)(function () {
|
@@ -592,10 +165,9 @@ var useContentResize = function useContentResize(root, props) {
|
|
592
165
|
if (props.isShow) {
|
593
166
|
setTimeout(function () {
|
594
167
|
handleContentBoxChange();
|
595
|
-
}
|
168
|
+
});
|
596
169
|
} else {
|
597
170
|
if (observer) {
|
598
|
-
observer.takeRecords();
|
599
171
|
observer.disconnect();
|
600
172
|
observer = null;
|
601
173
|
}
|
@@ -608,12 +180,76 @@ var useContentResize = function useContentResize(root, props) {
|
|
608
180
|
isContentScroll: isContentScroll
|
609
181
|
};
|
610
182
|
};
|
611
|
-
;// CONCATENATED MODULE:
|
612
|
-
|
613
|
-
|
614
|
-
|
183
|
+
;// CONCATENATED MODULE: ../../packages/modal/src/mask.ts
|
184
|
+
/*
|
185
|
+
* Tencent is pleased to support the open source community by making
|
186
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
187
|
+
*
|
188
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
189
|
+
*
|
190
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
191
|
+
*
|
192
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
193
|
+
*
|
194
|
+
* ---------------------------------------------------
|
195
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
196
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
197
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
198
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
199
|
+
*
|
200
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
201
|
+
* the Software.
|
202
|
+
*
|
203
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
204
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
205
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
206
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
207
|
+
* IN THE SOFTWARE.
|
208
|
+
*/
|
209
|
+
var maskEleLink = new WeakMap();
|
210
|
+
var lastestMaskEle;
|
211
|
+
var maskInstanceCount = 0;
|
212
|
+
var showMask = function showMask(maskEle) {
|
213
|
+
if (maskEle === lastestMaskEle) {
|
214
|
+
lastestMaskEle = maskEle;
|
215
|
+
return;
|
216
|
+
}
|
217
|
+
maskInstanceCount += 1;
|
218
|
+
if (lastestMaskEle) {
|
219
|
+
lastestMaskEle.style.opacity = '0';
|
220
|
+
maskEle.style.transitionProperty = '';
|
221
|
+
// 缓存遮罩出现的顺序
|
222
|
+
maskEleLink.set(maskEle, lastestMaskEle);
|
223
|
+
}
|
224
|
+
lastestMaskEle = maskEle;
|
225
|
+
};
|
226
|
+
var hideMask = function hideMask(maskEle) {
|
227
|
+
if (maskEleLink.has(maskEle)) {
|
228
|
+
lastestMaskEle = maskEleLink.get(maskEle);
|
229
|
+
lastestMaskEle.style.opacity = '1';
|
230
|
+
maskEle.style.visibility = 'hidden';
|
231
|
+
maskEleLink["delete"](maskEle);
|
232
|
+
maskInstanceCount -= 1;
|
233
|
+
setTimeout(function () {
|
234
|
+
maskEle.style.visibility = '';
|
235
|
+
}, 300);
|
236
|
+
}
|
237
|
+
};
|
238
|
+
var destroyMask = function destroyMask(maskEle) {
|
239
|
+
if (maskEleLink.has(maskEle)) {
|
240
|
+
maskEleLink["delete"](maskEle);
|
241
|
+
}
|
242
|
+
};
|
243
|
+
var getMaskCount = function getMaskCount() {
|
244
|
+
return maskInstanceCount;
|
245
|
+
};
|
246
|
+
var mask = {
|
247
|
+
showMask: showMask,
|
248
|
+
hideMask: hideMask,
|
249
|
+
destroyMask: destroyMask,
|
250
|
+
getMaskCount: getMaskCount
|
251
|
+
};
|
615
252
|
;// CONCATENATED MODULE: ../../packages/modal/src/props.mixin.ts
|
616
|
-
|
617
253
|
/*
|
618
254
|
* Tencent is pleased to support the open source community by making
|
619
255
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
@@ -640,46 +276,24 @@ const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: ()
|
|
640
276
|
* IN THE SOFTWARE.
|
641
277
|
*/
|
642
278
|
|
643
|
-
var ModalSizeEnum;
|
644
|
-
(function (ModalSizeEnum) {
|
645
|
-
ModalSizeEnum["NORMAL"] = "normal";
|
646
|
-
ModalSizeEnum["SMALL"] = "small";
|
647
|
-
ModalSizeEnum["MEDIUM"] = "medium";
|
648
|
-
ModalSizeEnum["LARGE"] = "large";
|
649
|
-
})(ModalSizeEnum || (ModalSizeEnum = {}));
|
650
279
|
var propsMixin = {
|
651
280
|
// 是否显示弹框
|
652
281
|
isShow: shared_namespaceObject.PropTypes.bool.def(false),
|
653
|
-
width: shared_namespaceObject.PropTypes.oneOfType([String, Number])
|
654
|
-
|
655
|
-
|
656
|
-
extCls: shared_namespaceObject.PropTypes.string || shared_namespaceObject.PropTypes.array,
|
657
|
-
// 弹框出现时,是否允许页面滚动
|
658
|
-
scrollable: shared_namespaceObject.PropTypes.bool.def(true),
|
282
|
+
width: shared_namespaceObject.PropTypes.oneOfType([String, Number]),
|
283
|
+
// 是否全屏
|
284
|
+
fullscreen: shared_namespaceObject.PropTypes.bool.def(false),
|
659
285
|
// 是否允许出现遮罩
|
660
286
|
showMask: shared_namespaceObject.PropTypes.bool.def(true),
|
661
287
|
// 是否显示右上角的关闭 icon
|
662
288
|
closeIcon: shared_namespaceObject.PropTypes.bool.def(true),
|
663
289
|
// 是否允许 esc 按键关闭弹框
|
664
290
|
escClose: shared_namespaceObject.PropTypes.bool.def(true),
|
665
|
-
// 是否全屏
|
666
|
-
fullscreen: shared_namespaceObject.PropTypes.bool.def(false),
|
667
|
-
// 弹框尺寸
|
668
|
-
size: (0,external_vue_types_namespaceObject.toType)('size', {}),
|
669
|
-
// 是否可拖拽
|
670
|
-
draggable: shared_namespaceObject.PropTypes.bool.def(true),
|
671
291
|
// 是否允许点击遮罩关闭弹窗
|
672
292
|
quickClose: shared_namespaceObject.PropTypes.bool.def(true),
|
673
293
|
// 是否显示在body内(即与id#app同级
|
674
294
|
transfer: shared_namespaceObject.PropTypes.oneOfType([Boolean, String, HTMLElement]).def(true),
|
675
295
|
// 弹出层z-index,实际显示的值会自动+1。为了抱证在遮罩上正常显示
|
676
296
|
zIndex: shared_namespaceObject.PropTypes.oneOfType([String, Number]),
|
677
|
-
// 内容区最大高度
|
678
|
-
maxHeight: shared_namespaceObject.PropTypes.string,
|
679
|
-
// 弹出方向
|
680
|
-
direction: shared_namespaceObject.PropTypes.string.def(''),
|
681
|
-
// title
|
682
|
-
title: shared_namespaceObject.PropTypes.string.def(''),
|
683
297
|
// 动画类型
|
684
298
|
animateType: shared_namespaceObject.PropTypes.string.def('slide'),
|
685
299
|
// 弹框的渲染方式
|
@@ -688,22 +302,12 @@ var propsMixin = {
|
|
688
302
|
beforeClose: shared_namespaceObject.PropTypes.custom(function () {
|
689
303
|
return true;
|
690
304
|
}),
|
691
|
-
// 对话框类型
|
692
|
-
dialogType: (0,shared_namespaceObject.dialogTypeUnion)(),
|
693
|
-
// 是否允许多个弹框同时存在
|
694
|
-
multiInstance: shared_namespaceObject.PropTypes.bool.def(true),
|
695
|
-
// info-box
|
696
|
-
infoType: shared_namespaceObject.PropTypes.theme(),
|
697
|
-
bodyClass: shared_namespaceObject.PropTypes.string || shared_namespaceObject.PropTypes.array,
|
698
305
|
left: shared_namespaceObject.PropTypes.string,
|
699
|
-
top: shared_namespaceObject.PropTypes.string
|
700
|
-
hiddenDelay: shared_namespaceObject.PropTypes.number.def(200)
|
306
|
+
top: shared_namespaceObject.PropTypes.string
|
701
307
|
};
|
702
308
|
;// CONCATENATED MODULE: ../../packages/modal/src/modal.tsx
|
703
309
|
|
704
310
|
|
705
|
-
|
706
|
-
|
707
311
|
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; }
|
708
312
|
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; }
|
709
313
|
/*
|
@@ -736,239 +340,157 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
736
340
|
|
737
341
|
|
738
342
|
|
343
|
+
|
739
344
|
/* harmony default export */ const modal = ((0,external_vue_namespaceObject.defineComponent)({
|
740
345
|
name: 'Modal',
|
741
346
|
props: _objectSpread({}, propsMixin),
|
742
|
-
emits: ['quick-close', '
|
347
|
+
emits: ['quick-close', 'hidden', 'shown', 'close'],
|
743
348
|
setup: function setup(props, ctx) {
|
744
|
-
var
|
745
|
-
var
|
746
|
-
var
|
747
|
-
var
|
349
|
+
var rootRef = (0,external_vue_namespaceObject.ref)();
|
350
|
+
var maskRef = (0,external_vue_namespaceObject.ref)();
|
351
|
+
var resizeTargetRef = (0,external_vue_namespaceObject.ref)();
|
352
|
+
var localShow = (0,external_vue_namespaceObject.ref)(props.isShow);
|
748
353
|
var zIndex = (0,external_vue_namespaceObject.ref)(props.zIndex);
|
749
|
-
var
|
750
|
-
var
|
751
|
-
var closeTimer;
|
752
|
-
var _useContentResize = useContentResize(refRoot, props),
|
354
|
+
var initRendered = (0,external_vue_namespaceObject.ref)(false);
|
355
|
+
var _useContentResize = useContentResize(rootRef, resizeTargetRef, props),
|
753
356
|
contentStyles = _useContentResize.contentStyles,
|
754
357
|
isContentScroll = _useContentResize.isContentScroll;
|
755
358
|
var modalWrapperStyles = (0,external_vue_namespaceObject.computed)(function () {
|
756
|
-
|
757
|
-
|
758
|
-
};
|
759
|
-
if (props.fullscreen) {
|
760
|
-
return baseStyles;
|
761
|
-
}
|
762
|
-
return Object.assign(baseStyles, _defineProperty({
|
359
|
+
return {
|
360
|
+
zIndex: zIndex.value,
|
763
361
|
width: /^\d+\.?\d*$/.test("".concat(props.width)) ? "".concat(props.width, "px") : props.width,
|
764
362
|
left: props.left,
|
765
363
|
top: props.top
|
766
|
-
}
|
364
|
+
};
|
767
365
|
});
|
768
|
-
var resolveTransfer = function resolveTransfer() {
|
769
|
-
if (props.transfer) {
|
770
|
-
if (typeof props.transfer === 'boolean') {
|
771
|
-
teleportTo.value = (0,shared_namespaceObject.getFullscreenRoot)();
|
772
|
-
return;
|
773
|
-
}
|
774
|
-
teleportTo.value = (0,shared_namespaceObject.getFullscreenRoot)(props.transfer);
|
775
|
-
}
|
776
|
-
};
|
777
366
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
778
367
|
resolveClassName = _usePrefix.resolveClassName;
|
779
|
-
var resolveClosetModal = function resolveClosetModal() {
|
780
|
-
var _refRoot$value;
|
781
|
-
resolveTransfer();
|
782
|
-
if (enableTeleport.value) {
|
783
|
-
if (typeof teleportTo.value === 'string') {
|
784
|
-
var target = document.querySelector(teleportTo.value);
|
785
|
-
target === null || target === void 0 || target.appendChild(refRoot.value);
|
786
|
-
return;
|
787
|
-
}
|
788
|
-
if ((0,shared_namespaceObject.isElement)(teleportTo.value)) {
|
789
|
-
teleportTo.value.appendChild(refRoot.value);
|
790
|
-
return;
|
791
|
-
}
|
792
|
-
}
|
793
|
-
var className = ".".concat(resolveClassName('modal-ctx'));
|
794
|
-
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);
|
795
|
-
if (parentNode) {
|
796
|
-
enableTeleport.value = true;
|
797
|
-
teleportTo.value = 'body';
|
798
|
-
var _target = document.querySelector(teleportTo.value);
|
799
|
-
_target === null || _target === void 0 || _target.appendChild(refRoot.value);
|
800
|
-
}
|
801
|
-
};
|
802
|
-
var close = function close() {
|
803
|
-
if (visible.value) {
|
804
|
-
visible.value = false;
|
805
|
-
shared_namespaceObject.mask.hideMask({
|
806
|
-
el: refRoot.value,
|
807
|
-
mask: refMask.value,
|
808
|
-
showMask: props.showMask,
|
809
|
-
backgroundColor: backgroundColor.value
|
810
|
-
});
|
811
|
-
ctx.emit('hidden');
|
812
|
-
if (enableTeleport.value) {
|
813
|
-
var _refRoot$value2;
|
814
|
-
(_refRoot$value2 = refRoot.value) === null || _refRoot$value2 === void 0 || _refRoot$value2.remove();
|
815
|
-
}
|
816
|
-
}
|
817
|
-
};
|
818
|
-
var closeModal = function closeModal() {
|
819
|
-
shared_namespaceObject.mask.hideMask({
|
820
|
-
el: refRoot.value,
|
821
|
-
mask: refMask.value,
|
822
|
-
showMask: props.showMask,
|
823
|
-
backgroundColor: backgroundColor.value
|
824
|
-
});
|
825
|
-
closeTimer = setTimeout(function () {
|
826
|
-
// 直接设为false会失去离开的动画效果,这里延迟设置
|
827
|
-
ctx.emit('hidden'); // 为false直接触发hidden事件,在上层有200ms的延时
|
828
|
-
if (enableTeleport.value) {
|
829
|
-
var _refRoot$value3;
|
830
|
-
(_refRoot$value3 = refRoot.value) === null || _refRoot$value3 === void 0 || _refRoot$value3.remove();
|
831
|
-
}
|
832
|
-
}, props.hiddenDelay);
|
833
|
-
};
|
834
368
|
(0,external_vue_namespaceObject.watch)(function () {
|
835
369
|
return props.isShow;
|
836
|
-
}, function (
|
837
|
-
if (
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
}
|
843
|
-
visible.value = true;
|
844
|
-
(0,external_vue_namespaceObject.nextTick)(function () {
|
370
|
+
}, function () {
|
371
|
+
if (props.isShow) {
|
372
|
+
initRendered.value = true;
|
373
|
+
setTimeout(function () {
|
374
|
+
zIndex.value = props.zIndex || shared_namespaceObject.bkZIndexManager.getModalNextIndex();
|
375
|
+
props.showMask && mask.showMask(maskRef.value);
|
845
376
|
ctx.emit('shown');
|
846
|
-
|
847
|
-
shared_namespaceObject.mask.showMask({
|
848
|
-
el: refRoot.value,
|
849
|
-
mask: refMask.value,
|
850
|
-
showMask: props.showMask,
|
851
|
-
backgroundColor: backgroundColor.value
|
852
|
-
});
|
377
|
+
localShow.value = true;
|
853
378
|
});
|
854
|
-
|
379
|
+
} else if (initRendered.value) {
|
380
|
+
props.showMask && mask.hideMask(maskRef.value);
|
381
|
+
ctx.emit('hidden');
|
382
|
+
localShow.value = false;
|
855
383
|
}
|
856
|
-
visible.value = false;
|
857
|
-
closeModal();
|
858
384
|
}, {
|
859
385
|
immediate: true
|
860
386
|
});
|
861
|
-
var
|
862
|
-
|
863
|
-
|
864
|
-
return regenerator_default().wrap(function _callee$(_context) {
|
865
|
-
while (1) switch (_context.prev = _context.next) {
|
866
|
-
case 0:
|
867
|
-
if (!(typeof props.beforeClose === 'function')) {
|
868
|
-
_context.next = 12;
|
869
|
-
break;
|
870
|
-
}
|
871
|
-
shouldClose = true;
|
872
|
-
execRet = props.beforeClose();
|
873
|
-
if (!(0,shared_namespaceObject.isPromise)(execRet)) {
|
874
|
-
_context.next = 9;
|
875
|
-
break;
|
876
|
-
}
|
877
|
-
_context.next = 6;
|
878
|
-
return execRet;
|
879
|
-
case 6:
|
880
|
-
shouldClose = _context.sent;
|
881
|
-
_context.next = 10;
|
882
|
-
break;
|
883
|
-
case 9:
|
884
|
-
shouldClose = execRet;
|
885
|
-
case 10:
|
886
|
-
if (!(shouldClose !== true)) {
|
887
|
-
_context.next = 12;
|
888
|
-
break;
|
889
|
-
}
|
890
|
-
return _context.abrupt("return");
|
891
|
-
case 12:
|
892
|
-
callbackFn === null || callbackFn === void 0 || callbackFn();
|
893
|
-
case 13:
|
894
|
-
case "end":
|
895
|
-
return _context.stop();
|
896
|
-
}
|
897
|
-
}, _callee);
|
898
|
-
}));
|
899
|
-
return function handleBeforeClose(_x) {
|
900
|
-
return _ref.apply(this, arguments);
|
901
|
-
};
|
902
|
-
}();
|
387
|
+
var handleClose = function handleClose() {
|
388
|
+
ctx.emit('close');
|
389
|
+
};
|
903
390
|
var handleClickOutSide = function handleClickOutSide(e) {
|
904
391
|
e.stopImmediatePropagation();
|
905
392
|
e.stopPropagation();
|
906
393
|
e.preventDefault();
|
907
394
|
if (props.quickClose) {
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
395
|
+
ctx.emit('quick-close');
|
396
|
+
ctx.emit('close');
|
397
|
+
}
|
398
|
+
};
|
399
|
+
// 按 esc 关闭弹框
|
400
|
+
var handleEscClose = function handleEscClose(e) {
|
401
|
+
if (props.isShow && props.escClose) {
|
402
|
+
if (e.keyCode === 27) {
|
403
|
+
handleClose();
|
404
|
+
}
|
913
405
|
}
|
914
406
|
};
|
407
|
+
(0,external_vue_namespaceObject.onMounted)(function () {
|
408
|
+
addEventListener('keydown', handleEscClose);
|
409
|
+
});
|
915
410
|
(0,external_vue_namespaceObject.onBeforeUnmount)(function () {
|
916
|
-
|
411
|
+
removeEventListener('keydown', handleEscClose);
|
412
|
+
mask.destroyMask(maskRef.value);
|
413
|
+
ctx.emit('hidden');
|
917
414
|
});
|
918
415
|
return {
|
416
|
+
rootRef: rootRef,
|
417
|
+
maskRef: maskRef,
|
418
|
+
localShow: localShow,
|
419
|
+
initRendered: initRendered,
|
919
420
|
zIndex: zIndex,
|
920
|
-
visible: visible,
|
921
421
|
contentStyles: contentStyles,
|
922
422
|
isContentScroll: isContentScroll,
|
923
423
|
modalWrapperStyles: modalWrapperStyles,
|
924
|
-
handleClickOutSide: handleClickOutSide,
|
925
|
-
refRoot: refRoot,
|
926
|
-
refMask: refMask,
|
927
424
|
resolveClassName: resolveClassName,
|
928
|
-
|
425
|
+
resizeTargetRef: resizeTargetRef,
|
426
|
+
handleClose: handleClose,
|
427
|
+
handleClickOutSide: handleClickOutSide
|
929
428
|
};
|
930
429
|
},
|
931
430
|
render: function render() {
|
932
|
-
var _this
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
_this$$slots3,
|
938
|
-
|
939
|
-
_this
|
940
|
-
|
941
|
-
return (0,external_vue_namespaceObject.createVNode)("div", {
|
942
|
-
"ref": "refRoot",
|
943
|
-
"class": _defineProperty(_defineProperty(_defineProperty({}, this.resolveClassName('modal-ctx'), true), '--show', this.visible), '--hide', !this.visible),
|
944
|
-
"style": {
|
945
|
-
zIndex: this.zIndex
|
431
|
+
var _this = this;
|
432
|
+
if (!this.initRendered) {
|
433
|
+
return null;
|
434
|
+
}
|
435
|
+
var renderContent = function renderContent() {
|
436
|
+
var _this$$slots$header, _this$$slots, _this$$slots$default, _this$$slots2, _this$$slots$footer, _this$$slots3, _this$$slots$close, _this$$slots4;
|
437
|
+
// v-if 模式渲染,如果 isShow 为 false 销毁 DOM
|
438
|
+
if (_this.renderDirective === 'if' && !_this.localShow) {
|
439
|
+
return null;
|
946
440
|
}
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
441
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
442
|
+
"class": _this.resolveClassName('modal-body')
|
443
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
444
|
+
"class": _this.resolveClassName('modal-header')
|
445
|
+
}, [(_this$$slots$header = (_this$$slots = _this.$slots).header) === null || _this$$slots$header === void 0 ? void 0 : _this$$slots$header.call(_this$$slots)]), (0,external_vue_namespaceObject.createVNode)("div", {
|
446
|
+
"class": _this.resolveClassName('modal-content'),
|
447
|
+
"style": _this.contentStyles
|
448
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
449
|
+
"style": "position: relative; display: inline-block; width: 100%;"
|
450
|
+
}, [(_this$$slots$default = (_this$$slots2 = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots2), (0,external_vue_namespaceObject.createVNode)("div", {
|
451
|
+
"ref": "resizeTargetRef",
|
452
|
+
"style": "position: absolute; top: 0; bottom: 0;"
|
453
|
+
}, null)])]), (0,external_vue_namespaceObject.createVNode)("div", {
|
454
|
+
"class": _defineProperty(_defineProperty({}, _this.resolveClassName('modal-footer'), true), 'is-fixed', _this.isContentScroll)
|
455
|
+
}, [(_this$$slots$footer = (_this$$slots3 = _this.$slots).footer) === null || _this$$slots$footer === void 0 ? void 0 : _this$$slots$footer.call(_this$$slots3)]), _this.closeIcon && (0,external_vue_namespaceObject.createVNode)("div", {
|
456
|
+
"class": _this.resolveClassName('modal-close'),
|
457
|
+
"onClick": _this.handleClose
|
458
|
+
}, [(_this$$slots$close = (_this$$slots4 = _this.$slots).close) === null || _this$$slots$close === void 0 ? void 0 : _this$$slots$close.call(_this$$slots4)])]);
|
459
|
+
};
|
460
|
+
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Teleport, {
|
461
|
+
"to": "body",
|
462
|
+
"disabled": !this.transfer
|
956
463
|
}, {
|
957
464
|
"default": function _default() {
|
958
|
-
return [
|
959
|
-
"
|
960
|
-
},
|
961
|
-
"class": _this.resolveClassName('modal
|
962
|
-
}, [
|
963
|
-
"
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
465
|
+
return [(0,external_vue_namespaceObject.createVNode)("div", (0,external_vue_namespaceObject.mergeProps)({
|
466
|
+
"ref": "rootRef"
|
467
|
+
}, _this.$attrs, {
|
468
|
+
"class": _this.resolveClassName('modal')
|
469
|
+
}), [_this.showMask && (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Transition, {
|
470
|
+
"name": mask.getMaskCount() > 0 ? 'fadein' : ''
|
471
|
+
}, {
|
472
|
+
"default": function _default() {
|
473
|
+
return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
|
474
|
+
"ref": "maskRef",
|
475
|
+
"class": _defineProperty({}, _this.resolveClassName('modal-ctx-mask'), true),
|
476
|
+
"style": {
|
477
|
+
zIndex: _this.zIndex
|
478
|
+
},
|
479
|
+
"onClick": _this.handleClickOutSide
|
480
|
+
}, null), [[external_vue_namespaceObject.vShow, _this.localShow]])];
|
481
|
+
}
|
482
|
+
}), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Transition, {
|
483
|
+
"name": "modal-".concat(_this.animateType)
|
484
|
+
}, {
|
485
|
+
"default": function _default() {
|
486
|
+
return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
|
487
|
+
"class": _this.resolveClassName('modal-wrapper'),
|
488
|
+
"style": _this.modalWrapperStyles
|
489
|
+
}, [renderContent()]), [[external_vue_namespaceObject.vShow, _this.localShow]])];
|
490
|
+
}
|
491
|
+
})])];
|
970
492
|
}
|
971
|
-
})
|
493
|
+
});
|
972
494
|
}
|
973
495
|
}));
|
974
496
|
;// CONCATENATED MODULE: ../../packages/modal/src/index.ts
|
@@ -1005,8 +527,6 @@ var BkModal = (0,shared_namespaceObject.withInstallProps)(modal, {
|
|
1005
527
|
}, true);
|
1006
528
|
/* harmony default export */ const src = (BkModal);
|
1007
529
|
|
1008
|
-
})();
|
1009
|
-
|
1010
530
|
var __webpack_exports__BkModal = __webpack_exports__.BkModal;
|
1011
531
|
var __webpack_exports__default = __webpack_exports__["default"];
|
1012
532
|
var __webpack_exports__propsMixin = __webpack_exports__.propsMixin;
|