oga-ui 1.0.0 → 1.0.2

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/index.es.js CHANGED
@@ -34023,31 +34023,44 @@ var src_default$4 = /* @__PURE__ */ __plugin_vue_export_helper_default(index_vue
34023
34023
  let _r = useModel(x, "modelValue"), Li = (x) => {
34024
34024
  _r.value = x.data.url;
34025
34025
  }, fa = (x) => x.size / 1024 / 1024 > 2 ? (ElMessage.error("Avatar picture size can not exceed 2MB!"), !1) : !0;
34026
- return (Tc, Tl) => {
34026
+ return (Vo, Tl) => {
34027
34027
  let Al = resolveComponent("el-icon"), Ff = resolveComponent("el-upload");
34028
- return openBlock(), createBlock(Ff, {
34029
- class: "oga-avatar",
34028
+ return unref(isEmpty)(_r.value) ? (openBlock(), createBlock(Ff, {
34029
+ key: 0,
34030
34030
  action: x.action,
34031
+ "show-file-list": !1,
34032
+ accept: "image/*",
34031
34033
  style: normalizeStyle({
34032
34034
  "--size": x.size,
34033
34035
  "--radius": x.radius
34034
34036
  }),
34035
- "show-file-list": !1,
34036
- accept: "image/*",
34037
+ class: "oga-avatar",
34037
34038
  "on-success": Li,
34038
34039
  "before-upload": fa
34039
34040
  }, {
34040
- default: withCtx(() => [_r.value ? (openBlock(), createElementBlock("img", {
34041
- key: 0,
34042
- src: _r.value,
34043
- class: "oga-avatar-img",
34044
- alt: ""
34045
- }, null, 8, _hoisted_1$2)) : createCommentVNode("v-if", !0), createVNode(Al, {
34041
+ default: withCtx(() => [createVNode(Al, {
34046
34042
  name: "plus",
34047
34043
  class: normalizeClass(["oga-avatar-icon", unref(isEmpty)(_r.value) ? "is-empty" : ""])
34048
34044
  }, null, 8, ["class"])]),
34049
34045
  _: 1
34050
- }, 8, ["action", "style"]);
34046
+ }, 8, ["action", "style"])) : (openBlock(), createElementBlock("div", {
34047
+ key: 1,
34048
+ class: "oga-avatar",
34049
+ style: normalizeStyle({
34050
+ "--size": x.size,
34051
+ "--radius": x.radius
34052
+ })
34053
+ }, [createElementVNode("div", {
34054
+ class: "oga-avatar-img oga-avatar-delete",
34055
+ onClick: Tl[0] ||= (x) => _r.value = ""
34056
+ }, [createVNode(Al, {
34057
+ name: "delete",
34058
+ class: "oga-avatar-icon is-empty"
34059
+ })]), createElementVNode("img", {
34060
+ src: _r.value,
34061
+ class: "oga-avatar-img",
34062
+ alt: ""
34063
+ }, null, 8, _hoisted_1$2)], 4));
34051
34064
  };
34052
34065
  }
34053
34066
  }), avatar_default = { install(x) {