web-kxjl-components 1.0.3 → 1.0.4

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/dist/index.js CHANGED
@@ -1,63 +1,45 @@
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
+ (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-switcher__trigger[data-v-af73d3b0]{cursor:pointer;display:inline-flex}.kx-app-switcher__panel[data-v-af73d3b0]{--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);justify-content:flex-end;align-items:flex-start;gap:8px;min-height:80px;display:flex}.kx-app-switcher__card[data-v-af73d3b0]{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-af73d3b0]{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.kx-app-switcher__system[data-v-af73d3b0]{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;font-weight:400;display:flex}.kx-app-switcher__system[data-v-af73d3b0]:hover{background:var(--kx-fill-light)}.kx-app-switcher__system.is-disabled[data-v-af73d3b0]{color:var(--kx-text-disabled);cursor:not-allowed}.kx-app-switcher__system.is-disabled[data-v-af73d3b0]:hover{background:0 0}.kx-app-switcher__system.is-disabled .kx-app-switcher__system-icon[data-v-af73d3b0]{opacity:.4;filter:grayscale()}.kx-app-switcher__system-icon[data-v-af73d3b0]{background:var(--kx-system-icon-bg);box-sizing:border-box;border-radius:6px;flex:none;width:24px;height:24px;padding:5px;overflow:hidden}.kx-app-switcher__system[data-v-af73d3b0]:nth-child(6n+1){--kx-system-icon-bg:#4b3fe9}.kx-app-switcher__system[data-v-af73d3b0]:nth-child(6n+2){--kx-system-icon-bg:#ef883a}.kx-app-switcher__system[data-v-af73d3b0]:nth-child(6n+3){--kx-system-icon-bg:#3fade9}.kx-app-switcher__system[data-v-af73d3b0]:nth-child(6n+4){--kx-system-icon-bg:#3686ff}.kx-app-switcher__system[data-v-af73d3b0]:nth-child(6n+5){--kx-system-icon-bg:#61bb5a}.kx-app-switcher__system[data-v-af73d3b0]:nth-child(6n){--kx-system-icon-bg:#ec6589}.kx-app-switcher__icon[data-v-af73d3b0]{object-fit:contain;width:100%;height:100%;display:block}.kx-app-switcher__system-name[data-v-af73d3b0]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.kx-app-switcher__products[data-v-af73d3b0]{flex-direction:column;flex:none;gap:8px;width:190px;display:flex}.kx-app-switcher__title[data-v-af73d3b0]{color:var(--kx-text-regular);font-size:14px}.kx-app-switcher__product[data-v-af73d3b0]{height:52px;color:var(--kx-text-primary);cursor:pointer;background:linear-gradient(90deg, #fff, var(--kx-product-bg-end));border:1px solid #e2e8f0;border-radius:4px;justify-content:space-between;align-items:center;padding:0 0 0 16px;font-size:16px;font-weight:600;display:flex}.kx-app-switcher__product.is-active[data-v-af73d3b0]{border-color:var(--kx-product-border)}.kx-app-switcher__product[data-v-af73d3b0]:nth-of-type(5n+1){--kx-product-bg-end:#dde9ff;--kx-product-border:#3b6df0}.kx-app-switcher__product[data-v-af73d3b0]:nth-of-type(5n+2){--kx-product-bg-end:#f4ecff;--kx-product-border:#883eff}.kx-app-switcher__product[data-v-af73d3b0]:nth-of-type(5n+3){--kx-product-bg-end:#e2f8e8;--kx-product-border:#61bb5a}.kx-app-switcher__product[data-v-af73d3b0]:nth-of-type(5n+4){--kx-product-bg-end:#d9f2ff;--kx-product-border:#3fade9}.kx-app-switcher__product[data-v-af73d3b0]:nth-of-type(5n){--kx-product-bg-end:#ffebdd;--kx-product-border:#ef883a}.kx-app-switcher__product-icon[data-v-af73d3b0]{flex:none;width:104px;height:47px}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
2
  import { ElEmpty as e, ElLoadingDirective as t, ElPopover as n, ElTooltip as r } from "element-plus/es";
3
3
  import "element-plus/es/components/base/style/css";
4
4
  import "element-plus/es/components/empty/style/css";
5
- import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createStaticVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, watch as y, withCtx as b, withDirectives as x } from "vue";
5
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, watch as v, withCtx as y, withDirectives as b } from "vue";
6
6
  import "element-plus/es/components/loading/style/css";
