@element-plus/nightly 0.0.20231009 → 0.0.20231011
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +1016 -538
- package/dist/index.full.min.js +25 -25
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +23 -23
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +1016 -538
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/component.mjs +3 -1
- package/es/component.mjs.map +1 -1
- package/es/components/carousel/index.d.ts +5 -0
- package/es/components/carousel/src/carousel.vue.d.ts +5 -0
- package/es/components/carousel/src/carousel2.mjs +7 -2
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/carousel/src/use-carousel.d.ts +6 -0
- package/es/components/carousel/src/use-carousel.mjs +33 -1
- package/es/components/carousel/src/use-carousel.mjs.map +1 -1
- package/es/components/checkbox/index.d.ts +12 -0
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +4 -0
- package/es/components/checkbox/src/checkbox.d.ts +1 -0
- package/es/components/checkbox/src/checkbox.mjs +2 -1
- package/es/components/checkbox/src/checkbox.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox.vue.d.ts +4 -0
- package/es/components/checkbox/src/composables/use-checkbox-status.mjs +2 -2
- package/es/components/checkbox/src/composables/use-checkbox-status.mjs.map +1 -1
- package/es/components/color-picker/index.d.ts +18 -1
- package/es/components/color-picker/src/color-picker.d.ts +2 -0
- package/es/components/color-picker/src/color-picker.mjs +3 -1
- package/es/components/color-picker/src/color-picker.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker.vue.d.ts +18 -1
- package/es/components/color-picker/src/color-picker2.mjs +83 -11
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/descriptions/src/description-item.mjs.map +1 -1
- package/es/components/descriptions/src/description.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +26 -176
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +176 -26
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/index.mjs +1 -1
- package/es/components/table/src/table.mjs +2 -1
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/transfer/index.d.ts +40 -0
- package/es/components/transfer/src/transfer-panel.vue.d.ts +8 -0
- package/es/components/transfer/src/transfer.vue.d.ts +40 -0
- package/es/components/tree-v2/index.d.ts +8 -0
- package/es/components/tree-v2/src/tree-node.vue.d.ts +8 -0
- package/es/components/tree-v2/src/tree.vue.d.ts +8 -0
- package/es/components/watermark/index.d.ts +94 -0
- package/es/components/watermark/index.mjs +9 -0
- package/es/components/watermark/index.mjs.map +1 -0
- package/es/components/watermark/src/useClips.d.ts +7 -0
- package/es/components/watermark/src/useClips.mjs +82 -0
- package/es/components/watermark/src/useClips.mjs.map +1 -0
- package/es/components/watermark/src/utils.d.ts +8 -0
- package/es/components/watermark/src/utils.mjs +22 -0
- package/es/components/watermark/src/utils.mjs.map +1 -0
- package/es/components/watermark/src/watermark.d.ts +32 -0
- package/es/components/watermark/src/watermark.mjs +33 -0
- package/es/components/watermark/src/watermark.mjs.map +1 -0
- package/es/components/watermark/src/watermark.vue.d.ts +94 -0
- package/es/components/watermark/src/watermark2.mjs +202 -0
- package/es/components/watermark/src/watermark2.mjs.map +1 -0
- package/es/components/watermark/style/index.d.ts +0 -0
- package/es/components/watermark/style/index.mjs +2 -0
- package/es/components/watermark/style/index.mjs.map +1 -0
- package/es/hooks/use-focus-controller/index.d.ts +6 -1
- package/es/hooks/use-focus-controller/index.mjs +5 -2
- package/es/hooks/use-focus-controller/index.mjs.map +1 -1
- package/es/index.mjs +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/component.js +3 -1
- package/lib/component.js.map +1 -1
- package/lib/components/carousel/index.d.ts +5 -0
- package/lib/components/carousel/src/carousel.vue.d.ts +5 -0
- package/lib/components/carousel/src/carousel2.js +7 -2
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/carousel/src/use-carousel.d.ts +6 -0
- package/lib/components/carousel/src/use-carousel.js +32 -0
- package/lib/components/carousel/src/use-carousel.js.map +1 -1
- package/lib/components/checkbox/index.d.ts +12 -0
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +4 -0
- package/lib/components/checkbox/src/checkbox.d.ts +1 -0
- package/lib/components/checkbox/src/checkbox.js +2 -1
- package/lib/components/checkbox/src/checkbox.js.map +1 -1
- package/lib/components/checkbox/src/checkbox.vue.d.ts +4 -0
- package/lib/components/checkbox/src/composables/use-checkbox-status.js +1 -1
- package/lib/components/checkbox/src/composables/use-checkbox-status.js.map +1 -1
- package/lib/components/color-picker/index.d.ts +18 -1
- package/lib/components/color-picker/src/color-picker.d.ts +2 -0
- package/lib/components/color-picker/src/color-picker.js +3 -1
- package/lib/components/color-picker/src/color-picker.js.map +1 -1
- package/lib/components/color-picker/src/color-picker.vue.d.ts +18 -1
- package/lib/components/color-picker/src/color-picker2.js +93 -21
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/descriptions/src/description-item.js.map +1 -1
- package/lib/components/descriptions/src/description.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +27 -176
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +176 -27
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/table/src/table.js +2 -1
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/transfer/index.d.ts +40 -0
- package/lib/components/transfer/src/transfer-panel.vue.d.ts +8 -0
- package/lib/components/transfer/src/transfer.vue.d.ts +40 -0
- package/lib/components/tree-v2/index.d.ts +8 -0
- package/lib/components/tree-v2/src/tree-node.vue.d.ts +8 -0
- package/lib/components/tree-v2/src/tree.vue.d.ts +8 -0
- package/lib/components/watermark/index.d.ts +94 -0
- package/lib/components/watermark/index.js +15 -0
- package/lib/components/watermark/index.js.map +1 -0
- package/lib/components/watermark/src/useClips.d.ts +7 -0
- package/lib/components/watermark/src/useClips.js +87 -0
- package/lib/components/watermark/src/useClips.js.map +1 -0
- package/lib/components/watermark/src/utils.d.ts +8 -0
- package/lib/components/watermark/src/utils.js +29 -0
- package/lib/components/watermark/src/utils.js.map +1 -0
- package/lib/components/watermark/src/watermark.d.ts +32 -0
- package/lib/components/watermark/src/watermark.js +37 -0
- package/lib/components/watermark/src/watermark.js.map +1 -0
- package/lib/components/watermark/src/watermark.vue.d.ts +94 -0
- package/lib/components/watermark/src/watermark2.js +206 -0
- package/lib/components/watermark/src/watermark2.js.map +1 -0
- package/lib/components/watermark/style/index.d.ts +0 -0
- package/lib/components/watermark/style/index.js +3 -0
- package/lib/components/watermark/style/index.js.map +1 -0
- package/lib/hooks/use-focus-controller/index.d.ts +6 -1
- package/lib/hooks/use-focus-controller/index.js +5 -2
- package/lib/hooks/use-focus-controller/index.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/theme-chalk/el-color-picker.css +1 -1
- package/theme-chalk/el-table-v2.css +1 -1
- package/theme-chalk/el-table.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/color-picker.scss +8 -2
- package/theme-chalk/src/common/var.scss +1 -0
- package/theme-chalk/src/table.scss +16 -9
- package/web-types.json +1 -1
|
@@ -440,6 +440,7 @@ export declare const ElTreeV2: import("@element-plus/nightly/es/utils").SFCWithI
|
|
|
440
440
|
};
|
|
441
441
|
label: {
|
|
442
442
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
443
|
+
default: undefined;
|
|
443
444
|
};
|
|
444
445
|
indeterminate: BooleanConstructor;
|
|
445
446
|
disabled: BooleanConstructor;
|
|
@@ -484,6 +485,7 @@ export declare const ElTreeV2: import("@element-plus/nightly/es/utils").SFCWithI
|
|
|
484
485
|
};
|
|
485
486
|
label: {
|
|
486
487
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
488
|
+
default: undefined;
|
|
487
489
|
};
|
|
488
490
|
indeterminate: BooleanConstructor;
|
|
489
491
|
disabled: BooleanConstructor;
|
|
@@ -567,6 +569,7 @@ export declare const ElTreeV2: import("@element-plus/nightly/es/utils").SFCWithI
|
|
|
567
569
|
};
|
|
568
570
|
label: {
|
|
569
571
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
572
|
+
default: undefined;
|
|
570
573
|
};
|
|
571
574
|
indeterminate: BooleanConstructor;
|
|
572
575
|
disabled: BooleanConstructor;
|
|
@@ -608,6 +611,7 @@ export declare const ElTreeV2: import("@element-plus/nightly/es/utils").SFCWithI
|
|
|
608
611
|
"onUpdate:modelValue"?: ((val: import("..").CheckboxValueType) => any) | undefined;
|
|
609
612
|
}, {
|
|
610
613
|
modelValue: string | number | boolean;
|
|
614
|
+
label: string | number | boolean | Record<string, any>;
|
|
611
615
|
id: string;
|
|
612
616
|
disabled: boolean;
|
|
613
617
|
name: string;
|
|
@@ -626,6 +630,7 @@ export declare const ElTreeV2: import("@element-plus/nightly/es/utils").SFCWithI
|
|
|
626
630
|
};
|
|
627
631
|
label: {
|
|
628
632
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
633
|
+
default: undefined;
|
|
629
634
|
};
|
|
630
635
|
indeterminate: BooleanConstructor;
|
|
631
636
|
disabled: BooleanConstructor;
|
|
@@ -670,6 +675,7 @@ export declare const ElTreeV2: import("@element-plus/nightly/es/utils").SFCWithI
|
|
|
670
675
|
};
|
|
671
676
|
label: {
|
|
672
677
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
678
|
+
default: undefined;
|
|
673
679
|
};
|
|
674
680
|
indeterminate: BooleanConstructor;
|
|
675
681
|
disabled: BooleanConstructor;
|
|
@@ -753,6 +759,7 @@ export declare const ElTreeV2: import("@element-plus/nightly/es/utils").SFCWithI
|
|
|
753
759
|
};
|
|
754
760
|
label: {
|
|
755
761
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
762
|
+
default: undefined;
|
|
756
763
|
};
|
|
757
764
|
indeterminate: BooleanConstructor;
|
|
758
765
|
disabled: BooleanConstructor;
|
|
@@ -794,6 +801,7 @@ export declare const ElTreeV2: import("@element-plus/nightly/es/utils").SFCWithI
|
|
|
794
801
|
"onUpdate:modelValue"?: ((val: import("..").CheckboxValueType) => any) | undefined;
|
|
795
802
|
}, {
|
|
796
803
|
modelValue: string | number | boolean;
|
|
804
|
+
label: string | number | boolean | Record<string, any>;
|
|
797
805
|
id: string;
|
|
798
806
|
disabled: boolean;
|
|
799
807
|
name: string;
|
|
@@ -129,6 +129,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
129
129
|
};
|
|
130
130
|
label: {
|
|
131
131
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
132
|
+
default: undefined;
|
|
132
133
|
};
|
|
133
134
|
indeterminate: BooleanConstructor;
|
|
134
135
|
disabled: BooleanConstructor;
|
|
@@ -173,6 +174,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
173
174
|
};
|
|
174
175
|
label: {
|
|
175
176
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
177
|
+
default: undefined;
|
|
176
178
|
};
|
|
177
179
|
indeterminate: BooleanConstructor;
|
|
178
180
|
disabled: BooleanConstructor;
|
|
@@ -256,6 +258,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
256
258
|
};
|
|
257
259
|
label: {
|
|
258
260
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
261
|
+
default: undefined;
|
|
259
262
|
};
|
|
260
263
|
indeterminate: BooleanConstructor;
|
|
261
264
|
disabled: BooleanConstructor;
|
|
@@ -297,6 +300,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
297
300
|
"onUpdate:modelValue"?: ((val: CheckboxValueType) => any) | undefined;
|
|
298
301
|
}, {
|
|
299
302
|
modelValue: string | number | boolean;
|
|
303
|
+
label: string | number | boolean | Record<string, any>;
|
|
300
304
|
id: string;
|
|
301
305
|
disabled: boolean;
|
|
302
306
|
name: string;
|
|
@@ -315,6 +319,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
315
319
|
};
|
|
316
320
|
label: {
|
|
317
321
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
322
|
+
default: undefined;
|
|
318
323
|
};
|
|
319
324
|
indeterminate: BooleanConstructor;
|
|
320
325
|
disabled: BooleanConstructor;
|
|
@@ -359,6 +364,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
359
364
|
};
|
|
360
365
|
label: {
|
|
361
366
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
367
|
+
default: undefined;
|
|
362
368
|
};
|
|
363
369
|
indeterminate: BooleanConstructor;
|
|
364
370
|
disabled: BooleanConstructor;
|
|
@@ -442,6 +448,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
442
448
|
};
|
|
443
449
|
label: {
|
|
444
450
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
451
|
+
default: undefined;
|
|
445
452
|
};
|
|
446
453
|
indeterminate: BooleanConstructor;
|
|
447
454
|
disabled: BooleanConstructor;
|
|
@@ -483,6 +490,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
483
490
|
"onUpdate:modelValue"?: ((val: CheckboxValueType) => any) | undefined;
|
|
484
491
|
}, {
|
|
485
492
|
modelValue: string | number | boolean;
|
|
493
|
+
label: string | number | boolean | Record<string, any>;
|
|
486
494
|
id: string;
|
|
487
495
|
disabled: boolean;
|
|
488
496
|
name: string;
|
|
@@ -440,6 +440,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
440
440
|
};
|
|
441
441
|
label: {
|
|
442
442
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
443
|
+
default: undefined;
|
|
443
444
|
};
|
|
444
445
|
indeterminate: BooleanConstructor;
|
|
445
446
|
disabled: BooleanConstructor;
|
|
@@ -484,6 +485,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
484
485
|
};
|
|
485
486
|
label: {
|
|
486
487
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
488
|
+
default: undefined;
|
|
487
489
|
};
|
|
488
490
|
indeterminate: BooleanConstructor;
|
|
489
491
|
disabled: BooleanConstructor;
|
|
@@ -567,6 +569,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
567
569
|
};
|
|
568
570
|
label: {
|
|
569
571
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
572
|
+
default: undefined;
|
|
570
573
|
};
|
|
571
574
|
indeterminate: BooleanConstructor;
|
|
572
575
|
disabled: BooleanConstructor;
|
|
@@ -608,6 +611,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
608
611
|
"onUpdate:modelValue"?: ((val: import("../..").CheckboxValueType) => any) | undefined;
|
|
609
612
|
}, {
|
|
610
613
|
modelValue: string | number | boolean;
|
|
614
|
+
label: string | number | boolean | Record<string, any>;
|
|
611
615
|
id: string;
|
|
612
616
|
disabled: boolean;
|
|
613
617
|
name: string;
|
|
@@ -626,6 +630,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
626
630
|
};
|
|
627
631
|
label: {
|
|
628
632
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
633
|
+
default: undefined;
|
|
629
634
|
};
|
|
630
635
|
indeterminate: BooleanConstructor;
|
|
631
636
|
disabled: BooleanConstructor;
|
|
@@ -670,6 +675,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
670
675
|
};
|
|
671
676
|
label: {
|
|
672
677
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
678
|
+
default: undefined;
|
|
673
679
|
};
|
|
674
680
|
indeterminate: BooleanConstructor;
|
|
675
681
|
disabled: BooleanConstructor;
|
|
@@ -753,6 +759,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
753
759
|
};
|
|
754
760
|
label: {
|
|
755
761
|
type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
762
|
+
default: undefined;
|
|
756
763
|
};
|
|
757
764
|
indeterminate: BooleanConstructor;
|
|
758
765
|
disabled: BooleanConstructor;
|
|
@@ -794,6 +801,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
794
801
|
"onUpdate:modelValue"?: ((val: import("../..").CheckboxValueType) => any) | undefined;
|
|
795
802
|
}, {
|
|
796
803
|
modelValue: string | number | boolean;
|
|
804
|
+
label: string | number | boolean | Record<string, any>;
|
|
797
805
|
id: string;
|
|
798
806
|
disabled: boolean;
|
|
799
807
|
name: string;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export declare const ElWatermark: import("@element-plus/nightly/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
2
|
+
readonly zIndex: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 9, boolean>;
|
|
3
|
+
readonly rotate: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, -22, boolean>;
|
|
4
|
+
readonly width: NumberConstructor;
|
|
5
|
+
readonly height: NumberConstructor;
|
|
6
|
+
readonly image: StringConstructor;
|
|
7
|
+
readonly content: import("@element-plus/nightly/es/utils").EpPropFinalized<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown, "Element Plus", boolean>;
|
|
8
|
+
readonly font: {
|
|
9
|
+
readonly type: import("vue").PropType<import("./src/watermark").WatermarkFontType>;
|
|
10
|
+
readonly required: false;
|
|
11
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
12
|
+
__epPropKey: true;
|
|
13
|
+
};
|
|
14
|
+
readonly gap: import("@element-plus/nightly/es/utils").EpPropFinalized<(new (...args: any[]) => [number, number]) | (() => [number, number]) | ((new (...args: any[]) => [number, number]) | (() => [number, number]))[], unknown, unknown, () => number[], boolean>;
|
|
15
|
+
readonly offset: {
|
|
16
|
+
readonly type: import("vue").PropType<[number, number]>;
|
|
17
|
+
readonly required: false;
|
|
18
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
19
|
+
__epPropKey: true;
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
style: import("vue").CSSProperties;
|
|
23
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
readonly zIndex: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 9, boolean>;
|
|
25
|
+
readonly rotate: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, -22, boolean>;
|
|
26
|
+
readonly width: NumberConstructor;
|
|
27
|
+
readonly height: NumberConstructor;
|
|
28
|
+
readonly image: StringConstructor;
|
|
29
|
+
readonly content: import("@element-plus/nightly/es/utils").EpPropFinalized<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown, "Element Plus", boolean>;
|
|
30
|
+
readonly font: {
|
|
31
|
+
readonly type: import("vue").PropType<import("./src/watermark").WatermarkFontType>;
|
|
32
|
+
readonly required: false;
|
|
33
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
34
|
+
__epPropKey: true;
|
|
35
|
+
};
|
|
36
|
+
readonly gap: import("@element-plus/nightly/es/utils").EpPropFinalized<(new (...args: any[]) => [number, number]) | (() => [number, number]) | ((new (...args: any[]) => [number, number]) | (() => [number, number]))[], unknown, unknown, () => number[], boolean>;
|
|
37
|
+
readonly offset: {
|
|
38
|
+
readonly type: import("vue").PropType<[number, number]>;
|
|
39
|
+
readonly required: false;
|
|
40
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
41
|
+
__epPropKey: true;
|
|
42
|
+
};
|
|
43
|
+
}>> & {
|
|
44
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
45
|
+
}>>;
|
|
46
|
+
color: import("vue").ComputedRef<string>;
|
|
47
|
+
fontSize: import("vue").ComputedRef<string | number>;
|
|
48
|
+
fontWeight: import("vue").ComputedRef<number | "light" | "normal" | "weight">;
|
|
49
|
+
fontStyle: import("vue").ComputedRef<"none" | "normal" | "italic" | "oblique">;
|
|
50
|
+
fontFamily: import("vue").ComputedRef<string>;
|
|
51
|
+
gapX: import("vue").ComputedRef<number>;
|
|
52
|
+
gapY: import("vue").ComputedRef<number>;
|
|
53
|
+
gapXCenter: import("vue").ComputedRef<number>;
|
|
54
|
+
gapYCenter: import("vue").ComputedRef<number>;
|
|
55
|
+
offsetLeft: import("vue").ComputedRef<number>;
|
|
56
|
+
offsetTop: import("vue").ComputedRef<number>;
|
|
57
|
+
getMarkStyle: () => import("vue").CSSProperties;
|
|
58
|
+
containerRef: import("vue").ShallowRef<HTMLDivElement | null>;
|
|
59
|
+
watermarkRef: import("vue").ShallowRef<HTMLDivElement | undefined>;
|
|
60
|
+
stopObservation: import("vue").Ref<boolean>;
|
|
61
|
+
destroyWatermark: () => void;
|
|
62
|
+
appendWatermark: (base64Url: string, markWidth: number) => void;
|
|
63
|
+
getMarkSize: (ctx: CanvasRenderingContext2D) => readonly [number, number];
|
|
64
|
+
getClips: (content: HTMLImageElement | import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown>, rotate: number, ratio: number, width: number, height: number, font: Required<import("./src/watermark").WatermarkFontType>, gapX: number, gapY: number) => [dataURL: string, finalWidth: number, finalHeight: number];
|
|
65
|
+
renderWatermark: () => void;
|
|
66
|
+
onMutate: (mutations: MutationRecord[]) => void;
|
|
67
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
68
|
+
readonly zIndex: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 9, boolean>;
|
|
69
|
+
readonly rotate: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, -22, boolean>;
|
|
70
|
+
readonly width: NumberConstructor;
|
|
71
|
+
readonly height: NumberConstructor;
|
|
72
|
+
readonly image: StringConstructor;
|
|
73
|
+
readonly content: import("@element-plus/nightly/es/utils").EpPropFinalized<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown, "Element Plus", boolean>;
|
|
74
|
+
readonly font: {
|
|
75
|
+
readonly type: import("vue").PropType<import("./src/watermark").WatermarkFontType>;
|
|
76
|
+
readonly required: false;
|
|
77
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
78
|
+
__epPropKey: true;
|
|
79
|
+
};
|
|
80
|
+
readonly gap: import("@element-plus/nightly/es/utils").EpPropFinalized<(new (...args: any[]) => [number, number]) | (() => [number, number]) | ((new (...args: any[]) => [number, number]) | (() => [number, number]))[], unknown, unknown, () => number[], boolean>;
|
|
81
|
+
readonly offset: {
|
|
82
|
+
readonly type: import("vue").PropType<[number, number]>;
|
|
83
|
+
readonly required: false;
|
|
84
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
85
|
+
__epPropKey: true;
|
|
86
|
+
};
|
|
87
|
+
}>>, {
|
|
88
|
+
readonly zIndex: number;
|
|
89
|
+
readonly content: import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown>;
|
|
90
|
+
readonly rotate: number;
|
|
91
|
+
readonly gap: [number, number];
|
|
92
|
+
}>> & Record<string, any>;
|
|
93
|
+
export default ElWatermark;
|
|
94
|
+
export * from './src/watermark';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../utils/index.js');
|
|
6
|
+
var watermark$1 = require('./src/watermark2.js');
|
|
7
|
+
var watermark = require('./src/watermark.js');
|
|
8
|
+
var install = require('../../utils/vue/install.js');
|
|
9
|
+
|
|
10
|
+
const ElWatermark = install.withInstall(watermark$1["default"]);
|
|
11
|
+
|
|
12
|
+
exports.watermarkProps = watermark.watermarkProps;
|
|
13
|
+
exports.ElWatermark = ElWatermark;
|
|
14
|
+
exports["default"] = ElWatermark;
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/components/watermark/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Watermark from './src/watermark.vue'\n\nexport const ElWatermark = withInstall(Watermark)\nexport default ElWatermark\n\nexport * from './src/watermark'\n"],"names":["withInstall","Watermark"],"mappings":";;;;;;;;;AAEY,MAAC,WAAW,GAAGA,mBAAW,CAACC,sBAAS;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WatermarkProps } from './watermark';
|
|
2
|
+
export declare const FontGap = 3;
|
|
3
|
+
/**
|
|
4
|
+
* Get the clips of text content.
|
|
5
|
+
* This is a lazy hook function since SSR no need this
|
|
6
|
+
*/
|
|
7
|
+
export default function useClips(): (content: NonNullable<WatermarkProps['content']> | HTMLImageElement, rotate: number, ratio: number, width: number, height: number, font: Required<NonNullable<WatermarkProps['font']>>, gapX: number, gapY: number) => [dataURL: string, finalWidth: number, finalHeight: number];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const FontGap = 3;
|
|
6
|
+
function prepareCanvas(width, height, ratio = 1) {
|
|
7
|
+
const canvas = document.createElement("canvas");
|
|
8
|
+
const ctx = canvas.getContext("2d");
|
|
9
|
+
const realWidth = width * ratio;
|
|
10
|
+
const realHeight = height * ratio;
|
|
11
|
+
canvas.setAttribute("width", `${realWidth}px`);
|
|
12
|
+
canvas.setAttribute("height", `${realHeight}px`);
|
|
13
|
+
ctx.save();
|
|
14
|
+
return [ctx, canvas, realWidth, realHeight];
|
|
15
|
+
}
|
|
16
|
+
function useClips() {
|
|
17
|
+
function getClips(content, rotate, ratio, width, height, font, gapX, gapY) {
|
|
18
|
+
const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(width, height, ratio);
|
|
19
|
+
if (content instanceof HTMLImageElement) {
|
|
20
|
+
ctx.drawImage(content, 0, 0, contentWidth, contentHeight);
|
|
21
|
+
} else {
|
|
22
|
+
const { color, fontSize, fontStyle, fontWeight, fontFamily } = font;
|
|
23
|
+
const mergedFontSize = Number(fontSize) * ratio;
|
|
24
|
+
ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${height}px ${fontFamily}`;
|
|
25
|
+
ctx.fillStyle = color;
|
|
26
|
+
ctx.textAlign = "center";
|
|
27
|
+
ctx.textBaseline = "top";
|
|
28
|
+
const contents = Array.isArray(content) ? content : [content];
|
|
29
|
+
contents == null ? void 0 : contents.forEach((item, index) => {
|
|
30
|
+
ctx.fillText(item != null ? item : "", contentWidth / 2, index * (mergedFontSize + FontGap * ratio));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const angle = Math.PI / 180 * Number(rotate);
|
|
34
|
+
const maxSize = Math.max(width, height);
|
|
35
|
+
const [rCtx, rCanvas, realMaxSize] = prepareCanvas(maxSize, maxSize, ratio);
|
|
36
|
+
rCtx.translate(realMaxSize / 2, realMaxSize / 2);
|
|
37
|
+
rCtx.rotate(angle);
|
|
38
|
+
if (contentWidth > 0 && contentHeight > 0) {
|
|
39
|
+
rCtx.drawImage(canvas, -contentWidth / 2, -contentHeight / 2);
|
|
40
|
+
}
|
|
41
|
+
function getRotatePos(x, y) {
|
|
42
|
+
const targetX = x * Math.cos(angle) - y * Math.sin(angle);
|
|
43
|
+
const targetY = x * Math.sin(angle) + y * Math.cos(angle);
|
|
44
|
+
return [targetX, targetY];
|
|
45
|
+
}
|
|
46
|
+
let left = 0;
|
|
47
|
+
let right = 0;
|
|
48
|
+
let top = 0;
|
|
49
|
+
let bottom = 0;
|
|
50
|
+
const halfWidth = contentWidth / 2;
|
|
51
|
+
const halfHeight = contentHeight / 2;
|
|
52
|
+
const points = [
|
|
53
|
+
[0 - halfWidth, 0 - halfHeight],
|
|
54
|
+
[0 + halfWidth, 0 - halfHeight],
|
|
55
|
+
[0 + halfWidth, 0 + halfHeight],
|
|
56
|
+
[0 - halfWidth, 0 + halfHeight]
|
|
57
|
+
];
|
|
58
|
+
points.forEach(([x, y]) => {
|
|
59
|
+
const [targetX, targetY] = getRotatePos(x, y);
|
|
60
|
+
left = Math.min(left, targetX);
|
|
61
|
+
right = Math.max(right, targetX);
|
|
62
|
+
top = Math.min(top, targetY);
|
|
63
|
+
bottom = Math.max(bottom, targetY);
|
|
64
|
+
});
|
|
65
|
+
const cutLeft = left + realMaxSize / 2;
|
|
66
|
+
const cutTop = top + realMaxSize / 2;
|
|
67
|
+
const cutWidth = right - left;
|
|
68
|
+
const cutHeight = bottom - top;
|
|
69
|
+
const realGapX = gapX * ratio;
|
|
70
|
+
const realGapY = gapY * ratio;
|
|
71
|
+
const filledWidth = (cutWidth + realGapX) * 2;
|
|
72
|
+
const filledHeight = cutHeight + realGapY;
|
|
73
|
+
const [fCtx, fCanvas] = prepareCanvas(filledWidth, filledHeight);
|
|
74
|
+
function drawImg(targetX = 0, targetY = 0) {
|
|
75
|
+
fCtx.drawImage(rCanvas, cutLeft, cutTop, cutWidth, cutHeight, targetX, targetY, cutWidth, cutHeight);
|
|
76
|
+
}
|
|
77
|
+
drawImg();
|
|
78
|
+
drawImg(cutWidth + realGapX, -cutHeight / 2 - realGapY / 2);
|
|
79
|
+
drawImg(cutWidth + realGapX, +cutHeight / 2 + realGapY / 2);
|
|
80
|
+
return [fCanvas.toDataURL(), filledWidth / ratio, filledHeight / ratio];
|
|
81
|
+
}
|
|
82
|
+
return getClips;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
exports.FontGap = FontGap;
|
|
86
|
+
exports["default"] = useClips;
|
|
87
|
+
//# sourceMappingURL=useClips.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClips.js","sources":["../../../../../../packages/components/watermark/src/useClips.ts"],"sourcesContent":["import type { WatermarkProps } from './watermark'\n\nexport const FontGap = 3\n\nfunction prepareCanvas(\n width: number,\n height: number,\n ratio = 1\n): [\n ctx: CanvasRenderingContext2D,\n canvas: HTMLCanvasElement,\n realWidth: number,\n realHeight: number\n] {\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')!\n const realWidth = width * ratio\n const realHeight = height * ratio\n canvas.setAttribute('width', `${realWidth}px`)\n canvas.setAttribute('height', `${realHeight}px`)\n ctx.save()\n\n return [ctx, canvas, realWidth, realHeight]\n}\n\n/**\n * Get the clips of text content.\n * This is a lazy hook function since SSR no need this\n */\nexport default function useClips() {\n // Get single clips\n function getClips(\n content: NonNullable<WatermarkProps['content']> | HTMLImageElement,\n rotate: number,\n ratio: number,\n width: number,\n height: number,\n font: Required<NonNullable<WatermarkProps['font']>>,\n gapX: number,\n gapY: number\n ): [dataURL: string, finalWidth: number, finalHeight: number] {\n // ================= Text / Image =================\n const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(\n width,\n height,\n ratio\n )\n\n if (content instanceof HTMLImageElement) {\n // Image\n ctx.drawImage(content, 0, 0, contentWidth, contentHeight)\n } else {\n // Text\n const { color, fontSize, fontStyle, fontWeight, fontFamily } = font\n const mergedFontSize = Number(fontSize) * ratio\n\n ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${height}px ${fontFamily}`\n ctx.fillStyle = color\n ctx.textAlign = 'center'\n ctx.textBaseline = 'top'\n const contents = Array.isArray(content) ? content : [content]\n contents?.forEach((item, index) => {\n ctx.fillText(\n item ?? '',\n contentWidth / 2,\n index * (mergedFontSize + FontGap * ratio)\n )\n })\n }\n\n // ==================== Rotate ====================\n const angle = (Math.PI / 180) * Number(rotate)\n const maxSize = Math.max(width, height)\n const [rCtx, rCanvas, realMaxSize] = prepareCanvas(maxSize, maxSize, ratio)\n\n // Copy from `ctx` and rotate\n rCtx.translate(realMaxSize / 2, realMaxSize / 2)\n rCtx.rotate(angle)\n if (contentWidth > 0 && contentHeight > 0) {\n rCtx.drawImage(canvas, -contentWidth / 2, -contentHeight / 2)\n }\n\n // Get boundary of rotated text\n function getRotatePos(x: number, y: number) {\n const targetX = x * Math.cos(angle) - y * Math.sin(angle)\n const targetY = x * Math.sin(angle) + y * Math.cos(angle)\n return [targetX, targetY]\n }\n\n let left = 0\n let right = 0\n let top = 0\n let bottom = 0\n\n const halfWidth = contentWidth / 2\n const halfHeight = contentHeight / 2\n const points = [\n [0 - halfWidth, 0 - halfHeight],\n [0 + halfWidth, 0 - halfHeight],\n [0 + halfWidth, 0 + halfHeight],\n [0 - halfWidth, 0 + halfHeight],\n ]\n points.forEach(([x, y]) => {\n const [targetX, targetY] = getRotatePos(x, y)\n left = Math.min(left, targetX)\n right = Math.max(right, targetX)\n top = Math.min(top, targetY)\n bottom = Math.max(bottom, targetY)\n })\n\n const cutLeft = left + realMaxSize / 2\n const cutTop = top + realMaxSize / 2\n const cutWidth = right - left\n const cutHeight = bottom - top\n\n // ================ Fill Alternate ================\n const realGapX = gapX * ratio\n const realGapY = gapY * ratio\n const filledWidth = (cutWidth + realGapX) * 2\n const filledHeight = cutHeight + realGapY\n\n const [fCtx, fCanvas] = prepareCanvas(filledWidth, filledHeight)\n\n function drawImg(targetX = 0, targetY = 0) {\n fCtx.drawImage(\n rCanvas,\n cutLeft,\n cutTop,\n cutWidth,\n cutHeight,\n targetX,\n targetY,\n cutWidth,\n cutHeight\n )\n }\n drawImg()\n drawImg(cutWidth + realGapX, -cutHeight / 2 - realGapY / 2)\n drawImg(cutWidth + realGapX, +cutHeight / 2 + realGapY / 2)\n\n return [fCanvas.toDataURL(), filledWidth / ratio, filledHeight / ratio]\n }\n\n return getClips\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CSSProperties } from 'vue';
|
|
2
|
+
/** converting camel-cased strings to be lowercase and link it with Separato */
|
|
3
|
+
export declare function toLowercaseSeparator(key: string): string;
|
|
4
|
+
export declare function getStyleStr(style: CSSProperties): string;
|
|
5
|
+
/** Returns the ratio of the device's physical pixel resolution to the css pixel resolution */
|
|
6
|
+
export declare function getPixelRatio(): number;
|
|
7
|
+
/** Whether to re-render the watermark */
|
|
8
|
+
export declare const reRendering: (mutation: MutationRecord, watermarkElement?: HTMLElement | undefined) => boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function toLowercaseSeparator(key) {
|
|
6
|
+
return key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
7
|
+
}
|
|
8
|
+
function getStyleStr(style) {
|
|
9
|
+
return Object.keys(style).map((key) => `${toLowercaseSeparator(key)}: ${style[key]};`).join(" ");
|
|
10
|
+
}
|
|
11
|
+
function getPixelRatio() {
|
|
12
|
+
return window.devicePixelRatio || 1;
|
|
13
|
+
}
|
|
14
|
+
const reRendering = (mutation, watermarkElement) => {
|
|
15
|
+
let flag = false;
|
|
16
|
+
if (mutation.removedNodes.length && watermarkElement) {
|
|
17
|
+
flag = Array.from(mutation.removedNodes).includes(watermarkElement);
|
|
18
|
+
}
|
|
19
|
+
if (mutation.type === "attributes" && mutation.target === watermarkElement) {
|
|
20
|
+
flag = true;
|
|
21
|
+
}
|
|
22
|
+
return flag;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.getPixelRatio = getPixelRatio;
|
|
26
|
+
exports.getStyleStr = getStyleStr;
|
|
27
|
+
exports.reRendering = reRendering;
|
|
28
|
+
exports.toLowercaseSeparator = toLowercaseSeparator;
|
|
29
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../../packages/components/watermark/src/utils.ts"],"sourcesContent":["import type { CSSProperties } from 'vue'\n\n/** converting camel-cased strings to be lowercase and link it with Separato */\nexport function toLowercaseSeparator(key: string) {\n return key.replace(/([A-Z])/g, '-$1').toLowerCase()\n}\n\nexport function getStyleStr(style: CSSProperties): string {\n return Object.keys(style)\n .map(\n (key) =>\n `${toLowercaseSeparator(key)}: ${style[key as keyof CSSProperties]};`\n )\n .join(' ')\n}\n\n/** Returns the ratio of the device's physical pixel resolution to the css pixel resolution */\nexport function getPixelRatio() {\n return window.devicePixelRatio || 1\n}\n\n/** Whether to re-render the watermark */\nexport const reRendering = (\n mutation: MutationRecord,\n watermarkElement?: HTMLElement\n) => {\n let flag = false\n // Whether to delete the watermark node\n if (mutation.removedNodes.length && watermarkElement) {\n flag = Array.from(mutation.removedNodes).includes(watermarkElement)\n }\n // Whether the watermark dom property value has been modified\n if (mutation.type === 'attributes' && mutation.target === watermarkElement) {\n flag = true\n }\n return flag\n}\n"],"names":[],"mappings":";;;;AAAO,SAAS,oBAAoB,CAAC,GAAG,EAAE;AAC1C,EAAE,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AACtD,CAAC;AACM,SAAS,WAAW,CAAC,KAAK,EAAE;AACnC,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnG,CAAC;AACM,SAAS,aAAa,GAAG;AAChC,EAAE,OAAO,MAAM,CAAC,gBAAgB,IAAI,CAAC,CAAC;AACtC,CAAC;AACW,MAAC,WAAW,GAAG,CAAC,QAAQ,EAAE,gBAAgB,KAAK;AAC3D,EAAE,IAAI,IAAI,GAAG,KAAK,CAAC;AACnB,EAAE,IAAI,QAAQ,CAAC,YAAY,CAAC,MAAM,IAAI,gBAAgB,EAAE;AACxD,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACxE,GAAG;AACH,EAAE,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY,IAAI,QAAQ,CAAC,MAAM,KAAK,gBAAgB,EAAE;AAC9E,IAAI,IAAI,GAAG,IAAI,CAAC;AAChB,GAAG;AACH,EAAE,OAAO,IAAI,CAAC;AACd;;;;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import type Watermark from './watermark.vue';
|
|
3
|
+
export interface WatermarkFontType {
|
|
4
|
+
color?: string;
|
|
5
|
+
fontSize?: number | string;
|
|
6
|
+
fontWeight?: 'normal' | 'light' | 'weight' | number;
|
|
7
|
+
fontStyle?: 'none' | 'normal' | 'italic' | 'oblique';
|
|
8
|
+
fontFamily?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const watermarkProps: {
|
|
11
|
+
readonly zIndex: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 9, boolean>;
|
|
12
|
+
readonly rotate: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, -22, boolean>;
|
|
13
|
+
readonly width: NumberConstructor;
|
|
14
|
+
readonly height: NumberConstructor;
|
|
15
|
+
readonly image: StringConstructor;
|
|
16
|
+
readonly content: import("@element-plus/nightly/es/utils").EpPropFinalized<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown, "Element Plus", boolean>;
|
|
17
|
+
readonly font: {
|
|
18
|
+
readonly type: import("vue").PropType<WatermarkFontType>;
|
|
19
|
+
readonly required: false;
|
|
20
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
21
|
+
__epPropKey: true;
|
|
22
|
+
};
|
|
23
|
+
readonly gap: import("@element-plus/nightly/es/utils").EpPropFinalized<(new (...args: any[]) => [number, number]) | (() => [number, number]) | ((new (...args: any[]) => [number, number]) | (() => [number, number]))[], unknown, unknown, () => number[], boolean>;
|
|
24
|
+
readonly offset: {
|
|
25
|
+
readonly type: import("vue").PropType<[number, number]>;
|
|
26
|
+
readonly required: false;
|
|
27
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
28
|
+
__epPropKey: true;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare type WatermarkProps = ExtractPropTypes<typeof watermarkProps>;
|
|
32
|
+
export declare type WatermarkInstance = InstanceType<typeof Watermark>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../../utils/index.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
7
|
+
|
|
8
|
+
const watermarkProps = runtime.buildProps({
|
|
9
|
+
zIndex: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 9
|
|
12
|
+
},
|
|
13
|
+
rotate: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: -22
|
|
16
|
+
},
|
|
17
|
+
width: Number,
|
|
18
|
+
height: Number,
|
|
19
|
+
image: String,
|
|
20
|
+
content: {
|
|
21
|
+
type: runtime.definePropType([String, Array]),
|
|
22
|
+
default: "Element Plus"
|
|
23
|
+
},
|
|
24
|
+
font: {
|
|
25
|
+
type: runtime.definePropType(Object)
|
|
26
|
+
},
|
|
27
|
+
gap: {
|
|
28
|
+
type: runtime.definePropType(Array),
|
|
29
|
+
default: () => [100, 100]
|
|
30
|
+
},
|
|
31
|
+
offset: {
|
|
32
|
+
type: runtime.definePropType(Array)
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
exports.watermarkProps = watermarkProps;
|
|
37
|
+
//# sourceMappingURL=watermark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watermark.js","sources":["../../../../../../packages/components/watermark/src/watermark.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } 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}\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 WatermarkInstance = InstanceType<typeof Watermark>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;;AACY,MAAC,cAAc,GAAGA,kBAAU,CAAC;AACzC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC,EAAE;AAChB,GAAG;AACH,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,cAAc;AAC3B,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEA,sBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;AAC7B,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,CAAC;;;;"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { CSSProperties } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
readonly zIndex: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 9, boolean>;
|
|
4
|
+
readonly rotate: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, -22, boolean>;
|
|
5
|
+
readonly width: NumberConstructor;
|
|
6
|
+
readonly height: NumberConstructor;
|
|
7
|
+
readonly image: StringConstructor;
|
|
8
|
+
readonly content: import("../../../utils").EpPropFinalized<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown, "Element Plus", boolean>;
|
|
9
|
+
readonly font: {
|
|
10
|
+
readonly type: import("vue").PropType<import("./watermark").WatermarkFontType>;
|
|
11
|
+
readonly required: false;
|
|
12
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
13
|
+
__epPropKey: true;
|
|
14
|
+
};
|
|
15
|
+
readonly gap: import("../../../utils").EpPropFinalized<(new (...args: any[]) => [number, number]) | (() => [number, number]) | ((new (...args: any[]) => [number, number]) | (() => [number, number]))[], unknown, unknown, () => number[], boolean>;
|
|
16
|
+
readonly offset: {
|
|
17
|
+
readonly type: import("vue").PropType<[number, number]>;
|
|
18
|
+
readonly required: false;
|
|
19
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
20
|
+
__epPropKey: true;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
style: CSSProperties;
|
|
24
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
25
|
+
readonly zIndex: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 9, boolean>;
|
|
26
|
+
readonly rotate: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, -22, boolean>;
|
|
27
|
+
readonly width: NumberConstructor;
|
|
28
|
+
readonly height: NumberConstructor;
|
|
29
|
+
readonly image: StringConstructor;
|
|
30
|
+
readonly content: import("../../../utils").EpPropFinalized<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown, "Element Plus", boolean>;
|
|
31
|
+
readonly font: {
|
|
32
|
+
readonly type: import("vue").PropType<import("./watermark").WatermarkFontType>;
|
|
33
|
+
readonly required: false;
|
|
34
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
35
|
+
__epPropKey: true;
|
|
36
|
+
};
|
|
37
|
+
readonly gap: import("../../../utils").EpPropFinalized<(new (...args: any[]) => [number, number]) | (() => [number, number]) | ((new (...args: any[]) => [number, number]) | (() => [number, number]))[], unknown, unknown, () => number[], boolean>;
|
|
38
|
+
readonly offset: {
|
|
39
|
+
readonly type: import("vue").PropType<[number, number]>;
|
|
40
|
+
readonly required: false;
|
|
41
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
42
|
+
__epPropKey: true;
|
|
43
|
+
};
|
|
44
|
+
}>> & {
|
|
45
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
46
|
+
}>>;
|
|
47
|
+
color: import("vue").ComputedRef<string>;
|
|
48
|
+
fontSize: import("vue").ComputedRef<string | number>;
|
|
49
|
+
fontWeight: import("vue").ComputedRef<number | "light" | "normal" | "weight">;
|
|
50
|
+
fontStyle: import("vue").ComputedRef<"none" | "normal" | "italic" | "oblique">;
|
|
51
|
+
fontFamily: import("vue").ComputedRef<string>;
|
|
52
|
+
gapX: import("vue").ComputedRef<number>;
|
|
53
|
+
gapY: import("vue").ComputedRef<number>;
|
|
54
|
+
gapXCenter: import("vue").ComputedRef<number>;
|
|
55
|
+
gapYCenter: import("vue").ComputedRef<number>;
|
|
56
|
+
offsetLeft: import("vue").ComputedRef<number>;
|
|
57
|
+
offsetTop: import("vue").ComputedRef<number>;
|
|
58
|
+
getMarkStyle: () => CSSProperties;
|
|
59
|
+
containerRef: import("vue").ShallowRef<HTMLDivElement | null>;
|
|
60
|
+
watermarkRef: import("vue").ShallowRef<HTMLDivElement | undefined>;
|
|
61
|
+
stopObservation: import("vue").Ref<boolean>;
|
|
62
|
+
destroyWatermark: () => void;
|
|
63
|
+
appendWatermark: (base64Url: string, markWidth: number) => void;
|
|
64
|
+
getMarkSize: (ctx: CanvasRenderingContext2D) => readonly [number, number];
|
|
65
|
+
getClips: (content: HTMLImageElement | import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown>, rotate: number, ratio: number, width: number, height: number, font: Required<import("./watermark").WatermarkFontType>, gapX: number, gapY: number) => [dataURL: string, finalWidth: number, finalHeight: number];
|
|
66
|
+
renderWatermark: () => void;
|
|
67
|
+
onMutate: (mutations: MutationRecord[]) => void;
|
|
68
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
69
|
+
readonly zIndex: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 9, boolean>;
|
|
70
|
+
readonly rotate: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, -22, boolean>;
|
|
71
|
+
readonly width: NumberConstructor;
|
|
72
|
+
readonly height: NumberConstructor;
|
|
73
|
+
readonly image: StringConstructor;
|
|
74
|
+
readonly content: import("../../../utils").EpPropFinalized<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown, "Element Plus", boolean>;
|
|
75
|
+
readonly font: {
|
|
76
|
+
readonly type: import("vue").PropType<import("./watermark").WatermarkFontType>;
|
|
77
|
+
readonly required: false;
|
|
78
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
79
|
+
__epPropKey: true;
|
|
80
|
+
};
|
|
81
|
+
readonly gap: import("../../../utils").EpPropFinalized<(new (...args: any[]) => [number, number]) | (() => [number, number]) | ((new (...args: any[]) => [number, number]) | (() => [number, number]))[], unknown, unknown, () => number[], boolean>;
|
|
82
|
+
readonly offset: {
|
|
83
|
+
readonly type: import("vue").PropType<[number, number]>;
|
|
84
|
+
readonly required: false;
|
|
85
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
86
|
+
__epPropKey: true;
|
|
87
|
+
};
|
|
88
|
+
}>>, {
|
|
89
|
+
readonly zIndex: number;
|
|
90
|
+
readonly content: import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]) | ((new (...args: any[]) => (string | string[]) & {}) | (() => string | string[]))[], unknown, unknown>;
|
|
91
|
+
readonly rotate: number;
|
|
92
|
+
readonly gap: [number, number];
|
|
93
|
+
}>;
|
|
94
|
+
export default _default;
|