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,CAAC,EAAE,CAAC,WAAW;SAC/C,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC;YACX,SAAS;SACV,CAAC,CAAC;IACL,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE;YACpC,OAAO;SACR;QACD,MAAM,eAAe,mCAChB,sBAAsB,GACtB,IAAI,CAAC,UAAU,CAAC,eAAe,CACnC,CAAC;QAEF,IAAI,CAAC,OAAO,CAAC;YACX,mBAAmB,EAAE,eAAe;SACrC,CAAC,CAAC;IACL,CAAC;IAED,cAAc;QACZ,MAAM,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QAChD,IAAI,mBAAmB,EAAE;YACvB,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;SACzD;IACH,CAAC;IAED,YAAY;QACV,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,YAAY,KAAI,CAAC;CAClB,CAAA;AA5DoB,KAAK;IADzB,WAAW,EAAE;GACO,KAAK,CA4DzB;eA5DoB,KAAK","file":"popup.js","sourcesContent":["import { TdPopupProps } from './type';\nimport { SuperComponent, wxComponent } from '../common/src/index';\nimport config from '../common/config';\nimport props from './props';\nimport { classNames } from '../common/utils';\n\nexport type PopupProps = TdPopupProps;\n\nconst { prefix } = config;\nconst name = `${prefix}-popup`;\nconst defaultTransitionProps = {\n name: `${name}--transition`,\n durations: [300, 300],\n appear: false,\n};\n\n@wxComponent()\nexport default class Popup extends SuperComponent {\n externalClasses = ['t-class', 't-class-overlay', 't-class-content'];\n\n options = {\n multipleSlots: true, // 多slot支持\n styleIsolation: 'shared' as const,\n };\n\n properties = props;\n\n data = {\n prefix,\n classPrefix: name,\n className: name,\n dataTransitionProps: { ...defaultTransitionProps },\n };\n\n lifetimes = {\n attached() {\n this.setClass();\n this.setTransitionProps();\n },\n };\n\n setClass() {\n const { placement, showOverlay } = this.properties;\n const className = classNames(name, 't-class', `${name}--position-${placement}`, {\n [`${name}--overlay-transparent`]: !showOverlay,\n });\n this.setData({\n className,\n });\n }\n\n setTransitionProps() {\n if (!this.properties.transitionProps) {\n return;\n }\n const transitionProps = {\n ...defaultTransitionProps,\n ...this.properties.transitionProps,\n };\n\n this.setData({\n dataTransitionProps: transitionProps,\n });\n }\n\n onOverlayClick() {\n const { closeOnOverlayClick } = this.properties;\n if (closeOnOverlayClick) {\n this.triggerEvent('visible-change', { visible: false });\n }\n }\n\n onCloseClick() {\n this.triggerEvent('visible-change', { visible: false });\n }\n\n preventEvent() {}\n}\n"]}