@hbdlzy/ui 0.1.8 → 0.1.9

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/AI-USAGE.md CHANGED
@@ -46,12 +46,22 @@ node_modules/@hbdlzy/ui/AI-USAGE.md
46
46
  - `echarts`
47
47
  - `exportExcel`
48
48
  - `companyTokens`
49
- - 全局按钮 ripple 已随 `@hbdlzy/ui` 入口自动启用,局部关闭可添加 `data-hbdl-ripple="false"`
49
+ - `Ripple`
50
+ - 全局点击涟漪已随 `@hbdlzy/ui` 入口自动启用,局部关闭可添加 `data-hbdl-ripple="false"`
50
51
  - 只有当现有组件无法满足需求时,才考虑新增公共组件
51
52
 
52
53
  ## 导入约定
53
54
 
54
- 优先统一从 `@hbdlzy/ui` 导入:
55
+ 应用入口优先全局安装:
56
+
57
+ ```ts
58
+ import HbdlUI from '@hbdlzy/ui'
59
+ import '@hbdlzy/ui/style.css'
60
+
61
+ createApp(App).use(HbdlUI).mount('#app')
62
+ ```
63
+
64
+ 页面里需要类型、工具或局部注册时,优先统一从 `@hbdlzy/ui` 导入:
55
65
 
56
66
  ```ts
57
67
  import {
@@ -67,6 +77,7 @@ import {
67
77
  OutlinedTimePicker,
68
78
  OutlinedCascader,
69
79
  OutlinedTreeSelect,
80
+ Ripple,
70
81
  installRipple,
71
82
  uninstallRipple,
72
83
  companyTokens,
@@ -74,6 +85,12 @@ import {
74
85
  } from '@hbdlzy/ui'
75
86
  ```
76
87
 
88
+ 只接入点击涟漪时,也可以使用细粒度入口:
89
+
90
+ ```ts
91
+ import { Ripple, installRipple, uninstallRipple } from '@hbdlzy/ui/ripple'
92
+ ```
93
+
77
94
  ## 复用规则
78
95
 
79
96
  - 不要在页面里重复写通用表格的分页、远程请求承接、排序参数映射和勾选暴露逻辑,优先使用 `BaseTable`