7
7
  import "element-plus/es/components/popover/style/css";
8
8
  import "element-plus/es/components/tooltip/style/css";
9
9
  // src/components/kx-empty/index.vue?vue&type=script&setup=true&lang.ts
10
- var S = { class: "kx-empty" }, C = /*@__PURE__*/ f({
10
+ var x = { class: "kx-empty" }, S = /*@__PURE__*/ d({
11
11
  name: "KxEmpty",
12
12
  __name: "index",
13
13
  props: { description: { default: "暂无数据" } },
14
14
  setup(t) {
15
15
  return (n, r) => {
16
16
  let i = e;
17
- return m(), c("div", S, [d(i, { description: t.description }, {
18
- default: b(() => [_(n.$slots, "default", {}, void 0, !0)]),
17
+ return p(), c("div", x, [u(i, { description: t.description }, {
18
+ default: y(() => [g(n.$slots, "default", {}, void 0, !0)]),
19
19
  _: 3
20
20
  }, 8, ["description"])]);
21
21
  };
22
22
  }
23
- }), w = (e, t) => {
23
+ }), C = (e, t) => {
24
24
  let n = e.__vccOpts || e;
25
25
  for (let [e, r] of t) n[e] = r;
26
26
  return n;
27
- }, T = /*#__PURE__*/ w(C, [["__scopeId", "data-v-392d5d37"]]), E = ["src"], D = {
28
- key: 1,
29
- class: "kx-app-icon",
30
- viewBox: "0 0 24 24",
31
- "aria-hidden": "true"
32
- }, O = /*#__PURE__*/ w(/* @__PURE__ */ f({
33
- name: "KxAppIcon",
34
- __name: "app-icon",
35
- props: { src: {} },
36
- setup(e) {
37
- let t = e, n = h(!1);
38
- return y(() => t.src, () => {
39
- n.value = !1;
40
- }), (t, r) => e.src && !n.value ? (m(), c("img", {
41
- key: 0,
42
- class: "kx-app-icon",
43
- src: e.src,
44
- alt: "",
45
- onError: r[0] ||= (e) => n.value = !0
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)]]));
47
- }
48
- }), [["__scopeId", "data-v-e5f115f7"]]), k = { class: "kx-app-switcher__trigger" }, A = { class: "kx-app-switcher__panel" }, j = {
27
+ }, w = /*#__PURE__*/ C(S, [["__scopeId", "data-v-392d5d37"]]), T = { class: "kx-app-switcher__trigger" }, E = { class: "kx-app-switcher__panel" }, D = {
49
28
  key: 0,
50
29
  class: "kx-app-switcher__card kx-app-switcher__systems"
51
- }, M = [
30
+ }, O = [
52
31
  "aria-disabled",
53
32
  "title",
54
33
  "onClick"
55
- ], N = { class: "kx-app-switcher__system-icon" }, P = { class: "kx-app-switcher__system-name" }, F = { class: "kx-app-switcher__card kx-app-switcher__products" }, I = [
34
+ ], k = { class: "kx-app-switcher__system-icon" }, A = ["src"], j = { class: "kx-app-switcher__system-name" }, M = { class: "kx-app-switcher__card kx-app-switcher__products" }, N = [
56
35
  "title",
57
36
  "onMouseenter",
58
37
  "onFocus",
59
38
  "onClick"
60
- ], L = { class: "kx-app-switcher__product-name" }, R = { class: "kx-app-switcher__product-icon" }, z = /*#__PURE__*/ w(/* @__PURE__ */ f({
39
+ ], P = { class: "kx-app-switcher__product-name" }, F = {
40
+ key: 0,
41
+ class: "kx-app-switcher__product-icon"
42
+ }, I = ["src"], L = /*#__PURE__*/ C(/* @__PURE__ */ d({
61
43
  name: "KxAppSwitcher",
62
44
  __name: "index",
63
45
  props: {
@@ -66,30 +48,30 @@ var S = { class: "kx-empty" }, C = /*@__PURE__*/ f({
66
48
  disabledTip: { default: "暂未开通" }
67
49
  },
68
50
  setup(u) {
69
- let f = u, S = h(!1), C = h(!1), w = h(!1), T = h([]), E = h(null), D = /^(https?:|data:|blob:|\/\/)/i;
51
+ let d = u, x = m(!1), S = m(!1), C = m(!1), w = m([]), L = m(null), R = /^(https?:|data:|blob:|\/\/)/i;
70
52
  function z(e) {
71
53
  return [...e].sort((e, t) => (e.sortNum ?? 0) - (t.sortNum ?? 0));
72
54
  }
73
- let B = a(() => T.value.find((e) => e.id === E.value)?.systems ?? []);
55
+ let B = a(() => w.value.find((e) => e.id === L.value)?.systems ?? []);
74
56
  async function V() {
75
- if (!(C.value || w.value)) {
76
- C.value = !0;
57
+ if (!(S.value || C.value)) {
58
+ S.value = !0;
77
59
  try {
78
- let e = await f.fetcher();
79
- e.code === 0 && Array.isArray(e.data) && (T.value = z(e.data).map((e) => ({
60
+ let e = await d.fetcher();
61
+ e.code === 0 && Array.isArray(e.data) && (w.value = z(e.data).map((e) => ({
80
62
  ...e,
81
63
  systems: z(e.systems ?? [])
82
- })), E.value = T.value[0]?.id ?? null, w.value = !0);
64
+ })), L.value = w.value[0]?.id ?? null, C.value = !0);
83
65
  } catch {} finally {
84
- C.value = !1;
66
+ S.value = !1;
85
67
  }
86
68
  }
87
69
  }
88
- y(S, (e) => {
70
+ v(x, (e) => {
89
71
  e && V();
90
72
  });
91
73
  function H(e) {
92
- return e ? D.test(e) ? e : f.staticFileFormat ? f.staticFileFormat(e) : e : "";
74
+ return e ? R.test(e) ? e : d.staticFileFormat ? d.staticFileFormat(e) : e : "";
93
75
  }
94
76
  function U(e) {
95
77
  if (!e.sysUrl) return;
@@ -99,16 +81,16 @@ var S = { class: "kx-empty" }, C = /*@__PURE__*/ f({
99
81
  } catch {
100
82
  return;
101
83
  }
102
- (t.protocol === "http:" || t.protocol === "https:") && (window.open(t.href, "_blank", "noopener,noreferrer"), S.value = !1);
84
+ (t.protocol === "http:" || t.protocol === "https:") && (window.open(t.href, "_blank", "noopener,noreferrer"), x.value = !1);
103
85
  }
104
- return (a, f) => {
105
- let h = r, y = e, w = n, D = t;
106
- return m(), o(w, {
107
- visible: S.value,
108
- "onUpdate:visible": f[0] ||= (e) => S.value = e,
86
+ return (a, d) => {
87
+ let m = r, v = e, C = n, R = t;
88
+ return p(), o(C, {
89
+ visible: x.value,
90
+ "onUpdate:visible": d[0] ||= (e) => x.value = e,
109
91
  trigger: "click",
110
92
  placement: "bottom-end",
111
- width: 430,
93
+ width: 480,
112
94
  "show-arrow": !1,
113
95
  "popper-style": {
114
96
  padding: 0,
@@ -117,48 +99,57 @@ var S = { class: "kx-empty" }, C = /*@__PURE__*/ f({
117
99
  boxShadow: "none"
118
100
  }
119
101
  }, {
120
- reference: b(() => [l("span", k, [_(a.$slots, "default", { visible: S.value }, void 0, !0)])]),
121
- default: b(() => [x((m(), c("div", A, [B.value.length ? (m(), c("div", j, [(m(!0), c(i, null, g(B.value, (e) => (m(), o(h, {
102
+ reference: y(() => [l("span", T, [g(a.$slots, "default", { visible: x.value }, void 0, !0)])]),
103
+ default: y(() => [b((p(), c("div", E, [B.value.length ? (p(), c("div", D, [(p(!0), c(i, null, h(B.value, (e) => (p(), o(m, {
122
104
  key: e.id,
123
105
  content: u.disabledTip,
124
106
  disabled: !!e.sysUrl,
125
107
  placement: "left"
126
108
  }, {
127
- default: b(() => [l("button", {
109
+ default: y(() => [l("button", {
128
110
  type: "button",
129
- class: p(["kx-app-switcher__system", { "is-disabled": !e.sysUrl }]),
111
+ class: f(["kx-app-switcher__system", { "is-disabled": !e.sysUrl }]),
130
112
  "aria-disabled": !e.sysUrl,
131
113
  title: e.description,
132
114
  onClick: (t) => U(e)
133
- }, [l("span", N, [d(O, { src: H(e.icon) }, null, 8, ["src"])]), l("span", P, v(e.sysName), 1)], 10, M)]),
115
+ }, [l("span", k, [e.icon ? (p(), c("img", {
116
+ key: 0,
117
+ class: "kx-app-switcher__icon",
118
+ src: H(e.icon),
119
+ alt: ""
120
+ }, null, 8, A)) : s("", !0)]), l("span", j, _(e.sysName), 1)], 10, O)]),
134
121
  _: 2
135
- }, 1032, ["content", "disabled"]))), 128))])) : s("", !0), l("div", F, [
136
- f[1] ||= l("div", { class: "kx-app-switcher__title" }, "应用切换", -1),
137
- !C.value && !T.value.length ? (m(), o(y, {
122
+ }, 1032, ["content", "disabled"]))), 128))])) : s("", !0), l("div", M, [
123
+ d[1] ||= l("div", { class: "kx-app-switcher__title" }, "应用切换", -1),
124
+ !S.value && !w.value.length ? (p(), o(v, {
138
125
  key: 0,
139
126
  "image-size": 60,
140
127
  description: "暂无应用"
141
128
  })) : s("", !0),
142
- (m(!0), c(i, null, g(T.value, (e) => (m(), c("button", {
129
+ (p(!0), c(i, null, h(w.value, (e) => (p(), c("button", {
143
130
  key: e.id,
144
131
  type: "button",
145
- class: p(["kx-app-switcher__product", { "is-active": e.id === E.value }]),
132
+ class: f(["kx-app-switcher__product", { "is-active": e.id === L.value }]),
146
133
  title: e.description,
147
- onMouseenter: (t) => E.value = e.id,
148
- onFocus: (t) => E.value = e.id,
149
- onClick: (t) => E.value = e.id
150
- }, [l("span", L, v(e.productName), 1), l("span", R, [d(O, { src: H(e.icon) }, null, 8, ["src"])])], 42, I))), 128))
151
- ])])), [[D, C.value]])]),
134
+ onMouseenter: (t) => L.value = e.id,
135
+ onFocus: (t) => L.value = e.id,
136
+ onClick: (t) => L.value = e.id
137
+ }, [l("span", P, _(e.productName), 1), e.icon ? (p(), c("span", F, [l("img", {
138
+ class: "kx-app-switcher__icon",
139
+ src: H(e.icon),
140
+ alt: ""
141
+ }, null, 8, I)])) : s("", !0)], 42, N))), 128))
142
+ ])])), [[R, S.value]])]),
152
143
  _: 3
153
144
  }, 8, ["visible"]);
154
145
  };
155
146
  }
156
- }), [["__scopeId", "data-v-826c18f8"]]), B = {
157
- KxEmpty: T,
158
- KxAppSwitcher: z
159
- }, V = { install(e) {
160
- Object.entries(B).forEach(([t, n]) => {
147
+ }), [["__scopeId", "data-v-af73d3b0"]]), R = {
148
+ KxEmpty: w,
149
+ KxAppSwitcher: L
150
+ }, z = { install(e) {
151
+ Object.entries(R).forEach(([t, n]) => {
161
152
  e.component(t, n);
162
153
  });
163
154
  } };
164
- export { z as KxAppSwitcher, T as KxEmpty, V as default };
155
+ export { L as KxAppSwitcher, w as KxEmpty, z as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-kxjl-components",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "公司公共组件库(Vue 3 + Element Plus)",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -1,7 +0,0 @@
1
- type __VLS_Props = {
2
- /** 图标地址,为空或加载失败时显示默认图标 */
3
- src?: string;
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
- declare const _default: typeof __VLS_export;
7
- export default _default;