@deppon/deppon-tools 2.2.1 → 2.2.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.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 xingxing
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 xingxing
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # `@deppon/deppon-tools`
2
-
3
- 前端 tools 工具包,适用于 Vue 项目。
4
-
5
- ## 功能
6
-
7
- - **html2image**: DOM 转图片工具
8
- - **Address**: 地址配置工具
9
- - **SwiftSwiper**: 滑动组件
10
- - **Loading**: 加载状态管理
1
+ # `@deppon/deppon-tools`
2
+
3
+ 前端 tools 工具包,适用于 Vue 项目。
4
+
5
+ ## 功能
6
+
7
+ - **html2image**: DOM 转图片工具
8
+ - **Address**: 地址配置工具
9
+ - **SwiftSwiper**: 滑动组件
10
+ - **Loading**: 加载状态管理
@@ -1,46 +1,46 @@
1
- export default class SwiftSwiper {
2
- static polyTransform(): string | undefined;
3
- static polyTransition(): string | undefined;
4
- static mergeSettings(options: any): any;
5
- constructor(options: any);
6
- config: any;
7
- selector: any;
8
- lazyElements: NodeListOf<Element>;
9
- innerElements: any[];
10
- selectorWidth: any;
11
- selectorHeight: any;
12
- total: number;
13
- currentIndex: number;
14
- transformProperty: string | undefined;
15
- transitionProperty: string | undefined;
16
- slideDirection: string;
17
- startX: number;
18
- startY: number;
19
- endX: number;
20
- endY: number;
21
- pointerDown: boolean;
22
- letItGo: boolean | null;
23
- isEndDrag: boolean;
24
- init(): void;
25
- initLazyload(): void;
26
- buildPagination(): void;
27
- paginationEl: HTMLDivElement | undefined;
28
- buildSlideFrame(): void;
29
- sliderFrame: HTMLDivElement | undefined;
30
- buildSliderFrameItem(elm: any): HTMLDivElement;
31
- transitionendHandler(): void;
32
- touchstartHandler(e: any): void;
33
- touchmoveHandler(e: any): void;
34
- touchendHandler(e: any): void;
35
- handleAfterDrag(): void;
36
- slideTo(index: any): void;
37
- clearDrag(): void;
38
- lazyLoadImg(el: any): void;
39
- attachEvents(): void;
40
- detachEvents(): void;
41
- enableTransition(): void;
42
- disableTransition(): void;
43
- jumpTo(index: any): void;
44
- jumpToNext(): false | undefined;
45
- jumpToPrev(): false | undefined;
46
- }
1
+ export default class SwiftSwiper {
2
+ static polyTransform(): string | undefined;
3
+ static polyTransition(): string | undefined;
4
+ static mergeSettings(options: any): any;
5
+ constructor(options: any);
6
+ config: any;
7
+ selector: any;
8
+ lazyElements: NodeListOf<Element>;
9
+ innerElements: any[];
10
+ selectorWidth: any;
11
+ selectorHeight: any;
12
+ total: number;
13
+ currentIndex: number;
14
+ transformProperty: string | undefined;
15
+ transitionProperty: string | undefined;
16
+ slideDirection: string;
17
+ startX: number;
18
+ startY: number;
19
+ endX: number;
20
+ endY: number;
21
+ pointerDown: boolean;
22
+ letItGo: boolean | null;
23
+ isEndDrag: boolean;
24
+ init(): void;
25
+ initLazyload(): void;
26
+ buildPagination(): void;
27
+ paginationEl: HTMLDivElement | undefined;
28
+ buildSlideFrame(): void;
29
+ sliderFrame: HTMLDivElement | undefined;
30
+ buildSliderFrameItem(elm: any): HTMLDivElement;
31
+ transitionendHandler(): void;
32
+ touchstartHandler(e: any): void;
33
+ touchmoveHandler(e: any): void;
34
+ touchendHandler(e: any): void;
35
+ handleAfterDrag(): void;
36
+ slideTo(index: any): void;
37
+ clearDrag(): void;
38
+ lazyLoadImg(el: any): void;
39
+ attachEvents(): void;
40
+ detachEvents(): void;
41
+ enableTransition(): void;
42
+ disableTransition(): void;
43
+ jumpTo(index: any): void;
44
+ jumpToNext(): false | undefined;
45
+ jumpToPrev(): false | undefined;
46
+ }
@@ -1,3 +1,3 @@
1
- export const DEFAUKT_DEVICE: 2;
2
- export const IMAGE_SCALE: 0.9;
3
- export const LONG_IMAGE_BORDER: 20;
1
+ export const DEFAUKT_DEVICE: 2;
2
+ export const IMAGE_SCALE: 0.9;
3
+ export const LONG_IMAGE_BORDER: 20;
@@ -1,113 +1,113 @@
1
- export default domtoimage;
2
- declare namespace domtoimage {
3
- export { toSvg };
4
- export { toPng };
5
- export { toJpeg };
6
- export { toBlob };
7
- export { toPixelData };
8
- export namespace impl {
9
- export { fontFaces };
10
- export { images };
11
- export { util };
12
- export { inliner };
13
- export const options: {};
14
- }
15
- }
16
- declare function toSvg(node: any, options: any): Promise<string>;
17
- /**
18
- * @param {Node} node - The DOM Node object to render
19
- * @param {Object} options - Rendering options, @see {@link toSvg}
20
- * @return {Promise} - A promise that is fulfilled with a PNG image data URL
21
- * */
22
- declare function toPng(node: Node, options: Object): Promise<any>;
23
- /**
24
- * @param {Node} node - The DOM Node object to render
25
- * @param {Object} options - Rendering options, @see {@link toSvg}
26
- * @return {Promise} - A promise that is fulfilled with a JPEG image data URL
27
- * */
28
- declare function toJpeg(node: Node, options: Object): Promise<any>;
29
- /**
30
- * @param {Node} node - The DOM Node object to render
31
- * @param {Object} options - Rendering options, @see {@link toSvg}
32
- * @return {Promise} - A promise that is fulfilled with a PNG image blob
33
- * */
34
- declare function toBlob(node: Node, options: Object): Promise<any>;
35
- /**
36
- * @param {Node} node - The DOM Node object to render
37
- * @param {Object} options - Rendering options, @see {@link toSvg}
38
- * @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
39
- * */
40
- declare function toPixelData(node: Node, options: Object): Promise<any>;
41
- declare namespace fontFaces {
42
- export { resolveAll };
43
- export namespace impl_1 {
44
- export { readAll };
45
- }
46
- export { impl_1 as impl };
47
- }
48
- declare namespace images {
49
- export { inlineAll };
50
- export namespace impl_2 {
51
- export { newImage };
52
- }
53
- export { impl_2 as impl };
54
- }
55
- declare namespace util {
56
- export { escape };
57
- export { parseExtension };
58
- export { mimeType };
59
- export { dataAsUrl };
60
- export { isDataUrl };
61
- export { canvasToBlob };
62
- export { resolveUrl };
63
- export { getAndEncode };
64
- export function uid(): string;
65
- export { delay };
66
- export { asArray };
67
- export { escapeXhtml };
68
- export { makeImage };
69
- export { width };
70
- export { height };
71
- export { domIsBody };
72
- export { getScrollTop };
73
- export { getScrollLeft };
74
- export { compressionBase64 };
75
- export { splitImg };
76
- }
77
- declare namespace inliner {
78
- export { inlineAll };
79
- export { shouldProcess };
80
- export namespace impl_3 {
81
- export { readUrls };
82
- export { inline };
83
- }
84
- export { impl_3 as impl };
85
- }
86
- declare function resolveAll(): Promise<string>;
87
- declare function readAll(): Promise<any>;
88
- declare function inlineAll(node: any, options: any): any;
89
- declare function newImage(element: any): {
90
- inline: (get: any, options: any) => Promise<any>;
91
- };
92
- declare function parseExtension(url: any): string;
93
- declare function mimeType(url: any): any;
94
- declare function dataAsUrl(content: any, type: any): string;
95
- declare function isDataUrl(url: any): boolean;
96
- declare function canvasToBlob(canvas: any): Promise<any>;
97
- declare function resolveUrl(url: any, baseUrl: any): string;
98
- declare function getAndEncode(url: any): Promise<any>;
99
- declare function delay(ms: any): (arg: any) => Promise<any>;
100
- declare function asArray(arrayLike: any): any[];
101
- declare function escapeXhtml(string: any): any;
102
- declare function makeImage(uri: any): Promise<any>;
103
- declare function width(node: any): any;
104
- declare function height(node: any): any;
105
- declare function domIsBody(node: any): boolean;
106
- declare function getScrollTop(): number;
107
- declare function getScrollLeft(): number;
108
- declare function compressionBase64(target: any, status: any): Promise<any>;
109
- declare function splitImg(clone: any, parent: any, original: any): Promise<any>;
110
- declare function inlineAll_1(string: any, baseUrl: any, get: any): Promise<any>;
111
- declare function shouldProcess(string: any): boolean;
112
- declare function readUrls(string: any): string[];
113
- declare function inline(string: any, url: any, baseUrl: any, get: any): Promise<any>;
1
+ export default domtoimage;
2
+ declare namespace domtoimage {
3
+ export { toSvg };
4
+ export { toPng };
5
+ export { toJpeg };
6
+ export { toBlob };
7
+ export { toPixelData };
8
+ export namespace impl {
9
+ export { fontFaces };
10
+ export { images };
11
+ export { util };
12
+ export { inliner };
13
+ export const options: {};
14
+ }
15
+ }
16
+ declare function toSvg(node: any, options: any): Promise<string>;
17
+ /**
18
+ * @param {Node} node - The DOM Node object to render
19
+ * @param {Object} options - Rendering options, @see {@link toSvg}
20
+ * @return {Promise} - A promise that is fulfilled with a PNG image data URL
21
+ * */
22
+ declare function toPng(node: Node, options: Object): Promise<any>;
23
+ /**
24
+ * @param {Node} node - The DOM Node object to render
25
+ * @param {Object} options - Rendering options, @see {@link toSvg}
26
+ * @return {Promise} - A promise that is fulfilled with a JPEG image data URL
27
+ * */
28
+ declare function toJpeg(node: Node, options: Object): Promise<any>;
29
+ /**
30
+ * @param {Node} node - The DOM Node object to render
31
+ * @param {Object} options - Rendering options, @see {@link toSvg}
32
+ * @return {Promise} - A promise that is fulfilled with a PNG image blob
33
+ * */
34
+ declare function toBlob(node: Node, options: Object): Promise<any>;
35
+ /**
36
+ * @param {Node} node - The DOM Node object to render
37
+ * @param {Object} options - Rendering options, @see {@link toSvg}
38
+ * @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
39
+ * */
40
+ declare function toPixelData(node: Node, options: Object): Promise<any>;
41
+ declare namespace fontFaces {
42
+ export { resolveAll };
43
+ export namespace impl_1 {
44
+ export { readAll };
45
+ }
46
+ export { impl_1 as impl };
47
+ }
48
+ declare namespace images {
49
+ export { inlineAll };
50
+ export namespace impl_2 {
51
+ export { newImage };
52
+ }
53
+ export { impl_2 as impl };
54
+ }
55
+ declare namespace util {
56
+ export { escape };
57
+ export { parseExtension };
58
+ export { mimeType };
59
+ export { dataAsUrl };
60
+ export { isDataUrl };
61
+ export { canvasToBlob };
62
+ export { resolveUrl };
63
+ export { getAndEncode };
64
+ export function uid(): string;
65
+ export { delay };
66
+ export { asArray };
67
+ export { escapeXhtml };
68
+ export { makeImage };
69
+ export { width };
70
+ export { height };
71
+ export { domIsBody };
72
+ export { getScrollTop };
73
+ export { getScrollLeft };
74
+ export { compressionBase64 };
75
+ export { splitImg };
76
+ }
77
+ declare namespace inliner {
78
+ export { inlineAll };
79
+ export { shouldProcess };
80
+ export namespace impl_3 {
81
+ export { readUrls };
82
+ export { inline };
83
+ }
84
+ export { impl_3 as impl };
85
+ }
86
+ declare function resolveAll(): Promise<string>;
87
+ declare function readAll(): Promise<any>;
88
+ declare function inlineAll(node: any, options: any): any;
89
+ declare function newImage(element: any): {
90
+ inline: (get: any, options: any) => Promise<any>;
91
+ };
92
+ declare function parseExtension(url: any): string;
93
+ declare function mimeType(url: any): any;
94
+ declare function dataAsUrl(content: any, type: any): string;
95
+ declare function isDataUrl(url: any): boolean;
96
+ declare function canvasToBlob(canvas: any): Promise<any>;
97
+ declare function resolveUrl(url: any, baseUrl: any): string;
98
+ declare function getAndEncode(url: any): Promise<any>;
99
+ declare function delay(ms: any): (arg: any) => Promise<any>;
100
+ declare function asArray(arrayLike: any): any[];
101
+ declare function escapeXhtml(string: any): any;
102
+ declare function makeImage(uri: any): Promise<any>;
103
+ declare function width(node: any): any;
104
+ declare function height(node: any): any;
105
+ declare function domIsBody(node: any): boolean;
106
+ declare function getScrollTop(): number;
107
+ declare function getScrollLeft(): number;
108
+ declare function compressionBase64(target: any, status: any): Promise<any>;
109
+ declare function splitImg(clone: any, parent: any, original: any): Promise<any>;
110
+ declare function inlineAll_1(string: any, baseUrl: any, get: any): Promise<any>;
111
+ declare function shouldProcess(string: any): boolean;
112
+ declare function readUrls(string: any): string[];
113
+ declare function inline(string: any, url: any, baseUrl: any, get: any): Promise<any>;
@@ -39,20 +39,20 @@ var domtoimage$1 = domtoimage;
39
39
  // else
