UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 2.92 kB
{"version":3,"file":"watermark.mjs","sources":["../../../../../../packages/components/watermark/src/watermark.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, ExtractPublicPropTypes } from 'vue'\nimport type Watermark from './watermark.vue'\n\nexport interface WatermarkFontType {\n color?: string\n fontSize?: number | string\n fontWeight?: 'normal' | 'light' | 'weight' | number\n fontStyle?: 'none' | 'normal' | 'italic' | 'oblique'\n fontFamily?: string\n fontGap?: number\n textAlign?: 'start' | 'end' | 'left' | 'right' | 'center'\n textBaseline?:\n | 'top'\n | 'hanging'\n | 'middle'\n | 'alphabetic'\n | 'ideographic'\n | 'bottom'\n}\n\nexport const watermarkProps = buildProps({\n /**\n * @description The z-index of the appended watermark element\n */\n zIndex: {\n type: Number,\n default: 9,\n },\n /**\n * @description The rotation angle of the watermark\n */\n rotate: {\n type: Number,\n default: -22,\n },\n /**\n * @description The width of the watermark\n */\n width: Number,\n /**\n * @description The height of the watermark\n */\n height: Number,\n /**\n * @description Image source, it is recommended to export 2x or 3x image, high priority (support base64 format)\n */\n image: String,\n /**\n * @description Watermark text content\n */\n content: {\n type: definePropType<string | string[]>([String, Array]),\n default: 'Element Plus',\n },\n /**\n * @description Text style\n */\n font: {\n type: definePropType<WatermarkFontType>(Object),\n },\n /**\n * @description The spacing between watermarks\n */\n gap: {\n type: definePropType<[number, number]>(Array),\n default: () => [100, 100],\n },\n /**\n * @description The offset of the watermark from the upper left corner of the container. The default is gap/2\n */\n offset: {\n type: definePropType<[number, number]>(Array),\n },\n} as const)\n\nexport type WatermarkProps = ExtractPropTypes<typeof watermarkProps>\nexport type WatermarkPropsPublic = ExtractPublicPropTypes<typeof watermarkProps>\nexport type WatermarkInstance = InstanceType<typeof Watermark> & unknown\n"],"names":[],"mappings":";;AAsBO,MAAM,iBAAiB,UAAW,CAAA;AAAA,EAIvC,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA,EAAA;AAAA,GACX;AAAA,EAIA,KAAO,EAAA,MAAA;AAAA,EAIP,MAAQ,EAAA,MAAA;AAAA,EAIR,KAAO,EAAA,MAAA;AAAA,EAIP,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,cAAA,CAAkC,CAAC,MAAA,EAAQ,KAAK,CAAC,CAAA;AAAA,IACvD,OAAS,EAAA,cAAA;AAAA,GACX;AAAA,EAIA,IAAM,EAAA;AAAA,IACJ,IAAA,EAAM,eAAkC,MAAM,CAAA;AAAA,GAChD;AAAA,EAIA,GAAK,EAAA;AAAA,IACH,IAAA,EAAM,eAAiC,KAAK,CAAA;AAAA,IAC5C,OAAS,EAAA,MAAM,CAAC,GAAA,EAAK,GAAG,CAAA;AAAA,GAC1B;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,eAAiC,KAAK,CAAA;AAAA,GAC9C;AACF,CAAU;;;;"}