index.js 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
  2. const require_runtime = require('../../../_virtual/_rolldown/runtime.js');
  3. const require__plugin_vue_export_helper = require('../../../_virtual/_plugin-vue_export-helper.js');
  4. const require_index_vue_vue_type_script_lang = require('./index.vue_vue_type_script_lang.js');
  5. let vue = require("vue");
  6. //#region ../../packages/components/message-box/src/index.vue
  7. const _hoisted_1 = ["aria-label", "aria-describedby"];
  8. const _hoisted_2 = ["aria-label"];
  9. const _hoisted_3 = ["id"];
  10. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  11. const _component_el_icon = (0, vue.resolveComponent)("el-icon");
  12. const _component_el_input = (0, vue.resolveComponent)("el-input");
  13. const _component_el_button = (0, vue.resolveComponent)("el-button");
  14. const _component_el_focus_trap = (0, vue.resolveComponent)("el-focus-trap");
  15. const _component_el_overlay = (0, vue.resolveComponent)("el-overlay");
  16. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, {
  17. name: "fade-in-linear",
  18. onAfterLeave: _cache[11] || (_cache[11] = ($event) => _ctx.$emit("vanish")),
  19. persisted: ""
  20. }, {
  21. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createVNode)(_component_el_overlay, {
  22. "z-index": _ctx.zIndex,
  23. "overlay-class": [_ctx.ns.is("message-box"), _ctx.modalClass],
  24. mask: _ctx.modal
  25. }, {
  26. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  27. role: "dialog",
  28. "aria-label": _ctx.title,
  29. "aria-modal": "true",
  30. "aria-describedby": !_ctx.showInput ? _ctx.contentId : void 0,
  31. class: (0, vue.normalizeClass)(`${_ctx.ns.namespace.value}-overlay-message-box`),
  32. onClick: _cache[8] || (_cache[8] = (...args) => _ctx.overlayEvent.onClick && _ctx.overlayEvent.onClick(...args)),
  33. onMousedown: _cache[9] || (_cache[9] = (...args) => _ctx.overlayEvent.onMousedown && _ctx.overlayEvent.onMousedown(...args)),
  34. onMouseup: _cache[10] || (_cache[10] = (...args) => _ctx.overlayEvent.onMouseup && _ctx.overlayEvent.onMouseup(...args))
  35. }, [(0, vue.createVNode)(_component_el_focus_trap, {
  36. loop: "",
  37. trapped: _ctx.visible,
  38. "focus-trap-el": _ctx.rootRef,
  39. "focus-start-el": _ctx.focusStartRef,
  40. onReleaseRequested: _ctx.onCloseRequested
  41. }, {
  42. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  43. ref: "rootRef",
  44. class: (0, vue.normalizeClass)([
  45. _ctx.ns.b(),
  46. _ctx.customClass,
  47. _ctx.ns.is("draggable", _ctx.draggable),
  48. _ctx.ns.is("dragging", _ctx.isDragging),
  49. { [_ctx.ns.m("center")]: _ctx.center }
  50. ]),
  51. style: (0, vue.normalizeStyle)(_ctx.customStyle),
  52. tabindex: "-1",
  53. onClick: _cache[7] || (_cache[7] = (0, vue.withModifiers)(() => {}, ["stop"]))
  54. }, [
  55. _ctx.title !== null && _ctx.title !== void 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  56. key: 0,
  57. ref: "headerRef",
  58. class: (0, vue.normalizeClass)([_ctx.ns.e("header"), { "show-close": _ctx.showClose }])
  59. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("title")) }, [_ctx.iconComponent && _ctx.center ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  60. key: 0,
  61. class: (0, vue.normalizeClass)([_ctx.ns.e("status"), _ctx.typeClass])
  62. }, {
  63. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.iconComponent)))]),
  64. _: 1
  65. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(_ctx.title), 1)], 2), _ctx.showClose ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  66. key: 0,
  67. type: "button",
  68. class: (0, vue.normalizeClass)(_ctx.ns.e("headerbtn")),
  69. "aria-label": _ctx.t("el.messagebox.close"),
  70. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel")),
  71. onKeydown: _cache[1] || (_cache[1] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"]))
  72. }, [(0, vue.createVNode)(_component_el_icon, { class: (0, vue.normalizeClass)(_ctx.ns.e("close")) }, {
  73. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.closeIcon || "close")))]),
  74. _: 1
  75. }, 8, ["class"])], 42, _hoisted_2)) : (0, vue.createCommentVNode)("v-if", true)], 2)) : (0, vue.createCommentVNode)("v-if", true),
  76. (0, vue.createElementVNode)("div", {
  77. id: _ctx.contentId,
  78. class: (0, vue.normalizeClass)(_ctx.ns.e("content"))
  79. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("container")) }, [_ctx.iconComponent && !_ctx.center && _ctx.hasMessage ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  80. key: 0,
  81. class: (0, vue.normalizeClass)([_ctx.ns.e("status"), _ctx.typeClass])
  82. }, {
  83. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.iconComponent)))]),
  84. _: 1
  85. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true), _ctx.hasMessage ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  86. key: 1,
  87. class: (0, vue.normalizeClass)(_ctx.ns.e("message"))
  88. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [!_ctx.dangerouslyUseHTMLString ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.showInput ? "label" : "p"), {
  89. key: 0,
  90. for: _ctx.showInput ? _ctx.inputId : void 0,
  91. textContent: (0, vue.toDisplayString)(_ctx.message)
  92. }, null, 8, ["for", "textContent"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.showInput ? "label" : "p"), {
  93. key: 1,
  94. for: _ctx.showInput ? _ctx.inputId : void 0,
  95. innerHTML: _ctx.message
  96. }, null, 8, ["for", "innerHTML"]))])], 2)) : (0, vue.createCommentVNode)("v-if", true)], 2), (0, vue.withDirectives)((0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("input")) }, [(0, vue.createVNode)(_component_el_input, {
  97. id: _ctx.inputId,
  98. ref: "inputRef",
  99. modelValue: _ctx.inputValue,
  100. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.inputValue = $event),
  101. type: _ctx.inputType,
  102. placeholder: _ctx.inputPlaceholder,
  103. "aria-invalid": _ctx.validateError,
  104. class: (0, vue.normalizeClass)({ invalid: _ctx.validateError }),
  105. onKeydown: (0, vue.withKeys)(_ctx.handleInputEnter, ["enter"])
  106. }, null, 8, [
  107. "id",
  108. "modelValue",
  109. "type",
  110. "placeholder",
  111. "aria-invalid",
  112. "class",
  113. "onKeydown"
  114. ]), (0, vue.createElementVNode)("div", {
  115. class: (0, vue.normalizeClass)(_ctx.ns.e("errormsg")),
  116. style: (0, vue.normalizeStyle)({ visibility: !!_ctx.editorErrorMessage ? "visible" : "hidden" })
  117. }, (0, vue.toDisplayString)(_ctx.editorErrorMessage), 7)], 2), [[vue.vShow, _ctx.showInput]])], 10, _hoisted_3),
  118. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("btns")) }, [_ctx.showCancelButton ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_button, {
  119. key: 0,
  120. type: _ctx.cancelButtonType === "text" ? "" : _ctx.cancelButtonType,
  121. text: _ctx.cancelButtonType === "text",
  122. loading: _ctx.cancelButtonLoading,
  123. "loading-icon": _ctx.cancelButtonLoadingIcon,
  124. class: (0, vue.normalizeClass)([_ctx.cancelButtonClass]),
  125. round: _ctx.roundButton,
  126. size: _ctx.btnSize,
  127. onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleAction("cancel")),
  128. onKeydown: _cache[4] || (_cache[4] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => _ctx.handleAction("cancel"), ["prevent"]), ["enter"]))
  129. }, {
  130. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(_ctx.cancelButtonText || _ctx.t("el.messagebox.cancel")), 1)]),
  131. _: 1
  132. }, 8, [
  133. "type",
  134. "text",
  135. "loading",
  136. "loading-icon",
  137. "class",
  138. "round",
  139. "size"
  140. ])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.withDirectives)((0, vue.createVNode)(_component_el_button, {
  141. ref: "confirmRef",
  142. type: _ctx.confirmButtonType === "text" ? "" : _ctx.confirmButtonType,
  143. text: _ctx.confirmButtonType === "text",
  144. loading: _ctx.confirmButtonLoading,
  145. "loading-icon": _ctx.confirmButtonLoadingIcon,
  146. class: (0, vue.normalizeClass)([_ctx.confirmButtonClasses]),
  147. round: _ctx.roundButton,
  148. disabled: _ctx.confirmButtonDisabled,
  149. size: _ctx.btnSize,
  150. onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleAction("confirm")),
  151. onKeydown: _cache[6] || (_cache[6] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => _ctx.handleAction("confirm"), ["prevent"]), ["enter"]))
  152. }, {
  153. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(_ctx.confirmButtonText || _ctx.t("el.messagebox.confirm")), 1)]),
  154. _: 1
  155. }, 8, [
  156. "type",
  157. "text",
  158. "loading",
  159. "loading-icon",
  160. "class",
  161. "round",
  162. "disabled",
  163. "size"
  164. ]), [[vue.vShow, _ctx.showConfirmButton]])], 2)
  165. ], 6)]),
  166. _: 3
  167. }, 8, [
  168. "trapped",
  169. "focus-trap-el",
  170. "focus-start-el",
  171. "onReleaseRequested"
  172. ])], 42, _hoisted_1)]),
  173. _: 3
  174. }, 8, [
  175. "z-index",
  176. "overlay-class",
  177. "mask"
  178. ]), [[vue.vShow, _ctx.visible]])]),
  179. _: 3
  180. });
  181. }
  182. var src_default = /* @__PURE__ */ require__plugin_vue_export_helper.default(require_index_vue_vue_type_script_lang.default, [["render", _sfc_render]]);
  183. //#endregion
  184. exports.default = src_default;
  185. //# sourceMappingURL=index.js.map