40
40
  // global.domtoimage = domtoimage;
41
41
 
42
- /**
43
- * @param {Node} node - The DOM Node object to render
44
- * @param {Object} options - Rendering options
45
- * @param {Function} options.filter - Should return true if passed node should be included in the output
46
- * (excluding node means excluding it's children as well). Not called on the root node.
47
- * @param {String} options.bgcolor - color for the background, any valid CSS color value.
48
- * @param {Number} options.width - width to be applied to node before rendering.
49
- * @param {Number} options.height - height to be applied to node before rendering.
50
- * @param {Object} options.style - an object whose properties to be copied to node's style before rendering.
51
- * @param {Number} options.quality - a Number between 0 and 1 indicating image quality (applicable to JPEG only),
52
- defaults to 1.0.
53
- * @param {String} options.imagePlaceholder - dataURL to use as a placeholder for failed images, default behaviour is to fail fast on images we can't fetch
54
- * @param {Boolean} options.cacheBust - set to true to cache bust by appending the time to the request url
55
- * @return {Promise} - A promise that is fulfilled with a SVG image data URL
42
+ /**
43
+ * @param {Node} node - The DOM Node object to render
44
+ * @param {Object} options - Rendering options
45
+ * @param {Function} options.filter - Should return true if passed node should be included in the output
46
+ * (excluding node means excluding it's children as well). Not called on the root node.
47
+ * @param {String} options.bgcolor - color for the background, any valid CSS color value.
48
+ * @param {Number} options.width - width to be applied to node before rendering.
49
+ * @param {Number} options.height - height to be applied to node before rendering.
50
+ * @param {Object} options.style - an object whose properties to be copied to node's style before rendering.
51
+ * @param {Number} options.quality - a Number between 0 and 1 indicating image quality (applicable to JPEG only),
52
+ defaults to 1.0.
53
+ * @param {String} options.imagePlaceholder - dataURL to use as a placeholder for failed images, default behaviour is to fail fast on images we can't fetch
54
+ * @param {Boolean} options.cacheBust - set to true to cache bust by appending the time to the request url
55
+ * @return {Promise} - A promise that is fulfilled with a SVG image data URL
56
56
  * */
