@10yun/cv-mobile-ui 0.5.51 → 0.5.52
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/build/common_func.js +3 -1
- package/build/parse-create.js +17 -8
- package/build/parse-pages-pkg.js +10 -4
- package/empty-devtools.js +3 -0
- package/libs/aes.js +50 -0
- package/libs/bledefine/bledefine.js +51 -0
- package/libs/bledefine/ios-ble-statuscode.js +97 -0
- package/libs/nfc/hexiii-nfc.js +236 -0
- package/libs/nfc.js +179 -0
- package/libs/sdk/html2canvas.js +8 -0
- package/libs/sdk/sdk-h5.js +585 -0
- package/{plugins → libs}/storage2.js +0 -5
- package/{plugins → libs}/storage3.js +0 -4
- package/libs/validators/index.js +438 -0
- package/libs/weapp-qrcode.js +1108 -0
- package/package.json +2 -3
- package/ui-cv/components/cv-dialog-share/tui-share.vue +16 -16
- package/ui-fireui/components/{fui-actionsheet/fui-actionsheet.vue → u-action-sheet/u-action-sheet.vue} +21 -21
- package/ui-fireui/components/{fui-alert/fui-alert.vue → u-alert/u-alert.vue} +13 -13
- package/ui-fireui/components/{fui-badge/fui-badge.vue → u-badge/u-badge.vue} +16 -16
- package/ui-fireui/components/{fui-bottom-navigation/fui-bottom-navigation.vue → u-bottom-navigation/u-bottom-navigation.vue} +47 -46
- package/ui-fireui/components/{fui-bottom-popup/fui-bottom-popup.vue → u-bottom-popup/u-bottom-popup.vue} +9 -8
- package/ui-fireui/components/{fui-bubble-popup/fui-bubble-popup.vue → u-bubble-popup/u-bubble-popup.vue} +19 -15
- package/ui-fireui/components/{fui-button/fui-button.vue → u-button/u-button.vue} +69 -69
- package/ui-fireui/components/u-button/u-button2.vue +553 -0
- package/ui-fireui/components/{fui-calendar/fui-calendar.vue → u-calendar/u-calendar.vue} +78 -78
- package/ui-fireui/components/u-calendar/u-calendar2.vue +801 -0
- package/ui-fireui/components/{fui-card/fui-card.vue → u-card/u-card.vue} +24 -24
- package/ui-fireui/components/{fui-cascade-selection/fui-cascade-selection.vue → u-cascade-selection/u-cascade-selection.vue} +32 -32
- package/ui-fireui/components/{fui-circular-progress/fui-circular-progress.vue → u-circular-progress/u-circular-progress.vue} +14 -6
- package/ui-fireui/components/{fui-collapse/fui-collapse.vue → u-collapse/u-collapse.vue} +19 -19
- package/ui-fireui/components/{fui-countdown/fui-countdown.vue → u-countdown/u-countdown.vue} +28 -28
- package/ui-fireui/components/{fui-datetime/fui-datetime.vue → u-datetime/u-datetime.vue} +51 -51
- package/ui-fireui/components/{fui-divider/fui-divider.vue → u-divider/u-divider.vue} +6 -6
- package/ui-fireui/components/{fui-drawer/fui-drawer.vue → u-drawer/u-drawer.vue} +11 -11
- package/ui-fireui/components/{fui-dropdown-list/fui-dropdown-list.vue → u-dropdown-list/u-dropdown-list.vue} +11 -6
- package/ui-fireui/components/{fui-fab/fui-fab.vue → u-fab/u-fab.vue} +30 -30
- package/ui-fireui/components/{fui-footer/fui-footer.vue → u-footer/u-footer.vue} +19 -15
- package/ui-fireui/components/{fui-grid/fui-grid.vue → u-grid/u-grid.vue} +13 -5
- package/ui-fireui/components/{fui-grid-item/fui-grid-item.vue → u-grid-item/u-grid-item.vue} +19 -19
- package/ui-fireui/components/{fui-icon/fui-icon.vue → u-icon/u-icon.vue} +191 -191
- package/ui-fireui/components/{fui-image-cropper/fui-image-cropper.vue → u-image-cropper/u-image-cropper.vue} +44 -44
- package/ui-fireui/components/{fui-image-group/fui-image-group.vue → u-image-group/u-image-group.vue} +7 -7
- package/ui-fireui/components/{fui-keyboard/fui-keyboard.vue → u-keyboard/u-keyboard.vue} +29 -32
- package/ui-fireui/components/{fui-keyboard-input/fui-keyboard-input.vue → u-keyboard-input/u-keyboard-input.vue} +9 -9
- package/ui-fireui/components/{fui-list-cell/fui-list-cell.vue → u-list-cell/u-list-cell.vue} +23 -23
- package/ui-fireui/components/{fui-list-view/fui-list-view.vue → u-list-view/u-list-view.vue} +11 -11
- package/ui-fireui/components/{fui-loading/fui-loading.vue → u-loading/u-loading.vue} +6 -6
- package/ui-fireui/components/{fui-loadmore/fui-loadmore.vue → u-loadmore/u-loadmore.vue} +15 -15
- package/ui-fireui/components/{fui-modal/fui-modal.vue → u-modal/u-modal.vue} +58 -58
- package/ui-fireui/components/{fui-navigation-bar/fui-navigation-bar.vue → u-navigation-bar/u-navigation-bar.vue} +11 -10
- package/ui-fireui/components/{fui-no-data/fui-no-data.vue → u-no-data/u-no-data.vue} +11 -11
- package/ui-fireui/components/{fui-nomore/fui-nomore.vue → u-nomore/u-nomore.vue} +10 -10
- package/ui-fireui/components/{fui-numberbox/fui-numberbox.vue → u-numberbox/u-numberbox.vue} +12 -12
- package/ui-fireui/components/{fui-numberbox-border/fui-numberbox-border.vue → u-numberbox-border/u-numberbox-border.vue} +10 -10
- package/ui-fireui/components/{fui-picture-cropper/fui-picture-cropper.vue → u-picture-cropper/u-picture-cropper.vue} +42 -42
- package/ui-fireui/components/u-picture-cropper/u-picture-cropper.wxs +582 -0
- package/ui-fireui/components/{fui-round-progress/fui-round-progress.vue → u-round-progress/u-round-progress.vue} +2 -2
- package/ui-fireui/components/{fui-scroll-top/fui-scroll-top.vue → u-scroll-top/u-scroll-top.vue} +21 -21
- package/ui-fireui/components/{fui-sharemodel/fui-sharemodel.vue → u-share-model/u-share-model.vue} +24 -24
- package/ui-fireui/components/{fui-skeleton/fui-skeleton.vue → u-skeleton/u-skeleton.vue} +22 -22
- package/ui-fireui/components/{fui-steps/fui-steps.vue → u-steps/u-steps.vue} +27 -27
- package/ui-fireui/components/{fui-sticky/fui-sticky.vue → u-sticky/u-sticky.vue} +4 -4
- package/ui-fireui/components/{fui-sticky-wxs/fui-sticky-wxs.vue → u-sticky-wxs/u-sticky-wxs.vue} +7 -7
- package/ui-fireui/components/u-sticky-wxs/u-sticky.wxs +46 -0
- package/ui-fireui/components/{fui-swipe-action/fui-swipe-action.vue → u-swipe-action/u-swipe-action.vue} +11 -11
- package/ui-fireui/components/{fui-tabbar/fui-tabbar.vue → u-tabbar/u-tabbar.vue} +26 -30
- package/ui-fireui/components/{fui-tabs/fui-tabs.vue → u-tabs/u-tabs.vue} +17 -17
- package/ui-fireui/components/{fui-tabs2/fui-tabs2.vue → u-tabs2/u-tabs2.vue} +17 -17
- package/ui-fireui/components/{fui-tag/fui-tag.vue → u-tag/u-tag.vue} +362 -374
- package/ui-fireui/components/{fui-time-axis/fui-time-axis.vue → u-time-axis/u-time-axis.vue} +3 -3
- package/ui-fireui/components/{fui-timeaxis-item/fui-timeaxis-item.vue → u-timeaxis-item/u-timeaxis-item.vue} +4 -4
- package/ui-fireui/components/{fui-tips/fui-tips.vue → u-tips/u-tips.vue} +20 -20
- package/ui-fireui/components/{fui-toast/fui-toast.vue → u-toast/u-toast.vue} +13 -13
- package/ui-fireui/components/{fui-top-dropdown/fui-top-dropdown.vue → u-top-dropdown/u-top-dropdown.vue} +8 -8
- package/ui-fireui/components/{fui-upload/fui-upload.vue → u-upload/u-upload.vue} +30 -30
- package/ui-fireui/components/u-upload2/u-upload.vue +464 -0
- package/ui-fireui/components/{fui-uploadsamll/fui-uploadsamll.vue → u-uploadsamll/u-uploadsamll.vue} +34 -34
- package/ui-fireui/css/thorui.css +589 -0
- package/ui-fireui/{fireui.css → index.css} +306 -268
- package/ui-fireui/nvue/u-circular-progress/gcanvas/bridge/bridge-weex.js +241 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/FillStylePattern.js +8 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/RenderingContext.js +666 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/ActiveInfo.js +11 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Buffer.js +21 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Framebuffer.js +21 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/GLenum.js +298 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/GLmethod.js +142 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/GLtype.js +23 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Program.js +21 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Renderbuffer.js +21 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/RenderingContext.js +1191 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Shader.js +22 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Texture.js +22 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/UniformLocation.js +22 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/classUtils.js +3 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/env/canvas.js +74 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/env/image.js +96 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/env/tool.js +24 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/index.js +47 -0
- package/ui-fireui/nvue/u-circular-progress/u-circular-progress.nvue +203 -0
- package/ui-fireui/nvue/u-icon/icons.js +188 -0
- package/ui-fireui/nvue/u-icon/u-icon.vue +78 -0
- package/ui-fireui/components/fui-picture-cropper/fui-picture-cropper.wxs +0 -560
- package/ui-fireui/components/fui-rate/fui-rate.vue +0 -167
- package/ui-fireui/components/fui-sticky-wxs/fui-sticky.wxs +0 -44
- /package/ui-fireui/components/{fui-calendar/fui-calendar.js → u-calendar/u-calendar.js} +0 -0
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
//#ifdef H5
|
|
2
|
+
/**
|
|
3
|
+
* 设置剪切板
|
|
4
|
+
uni.setClipboardData({ data:'文字', success:function(data){}, fail:function(err){}, complete:function(res){} })
|
|
5
|
+
|
|
6
|
+
获取剪贴板
|
|
7
|
+
uni.getClipboardData({success:function(data){}, fail:function(err){}, complete:function(res){} })
|
|
8
|
+
|
|
9
|
+
保存图片到系统相册
|
|
10
|
+
uni.saveImageToPhotosAlbum({ filePath: res.tempFilePaths[0], success: function () { console.log('save success'); } })
|
|
11
|
+
|
|
12
|
+
保存视频到系统相册
|
|
13
|
+
uni.saveVideoToPhotosAlbum({ filePath: res.tempFilePath, success: function () { console.log('save success'); } });
|
|
14
|
+
* **/
|
|
15
|
+
! function(t, e) {
|
|
16
|
+
try {
|
|
17
|
+
window.ClipboardJS = e();
|
|
18
|
+
} catch (e) {};
|
|
19
|
+
"object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define
|
|
20
|
+
.amd ? define([], e) : "object" == typeof exports ? exports.ClipboardJS = e() : t.ClipboardJS = e()
|
|
21
|
+
}(this, function() {
|
|
22
|
+
return function(n) {
|
|
23
|
+
var o = {};
|
|
24
|
+
|
|
25
|
+
function r(t) {
|
|
26
|
+
if (o[t]) return o[t].exports;
|
|
27
|
+
var e = o[t] = {
|
|
28
|
+
i: t,
|
|
29
|
+
l: !1,
|
|
30
|
+
exports: {}
|
|
31
|
+
};
|
|
32
|
+
return n[t].call(e.exports, e, e.exports, r), e.l = !0, e.exports
|
|
33
|
+
}
|
|
34
|
+
return r.m = n, r.c = o, r.d = function(t, e, n) {
|
|
35
|
+
r.o(t, e) || Object.defineProperty(t, e, {
|
|
36
|
+
enumerable: !0,
|
|
37
|
+
get: n
|
|
38
|
+
})
|
|
39
|
+
}, r.r = function(t) {
|
|
40
|
+
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
|
|
41
|
+
value: "Module"
|
|
42
|
+
}), Object.defineProperty(t, "__esModule", {
|
|
43
|
+
value: !0
|
|
44
|
+
})
|
|
45
|
+
}, r.t = function(e, t) {
|
|
46
|
+
if (1 & t && (e = r(e)), 8 & t) return e;
|
|
47
|
+
if (4 & t && "object" == typeof e && e && e.__esModule) return e;
|
|
48
|
+
var n = Object.create(null);
|
|
49
|
+
if (r.r(n), Object.defineProperty(n, "default", {
|
|
50
|
+
enumerable: !0,
|
|
51
|
+
value: e
|
|
52
|
+
}), 2 & t && "string" != typeof e)
|
|
53
|
+
for (var o in e) r.d(n, o, function(t) {
|
|
54
|
+
return e[t]
|
|
55
|
+
}.bind(null, o));
|
|
56
|
+
return n
|
|
57
|
+
}, r.n = function(t) {
|
|
58
|
+
var e = t && t.__esModule ? function() {
|
|
59
|
+
return t.default
|
|
60
|
+
} : function() {
|
|
61
|
+
return t
|
|
62
|
+
};
|
|
63
|
+
return r.d(e, "a", e), e
|
|
64
|
+
}, r.o = function(t, e) {
|
|
65
|
+
return Object.prototype.hasOwnProperty.call(t, e)
|
|
66
|
+
}, r.p = "", r(r.s = 0)
|
|
67
|
+
}([function(t, e, n) {
|
|
68
|
+
"use strict";
|
|
69
|
+
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
70
|
+
return typeof t
|
|
71
|
+
} : function(t) {
|
|
72
|
+
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" :
|
|
73
|
+
typeof t
|
|
74
|
+
},
|
|
75
|
+
i = function() {
|
|
76
|
+
function o(t, e) {
|
|
77
|
+
for (var n = 0; n < e.length; n++) {
|
|
78
|
+
var o = e[n];
|
|
79
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(
|
|
80
|
+
t, o.key, o)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return function(t, e, n) {
|
|
84
|
+
return e && o(t.prototype, e), n && o(t, n), t
|
|
85
|
+
}
|
|
86
|
+
}(),
|
|
87
|
+
a = o(n(1)),
|
|
88
|
+
c = o(n(3)),
|
|
89
|
+
u = o(n(4));
|
|
90
|
+
|
|
91
|
+
function o(t) {
|
|
92
|
+
return t && t.__esModule ? t : {
|
|
93
|
+
default: t
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
var l = function(t) {
|
|
97
|
+
function o(t, e) {
|
|
98
|
+
! function(t, e) {
|
|
99
|
+
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
|
|
100
|
+
}(this, o);
|
|
101
|
+
var n = function(t, e) {
|
|
102
|
+
if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
103
|
+
return !e || "object" != typeof e && "function" != typeof e ? t : e
|
|
104
|
+
}(this, (o.__proto__ || Object.getPrototypeOf(o)).call(this));
|
|
105
|
+
return n.resolveOptions(e), n.listenClick(t), n
|
|
106
|
+
}
|
|
107
|
+
return function(t, e) {
|
|
108
|
+
if ("function" != typeof e && null !== e) throw new TypeError(
|
|
109
|
+
"Super expression must either be null or a function, not " + typeof e);
|
|
110
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
111
|
+
constructor: {
|
|
112
|
+
value: t,
|
|
113
|
+
enumerable: !1,
|
|
114
|
+
writable: !0,
|
|
115
|
+
configurable: !0
|
|
116
|
+
}
|
|
117
|
+
}), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
|
|
118
|
+
}(o, c.default), i(o, [{
|
|
119
|
+
key: "resolveOptions",
|
|
120
|
+
value: function() {
|
|
121
|
+
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
|
|
122
|
+
this.action = "function" == typeof t.action ? t.action : this.defaultAction, this.target = "function" ==
|
|
123
|
+
typeof t.target ? t.target : this.defaultTarget, this.text = "function" == typeof t.text ? t.text : this
|
|
124
|
+
.defaultText, this.container = "object" === r(t.container) ? t.container : document.body
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "listenClick",
|
|
128
|
+
value: function(t) {
|
|
129
|
+
var e = this;
|
|
130
|
+
this.listener = (0, u.default)(t, "click", function(t) {
|
|
131
|
+
return e.onClick(t)
|
|
132
|
+
})
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
key: "onClick",
|
|
136
|
+
value: function(t) {
|
|
137
|
+
var e = t.delegateTarget || t.currentTarget;
|
|
138
|
+
this.clipboardAction && (this.clipboardAction = null), this.clipboardAction = new a.default({
|
|
139
|
+
action: this.action(e),
|
|
140
|
+
target: this.target(e),
|
|
141
|
+
text: this.text(e),
|
|
142
|
+
container: this.container,
|
|
143
|
+
trigger: e,
|
|
144
|
+
emitter: this
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "defaultAction",
|
|
149
|
+
value: function(t) {
|
|
150
|
+
return s("action", t) || 'copy'
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
key: "defaultTarget",
|
|
154
|
+
value: function(t) {
|
|
155
|
+
var e = s("target", t);
|
|
156
|
+
if (e) {
|
|
157
|
+
return document.querySelector(e)
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}, {
|
|
161
|
+
key: "defaultText",
|
|
162
|
+
value: function(t) {
|
|
163
|
+
return s("text", t) || this.text
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
key: "destroy",
|
|
167
|
+
value: function() {
|
|
168
|
+
this.listener.destroy(), this.clipboardAction && (this.clipboardAction.destroy(), this.clipboardAction =
|
|
169
|
+
null)
|
|
170
|
+
}
|
|
171
|
+
}], [{
|
|
172
|
+
key: "isSupported",
|
|
173
|
+
value: function() {
|
|
174
|
+
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ["copy", "cut"],
|
|
175
|
+
e = "string" == typeof t ? [t] : t,
|
|
176
|
+
n = !!document.queryCommandSupported;
|
|
177
|
+
return e.forEach(function(t) {
|
|
178
|
+
n = n && !!document.queryCommandSupported(t)
|
|
179
|
+
}), n
|
|
180
|
+
}
|
|
181
|
+
}]), o
|
|
182
|
+
}();
|
|
183
|
+
|
|
184
|
+
function s(t, e) {
|
|
185
|
+
var n = "data-clipboard-" + t;
|
|
186
|
+
let isFun = e && typeof e.hasAttribute === 'function';
|
|
187
|
+
if (isFun && e.hasAttribute(n)) {
|
|
188
|
+
return e.getAttribute(n)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
t.exports = l
|
|
192
|
+
}, function(t, e, n) {
|
|
193
|
+
"use strict";
|
|
194
|
+
var o, r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
195
|
+
return typeof t
|
|
196
|
+
} : function(t) {
|
|
197
|
+
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" :
|
|
198
|
+
typeof t
|
|
199
|
+
},
|
|
200
|
+
i = function() {
|
|
201
|
+
function o(t, e) {
|
|
202
|
+
for (var n = 0; n < e.length; n++) {
|
|
203
|
+
var o = e[n];
|
|
204
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(
|
|
205
|
+
t, o.key, o)
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return function(t, e, n) {
|
|
209
|
+
return e && o(t.prototype, e), n && o(t, n), t
|
|
210
|
+
}
|
|
211
|
+
}(),
|
|
212
|
+
a = n(2),
|
|
213
|
+
c = (o = a) && o.__esModule ? o : {
|
|
214
|
+
default: o
|
|
215
|
+
};
|
|
216
|
+
var u = function() {
|
|
217
|
+
function e(t) {
|
|
218
|
+
! function(t, e) {
|
|
219
|
+
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
|
|
220
|
+
}(this, e), this.resolveOptions(t), this.initSelection()
|
|
221
|
+
}
|
|
222
|
+
return i(e, [{
|
|
223
|
+
key: "resolveOptions",
|
|
224
|
+
value: function() {
|
|
225
|
+
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
|
|
226
|
+
this.action = t.action, this.container = t.container, this.emitter = t.emitter, this.target = t.target,
|
|
227
|
+
this.text = t.text, this.trigger = t.trigger, this.selectedText = ""
|
|
228
|
+
}
|
|
229
|
+
}, {
|
|
230
|
+
key: "initSelection",
|
|
231
|
+
value: function() {
|
|
232
|
+
this.text ? this.selectFake() : this.target && this.selectTarget()
|
|
233
|
+
}
|
|
234
|
+
}, {
|
|
235
|
+
key: "selectFake",
|
|
236
|
+
value: function() {
|
|
237
|
+
var t = this,
|
|
238
|
+
e = "rtl" == document.documentElement.getAttribute("dir");
|
|
239
|
+
this.removeFake(), this.fakeHandlerCallback = function() {
|
|
240
|
+
return t.removeFake()
|
|
241
|
+
}, this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || !0, this.fakeElem =
|
|
242
|
+
document.createElement("textarea"), this.fakeElem.style.fontSize = "12pt", this.fakeElem.style.border =
|
|
243
|
+
"0", this.fakeElem.style.padding = "0", this.fakeElem.style.margin = "0", this.fakeElem.style.position =
|
|
244
|
+
"absolute", this.fakeElem.style[e ? "right" : "left"] = "-9999px";
|
|
245
|
+
var n = window.pageYOffset || document.documentElement.scrollTop;
|
|
246
|
+
this.fakeElem.style.top = n + "px", this.fakeElem.setAttribute("readonly", ""), this.fakeElem.value =
|
|
247
|
+
this.text, this.container.appendChild(this.fakeElem), this.selectedText = (0, c.default)(this.fakeElem),
|
|
248
|
+
this.copyText()
|
|
249
|
+
}
|
|
250
|
+
}, {
|
|
251
|
+
key: "removeFake",
|
|
252
|
+
value: function() {
|
|
253
|
+
this.fakeHandler && (this.container.removeEventListener("click", this.fakeHandlerCallback), this.fakeHandler =
|
|
254
|
+
null, this.fakeHandlerCallback = null), this.fakeElem && (this.container.removeChild(this.fakeElem),
|
|
255
|
+
this.fakeElem = null)
|
|
256
|
+
}
|
|
257
|
+
}, {
|
|
258
|
+
key: "selectTarget",
|
|
259
|
+
value: function() {
|
|
260
|
+
this.selectedText = (0, c.default)(this.target), this.copyText()
|
|
261
|
+
}
|
|
262
|
+
}, {
|
|
263
|
+
key: "copyText",
|
|
264
|
+
value: function() {
|
|
265
|
+
var e = void 0;
|
|
266
|
+
try {
|
|
267
|
+
e = document.execCommand(this.action)
|
|
268
|
+
} catch (t) {
|
|
269
|
+
e = !1
|
|
270
|
+
}
|
|
271
|
+
this.handleResult(e)
|
|
272
|
+
}
|
|
273
|
+
}, {
|
|
274
|
+
key: "handleResult",
|
|
275
|
+
value: function(t) {
|
|
276
|
+
this.emitter.emit(t ? "success" : "error", {
|
|
277
|
+
action: this.action,
|
|
278
|
+
text: this.selectedText,
|
|
279
|
+
trigger: this.trigger,
|
|
280
|
+
clearSelection: this.clearSelection.bind(this)
|
|
281
|
+
})
|
|
282
|
+
}
|
|
283
|
+
}, {
|
|
284
|
+
key: "clearSelection",
|
|
285
|
+
value: function() {
|
|
286
|
+
this.trigger && this.trigger.focus(), window.getSelection().removeAllRanges()
|
|
287
|
+
}
|
|
288
|
+
}, {
|
|
289
|
+
key: "destroy",
|
|
290
|
+
value: function() {
|
|
291
|
+
this.removeFake()
|
|
292
|
+
}
|
|
293
|
+
}, {
|
|
294
|
+
key: "action",
|
|
295
|
+
set: function() {
|
|
296
|
+
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "copy";
|
|
297
|
+
if (this._action = t, "copy" !== this._action && "cut" !== this._action) throw new Error(
|
|
298
|
+
'Invalid "action" value, use either "copy" or "cut"')
|
|
299
|
+
},
|
|
300
|
+
get: function() {
|
|
301
|
+
return this._action
|
|
302
|
+
}
|
|
303
|
+
}, {
|
|
304
|
+
key: "target",
|
|
305
|
+
set: function(t) {
|
|
306
|
+
if (void 0 !== t) {
|
|
307
|
+
if (!t || "object" !== (void 0 === t ? "undefined" : r(t)) || 1 !== t.nodeType) throw new Error(
|
|
308
|
+
'Invalid "target" value, use a valid Element');
|
|
309
|
+
if ("copy" === this.action && t.hasAttribute("disabled")) throw new Error(
|
|
310
|
+
'Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
|
311
|
+
if ("cut" === this.action && (t.hasAttribute("readonly") || t.hasAttribute("disabled"))) throw new Error(
|
|
312
|
+
'Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'
|
|
313
|
+
);
|
|
314
|
+
this._target = t
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
get: function() {
|
|
318
|
+
return this._target
|
|
319
|
+
}
|
|
320
|
+
}]), e
|
|
321
|
+
}();
|
|
322
|
+
t.exports = u
|
|
323
|
+
}, function(t, e) {
|
|
324
|
+
t.exports = function(t) {
|
|
325
|
+
var e;
|
|
326
|
+
if ("SELECT" === t.nodeName) t.focus(), e = t.value;
|
|
327
|
+
else if ("INPUT" === t.nodeName || "TEXTAREA" === t.nodeName) {
|
|
328
|
+
var n = t.hasAttribute("readonly");
|
|
329
|
+
n || t.setAttribute("readonly", ""), t.select(), t.setSelectionRange(0, t.value.length), n || t.removeAttribute(
|
|
330
|
+
"readonly"), e = t.value
|
|
331
|
+
} else {
|
|
332
|
+
t.hasAttribute("contenteditable") && t.focus();
|
|
333
|
+
var o = window.getSelection(),
|
|
334
|
+
r = document.createRange();
|
|
335
|
+
r.selectNodeContents(t), o.removeAllRanges(), o.addRange(r), e = o.toString()
|
|
336
|
+
}
|
|
337
|
+
return e
|
|
338
|
+
}
|
|
339
|
+
}, function(t, e) {
|
|
340
|
+
function n() {}
|
|
341
|
+
n.prototype = {
|
|
342
|
+
on: function(t, e, n) {
|
|
343
|
+
var o = this.e || (this.e = {});
|
|
344
|
+
return (o[t] || (o[t] = [])).push({
|
|
345
|
+
fn: e,
|
|
346
|
+
ctx: n
|
|
347
|
+
}), this
|
|
348
|
+
},
|
|
349
|
+
once: function(t, e, n) {
|
|
350
|
+
var o = this;
|
|
351
|
+
|
|
352
|
+
function r() {
|
|
353
|
+
o.off(t, r), e.apply(n, arguments)
|
|
354
|
+
}
|
|
355
|
+
return r._ = e, this.on(t, r, n)
|
|
356
|
+
},
|
|
357
|
+
emit: function(t) {
|
|
358
|
+
for (var e = [].slice.call(arguments, 1), n = ((this.e || (this.e = {}))[t] || []).slice(), o = 0, r = n.length; o <
|
|
359
|
+
r; o++) n[o].fn.apply(n[o].ctx, e);
|
|
360
|
+
return this
|
|
361
|
+
},
|
|
362
|
+
off: function(t, e) {
|
|
363
|
+
var n = this.e || (this.e = {}),
|
|
364
|
+
o = n[t],
|
|
365
|
+
r = [];
|
|
366
|
+
if (o && e)
|
|
367
|
+
for (var i = 0, a = o.length; i < a; i++) o[i].fn !== e && o[i].fn._ !== e && r.push(o[i]);
|
|
368
|
+
return r.length ? n[t] = r : delete n[t], this
|
|
369
|
+
}
|
|
370
|
+
}, t.exports = n
|
|
371
|
+
}, function(t, e, n) {
|
|
372
|
+
var d = n(5),
|
|
373
|
+
h = n(6);
|
|
374
|
+
t.exports = function(t, e, n) {
|
|
375
|
+
if (!t && !e && !n) throw new Error("Missing required arguments");
|
|
376
|
+
if (!d.string(e)) throw new TypeError("Second argument must be a String");
|
|
377
|
+
if (!d.fn(n)) throw new TypeError("Third argument must be a Function");
|
|
378
|
+
if (d.node(t)) return s = e, f = n, (l = t).addEventListener(s, f), {
|
|
379
|
+
destroy: function() {
|
|
380
|
+
l.removeEventListener(s, f)
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
if (d.nodeList(t)) return a = t, c = e, u = n, Array.prototype.forEach.call(a, function(t) {
|
|
384
|
+
t.addEventListener(c, u)
|
|
385
|
+
}), {
|
|
386
|
+
destroy: function() {
|
|
387
|
+
Array.prototype.forEach.call(a, function(t) {
|
|
388
|
+
t.removeEventListener(c, u)
|
|
389
|
+
})
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
if (d.string(t)) return o = t, r = e, i = n, h(document.body, o, r, i);
|
|
393
|
+
throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
|
|
394
|
+
var o, r, i, a, c, u, l, s, f
|
|
395
|
+
}
|
|
396
|
+
}, function(t, n) {
|
|
397
|
+
n.node = function(t) {
|
|
398
|
+
return void 0 !== t && t instanceof HTMLElement && 1 === t.nodeType
|
|
399
|
+
}, n.nodeList = function(t) {
|
|
400
|
+
var e = Object.prototype.toString.call(t);
|
|
401
|
+
return void 0 !== t && ("[object NodeList]" === e || "[object HTMLCollection]" === e) && "length" in t && (0 ===
|
|
402
|
+
t.length || n.node(t[0]))
|
|
403
|
+
}, n.string = function(t) {
|
|
404
|
+
return "string" == typeof t || t instanceof String
|
|
405
|
+
}, n.fn = function(t) {
|
|
406
|
+
return "[object Function]" === Object.prototype.toString.call(t)
|
|
407
|
+
}
|
|
408
|
+
}, function(t, e, n) {
|
|
409
|
+
var a = n(7);
|
|
410
|
+
|
|
411
|
+
function i(t, e, n, o, r) {
|
|
412
|
+
var i = function(e, n, t, o) {
|
|
413
|
+
return function(t) {
|
|
414
|
+
t.delegateTarget = a(t.target, n), t.delegateTarget && o.call(e, t)
|
|
415
|
+
}
|
|
416
|
+
}.apply(this, arguments);
|
|
417
|
+
return t.addEventListener(n, i, r), {
|
|
418
|
+
destroy: function() {
|
|
419
|
+
t.removeEventListener(n, i, r)
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
t.exports = function(t, e, n, o, r) {
|
|
424
|
+
return "function" == typeof t.addEventListener ? i.apply(null, arguments) : "function" == typeof n ? i.bind(
|
|
425
|
+
null, document).apply(null, arguments) : ("string" == typeof t && (t = document.querySelectorAll(t)), Array.prototype
|
|
426
|
+
.map.call(t, function(t) {
|
|
427
|
+
return i(t, e, n, o, r)
|
|
428
|
+
}))
|
|
429
|
+
}
|
|
430
|
+
}, function(t, e) {
|
|
431
|
+
if ("undefined" != typeof Element && !Element.prototype.matches) {
|
|
432
|
+
var n = Element.prototype;
|
|
433
|
+
n.matches = n.matchesSelector || n.mozMatchesSelector || n.msMatchesSelector || n.oMatchesSelector || n.webkitMatchesSelector
|
|
434
|
+
}
|
|
435
|
+
t.exports = function(t, e) {
|
|
436
|
+
for (; t && 9 !== t.nodeType;) {
|
|
437
|
+
if ("function" == typeof t.matches && t.matches(e)) return t;
|
|
438
|
+
t = t.parentNode
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}])
|
|
442
|
+
});
|
|
443
|
+
let Types = {
|
|
444
|
+
isFunction: function(obj) {
|
|
445
|
+
var type = Object.prototype.toString.call(obj)
|
|
446
|
+
return type == '[object Function]'
|
|
447
|
+
},
|
|
448
|
+
isObject: function(obj) {
|
|
449
|
+
var type = Object.prototype.toString.call(obj)
|
|
450
|
+
return type == '[object Object]'
|
|
451
|
+
},
|
|
452
|
+
isString: function(obj) {
|
|
453
|
+
var type = Object.prototype.toString.call(obj)
|
|
454
|
+
return type == '[object String]'
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
uni.setClipboardData = function(options) {
|
|
458
|
+
let emptyFun = function() {}
|
|
459
|
+
let config = {
|
|
460
|
+
data: null,
|
|
461
|
+
event: null,
|
|
462
|
+
success: emptyFun,
|
|
463
|
+
fail: emptyFun,
|
|
464
|
+
complete: emptyFun
|
|
465
|
+
}
|
|
466
|
+
if (options && Types.isObject(options)) {
|
|
467
|
+
config = Object.assign({}, config, options)
|
|
468
|
+
}
|
|
469
|
+
if (options && Types.isString(options)) {
|
|
470
|
+
config = Object.assign({}, config, {
|
|
471
|
+
data: options
|
|
472
|
+
})
|
|
473
|
+
}
|
|
474
|
+
let data = config.data
|
|
475
|
+
let success = config.success || emptyFun
|
|
476
|
+
let fail = config.fail || emptyFun
|
|
477
|
+
let complete = config.complete || emptyFun
|
|
478
|
+
let e = config.event || window.event || {}
|
|
479
|
+
let cb = new ClipboardJS('.null', {
|
|
480
|
+
text: () => data
|
|
481
|
+
})
|
|
482
|
+
cb.on('success', function(res) {
|
|
483
|
+
window.__clipboard__ = data;
|
|
484
|
+
success && Types.isFunction(success) && success({
|
|
485
|
+
data: res.text
|
|
486
|
+
})
|
|
487
|
+
complete && Types.isFunction(complete) && complete()
|
|
488
|
+
cb.off('error')
|
|
489
|
+
cb.off('success')
|
|
490
|
+
cb.destroy()
|
|
491
|
+
})
|
|
492
|
+
cb.on('error', function(err) {
|
|
493
|
+
fail && Types.isFunction(fail) && fail(err)
|
|
494
|
+
complete && Types.isFunction(complete) && complete()
|
|
495
|
+
cb.off('error')
|
|
496
|
+
cb.off('success')
|
|
497
|
+
cb.destroy()
|
|
498
|
+
})
|
|
499
|
+
cb.onClick(e)
|
|
500
|
+
};
|
|
501
|
+
uni.getClipboardData = function(options) {
|
|
502
|
+
let emptyFun = function() {}
|
|
503
|
+
let config = {
|
|
504
|
+
data: null,
|
|
505
|
+
event: null,
|
|
506
|
+
success: emptyFun,
|
|
507
|
+
fail: emptyFun,
|
|
508
|
+
complete: emptyFun
|
|
509
|
+
}
|
|
510
|
+
if (options && Types.isObject(options)) {
|
|
511
|
+
config = Object.assign({}, config, options)
|
|
512
|
+
}
|
|
513
|
+
let success = config.success || emptyFun
|
|
514
|
+
let fail = config.fail || emptyFun
|
|
515
|
+
let complete = config.complete || emptyFun
|
|
516
|
+
if (window.__clipboard__ !== undefined) {
|
|
517
|
+
success && Types.isFunction(success) && success({
|
|
518
|
+
data: window.__clipboard__
|
|
519
|
+
})
|
|
520
|
+
} else {
|
|
521
|
+
fail && Types.isFunction(fail) && fail({
|
|
522
|
+
data: null
|
|
523
|
+
})
|
|
524
|
+
}
|
|
525
|
+
complete && Types.isFunction(complete) && complete()
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
function fileDownLoad(data) {
|
|
529
|
+
var linkElement = document.createElement('a')
|
|
530
|
+
linkElement.setAttribute('href', data.blob)
|
|
531
|
+
linkElement.setAttribute('downLoad', data.name)
|
|
532
|
+
linkElement.click()
|
|
533
|
+
}
|
|
534
|
+
uni.saveImageToPhotosAlbum = uni.saveVideoToPhotosAlbum = function(options) {
|
|
535
|
+
let emptyFun = function() {}
|
|
536
|
+
let config = {
|
|
537
|
+
filePath: null,
|
|
538
|
+
success: emptyFun,
|
|
539
|
+
fail: emptyFun,
|
|
540
|
+
complete: emptyFun
|
|
541
|
+
}
|
|
542
|
+
if (options && Types.isObject(options)) {
|
|
543
|
+
config = Object.assign({}, config, options)
|
|
544
|
+
}
|
|
545
|
+
if (options && Types.isString(options)) {
|
|
546
|
+
config = Object.assign({}, config, {
|
|
547
|
+
filePath: options
|
|
548
|
+
})
|
|
549
|
+
}
|
|
550
|
+
let filePath = config.filePath
|
|
551
|
+
let success = config.success || emptyFun
|
|
552
|
+
let fail = config.fail || emptyFun
|
|
553
|
+
let complete = config.complete || emptyFun
|
|
554
|
+
if (!filePath) {
|
|
555
|
+
fail && Types.isFunction(fail) && fail({
|
|
556
|
+
msg: 'no File'
|
|
557
|
+
})
|
|
558
|
+
complete && Types.isFunction(complete) && complete()
|
|
559
|
+
return
|
|
560
|
+
}
|
|
561
|
+
let names = filePath.split('/')
|
|
562
|
+
let name = names[names.length - 1]
|
|
563
|
+
uni.downloadFile({
|
|
564
|
+
url: filePath,
|
|
565
|
+
success: function(res) {
|
|
566
|
+
let tempFilePath = res.tempFilePath
|
|
567
|
+
fileDownLoad({
|
|
568
|
+
name: name,
|
|
569
|
+
blob: tempFilePath
|
|
570
|
+
})
|
|
571
|
+
success && Types.isFunction(success) && success({
|
|
572
|
+
filePath: filePath
|
|
573
|
+
})
|
|
574
|
+
},
|
|
575
|
+
fail: function(err) {
|
|
576
|
+
fail && Types.isFunction(fail) && fail({
|
|
577
|
+
msg: err
|
|
578
|
+
})
|
|
579
|
+
},
|
|
580
|
+
complete: function() {
|
|
581
|
+
complete && Types.isFunction(complete) && complete()
|
|
582
|
+
}
|
|
583
|
+
})
|
|
584
|
+
}
|
|
585
|
+
//#endif
|
|
@@ -31,18 +31,14 @@ export const setStorage = (key, value, expire = 0) => {
|
|
|
31
31
|
if (value === '' || value === null || value === undefined) {
|
|
32
32
|
value = null;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
34
|
if (isNaN(expire) || expire < 0) throw new Error('Expire must be a number');
|
|
36
|
-
|
|
37
35
|
expire = (expire ? expire : config.expire) * 1000;
|
|
38
36
|
let data = {
|
|
39
37
|
value: value, // 存储值
|
|
40
38
|
time: Date.now(), //存值时间戳
|
|
41
39
|
expire: expire // 过期时间
|
|
42
40
|
};
|
|
43
|
-
|
|
44
41
|
const encryptString = config.isEncrypt ? encrypt(JSON.stringify(data)) : JSON.stringify(data);
|
|
45
|
-
|
|
46
42
|
window[config.type].setItem(autoAddPrefix(key), encryptString);
|
|
47
43
|
};
|
|
48
44
|
|
|
@@ -53,7 +49,6 @@ export const getStorage = (key) => {
|
|
|
53
49
|
if (!window[config.type].getItem(key) || JSON.stringify(window[config.type].getItem(key)) === 'null') {
|
|
54
50
|
return null;
|
|
55
51
|
}
|
|
56
|
-
|
|
57
52
|
// 优化 持续使用中续期
|
|
58
53
|
const storage = config.isEncrypt
|
|
59
54
|
? JSON.parse(decrypt(window[config.type].getItem(key)))
|