Files
game-cards-poker-design/frontend/node_modules/element-plus/es/utils/vue/props/runtime.mjs.map
Poker Design Developer 5dbcebf7a2 Fix frontend blank page issues
- Fix router import path in main.js
- Handle Django REST Framework pagination format in API calls
- Add getTemplates function to project API
- Restart frontend development server
2026-05-31 18:40:56 +08:00

1 line
4.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../../../packages/utils/vue/props/runtime.ts"],"sourcesContent":["import { warn } from 'vue'\nimport { fromPairs } from 'lodash-unified'\nimport { isObject } from '../../types'\nimport { hasOwn } from '../../objects'\n\nimport type { PropType } from 'vue'\nimport type {\n EpProp,\n EpPropConvert,\n EpPropFinalized,\n EpPropInput,\n EpPropMergeType,\n IfEpProp,\n IfNativePropType,\n NativePropType,\n} from './types'\n\nexport const epPropKey = '__epPropKey'\n\nexport const definePropType = <T>(val: any): PropType<T> => val\n\nexport const isEpProp = (val: unknown): val is EpProp<any, any, any> =>\n isObject(val) && !!(val as any)[epPropKey]\n\n/**\n * @description Build prop. It can better optimize prop types\n * @description 生成 prop能更好地优化类型\n * @example\n // limited options\n // the type will be PropType<'light' | 'dark'>\n buildProp({\n type: String,\n values: ['light', 'dark'],\n } as const)\n * @example\n // limited options and other types\n // the type will be PropType<'small' | 'large' | number>\n buildProp({\n type: [String, Number],\n values: ['small', 'large'],\n validator: (val: unknown): val is number => typeof val === 'number',\n } as const)\n @link see more: https://github.com/element-plus/element-plus/pull/3341\n */\nexport const buildProp = <\n Type = never,\n Value = never,\n Validator = never,\n Default extends EpPropMergeType<Type, Value, Validator> = never,\n Required extends boolean = false,\n>(\n prop: EpPropInput<Type, Value, Validator, Default, Required>,\n key?: string\n): EpPropFinalized<Type, Value, Validator, Default, Required> => {\n // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`)\n if (!isObject(prop) || isEpProp(prop)) return prop as any\n\n const { values, required, default: defaultValue, type, validator } = prop\n\n const _validator =\n values || validator\n ? (val: unknown) => {\n let valid = false\n let allowedValues: unknown[] = []\n\n if (values) {\n allowedValues = Array.from(values)\n if (hasOwn(prop, 'default')) {\n allowedValues.push(defaultValue)\n }\n valid ||= allowedValues.includes(val)\n }\n if (validator) valid ||= validator(val)\n\n if (!valid && allowedValues.length > 0) {\n const allowValuesText = [...new Set(allowedValues)]\n .map((value) => JSON.stringify(value))\n .join(', ')\n warn(\n `Invalid prop: validation failed${\n key ? ` for prop \"${key}\"` : ''\n }. Expected one of [${allowValuesText}], got value ${JSON.stringify(\n val\n )}.`\n )\n }\n return valid\n }\n : undefined\n\n const epProp: any = {\n type,\n required: !!required,\n validator: _validator,\n [epPropKey]: true,\n }\n if (hasOwn(prop, 'default')) epProp.default = defaultValue\n return epProp\n}\n\nexport const buildProps = <\n Props extends Record<\n string,\n | { [epPropKey]: true }\n | NativePropType\n | EpPropInput<any, any, any, any, any>\n >,\n>(\n props: Props\n): {\n [K in keyof Props]: IfEpProp<\n Props[K],\n Props[K],\n IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>\n >\n} =>\n fromPairs(\n Object.entries(props).map(([key, option]) => [\n key,\n buildProp(option as any, key),\n ])\n ) as any\n"],"mappings":";;;;;AAiBA,MAAa,YAAY;AAEzB,MAAa,kBAAqB,QAA0B;AAE5D,MAAa,YAAY,QACvB,SAAS,IAAI,IAAI,CAAC,CAAE,IAAA;;;;;;;;;;;;;;;;;;;;;AAsBtB,MAAa,aAOX,MACA,QAC+D;CAE/D,IAAI,CAAC,SAAS,KAAK,IAAI,SAAS,KAAK,EAAE,OAAO;CAE9C,MAAM,EAAE,QAAQ,UAAU,SAAS,cAAc,MAAM,cAAc;CAiCrE,MAAM,SAAc;EAClB;EACA,UAAU,CAAC,CAAC;EACZ,WAjCA,UAAU,aACL,QAAiB;GAChB,IAAI,QAAQ;GACZ,IAAI,gBAA2B,EAAE;GAEjC,IAAI,QAAQ;IACV,gBAAgB,MAAM,KAAK,OAAO;IAClC,IAAI,OAAO,MAAM,UAAU,EACzB,cAAc,KAAK,aAAa;IAElC,UAAU,cAAc,SAAS,IAAI;;GAEvC,IAAI,WAAW,UAAU,UAAU,IAAI;GAEvC,IAAI,CAAC,SAAS,cAAc,SAAS,GAAG;IACtC,MAAM,kBAAkB,CAAC,GAAG,IAAI,IAAI,cAAc,CAAC,CAChD,KAAK,UAAU,KAAK,UAAU,MAAM,CAAC,CACrC,KAAK,KAAK;IACb,KACE,kCACE,MAAM,cAAc,IAAI,KAAK,GAC9B,qBAAqB,gBAAgB,eAAe,KAAK,UACxD,IACD,CAAC,GACH;;GAEH,OAAO;MAET,KAAA;GAMH,YAAY;EACd;CACD,IAAI,OAAO,MAAM,UAAU,EAAE,OAAO,UAAU;CAC9C,OAAO;;AAGT,MAAa,cAQX,UAQA,UACE,OAAO,QAAQ,MAAM,CAAC,KAAK,CAAC,KAAK,YAAY,CAC3C,KACA,UAAU,QAAe,IAAI,CAC9B,CAAC,CACH"}