@fmdevui/fm-dev 1.0.17 → 1.0.19

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.
Files changed (29) hide show
  1. package/es/core/ui/components/dragVerify/dragVerifyImgRotate.vue.d.ts +247 -0
  2. package/es/core/ui/components/index.d.ts +246 -1
  3. package/es/index.d.ts +3 -0
  4. package/es/index.mjs +4 -1
  5. package/es/packages/core/index.mjs +1 -1
  6. package/es/packages/core/ui/components/dragVerify/dragVerifyImgRotate.vue.mjs +118 -0
  7. package/es/packages/core/ui/components/dragVerify/dragVerifyImgRotate.vue2.mjs +266 -0
  8. package/es/packages/core/ui/components/dragVerify/dragVerifyImgRotate.vue3.mjs +3 -0
  9. package/es/packages/core/ui/components/dragVerify/dragVerifyImgRotate.vue4.mjs +3 -0
  10. package/es/packages/core/ui/components/index.mjs +3 -1
  11. package/{lib/index.css → es/version.css} +3 -1
  12. package/index.css +113 -1
  13. package/index.js +669 -25
  14. package/index.min.css +1 -0
  15. package/index.min.js +28 -24
  16. package/index.min.mjs +29 -25
  17. package/index.mjs +656 -23
  18. package/lib/core/ui/components/dragVerify/dragVerifyImgRotate.vue.d.ts +247 -0
  19. package/lib/core/ui/components/index.d.ts +246 -1
  20. package/{es → lib}/defaults.css +5 -4
  21. package/lib/index.d.ts +3 -0
  22. package/lib/index.js +14 -0
  23. package/lib/packages/core/index.js +1 -0
  24. package/lib/packages/core/ui/components/dragVerify/dragVerifyImgRotate.vue.js +122 -0
  25. package/lib/packages/core/ui/components/dragVerify/dragVerifyImgRotate.vue2.js +270 -0
  26. package/lib/packages/core/ui/components/dragVerify/dragVerifyImgRotate.vue3.js +7 -0
  27. package/lib/packages/core/ui/components/dragVerify/dragVerifyImgRotate.vue4.js +7 -0
  28. package/lib/packages/core/ui/components/index.js +3 -0
  29. package/package.json +1 -1
