@web-utils/component 3.4.5 → 3.4.6

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.
@@ -1,25 +1,45 @@
1
- var a = (t, e, l) => new Promise((i, n) => {
1
+ var s = (t, e, l) => new Promise((i, n) => {
2
2
  var p = (o) => {
3
3
  try {
4
- s(l.next(o));
4
+ a(l.next(o));
5
5
  } catch (r) {
6
6
  n(r);
7
7
  }
8
- }, c = (o) => {
8
+ }, u = (o) => {
9
9
  try {
10
- s(l.throw(o));
10
+ a(l.throw(o));
11
11
  } catch (r) {
12
12
  n(r);
13
13
  }
14
- }, s = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(p, c);
15
- s((l = l.apply(t, e)).next());
14
+ }, a = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(p, u);
15
+ a((l = l.apply(t, e)).next());
16
16
  });
17
17
  import d from "element-ui/lib/dialog";
18
- import { dialogDrag as u } from "@web-utils/vue/directives/dialog-drag";
19
- import { getComputedHeight as h, isDef as f } from "@web-utils/core";
20
- import m from "../emulate-form/index.mjs";
21
- import { n as g } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
22
- const y = {
18
+ import { dialogDrag as f } from "@web-utils/vue/directives/dialog-drag";
19
+ import { getComputedHeight as h, isDef as m } from "@web-utils/core";
20
+ import { n as c } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
21
+ const g = {
22
+ name: "EmulateForm",
23
+ provide() {
24
+ return {
25
+ elForm: {
26
+ disabled: !1
27
+ }
28
+ };
29
+ },
30
+ render() {
31
+ return this.$slots.default;
32
+ }
33
+ }, y = null, _ = null;
34
+ var v = /* @__PURE__ */ c(
35
+ g,
36
+ y,
37
+ _,
38
+ !1,
39
+ null,
40
+ null
41
+ );
42
+ const C = v.exports, b = {
23
43
  props: {
24
44
  /**
25
45
  * 对话框是否可见
@@ -87,13 +107,13 @@ const y = {
87
107
  default: "76vh"
88
108
  }
89
109
  }
90
- }, v = {
110
+ }, S = {
91
111
  name: "ElementDialog",
92
- components: { EmulateForm: m },
112
+ components: { EmulateForm: C },
93
113
  directives: {
94
- dialogDrag: u
114
+ dialogDrag: f
95
115
  },
96
- mixins: [...d.mixins || d.default.mixins, y],
116
+ mixins: [...d.mixins || d.default.mixins, b],
97
117
  props: {
98
118
  /**
99
119
  * 对话框标题
@@ -215,7 +235,7 @@ const y = {
215
235
  },
216
236
  watch: {
217
237
  visible(t) {
218
- return a(this, null, function* () {
238
+ return s(this, null, function* () {
219
239
  t ? (this.closed = !1, this.$emit("open"), this.$el.addEventListener("scroll", this.updatePopper), yield this.$nextTick(), this.$refs.dialog.scrollTop = 0, yield this.computeTop(), this.appendToBody && document.body.appendChild(this.$el)) : (this.$el.removeEventListener("scroll", this.updatePopper), this.closed || this.$emit("close"));
220
240
  });
221
241
  },
@@ -227,7 +247,7 @@ const y = {
227
247
  this.$watch(() => ({ offsetTop: this.offsetTop, verticalCenter: this.verticalCenter, top: this.top }), this.computeTop, { deep: !0 });
228
248
  },
229
249
  mounted() {
230
- return a(this, null, function* () {
250
+ return s(this, null, function* () {
231
251
  this.visible && (this.rendered = !0, this.open(), yield this.computeTop(), this.appendToBody && document.body.appendChild(this.$el));
232
252
  });
233
253
  },
@@ -236,8 +256,8 @@ const y = {
236
256
  },
237
257
  methods: {
238
258
  computeTop() {
239
- return a(this, null, function* () {
240
- yield this.$nextTick(), this.verticalCenter ? this.marginTop = `${(document.body.offsetHeight - h(this.$refs.dialog)) / 2 + (f(this.offsetTop) ? this.offsetTop : 0)}px` : this.marginTop = this.top;
259
+ return s(this, null, function* () {
260
+ yield this.$nextTick(), this.verticalCenter ? this.marginTop = `${(document.body.offsetHeight - h(this.$refs.dialog)) / 2 + (m(this.offsetTop) ? this.offsetTop : 0)}px` : this.marginTop = this.top;
241
261
  });
242
262
  },
243
263
  toggleFullScreen() {
@@ -273,7 +293,7 @@ const y = {
273
293
  }
274
294
  }
275
295
  };
276
- var C = function() {
296
+ var $ = function() {
277
297
  var e = this, l = e._self._c;
278
298
  return l("Transition", { attrs: { name: "dialog-fade" }, on: { "after-enter": e.afterEnter, "after-leave": e.afterLeave } }, [l("div", { directives: [{ name: "show", rawName: "v-show", value: e.visible, expression: "visible" }, { name: "dialog-drag", rawName: "v-dialog-drag:[fullScreen]", value: { onMove: e.updatePopper }, expression: "{ onMove: updatePopper }", arg: e.fullScreen }], staticClass: "el-dialog__wrapper", on: { click: function(i) {
279
299
  return i.target !== i.currentTarget ? null : e.handleWrapperClick.apply(null, arguments);
@@ -292,16 +312,16 @@ var C = function() {
292
312
  e.customClass
293
313
  ], style: e.style, attrs: { role: "dialog", "aria-modal": "true", "aria-label": e.title || "dialog" } }, [l("div", { staticClass: "el-dialog__header" }, [e._t("title", function() {
294
314
  return [l("span", { staticClass: "el-dialog__title" }, [e._v(e._s(e.title))])];
295
- }), l("div", { staticClass: "header-button-wrapper" }, [l("EmulateForm", [e._t("header-button"), e.showFullScreen ? l("ElButton", { staticClass: "header-button", attrs: { disabled: !1, type: "text", icon: e.fullScreen ? "el-icon-copy-document" : "el-icon-full-screen", size: "medium", title: e.fullScreen ? "还原" : "最大化" }, on: { click: e.toggleFullScreen } }) : e._e(), e.showClose ? l("ElButton", { staticClass: "header-button header-dialog-close", attrs: { disabled: !1, "aria-label": "Close", type: "text", title: "关闭", icon: "el-icon-close", size: "medium" }, on: { click: e.handleClose } }) : e._e()], 2)], 1)], 2), e.rendered ? l("div", { staticClass: "el-dialog__body", style: { height: e.fullScreen ? "100%" : e.height } }, [e.destroyOnClose ? [e.visible ? e._t("default") : e._e()] : e._t("default")], 2) : e._e(), e.shouldShowFooter() ? l("div", { staticClass: "el-dialog__footer" }, [e._t("footer", null, { handleClose: e.handleClose })], 2) : e._e()])])]);
296
- }, _ = [], b = /* @__PURE__ */ g(
297
- v,
298
- C,
299
- _,
315
+ }), l("EmulateForm", [l("div", { staticClass: "header-button-wrapper" }, [e._t("header-button"), e.showFullScreen ? l("ElButton", { staticClass: "header-button", attrs: { disabled: !1, type: "text", icon: e.fullScreen ? "el-icon-copy-document" : "el-icon-full-screen", size: "medium", title: e.fullScreen ? "还原" : "最大化" }, on: { click: e.toggleFullScreen } }) : e._e(), e.showClose ? l("ElButton", { staticClass: "header-button header-dialog-close", attrs: { disabled: !1, "aria-label": "Close", type: "text", title: "关闭", icon: "el-icon-close", size: "medium" }, on: { click: e.handleClose } }) : e._e()], 2)])], 2), e.rendered ? l("div", { staticClass: "el-dialog__body", style: { height: e.fullScreen ? "100%" : e.height } }, [e.destroyOnClose ? [e.visible ? e._t("default") : e._e()] : e._t("default")], 2) : e._e(), e.shouldShowFooter() ? l("div", { staticClass: "el-dialog__footer" }, [e._t("footer", null, { handleClose: e.handleClose })], 2) : e._e()])])]);
316
+ }, w = [], x = /* @__PURE__ */ c(
317
+ S,
318
+ $,
319
+ w,
300
320
  !1,
301
321
  null,
302
322
  null
303
323
  );
304
- const F = b.exports;
324
+ const P = x.exports;
305
325
  export {
306
- F as default
326
+ P as default
307
327
  };