@infly/ui 1.0.8

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 (3) hide show
  1. package/README.md +23 -0
  2. package/index.js +45 -0
  3. package/package.json +34 -0
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # infly-ui
2
+
3
+ ## 介绍
4
+
5
+ 组件库
6
+
7
+ ## 注意事项
8
+
9
+
10
+ ## 软件架构
11
+
12
+ infly-ui
13
+ ├── Base - 基础组件库
14
+ │ └── InflyForm - 动态表单组件
15
+ ├── Business - 业务组件
16
+ │ └── InstitutionSelect - 机构选择组件
17
+
18
+ ## 安装教程
19
+
20
+ ```bash
21
+ # 项目安装
22
+ npm/pnpm install infly-ui
23
+ ```
package/index.js ADDED
@@ -0,0 +1,45 @@
1
+ import "./styles/index.scss";
2
+
3
+ // 动态导入 Base 组件
4
+ const requireBase = require.context("./src/Base", true, /index\.js$/);
5
+ const baseComponents = requireBase.keys().reduce((components, modulePath) => {
6
+ const component = requireBase(modulePath).default;
7
+ if (component && component.name) {
8
+ components[component.name] = component;
9
+ }
10
+ return components;
11
+ }, {});
12
+
13
+ // 动态导入 Business 组件
14
+ const requireBusiness = require.context("./src/Business", true, /index\.js$/);
15
+ const businessComponents = requireBusiness.keys().reduce((components, modulePath) => {
16
+ const component = requireBusiness(modulePath).default;
17
+ if (component && component.name) {
18
+ components[component.name] = component;
19
+ }
20
+ return components;
21
+ }, {});
22
+
23
+ // 合并所有组件
24
+ const allComponents = { ...baseComponents, ...businessComponents };
25
+ const components = Object.values(allComponents);
26
+
27
+ const install = Vue => {
28
+ if (install.installed || !Vue) return;
29
+ install.installed = true;
30
+ components.forEach(component => Vue.component(component.name, component));
31
+ };
32
+
33
+ // CDN 支持
34
+ if (typeof window !== "undefined" && window.Vue) install(window.Vue);
35
+
36
+ // 动态导出
37
+ export const {
38
+ InflyInput,
39
+ InflyCheckBox,
40
+ InflyForm,
41
+ InflyModal,
42
+ InflyList,
43
+ InstitutionSelect
44
+ } = allComponents;
45
+ export default { install, ...allComponents };
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@infly/ui",
3
+ "version": "1.0.8",
4
+ "description": "组件库 ",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "build:entry": "node scripts/build-entry.js",
9
+ "build": "pnpm run build:entry && vite build",
10
+ "publishPkg": "npm version patch && npm publish --access=public --registry=https://registry.npmjs.org/"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "import": "./index.js",
15
+ "require": "./index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://gitee.com/gdinfly_1/infly-ui.git"
24
+ },
25
+ "keywords": [
26
+ "infly",
27
+ "infly-ui"
28
+ ],
29
+ "author": "Kahal",
30
+ "license": "ISC",
31
+ "peerDependencies": {
32
+ "infly-libs": "^2.0.0"
33
+ }
34
+ }