@hbdlzy/ui 0.1.7 → 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
@@ -35,6 +35,7 @@ node_modules/@hbdlzy/ui/AI-USAGE.md
35
35
  - `BaseCard`
36
36
  - `BaseEChart`
37
37
  - `BaseExportButton`
38
+ - `SvgIcon`
38
39
  - `OutlinedInput`
39
40
  - `OutlinedSelect`
40
41
  - `OutlinedDatePicker`
@@ -45,12 +46,22 @@ node_modules/@hbdlzy/ui/AI-USAGE.md
45
46
  - `echarts`
46
47
  - `exportExcel`
47
48
  - `companyTokens`
48
- - 全局按钮 ripple 已随 `@hbdlzy/ui` 入口自动启用,局部关闭可添加 `data-hbdl-ripple="false"`
49
+ - `Ripple`
50
+ - 全局点击涟漪已随 `@hbdlzy/ui` 入口自动启用,局部关闭可添加 `data-hbdl-ripple="false"`
49
51
  - 只有当现有组件无法满足需求时,才考虑新增公共组件
50
52
 
51
53
  ## 导入约定
52
54
 
53
- 优先统一从 `@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` 导入:
54
65
 
55
66
  ```ts
56
67
  import {
@@ -58,6 +69,7 @@ import {
58
69
  BaseCard,
59
70
  BaseEChart,
60
71
  BaseExportButton,
72
+ SvgIcon,
61
73
  OutlinedInput,
62
74
  OutlinedSelect,
63
75
  OutlinedDatePicker,
@@ -65,6 +77,7 @@ import {
65
77
  OutlinedTimePicker,
66
78
  OutlinedCascader,
67
79
  OutlinedTreeSelect,
80
+ Ripple,
68
81
  installRipple,
69
82
  uninstallRipple,
70
83
  companyTokens,
@@ -72,12 +85,19 @@ import {
72
85
  } from '@hbdlzy/ui'
73
86
  ```
74
87
 
88
+ 只接入点击涟漪时,也可以使用细粒度入口:
89
+
90
+ ```ts
91
+ import { Ripple, installRipple, uninstallRipple } from '@hbdlzy/ui/ripple'
92
+ ```
93
+
75
94
  ## 复用规则
76
95
 
77
96
  - 不要在页面里重复写通用表格的分页、远程请求承接、排序参数映射和勾选暴露逻辑,优先使用 `BaseTable`
78
97
  - 不要在页面里重复写 ECharts 初始化、resize、dispose 逻辑,优先使用 `BaseEChart`
79
98
  - 不要在页面里重复写卡片外层容器、标题区、右侧时间和导出触发区,优先使用 `BaseCard`
80
99
  - 不要在页面里重复写导出按钮 loading、成功失败提示和文件下载逻辑,优先使用 `BaseExportButton`
100
+ - 不要在页面里重复写 SVG symbol 或外链 SVG 图标展示壳子,优先使用 `SvgIcon`
81
101
  - 不要在页面里重复写浮动标签输入框、数值基础校验和输入框实例方法暴露逻辑,优先使用 `OutlinedInput`
82
102
  - 不要在页面里重复写基础下拉的浮动标签、选项映射和焦点态逻辑,优先使用 `OutlinedSelect`
83
103
  - 不要在页面里重复写基础日期控件的浮动标签、禁用日期和焦点态逻辑,优先使用 `OutlinedDatePicker`
