@ajaxjs/util 1.1.1 → 1.1.3

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 (78) hide show
  1. package/README.md +55 -6
  2. package/dist/index.esm.js +525 -0
  3. package/dist/index.umd.js +536 -0
  4. package/dist/{util → src/core}/cookies.d.ts +18 -18
  5. package/dist/{util → src/core}/dom.d.ts +17 -17
  6. package/dist/{util → src/core}/utils.d.ts +51 -51
  7. package/dist/{util → src/core}/xhr-config.d.ts +22 -22
  8. package/dist/{util → src/core}/xhr.d.ts +71 -71
  9. package/dist/src/index.d.ts +5 -0
  10. package/package.json +41 -43
  11. package/LICENSE +0 -201
  12. package/dist/index.d.ts +0 -38
  13. package/dist/index.js +0 -71
  14. package/dist/index.js.map +0 -1
  15. package/dist/main.d.ts +0 -1
  16. package/dist/main.js +0 -16
  17. package/dist/main.js.map +0 -1
  18. package/dist/router/index.d.ts +0 -3
  19. package/dist/router/index.js +0 -44
  20. package/dist/router/index.js.map +0 -1
  21. package/dist/router.d.ts +0 -3
  22. package/dist/router.js +0 -44
  23. package/dist/router.js.map +0 -1
  24. package/dist/shims-vue.d.ts +0 -4
  25. package/dist/style/common-functions.less +0 -294
  26. package/dist/style/reset.less +0 -19
  27. package/dist/util/cookies.js +0 -46
  28. package/dist/util/cookies.js.map +0 -1
  29. package/dist/util/dom.js +0 -44
  30. package/dist/util/dom.js.map +0 -1
  31. package/dist/util/utils.js +0 -174
  32. package/dist/util/utils.js.map +0 -1
  33. package/dist/util/xhr-config.js +0 -3
  34. package/dist/util/xhr-config.js.map +0 -1
  35. package/dist/util/xhr.js +0 -262
  36. package/dist/util/xhr.js.map +0 -1
  37. package/dist/widget/AccordionMenu.vue +0 -140
  38. package/dist/widget/AdjustFontSize.vue +0 -65
  39. package/dist/widget/Article.vue +0 -59
  40. package/dist/widget/EmptyContent.d.ts +0 -5
  41. package/dist/widget/EmptyContent.js +0 -7
  42. package/dist/widget/EmptyContent.js.map +0 -1
  43. package/dist/widget/Expander.vue +0 -65
  44. package/dist/widget/FileUploader/FileUploader.d.ts +0 -70
  45. package/dist/widget/FileUploader/FileUploader.js +0 -139
  46. package/dist/widget/FileUploader/FileUploader.js.map +0 -1
  47. package/dist/widget/FileUploader/FileUploader.less +0 -68
  48. package/dist/widget/FileUploader/FileUploader.ts +0 -156
  49. package/dist/widget/FileUploader/FileUploader.vue +0 -43
  50. package/dist/widget/HtmlEditor/HtmlEditor.d.ts +0 -70
  51. package/dist/widget/HtmlEditor/HtmlEditor.js +0 -287
  52. package/dist/widget/HtmlEditor/HtmlEditor.js.map +0 -1
  53. package/dist/widget/HtmlEditor/HtmlEditor.less +0 -345
  54. package/dist/widget/HtmlEditor/HtmlEditor.ts +0 -339
  55. package/dist/widget/HtmlEditor/HtmlEditor.vue +0 -70
  56. package/dist/widget/HtmlEditor/html-editor-HtmlSanitizer.js +0 -103
  57. package/dist/widget/ImageEnlarger.vue +0 -105
  58. package/dist/widget/OpacityBanner.vue +0 -125
  59. package/dist/widget/ProcessLine.vue +0 -133
  60. package/dist/widget/Resize.d.ts +0 -51
  61. package/dist/widget/Resize.js +0 -133
  62. package/dist/widget/Resize.js.map +0 -1
  63. package/dist/widget/Resize.ts +0 -152
  64. package/dist/widget/Resize.vue +0 -104
  65. package/dist/widget/TreeSelector.vue +0 -4
  66. package/dist/widget/calendar/BetweenDate.vue +0 -63
  67. package/dist/widget/calendar/Calendar.d.ts +0 -55
  68. package/dist/widget/calendar/Calendar.js +0 -145
  69. package/dist/widget/calendar/Calendar.js.map +0 -1
  70. package/dist/widget/calendar/Calendar.less +0 -210
  71. package/dist/widget/calendar/Calendar.ts +0 -167
  72. package/dist/widget/calendar/Calendar.vue +0 -52
  73. package/dist/widget/calendar/CalendarInput.vue +0 -71
  74. package/dist/widget/form/validator.d.ts +0 -70
  75. package/dist/widget/form/validator.js +0 -220
  76. package/dist/widget/form/validator.js.map +0 -1
  77. package/dist/widget/form/validator.ts +0 -289
  78. package/dist/widget/play-ground/sku.vue +0 -93
