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.
Files changed (53) hide show
  1. package/es/component.d.ts +3 -0
  2. package/es/component.mjs +9 -0
  3. package/{dist/es/packages → es}/components/button/HtButton.vue.d.ts +0 -7
  4. package/es/components/button/HtButton.vue.mjs +16 -0
  5. package/{dist/es/packages → es}/components/button/HtButton.vue2.mjs +6 -11
  6. package/{dist/es/packages → es}/components/button/index.d.ts +3 -9
  7. package/{dist/es/packages → es}/components/button/index.mjs +2 -2
  8. package/es/components/button/instance.d.ts +2 -0
  9. package/es/components/button/instance.mjs +1 -0
  10. package/es/components/index.d.ts +1 -0
  11. package/es/components/index.mjs +2 -0
  12. package/es/components/table/HtTable.d.ts +142 -0
  13. package/es/components/table/HtTable.mjs +136 -0
  14. package/es/components/table/HtTable.vue.d.ts +1847 -0
  15. package/es/components/table/HtTable.vue.mjs +443 -0
  16. package/es/components/table/HtTable.vue2.mjs +128 -0
  17. package/es/components/table/index.d.ts +1845 -0
  18. package/{dist/es/packages → es}/components/table/index.mjs +2 -1
  19. package/es/constants/index.d.ts +1 -0
  20. package/es/constants/index.mjs +1 -0
  21. package/es/constants/key.d.ts +1 -0
  22. package/es/constants/key.mjs +3 -0
  23. package/es/defaults.d.ts +4 -0
  24. package/es/defaults.mjs +7 -0
  25. package/es/index.d.ts +5 -0
  26. package/es/index.mjs +8 -0
  27. package/es/make-installer.d.ts +4 -0
  28. package/es/make-installer.mjs +14 -0
  29. package/es/plugin.d.ts +2 -0
  30. package/es/plugin.mjs +3 -0
  31. package/{dist/es/packages → es}/utils/common.d.ts +1 -1
  32. package/es/utils/index.d.ts +3 -0
  33. package/es/utils/index.mjs +3 -0
  34. package/es/utils/table.d.ts +2 -0
  35. package/es/utils/table.mjs +31 -0
  36. package/es/utils/tool.d.ts +2 -0
  37. package/es/utils/tool.mjs +42 -0
  38. package/global.d.ts +15 -0
  39. package/package.json +5 -10
  40. package/README.en.md +0 -36
  41. package/README.md +0 -4
  42. 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
  43. package/dist/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +0 -28
  44. package/dist/es/packages/components/button/HtButton.vue.mjs +0 -6
  45. package/dist/es/packages/components/index.d.ts +0 -6
  46. package/dist/es/packages/components/index.mjs +0 -12
  47. package/dist/es/packages/components/table/HtTable.vue.d.ts +0 -280
  48. package/dist/es/packages/components/table/HtTable.vue.mjs +0 -6
  49. package/dist/es/packages/components/table/HtTable.vue2.mjs +0 -110
  50. package/dist/es/packages/components/table/index.d.ts +0 -278
  51. package/dist/es/packages/utils/index.d.ts +0 -1
  52. /package/{dist/es → es}/_virtual/_plugin-vue_export-helper.mjs +0 -0
  53. /package/{dist/es/packages → es}/utils/common.mjs +0 -0
@@ -1,6 +1,7 @@
1
1
  import Table from './HtTable.vue.mjs';
2
2
  import { withInstall } from '../../utils/common.mjs';
3
+ export { tableProps } from './HtTable.mjs';
3
4
 
4
5
  const HtTable = withInstall(Table);
5
6
 
6
- export { HtTable as default };
7
+ export { HtTable, HtTable as default };
@@ -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;
@@ -0,0 +1,3 @@
1
+ const INSTALLED_KEY = Symbol("INSTALLED_KEY");
2
+
3
+ export { INSTALLED_KEY };
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ install: (app: import("vue").App<any>) => void;
3
+ };
4
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { makeInstaller } from './make-installer.mjs';
2
+ import Components from './component.mjs';
3
+ import Plugins from './plugin.mjs';
4
+
5
+ var installer = makeInstaller([...Components, ...Plugins]);
6
+
7
+ export { installer as default };
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,4 @@
1
+ import type { App, Plugin } from 'vue';
2
+ export declare const makeInstaller: (components?: Plugin[]) => {
3
+ install: (app: App) => void;
4
+ };
@@ -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
@@ -0,0 +1,2 @@
1
+ declare const _default: never[];
2
+ export default _default;
package/es/plugin.mjs ADDED
@@ -0,0 +1,3 @@
1
+ var Plugins = [];
2
+
3
+ export { Plugins as default };
@@ -1,3 +1,3 @@
1
- import type { Plugin } from 'vue';
1
+ import type { Plugin } from "vue";
2
2
  export type SFCWithInstall<T> = T & Plugin;
3
3
  export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E;
@@ -0,0 +1,3 @@
1
+ export * from './common';
2
+ export * from './table';
3
+ export * from './tool';
@@ -0,0 +1,3 @@
1
+ export { withInstall } from './common.mjs';
2
+ export { handleData, handleText } from './table.mjs';
3
+ export { dataHandle, splitK } from './tool.mjs';
@@ -0,0 +1,2 @@
1
+ export declare const handleData: (value: any, type: string) => string | number;
2
+ export declare const handleText: (value: any, type: string) => any;
@@ -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,2 @@
1
+ export declare function dataHandle(val: any, isPer: boolean, floatNum: number): any;
2
+ export declare function splitK(num: string | number): string;
@@ -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.4",
3
+ "version": "0.0.6",
4
4
  "description": "",
5
- "main": "dist/es/packages/components/index.mjs",
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.4.21"
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
@@ -1,4 +0,0 @@
1
- # ht
2
-
3
- #### 介绍
4
- 好投科技组件库