@eonova/v3-directives 1.0.6

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Eonova
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # ☠v3-directives
2
+
3
+ ![screenshot](https://cdn.jsdelivr.net/gh/eonova/picx-images/local/5465730512d71722380d1ecd6d7db6ae.png)
4
+
5
+ ☠Vue3 directives 自定义指令库: [📖 在线文档](https://v3-directives.leostar.top/)
6
+
7
+ ![Static Badge](https://img.shields.io/npm/v/@eonova/v3-directives?color=409eff)
8
+ ![Static Badge](https://img.shields.io/github/stars/eonova/v3-directives?style=social)
9
+
10
+ ## 🕹Usage
11
+
12
+ 1. Install package (安装依赖)
13
+
14
+ ```bash
15
+ pnpm add @eonova/v3-directives
16
+ # or
17
+ npm install @eonova/v3-directives --save
18
+ ```
19
+
20
+ 1. Registration Directive (注册指令)
21
+
22
+ ```typescript
23
+ import VueDirectives from '@eonova/v3-directives'
24
+ const app = createApp(App)
25
+ app.use(router).mount('#app')
26
+ app.use(VueDirectives)
27
+ ```
28
+
29
+ ## 🧩Directives
30
+
31
+ | Directive | Description |
32
+ | ------------------------------------------------------------------------------------- | ------------------------------------------------- |
33
+ | [v-backtop](https://v3-directives.leostar.top/zh/directives/v-backtop.html) | Add a return to top function for an element |
34
+ | [v-clickOutside](https://v3-directives.leostar.top/zh/directives/v-clickOutside.html) | Event when clicking outside the element triggers |
35
+ | [v-copy](https://v3-directives.leostar.top/zh/directives/v-copy.html) | Copy the passed value to the clipboard |
36
+ | [v-debounce](https://v3-directives.leostar.top/zh/directives/v-debounce.html) | Anti-shaking function |
37
+ | [v-doubleClick](https://v3-directives.leostar.top/zh/directives/v-doubleClick.html) | Trigger an event on double-click |
38
+ | [v-draggable](https://v3-directives.leostar.top/zh/directives/v-draggable.html) | Makes elements draggable |
39
+ | [v-ellipsis](https://v3-directives.leostar.top/zh/directives/v-ellipsis.html) | Omit excess text |
40
+ | [v-emoji](https://v3-directives.leostar.top/zh/directives/v-emoji.html) | Prohibit emoji input |
41
+ | [v-empty](https://v3-directives.leostar.top/zh/directives/v-empty.html) | Used to display empty status |
42
+ | [v-flicker](https://v3-directives.leostar.top/zh/directives/v-flicker.html) | Element flicker |
43
+ | [v-focus](https://v3-directives.leostar.top/zh/directives/v-focus.html) | Input box autofocus |
44
+ | [v-highlight](https://v3-directives.leostar.top/zh/directives/v-highlight.html) | Text highlighting |
45
+ | [v-hover](https://v3-directives.leostar.top/zh/directives/v-hover.html) | Triggers a callback after the element |
46
+ | [v-input](https://v3-directives.leostar.top/zh/directives/v-input.html) | Input formatting |
47
+ | [v-lazyImg](https://v3-directives.leostar.top/zh/directives/v-lazyImg.html) | Lazy image loading |
48
+ | [v-loading](https://v3-directives.leostar.top/zh/directives/v-loading.html) | Add loading animation |
49
+ | [v-longpress](https://v3-directives.leostar.top/zh/directives/v-longpress.html) | Trigger event when long pressing an element |
50
+ | [v-money](https://v3-directives.leostar.top/zh/directives/v-money.html) | Format numbers into money format |
51
+ | [v-onOnce](https://v3-directives.leostar.top/zh/directives/v-onOnce.html) | Only one callback is triggered |
52
+ | [v-permission](https://v3-directives.leostar.top/zh/directives/v-permission.html) | Rapid realization of authentication |
53
+ | [v-resize](https://v3-directives.leostar.top/zh/directives/v-resize.html) | Response to resize the element |
54
+ | [v-ripple](https://v3-directives.leostar.top/zh/directives/v-ripple.html) | Add ripple dynamic effects to the clicked element |
55
+ | [v-slideIn](https://v3-directives.leostar.top/zh/directives/v-slideIn.html) | Add entry animation |
56
+ | [v-throttle](https://v3-directives.leostar.top/zh/directives/v-throttle.html) | Throttling function |
57
+ | [v-waterMarker](https://v3-directives.leostar.top/zh/directives/v-waterMarker.html) | Add custom watermark |
58
+
59
+ ## 💖Contributors
60
+
61
+ Contributions are welcome, PR is welcome, More references [Participate in Open source](https://v3-directives.leostar.top/en/about/contribution.html)
@@ -0,0 +1,199 @@
1
+ import { Directive, DirectiveBinding, App } from 'vue';
2
+
3
+ /**
4
+ * @description: v-backtop指令
5
+ * @LastEditors: eonova
6
+ * @LastEditTime: 2024/02/13 14:05:16
7
+ * @description: 为元素添加返回顶部功能
8
+ */
9
+
10
+ declare const vBackTop: Directive;
11
+
12
+ /**
13
+ * @description: v-clickOutside指令
14
+ * @LastEditors: eonova
15
+ * @LastEditTime: 2024/02/07 11:12:16
16
+ * @description: 点击元素外部触发时事件
17
+ */
18
+
19
+ declare const vClickOut: Directive;
20
+
21
+ /**
22
+ * @description: v-copy指令
23
+ * @LastEditors: eonova
24
+ * @LastEditTime: 2024/02/07 11:12:16
25
+ * @description: 实现文本复制到剪贴板功能
26
+ */
27
+
28
+ declare const vCopy: Directive;
29
+
30
+ declare const vDebounce: Directive;
31
+
32
+ /**
33
+ * @description: v-doubleClick指令
34
+ * @LastEditors: eonova
35
+ * @LastEditTime: 2024/02/07 11:12:16
36
+ * @description: 双击触发事件
37
+ */
38
+
39
+ declare const vDoubleClick: Directive;
40
+
41
+ /**
42
+ * @description: v-draggable指令
43
+ * @LastEditors: eonova
44
+ * @LastEditTime: 2024/02/07 11:12:16
45
+ * @description: 使元素可拖拽
46
+ */
47
+
48
+ declare const vDraggable: Directive;
49
+
50
+ /**
51
+ * @description: v-ellipsis指令
52
+ * @LastEditors: eonova
53
+ * @LastEditTime: 2024/02/07 11:12:16
54
+ * @description: 省略超出文本
55
+ */
56
+
57
+ declare const vEllipsis: Directive;
58
+
59
+ /**
60
+ * @description: v-emoji指令
61
+ * @LastEditors: eonova
62
+ * @LastEditTime: 2024/02/07 11:12:16
63
+ * @description: 禁止输入emoji
64
+ */
65
+
66
+ declare const vEmoji: Directive;
67
+
68
+ /**
69
+ * @description: v-empty指令
70
+ * @LastEditors: eonova
71
+ * @LastEditTime: 2024/02/07 11:12:16
72
+ * @description: 设置空状态
73
+ */
74
+
75
+ declare const vEmpty: Directive;
76
+
77
+ /**
78
+ * @description: v-flicker指令
79
+ * @LastEditors: eonova
80
+ * @LastEditTime: 2024/02/07 11:12:16
81
+ * @description: 元素闪烁
82
+ */
83
+
84
+ declare const vFlicker: Directive;
85
+
86
+ /**
87
+ * @description: v-focus指令
88
+ * @LastEditors: eonova
89
+ * @LastEditTime: 2024/02/07 11:12:16
90
+ * @description: 自动聚焦
91
+ */
92
+
93
+ declare const vFocus: Directive;
94
+
95
+ /**
96
+ * @description: v-highlight指令
97
+ * @LastEditors: eonova
98
+ * @LastEditTime: 2024/02/07 11:12:16
99
+ * @description: 元素闪烁
100
+ */
101
+
102
+ declare const vHighlight: Directive;
103
+
104
+ /**
105
+ * @description: v-hover指令
106
+ * @LastEditors: eonova
107
+ * @LastEditTime: 2024/02/07 11:12:16
108
+ * @description: 鼠标经过触发事件
109
+ */
110
+
111
+ declare const vHover: Directive;
112
+
113
+ /**
114
+ * @description: v-input指令
115
+ * @LastEditors: eonova
116
+ * @LastEditTime: 2024/02/07 11:12:16
117
+ * @description: 限制输入类型
118
+ */
119
+
120
+ declare const vInput: Directive;
121
+
122
+ declare const vImgLazyLoad: Directive;
123
+
124
+ declare const vLoading: Directive;
125
+
126
+ /**
127
+ * @description: v-longpress指令
128
+ * @LastEditors: eonova
129
+ * @LastEditTime: 2024/02/21 18:12:16
130
+ * @description: 长按触发事件
131
+ */
132
+
133
+ declare const vLongPress: Directive;
134
+
135
+ /**
136
+ * @description: v-money指令
137
+ * @LastEditors: eonova
138
+ * @LastEditTime: 2024/02/21 18:12:16
139
+ * @description: 格式化数字为金额
140
+ */
141
+
142
+ declare const vMoney: Directive;
143
+
144
+ /**
145
+ * @description: v-onOnce指令
146
+ * @LastEditors: eonova
147
+ * @LastEditTime: 2024/02/21 18:12:16
148
+ * @description: 只触发一次回调
149
+ */
150
+
151
+ declare const vOnOnce: Directive;
152
+
153
+ /**
154
+ * @description: v-permission指令
155
+ * @LastEditors: eonova
156
+ * @LastEditTime: 2024/02/07 11:12:16
157
+ * @description: 快速实现鉴权
158
+ */
159
+
160
+ declare const vPermission: Directive;
161
+
162
+ /**
163
+ * @description: v-resize指令
164
+ * @LastEditors: eonova
165
+ * @LastEditTime: 2024/02/07 11:12:16
166
+ * @description: 响应缩放
167
+ */
168
+
169
+ declare const vResize: Directive;
170
+
171
+ /**
172
+ * @description: v-ripple指令
173
+ * @LastEditors: eonova
174
+ * @LastEditTime: 2024/02/07 11:12:16
175
+ * @description: 给元素添加波纹动效
176
+ */
177
+
178
+ declare const Ripple: Directive;
179
+
180
+ declare const vSlideIn: Directive;
181
+
182
+ declare const vThrottle: Directive;
183
+
184
+ /**
185
+ * @description: v-waterMarker指令
186
+ * @LastEditors: eonova
187
+ * @LastEditTime: 2024/02/07 11:12:16
188
+ * @description: 添加水印
189
+ */
190
+
191
+ declare const waterMarker: {
192
+ mounted(el: DirectiveBinding, binding: DirectiveBinding): void;
193
+ };
194
+
195
+ declare const _default: {
196
+ install(app: App): void;
197
+ };
198
+
199
+ export { _default as default, vBackTop as vBacktop, vClickOut as vClickOutside, vCopy, vDebounce, vDoubleClick, vDraggable, vEllipsis, vEmoji, vEmpty, vFlicker, vFocus, vHighlight, vHover, vInput, vImgLazyLoad as vLazyImg, vLoading, vLongPress as vLongpress, vMoney, vOnOnce, vPermission, vResize, Ripple as vRipple, vSlideIn, vThrottle, waterMarker as vWaterMarker };
@@ -0,0 +1,199 @@
1
+ import { Directive, DirectiveBinding, App } from 'vue';
2
+
3
+ /**
4
+ * @description: v-backtop指令
5
+ * @LastEditors: eonova
6
+ * @LastEditTime: 2024/02/13 14:05:16
7
+ * @description: 为元素添加返回顶部功能
8
+ */
9
+
10
+ declare const vBackTop: Directive;
11
+
12
+ /**
13
+ * @description: v-clickOutside指令
14
+ * @LastEditors: eonova
15
+ * @LastEditTime: 2024/02/07 11:12:16
16
+ * @description: 点击元素外部触发时事件
17
+ */
18
+
19
+ declare const vClickOut: Directive;
20
+
21
+ /**
22
+ * @description: v-copy指令
23
+ * @LastEditors: eonova
24
+ * @LastEditTime: 2024/02/07 11:12:16
25
+ * @description: 实现文本复制到剪贴板功能
26
+ */
27
+
28
+ declare const vCopy: Directive;
29
+
30
+ declare const vDebounce: Directive;
31
+
32
+ /**
33
+ * @description: v-doubleClick指令
34
+ * @LastEditors: eonova
35
+ * @LastEditTime: 2024/02/07 11:12:16
36
+ * @description: 双击触发事件
37
+ */
38
+
39
+ declare const vDoubleClick: Directive;
40
+
41
+ /**
42
+ * @description: v-draggable指令
43
+ * @LastEditors: eonova
44
+ * @LastEditTime: 2024/02/07 11:12:16
45
+ * @description: 使元素可拖拽
46
+ */
47
+
48
+ declare const vDraggable: Directive;
49
+
50
+ /**
51
+ * @description: v-ellipsis指令
52
+ * @LastEditors: eonova
53
+ * @LastEditTime: 2024/02/07 11:12:16
54
+ * @description: 省略超出文本
55
+ */
56
+
57
+ declare const vEllipsis: Directive;
58
+
59
+ /**
60
+ * @description: v-emoji指令
61
+ * @LastEditors: eonova
62
+ * @LastEditTime: 2024/02/07 11:12:16
63
+ * @description: 禁止输入emoji
64
+ */
65
+
66
+ declare const vEmoji: Directive;
67
+
68
+ /**
69
+ * @description: v-empty指令
70
+ * @LastEditors: eonova
71
+ * @LastEditTime: 2024/02/07 11:12:16
72
+ * @description: 设置空状态
73
+ */
74
+
75
+ declare const vEmpty: Directive;
76
+
77
+ /**
78
+ * @description: v-flicker指令
79
+ * @LastEditors: eonova
80
+ * @LastEditTime: 2024/02/07 11:12:16
81
+ * @description: 元素闪烁
82
+ */
83
+
84
+ declare const vFlicker: Directive;
85
+
86
+ /**
87
+ * @description: v-focus指令
88
+ * @LastEditors: eonova
89
+ * @LastEditTime: 2024/02/07 11:12:16
90
+ * @description: 自动聚焦
91
+ */
92
+
93
+ declare const vFocus: Directive;
94
+
95
+ /**
96
+ * @description: v-highlight指令
97
+ * @LastEditors: eonova
98
+ * @LastEditTime: 2024/02/07 11:12:16
99
+ * @description: 元素闪烁
100
+ */
101
+
102
+ declare const vHighlight: Directive;
103
+
104
+ /**
105
+ * @description: v-hover指令
106
+ * @LastEditors: eonova
107
+ * @LastEditTime: 2024/02/07 11:12:16
108
+ * @description: 鼠标经过触发事件
109
+ */
110
+
111
+ declare const vHover: Directive;
112
+
113
+ /**
114
+ * @description: v-input指令
115
+ * @LastEditors: eonova
116
+ * @LastEditTime: 2024/02/07 11:12:16
117
+ * @description: 限制输入类型
118
+ */
119
+
120
+ declare const vInput: Directive;
121
+
122
+ declare const vImgLazyLoad: Directive;
123
+
124
+ declare const vLoading: Directive;
125
+
126
+ /**
127
+ * @description: v-longpress指令
128
+ * @LastEditors: eonova
129
+ * @LastEditTime: 2024/02/21 18:12:16
130
+ * @description: 长按触发事件
131
+ */
132
+
133
+ declare const vLongPress: Directive;
134
+
135
+ /**
136
+ * @description: v-money指令
137
+ * @LastEditors: eonova
138
+ * @LastEditTime: 2024/02/21 18:12:16
139
+ * @description: 格式化数字为金额
140
+ */
141
+
142
+ declare const vMoney: Directive;
143
+
144
+ /**
145
+ * @description: v-onOnce指令
146
+ * @LastEditors: eonova
147
+ * @LastEditTime: 2024/02/21 18:12:16
148
+ * @description: 只触发一次回调
149
+ */
150
+
151
+ declare const vOnOnce: Directive;
152
+
153
+ /**
154
+ * @description: v-permission指令
155
+ * @LastEditors: eonova
156
+ * @LastEditTime: 2024/02/07 11:12:16
157
+ * @description: 快速实现鉴权
158
+ */
159
+
160
+ declare const vPermission: Directive;
161
+
162
+ /**
163
+ * @description: v-resize指令
164
+ * @LastEditors: eonova
165
+ * @LastEditTime: 2024/02/07 11:12:16
166
+ * @description: 响应缩放
167
+ */
168
+
169
+ declare const vResize: Directive;
170
+
171
+ /**
172
+ * @description: v-ripple指令
173
+ * @LastEditors: eonova
174
+ * @LastEditTime: 2024/02/07 11:12:16
175
+ * @description: 给元素添加波纹动效
176
+ */
177
+
178
+ declare const Ripple: Directive;
179
+
180
+ declare const vSlideIn: Directive;
181
+
182
+ declare const vThrottle: Directive;
183
+
184
+ /**
185
+ * @description: v-waterMarker指令
186
+ * @LastEditors: eonova
187
+ * @LastEditTime: 2024/02/07 11:12:16
188
+ * @description: 添加水印
189
+ */
190
+
191
+ declare const waterMarker: {
192
+ mounted(el: DirectiveBinding, binding: DirectiveBinding): void;
193
+ };
194
+
195
+ declare const _default: {
196
+ install(app: App): void;
197
+ };
198
+
199
+ export { _default as default, vBackTop as vBacktop, vClickOut as vClickOutside, vCopy, vDebounce, vDoubleClick, vDraggable, vEllipsis, vEmoji, vEmpty, vFlicker, vFocus, vHighlight, vHover, vInput, vImgLazyLoad as vLazyImg, vLoading, vLongPress as vLongpress, vMoney, vOnOnce, vPermission, vResize, Ripple as vRipple, vSlideIn, vThrottle, waterMarker as vWaterMarker };