acdr-ui/dist/dev/mp-weixin/node-modules/wot-design-uni/components/wd-popover/wd-popover.js.map

1 line
7.8 KiB
Plaintext

{"version":3,"file":"wd-popover.js","sources":["../../../../../../../node_modules/wot-design-uni/components/wd-popover/wd-popover.vue","../../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL25vZGVfbW9kdWxlcy93b3QtZGVzaWduLXVuaS9jb21wb25lbnRzL3dkLXBvcG92ZXIvd2QtcG9wb3Zlci52dWU"],"sourcesContent":["<template>\n <view :class=\"`wd-popover ${customClass}`\" :style=\"customStyle\" id=\"popover\" @click.stop=\"popover.noop\">\n <!-- TODO 插槽情况监听会有问题 待调整, 用于为渲染获取宽高的元素 -->\n <view class=\"wd-popover__pos wd-popover__hidden\" id=\"pos\">\n <view :class=\"`wd-popover__container ${customPop}`\">\n <view v-if=\"!useContentSlot && mode === 'normal'\" class=\"wd-popover__inner\">\n {{ content }}\n </view>\n <view v-if=\"!useContentSlot && mode === 'menu' && typeof content === 'object'\" class=\"wd-popover__menu\">\n <view v-for=\"(item, index) in content\" :key=\"index\" class=\"wd-popover__menu-inner\" @click=\"menuClick(index)\">\n <wd-icon v-if=\"item.iconClass\" :name=\"item.iconClass\" custom-class=\"wd-popover__icon\" />\n <text>{{ item.content }}</text>\n </view>\n </view>\n </view>\n </view>\n <wd-transition custom-class=\"wd-popover__pos\" :custom-style=\"popover.popStyle.value\" :show=\"modelValue\" name=\"fade\" :duration=\"200\">\n <view :class=\"`wd-popover__container ${customPop}`\">\n <view\n v-if=\"props.visibleArrow\"\n :class=\"`wd-popover__arrow ${popover.arrowClass.value} ${customArrow}`\"\n :style=\"popover.arrowStyle.value\"\n ></view>\n <!-- 普通模式 -->\n <view v-if=\"!useContentSlot && mode === 'normal'\" class=\"wd-popover__inner\">\n {{ content }}\n </view>\n <!-- 列表模式 -->\n <view v-if=\"!useContentSlot && mode === 'menu'\" class=\"wd-popover__menu\">\n <view\n v-for=\"(item, index) in content\"\n :key=\"index\"\n class=\"wd-popover__menu-inner\"\n @click=\"menuClick(index)\"\n :style=\"index === 0 ? 'border-top: none' : ''\"\n >\n <wd-icon v-if=\"typeof item === 'object' && item.iconClass\" :name=\"item.iconClass\" custom-class=\"wd-popover__icon\" />\n <view style=\"display: inline-block\">{{ typeof item === 'object' && item.content ? item.content : '' }}</view>\n </view>\n </view>\n <!-- 用户自定义样式 -->\n <slot name=\"content\" v-else />\n </view>\n <wd-icon v-if=\"showClose\" name=\"close\" custom-class=\"wd-popover__close-icon\" @click=\"toggle\"></wd-icon>\n </wd-transition>\n <view @click=\"toggle\" class=\"wd-popover__target\" id=\"target\">\n <slot />\n </view>\n </view>\n</template>\n\n<script lang=\"ts\">\nexport default {\n name: 'wd-popover',\n options: {\n virtualHost: true,\n addGlobalClass: true,\n styleIsolation: 'shared'\n }\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport { getCurrentInstance, inject, onBeforeMount, onBeforeUnmount, onMounted, watch } from 'vue'\nimport { usePopover } from '../composables/usePopover'\nimport { closeOther, pushToQueue, removeFromQueue } from '../common/clickoutside'\nimport { type Queue, queueKey } from '../composables/useQueue'\nimport { popoverProps, type PopoverExpose } from './types'\nimport { isArray } from '../common/util'\n\nconst props = defineProps(popoverProps)\nconst emit = defineEmits(['update:modelValue', 'menuclick', 'change', 'open', 'close'])\n\nconst queue = inject<Queue | null>(queueKey, null)\n\nconst selector: string = 'popover'\nconst { proxy } = getCurrentInstance() as any\n\nwatch(\n () => props.content,\n (newVal) => {\n const { mode } = props\n if (selector === 'popover' && mode === 'normal' && typeof newVal !== 'string') {\n console.error('The value type must be a string type in normal mode')\n } else if (selector === 'popover' && mode === 'menu' && !isArray(newVal)) {\n console.error('The value type must be a Array type in menu mode')\n }\n }\n)\n\nwatch(\n () => props.placement,\n () => {\n popover.init(props.placement, props.visibleArrow, selector)\n }\n)\n\nwatch(\n () => props.modelValue,\n (newValue) => {\n if (newValue) {\n popover.control(props.placement, props.offset)\n if (queue && queue.closeOther) {\n queue.closeOther(proxy)\n } else {\n closeOther(proxy)\n }\n }\n popover.showStyle.value = newValue ? 'display: inline-block;' : 'display: none;'\n emit('change', { show: newValue })\n emit(`${newValue ? 'open' : 'close'}`)\n }\n)\n\nonMounted(() => {\n popover.init(props.placement, props.visibleArrow, selector)\n})\n\nonBeforeMount(() => {\n if (queue && queue.pushToQueue) {\n queue.pushToQueue(proxy)\n } else {\n pushToQueue(proxy)\n }\n popover.showStyle.value = props.modelValue ? 'opacity: 1;' : 'opacity: 0;'\n})\n\nonBeforeUnmount(() => {\n if (queue && queue.removeFromQueue) {\n queue.removeFromQueue(proxy)\n } else {\n removeFromQueue(proxy)\n }\n})\n\nconst popover = usePopover()\n\nfunction menuClick(index: number) {\n emit('update:modelValue', false)\n emit('menuclick', {\n item: (props.content as Array<Record<string, any>>)[index],\n index\n })\n}\n\nfunction toggle() {\n if (props.disabled) return\n emit('update:modelValue', !props.modelValue)\n}\n\nfunction open() {\n emit('update:modelValue', true)\n}\n\nfunction close() {\n emit('update:modelValue', false)\n}\n\ndefineExpose<PopoverExpose>({\n open,\n close\n})\n</script>\n<style lang=\"scss\" scoped>\n@import './index.scss';\n</style>\n","import Component from 'D:/App/Work/addr/acdr-ui/node_modules/wot-design-uni/components/wd-popover/wd-popover.vue'\nwx.createComponent(Component)"],"names":["inject","queueKey","getCurrentInstance","watch","isArray","closeOther","onMounted","onBeforeMount","pushToQueue","onBeforeUnmount","removeFromQueue","usePopover"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAA,cAAe;AAAA,EACb,MAAM;AAAA,EACN,SAAS;AAAA,IACP,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,EAClB;AACF;;;;;AAWA,UAAM,QAAQ;AACd,UAAM,OAAO;AAEP,UAAA,QAAQA,cAAAA,OAAqBC,cAAA,UAAU,IAAI;AAEjD,UAAM,WAAmB;AACnB,UAAA,EAAE,UAAUC,cAAAA;AAElBC,kBAAA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