ll-plus 2.5.8 → 2.5.10
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/es/component.mjs +3 -1
- package/es/component.mjs.map +1 -1
- package/es/components/cropper/index.d.ts +0 -1237
- package/es/components/cropper/src/cropper-modal.vue.d.ts +0 -1237
- package/es/components/index.d.ts +1 -0
- package/es/components/watermark/index.d.ts +143 -0
- package/es/components/watermark/src/watermark.d.ts +4 -0
- package/es/components/watermark/src/watermark.vue.d.ts +136 -0
- package/es/index.mjs +1 -0
- package/es/index.mjs.map +1 -1
- package/es/packages/components/cropper/src/cropper-modal.vue2.mjs +22 -13
- package/es/packages/components/cropper/src/cropper-modal.vue2.mjs.map +1 -1
- package/es/packages/components/index.mjs +1 -0
- package/es/packages/components/index.mjs.map +1 -1
- package/es/packages/components/watermark/index.mjs +10 -0
- package/es/packages/components/watermark/index.mjs.map +1 -0
- package/es/packages/components/watermark/src/watermark.mjs +2 -0
- package/es/packages/components/watermark/src/watermark.mjs.map +1 -0
- package/es/packages/components/watermark/src/watermark.vue.mjs +8 -0
- package/es/packages/components/watermark/src/watermark.vue.mjs.map +1 -0
- package/es/packages/components/watermark/src/watermark.vue2.mjs +34 -0
- package/es/packages/components/watermark/src/watermark.vue2.mjs.map +1 -0
- package/es/packages/hooks/use-scroll/index.mjs +27 -1
- package/es/packages/hooks/use-scroll/index.mjs.map +1 -1
- package/global.d.ts +1 -0
- package/index.full.js +269 -201
- package/index.full.min.js +23 -23
- package/index.full.min.js.map +1 -1
- package/index.full.min.mjs +23 -23
- package/index.full.min.mjs.map +1 -1
- package/index.full.mjs +271 -204
- package/lib/component.js +3 -1
- package/lib/component.js.map +1 -1
- package/lib/components/cropper/index.d.ts +0 -1237
- package/lib/components/cropper/src/cropper-modal.vue.d.ts +0 -1237
- package/lib/components/index.d.ts +1 -0
- package/lib/components/watermark/index.d.ts +143 -0
- package/lib/components/watermark/src/watermark.d.ts +4 -0
- package/lib/components/watermark/src/watermark.vue.d.ts +136 -0
- package/lib/index.js +6 -4
- package/lib/index.js.map +1 -1
- package/lib/packages/components/cropper/src/cropper-modal.vue2.js +22 -13
- package/lib/packages/components/cropper/src/cropper-modal.vue2.js.map +1 -1
- package/lib/packages/components/index.js +2 -0
- package/lib/packages/components/index.js.map +1 -1
- package/lib/packages/components/watermark/index.js +15 -0
- package/lib/packages/components/watermark/index.js.map +1 -0
- package/lib/packages/components/watermark/src/watermark.js +4 -0
- package/lib/packages/components/watermark/src/watermark.js.map +1 -0
- package/lib/packages/components/watermark/src/watermark.vue.js +12 -0
- package/lib/packages/components/watermark/src/watermark.vue.js.map +1 -0
- package/lib/packages/components/watermark/src/watermark.vue2.js +38 -0
- package/lib/packages/components/watermark/src/watermark.vue2.js.map +1 -0
- package/lib/packages/hooks/use-scroll/index.js +26 -0
- package/lib/packages/hooks/use-scroll/index.js.map +1 -1
- package/package.json +1 -1
- package/theme-chalk/css/cropper.css +1 -1
- package/theme-chalk/css/index.css +2 -2
- package/theme-chalk/css/tooltip.css +1 -1
- package/types/packages/components/cropper/index.d.ts +0 -1237
- package/types/packages/components/cropper/src/cropper-modal.vue.d.ts +0 -1237
- package/types/packages/components/index.d.ts +1 -0
- package/types/packages/components/watermark/index.d.ts +143 -0
- package/types/packages/components/watermark/src/watermark.d.ts +4 -0
- package/types/packages/components/watermark/src/watermark.vue.d.ts +136 -0
package/es/components/index.d.ts
CHANGED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import Watermark from './src/watermark.vue';
|
|
2
|
+
export declare const LlWatermark: import("ll-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
3
|
+
attrs: {
|
|
4
|
+
[x: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
bem: {
|
|
7
|
+
b: (blockSuffix?: string) => string;
|
|
8
|
+
e: (element?: string) => string;
|
|
9
|
+
m: (modifier?: string) => string;
|
|
10
|
+
be: (blockSuffix?: string, element?: string) => string;
|
|
11
|
+
em: (element: string, modifier: string) => string;
|
|
12
|
+
bm: (blockSuffix: string, modifier: string) => string;
|
|
13
|
+
bem: (blockSuffix: string, element: string, modifier: string) => string;
|
|
14
|
+
is: (name?: string) => string;
|
|
15
|
+
};
|
|
16
|
+
readonly Watermark: {
|
|
17
|
+
new (...args: any[]): import("@vue/runtime-core").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
zIndex: NumberConstructor;
|
|
19
|
+
rotate: NumberConstructor;
|
|
20
|
+
width: NumberConstructor;
|
|
21
|
+
height: NumberConstructor;
|
|
22
|
+
image: StringConstructor;
|
|
23
|
+
content: {
|
|
24
|
+
type: import("vue").PropType<string | string[]>;
|
|
25
|
+
default: string | string[];
|
|
26
|
+
};
|
|
27
|
+
font: {
|
|
28
|
+
type: import("vue").PropType<import("ant-design-vue/es/watermark").WatermarkFontType>;
|
|
29
|
+
default: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
30
|
+
};
|
|
31
|
+
rootClassName: StringConstructor;
|
|
32
|
+
gap: {
|
|
33
|
+
type: import("vue").PropType<[number, number]>;
|
|
34
|
+
default: [number, number];
|
|
35
|
+
};
|
|
36
|
+
offset: {
|
|
37
|
+
type: import("vue").PropType<[number, number]>;
|
|
38
|
+
default: [number, number];
|
|
39
|
+
};
|
|
40
|
+
}>>, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
41
|
+
zIndex: NumberConstructor;
|
|
42
|
+
rotate: NumberConstructor;
|
|
43
|
+
width: NumberConstructor;
|
|
44
|
+
height: NumberConstructor;
|
|
45
|
+
image: StringConstructor;
|
|
46
|
+
content: {
|
|
47
|
+
type: import("vue").PropType<string | string[]>;
|
|
48
|
+
default: string | string[];
|
|
49
|
+
};
|
|
50
|
+
font: {
|
|
51
|
+
type: import("vue").PropType<import("ant-design-vue/es/watermark").WatermarkFontType>;
|
|
52
|
+
default: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
53
|
+
};
|
|
54
|
+
rootClassName: StringConstructor;
|
|
55
|
+
gap: {
|
|
56
|
+
type: import("vue").PropType<[number, number]>;
|
|
57
|
+
default: [number, number];
|
|
58
|
+
};
|
|
59
|
+
offset: {
|
|
60
|
+
type: import("vue").PropType<[number, number]>;
|
|
61
|
+
default: [number, number];
|
|
62
|
+
};
|
|
63
|
+
}>>, {
|
|
64
|
+
content: string | string[];
|
|
65
|
+
font: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
66
|
+
gap: [number, number];
|
|
67
|
+
offset: [number, number];
|
|
68
|
+
}, true, {}, {}, {
|
|
69
|
+
P: {};
|
|
70
|
+
B: {};
|
|
71
|
+
D: {};
|
|
72
|
+
C: {};
|
|
73
|
+
M: {};
|
|
74
|
+
Defaults: {};
|
|
75
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
76
|
+
zIndex: NumberConstructor;
|
|
77
|
+
rotate: NumberConstructor;
|
|
78
|
+
width: NumberConstructor;
|
|
79
|
+
height: NumberConstructor;
|
|
80
|
+
image: StringConstructor;
|
|
81
|
+
content: {
|
|
82
|
+
type: import("vue").PropType<string | string[]>;
|
|
83
|
+
default: string | string[];
|
|
84
|
+
};
|
|
85
|
+
font: {
|
|
86
|
+
type: import("vue").PropType<import("ant-design-vue/es/watermark").WatermarkFontType>;
|
|
87
|
+
default: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
88
|
+
};
|
|
89
|
+
rootClassName: StringConstructor;
|
|
90
|
+
gap: {
|
|
91
|
+
type: import("vue").PropType<[number, number]>;
|
|
92
|
+
default: [number, number];
|
|
93
|
+
};
|
|
94
|
+
offset: {
|
|
95
|
+
type: import("vue").PropType<[number, number]>;
|
|
96
|
+
default: [number, number];
|
|
97
|
+
};
|
|
98
|
+
}>>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
99
|
+
content: string | string[];
|
|
100
|
+
font: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
101
|
+
gap: [number, number];
|
|
102
|
+
offset: [number, number];
|
|
103
|
+
}>;
|
|
104
|
+
__isFragment?: undefined;
|
|
105
|
+
__isTeleport?: undefined;
|
|
106
|
+
__isSuspense?: undefined;
|
|
107
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
108
|
+
zIndex: NumberConstructor;
|
|
109
|
+
rotate: NumberConstructor;
|
|
110
|
+
width: NumberConstructor;
|
|
111
|
+
height: NumberConstructor;
|
|
112
|
+
image: StringConstructor;
|
|
113
|
+
content: {
|
|
114
|
+
type: import("vue").PropType<string | string[]>;
|
|
115
|
+
default: string | string[];
|
|
116
|
+
};
|
|
117
|
+
font: {
|
|
118
|
+
type: import("vue").PropType<import("ant-design-vue/es/watermark").WatermarkFontType>;
|
|
119
|
+
default: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
120
|
+
};
|
|
121
|
+
rootClassName: StringConstructor;
|
|
122
|
+
gap: {
|
|
123
|
+
type: import("vue").PropType<[number, number]>;
|
|
124
|
+
default: [number, number];
|
|
125
|
+
};
|
|
126
|
+
offset: {
|
|
127
|
+
type: import("vue").PropType<[number, number]>;
|
|
128
|
+
default: [number, number];
|
|
129
|
+
};
|
|
130
|
+
}>>, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
131
|
+
content: string | string[];
|
|
132
|
+
font: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
133
|
+
gap: [number, number];
|
|
134
|
+
offset: [number, number];
|
|
135
|
+
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]>;
|
|
136
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>;
|
|
137
|
+
export default LlWatermark;
|
|
138
|
+
export * from './src/watermark';
|
|
139
|
+
declare module 'vue' {
|
|
140
|
+
interface GlobalComponents {
|
|
141
|
+
LlWatermark: typeof Watermark;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
attrs: {
|
|
3
|
+
[x: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
bem: {
|
|
6
|
+
b: (blockSuffix?: string) => string;
|
|
7
|
+
e: (element?: string) => string;
|
|
8
|
+
m: (modifier?: string) => string;
|
|
9
|
+
be: (blockSuffix?: string, element?: string) => string;
|
|
10
|
+
em: (element: string, modifier: string) => string;
|
|
11
|
+
bm: (blockSuffix: string, modifier: string) => string;
|
|
12
|
+
bem: (blockSuffix: string, element: string, modifier: string) => string;
|
|
13
|
+
is: (name?: string) => string;
|
|
14
|
+
};
|
|
15
|
+
readonly Watermark: {
|
|
16
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
zIndex: NumberConstructor;
|
|
18
|
+
rotate: NumberConstructor;
|
|
19
|
+
width: NumberConstructor;
|
|
20
|
+
height: NumberConstructor;
|
|
21
|
+
image: StringConstructor;
|
|
22
|
+
content: {
|
|
23
|
+
type: import("vue").PropType<string | string[]>;
|
|
24
|
+
default: string | string[];
|
|
25
|
+
};
|
|
26
|
+
font: {
|
|
27
|
+
type: import("vue").PropType<import("ant-design-vue/es/watermark").WatermarkFontType>;
|
|
28
|
+
default: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
29
|
+
};
|
|
30
|
+
rootClassName: StringConstructor;
|
|
31
|
+
gap: {
|
|
32
|
+
type: import("vue").PropType<[number, number]>;
|
|
33
|
+
default: [number, number];
|
|
34
|
+
};
|
|
35
|
+
offset: {
|
|
36
|
+
type: import("vue").PropType<[number, number]>;
|
|
37
|
+
default: [number, number];
|
|
38
|
+
};
|
|
39
|
+
}>>, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
zIndex: NumberConstructor;
|
|
41
|
+
rotate: NumberConstructor;
|
|
42
|
+
width: NumberConstructor;
|
|
43
|
+
height: NumberConstructor;
|
|
44
|
+
image: StringConstructor;
|
|
45
|
+
content: {
|
|
46
|
+
type: import("vue").PropType<string | string[]>;
|
|
47
|
+
default: string | string[];
|
|
48
|
+
};
|
|
49
|
+
font: {
|
|
50
|
+
type: import("vue").PropType<import("ant-design-vue/es/watermark").WatermarkFontType>;
|
|
51
|
+
default: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
52
|
+
};
|
|
53
|
+
rootClassName: StringConstructor;
|
|
54
|
+
gap: {
|
|
55
|
+
type: import("vue").PropType<[number, number]>;
|
|
56
|
+
default: [number, number];
|
|
57
|
+
};
|
|
58
|
+
offset: {
|
|
59
|
+
type: import("vue").PropType<[number, number]>;
|
|
60
|
+
default: [number, number];
|
|
61
|
+
};
|
|
62
|
+
}>>, {
|
|
63
|
+
content: string | string[];
|
|
64
|
+
font: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
65
|
+
gap: [number, number];
|
|
66
|
+
offset: [number, number];
|
|
67
|
+
}, true, {}, {}, {
|
|
68
|
+
P: {};
|
|
69
|
+
B: {};
|
|
70
|
+
D: {};
|
|
71
|
+
C: {};
|
|
72
|
+
M: {};
|
|
73
|
+
Defaults: {};
|
|
74
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
75
|
+
zIndex: NumberConstructor;
|
|
76
|
+
rotate: NumberConstructor;
|
|
77
|
+
width: NumberConstructor;
|
|
78
|
+
height: NumberConstructor;
|
|
79
|
+
image: StringConstructor;
|
|
80
|
+
content: {
|
|
81
|
+
type: import("vue").PropType<string | string[]>;
|
|
82
|
+
default: string | string[];
|
|
83
|
+
};
|
|
84
|
+
font: {
|
|
85
|
+
type: import("vue").PropType<import("ant-design-vue/es/watermark").WatermarkFontType>;
|
|
86
|
+
default: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
87
|
+
};
|
|
88
|
+
rootClassName: StringConstructor;
|
|
89
|
+
gap: {
|
|
90
|
+
type: import("vue").PropType<[number, number]>;
|
|
91
|
+
default: [number, number];
|
|
92
|
+
};
|
|
93
|
+
offset: {
|
|
94
|
+
type: import("vue").PropType<[number, number]>;
|
|
95
|
+
default: [number, number];
|
|
96
|
+
};
|
|
97
|
+
}>>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
98
|
+
content: string | string[];
|
|
99
|
+
font: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
100
|
+
gap: [number, number];
|
|
101
|
+
offset: [number, number];
|
|
102
|
+
}>;
|
|
103
|
+
__isFragment?: undefined;
|
|
104
|
+
__isTeleport?: undefined;
|
|
105
|
+
__isSuspense?: undefined;
|
|
106
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
107
|
+
zIndex: NumberConstructor;
|
|
108
|
+
rotate: NumberConstructor;
|
|
109
|
+
width: NumberConstructor;
|
|
110
|
+
height: NumberConstructor;
|
|
111
|
+
image: StringConstructor;
|
|
112
|
+
content: {
|
|
113
|
+
type: import("vue").PropType<string | string[]>;
|
|
114
|
+
default: string | string[];
|
|
115
|
+
};
|
|
116
|
+
font: {
|
|
117
|
+
type: import("vue").PropType<import("ant-design-vue/es/watermark").WatermarkFontType>;
|
|
118
|
+
default: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
119
|
+
};
|
|
120
|
+
rootClassName: StringConstructor;
|
|
121
|
+
gap: {
|
|
122
|
+
type: import("vue").PropType<[number, number]>;
|
|
123
|
+
default: [number, number];
|
|
124
|
+
};
|
|
125
|
+
offset: {
|
|
126
|
+
type: import("vue").PropType<[number, number]>;
|
|
127
|
+
default: [number, number];
|
|
128
|
+
};
|
|
129
|
+
}>>, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
130
|
+
content: string | string[];
|
|
131
|
+
font: import("ant-design-vue/es/watermark").WatermarkFontType;
|
|
132
|
+
gap: [number, number];
|
|
133
|
+
offset: [number, number];
|
|
134
|
+
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]>;
|
|
135
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
136
|
+
export default _default;
|
package/es/index.mjs
CHANGED
|
@@ -123,6 +123,7 @@ export { uploadImageEmits, uploadImageProps } from './packages/components/upload
|
|
|
123
123
|
export { LlUploadImage } from './packages/components/upload-image/index.mjs';
|
|
124
124
|
export { getHttpMethodUri, httpUriOptions, uriInputEmits, uriInputProps } from './packages/components/uri-input/src/uri-input.mjs';
|
|
125
125
|
export { LlUriInput } from './packages/components/uri-input/index.mjs';
|
|
126
|
+
export { LlWatermark } from './packages/components/watermark/index.mjs';
|
|
126
127
|
export { buildProp, buildProps, definePropType, epPropKey, isEpProp } from './packages/utils/props/runtime.mjs';
|
|
127
128
|
export { addUnit } from './packages/utils/add-unit.mjs';
|
|
128
129
|
export { createNamespace } from './packages/utils/create-namespace.mjs';
|
package/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../packages/ll-plus/index.ts"],"sourcesContent":["import installer from './defaults'\n\nexport * from '@ll-plus/components'\nexport * from '@ll-plus/constant'\nexport * from '@ll-plus/utils'\nexport * from '@ll-plus/hooks'\n\nexport const install = installer.install\nexport default installer\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../packages/ll-plus/index.ts"],"sourcesContent":["import installer from './defaults'\n\nexport * from '@ll-plus/components'\nexport * from '@ll-plus/constant'\nexport * from '@ll-plus/utils'\nexport * from '@ll-plus/hooks'\n\nexport const install = installer.install\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,UAAU,SAAU,CAAA;;;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { defineComponent, ref, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createElementVNode, normalizeClass, unref, createBlock, createCommentVNode, renderSlot } from 'vue';
|
|
2
|
-
import { Upload } from 'ant-design-vue';
|
|
3
2
|
import '../../../utils/index.mjs';
|
|
4
3
|
import CropperImage from './cropper-image.vue.mjs';
|
|
5
4
|
import { cropperModalProps, cropperModalEmits } from './cropper-image.mjs';
|
|
@@ -62,8 +61,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
61
|
const _component_ll_icon = resolveComponent("ll-icon");
|
|
63
62
|
const _component_ll_button = resolveComponent("ll-button");
|
|
64
63
|
const _component_ll_tooltip = resolveComponent("ll-tooltip");
|
|
64
|
+
const _component_a_upload = resolveComponent("a-upload");
|
|
65
65
|
const _component_ll_space = resolveComponent("ll-space");
|
|
66
|
-
const
|
|
66
|
+
const _component_ll_image = resolveComponent("ll-image");
|
|
67
67
|
const _component_ll_modal = resolveComponent("ll-modal");
|
|
68
68
|
return openBlock(), createElementBlock(
|
|
69
69
|
Fragment,
|
|
@@ -116,7 +116,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
116
116
|
class: normalizeClass(unref(bem).e("toolbar"))
|
|
117
117
|
},
|
|
118
118
|
[
|
|
119
|
-
createVNode(
|
|
119
|
+
createVNode(_component_a_upload, {
|
|
120
120
|
"file-list": [],
|
|
121
121
|
accept: "image/*",
|
|
122
122
|
"before-upload": handleBeforeUpload
|
|
@@ -335,21 +335,29 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
335
335
|
class: normalizeClass(unref(bem).e("group"))
|
|
336
336
|
},
|
|
337
337
|
[
|
|
338
|
-
createVNode(
|
|
338
|
+
createVNode(_component_ll_image, {
|
|
339
|
+
preview: false,
|
|
339
340
|
src: previewSource.value,
|
|
340
|
-
|
|
341
|
+
width: 32,
|
|
342
|
+
height: 32
|
|
341
343
|
}, null, 8, ["src"]),
|
|
342
|
-
createVNode(
|
|
344
|
+
createVNode(_component_ll_image, {
|
|
345
|
+
preview: false,
|
|
343
346
|
src: previewSource.value,
|
|
344
|
-
|
|
347
|
+
width: 48,
|
|
348
|
+
height: 48
|
|
345
349
|
}, null, 8, ["src"]),
|
|
346
|
-
createVNode(
|
|
350
|
+
createVNode(_component_ll_image, {
|
|
351
|
+
preview: false,
|
|
347
352
|
src: previewSource.value,
|
|
348
|
-
|
|
353
|
+
width: 64,
|
|
354
|
+
height: 64
|
|
349
355
|
}, null, 8, ["src"]),
|
|
350
|
-
createVNode(
|
|
356
|
+
createVNode(_component_ll_image, {
|
|
357
|
+
preview: false,
|
|
351
358
|
src: previewSource.value,
|
|
352
|
-
|
|
359
|
+
width: 80,
|
|
360
|
+
height: 80
|
|
353
361
|
}, null, 8, ["src"])
|
|
354
362
|
],
|
|
355
363
|
2
|
|
@@ -375,9 +383,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
375
383
|
},
|
|
376
384
|
[
|
|
377
385
|
renderSlot(_ctx.$slots, "default", { src: avatar.value }, () => [
|
|
378
|
-
createVNode(
|
|
386
|
+
createVNode(_component_ll_image, {
|
|
379
387
|
src: avatar.value,
|
|
380
|
-
|
|
388
|
+
width: 64,
|
|
389
|
+
height: 64
|
|
381
390
|
}, null, 8, ["src"])
|
|
382
391
|
])
|
|
383
392
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cropper-modal.vue2.mjs","sources":["../../../../../../packages/components/cropper/src/cropper-modal.vue"],"sourcesContent":["<template>\n <ll-modal\n :open=\"open\"\n :title=\"'图片裁剪'\"\n width=\"800px\"\n :keyboard=\"false\"\n :mask-closable=\"false\"\n :ok-text=\"'确定'\"\n @cancel=\"open = false\"\n @ok=\"handleOk\"\n >\n <div :class=\"bem.b()\">\n <div :class=\"bem.e('left')\">\n <div :class=\"bem.e('cropper')\">\n <cropper-image\n v-if=\"src\"\n :src=\"src\"\n height=\"300px\"\n :circled=\"circled\"\n @cropend=\"handleCropend\"\n @on-ready=\"handleReady\"\n />\n </div>\n <div :class=\"bem.e('toolbar')\">\n <
|
|
1
|
+
{"version":3,"file":"cropper-modal.vue2.mjs","sources":["../../../../../../packages/components/cropper/src/cropper-modal.vue"],"sourcesContent":["<template>\n <ll-modal\n :open=\"open\"\n :title=\"'图片裁剪'\"\n width=\"800px\"\n :keyboard=\"false\"\n :mask-closable=\"false\"\n :ok-text=\"'确定'\"\n @cancel=\"open = false\"\n @ok=\"handleOk\"\n >\n <div :class=\"bem.b()\">\n <div :class=\"bem.e('left')\">\n <div :class=\"bem.e('cropper')\">\n <cropper-image\n v-if=\"src\"\n :src=\"src\"\n height=\"300px\"\n :circled=\"circled\"\n @cropend=\"handleCropend\"\n @on-ready=\"handleReady\"\n />\n </div>\n <div :class=\"bem.e('toolbar')\">\n <a-upload\n :file-list=\"[]\"\n accept=\"image/*\"\n :before-upload=\"handleBeforeUpload\"\n >\n <ll-tooltip :title=\"'选择图片'\" placement=\"bottom\">\n <ll-button\n type=\"primary\"\n size=\"small\"\n @click=\"handlerToolbar('reset')\"\n >\n <ll-icon icon-name=\"icon-upload\" />\n </ll-button>\n </ll-tooltip>\n </a-upload>\n <ll-space>\n <ll-tooltip :tip=\"'重置'\" placement=\"bottom\">\n <ll-button\n type=\"primary\"\n size=\"small\"\n :disabled=\"!src\"\n @click=\"handlerToolbar('reset')\"\n >\n <ll-icon icon-name=\"icon-refresh\" />\n </ll-button>\n </ll-tooltip>\n <ll-tooltip :tip=\"'逆时针旋转'\" placement=\"bottom\">\n <ll-button\n type=\"primary\"\n size=\"small\"\n :disabled=\"!src\"\n @click=\"handlerToolbar('rotate', -45)\"\n >\n <ll-icon icon-name=\"icon-counter-clockwise\" />\n </ll-button>\n </ll-tooltip>\n <ll-tooltip :tip=\"'顺时针旋转'\" placement=\"bottom\">\n <ll-button\n type=\"primary\"\n size=\"small\"\n :disabled=\"!src\"\n @click=\"handlerToolbar('rotate', 45)\"\n >\n <ll-icon icon-name=\"icon-flip-horizontal\" />\n </ll-button>\n </ll-tooltip>\n <ll-tooltip :tip=\"'水平翻转'\" placement=\"bottom\">\n <ll-button\n type=\"primary\"\n size=\"small\"\n :disabled=\"!src\"\n @click=\"handlerToolbar('scaleX')\"\n >\n <ll-icon icon-name=\"icon-flip-horizontal\" />\n </ll-button>\n </ll-tooltip>\n <ll-tooltip :tip=\"'垂直翻转'\" placement=\"bottom\">\n <ll-button\n type=\"primary\"\n size=\"small\"\n :disabled=\"!src\"\n @click=\"handlerToolbar('scaleY')\"\n >\n <ll-icon icon-name=\"icon-flip-vertical\" />\n </ll-button>\n </ll-tooltip>\n <ll-tooltip :tip=\"'放大'\" placement=\"bottom\">\n <ll-button\n type=\"primary\"\n size=\"small\"\n :disabled=\"!src\"\n @click=\"handlerToolbar('zoom', 0.1)\"\n >\n <ll-icon icon-name=\"icon-amplify1\" />\n </ll-button>\n </ll-tooltip>\n <ll-tooltip :tip=\"'缩小'\" placement=\"bottom\">\n <ll-button\n type=\"primary\"\n size=\"small\"\n :disabled=\"!src\"\n @click=\"handlerToolbar('zoom', -0.1)\"\n >\n <ll-icon icon-name=\"icon-scale\" />\n </ll-button>\n </ll-tooltip>\n </ll-space>\n </div>\n </div>\n <div :class=\"bem.e('right')\">\n <div :class=\"bem.e('preview')\">\n <img v-if=\"previewSource\" :src=\"previewSource\" :alt=\"'预览'\" />\n </div>\n <template v-if=\"previewSource\">\n <div :class=\"bem.e('group')\">\n <ll-image\n :preview=\"false\"\n :src=\"previewSource\"\n :width=\"32\"\n :height=\"32\"\n />\n <ll-image\n :preview=\"false\"\n :src=\"previewSource\"\n :width=\"48\"\n :height=\"48\"\n />\n <ll-image\n :preview=\"false\"\n :src=\"previewSource\"\n :width=\"64\"\n :height=\"64\"\n />\n <ll-image\n :preview=\"false\"\n :src=\"previewSource\"\n :width=\"80\"\n :height=\"80\"\n />\n </div>\n </template>\n </div>\n </div>\n </ll-modal>\n <div :class=\"bem.e('cropper-avatar')\" @click=\"handleOpen\">\n <slot :src=\"avatar\">\n <ll-image :src=\"avatar\" :width=\"64\" :height=\"64\" />\n </slot>\n </div>\n</template>\n<script lang=\"ts\" setup>\n//@ts-ignore\nimport type Cropper from 'cropperjs'\n\nimport { ref } from 'vue'\nimport { createNamespace, dataURLtoBlob, type Nullable } from '@ll-plus/utils'\nimport CropperImage from './cropper-image.vue'\nimport {\n cropperModalProps,\n cropperModalEmits,\n type CropendResult\n} from './cropper-image'\n\ndefineOptions({ name: 'LlCropperModal' })\nconst props = defineProps(cropperModalProps)\nconst emits = defineEmits(cropperModalEmits)\nconst bem = createNamespace('cropper-modal')\nconst src = ref(props.avatar || '')\nconst avatar = ref(props.avatar || '')\nconst open = ref(false)\nconst previewSource = ref('')\n\nconst cropper = ref<Nullable<Cropper>>()\nlet scaleX = 1\nlet scaleY = 1\n\n// Block upload\nfunction handleBeforeUpload(file: File) {\n const reader = new FileReader()\n reader.readAsDataURL(file)\n src.value = ''\n previewSource.value = ''\n reader.onload = function (e) {\n src.value = (e.target?.result as string) ?? ''\n // filename = file.name\n }\n return false\n}\nfunction handleOpen() {\n open.value = true\n}\nfunction handleCropend({ imgBase64 }: CropendResult) {\n previewSource.value = imgBase64\n}\n\nfunction handleReady(cropperInstance: Cropper) {\n cropper.value = cropperInstance\n}\nfunction handlerToolbar(event: string, arg?: number) {\n if (event === 'scaleX') {\n scaleX = arg = scaleX === -1 ? 1 : -1\n }\n if (event === 'scaleY') {\n scaleY = arg = scaleY === -1 ? 1 : -1\n }\n cropper?.value?.[event]?.(arg)\n}\n\nasync function handleOk() {\n const blob = dataURLtoBlob(previewSource.value)\n emits('confirm', { blob, previewSource: previewSource.value })\n avatar.value = previewSource.value\n open.value = false\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAwKA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AACd,IAAM,MAAA,GAAA,GAAM,gBAAgB,eAAe,CAAA,CAAA;AAC3C,IAAA,MAAM,GAAM,GAAA,GAAA,CAAI,KAAM,CAAA,MAAA,IAAU,EAAE,CAAA,CAAA;AAClC,IAAA,MAAM,MAAS,GAAA,GAAA,CAAI,KAAM,CAAA,MAAA,IAAU,EAAE,CAAA,CAAA;AACrC,IAAM,MAAA,IAAA,GAAO,IAAI,KAAK,CAAA,CAAA;AACtB,IAAM,MAAA,aAAA,GAAgB,IAAI,EAAE,CAAA,CAAA;AAE5B,IAAA,MAAM,UAAU,GAAuB,EAAA,CAAA;AACvC,IAAA,IAAI,MAAS,GAAA,CAAA,CAAA;AACb,IAAA,IAAI,MAAS,GAAA,CAAA,CAAA;AAGb,IAAA,SAAS,mBAAmB,IAAY,EAAA;AACtC,MAAM,MAAA,MAAA,GAAS,IAAI,UAAW,EAAA,CAAA;AAC9B,MAAA,MAAA,CAAO,cAAc,IAAI,CAAA,CAAA;AACzB,MAAA,GAAA,CAAI,KAAQ,GAAA,EAAA,CAAA;AACZ,MAAA,aAAA,CAAc,KAAQ,GAAA,EAAA,CAAA;AACtB,MAAO,MAAA,CAAA,MAAA,GAAS,SAAU,CAAG,EAAA;AAC3B,QAAI,GAAA,CAAA,KAAA,GAAS,CAAE,CAAA,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -52,6 +52,7 @@ export { LlDropdown, LlDropdownButton } from './dropdown/index.mjs';
|
|
|
52
52
|
export { LlUploadDrag } from './upload-drag/index.mjs';
|
|
53
53
|
export { LlUploadImage } from './upload-image/index.mjs';
|
|
54
54
|
export { LlUriInput } from './uri-input/index.mjs';
|
|
55
|
+
export { LlWatermark } from './watermark/index.mjs';
|
|
55
56
|
export { ALL_VALUE, advancedFilteringEmits, advancedFilteringParamsEmits, advancedFilteringParamsProps, advancedFilteringProps, advancedFilteringTagsEmits, filterAllValue, findLabelByValue, hasValue, initValue, treeDataFormat } from './advanced-filtering/src/advanced-filtering.mjs';
|
|
56
57
|
export { DEFAULT_METHOD, apiComponentEmits, apiComponentProps, bodyList, requestList } from './api-component/src/config/api-component.mjs';
|
|
57
58
|
export { apiModalEmits, apiModalProps } from './api-component/src/config/api-modal.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import '../../utils/index.mjs';
|
|
2
|
+
import Watermark from './src/watermark.vue.mjs';
|
|
3
|
+
import './src/watermark.mjs';
|
|
4
|
+
import { withInstall } from '../../utils/with-install.mjs';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const LlWatermark = withInstall(Watermark);
|
|
8
|
+
|
|
9
|
+
export { LlWatermark, LlWatermark as default };
|
|
10
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/watermark/index.ts"],"sourcesContent":["import { withInstall } from '@ll-plus/utils'\n\nimport Watermark from './src/watermark.vue'\n\nexport const LlWatermark = withInstall(Watermark)\n\nexport default LlWatermark\n\nexport * from './src/watermark'\n\ndeclare module 'vue' {\n export interface GlobalComponents {\n LlWatermark: typeof Watermark\n }\n}\n"],"names":[],"mappings":";;;;;;AAIa,MAAA,WAAA,GAAc,YAAY,SAAS;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watermark.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _sfc_main from './watermark.vue2.mjs';
|
|
2
|
+
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
var Watermark = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "watermark.vue"]]);
|
|
6
|
+
|
|
7
|
+
export { Watermark as default };
|
|
8
|
+
//# sourceMappingURL=watermark.vue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watermark.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, openBlock, createBlock, unref, mergeProps, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
|
+
import { Watermark } from 'ant-design-vue';
|
|
3
|
+
import '../../../utils/index.mjs';
|
|
4
|
+
import { createNamespace } from '../../../utils/create-namespace.mjs';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
...{ name: "LlWatermark" },
|
|
9
|
+
__name: "watermark",
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const attrs = useAttrs();
|
|
12
|
+
const bem = createNamespace("watermark");
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return openBlock(), createBlock(unref(Watermark), mergeProps(unref(attrs), {
|
|
15
|
+
class: unref(bem).b()
|
|
16
|
+
}), createSlots({
|
|
17
|
+
_: 2
|
|
18
|
+
/* DYNAMIC */
|
|
19
|
+
}, [
|
|
20
|
+
renderList(Object.keys(_ctx.$slots), (item) => {
|
|
21
|
+
return {
|
|
22
|
+
name: item,
|
|
23
|
+
fn: withCtx((data) => [
|
|
24
|
+
renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
|
|
25
|
+
])
|
|
26
|
+
};
|
|
27
|
+
})
|
|
28
|
+
]), 1040, ["class"]);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export { _sfc_main as default };
|
|
34
|
+
//# sourceMappingURL=watermark.vue2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watermark.vue2.mjs","sources":["../../../../../../packages/components/watermark/src/watermark.vue"],"sourcesContent":["<template>\n <Watermark v-bind=\"attrs\" :class=\"bem.b()\">\n <template v-for=\"item in Object.keys($slots)\" #[item]=\"data\">\n <slot :name=\"item\" v-bind=\"data || {}\" />\n </template>\n </Watermark>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useAttrs } from 'vue'\nimport { Watermark } from 'ant-design-vue'\nimport { createNamespace } from '@ll-plus/utils'\ndefineOptions({ name: 'LlWatermark' })\n\nconst attrs = useAttrs()\nconst bem = createNamespace('watermark')\n</script>\n"],"names":[],"mappings":";;;;;;;;;;AAcA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,IAAM,MAAA,GAAA,GAAM,gBAAgB,WAAW,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, watch, onUnmounted } from 'vue';
|
|
1
|
+
import { ref, watch, onMounted, onUnmounted } from 'vue';
|
|
2
2
|
|
|
3
3
|
"use strict";
|
|
4
4
|
function useScroll() {
|
|
@@ -50,6 +50,32 @@ function useScroll() {
|
|
|
50
50
|
deep: true
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
+
onMounted(() => {
|
|
54
|
+
});
|
|
55
|
+
watch(
|
|
56
|
+
scrollRef,
|
|
57
|
+
() => {
|
|
58
|
+
if (scrollRef.value) {
|
|
59
|
+
if (!observer) {
|
|
60
|
+
observer = new ResizeObserver(() => {
|
|
61
|
+
if (scrollRef.value) {
|
|
62
|
+
if (scrollRef.value.scrollHeight > scrollRef.value.offsetHeight) {
|
|
63
|
+
isHasScrollBar.value = true;
|
|
64
|
+
} else {
|
|
65
|
+
isHasScrollBar.value = false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
scrollRef.value.addEventListener("scroll", handleScroll);
|
|
70
|
+
observer.observe(scrollRef.value);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
immediate: true,
|
|
76
|
+
deep: true
|
|
77
|
+
}
|
|
78
|
+
);
|
|
53
79
|
onUnmounted(() => {
|
|
54
80
|
if (observer) {
|
|
55
81
|
observer.disconnect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-scroll/index.ts"],"sourcesContent":["/**\n * @description: 用于监听滚动行为/window的resize监听/滚动区域内的dom动态增删dom来添加阴影\n * @return {HTMLElement} elementRef 要滚动监听的dom\n * @return {scrollPosition} IScrollPosition 监听的位置\n */\nimport { onUnmounted, ref, watch } from 'vue'\n\ntype IScrollPosition = 'top' | 'scrolling' | 'bottom' // 滚动到最顶部、滚动中、滚动到最底部\n\nexport function useScroll() {\n const scrollRef = ref<HTMLElement>() // 监听滚动的dom\n const scrollPosition = ref<IScrollPosition>() // 滚动到的位置\n const isHasScrollBar = ref(false) // 是否有滚动条\n let observer: ResizeObserver // 监听dom内容发生变化\n\n // 滚动事件\n const handleScroll = (event: Event) => {\n const target = event.target as HTMLElement\n getSrcollPosition(target)\n }\n // 判断滚动位置\n const getSrcollPosition = (target: HTMLElement) => {\n // 判断是否有滚动体条\n if (target.scrollHeight > target.offsetHeight) {\n isHasScrollBar.value = true\n } else {\n isHasScrollBar.value = false\n }\n if (!!target.scrollTop) {\n // 有0.5px的误差 故-1\n if (target.scrollTop + target.offsetHeight >= target.scrollHeight - 1) {\n // 在最底部\n scrollPosition.value = 'bottom'\n } else {\n // 滚动中\n scrollPosition.value = 'scrolling'\n }\n } else {\n // 在最顶部\n scrollPosition.value = 'top'\n }\n }\n\n // 监听滚动容器高度的变化\n watch(\n scrollRef,\n () => {\n if (scrollRef.value) {\n if (!observer) {\n observer = new ResizeObserver(() => {\n if (scrollRef.value) {\n // 检查容器的高度变化\n if (\n scrollRef.value!.scrollHeight > scrollRef.value!.offsetHeight\n ) {\n isHasScrollBar.value = true\n } else {\n isHasScrollBar.value = false\n }\n }\n })\n scrollRef.value!.addEventListener('scroll', handleScroll)\n observer.observe(scrollRef.value)\n }\n }\n },\n {\n immediate: true,\n deep: true\n }\n )\n\n // 组件卸载停止监听\n onUnmounted(() => {\n if (observer) {\n observer.disconnect()\n }\n })\n\n return { scrollRef, isHasScrollBar, scrollPosition }\n}\n"],"names":[],"mappings":";;;AASO,SAAS,SAAY,GAAA;AAC1B,EAAA,MAAM,YAAY,GAAiB,EAAA,CAAA;AACnC,EAAA,MAAM,iBAAiB,GAAqB,EAAA,CAAA;AAC5C,EAAM,MAAA,cAA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,KAAA,CAAA;AAAA,eACzB;AAAA,aACF;AAAA,WACD,CAAA,CAAA;AACD,UAAU,SAAA,CAAA,KAAA,CAAO,gBAAiB,CAAA,QAAA,EAAU,YAAY,CAAA,CAAA;AACxD,UAAS,QAAA,CAAA,OAAA,CAAQ,UAAU,KAAK,CAAA,CAAA;AAAA,SAClC;AAAA,OACF;AAAA,KACF;AAAA,IACA;AAAA,MACE,SAAW,EAAA,IAAA;AAAA,MACX,IAAM,EAAA,IAAA;AAAA,KACR;AAAA,GACF,CAAA;AAGA,EAAA,WAAA,CAAY,MAAM;AAChB,IAAA,IAAI,QAAU,EAAA;AACZ,MAAA,QAAA,CAAS,UAAW,EAAA,CAAA;AAAA,KACtB;AAAA,GACD,CAAA,CAAA;AAED,EAAO,OAAA,EAAE,SAAW,EAAA,cAAA,EAAgB,cAAe,EAAA,CAAA;AACrD;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-scroll/index.ts"],"sourcesContent":["/**\n * @description: 用于监听滚动行为/window的resize监听/滚动区域内的dom动态增删dom来添加阴影\n * @return {HTMLElement} elementRef 要滚动监听的dom\n * @return {scrollPosition} IScrollPosition 监听的位置\n */\nimport { onMounted, onUnmounted, ref, watch } from 'vue'\n\ntype IScrollPosition = 'top' | 'scrolling' | 'bottom' // 滚动到最顶部、滚动中、滚动到最底部\n\nexport function useScroll() {\n const scrollRef = ref<HTMLElement>() // 监听滚动的dom\n const scrollPosition = ref<IScrollPosition>() // 滚动到的位置\n const isHasScrollBar = ref(false) // 是否有滚动条\n let observer: ResizeObserver // 监听dom内容发生变化\n\n // 滚动事件\n const handleScroll = (event: Event) => {\n const target = event.target as HTMLElement\n getSrcollPosition(target)\n }\n // 判断滚动位置\n const getSrcollPosition = (target: HTMLElement) => {\n // 判断是否有滚动体条\n if (target.scrollHeight > target.offsetHeight) {\n isHasScrollBar.value = true\n } else {\n isHasScrollBar.value = false\n }\n if (!!target.scrollTop) {\n // 有0.5px的误差 故-1\n if (target.scrollTop + target.offsetHeight >= target.scrollHeight - 1) {\n // 在最底部\n scrollPosition.value = 'bottom'\n } else {\n // 滚动中\n scrollPosition.value = 'scrolling'\n }\n } else {\n // 在最顶部\n scrollPosition.value = 'top'\n }\n }\n\n // 监听滚动容器高度的变化\n watch(\n scrollRef,\n () => {\n if (scrollRef.value) {\n if (!observer) {\n observer = new ResizeObserver(() => {\n if (scrollRef.value) {\n // 检查容器的高度变化\n if (\n scrollRef.value!.scrollHeight > scrollRef.value!.offsetHeight\n ) {\n isHasScrollBar.value = true\n } else {\n isHasScrollBar.value = false\n }\n }\n })\n scrollRef.value!.addEventListener('scroll', handleScroll)\n observer.observe(scrollRef.value)\n }\n }\n },\n {\n immediate: true,\n deep: true\n }\n )\n\n onMounted(() => {})\n watch(\n scrollRef,\n () => {\n if (scrollRef.value) {\n if (!observer) {\n observer = new ResizeObserver(() => {\n if (scrollRef.value) {\n // 检查容器的高度变化\n if (\n scrollRef.value!.scrollHeight > scrollRef.value!.offsetHeight\n ) {\n isHasScrollBar.value = true\n } else {\n isHasScrollBar.value = false\n }\n }\n })\n scrollRef.value!.addEventListener('scroll', handleScroll)\n observer.observe(scrollRef.value)\n }\n }\n },\n {\n immediate: true,\n deep: true\n }\n )\n\n // 组件卸载停止监听\n onUnmounted(() => {\n if (observer) {\n observer.disconnect()\n }\n })\n\n return { scrollRef, isHasScrollBar, scrollPosition }\n}\n"],"names":[],"mappings":";;;AASO,SAAS,SAAY,GAAA;AAC1B,EAAA,MAAM,YAAY,GAAiB,EAAA,CAAA;AACnC,EAAA,MAAM,iBAAiB,GAAqB,EAAA,CAAA;AAC5C,EAAM,MAAA,cAAA,GAAiB,IAAI,KAAK,CAAA,CAAA;AAChC,EAAI,IAAA,QAAA,CAAA;AAGJ,EAAM,MAAA,YAAA,GAAe,CAAC,KAAiB,KAAA;AACrC,IAAA,MAAM,SAAS,KAAM,CAAA,MAAA,CAAA;AACrB,IAAA,iBAAA,CAAkB,MAAM,CA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|
41
41
|
LlTreeSearch: typeof import('ll-plus')['LlTreeSearch']
|
|
42
42
|
LlUriIput: typeof import('ll-plus')['LlUriIput']
|
|
43
|
+
LlWatermark: typeof import('ll-plus')['LlWatermark']
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
|