@@ -0,0 +1,536 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.index = global.index || {}, global.index.umd = global.index.umd || {}, global.index.umd.js = {})));
5
+ })(this, (function (exports) { 'use strict';
6
+
7
+ /**
8
+ * 获取某个 Cookie
9
+ *
10
+ * @param name 键名称
11
+ * @returns 值
12
+ */
13
+ function getCookie(name) {
14
+ let arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
15
+ // @ts-ignore
16
+ if (arr = document.cookie.match(reg))
17
+ return unescape(arr[2]);
18
+ else
19
+ return null;
20
+ }
21
+ /**
22
+ * 设置某个 Cookie
23
+ *
24
+ * @param name 键名称
25
+ * @param value 值
26
+ */
27
+ function setCookie(name, value) {
28
+ let days = 2, exp = new Date();
29
+ exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000);
30
+ // @ts-ignore
31
+ document.cookie = name + "=" + escape(value) + ";path=/;expires=" + exp.toGMTString();
32
+ }
33
+ /**
34
+ * 清空 Cookie
35
+ */
36
+ function delCookie() {
37
+ let keys = document.cookie.match(/[^ =;]+(?==)/g);
38
+ if (keys) {
39
+ let date = new Date(0).toUTCString();
40
+ for (let i = keys.length; i--;) {
41
+ document.cookie = keys[i] + '=0;path=/;expires=' + date; // 清除当前域名下的,例如:m.ratingdog.cn
42
+ document.cookie = keys[i] + '=0;path=/;domain=' + document.domain + ';expires=' + date; // 清除当前域名下的,例如 .m.ratingdog.cn
43
+ document.cookie = keys[i] + '=0;path=/;domain=' + location.host + ';expires=' + date; // 清除一级域名下的或指定的,例如 .ratingdog.cn
44
+ }
45
+ }
46
+ }
47
+
48
+ var cookies = /*#__PURE__*/Object.freeze({
49
+ __proto__: null,
50
+ delCookie: delCookie,
51
+ getCookie: getCookie,
52
+ setCookie: setCookie
53
+ });
54
+
55
+ /**
56
+ * 向父级元素递归搜索
57
+ *
58
+ * @param _el 当前所在元素
59
+ * @param tagName 目标标签名称
60
+ * @param className 目标元素样式类
61
+ * @returns 目标元素,找不到为 null
62
+ */
63
+ function up(_el, tagName, className) {
64
+ if (tagName && className)
65
+ throw '只能任选一种参数,不能同时传';
66
+ let el = _el.parentNode;
67
+ tagName = tagName && tagName.toUpperCase();
68
+ while (el) {
69
+ if (tagName && el.tagName == tagName)
70
+ return el;
71
+ if (className && el.className && ~el.className.indexOf(className))
72
+ return el;
73
+ el = el.parentNode;
74
+ }
75
+ return null;
76
+ }
77
+ /**
78
+ * 加载脚本
79
+ *
80
+ * @param url 脚本地址
81
+ * @param id 脚本元素 id,可选的
82
+ * @param cb 回调函数,可选的
83
+ */
84
+ function loadScript(url, id, cb) {
85
+ let script = document.createElement("script");
86
+ script.src = url;
87
+ if (cb)
88
+ script.onload = cb;
89
+ if (id)
90
+ script.id = id;
91
+ document.getElementsByTagName("head")[0].appendChild(script);
92
+ }
93
+
94
+ var dom = /*#__PURE__*/Object.freeze({
95
+ __proto__: null,
96
+ loadScript: loadScript,
97
+ up: up
98
+ });
99
+
100
+ /**
101
+ * 通用工具类
102
+ */
103
+ /**
104
+ * 是否调试模式中
105
+ *
106
+ * 打包成组件之后不能用
107
+ *
108
+ * @returns
109
+ */
110
+ function isDebug() {
111
+ // @ts-ignore
112
+ return process.env.NODE_ENV === 'development';
113
+ }
114
+ function isDev() {
115
+ let currentHostname = window.location.hostname;
116
+ // 判断主机名是否是内网地址
117
+ return (currentHostname.startsWith('192.168.') || currentHostname.startsWith('10.') || currentHostname === 'localhost');
118
+ }
119
+ /**
120
+ * 日期格式化。详见博客文章:http://blog.csdn.net/zhangxin09/archive/2011/01/01/6111294.aspx
121
+ * e.g: new Date().format("yyyy-MM-dd hh:mm:ss")
122
+ *
123
+ * @param {String} format
124
+ * @return {String}
125
+ */
126
+ function dateFormat(format) {
127
+ let $1, o = {
128
+ "M+": this.getMonth() + 1, // 月份,从0开始算
129
+ "d+": this.getDate(), // 日期
130
+ "h+": this.getHours(), // 小时
131
+ "m+": this.getMinutes(), // 分钟
132
+ "s+": this.getSeconds(), // 秒钟
133
+ // 季度 quarter
134
+ "q+": Math.floor((this.getMonth() + 3) / 3),
135
+ "S": this.getMilliseconds() // 千秒
136
+ };
137
+ if (/(y+)/.test(format))
138
+ // @ts-ignore
139
+ $1 = RegExp.$1, format = format.replace($1, String(this.getFullYear()).substr(4 - $1));
140
+ let key, value;
141
+ for (key in o) { // 如果没有指定该参数,则子字符串将延续到 stringvar 的最后。
142
+ if (new RegExp("(" + key + ")").test(format)) {
143
+ $1 = RegExp.$1,
144
+ value = String(o[key]),
145
+ value = $1.length == 1 ? value : ("00" + value).substr(value.length),
146
+ format = format.replace($1, value);
147
+ }
148
+ }
149
+ return format;
150
+ }
151
+ /**
152
+ * 日期格式化
153
+ * @author meizz
154
+ * @param date 日期,必须为 Date 类型
155
+ * @param fmt 格式模板
156
+ * @returns 格式化后的字符串
157
+ */
158
+ function dateFormat2(date, fmt) {
159
+ let o = {
160
+ "M+": date.getMonth() + 1, // 月份
161
+ "d+": date.getDate(), // 日
162
+ "h+": date.getHours(), // 小时
163
+ "m+": date.getMinutes(), // 分
164
+ "s+": date.getSeconds(), // 秒
165
+ "q+": Math.floor((date.getMonth() + 3) / 3), // 季度
166
+ "S": date.getMilliseconds() // 毫秒
167
+ };
168
+ if (/(y+)/.test(fmt))
169
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
170
+ for (var k in o)
171
+ if (new RegExp("(" + k + ")").test(fmt)) {
172
+ let obj = (RegExp.$1.length == 1) ? o[k] : ("00" + o[k]).substr(("" + o[k]).length);
173
+ // @ts-ignore
174
+ fmt = fmt.replace(RegExp.$1, obj);
175
+ }
176
+ return fmt;
177
+ }
178
+ /**
179
+ * 并行和串行任务
180
+ *
181
+ * @author https://segmentfault.com/a/1190000013265925
182
+ * @param arr
183
+ * @param finnaly
184
+ */
185
+ function parallel(arr, _finally) {
186
+ let fn, index = 0;
187
+ // @ts-ignore
188
+ let statusArr = Array(arr.length).fill().map(() => ({ isActive: false, data: null }));
189
+ let isFinished = function () {
190
+ return statusArr.every((item) => item.isActive === true);
191
+ };
192
+ let resolve = function (index) {
193
+ return function (data) {
194
+ statusArr[index].data = data;
195
+ statusArr[index].isActive = true;
196
+ let isFinish = isFinished();
197
+ if (isFinish) {
198
+ let datas = statusArr.map((item) => item.data);
199
+ _finally(datas);
200
+ }
201
+ };
202
+ };
203
+ // @ts-ignore
204
+ while ((fn = arr.shift())) {
205
+ fn(resolve(index)); // 给 resolve 函数追加参数,可以使用 bind 函数实现,这里使用了柯里化
206
+ index++;
207
+ }
208
+ }
209
+ /**
210
+ * 函数节流
211
+ *
212
+ * @author https://www.cnblogs.com/moqiutao/p/6875955.html
213
+ * @param fn
214
+ * @param delay
215
+ * @param mustRunDelay
216
+ */
217
+ function throttle(fn, delay, mustRunDelay) {
218
+ var timer, t_start;
219
+ return function () {
220
+ var t_curr = +new Date();
221
+ window.clearTimeout(timer);
222
+ if (!t_start)
223
+ t_start = t_curr;
224
+ if (t_curr - t_start >= mustRunDelay) {
225
+ // @ts-ignore
226
+ fn.apply(this, arguments);
227
+ t_start = t_curr;
228
+ }
229
+ else {
230
+ var args = arguments;
231
+ // @ts-ignore
232
+ timer = window.setTimeout(() => fn.apply(this, args), delay);
233
+ }
234
+ };
235
+ }
236
+ /**
237
+ * 复制文字到剪切板
238
+ *
239
+ * @param {string} text
240
+ */
241
+ function copyToClipboard(text) {
242
+ if (navigator.clipboard)
243
+ navigator.clipboard.writeText(text); // clipboard api 复制
244
+ else {
245
+ let textarea = document.createElement('textarea');
246
+ document.body.appendChild(textarea); // 隐藏此输入框
247
+ textarea.style.position = 'fixed';
248
+ textarea.style.clip = 'rect(0 0 0 0)';
249
+ textarea.style.top = '10px';
250
+ textarea.value = text; // 赋值
251
+ textarea.select(); // 选中
252
+ document.execCommand('copy', true); // 复制
253
+ document.body.removeChild(textarea); // 移除输入框
254
+ }
255
+ }
256
+
257
+ var utils = /*#__PURE__*/Object.freeze({
258
+ __proto__: null,
259
+ copyToClipboard: copyToClipboard,
260
+ dateFormat: dateFormat,
261
+ dateFormat2: dateFormat2,
262
+ isDebug: isDebug,
263
+ isDev: isDev,
264
+ parallel: parallel,
265
+ throttle: throttle
266
+ });
267
+
268
+ /**
269
+ * 默认的请求配置
270
+ */
271
+ const DEFAULT_XHR_CFG = {
272
+ timeout: 5000,
273
+ withCredentials: false,
274
+ parseContentType: 'json'
275
+ };
276
+ /**
277
+ * 全局请求的 head 参数
278
+ */
279
+ let BASE_HEAD_PARAMS = null;
280
+ /**
281
+ * 设置全局请求的 head 参数
282
+ *
283
+ * @param param
284
+ */
285
+ function setBaseHeadParams(params) {
286
+ if (BASE_HEAD_PARAMS === null)
287
+ BASE_HEAD_PARAMS = {};
288
+ Object.assign(BASE_HEAD_PARAMS, params);
289
+ }
290
+ /**
291
+ *
292
+ * @param getOrDel
293
+ * @param url
294
+ * @param cb
295
+ * @param params
296
+ * @param cfg
297
+ */
298
+ function getOrDel(getOrDel, url, cb, params, cfg = DEFAULT_XHR_CFG) {
299
+ let xhr = initXhr(cfg);
300
+ if (params != null) {
301
+ if (url.indexOf('?') != -1)
302
+ url += '&' + toParams(params);
303
+ else
304
+ url += '?' + toParams(params);
305
+ }
306
+ xhr.open(getOrDel.toUpperCase(), url, true);
307
+ xhr.onreadystatechange = function () {
308
+ responseHandle(this, cb, cfg);
309
+ };
310
+ if (BASE_HEAD_PARAMS) // 设置自定义请求头
311
+ for (let key in BASE_HEAD_PARAMS)
312
+ xhr.setRequestHeader(key, BASE_HEAD_PARAMS[key]);
313
+ xhr.send();
314
+ }
315
+ /**
316
+ *
317
+ * @param method
318
+ * @param url
319
+ * @param cb
320
+ * @param params
321
+ * @param cfg
322
+ */
323
+ function postOrPut(method, url, cb, params, cfg = DEFAULT_XHR_CFG) {
324
+ let xhr = initXhr(cfg);
325
+ xhr.open(method, url, true);
326
+ xhr.onreadystatechange = function () {
327
+ responseHandle(this, cb, cfg);
328
+ };
329
+ if (BASE_HEAD_PARAMS) // 设置自定义请求头
330
+ for (let key in BASE_HEAD_PARAMS)
331
+ xhr.setRequestHeader(key, BASE_HEAD_PARAMS[key]);
332
+ // 此方法必须在 open() 方法和 send() 之间调用
333
+ if (!cfg.contentType) // 如未设置,默认为表单请求
334
+ xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
335
+ else
336
+ xhr.setRequestHeader("Content-Type", cfg.contentType);
337
+ let _params = typeof params != 'string' ? toParams(params) : params;
338
+ if (_params)
339
+ xhr.send(_params);
340
+ else
341
+ xhr.send();
342
+ }
343
+ /**
344
+ *
345
+ * @param url
346
+ * @param cb
347
+ * @param params
348
+ * @param cfg
349
+ */
350
+ function xhr_post_upload(url, cb, params, cfg = DEFAULT_XHR_CFG) {
351
+ let xhr = initXhr(cfg);
352
+ xhr.open('post', url, true);
353
+ xhr.onreadystatechange = function () {
354
+ responseHandle(this, cb, cfg);
355
+ };
356
+ if (BASE_HEAD_PARAMS) // 设置自定义请求头
357
+ for (let key in BASE_HEAD_PARAMS)
358
+ xhr.setRequestHeader(key, BASE_HEAD_PARAMS[key]);
359
+ // 什么 Content-Type 都不设置
360
+ xhr.send(params);
361
+ }
362
+ /**
363
+ * XHR GET 请求
364
+ *
365
+ * @param url 请求地址
366
+ * @param cb 回调函数 @example (json: {}, text: string) => void;
367
+ * @param params 参数,必填,如无填空字符串 "";参数类型是json;参数值会进行 URL 编码,最后附加到 QueryString 中
368
+ * @param cfg 配置,可选的
369
+ */
370
+ function xhr_get(url, cb, params, cfg = DEFAULT_XHR_CFG) {
371
+ getOrDel('get', url, cb, params, cfg);
372
+ }
373
+ /**
374
+ * XHR DELETE 请求
375
+ *
376
+ * @param url 请求地址
377
+ * @param cb 回调函数 @example (json: {}, text: string) => void;
378
+ * @param params 参数,必填,如无填空字符串 "";参数类型是json;参数值会进行 URL 编码,最后附加到 QueryString 中
379
+ * @param cfg 配置,可选的
380
+ */
381
+ function xhr_del(url, cb, params, cfg = DEFAULT_XHR_CFG) {
382
+ getOrDel('delete', url, cb, params, cfg);
383
+ }
384
+ /**
385
+ * XHR POST 请求
386
+ *
387
+ * @param url 请求地址
388
+ * @param cb 回调函数 @example (json: {}, text: string) => void;
389
+ * @param params 参数,必填,如无填空字符串 "";参数类型可以是字符串或 json;参数值会进行 URL 编码
390
+ * @param cfg 配置,可选的
391
+ */
392
+ function xhr_post(url, cb, params, cfg = DEFAULT_XHR_CFG) {
393
+ postOrPut('post', url, cb, params, cfg);
394
+ }
395
+ /**
396
+ * XHR PUT 请求
397
+ *
398
+ * @param url 请求地址
399
+ * @param cb 回调函数 @example (json: {}, text: string) => void;
400
+ * @param params 参数,必填,如无填空字符串 "";参数类型可以是字符串或 json;参数值会进行 URL 编码
401
+ * @param cfg 配置,可选的
402
+ */
403
+ function xhr_put(url, cb, params, cfg = DEFAULT_XHR_CFG) {
404
+ postOrPut('put', url, cb, params, cfg);
405
+ }
406
+ /**
407
+ * 初始化 XHR
408
+ *
409
+ * @param cfg
410
+ * @returns
411
+ */
412
+ function initXhr(cfg) {
413
+ let xhr = new XMLHttpRequest();
414
+ if (cfg && cfg.timeout) {
415
+ xhr.timeout = cfg.timeout;
416
+ xhr.ontimeout = (e) => console.error('系统异常,XHR 连接服务超时');
417
+ }
418
+ if (cfg && cfg.withCredentials)
419
+ xhr.withCredentials = true;
420
+ return xhr;
421
+ }
422
+ /**
423
+ * 错误处理
424
+ *
425
+ * @param xhr
426
+ */
427
+ function errHandle(xhr) {
428
+ let msg;
429
+ if (xhr.status <= 400)
430
+ msg = '请求参数错误或者权限不足。';
431
+ else if (xhr.status <= 500)
432
+ msg = '服务端异常。';
433
+ else
434
+ msg = `未知异常,HTTP code:${xhr.status}。`;
435
+ if (!xhr.responseText)
436
+ msg += " 服务端返回空的字符串!";
437
+ console.error(msg, xhr.responseText);
438
+ }
439
+ /**
440
+ * 响应处理
441
+ *
442
+ * @param xhr
443
+ * @param cb
444
+ * @param cfg
445
+ */
446
+ function responseHandle(xhr, cb, cfg) {
447
+ if (xhr.readyState == 4) {
448
+ if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) {
449
+ let text = xhr.responseText;
450
+ let json;
451
+ if (!text)
452
+ console.warn('服务端没有返回任何字符串');
453
+ switch (cfg.parseContentType) {
454
+ case 'text':
455
+ break;
456
+ case 'xml':
457
+ json = xhr.responseXML;
458
+ break;
459
+ case 'json':
460
+ default:
461
+ try {
462
+ json = JSON.parse(text);
463
+ }
464
+ catch (e) {
465
+ console.error('解析 JSON 时候发生错误,非法 JSON');
466
+ console.warn(e);
467
+ }
468
+ }
469
+ cb && cb(json, text);
470
+ }
471
+ else
472
+ errHandle(xhr);
473
+ }
474
+ }
475
+ /**
476
+ * 对象转换为 URL 参数列表,用 & 分隔
477
+ *
478
+ * @param {Object} param JSON 对象
479
+ * @returns URL 参数列表
480
+ */
481
+ function toParams(param) {
482
+ let result = "";
483
+ for (let name in param) {
484
+ if (typeof param[name] != "function")
485
+ result += "&" + name + "=" + encodeURIComponent(param[name]);
486
+ }
487
+ return result.substring(1);
488
+ }
489
+ /**
490
+ * 获取 QueryString 的某个参数
491
+ *
492
+ * @param val
493
+ * @returns
494
+ */
495
+ function getQuery(val) {
496
+ const w = location.hash.indexOf('?');
497
+ const query = location.hash.substring(w + 1);
498
+ let vars = query.split('&');
499
+ for (let i = 0; i < vars.length; i++) {
500
+ const pair = vars[i].split('=');
501
+ if (pair[0] == val)
502
+ return pair[1];
503
+ }
504
+ return '';
505
+ }
506
+ function getPageList(self, listArray, callback) {
507
+ return (j) => {
508
+ if (j.status) {
509
+ listArray.total = j.total;
510
+ listArray.data = j.data;
511
+ callback && callback();
512
+ }
513
+ else
514
+ self.$Message.warning(j.message || '获取数据失败');
515
+ };
516
+ }
517
+
518
+ var xhr = /*#__PURE__*/Object.freeze({
519
+ __proto__: null,
520
+ getPageList: getPageList,
521
+ getQuery: getQuery,
522
+ setBaseHeadParams: setBaseHeadParams,
523
+ toParams: toParams,
524
+ xhr_del: xhr_del,
525
+ xhr_get: xhr_get,
526
+ xhr_post: xhr_post,
527
+ xhr_post_upload: xhr_post_upload,
528
+ xhr_put: xhr_put
529
+ });
530
+
531
+ exports.Cookies = cookies;
532
+ exports.Dom = dom;
533
+ exports.Utils = utils;
534
+ exports.Xhr = xhr;
535
+
536
+ }));
@@ -1,18 +1,18 @@
1
- /**
2
- * 获取某个 Cookie
3
- *
4
- * @param name 键名称
5
- * @returns 值
6
- */
7
- export declare function getCookie(name: string): string | null;
8
- /**
9
- * 设置某个 Cookie
10
- *
11
- * @param name 键名称
12
- * @param value 值
13
- */
14
- export declare function setCookie(name: string, value: string): void;
15
- /**
16
- * 清空 Cookie
17
- */
18
- export declare function delCookie(): void;
1
+ /**
2
+ * 获取某个 Cookie
3
+ *
4
+ * @param name 键名称
5
+ * @returns 值
6
+ */
7
+ export declare function getCookie(name: string): string | null;
8
+ /**
9
+ * 设置某个 Cookie
10
+ *
11
+ * @param name 键名称
12
+ * @param value 值
13
+ */
14
+ export declare function setCookie(name: string, value: string): void;
15
+ /**
16
+ * 清空 Cookie
17
+ */
18
+ export declare function delCookie(): void;
@@ -1,17 +1,17 @@
1
- /**
2
- * 向父级元素递归搜索
3
- *
4
- * @param _el 当前所在元素
5
- * @param tagName 目标标签名称
6
- * @param className 目标元素样式类
7
- * @returns 目标元素,找不到为 null
8
- */
9
- export declare function up(_el: Element, tagName: string, className: string): Element | null;
10
- /**
11
- * 加载脚本
12
- *
13
- * @param url 脚本地址
14
- * @param id 脚本元素 id,可选的
15
- * @param cb 回调函数,可选的
16
- */
17
- export declare function loadScript(url: string, id?: string, cb?: (ev: Event) => any): void;
1
+ /**
2
+ * 向父级元素递归搜索
3
+ *
4
+ * @param _el 当前所在元素
5
+ * @param tagName 目标标签名称
6
+ * @param className 目标元素样式类
7
+ * @returns 目标元素,找不到为 null
8
+ */
9
+ export declare function up(_el: Element, tagName: string, className: string): Element | null;
10
+ /**
11
+ * 加载脚本
12
+ *
13
+ * @param url 脚本地址
14
+ * @param id 脚本元素 id,可选的
15
+ * @param cb 回调函数,可选的
16
+ */
17
+ export declare function loadScript(url: string, id?: string, cb?: (ev: Event) => any): void;