@@ -90,6 +107,7 @@ import {
90
107
  - 不要在页面里重复写树形下拉选择的字段映射、浮动标签和清空逻辑,优先使用 `OutlinedTreeSelect`
91
108
  - 需要渐变色、图形工具时,优先使用统一导出的 `echarts`
92
109
  - 需要主题变量时,优先使用 `companyTokens`
110
+ - 需要全局点击反馈时,优先使用已内置的 `Ripple` / `installRipple`,不要重复写 `v-ripple` 指令或按钮动画 DOM
93
111
 
94
112
  ## 维护组件库时
95
113
 
package/README.md CHANGED
@@ -16,6 +16,29 @@ npm install @hbdlzy/ui
16
16
 
17
17
  ## 使用方式
18
18
 
19
+ ### 全局注册所有组件
20
+
21
+ 业务项目入口推荐这样接入,之后页面里可以直接写 `<BaseTable />`、`<BaseCard />`、`<OutlinedInput />` 等组件:
22
+
23
+ ```ts
24
+ import { createApp } from 'vue'
25
+ import ElementPlus from 'element-plus'
26
+ import zhCn from 'element-plus/es/locale/lang/zh-cn'
27
+ import 'element-plus/dist/index.css'
28
+ import '@hbdlzy/ui/style.css'
29
+ import HbdlUI from '@hbdlzy/ui'
30
+ import App from './App.vue'
31
+
32
+ createApp(App)
33
+ .use(ElementPlus, { locale: zhCn })
34
+ .use(HbdlUI)
35
+ .mount('#app')
36
+ ```
37
+
38
+ ### 按需导入
39
+
40
+ 页面或组合式函数里需要类型、工具或局部注册时,可以继续从统一入口导入:
41
+
19
42
  ```ts
20
43
  import '@hbdlzy/ui/style.css'
21
44
 
@@ -32,6 +55,7 @@ import {
32
55
  OutlinedTimePicker,
33
56
  OutlinedCascader,
34
57
  OutlinedTreeSelect,
58
+ Ripple,
35
59
  installRipple,
36
60
  uninstallRipple,
37
61
  companyTokens,
@@ -39,7 +63,25 @@ import {
39
63
  } from '@hbdlzy/ui'
40
64
  ```
41
65
 
42
- 导入 `@hbdlzy/ui` 后会自动为项目里的按钮启用 ripple 效果,覆盖原生 `button`、Element Plus `el-button` 以及 radio/checkbox button 形态。局部不需要时,可在按钮或父级元素上添加 `data-hbdl-ripple="false"`。
66
+ 导入 `@hbdlzy/ui` 后会自动为项目里的按钮启用点击涟漪效果,覆盖原生 `button`、Element Plus `el-button` 以及 radio/checkbox button 形态。局部不需要时,可在按钮或父级元素上添加 `data-hbdl-ripple="false"`。
67
+
68
+ ## 全局点击涟漪
69
+
70
+ 推荐业务项目在入口统一导入:
71
+
72
+ ```ts
73
+ import '@hbdlzy/ui'
74
+ ```
75
+
76
+ 需要显式控制安装时机时,也可以按 Vue 插件使用:
77
+
78
+ ```ts
79
+ import { createApp } from 'vue'
80
+ import { Ripple } from '@hbdlzy/ui/ripple'
81
+ import App from './App.vue'
82
+
83
+ createApp(App).use(Ripple).mount('#app')
84
+ ```
43
85
 
44
86
  ## 当前聚合内容
45
87
 
@@ -64,6 +106,7 @@ import {
64
106
  - `echarts`
65
107
  - `exportExcel`
66
108
  - `companyTokens`
109
+ - `Ripple`
67
110
  - `installRipple`
68
111
  - `uninstallRipple`
69
112
 
@@ -84,6 +127,7 @@ import {
84
127
  - `OutlinedTimePicker` 文档:[../ui-core/src/components/OutlinedTimePicker/README.md](../ui-core/src/components/OutlinedTimePicker/README.md)
85
128
  - `OutlinedCascader` 文档:[../ui-core/src/components/OutlinedCascader/README.md](../ui-core/src/components/OutlinedCascader/README.md)
86
129
  - `OutlinedTreeSelect` 文档:[../ui-core/src/components/OutlinedTreeSelect/README.md](../ui-core/src/components/OutlinedTreeSelect/README.md)
130
+ - `Ripple` 文档:[../ui-core/src/ripple/README.md](../ui-core/src/ripple/README.md)
87
131
 
88
132
  ## AI 使用指令
89
133
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var n=require("@hbdlzy/tokens"),t=require("@hbdlzy/ui-core"),r=require("@hbdlzy/ui-energy");function u(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var o=u(n);const a="@hbdlzy/ui";Object.defineProperty(exports,"companyTokens",{enumerable:!0,get:function(){return n.companyTokens}});Object.defineProperty(exports,"defaultCompanyTokens",{enumerable:!0,get:function(){return o.default}});exports.uiPackageName=a;Object.keys(t).forEach(function(e){e!=="default"&&!exports.hasOwnProperty(e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})});Object.keys(r).forEach(function(e){e!=="default"&&!exports.hasOwnProperty(e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})});
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var n=require("@hbdlzy/tokens"),t=require("@hbdlzy/ui-core"),r=require("@hbdlzy/ui-energy");function u(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var l=u(n),i=u(t);const f="@hbdlzy/ui";function a(e){e.use(i.default)}const o={install:a};Object.defineProperty(exports,"companyTokens",{enumerable:!0,get:function(){return n.companyTokens}});Object.defineProperty(exports,"defaultCompanyTokens",{enumerable:!0,get:function(){return l.default}});exports.HbdlUI=o;exports.default=o;exports.install=a;exports.uiPackageName=f;Object.keys(t).forEach(function(e){e!=="default"&&!exports.hasOwnProperty(e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})});Object.keys(r).forEach(function(e){e!=="default"&&!exports.hasOwnProperty(e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})});
package/dist/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
+ import type { App, Plugin } from 'vue';
1
2
  import '@hbdlzy/tokens';
2
3
  export { companyTokens } from '@hbdlzy/tokens';
3
4
  export { default as defaultCompanyTokens } from '@hbdlzy/tokens';
4
5
  export * from '@hbdlzy/ui-core';
5
6
  export * from '@hbdlzy/ui-energy';
6
7
  export declare const uiPackageName = "@hbdlzy/ui";
8
+ export declare function install(app: App): void;
9
+ export declare const HbdlUI: Plugin;
10
+ export default HbdlUI;
package/dist/index.js CHANGED
@@ -1,5 +1,12 @@
1
1
  export { companyTokens, default as defaultCompanyTokens } from "@hbdlzy/tokens";
2
+ import HbdlUICore__default from "@hbdlzy/ui-core";
2
3
  export * from "@hbdlzy/ui-core";
3
4
  export * from "@hbdlzy/ui-energy";
4
5
  const uiPackageName = "@hbdlzy/ui";
5
- export { uiPackageName };
6
+ function install(app) {
7
+ app.use(HbdlUICore__default);
8
+ }
9
+ const HbdlUI = {
10
+ install
11
+ };
12
+ export { HbdlUI, HbdlUI as default, install, uiPackageName };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e=require("@hbdlzy/ui-core/ripple");Object.defineProperty(exports,"Ripple",{enumerable:!0,get:function(){return e.Ripple}});Object.defineProperty(exports,"installRipple",{enumerable:!0,get:function(){return e.installRipple}});Object.defineProperty(exports,"uninstallRipple",{enumerable:!0,get:function(){return e.uninstallRipple}});
@@ -0,0 +1,2 @@
1
+ export { Ripple, installRipple, uninstallRipple } from '@hbdlzy/ui-core/ripple';
2
+ export type { RipplePlugin, RippleTeardown } from '@hbdlzy/ui-core/ripple';
package/dist/ripple.js ADDED
@@ -0,0 +1 @@
1
+ export { Ripple, installRipple, uninstallRipple } from "@hbdlzy/ui-core/ripple";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hbdlzy/ui",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Company unified UI entry package.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,10 +17,25 @@
17
17
  "require": "./dist/index.cjs",
18
18
  "types": "./dist/index.d.ts"
19
19
  },
