@aplus-frontend/ui
Version:
2 lines (1 loc) • 3.52 kB
JavaScript
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("@aplus-frontend/antdv"),r=require("@ant-design/icons-vue");require("../../../../config-provider/index.js");const T=require("../sorter/context.js"),b=require("../images/icon_carst_down.svg.js"),B=require("../images/icon_fill_right.svg.js"),w=require("../utils.js"),_=require("../../../../config-provider/hooks/use-namespace.js"),z=require("../../../../config-provider/hooks/use-locale.js"),q=["src"],y=e.defineComponent({__name:"item",props:{value:{},"onUpdate:value":{type:Function},level:{},open:{type:Boolean}},emits:["update:open","update:value"],setup(u,{emit:d}){const t=u,f=d,{b:n,be:c,is:p}=_.useNamespace("sortable-item-meta"),{fixedToLeft:m,fixedToRight:h,unFixed:C}=T.useInjectSorterMethods(),{t:i}=z.useLocale();function s(l){const o=t.value;return o.fixed=l,o.children?.forEach(x=>x.fixed=l),o}function k(){const l=s("left");m(l)}function v(){const l=s("right");h(l)}function V(){const l=s(void 0);C(l)}function g(){f("update:open",!t.open)}function N(){const l=t.value;l.show=!1,l.children?.forEach(o=>o.show=!1)}return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(n)())},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n)("left"))},[e.createVNode(e.unref(r.HolderOutlined),{class:e.normalizeClass(e.unref(c)("left","holder")),style:{"font-size":"16px",color:"#abb7cc"}},null,8,["class"]),e.createElementVNode("span",{class:e.normalizeClass(e.unref(c)("left","indicator")),onClick:g},[l.value.children?.length?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.open?e.unref(B.default):e.unref(b.default)},null,8,q)):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass([e.unref(c)("left","label-wrapper"),e.unref(p)("level2",t.level===2)])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(w.getLabelRenderNode)(l.value.label))))],2)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(n)("right"))},[e.createVNode(e.unref(a.Space),null,{default:e.withCtx(()=>[t.level!==2&&l.value.fixed!=="left"?(e.openBlock(),e.createBlock(e.unref(a.Tooltip),{key:0,title:e.unref(i)("ap.apTable.setting.fixToLeft")},{default:e.withCtx(()=>[e.createVNode(e.unref(r.VerticalAlignTopOutlined),{rotate:270,class:e.normalizeClass(e.unref(n)("action-icon")),onClick:k},null,8,["class"])]),_:1},8,["title"])):e.createCommentVNode("",!0),t.level!==2&&l.value.fixed?(e.openBlock(),e.createBlock(e.unref(a.Tooltip),{key:1,title:e.unref(i)("ap.apTable.setting.unFixed")},{default:e.withCtx(()=>[e.createVNode(e.unref(r.VerticalAlignMiddleOutlined),{class:e.normalizeClass(e.unref(n)("action-icon")),onClick:V},null,8,["class"])]),_:1},8,["title"])):e.createCommentVNode("",!0),t.level!==2&&l.value.fixed!=="right"?(e.openBlock(),e.createBlock(e.unref(a.Tooltip),{key:2,title:e.unref(i)("ap.apTable.setting.fixToRight")},{default:e.withCtx(()=>[e.createVNode(e.unref(r.VerticalAlignTopOutlined),{rotate:90,class:e.normalizeClass(e.unref(n)("action-icon")),onClick:v},null,8,["class"])]),_:1},8,["title"])):e.createCommentVNode("",!0),l.value.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(a.Tooltip),{key:3,title:e.unref(i)("ap.apTable.setting.delete")},{default:e.withCtx(()=>[e.createVNode(e.unref(r.DeleteOutlined),{class:e.normalizeClass(e.unref(n)("action-icon")),onClick:N},null,8,["class"])]),_:1},8,["title"]))]),_:1})],2)],2))}});exports.default=y;