1 |
- {"version":3,"sources":["../src/loading/loading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAC;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAK7C,MAAM,WAAW,YAAa,SAAQ,cAAc;CAAG;AAEvD,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,cAAc;IACjD,eAAe,WAA4E;IAE3F,IAAI;;;;MAIF;IAEF,OAAO;;MAEL;IAEF,UAAU,iBAAS;IAEnB,KAAK,MAAQ;IAEb,SAAS;;MAmBP;IAEF,SAAS;;MAIP;IAEF,WAAW;CAGZ","file":"loading.d.ts","sourcesContent":["import { SuperComponent, wxComponent } from '../common/src/index';\nimport config from '../common/config';\nimport props from './props';\nimport type { TdLoadingProps } from './type';\n\nconst { prefix } = config;\nconst name = `${prefix}-loading`;\n\nexport interface LoadingProps extends TdLoadingProps {}\n@wxComponent()\nexport default class Loading extends SuperComponent {\n externalClasses = [`${prefix}-class`, `${prefix}-class-text`, `${prefix}-class-indicator`];\n\n data = {\n prefix,\n classPrefix: name,\n show: true,\n };\n\n options = {\n multipleSlots: true,\n };\n\n properties = props;\n\n timer = null;\n\n observers = {\n loading(this, cur) {\n const { delay } = this.properties;\n if (this.timer) {\n clearTimeout(this.timer);\n }\n if (cur) {\n if (delay) {\n this.timer = setTimeout(() => {\n this.setData({ show: cur });\n this.timer = null;\n }, delay);\n } else {\n this.setData({ show: cur });\n }\n } else {\n this.setData({ show: cur });\n }\n },\n };\n\n lifetimes = {\n detached() {\n clearTimeout(this.timer);\n },\n };\n\n refreshPage() {\n this.triggerEvent('reload');\n }\n}\n"]}
|