57
57
 
58
58
  var globalOptions = {};
@@ -198,10 +198,10 @@ function toSvg(node, options) {
198
198
  }
199
199
  }
200
200
 
201
- /**
202
- * @param {Node} node - The DOM Node object to render
203
- * @param {Object} options - Rendering options, @see {@link toSvg}
204
- * @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
201
+ /**
202
+ * @param {Node} node - The DOM Node object to render
203
+ * @param {Object} options - Rendering options, @see {@link toSvg}
204
+ * @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
205
205
  * */
206
206
  function toPixelData(node, options) {
207
207
  return draw(node, options || {}).then(function (canvas) {
@@ -209,10 +209,10 @@ function toPixelData(node, options) {
209
209
  });
210
210
  }
211
211
 
212
- /**
213
- * @param {Node} node - The DOM Node object to render
214
- * @param {Object} options - Rendering options, @see {@link toSvg}
215
- * @return {Promise} - A promise that is fulfilled with a PNG image data URL
212
+ /**
213
+ * @param {Node} node - The DOM Node object to render
214
+ * @param {Object} options - Rendering options, @see {@link toSvg}
215
+ * @return {Promise} - A promise that is fulfilled with a PNG image data URL
216
216
  * */
217
217
  function toPng(node, options) {
218
218
  return draw(node, options || {}).then(function (canvas) {
@@ -220,10 +220,10 @@ function toPng(node, options) {
220
220
  });
221
221
  }
222
222
 
223
- /**
224
- * @param {Node} node - The DOM Node object to render
225
- * @param {Object} options - Rendering options, @see {@link toSvg}
226
- * @return {Promise} - A promise that is fulfilled with a JPEG image data URL
223
+ /**
224
+ * @param {Node} node - The DOM Node object to render
225
+ * @param {Object} options - Rendering options, @see {@link toSvg}
226
+ * @return {Promise} - A promise that is fulfilled with a JPEG image data URL
227
227
  * */
228
228
  function toJpeg(node, options) {
229
229
  options = options || {};
@@ -232,10 +232,10 @@ function toJpeg(node, options) {
232
232
  });
233
233
  }
234
234
 
235
- /**
236
- * @param {Node} node - The DOM Node object to render
237
- * @param {Object} options - Rendering options, @see {@link toSvg}
238
- * @return {Promise} - A promise that is fulfilled with a PNG image blob
235
+ /**
236
+ * @param {Node} node - The DOM Node object to render
237
+ * @param {Object} options - Rendering options, @see {@link toSvg}
238
+ * @return {Promise} - A promise that is fulfilled with a PNG image blob
239
239
  * */
240
240
  function toBlob(node, options) {
241
241
  return draw(node, options || {}).then(util.canvasToBlob);
@@ -674,9 +674,9 @@ function newUtil() {
674
674
  splitImg: splitImg
675
675
  };
676
676
  function mimes() {
677
- /*
678
- * Only WOFF and EOT mime types for fonts are 'real'
679
- * see http://www.iana.org/assignments/media-types/media-types.xhtml
677
+ /*
678
+ * Only WOFF and EOT mime types for fonts are 'real'
679
+ * see http://www.iana.org/assignments/media-types/media-types.xhtml
680
680
  */
681
681
  var WOFF = 'application/font-woff';
682
682
  var JPEG = 'image/jpeg';
@@ -1,2 +1,2 @@
1
- export default function _default(node: any, options: any): Promise<any>;
2
- export function renderInDocument(canvas: any, screenType: any, defaultDevice: any): void;
1
+ export default function _default(node: any, options: any): Promise<any>;
2
+ export function renderInDocument(canvas: any, screenType: any, defaultDevice: any): void;
package/es/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { default as html2image } from "./html2image";
2
- export { default as Address } from "./location";
3
- export { default as SwiftSwiper } from "./SwiftSwiper/index";
1
+ export { default as html2image } from "./html2image";
2
+ export { default as Address } from "./location";
3
+ export { default as SwiftSwiper } from "./SwiftSwiper/index";
@@ -1,2 +1,2 @@
1
- declare const _default: string;
2
- export default _default;
1
+ declare const _default: string;
2
+ export default _default;
@@ -1,8 +1,8 @@
1
- declare const _default: {
2
- background: any;
3
- show(): false | undefined;
4
- $loading: HTMLDivElement | undefined;
5
- hide(): false | undefined;
6
- appendStyle(): false | undefined;
7
- };
8
- export default _default;
1
+ declare const _default: {
2
+ background: any;
3
+ show(): false | undefined;
4
+ $loading: HTMLDivElement | undefined;
5
+ hide(): false | undefined;
6
+ appendStyle(): false | undefined;
7
+ };
8
+ export default _default;
@@ -1,9 +1,9 @@
1
- export default Address;
2
- declare namespace Address {
3
- const path: string;
4
- const ajaxPath: string;
5
- const wxAjaxPath: string;
6
- function url(path: any): string;
7
- function ajaxUrl(path: any): string;
8
- function wxAjaxUrl(path: any): string;
9
- }
1
+ export default Address;
2
+ declare namespace Address {
3
+ const path: string;
4
+ const ajaxPath: string;
5
+ const wxAjaxPath: string;
6
+ function url(path: any): string;
7
+ function ajaxUrl(path: any): string;
8
+ function wxAjaxUrl(path: any): string;
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deppon/deppon-tools",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "main": "es/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "es/index.d.ts",