1 |
- {"version":3,"sources":["../src/dialog/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAC;AAQlE,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,cAAc;IAChD,OAAO;;;MAGL;IAEF,eAAe,WAMb;IAEF,UAAU,iCAAS;IAEnB,IAAI;;;MAGF;IAEF,OAAO;;;;;;uBAuCU,GAAG;;;MAiBlB;CACH","file":"dialog.d.ts","sourcesContent":["import { SuperComponent, wxComponent } from '../common/src/index';\nimport config from '../common/config';\nimport props from './props';\n\nconst { prefix } = config;\nconst name = `${prefix}-dialog`;\n\n@wxComponent()\nexport default class Dialog extends SuperComponent {\n options = {\n multipleSlots: true, // 在组件定义时的选项中启用多slot支持\n addGlobalClass: true,\n };\n\n externalClasses = [\n `${prefix}-class`,\n `${prefix}-class-content`,\n `${prefix}-class-confirm`,\n `${prefix}-class-cancel`,\n `${prefix}-class-action`,\n ];\n\n properties = props;\n\n data = {\n prefix,\n classPrefix: name,\n };\n\n methods = {\n onTplButtonTap(e) {\n const evtType = e.type;\n const { type } = e.target.dataset;\n\n if (`bind${evtType}` in this.data[`${type}Btn`]) {\n this.data[`${type}Btn`][`bind${evtType}`](e.detail);\n }\n },\n\n onConfirm() {\n this.triggerEvent('confirm');\n if (this._onComfirm) {\n this._onComfirm();\n this.close();\n }\n },\n\n onCancel() {\n this.triggerEvent('close', { trigger: 'cancel' });\n this.triggerEvent('cancel');\n\n if (this._onCancel) {\n this._onCancel();\n this.close();\n }\n },\n\n close() {\n this.setData({ visible: false });\n },\n\n overlayClick() {\n if (this.properties.closeOnOverlayClick) {\n this.triggerEvent('close', { trigger: 'overlay' });\n }\n this.triggerEvent('overlayClick');\n },\n\n onActionTap(e: any) {\n const { index } = e.currentTarget.dataset;\n\n this.triggerEvent('action', { index });\n if (this._onAction) {\n this._onAction({ index });\n this.close();\n }\n },\n\n openValueCBHandle(e) {\n this.triggerEvent('open-type-event', e.detail);\n },\n\n openValueErrCBHandle(e) {\n this.triggerEvent('open-type-error-event', e.detail);\n },\n };\n}\n"]}
|