20
+ "./ripple": {
21
+ "import": "./dist/ripple.js",
22
+ "require": "./dist/ripple.cjs",
23
+ "types": "./dist/ripple.d.ts"
24
+ },
20
25
  "./style.css": "./src/style.css",
21
26
  "./dist/style.css": "./src/style.css",
22
27
  "./package.manifest.json": "./package.manifest.json"
23
28
  },
29
+ "typesVersions": {
30
+ "*": {
31
+ "ripple": [
32
+ "dist/ripple.d.ts"
33
+ ],
34
+ "package.manifest.json": [
35
+ "package.manifest.json"
36
+ ]
37
+ }
38
+ },
24
39
  "files": [
25
40
  "dist",
26
41
  "src",
@@ -30,7 +45,7 @@
30
45
  ],
31
46
  "dependencies": {
32
47
  "@hbdlzy/tokens": "0.1.2",
33
- "@hbdlzy/ui-core": "0.1.7",
48
+ "@hbdlzy/ui-core": "0.1.8",
34
49
  "@hbdlzy/ui-energy": "0.1.2"
35
50
  },
36
51
  "peerDependencies": {
@@ -48,7 +63,7 @@
48
63
  "registry": "https://registry.npmjs.org/"
49
64
  },
50
65
  "scripts": {
51
- "build": "vite build && pnpm run build:types",
66
+ "build": "vite build && vite build --config vite.ripple.config.ts && pnpm run build:types",
52
67
  "build:types": "vue-tsc -p tsconfig.build.json --declaration --emitDeclarationOnly"
53
68
  }
54
69
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hbdlzy/ui",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "entry": "@hbdlzy/ui",
5
5
  "readme": "README.md",
6
6
  "aiGuide": "AI-USAGE.md",
@@ -11,6 +11,12 @@
11
11
  "@hbdlzy/ui-energy"
12
12
  ],
13
13
  "description": "Unified install entry for company UI packages.",
14
+ "plugin": {
15
+ "name": "HbdlUI",
16
+ "importName": "default",
17
+ "entry": "@hbdlzy/ui",
18
+ "description": "Vue 插件入口,调用 app.use(HbdlUI) 可全局注册当前组件库已有组件并启用全局点击涟漪。"
19
+ },
14
20
  "exports": {
15
21
  "components": [
16
22
  {
@@ -105,17 +111,23 @@
105
111
  "importName": "companyTokens",
106
112
  "docs": "../tokens/README.md"
107
113
  },
114
+ {
115
+ "name": "Ripple",
116
+ "from": "@hbdlzy/ui-core",
117
+ "importName": "Ripple",
118
+ "docs": "../ui-core/src/ripple/README.md"
119
+ },
108
120
  {
109
121
  "name": "installRipple",
110
122
  "from": "@hbdlzy/ui-core",
111
123
  "importName": "installRipple",
112
- "docs": "../ui-core/README.md"
124
+ "docs": "../ui-core/src/ripple/README.md"
113
125
  },
114
126
  {
115
127
  "name": "uninstallRipple",
116
128
  "from": "@hbdlzy/ui-core",
117
129
  "importName": "uninstallRipple",
118
- "docs": "../ui-core/README.md"
130
+ "docs": "../ui-core/src/ripple/README.md"
119
131
  }
120
132
  ]
121
133
  },
@@ -142,6 +154,7 @@
142
154
  "AI-USAGE.md",
143
155
  "../ui-core/components.manifest.json",
144
156
  "../ui-core/README.md",
157
+ "../ui-core/src/ripple/README.md",
145
158
  "../ui-core/src/components/BaseTable/README.md",
146
159
  "../ui-core/src/components/BaseCard/README.md",
147
160
  "../ui-core/src/components/BaseEChart/README.md",
package/src/index.ts CHANGED
@@ -1,4 +1,6 @@
1
+ import type { App, Plugin } from 'vue'
1
2
  import '@hbdlzy/tokens'
3
+ import HbdlUICore from '@hbdlzy/ui-core'
2
4
 
3
5
  export { companyTokens } from '@hbdlzy/tokens'
4
6
  export { default as defaultCompanyTokens } from '@hbdlzy/tokens'
@@ -6,3 +8,13 @@ export * from '@hbdlzy/ui-core'
6
8
  export * from '@hbdlzy/ui-energy'
7
9
 
8
10
  export const uiPackageName = '@hbdlzy/ui'
11
+
12
+ export function install(app: App) {
13
+ app.use(HbdlUICore)
14
+ }
15
+
16
+ export const HbdlUI: Plugin = {
17
+ install
18
+ }
19
+
20
+ export default HbdlUI
package/src/ripple.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { Ripple, installRipple, uninstallRipple } from '@hbdlzy/ui-core/ripple'
2
+ export type { RipplePlugin, RippleTeardown } from '@hbdlzy/ui-core/ripple'