hfn-components 0.0.4 → 0.0.6
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/es/component.d.ts +3 -0
- package/es/component.mjs +9 -0
- package/{dist/es/packages → es}/components/button/HtButton.vue.d.ts +0 -7
- package/es/components/button/HtButton.vue.mjs +16 -0
- package/{dist/es/packages → es}/components/button/HtButton.vue2.mjs +6 -11
- package/{dist/es/packages → es}/components/button/index.d.ts +3 -9
- package/{dist/es/packages → es}/components/button/index.mjs +2 -2
- package/es/components/button/instance.d.ts +2 -0
- package/es/components/button/instance.mjs +1 -0
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +2 -0
- package/es/components/table/HtTable.d.ts +142 -0
- package/es/components/table/HtTable.mjs +136 -0
- package/es/components/table/HtTable.vue.d.ts +1847 -0
- package/es/components/table/HtTable.vue.mjs +443 -0
- package/es/components/table/HtTable.vue2.mjs +128 -0
- package/es/components/table/index.d.ts +1845 -0
- package/{dist/es/packages → es}/components/table/index.mjs +2 -1
- package/es/constants/index.d.ts +1 -0
- package/es/constants/index.mjs +1 -0
- package/es/constants/key.d.ts +1 -0
- package/es/constants/key.mjs +3 -0
- package/es/defaults.d.ts +4 -0
- package/es/defaults.mjs +7 -0
- package/es/index.d.ts +5 -0
- package/es/index.mjs +8 -0
- package/es/make-installer.d.ts +4 -0
- package/es/make-installer.mjs +14 -0
- package/es/plugin.d.ts +2 -0
- package/es/plugin.mjs +3 -0
- package/{dist/es/packages → es}/utils/common.d.ts +1 -1
- package/es/utils/index.d.ts +3 -0
- package/es/utils/index.mjs +3 -0
- package/es/utils/table.d.ts +2 -0
- package/es/utils/table.mjs +31 -0
- package/es/utils/tool.d.ts +2 -0
- package/es/utils/tool.mjs +42 -0
- package/global.d.ts +15 -0
- package/package.json +5 -10
- package/README.en.md +0 -36
- package/README.md +0 -4
- package/dist/es/node_modules/.pnpm/ant-design-vue@3.2.20_vue@3.4.21_typescript@5.3.3_/node_modules/ant-design-vue/dist/antd.css.mjs +0 -6
- package/dist/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +0 -28
- package/dist/es/packages/components/button/HtButton.vue.mjs +0 -6
- package/dist/es/packages/components/index.d.ts +0 -6
- package/dist/es/packages/components/index.mjs +0 -12
- package/dist/es/packages/components/table/HtTable.vue.d.ts +0 -280
- package/dist/es/packages/components/table/HtTable.vue.mjs +0 -6
- package/dist/es/packages/components/table/HtTable.vue2.mjs +0 -110
- package/dist/es/packages/components/table/index.d.ts +0 -278
- package/dist/es/packages/utils/index.d.ts +0 -1
- /package/{dist/es → es}/_virtual/_plugin-vue_export-helper.mjs +0 -0
- /package/{dist/es/packages → es}/utils/common.mjs +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './key';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { INSTALLED_KEY } from './key.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INSTALLED_KEY: unique symbol;
|
package/es/defaults.d.ts
ADDED
package/es/defaults.mjs
ADDED
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import installer from './defaults';
|
|
2
|
+
export * from './make-installer';
|
|
3
|
+
export * from '/Users/libiluo/Desktop/company/component-library/dist/hfn-components/es/components';
|
|
4
|
+
export declare const install: (app: import("vue").App<any>) => void;
|
|
5
|
+
export default installer;
|
package/es/index.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import installer from './defaults.mjs';
|
|
2
|
+
export { makeInstaller } from './make-installer.mjs';
|
|
3
|
+
export { HtTable } from './components/table/index.mjs';
|
|
4
|
+
export { tableProps } from './components/table/HtTable.mjs';
|
|
5
|
+
|
|
6
|
+
const install = installer.install;
|
|
7
|
+
|
|
8
|
+
export { installer as default, install };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { INSTALLED_KEY } from './constants/key.mjs';
|
|
2
|
+
|
|
3
|
+
const makeInstaller = (components = []) => {
|
|
4
|
+
const install = (app) => {
|
|
5
|
+
if (app[INSTALLED_KEY]) return;
|
|
6
|
+
app[INSTALLED_KEY] = true;
|
|
7
|
+
components.forEach((c) => app.use(c));
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
install
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { makeInstaller };
|
package/es/plugin.d.ts
ADDED
package/es/plugin.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { splitK } from './tool.mjs';
|
|
2
|
+
|
|
3
|
+
const handleData = (value, type) => {
|
|
4
|
+
if (isNaN(parseFloat(value))) return "-";
|
|
5
|
+
let val = parseFloat(value);
|
|
6
|
+
if (type.includes("percent")) {
|
|
7
|
+
val = val * 100;
|
|
8
|
+
}
|
|
9
|
+
const floatMatch = type.match(/float(\d+)/);
|
|
10
|
+
if (floatMatch) {
|
|
11
|
+
const precision = Number(floatMatch[1]);
|
|
12
|
+
val = val.toFixed(precision);
|
|
13
|
+
}
|
|
14
|
+
if (type.includes("splitK")) {
|
|
15
|
+
val = splitK(val);
|
|
16
|
+
}
|
|
17
|
+
if (type.includes("sign")) {
|
|
18
|
+
val = Number(val) > 0 ? "+" + val : val;
|
|
19
|
+
}
|
|
20
|
+
if (type.includes("percent")) {
|
|
21
|
+
val = val + "%";
|
|
22
|
+
}
|
|
23
|
+
return val;
|
|
24
|
+
};
|
|
25
|
+
const handleText = (value, type) => {
|
|
26
|
+
if (type === "name") {
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { handleData, handleText };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function dataHandle(val, isPer, floatNum) {
|
|
2
|
+
val = parseFloat(val);
|
|
3
|
+
if (isNaN(val)) {
|
|
4
|
+
return "-";
|
|
5
|
+
} else {
|
|
6
|
+
if (isPer) {
|
|
7
|
+
val = val * 100;
|
|
8
|
+
}
|
|
9
|
+
if (Number(val.toFixed(floatNum)) === 0) {
|
|
10
|
+
const a = 0;
|
|
11
|
+
return a.toFixed(floatNum);
|
|
12
|
+
} else {
|
|
13
|
+
return val.toFixed(floatNum);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function splitK(num) {
|
|
18
|
+
let decimal = String(num).split(".")[1] || "";
|
|
19
|
+
if (decimal === "") {
|
|
20
|
+
decimal = "00";
|
|
21
|
+
}
|
|
22
|
+
const tempArr = [];
|
|
23
|
+
const revNumArr = String(num).split(".")[0].split("").reverse();
|
|
24
|
+
const mark = revNumArr[revNumArr.length - 1];
|
|
25
|
+
if (mark === "-") {
|
|
26
|
+
revNumArr.splice(-1, 1);
|
|
27
|
+
}
|
|
28
|
+
for (const i in revNumArr) {
|
|
29
|
+
tempArr.push(revNumArr[i]);
|
|
30
|
+
let index = parseFloat(i);
|
|
31
|
+
if ((index + 1) % 3 === 0 && Number(i) !== revNumArr.length - 1) {
|
|
32
|
+
tempArr.push(",");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (mark === "-") {
|
|
36
|
+
tempArr.push(mark);
|
|
37
|
+
}
|
|
38
|
+
const zs = tempArr.reverse().join("");
|
|
39
|
+
return decimal ? zs + "." + decimal : zs;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { dataHandle, splitK };
|
package/global.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// declare module '*.vue' {
|
|
2
|
+
// import { defineComponent } from 'vue'
|
|
3
|
+
// const componentOptions:ReturnType<typeof defineComponent>
|
|
4
|
+
// export default componentOptions
|
|
5
|
+
// }
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
declare module '@vue/runtime-core' {
|
|
9
|
+
export interface GlobalComponents {
|
|
10
|
+
HtTable: typeof import('hfn-components')['HtTable']
|
|
11
|
+
}
|
|
12
|
+
interface ComponentCustomProperties {
|
|
13
|
+
// 你可以在这里添加自定义属性
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hfn-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "index.ts",
|
|
6
|
+
"module": "es/index.mjs",
|
|
7
|
+
"types": "es/index.d.ts",
|
|
6
8
|
"scripts": {
|
|
7
9
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
10
|
},
|
|
9
|
-
"files": [
|
|
10
|
-
"dist/"
|
|
11
|
-
],
|
|
12
11
|
"keywords": [],
|
|
13
12
|
"author": "",
|
|
14
13
|
"license": "ISC",
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"ant-design-vue": "3.2.20",
|
|
17
|
-
"typescript": "^5.3.3"
|
|
18
|
-
},
|
|
19
14
|
"peerDependencies": {
|
|
20
|
-
"vue": "3.
|
|
15
|
+
"vue": "^3.2.0"
|
|
21
16
|
}
|
|
22
17
|
}
|
package/README.en.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# ht
|
|
2
|
-
|
|
3
|
-
#### Description
|
|
4
|
-
ht-test
|
|
5
|
-
|
|
6
|
-
#### Software Architecture
|
|
7
|
-
Software architecture description
|
|
8
|
-
|
|
9
|
-
#### Installation
|
|
10
|
-
|
|
11
|
-
1. xxxx
|
|
12
|
-
2. xxxx
|
|
13
|
-
3. xxxx
|
|
14
|
-
|
|
15
|
-
#### Instructions
|
|
16
|
-
|
|
17
|
-
1. xxxx
|
|
18
|
-
2. xxxx
|
|
19
|
-
3. xxxx
|
|
20
|
-
|
|
21
|
-
#### Contribution
|
|
22
|
-
|
|
23
|
-
1. Fork the repository
|
|
24
|
-
2. Create Feat_xxx branch
|
|
25
|
-
3. Commit your code
|
|
26
|
-
4. Create Pull Request
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#### Gitee Feature
|
|
30
|
-
|
|
31
|
-
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
|
32
|
-
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
|
33
|
-
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
|
34
|
-
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
|
35
|
-
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
|
36
|
-
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
package/README.md
DELETED