You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 lines
2.7 KiB

{"ast":null,"code":"import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { mutable } from '../../../utils/typescript.mjs';\nimport { isNumber } from '../../../utils/types.mjs';\nimport { isString, isArray } from '@vue/shared';\nimport { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';\nconst emitChangeFn = value => isNumber(value) || isString(value) || isArray(value);\nconst collapseProps = buildProps({\n accordion: Boolean,\n modelValue: {\n type: definePropType([Array, String, Number]),\n default: () => mutable([])\n }\n});\nconst collapseEmits = {\n [UPDATE_MODEL_EVENT]: emitChangeFn,\n [CHANGE_EVENT]: emitChangeFn\n};\nexport { collapseEmits, collapseProps, emitChangeFn };","map":{"version":3,"names":["emitChangeFn","value","isNumber","isString","isArray","collapseProps","buildProps","accordion","Boolean","modelValue","type","definePropType","Array","String","Number","default","mutable","collapseEmits","UPDATE_MODEL_EVENT","CHANGE_EVENT"],"sources":["../../../../../../packages/components/collapse/src/collapse.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isArray,\n isNumber,\n isString,\n mutable,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type { Arrayable } from '@element-plus/utils'\n\nexport type CollapseActiveName = string | number\nexport type CollapseModelValue = Arrayable<CollapseActiveName>\n\nexport const emitChangeFn = (value: CollapseModelValue) =>\n isNumber(value) || isString(value) || isArray(value)\n\nexport const collapseProps = buildProps({\n /**\n * @description whether to activate accordion mode\n */\n accordion: Boolean,\n /**\n * @description currently active panel, the type is `string` in accordion mode, otherwise it is `array`\n */\n modelValue: {\n type: definePropType<CollapseModelValue>([Array, String, Number]),\n default: () => mutable([] as const),\n },\n} as const)\nexport type CollapseProps = ExtractPropTypes<typeof collapseProps>\n\nexport const collapseEmits = {\n [UPDATE_MODEL_EVENT]: emitChangeFn,\n [CHANGE_EVENT]: emitChangeFn,\n}\nexport type CollapseEmits = typeof collapseEmits\n"],"mappings":";;;;;AASY,MAACA,YAAY,GAAIC,KAAK,IAAKC,QAAQ,CAACD,KAAK,CAAC,IAAIE,QAAQ,CAACF,KAAK,CAAC,IAAIG,OAAO,CAACH,KAAK;AAC9E,MAACI,aAAa,GAAGC,UAAU,CAAC;EACtCC,SAAS,EAAEC,OAAO;EAClBC,UAAU,EAAE;IACVC,IAAI,EAAEC,cAAc,CAAC,CAACC,KAAK,EAAEC,MAAM,EAAEC,MAAM,CAAC,CAAC;IAC7CC,OAAO,EAAEA,CAAA,KAAMC,OAAO,CAAC,EAAE;EAC7B;AACA,CAAC;AACW,MAACC,aAAa,GAAG;EAC3B,CAACC,kBAAkB,GAAGlB,YAAY;EAClC,CAACmB,YAAY,GAAGnB;AAClB","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}