@@ -87,6 +107,7 @@ import {
87
107
  - 不要在页面里重复写树形下拉选择的字段映射、浮动标签和清空逻辑,优先使用 `OutlinedTreeSelect`
88
108
  - 需要渐变色、图形工具时,优先使用统一导出的 `echarts`
89
109
  - 需要主题变量时,优先使用 `companyTokens`
110
+ - 需要全局点击反馈时,优先使用已内置的 `Ripple` / `installRipple`,不要重复写 `v-ripple` 指令或按钮动画 DOM
90
111
 
91
112
  ## 维护组件库时
92
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
 
@@ -24,6 +47,7 @@ import {
24
47
  BaseCard,
25
48
  BaseEChart,
26
49
  BaseExportButton,
50
+ SvgIcon,
27
51
  OutlinedInput,
28
52
  OutlinedSelect,
29
53
  OutlinedDatePicker,
@@ -31,6 +55,7 @@ import {
31
55
  OutlinedTimePicker,
32
56
  OutlinedCascader,
33
57
  OutlinedTreeSelect,
58
+ Ripple,
34
59
  installRipple,
35
60
  uninstallRipple,
36
61
  companyTokens,
@@ -38,7 +63,25 @@ import {
38
63
  } from '@hbdlzy/ui'
39
64
  ```
40
65
 
41
- 导入 `@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
+ ```
42
85
 
43
86
  ## 当前聚合内容
44
87
 
@@ -52,6 +95,7 @@ import {
52
95
  - `BaseCard`
53
96
  - `BaseEChart`
54
97
  - `BaseExportButton`
98
+ - `SvgIcon`
55
99
  - `OutlinedInput`
56
100
  - `OutlinedSelect`
57
101
  - `OutlinedDatePicker`
@@ -62,6 +106,7 @@ import {
62
106
  - `echarts`
63
107
  - `exportExcel`
64
108
  - `companyTokens`
109
+ - `Ripple`
65
110
  - `installRipple`
66
111
  - `uninstallRipple`
67
112
 
@@ -74,6 +119,7 @@ import {
74
119
  - `BaseCard` 文档:[../ui-core/src/components/BaseCard/README.md](../ui-core/src/components/BaseCard/README.md)
75
120
  - `BaseEChart` 文档:[../ui-core/src/components/BaseEChart/README.md](../ui-core/src/components/BaseEChart/README.md)
76
121
  - `BaseExportButton` 文档:[../ui-core/src/components/BaseExportButton/README.md](../ui-core/src/components/BaseExportButton/README.md)
122
+ - `SvgIcon` 文档:[../ui-core/src/components/SvgIcon/README.md](../ui-core/src/components/SvgIcon/README.md)
77
123
  - `OutlinedInput` 文档:[../ui-core/src/components/OutlinedInput/README.md](../ui-core/src/components/OutlinedInput/README.md)
78
124
  - `OutlinedSelect` 文档:[../ui-core/src/components/OutlinedSelect/README.md](../ui-core/src/components/OutlinedSelect/README.md)
79
125
  - `OutlinedDatePicker` 文档:[../ui-core/src/components/OutlinedDatePicker/README.md](../ui-core/src/components/OutlinedDatePicker/README.md)
@@ -81,6 +127,7 @@ import {
81
127
  - `OutlinedTimePicker` 文档:[../ui-core/src/components/OutlinedTimePicker/README.md](../ui-core/src/components/OutlinedTimePicker/README.md)
82
128
  - `OutlinedCascader` 文档:[../ui-core/src/components/OutlinedCascader/README.md](../ui-core/src/components/OutlinedCascader/README.md)
83
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)
84
131
 
85
132
  ## AI 使用指令
86
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.7",
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.6",
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.7",
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
  {
@@ -37,6 +43,12 @@
37
43
  "importName": "BaseExportButton",
38
44
  "docs": "../ui-core/src/components/BaseExportButton/README.md"
39
45
  },
46
+ {
47
+ "name": "SvgIcon",
48
+ "from": "@hbdlzy/ui-core",
49
+ "importName": "SvgIcon",
50
+ "docs": "../ui-core/src/components/SvgIcon/README.md"
51
+ },
40
52
  {
41
53
  "name": "OutlinedInput",
42
54
  "from": "@hbdlzy/ui-core",
@@ -99,17 +111,23 @@
99
111
  "importName": "companyTokens",
100
112
  "docs": "../tokens/README.md"
101
113
  },
114
+ {
115
+ "name": "Ripple",
116
+ "from": "@hbdlzy/ui-core",
117
+ "importName": "Ripple",
118
+ "docs": "../ui-core/src/ripple/README.md"
119
+ },
102
120
  {
103
121
  "name": "installRipple",
104
122
  "from": "@hbdlzy/ui-core",
105
123
  "importName": "installRipple",
106
- "docs": "../ui-core/README.md"
124
+ "docs": "../ui-core/src/ripple/README.md"
107
125
  },
108
126
  {
109
127
  "name": "uninstallRipple",
110
128
  "from": "@hbdlzy/ui-core",
111
129
  "importName": "uninstallRipple",
112
- "docs": "../ui-core/README.md"
130
+ "docs": "../ui-core/src/ripple/README.md"
113
131
  }
114
132
  ]
115
133
  },
@@ -136,10 +154,12 @@
136
154
  "AI-USAGE.md",
137
155
  "../ui-core/components.manifest.json",
138
156
  "../ui-core/README.md",
157
+ "../ui-core/src/ripple/README.md",
139
158
  "../ui-core/src/components/BaseTable/README.md",
140
159
  "../ui-core/src/components/BaseCard/README.md",
141
160
  "../ui-core/src/components/BaseEChart/README.md",
142
161
  "../ui-core/src/components/BaseExportButton/README.md",
162
+ "../ui-core/src/components/SvgIcon/README.md",
143
163
  "../ui-core/src/components/OutlinedInput/README.md",
144
164
  "../ui-core/src/components/OutlinedSelect/README.md",
145
165
  "../ui-core/src/components/OutlinedDatePicker/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'