@10yun/cv-mobile-ui 0.5.35 → 0.5.37
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/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/QRCodeAlg.js +1046 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/QS-SharePoster.js +1309 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/QS-SharePoster2.js +1575 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/app.js +572 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/app2.js +570 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/image-tools.js +168 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/package.json +12 -0
- package/js-sdk/Sansnn-uQRCode/uqrcode.js +1295 -0
- package/js-sdk/ican-H5Api/ican-H5Api.js +669 -0
- package/package.json +1 -1
- package/ui-cv/components/cv-editor-quill/index.js +154 -133
- package/uni-ui/lib/uni-badge/uni-badge.vue +3 -1
- package/uni-ui/lib/uni-list/uni-refresh.wxs +1 -1
- package/uni-ui/lib/uni-load-more/uni-load-more.vue +3 -0
- package/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +355 -213
- package/uview-plus/components/u-qrcode/qrcode.js +4 -0
- package/uview-plus/libs/ctocode/date.js +17 -0
- package/uview-plus/libs/ctocode/index.js +19 -0
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
//#ifdef H5
|
|
2
|
+
/** clipboard.js v2.0.4**/
|
|
3
|
+
!(function (t, e) {
|
|
4
|
+
try {
|
|
5
|
+
window.ClipboardJS = e();
|
|
6
|
+
} catch (e) {}
|
|
7
|
+
'object' == typeof exports && 'object' == typeof module
|
|
8
|
+
? (module.exports = e())
|
|
9
|
+
: 'function' == typeof define && define.amd
|
|
10
|
+
? define([], e)
|
|
11
|
+
: 'object' == typeof exports
|
|
12
|
+
? (exports.ClipboardJS = e())
|
|
13
|
+
: (t.ClipboardJS = e());
|
|
14
|
+
})(this, function () {
|
|
15
|
+
return (function (n) {
|
|
16
|
+
var o = {};
|
|
17
|
+
function r(t) {
|
|
18
|
+
if (o[t]) return o[t].exports;
|
|
19
|
+
var e = (o[t] = { i: t, l: !1, exports: {} });
|
|
20
|
+
return n[t].call(e.exports, e, e.exports, r), (e.l = !0), e.exports;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
(r.m = n),
|
|
25
|
+
(r.c = o),
|
|
26
|
+
(r.d = function (t, e, n) {
|
|
27
|
+
r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n });
|
|
28
|
+
}),
|
|
29
|
+
(r.r = function (t) {
|
|
30
|
+
'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }),
|
|
31
|
+
Object.defineProperty(t, '__esModule', { value: !0 });
|
|
32
|
+
}),
|
|
33
|
+
(r.t = function (e, t) {
|
|
34
|
+
if ((1 & t && (e = r(e)), 8 & t)) return e;
|
|
35
|
+
if (4 & t && 'object' == typeof e && e && e.__esModule) return e;
|
|
36
|
+
var n = Object.create(null);
|
|
37
|
+
if (
|
|
38
|
+
(r.r(n),
|
|
39
|
+
Object.defineProperty(n, 'default', {
|
|
40
|
+
enumerable: !0,
|
|
41
|
+
value: e
|
|
42
|
+
}),
|
|
43
|
+
2 & t && 'string' != typeof e)
|
|
44
|
+
)
|
|
45
|
+
for (var o in e)
|
|
46
|
+
r.d(
|
|
47
|
+
n,
|
|
48
|
+
o,
|
|
49
|
+
function (t) {
|
|
50
|
+
return e[t];
|
|
51
|
+
}.bind(null, o)
|
|
52
|
+
);
|
|
53
|
+
return n;
|
|
54
|
+
}),
|
|
55
|
+
(r.n = function (t) {
|
|
56
|
+
var e =
|
|
57
|
+
t && t.__esModule
|
|
58
|
+
? function () {
|
|
59
|
+
return t.default;
|
|
60
|
+
}
|
|
61
|
+
: function () {
|
|
62
|
+
return t;
|
|
63
|
+
};
|
|
64
|
+
return r.d(e, 'a', e), e;
|
|
65
|
+
}),
|
|
66
|
+
(r.o = function (t, e) {
|
|
67
|
+
return Object.prototype.hasOwnProperty.call(t, e);
|
|
68
|
+
}),
|
|
69
|
+
(r.p = ''),
|
|
70
|
+
r((r.s = 0))
|
|
71
|
+
);
|
|
72
|
+
})([
|
|
73
|
+
function (t, e, n) {
|
|
74
|
+
'use strict';
|
|
75
|
+
var r =
|
|
76
|
+
'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
|
|
77
|
+
? function (t) {
|
|
78
|
+
return typeof t;
|
|
79
|
+
}
|
|
80
|
+
: function (t) {
|
|
81
|
+
return t && 'function' == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype
|
|
82
|
+
? 'symbol'
|
|
83
|
+
: typeof t;
|
|
84
|
+
},
|
|
85
|
+
i = (function () {
|
|
86
|
+
function o(t, e) {
|
|
87
|
+
for (var n = 0; n < e.length; n++) {
|
|
88
|
+
var o = e[n];
|
|
89
|
+
(o.enumerable = o.enumerable || !1),
|
|
90
|
+
(o.configurable = !0),
|
|
91
|
+
'value' in o && (o.writable = !0),
|
|
92
|
+
Object.defineProperty(t, o.key, o);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return function (t, e, n) {
|
|
97
|
+
return e && o(t.prototype, e), n && o(t, n), t;
|
|
98
|
+
};
|
|
99
|
+
})(),
|
|
100
|
+
a = o(n(1)),
|
|
101
|
+
c = o(n(3)),
|
|
102
|
+
u = o(n(4));
|
|
103
|
+
|
|
104
|
+
function o(t) {
|
|
105
|
+
return t && t.__esModule ? t : { default: t };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var l = (function (t) {
|
|
109
|
+
function o(t, e) {
|
|
110
|
+
!(function (t, e) {
|
|
111
|
+
if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function');
|
|
112
|
+
})(this, o);
|
|
113
|
+
var n = (function (t, e) {
|
|
114
|
+
if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
115
|
+
return !e || ('object' != typeof e && 'function' != typeof e) ? t : e;
|
|
116
|
+
})(this, (o.__proto__ || Object.getPrototypeOf(o)).call(this));
|
|
117
|
+
return n.resolveOptions(e), n.listenClick(t), n;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
(function (t, e) {
|
|
122
|
+
if ('function' != typeof e && null !== e)
|
|
123
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof e);
|
|
124
|
+
(t.prototype = Object.create(e && e.prototype, {
|
|
125
|
+
constructor: {
|
|
126
|
+
value: t,
|
|
127
|
+
enumerable: !1,
|
|
128
|
+
writable: !0,
|
|
129
|
+
configurable: !0
|
|
130
|
+
}
|
|
131
|
+
})),
|
|
132
|
+
e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : (t.__proto__ = e));
|
|
133
|
+
})(o, c.default),
|
|
134
|
+
i(
|
|
135
|
+
o,
|
|
136
|
+
[
|
|
137
|
+
{
|
|
138
|
+
key: 'resolveOptions',
|
|
139
|
+
value: function () {
|
|
140
|
+
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
|
|
141
|
+
(this.action = 'function' == typeof t.action ? t.action : this.defaultAction),
|
|
142
|
+
(this.target = 'function' == typeof t.target ? t.target : this.defaultTarget),
|
|
143
|
+
(this.text = 'function' == typeof t.text ? t.text : this.defaultText),
|
|
144
|
+
(this.container = 'object' === r(t.container) ? t.container : document.body);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
key: 'listenClick',
|
|
149
|
+
value: function (t) {
|
|
150
|
+
var e = this;
|
|
151
|
+
this.listener = (0, u.default)(t, 'click', function (t) {
|
|
152
|
+
return e.onClick(t);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
key: 'onClick',
|
|
158
|
+
value: function (t) {
|
|
159
|
+
var e = t.delegateTarget || t.currentTarget;
|
|
160
|
+
this.clipboardAction && (this.clipboardAction = null),
|
|
161
|
+
(this.clipboardAction = new a.default({
|
|
162
|
+
action: this.action(e),
|
|
163
|
+
target: this.target(e),
|
|
164
|
+
text: this.text(e),
|
|
165
|
+
container: this.container,
|
|
166
|
+
trigger: e,
|
|
167
|
+
emitter: this
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
key: 'defaultAction',
|
|
173
|
+
value: function (t) {
|
|
174
|
+
return s('action', t) || 'copy';
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
key: 'defaultTarget',
|
|
179
|
+
value: function (t) {
|
|
180
|
+
var e = s('target', t);
|
|
181
|
+
if (e) {
|
|
182
|
+
return document.querySelector(e);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
key: 'defaultText',
|
|
188
|
+
value: function (t) {
|
|
189
|
+
return s('text', t) || this.text;
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
key: 'destroy',
|
|
194
|
+
value: function () {
|
|
195
|
+
this.listener.destroy(),
|
|
196
|
+
this.clipboardAction && (this.clipboardAction.destroy(), (this.clipboardAction = null));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
[
|
|
201
|
+
{
|
|
202
|
+
key: 'isSupported',
|
|
203
|
+
value: function () {
|
|
204
|
+
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ['copy', 'cut'],
|
|
205
|
+
e = 'string' == typeof t ? [t] : t,
|
|
206
|
+
n = !!document.queryCommandSupported;
|
|
207
|
+
return (
|
|
208
|
+
e.forEach(function (t) {
|
|
209
|
+
n = n && !!document.queryCommandSupported(t);
|
|
210
|
+
}),
|
|
211
|
+
n
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
),
|
|
217
|
+
o
|
|
218
|
+
);
|
|
219
|
+
})();
|
|
220
|
+
|
|
221
|
+
function s(t, e) {
|
|
222
|
+
var n = 'data-clipboard-' + t;
|
|
223
|
+
let isFun = e && typeof e.hasAttribute === 'function';
|
|
224
|
+
if (isFun && e.hasAttribute(n)) {
|
|
225
|
+
return e.getAttribute(n);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
t.exports = l;
|
|
230
|
+
},
|
|
231
|
+
function (t, e, n) {
|
|
232
|
+
'use strict';
|
|
233
|
+
var o,
|
|
234
|
+
r =
|
|
235
|
+
'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
|
|
236
|
+
? function (t) {
|
|
237
|
+
return typeof t;
|
|
238
|
+
}
|
|
239
|
+
: function (t) {
|
|
240
|
+
return t && 'function' == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype
|
|
241
|
+
? 'symbol'
|
|
242
|
+
: typeof t;
|
|
243
|
+
},
|
|
244
|
+
i = (function () {
|
|
245
|
+
function o(t, e) {
|
|
246
|
+
for (var n = 0; n < e.length; n++) {
|
|
247
|
+
var o = e[n];
|
|
248
|
+
(o.enumerable = o.enumerable || !1),
|
|
249
|
+
(o.configurable = !0),
|
|
250
|
+
'value' in o && (o.writable = !0),
|
|
251
|
+
Object.defineProperty(t, o.key, o);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return function (t, e, n) {
|
|
256
|
+
return e && o(t.prototype, e), n && o(t, n), t;
|
|
257
|
+
};
|
|
258
|
+
})(),
|
|
259
|
+
a = n(2),
|
|
260
|
+
c = (o = a) && o.__esModule ? o : { default: o };
|
|
261
|
+
var u = (function () {
|
|
262
|
+
function e(t) {
|
|
263
|
+
!(function (t, e) {
|
|
264
|
+
if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function');
|
|
265
|
+
})(this, e),
|
|
266
|
+
this.resolveOptions(t),
|
|
267
|
+
this.initSelection();
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
i(e, [
|
|
272
|
+
{
|
|
273
|
+
key: 'resolveOptions',
|
|
274
|
+
value: function () {
|
|
275
|
+
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
|
|
276
|
+
(this.action = t.action),
|
|
277
|
+
(this.container = t.container),
|
|
278
|
+
(this.emitter = t.emitter),
|
|
279
|
+
(this.target = t.target),
|
|
280
|
+
(this.text = t.text),
|
|
281
|
+
(this.trigger = t.trigger),
|
|
282
|
+
(this.selectedText = '');
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
key: 'initSelection',
|
|
287
|
+
value: function () {
|
|
288
|
+
this.text ? this.selectFake() : this.target && this.selectTarget();
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
key: 'selectFake',
|
|
293
|
+
value: function () {
|
|
294
|
+
var t = this,
|
|
295
|
+
e = 'rtl' == document.documentElement.getAttribute('dir');
|
|
296
|
+
this.removeFake(),
|
|
297
|
+
(this.fakeHandlerCallback = function () {
|
|
298
|
+
return t.removeFake();
|
|
299
|
+
}),
|
|
300
|
+
(this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || !0),
|
|
301
|
+
(this.fakeElem = document.createElement('textarea')),
|
|
302
|
+
(this.fakeElem.style.fontSize = '12pt'),
|
|
303
|
+
(this.fakeElem.style.border = '0'),
|
|
304
|
+
(this.fakeElem.style.padding = '0'),
|
|
305
|
+
(this.fakeElem.style.margin = '0'),
|
|
306
|
+
(this.fakeElem.style.position = 'absolute'),
|
|
307
|
+
(this.fakeElem.style[e ? 'right' : 'left'] = '-9999px');
|
|
308
|
+
var n = window.pageYOffset || document.documentElement.scrollTop;
|
|
309
|
+
(this.fakeElem.style.top = n + 'px'),
|
|
310
|
+
this.fakeElem.setAttribute('readonly', ''),
|
|
311
|
+
(this.fakeElem.value = this.text),
|
|
312
|
+
this.container.appendChild(this.fakeElem),
|
|
313
|
+
(this.selectedText = (0, c.default)(this.fakeElem)),
|
|
314
|
+
this.copyText();
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
key: 'removeFake',
|
|
319
|
+
value: function () {
|
|
320
|
+
this.fakeHandler &&
|
|
321
|
+
(this.container.removeEventListener('click', this.fakeHandlerCallback),
|
|
322
|
+
(this.fakeHandler = null),
|
|
323
|
+
(this.fakeHandlerCallback = null)),
|
|
324
|
+
this.fakeElem && (this.container.removeChild(this.fakeElem), (this.fakeElem = null));
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
key: 'selectTarget',
|
|
329
|
+
value: function () {
|
|
330
|
+
(this.selectedText = (0, c.default)(this.target)), this.copyText();
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
key: 'copyText',
|
|
335
|
+
value: function () {
|
|
336
|
+
var e = void 0;
|
|
337
|
+
try {
|
|
338
|
+
e = document.execCommand(this.action);
|
|
339
|
+
} catch (t) {
|
|
340
|
+
e = !1;
|
|
341
|
+
}
|
|
342
|
+
this.handleResult(e);
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
key: 'handleResult',
|
|
347
|
+
value: function (t) {
|
|
348
|
+
this.emitter.emit(t ? 'success' : 'error', {
|
|
349
|
+
action: this.action,
|
|
350
|
+
text: this.selectedText,
|
|
351
|
+
trigger: this.trigger,
|
|
352
|
+
clearSelection: this.clearSelection.bind(this)
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
key: 'clearSelection',
|
|
358
|
+
value: function () {
|
|
359
|
+
this.trigger && this.trigger.focus(), window.getSelection().removeAllRanges();
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
key: 'destroy',
|
|
364
|
+
value: function () {
|
|
365
|
+
this.removeFake();
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
key: 'action',
|
|
370
|
+
set: function () {
|
|
371
|
+
var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 'copy';
|
|
372
|
+
if (((this._action = t), 'copy' !== this._action && 'cut' !== this._action))
|
|
373
|
+
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
|
374
|
+
},
|
|
375
|
+
get: function () {
|
|
376
|
+
return this._action;
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
key: 'target',
|
|
381
|
+
set: function (t) {
|
|
382
|
+
if (void 0 !== t) {
|
|
383
|
+
if (!t || 'object' !== (void 0 === t ? 'undefined' : r(t)) || 1 !== t.nodeType)
|
|
384
|
+
throw new Error('Invalid "target" value, use a valid Element');
|
|
385
|
+
if ('copy' === this.action && t.hasAttribute('disabled'))
|
|
386
|
+
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
|
387
|
+
if ('cut' === this.action && (t.hasAttribute('readonly') || t.hasAttribute('disabled')))
|
|
388
|
+
throw new Error(
|
|
389
|
+
'Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'
|
|
390
|
+
);
|
|
391
|
+
this._target = t;
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
get: function () {
|
|
395
|
+
return this._target;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
]),
|
|
399
|
+
e
|
|
400
|
+
);
|
|
401
|
+
})();
|
|
402
|
+
t.exports = u;
|
|
403
|
+
},
|
|
404
|
+
function (t, e) {
|
|
405
|
+
t.exports = function (t) {
|
|
406
|
+
var e;
|
|
407
|
+
if ('SELECT' === t.nodeName) t.focus(), (e = t.value);
|
|
408
|
+
else if ('INPUT' === t.nodeName || 'TEXTAREA' === t.nodeName) {
|
|
409
|
+
var n = t.hasAttribute('readonly');
|
|
410
|
+
n || t.setAttribute('readonly', ''),
|
|
411
|
+
t.select(),
|
|
412
|
+
t.setSelectionRange(0, t.value.length),
|
|
413
|
+
n || t.removeAttribute('readonly'),
|
|
414
|
+
(e = t.value);
|
|
415
|
+
} else {
|
|
416
|
+
t.hasAttribute('contenteditable') && t.focus();
|
|
417
|
+
var o = window.getSelection(),
|
|
418
|
+
r = document.createRange();
|
|
419
|
+
r.selectNodeContents(t), o.removeAllRanges(), o.addRange(r), (e = o.toString());
|
|
420
|
+
}
|
|
421
|
+
return e;
|
|
422
|
+
};
|
|
423
|
+
},
|
|
424
|
+
function (t, e) {
|
|
425
|
+
function n() {}
|
|
426
|
+
|
|
427
|
+
(n.prototype = {
|
|
428
|
+
on: function (t, e, n) {
|
|
429
|
+
var o = this.e || (this.e = {});
|
|
430
|
+
return (o[t] || (o[t] = [])).push({ fn: e, ctx: n }), this;
|
|
431
|
+
},
|
|
432
|
+
once: function (t, e, n) {
|
|
433
|
+
var o = this;
|
|
434
|
+
|
|
435
|
+
function r() {
|
|
436
|
+
o.off(t, r), e.apply(n, arguments);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
return (r._ = e), this.on(t, r, n);
|
|
440
|
+
},
|
|
441
|
+
emit: function (t) {
|
|
442
|
+
for (
|
|
443
|
+
var e = [].slice.call(arguments, 1), n = ((this.e || (this.e = {}))[t] || []).slice(), o = 0, r = n.length;
|
|
444
|
+
o < r;
|
|
445
|
+
o++
|
|
446
|
+
)
|
|
447
|
+
n[o].fn.apply(n[o].ctx, e);
|
|
448
|
+
return this;
|
|
449
|
+
},
|
|
450
|
+
off: function (t, e) {
|
|
451
|
+
var n = this.e || (this.e = {}),
|
|
452
|
+
o = n[t],
|
|
453
|
+
r = [];
|
|
454
|
+
if (o && e) for (var i = 0, a = o.length; i < a; i++) o[i].fn !== e && o[i].fn._ !== e && r.push(o[i]);
|
|
455
|
+
return r.length ? (n[t] = r) : delete n[t], this;
|
|
456
|
+
}
|
|
457
|
+
}),
|
|
458
|
+
(t.exports = n);
|
|
459
|
+
},
|
|
460
|
+
function (t, e, n) {
|
|
461
|
+
var d = n(5),
|
|
462
|
+
h = n(6);
|
|
463
|
+
t.exports = function (t, e, n) {
|
|
464
|
+
if (!t && !e && !n) throw new Error('Missing required arguments');
|
|
465
|
+
if (!d.string(e)) throw new TypeError('Second argument must be a String');
|
|
466
|
+
if (!d.fn(n)) throw new TypeError('Third argument must be a Function');
|
|
467
|
+
if (d.node(t))
|
|
468
|
+
return (
|
|
469
|
+
(s = e),
|
|
470
|
+
(f = n),
|
|
471
|
+
(l = t).addEventListener(s, f),
|
|
472
|
+
{
|
|
473
|
+
destroy: function () {
|
|
474
|
+
l.removeEventListener(s, f);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
);
|
|
478
|
+
if (d.nodeList(t))
|
|
479
|
+
return (
|
|
480
|
+
(a = t),
|
|
481
|
+
(c = e),
|
|
482
|
+
(u = n),
|
|
483
|
+
Array.prototype.forEach.call(a, function (t) {
|
|
484
|
+
t.addEventListener(c, u);
|
|
485
|
+
}),
|
|
486
|
+
{
|
|
487
|
+
destroy: function () {
|
|
488
|
+
Array.prototype.forEach.call(a, function (t) {
|
|
489
|
+
t.removeEventListener(c, u);
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
);
|
|
494
|
+
if (d.string(t)) return (o = t), (r = e), (i = n), h(document.body, o, r, i);
|
|
495
|
+
throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
|
|
496
|
+
var o, r, i, a, c, u, l, s, f;
|
|
497
|
+
};
|
|
498
|
+
},
|
|
499
|
+
function (t, n) {
|
|
500
|
+
(n.node = function (t) {
|
|
501
|
+
return void 0 !== t && t instanceof HTMLElement && 1 === t.nodeType;
|
|
502
|
+
}),
|
|
503
|
+
(n.nodeList = function (t) {
|
|
504
|
+
var e = Object.prototype.toString.call(t);
|
|
505
|
+
return (
|
|
506
|
+
void 0 !== t &&
|
|
507
|
+
('[object NodeList]' === e || '[object HTMLCollection]' === e) &&
|
|
508
|
+
'length' in t &&
|
|
509
|
+
(0 === t.length || n.node(t[0]))
|
|
510
|
+
);
|
|
511
|
+
}),
|
|
512
|
+
(n.string = function (t) {
|
|
513
|
+
return 'string' == typeof t || t instanceof String;
|
|
514
|
+
}),
|
|
515
|
+
(n.fn = function (t) {
|
|
516
|
+
return '[object Function]' === Object.prototype.toString.call(t);
|
|
517
|
+
});
|
|
518
|
+
},
|
|
519
|
+
function (t, e, n) {
|
|
520
|
+
var a = n(7);
|
|
521
|
+
|
|
522
|
+
function i(t, e, n, o, r) {
|
|
523
|
+
var i = function (e, n, t, o) {
|
|
524
|
+
return function (t) {
|
|
525
|
+
(t.delegateTarget = a(t.target, n)), t.delegateTarget && o.call(e, t);
|
|
526
|
+
};
|
|
527
|
+
}.apply(this, arguments);
|
|
528
|
+
return (
|
|
529
|
+
t.addEventListener(n, i, r),
|
|
530
|
+
{
|
|
531
|
+
destroy: function () {
|
|
532
|
+
t.removeEventListener(n, i, r);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
t.exports = function (t, e, n, o, r) {
|
|
539
|
+
return 'function' == typeof t.addEventListener
|
|
540
|
+
? i.apply(null, arguments)
|
|
541
|
+
: 'function' == typeof n
|
|
542
|
+
? i.bind(null, document).apply(null, arguments)
|
|
543
|
+
: ('string' == typeof t && (t = document.querySelectorAll(t)),
|
|
544
|
+
Array.prototype.map.call(t, function (t) {
|
|
545
|
+
return i(t, e, n, o, r);
|
|
546
|
+
}));
|
|
547
|
+
};
|
|
548
|
+
},
|
|
549
|
+
function (t, e) {
|
|
550
|
+
if ('undefined' != typeof Element && !Element.prototype.matches) {
|
|
551
|
+
var n = Element.prototype;
|
|
552
|
+
n.matches =
|
|
553
|
+
n.matchesSelector || n.mozMatchesSelector || n.msMatchesSelector || n.oMatchesSelector || n.webkitMatchesSelector;
|
|
554
|
+
}
|
|
555
|
+
t.exports = function (t, e) {
|
|
556
|
+
for (; t && 9 !== t.nodeType; ) {
|
|
557
|
+
if ('function' == typeof t.matches && t.matches(e)) return t;
|
|
558
|
+
t = t.parentNode;
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
]);
|
|
563
|
+
});
|
|
564
|
+
let Types = {
|
|
565
|
+
isFunction: function (obj) {
|
|
566
|
+
var type = Object.prototype.toString.call(obj);
|
|
567
|
+
return type == '[object Function]';
|
|
568
|
+
},
|
|
569
|
+
isObject: function (obj) {
|
|
570
|
+
var type = Object.prototype.toString.call(obj);
|
|
571
|
+
return type == '[object Object]';
|
|
572
|
+
},
|
|
573
|
+
isString: function (obj) {
|
|
574
|
+
var type = Object.prototype.toString.call(obj);
|
|
575
|
+
return type == '[object String]';
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
uni.setClipboardData = function (options) {
|
|
579
|
+
let emptyFun = function () {};
|
|
580
|
+
let config = { data: null, event: null, success: emptyFun, fail: emptyFun, complete: emptyFun };
|
|
581
|
+
if (options && Types.isObject(options)) {
|
|
582
|
+
config = Object.assign({}, config, options);
|
|
583
|
+
}
|
|
584
|
+
if (options && Types.isString(options)) {
|
|
585
|
+
config = Object.assign({}, config, { data: options });
|
|
586
|
+
}
|
|
587
|
+
let data = config.data;
|
|
588
|
+
let success = config.success || emptyFun;
|
|
589
|
+
let fail = config.fail || emptyFun;
|
|
590
|
+
let complete = config.complete || emptyFun;
|
|
591
|
+
let e = config.event || window.event || {};
|
|
592
|
+
let cb = new ClipboardJS('.null', { text: () => data });
|
|
593
|
+
cb.on('success', function (res) {
|
|
594
|
+
window.__clipboard__ = data;
|
|
595
|
+
success && Types.isFunction(success) && success({ data: res.text });
|
|
596
|
+
complete && Types.isFunction(complete) && complete();
|
|
597
|
+
cb.off('error');
|
|
598
|
+
cb.off('success');
|
|
599
|
+
cb.destroy();
|
|
600
|
+
});
|
|
601
|
+
cb.on('error', function (err) {
|
|
602
|
+
fail && Types.isFunction(fail) && fail(err);
|
|
603
|
+
complete && Types.isFunction(complete) && complete();
|
|
604
|
+
cb.off('error');
|
|
605
|
+
cb.off('success');
|
|
606
|
+
cb.destroy();
|
|
607
|
+
});
|
|
608
|
+
cb.onClick(e);
|
|
609
|
+
};
|
|
610
|
+
uni.getClipboardData = function (options) {
|
|
611
|
+
let emptyFun = function () {};
|
|
612
|
+
let config = { data: null, event: null, success: emptyFun, fail: emptyFun, complete: emptyFun };
|
|
613
|
+
if (options && Types.isObject(options)) {
|
|
614
|
+
config = Object.assign({}, config, options);
|
|
615
|
+
}
|
|
616
|
+
let success = config.success || emptyFun;
|
|
617
|
+
let fail = config.fail || emptyFun;
|
|
618
|
+
let complete = config.complete || emptyFun;
|
|
619
|
+
if (window.__clipboard__ !== undefined) {
|
|
620
|
+
success && Types.isFunction(success) && success({ data: window.__clipboard__ });
|
|
621
|
+
} else {
|
|
622
|
+
fail && Types.isFunction(fail) && fail({ data: null });
|
|
623
|
+
}
|
|
624
|
+
complete && Types.isFunction(complete) && complete();
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
function fileDownLoad(data) {
|
|
628
|
+
var linkElement = document.createElement('a');
|
|
629
|
+
linkElement.setAttribute('href', data.blob);
|
|
630
|
+
linkElement.setAttribute('downLoad', data.name);
|
|
631
|
+
linkElement.click();
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
uni.saveImageToPhotosAlbum = uni.saveVideoToPhotosAlbum = function (options) {
|
|
635
|
+
let emptyFun = function () {};
|
|
636
|
+
let config = { filePath: null, success: emptyFun, fail: emptyFun, complete: emptyFun };
|
|
637
|
+
if (options && Types.isObject(options)) {
|
|
638
|
+
config = Object.assign({}, config, options);
|
|
639
|
+
}
|
|
640
|
+
if (options && Types.isString(options)) {
|
|
641
|
+
config = Object.assign({}, config, { filePath: options });
|
|
642
|
+
}
|
|
643
|
+
let filePath = config.filePath;
|
|
644
|
+
let success = config.success || emptyFun;
|
|
645
|
+
let fail = config.fail || emptyFun;
|
|
646
|
+
let complete = config.complete || emptyFun;
|
|
647
|
+
if (!filePath) {
|
|
648
|
+
fail && Types.isFunction(fail) && fail({ msg: 'no File' });
|
|
649
|
+
complete && Types.isFunction(complete) && complete();
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
let names = filePath.split('/');
|
|
653
|
+
let name = names[names.length - 1];
|
|
654
|
+
uni.downloadFile({
|
|
655
|
+
url: filePath,
|
|
656
|
+
success: function (res) {
|
|
657
|
+
let tempFilePath = res.tempFilePath;
|
|
658
|
+
fileDownLoad({ name: name, blob: tempFilePath });
|
|
659
|
+
success && Types.isFunction(success) && success({ filePath: filePath });
|
|
660
|
+
},
|
|
661
|
+
fail: function (err) {
|
|
662
|
+
fail && Types.isFunction(fail) && fail({ msg: err });
|
|
663
|
+
},
|
|
664
|
+
complete: function () {
|
|
665
|
+
complete && Types.isFunction(complete) && complete();
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
};
|
|
669
|
+
//#endif
|