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I,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;iBAC7B;YACH,CAAC;SACF,CAAC;QAEF,cAAS,GAAG;YACV,QAAQ;gBACN,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;SACF,CAAC;IAKJ,CAAC;IAHC,WAAW;QACT,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;CACF,CAAA;AA/CoB,OAAO;IAD3B,WAAW,EAAE;GACO,OAAO,CA+C3B;eA/CoB,OAAO","file":"loading.js","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"]}
|