acdr-ui/dist/build/mp-weixin/node-modules/wot-design-uni/components/wd-action-sheet/wd-action-sheet.js

2 lines
3.2 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";var e=Object.defineProperty,o=Object.defineProperties,t=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(o,t,n)=>t in o?e(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n;const s=require("../../../../common/vendor.js");if(!Array){(s.resolveComponent("wd-icon")+s.resolveComponent("wd-loading")+s.resolveComponent("wd-popup"))()}Math||((()=>"../wd-icon/wd-icon.js")+(()=>"../wd-loading/wd-loading.js")+(()=>"../wd-popup/wd-popup.js"))();const i=s.defineComponent((d=((e,o)=>{for(var t in o||(o={}))a.call(o,t)&&c(e,t,o[t]);if(n)for(var t of n(o))l.call(o,t)&&c(e,t,o[t]);return e})({},{name:"wd-action-sheet",options:{addGlobalClass:!0,virtualHost:!0,styleIsolation:"shared"}}),r={props:s.actionSheetProps,emits:["select","click-modal","cancel","closed","close","open","opened","update:modelValue"],setup(e,{emit:o}){const t=e,n=o,a=s.ref([]),l=s.ref(!1);function c(){return t.panels.length&&!s.isArray(t.panels[0])}function i(e,o,a){"action"===o?n("select",{item:t.actions[e],index:e}):c()?n("select",{item:t.panels[Number(a)],index:a}):n("select",{item:t.panels[e][Number(a)],rowIndex:e,colIndex:a}),p()}function d(){n("click-modal"),t.closeOnClickModal&&p()}function r(){n("cancel"),p()}function p(){n("update:modelValue",!1),n("close")}function u(){n("open")}function m(){n("opened")}function b(){n("closed")}return s.watch((()=>t.panels),(function(){a.value=c()?[t.panels]:t.panels}),{deep:!0,immediate:!0}),s.watch((()=>t.modelValue),(e=>{l.value=e}),{deep:!0,immediate:!0}),(e,o)=>s.e({a:e.title},e.title?{b:s.t(e.title),c:s.o(p),d:s.p({"custom-class":"wd-action-sheet__close",name:"add"}),e:s.n(`wd-action-sheet__header ${e.customHeaderClass}`)}:{},{f:e.actions&&e.actions.length},e.actions&&e.actions.length?{g:s.f(e.actions,((e,o,t)=>s.e({a:e.loading},e.loading?{b:"87c5dd9b-2-"+t+",87c5dd9b-0",c:s.p({size:"20px"})}:{d:s.t(e.name)},{e:!e.loading&&e.subname},!e.loading&&e.subname?{f:s.t(e.subname)}:{},{g:o,h:s.n(`wd-action-sheet__action ${e.disabled?"wd-action-sheet__action--disabled":""} ${e.loading?"wd-action-sheet__action--loading":""}`),i:s.s(`color: ${e.color}`),j:s.o((e=>i(o,"action")),o)})))}:{},{h:a.value&&a.value.length},a.value&&a.value.length?{i:s.f(a.value,((e,o,t)=>({a:s.f(e,((e,t,n)=>({a:e.iconUrl,b:s.t(e.title),c:t,d:s.o((e=>i(o,"panels",t)),t)}))),b:o})))}:{},{j:e.cancelText},e.cancelText?{k:s.t(e.cancelText),l:s.o(r)}:{},{m:s.n(`wd-action-sheet ${e.customClass}`),n:s.s(`${e.actions&&e.actions.length||e.panels&&e.panels.length?"margin: 0 10px calc(var(--window-bottom) + 10px) 10px; border-radius: 16px;":"margin-bottom: var(--window-bottom);"} ${e.customStyle}`),o:s.o(u),p:s.o(p),q:s.o(m),r:s.o(b),s:s.o(d),t:s.o((e=>l.value=e)),v:s.p({"custom-class":"wd-action-sheet__popup","custom-style":e.actions&&e.actions.length||e.panels&&e.panels.length?"background: transparent;":"",duration:e.duration,position:"bottom","close-on-click-modal":e.closeOnClickModal,"safe-area-inset-bottom":e.safeAreaInsetBottom,"lazy-render":e.lazyRender,"z-index":e.zIndex,modelValue:l.value})})}},o(d,t(r))));var d,r;const p=s._export_sfc(i,[["__scopeId","data-v-87c5dd9b"]]);wx.createComponent(p);