1 |
- {"version":3,"sources":["../src/skeleton/skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAC;AASlE,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,cAAc;IAClD,eAAe,WAAiD;IAEhE,UAAU,mCAAS;IAEnB,SAAS;;MAuBP;IAEF,IAAI;;;;MAIF;CACH","file":"skeleton.d.ts","sourcesContent":["import { SuperComponent, wxComponent } from '../common/src/index';\nimport config from '../common/config';\nimport props from './props';\nimport { isNumber } from '../common/utils';\n\nconst { prefix } = config;\nconst name = `${prefix}-skeleton`;\n\n@wxComponent()\nexport default class Skeleton extends SuperComponent {\n externalClasses = ['t-class', 't-class-avatar', 't-class-text'];\n\n properties = props;\n\n observers = {\n rowCol(this, val) {\n const rowStyles = [];\n const isNumList = [];\n if (Array.isArray(val)) {\n val.forEach((v) => {\n if (isNumber(v)) {\n const curArr = [];\n const defaultWidth = `${(686 - 32 * (v - 1)) / v}rpx`;\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < v; i++) {\n curArr.push({ width: defaultWidth, height: '32rpx' });\n }\n rowStyles.push(curArr);\n isNumList.push(true);\n } else {\n rowStyles.push(Array.isArray(v) ? v : [v]);\n isNumList.push(false);\n }\n });\n }\n this.setData({ rowStyles, isNumList });\n },\n };\n\n data = {\n classPrefix: name,\n isNumList: [],\n rowStyles: [],\n };\n}\n"]}
|