web-kxjl-components 1.0.0 → 1.0.3

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/README.md CHANGED
@@ -10,18 +10,18 @@ npm install web-kxjl-components
10
10
 
11
11
  宿主项目需自带 `vue`、`element-plus`(peerDependencies),组件库不会重复打包这两个依赖。
12
12
 
13
+ 样式已内联进 JS,导入组件时自动注入,无需再引入 css 文件。
14
+
13
15
  按需引入(推荐):
14
16
 
15
17
  ```ts
16
18
  import { KxEmpty } from "web-kxjl-components";
17
- import "web-kxjl-components/style.css";
18
19
  ```
19
20
 
20
21
  全量注册:
21
22
 
22
23
  ```ts
23
24
  import KxComponents from "web-kxjl-components";
24
- import "web-kxjl-components/style.css";
25
25
 
26
26
  app.use(KxComponents);
27
27
  ```
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.kx-empty[data-v-392d5d37]{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.kx-app-icon[data-v-e5f115f7]{object-fit:contain;width:100%;height:100%;display:block}.kx-app-switcher__trigger[data-v-826c18f8]{cursor:pointer;display:inline-flex}.kx-app-switcher__panel[data-v-826c18f8]{--kx-text-primary:var(--kx-switcher-text-primary,#303133);--kx-text-regular:var(--kx-switcher-text-regular,#606266);--kx-text-disabled:var(--kx-switcher-text-disabled,#a8abb2);--kx-bg-overlay:var(--kx-switcher-bg-overlay,#fff);--kx-border-light:var(--kx-switcher-border-light,#e4e7ed);--kx-box-shadow-light:var(--kx-switcher-box-shadow-light,0 0 12px #0000001f);--kx-fill-light:var(--kx-switcher-fill-light,#f5f7fa);--kx-fill-lighter:var(--kx-switcher-fill-lighter,#fafafa);--kx-primary:var(--kx-switcher-primary,#2879ff);--kx-primary-light-9:var(--kx-switcher-primary-light-9,#eaf2ff);--kx-primary-light-5:var(--kx-switcher-primary-light-5,#94bcff);justify-content:flex-end;align-items:flex-start;gap:8px;min-height:80px;display:flex}.kx-app-switcher__card[data-v-826c18f8]{background:var(--kx-bg-overlay);border:1px solid var(--kx-border-light);box-shadow:var(--kx-box-shadow-light);border-radius:8px;padding:12px}.kx-app-switcher__systems[data-v-826c18f8]{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.kx-app-switcher__system[data-v-826c18f8]{color:var(--kx-text-primary);text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;gap:10px;padding:8px;font-size:14px;display:flex}.kx-app-switcher__system[data-v-826c18f8]:hover{background:var(--kx-fill-light)}.kx-app-switcher__system.is-disabled[data-v-826c18f8]{color:var(--kx-text-disabled);cursor:not-allowed}.kx-app-switcher__system.is-disabled[data-v-826c18f8]:hover{background:0 0}.kx-app-switcher__system.is-disabled .kx-app-switcher__system-icon[data-v-826c18f8]{opacity:.4;filter:grayscale()}.kx-app-switcher__system-icon[data-v-826c18f8]{flex:none;width:24px;height:24px}.kx-app-switcher__system-name[data-v-826c18f8]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.kx-app-switcher__products[data-v-826c18f8]{flex-direction:column;flex:none;gap:8px;width:200px;display:flex}.kx-app-switcher__title[data-v-826c18f8]{color:var(--kx-text-regular);font-size:14px}.kx-app-switcher__product[data-v-826c18f8]{height:56px;color:var(--kx-text-primary);cursor:pointer;background:var(--kx-fill-lighter);border:1px solid #0000;border-radius:8px;justify-content:space-between;align-items:center;padding:0 12px;font-size:15px;font-weight:600;display:flex}.kx-app-switcher__product.is-active[data-v-826c18f8]{background:var(--kx-primary-light-9);border-color:var(--kx-primary-light-5)}.kx-app-switcher__product-icon[data-v-826c18f8]{flex:none;width:36px;height:36px}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
1
2
  import { ElEmpty as e, ElLoadingDirective as t, ElPopover as n, ElTooltip as r } from "element-plus/es";
2
3
  import "element-plus/es/components/base/style/css";
3
4
  import "element-plus/es/components/empty/style/css";
@@ -42,9 +43,9 @@ var S = { class: "kx-empty" }, C = /*@__PURE__*/ f({
42
43
  src: e.src,
43
44
  alt: "",
44
45
  onError: r[0] ||= (e) => n.value = !0
45
- }, null, 40, E)) : (m(), c("svg", D, [...r[1] ||= [u("<rect width=\"24\" height=\"24\" rx=\"6\" fill=\"var(--el-color-primary)\" data-v-352f5b8f></rect><rect x=\"5\" y=\"5\" width=\"6\" height=\"6\" rx=\"1.5\" fill=\"#fff\" data-v-352f5b8f></rect><rect x=\"13\" y=\"5\" width=\"6\" height=\"6\" rx=\"1.5\" fill=\"#fff\" data-v-352f5b8f></rect><rect x=\"5\" y=\"13\" width=\"6\" height=\"6\" rx=\"1.5\" fill=\"#fff\" data-v-352f5b8f></rect><rect x=\"13\" y=\"13\" width=\"6\" height=\"6\" rx=\"1.5\" fill=\"#fff\" data-v-352f5b8f></rect>", 5)]]));
46
+ }, null, 40, E)) : (m(), c("svg", D, [...r[1] ||= [u("<rect width=\"24\" height=\"24\" rx=\"6\" fill=\"var(--kx-primary, #2879ff)\" data-v-e5f115f7></rect><rect x=\"5\" y=\"5\" width=\"6\" height=\"6\" rx=\"1.5\" fill=\"#fff\" data-v-e5f115f7></rect><rect x=\"13\" y=\"5\" width=\"6\" height=\"6\" rx=\"1.5\" fill=\"#fff\" data-v-e5f115f7></rect><rect x=\"5\" y=\"13\" width=\"6\" height=\"6\" rx=\"1.5\" fill=\"#fff\" data-v-e5f115f7></rect><rect x=\"13\" y=\"13\" width=\"6\" height=\"6\" rx=\"1.5\" fill=\"#fff\" data-v-e5f115f7></rect>", 5)]]));
46
47
  }