@@ -0,0 +1,122 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var dragVerifyImgRotate_vue_vue_type_script_lang = require('./dragVerifyImgRotate.vue2.js');
6
+ var vue = require('vue');
7
+ require('./dragVerifyImgRotate.vue3.js');
8
+ require('./dragVerifyImgRotate.vue4.js');
9
+ var _pluginVue_exportHelper = require('../../../../../_virtual/_plugin-vue_export-helper.js');
10
+
11
+ const _hoisted_1 = { class: "drag-verify-container" };
12
+ const _hoisted_2 = ["src"];
13
+ const _hoisted_3 = {
14
+ key: 0,
15
+ class: "tips success"
16
+ };
17
+ const _hoisted_4 = {
18
+ key: 1,
19
+ class: "tips danger"
20
+ };
21
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
22
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
23
+ vue.createElementVNode(
24
+ "div",
25
+ {
26
+ style: vue.normalizeStyle([$options.dragVerifyImgStyle, { "background-color": "var(--el-color-primary)" }])
27
+ },
28
+ [
29
+ vue.createElementVNode("img", {
30
+ ref: "checkImg",
31
+ src: $props.imgsrc,
32
+ class: vue.normalizeClass(["check-img", { goOrigin: $data.isOk }]),
33
+ onLoad: _cache[0] || (_cache[0] = (...args) => $options.checkimgLoaded && $options.checkimgLoaded(...args)),
34
+ style: vue.normalizeStyle($data.imgStyle),
35
+ alt: ""
36
+ }, null, 46, _hoisted_2),
37
+ $props.showTips && $props.isPassing ? (vue.openBlock(), vue.createElementBlock(
38
+ "div",
39
+ _hoisted_3,
40
+ vue.toDisplayString($props.successTip),
41
+ 1
42
+ /* TEXT */
43
+ )) : vue.createCommentVNode("v-if", true),
44
+ $props.showTips && !$props.isPassing && $data.showErrorTip ? (vue.openBlock(), vue.createElementBlock(
45
+ "div",
46
+ _hoisted_4,
47
+ vue.toDisplayString($props.failTip),
48
+ 1
49
+ /* TEXT */
50
+ )) : vue.createCommentVNode("v-if", true)
51
+ ],
52
+ 4
53
+ /* STYLE */
54
+ ),
55
+ vue.createElementVNode(
56
+ "div",
57
+ {
58
+ ref: "dragVerify",
59
+ class: "drag_verify",
60
+ style: vue.normalizeStyle($options.dragVerifyStyle),
61
+ onMousemove: _cache[3] || (_cache[3] = (...args) => $options.dragMoving && $options.dragMoving(...args)),
62
+ onMouseup: _cache[4] || (_cache[4] = (...args) => $options.dragFinish && $options.dragFinish(...args)),
63
+ onMouseleave: _cache[5] || (_cache[5] = (...args) => $options.dragFinish && $options.dragFinish(...args)),
64
+ onTouchmove: _cache[6] || (_cache[6] = vue.withModifiers((...args) => $options.dragMoving && $options.dragMoving(...args), ["prevent"])),
65
+ onTouchend: _cache[7] || (_cache[7] = vue.withModifiers((...args) => $options.dragFinish && $options.dragFinish(...args), ["prevent"]))
66
+ },
67
+ [
68
+ vue.createElementVNode(
69
+ "div",
70
+ {
71
+ class: vue.normalizeClass(["dv_progress_bar", { goFirst2: $data.isOk }]),
72
+ ref: "progressBar",
73
+ style: vue.normalizeStyle($options.progressBarStyle)
74
+ },
75
+ vue.toDisplayString($options.successMessage),
76
+ 7
77
+ /* TEXT, CLASS, STYLE */
78
+ ),
79
+ vue.createElementVNode(
80
+ "div",
81
+ {
82
+ class: "dv_text",
83
+ style: vue.normalizeStyle($options.textStyle),
84
+ ref: "message"
85
+ },
86
+ vue.toDisplayString($options.message),
87
+ 5
88
+ /* TEXT, STYLE */
89
+ ),
90
+ vue.createElementVNode(
91
+ "div",
92
+ {
93
+ class: vue.normalizeClass(["dv_handler dv_handler_bg", { goFirst: $data.isOk }]),
94
+ onMousedown: _cache[1] || (_cache[1] = (...args) => $options.dragStart && $options.dragStart(...args)),
95
+ onTouchstart: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.dragStart && $options.dragStart(...args), ["prevent"])),
96
+ ref: "handler",
97
+ style: vue.normalizeStyle([$options.handlerStyle, { "background-color": "var(--el-color-primary)" }])
98
+ },
99
+ [
100
+ vue.createElementVNode(
101
+ "i",
102
+ {
103
+ class: vue.normalizeClass($props.handlerIcon),
104
+ style: { "color": "#fff" }
105
+ },
106
+ null,
107
+ 2
108
+ /* CLASS */
109
+ )
110
+ ],
111
+ 38
112
+ /* CLASS, STYLE, NEED_HYDRATION */
113
+ )
114
+ ],
115
+ 36
116
+ /* STYLE, NEED_HYDRATION */
117
+ )
118
+ ]);
119
+ }
120
+ var dragimg = /* @__PURE__ */ _pluginVue_exportHelper.default(dragVerifyImgRotate_vue_vue_type_script_lang.default, [["render", _sfc_render], ["__scopeId", "data-v-9e8c9ed2"]]);
121
+
122
+ exports.default = dragimg;
@@ -0,0 +1,270 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _sfc_main = {
6
+ name: "dragVerify",
7
+ props: {
8
+ isPassing: {
9
+ type: Boolean,
10
+ default: false
11
+ },
12
+ width: {
13
+ type: Number,
14
+ default: 250
15
+ },
16
+ height: {
17
+ type: Number,
18
+ default: 40
19
+ },
20
+ text: {
21
+ type: String,
22
+ default: "swiping to the right side"
23
+ },
24
+ successText: {
25
+ type: String,
26
+ default: "success"
27
+ },
28
+ background: {
29
+ type: String,
30
+ default: "#eee"
31
+ },
32
+ progressBarBg: {
33
+ type: String,
34
+ default: "#76c61d"
35
+ },
36
+ completedBg: {
37
+ type: String,
38
+ default: "#76c61d"
39
+ },
40
+ circle: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ radius: {
45
+ type: String,
46
+ default: "4px"
47
+ },
48
+ handlerIcon: {
49
+ type: String
50
+ },
51
+ successIcon: {
52
+ type: String
53
+ },
54
+ handlerBg: {
55
+ type: String,
56
+ default: "#fff"
57
+ },
58
+ textSize: {
59
+ type: String,
60
+ default: "14px"
61
+ },
62
+ textColor: {
63
+ type: String,
64
+ default: "#333"
65
+ },
66
+ imgsrc: {
67
+ type: String
68
+ },
69
+ showTips: {
70
+ type: Boolean,
71
+ default: true
72
+ },
73
+ successTip: {
74
+ type: String,
75
+ default: "\u9A8C\u8BC1\u901A\u8FC7"
76
+ },
77
+ failTip: {
78
+ type: String,
79
+ default: "\u9A8C\u8BC1\u5931\u8D25"
80
+ },
81
+ diffDegree: {
82
+ type: Number,
83
+ default: 10
84
+ },
85
+ minDegree: {
86
+ type: Number,
87
+ default: 90
88
+ },
89
+ maxDegree: {
90
+ type: Number,
91
+ default: 270
92
+ }
93
+ },
94
+ mounted: function() {
95
+ const dragEl = this.$refs.dragVerify;
96
+ dragEl.style.setProperty("--textColor", this.textColor);
97
+ dragEl.style.setProperty("--width", Math.floor(this.width / 2) + "px");
98
+ dragEl.style.setProperty("--pwidth", -Math.floor(this.width / 2) + "px");
99
+ },
100
+ computed: {
101
+ handlerStyle: function() {
102
+ return {
103
+ width: this.height + "px",
104
+ height: this.height + "px",
105
+ background: this.handlerBg
106
+ };
107
+ },
108
+ message: function() {
109
+ return this.isPassing ? "" : this.text;
110
+ },
111
+ successMessage: function() {
112
+ return this.isPassing ? this.successText : "";
113
+ },
114
+ dragVerifyStyle: function() {
115
+ return {
116
+ width: this.width + "px",
117
+ height: this.height + "px",
118
+ lineHeight: this.height + "px",
119
+ marginTop: "20px",
120
+ background: this.background,
121
+ borderRadius: this.circle ? this.height / 2 + "px" : this.radius
122
+ };
123
+ },
124
+ dragVerifyImgStyle: function() {
125
+ return {
126
+ width: this.width + "px",
127
+ height: this.width + "px",
128
+ position: "relative",
129
+ overflow: "hidden",
130
+ "border-radius": "50%"
131
+ };
132
+ },
133
+ progressBarStyle: function() {
134
+ return {
135
+ background: this.progressBarBg,
136
+ height: this.height + "px",
137
+ borderRadius: this.circle ? this.height / 2 + "px 0 0 " + this.height / 2 + "px" : this.radius
138
+ };
139
+ },
140
+ textStyle: function() {
141
+ return {
142
+ height: this.height + "px",
143
+ width: this.width + "px",
144
+ fontSize: this.textSize
145
+ };
146
+ },
147
+ factor: function() {
148
+ if (this.minDegree == this.maxDegree) {
149
+ return Math.floor(1 + Math.random() * 6) / 10 + 1;
150
+ }
151
+ return 1;
152
+ }
153
+ },
154
+ data() {
155
+ return {
156
+ isMoving: false,
157
+ x: 0,
158
+ isOk: false,
159
+ showBar: false,
160
+ showErrorTip: false,
161
+ ranRotate: 0,
162
+ cRotate: 0,
163
+ imgStyle: {}
164
+ };
165
+ },
166
+ methods: {
167
+ checkimgLoaded: function() {
168
+ var minDegree = this.minDegree;
169
+ var maxDegree = this.maxDegree;
170
+ var ranRotate = Math.floor(minDegree + Math.random() * (maxDegree - minDegree));
171
+ this.ranRotate = ranRotate;
172
+ this.imgStyle = {
173
+ transform: `rotateZ(${ranRotate}deg)`
174
+ };
175
+ },
176
+ dragStart: function(e) {
177
+ if (!this.isPassing) {
178
+ this.isMoving = true;
179
+ this.x = e.pageX || e.touches[0].pageX;
180
+ }
181
+ this.showBar = true;
182
+ this.showErrorTip = false;
183
+ this.$emit("handlerMove");
184
+ },
185
+ dragMoving: function(e) {
186
+ if (this.isMoving && !this.isPassing) {
187
+ var _x = (e.pageX || e.touches[0].pageX) - this.x;
188
+ var handler = this.$refs.handler;
189
+ handler.style.left = _x + "px";
190
+ var progressBar = this.$refs.progressBar;
191
+ progressBar.style.width = _x + this.height / 2 + "px";
192
+ var cRotate = Math.ceil(_x / (this.width - this.height) * this.maxDegree * this.factor);
193
+ this.cRotate = cRotate;
194
+ var rotate = this.ranRotate - cRotate;
195
+ this.imgStyle = {
196
+ transform: `rotateZ(${rotate}deg)`
197
+ };
198
+ }
199
+ },
200
+ dragFinish: function(e) {
201
+ if (this.isMoving && !this.isPassing) {
202
+ if (Math.abs(this.ranRotate - this.cRotate) > this.diffDegree) {
203
+ this.isOk = true;
204
+ this.imgStyle = {
205
+ transform: `rotateZ(${this.ranRotate}deg)`
206
+ };
207
+ var that = this;
208
+ setTimeout(function() {
209
+ var handler = that.$refs.handler;
210
+ var progressBar = that.$refs.progressBar;
211
+ handler.style.left = "0";
212
+ progressBar.style.width = "0";
213
+ that.isOk = false;
214
+ }, 500);
215
+ this.showErrorTip = true;
216
+ this.$emit("passfail");
217
+ } else {
218
+ this.passVerify();
219
+ }
220
+ this.isMoving = false;
221
+ }
222
+ },
223
+ passVerify: function() {
224
+ this.$emit("update:isPassing", true);
225
+ this.isMoving = false;
226
+ var handler = this.$refs.handler;
227
+ handler.children[0].className = this.successIcon;
228
+ this.$refs.progressBar.style.background = this.completedBg;
229
+ this.$refs.message.style["-webkit-text-fill-color"] = "unset";
230
+ this.$refs.message.style.animation = "slidetounlock2 3s infinite";
231
+ this.$refs.progressBar.style.color = "#fff";
232
+ this.$refs.progressBar.style.fontSize = this.textSize;
233
+ this.$emit("passcallback");
234
+ },
235
+ reset: function() {
236
+ this.reImg();
237
+ this.checkimgLoaded();
238
+ },
239
+ reImg: function() {
240
+ this.$emit("update:isPassing", false);
241
+ const oriData = this.$options.data();
242
+ for (const key in oriData) {
243
+ if (Object.prototype.hasOwnProperty.call(oriData, key)) {
244
+ this[key] = oriData[key];
245
+ }
246
+ }
247
+ var handler = this.$refs.handler;
248
+ var message = this.$refs.message;
249
+ handler.style.left = "0";
250
+ this.$refs.progressBar.style.width = "0";
251
+ handler.children[0].className = this.handlerIcon;
252
+ message.style["-webkit-text-fill-color"] = "transparent";
253
+ message.style.animation = "slidetounlock 3s infinite";
254
+ message.style.color = this.background;
255
+ },
256
+ refreshimg: function() {
257
+ this.$emit("refresh");
258
+ }
259
+ },
260
+ watch: {
261
+ imgsrc: {
262
+ immediate: false,
263
+ handler: function() {
264
+ this.reImg();
265
+ }
266
+ }
267
+ }
268
+ };
269
+
270
+ exports.default = _sfc_main;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var undefined$1 = undefined;
6
+
7
+ exports.default = undefined$1;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var undefined$1 = undefined;
6
+
7
+ exports.default = undefined$1;
@@ -2,13 +2,16 @@
2
2
 
3
3
  require('./transfer/index.vue.js');
4
4
  require('./noticeBar/index.vue.js');
5
+ var dragVerifyImgRotate = require('./dragVerify/dragVerifyImgRotate.vue.js');
5
6
  var index = require('./svgIcon/index.js');
6
7
  var index_vue_vue_type_script_setup_true_lang = require('./transfer/index.vue2.js');
7
8
  var index_vue_vue_type_script_setup_true_lang$1 = require('./noticeBar/index.vue2.js');
8
9
 
9
10
  const FmTransfer = index_vue_vue_type_script_setup_true_lang.default;
10
11
  const FmNoticeBar = index_vue_vue_type_script_setup_true_lang$1.default;
12
+ const FmDragImg = dragVerifyImgRotate.default;
11
13
 
12
14
  exports.elSvg = index.elSvg;
15
+ exports.FmDragImg = FmDragImg;
13
16
  exports.FmNoticeBar = FmNoticeBar;
14
17
  exports.FmTransfer = FmTransfer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fmdevui/fm-dev",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Page level components developed based on Element Plus.",
5
5
  "author": "fmdevui",
6
6
  "keywords": [