@bestime/utils_browser 1.0.1
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/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
### 不同git项目,使用不同用户名和邮箱
|
|
2
|
+
|
|
3
|
+
修改配置文件 ~/.gitconfig
|
|
4
|
+
|
|
5
|
+
```cmd
|
|
6
|
+
[core]
|
|
7
|
+
autocrlf = false
|
|
8
|
+
[includeIf "gitdir:D:/bestime/git/"]
|
|
9
|
+
path = D:/bestime/config/.gitconfig
|
|
10
|
+
[includeIf "gitdir:D:/work-qssoft/git/qs-t/"]
|
|
11
|
+
path = D:/bestime/config/qssoft.gitconfig
|
|
12
|
+
[includeIf "gitdir:D:/work-qssoft/git/rdc-cq/"]
|
|
13
|
+
path = D:/bestime/config/sitian.gitconfig
|
|
14
|
+
|
|
15
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取浏览器窗口尺寸
|
|
3
|
+
*/
|
|
4
|
+
declare function getWindowSize(): {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 给dom元素添加className
|
|
11
|
+
* @param el - DOM
|
|
12
|
+
* @param name - 需要添加的className
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
declare function addClass(el: HTMLElement, name: string | string[]): void;
|
|
16
|
+
|
|
17
|
+
export { addClass, getWindowSize };
|
|
18
|
+
|
|
19
|
+
export default undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 浏览器工具库 => jUtilsBrowser
|
|
3
|
+
* @QQ 1174295440
|
|
4
|
+
* @author Bestime
|
|
5
|
+
* @see https://github.com/bestime/tool
|
|
6
|
+
* @update 2023-11-05 11:41:51
|
|
7
|
+
*/
|
|
8
|
+
import{isArray,forEach}from"@bestime/utils_base";function getWindowSize(){return{width:document.documentElement.clientWidth||document.body.clientWidth||window.innerWidth||0,height:document.documentElement.clientHeight||document.body.clientHeight||window.innerHeight||0}}function addClass(i,t){isArray(t)?forEach(t,function(t){i.classList.add(t)}):i.classList.add(t)}export{addClass,getWindowSize};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取浏览器窗口尺寸
|
|
3
|
+
*/
|
|
4
|
+
declare function getWindowSize(): {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 给dom元素添加className
|
|
11
|
+
* @param el - DOM
|
|
12
|
+
* @param name - 需要添加的className
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
declare function addClass(el: HTMLElement, name: string | string[]): void;
|
|
16
|
+
|
|
17
|
+
declare global {
|
|
18
|
+
/**
|
|
19
|
+
* 该声明文件用于全局声明(不用npm安装时拷贝到项目中直接使用)
|
|
20
|
+
*/
|
|
21
|
+
namespace jUtilsBrowser {
|
|
22
|
+
export { addClass, getWindowSize };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 浏览器工具库 => jUtilsBrowser
|
|
3
|
+
* @QQ 1174295440
|
|
4
|
+
* @author Bestime
|
|
5
|
+
* @see https://github.com/bestime/tool
|
|
6
|
+
* @update 2023-11-05 11:41:51
|
|
7
|
+
*/
|
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@bestime/utils_base")):"function"==typeof define&&define.amd?define(["exports","@bestime/utils_base"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jUtilsBrowser={},e.jUtilsBase)}(this,function(e,i){"use strict";e.addClass=function(t,e){i.isArray(e)?i.forEach(e,function(e){t.classList.add(e)}):t.classList.add(e)},e.getWindowSize=function(){return{width:document.documentElement.clientWidth||document.body.clientWidth||window.innerWidth||0,height:document.documentElement.clientHeight||document.body.clientHeight||window.innerHeight||0}}});
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bestime/utils_browser",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"main": "./dist/jUtilsBrowser.esm.min.mjs",
|
|
5
|
+
"module": "./dist/jUtilsBrowser.esm.min.mjs",
|
|
6
|
+
"types": "./dist/jUtilsBrowser.esm.d.ts",
|
|
7
|
+
"description": "个人常用工具库,浏览器使用",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "rollup --config rollup.config.prod.js",
|
|
14
|
+
"serve": "rollup --config rollup.config.dev.js --watch"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@babel/core": "7.18.6",
|
|
18
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
19
|
+
"@babel/plugin-proposal-class-static-block": "^7.20.7",
|
|
20
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
21
|
+
"@babel/plugin-proposal-optional-chaining": "^7.20.7",
|
|
22
|
+
"@babel/plugin-transform-arrow-functions": "^7.18.6",
|
|
23
|
+
"@babel/plugin-transform-async-to-generator": "^7.18.6",
|
|
24
|
+
"@babel/plugin-transform-block-scoping": "7.18.6",
|
|
25
|
+
"@babel/plugin-transform-classes": "^7.20.2",
|
|
26
|
+
"@babel/plugin-transform-parameters": "^7.18.8",
|
|
27
|
+
"@babel/plugin-transform-shorthand-properties": "7.18.6",
|
|
28
|
+
"@babel/plugin-transform-spread": "^7.18.9",
|
|
29
|
+
"@babel/plugin-transform-template-literals": "7.18.6",
|
|
30
|
+
"@rollup/plugin-babel": "6.0.3",
|
|
31
|
+
"@rollup/plugin-commonjs": "24.0.0",
|
|
32
|
+
"@rollup/plugin-json": "^6.0.1",
|
|
33
|
+
"@rollup/plugin-node-resolve": "15.0.1",
|
|
34
|
+
"prettier": "^2.8.8",
|
|
35
|
+
"rollup": "^3.21.4",
|
|
36
|
+
"rollup-plugin-dts": "^5.3.0",
|
|
37
|
+
"rollup-plugin-livereload": "2.0.5",
|
|
38
|
+
"rollup-plugin-typescript2": "0.34.1",
|
|
39
|
+
"rollup-plugin-uglify": "6.0.4",
|
|
40
|
+
"typescript": "^5.0.4"
|
|
41
|
+
},
|
|
42
|
+
"author": "bestime1020@gmail.com",
|
|
43
|
+
"license": "ISC",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/bestime/tool.git"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/bestime/tool",
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@bestime/utils_base": "^1.0.1"
|
|
54
|
+
}
|
|
55
|
+
}
|