47
- }), [["__scopeId", "data-v-352f5b8f"]]), k = { class: "kx-app-switcher__trigger" }, A = { class: "kx-app-switcher__panel" }, j = {
48
+ }), [["__scopeId", "data-v-e5f115f7"]]), k = { class: "kx-app-switcher__trigger" }, A = { class: "kx-app-switcher__panel" }, j = {
48
49
  key: 0,
49
50
  class: "kx-app-switcher__card kx-app-switcher__systems"
50
51
  }, M = [
@@ -152,7 +153,7 @@ var S = { class: "kx-empty" }, C = /*@__PURE__*/ f({
152
153
  }, 8, ["visible"]);
153
154
  };
154
155
  }
155
- }), [["__scopeId", "data-v-5a0f26bb"]]), B = {
156
+ }), [["__scopeId", "data-v-826c18f8"]]), B = {
156
157
  KxEmpty: T,
157
158
  KxAppSwitcher: z
158
159
  }, V = { install(e) {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "web-kxjl-components",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "公司公共组件库(Vue 3 + Element Plus)",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
7
7
  "sideEffects": [
8
- "**/*.css"
8
+ "./dist/index.js"
9
9
  ],
10
10
  "files": [
11
11
  "dist"
@@ -17,8 +17,7 @@
17
17
  ".": {
18
18
  "types": "./dist/index.d.ts",
19
19
  "import": "./dist/index.js"
20
- },
21
- "./style.css": "./dist/web-kxjl-components.css"
20
+ }
22
21
  },
23
22
  "publishConfig": {
24
23
  "registry": "https://registry.npmjs.org/",
@@ -43,6 +42,7 @@
43
42
  "typescript": "~6.0.2",
44
43
  "unplugin-vue-components": "^32.1.0",
45
44
  "vite": "^8.0.12",
45
+ "vite-plugin-css-injected-by-js": "5.0.3",
46
46
  "vue": "^3.5.34",
47
47
  "vue-tsc": "^3.2.8"
48
48
  }
@@ -1,2 +0,0 @@
1
- .kx-empty[data-v-392d5d37]{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.kx-app-icon[data-v-352f5b8f]{object-fit:contain;width:100%;height:100%;display:block}.kx-app-switcher__trigger[data-v-5a0f26bb]{cursor:pointer;display:inline-flex}.kx-app-switcher__panel[data-v-5a0f26bb]{justify-content:flex-end;align-items:flex-start;gap:8px;min-height:80px;display:flex}.kx-app-switcher__card[data-v-5a0f26bb]{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light);border-radius:8px;padding:12px}.kx-app-switcher__systems[data-v-5a0f26bb]{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.kx-app-switcher__system[data-v-5a0f26bb]{color:var(--el-text-color-primary);text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;gap:10px;padding:8px;font-size:14px;display:flex}.kx-app-switcher__system[data-v-5a0f26bb]:hover{background:var(--el-fill-color-light)}.kx-app-switcher__system.is-disabled[data-v-5a0f26bb]{color:var(--el-text-color-disabled);cursor:not-allowed}.kx-app-switcher__system.is-disabled[data-v-5a0f26bb]:hover{background:0 0}.kx-app-switcher__system.is-disabled .kx-app-switcher__system-icon[data-v-5a0f26bb]{opacity:.4;filter:grayscale()}.kx-app-switcher__system-icon[data-v-5a0f26bb]{flex:none;width:24px;height:24px}.kx-app-switcher__system-name[data-v-5a0f26bb]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.kx-app-switcher__products[data-v-5a0f26bb]{flex-direction:column;flex:none;gap:8px;width:200px;display:flex}.kx-app-switcher__title[data-v-5a0f26bb]{color:var(--el-text-color-regular);font-size:14px}.kx-app-switcher__product[data-v-5a0f26bb]{height:56px;color:var(--el-text-color-primary);cursor:pointer;background:var(--el-fill-color-lighter);border:1px solid #0000;border-radius:8px;justify-content:space-between;align-items:center;padding:0 12px;font-size:15px;font-weight:600;display:flex}.kx-app-switcher__product.is-active[data-v-5a0f26bb]{background:var(--el-color-primary-light-9);border-color:var(--el-color-primary-light-5)}.kx-app-switcher__product-icon[data-v-5a0f26bb]{flex:none;width:36px;height:36px}
2
- /*$vite$:1*/