element-plus
Version:
A Component Library for Vue 3
1 lines • 4.02 kB
Source Map (JSON)
{"version":3,"file":"watermark.mjs","sources":["../../../../../../packages/components/watermark/src/watermark.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { 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 interface WatermarkProps {\n /**\n * @description The z-index of the appended watermark element\n */\n zIndex?: number\n /**\n * @description The rotation angle of the watermark\n */\n rotate?: number\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?: string | string[]\n /**\n * @description Text style\n */\n font?: WatermarkFontType\n /**\n * @description The spacing between watermarks\n */\n gap?: [number, number]\n /**\n * @description The offset of the watermark from the upper left corner of the container. The default is gap/2\n */\n offset?: [number, number]\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `WatermarkProps` instead.\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\n/**\n * @deprecated Removed after 3.0.0, Use `WatermarkProps` instead.\n */\nexport type WatermarkPropsPublic = ExtractPublicPropTypes<typeof watermarkProps>\nexport type WatermarkInstance = InstanceType<typeof Watermark> & unknown\n"],"names":[],"mappings":";;AAgEO,MAAM,iBAAiB,UAAA,CAAW;AAAA;AAAA;AAAA;AAAA,EAIvC,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,KAAA,EAAO,MAAA;AAAA;AAAA;AAAA;AAAA,EAIP,MAAA,EAAQ,MAAA;AAAA;AAAA;AAAA;AAAA,EAIR,KAAA,EAAO,MAAA;AAAA;AAAA;AAAA;AAAA,EAIP,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,cAAA,CAAkC,CAAC,MAAA,EAAQ,KAAK,CAAC,CAAA;AAAA,IACvD,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,eAAkC,MAAM;AAAA,GAChD;AAAA;AAAA;AAAA;AAAA,EAIA,GAAA,EAAK;AAAA,IACH,IAAA,EAAM,eAAiC,KAAK,CAAA;AAAA,IAC5C,OAAA,EAAS,MAAM,CAAC,GAAA,EAAK,GAAG;AAAA,GAC1B;AAAA;AAAA;AAAA;AAAA,EAIA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,eAAiC,KAAK;AAAA;AAEhD,CAAU;;;;"}