@junfuhuang/tcamp-components 1.0.20 → 1.0.22

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 (2) hide show
  1. package/dist/index.js +49 -49
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { defineComponent as U, ref as S, computed as u, onMounted as G, onUnmounted as I, createElementBlock as r, openBlock as l, createElementVNode as c, createCommentVNode as v, withModifiers as C, normalizeStyle as d, normalizeClass as f, renderSlot as F, unref as a, Fragment as Z, renderList as E, toDisplayString as m, createBlock as j, withCtx as y, createVNode as b, createTextVNode as Y } from "vue";
2
- import { Dropdown as R, Space as K, Button as q, Icon as _ } from "tdesign-vue-next";
1
+ import { defineComponent as U, ref as Z, computed as u, onMounted as G, onUnmounted as j, createElementBlock as r, openBlock as l, createElementVNode as c, createCommentVNode as v, withModifiers as O, normalizeStyle as d, normalizeClass as f, renderSlot as F, unref as a, Fragment as M, renderList as x, toDisplayString as y, createBlock as Y, withCtx as g, createVNode as b, createTextVNode as R } from "vue";
2
+ import { Dropdown as I, Space as K, Button as q, Icon as _ } from "tdesign-vue-next";
3
3
  var w = /* @__PURE__ */ ((n) => (n.Logout = "logout", n.Account = "account", n.Certificates = "certificates", n.MyCamp = "myCamp", n))(w || {});
4
- const x = [
4
+ const W = [
5
5
  {
6
6
  content: "我的营地",
7
7
  value: "myCamp"
@@ -84,28 +84,28 @@ const x = [
84
84
  userName: {}
85
85
  },
86
86
  emits: ["logo-click", "menu-click", "login-click", "user-dropdown-click", "logout"],
87
- setup(n, { emit: g }) {
88
- const t = n, X = g, o = S(!1), B = S(-1), W = u(
87
+ setup(n, { emit: m }) {
88
+ const t = n, X = m, o = Z(!1), B = Z(-1), E = u(
89
89
  () => o.value ? "translate-x-0" : "-translate-x-full"
90
- ), h = u(() => t.transparent && !t.scrolled ? $ : L), N = u(() => t.transparent && !t.scrolled ? "!text-white" : "login-btn-primary"), O = u(() => t.transparent && !t.scrolled ? {} : {
90
+ ), h = u(() => t.transparent && !t.scrolled ? $ : L), k = u(() => t.transparent && !t.scrolled ? "!text-white" : "login-btn-primary"), N = u(() => t.transparent && !t.scrolled ? {} : {
91
91
  color: "#0052D9 !important"
92
- }), P = u(() => t.transparent && !t.scrolled ? "text-white/90 hover:text-white transition-colors duration-200" : "nav-text-primary"), V = u(() => t.transparent && !t.scrolled ? {} : {
92
+ }), P = u(() => t.transparent && !t.scrolled ? "text-white/90 hover:text-white transition-colors duration-200" : "nav-text-primary"), z = u(() => t.transparent && !t.scrolled ? {} : {
93
93
  color: "#0052D9 !important",
94
94
  opacity: "0.9"
95
95
  }), J = u(() => t.transparent && !t.scrolled ? "after:bg-white" : "nav-underline-primary");
96
96
  function Q() {
97
97
  console.log("toggleMobileMenu - before:", o.value), o.value = !o.value, console.log("toggleMobileMenu - after:", o.value);
98
98
  }
99
- function k() {
99
+ function C() {
100
100
  o.value = !1;
101
101
  }
102
- function z() {
103
- window.location.href = `${import.meta.env.VITE_API_DOMAIN}`;
102
+ function V() {
103
+ window.location.href = import.meta.env.VITE_API_DOMAIN;
104
104
  }
105
- function D(A) {
106
- k(), window.location.href = `${import.meta.env.VITE_API_DOMAIN}${A.path}`;
105
+ function S(A) {
106
+ C(), window.location.href = `${import.meta.env.VITE_API_DOMAIN}${A.path}`;
107
107
  }
108
- function M() {
108
+ function D() {
109
109
  try {
110
110
  const A = new URL("auth", import.meta.env.VITE_API_DOMAIN), s = window.location.href;
111
111
  A.searchParams.set("redirect", s), window.location.href = A.toString();
@@ -120,9 +120,9 @@ const x = [
120
120
  return G(() => {
121
121
  const A = (s) => {
122
122
  const e = s.target, i = e.closest(".mobile-menu-container"), p = e.closest('button[aria-label="菜单"]');
123
- o.value && !i && !p && (console.log("handleClickOutside - closing menu"), k());
123
+ o.value && !i && !p && (console.log("handleClickOutside - closing menu"), C());
124
124
  };
125
- document.addEventListener("click", A), I(() => {
125
+ document.addEventListener("click", A), j(() => {
126
126
  document.removeEventListener("click", A);
127
127
  });
128
128
  }), (A, s) => (l(), r("div", AA, [
@@ -130,8 +130,8 @@ const x = [
130
130
  c("div", tA, [
131
131
  c("button", {
132
132
  class: f(["md:hidden p-2 relative z-50", P.value]),
133
- style: d(V.value),
134
- onClick: C(Q, ["stop"]),
133
+ style: d(z.value),
134
+ onClick: O(Q, ["stop"]),
135
135
  "aria-label": "菜单",
136
136
  type: "button"
137
137
  }, [
@@ -151,16 +151,16 @@ const x = [
151
151
  key: 0,
152
152
  class: "fixed inset-0 bg-black/50 backdrop-blur-sm z-40 lg:hidden top-[56px]",
153
153
  style: d({ width: `calc(100vw - ${A.scrollbarWidth}px)` }),
154
- onClick: C(k, ["stop"])
154
+ onClick: O(C, ["stop"])
155
155
  }, null, 4)) : v("", !0),
156
156
  c("div", {
157
- class: f(["fixed top-[56px] left-0 max-w-[90vw] h-[calc(100vh-51px)] bg-white transform transition-transform duration-300 z-40 md:hidden mobile-menu-container", W.value]),
157
+ class: f(["fixed top-[56px] left-0 max-w-[90vw] h-[calc(100vh-51px)] bg-white transform transition-transform duration-300 z-40 md:hidden mobile-menu-container", E.value]),
158
158
  style: { width: "320px" }
159
159
  }, [
160
160
  c("div", oA, [
161
161
  c("div", {
162
162
  class: "flex justify-start px-4 mb-6 cursor-pointer",
163
- onClick: z
163
+ onClick: V
164
164
  }, [
165
165
  F(A.$slots, "mobile-logo", {}, () => [
166
166
  a(L) ? (l(), r("img", {
@@ -173,16 +173,16 @@ const x = [
173
173
  ], !0)
174
174
  ]),
175
175
  c("nav", sA, [
176
- (l(!0), r(Z, null, E(a(H), (e, i) => (l(), r("a", {
176
+ (l(!0), r(M, null, x(a(H), (e, i) => (l(), r("a", {
177
177
  href: "#",
178
178
  key: (e == null ? void 0 : e.value) || i,
179
179
  class: "flex items-center px-4 py-3 rounded-lg transition-colors duration-200",
180
180
  style: d(B.value === i ? { color: "#0052D9" } : {}),
181
181
  onMouseenter: (p) => B.value = i,
182
182
  onMouseleave: s[0] || (s[0] = (p) => B.value = -1),
183
- onClick: C((p) => D(e), ["prevent"])
183
+ onClick: O((p) => S(e), ["prevent"])
184
184
  }, [
185
- c("span", iA, m(e.title), 1)
185
+ c("span", iA, y(e.title), 1)
186
186
  ], 44, aA))), 128))
187
187
  ])
188
188
  ])
@@ -190,7 +190,7 @@ const x = [
190
190
  c("div", {
191
191
  class: "cursor-pointer",
192
192
  style: d({ display: o.value ? "none" : "block" }),
193
- onClick: z
193
+ onClick: V
194
194
  }, [
195
195
  F(A.$slots, "logo", {}, () => [
196
196
  h.value ? (l(), r("img", {
@@ -202,56 +202,56 @@ const x = [
202
202
  ], !0)
203
203
  ], 4),
204
204
  A.showNavigation && a(H).length > 0 ? (l(), r("div", uA, [
205
- (l(!0), r(Z, null, E(a(H), (e, i) => (l(), r("span", {
205
+ (l(!0), r(M, null, x(a(H), (e, i) => (l(), r("span", {
206
206
  class: f([
207
207
  "px-3 md:px-4 text-[14px] relative transition-all duration-300",
208
208
  P.value,
209
209
  J.value
210
210
  ]),
211
- style: d(V.value),
211
+ style: d(z.value),
212
212
  key: e.title || i,
213
- onClick: (p) => D(e)
214
- }, m(e.title), 15, dA))), 128))
213
+ onClick: (p) => S(e)
214
+ }, y(e.title), 15, dA))), 128))
215
215
  ])) : v("", !0)
216
216
  ]),
217
217
  c("div", fA, [
218
218
  F(A.$slots, "user-area", {
219
- loginBtnClass: N.value,
220
- loginBtnStyle: O.value,
221
- handleLogin: M
219
+ loginBtnClass: k.value,
220
+ loginBtnStyle: N.value,
221
+ handleLogin: D
222
222
  }, () => [
223
- A.userInfo && a(x).length > 0 ? (l(), j(a(R), {
223
+ A.userInfo && a(W).length > 0 ? (l(), Y(a(I), {
224
224
  key: 0,
225
225
  placement: "bottom-right",
226
226
  trigger: "hover",
227
- options: a(x),
227
+ options: a(W),
228
228
  onClick: T
229
229
  }, {
230
- default: y(() => [
230
+ default: g(() => [
231
231
  b(a(K), null, {
232
- default: y(() => [
232
+ default: g(() => [
233
233
  b(a(q), {
234
234
  variant: "text",
235
- class: f(N.value),
235
+ class: f(k.value),
236
236
  style: d({
237
237
  border: "0px !important",
238
238
  backgroundColor: "transparent !important",
239
239
  boxShadow: "none",
240
- ...O.value
240
+ ...N.value
241
241
  }),
242
242
  onMouseenter: s[1] || (s[1] = (e) => e.target.style.backgroundColor = "transparent !important"),
243
243
  onMouseleave: s[2] || (s[2] = (e) => e.target.style.backgroundColor = "transparent !important")
244
244
  }, {
245
- suffix: y(() => [
245
+ suffix: g(() => [
246
246
  b(a(_), {
247
247
  name: "chevron-down",
248
248
  size: "16"
249
249
  })
250
250
  ]),
251
- default: y(() => {
251
+ default: g(() => {
252
252
  var e, i;
253
253
  return [
254
- Y(m(((e = A.userInfo) == null ? void 0 : e.name) || ((i = A.userInfo) == null ? void 0 : i.Name) || "我的账号") + " ", 1)
254
+ R(y(((e = A.userInfo) == null ? void 0 : e.name) || ((i = A.userInfo) == null ? void 0 : i.Name) || "我的账号") + " ", 1)
255
255
  ];
256
256
  }),
257
257
  _: 1
@@ -263,27 +263,27 @@ const x = [
263
263
  _: 1
264
264
  }, 8, ["options"])) : A.showLogin ? (l(), r("span", {
265
265
  key: 1,
266
- class: f(["cursor-pointer", N.value]),
267
- style: d(O.value),
268
- onClick: M
269
- }, m(A.loginText), 7)) : v("", !0)
266
+ class: f(["cursor-pointer", k.value]),
267
+ style: d(N.value),
268
+ onClick: D
269
+ }, y(A.loginText), 7)) : v("", !0)
270
270
  ], !0)
271
271
  ])
272
272
  ])
273
273
  ]));
274
274
  }
275
- }), vA = (n, g) => {
275
+ }), vA = (n, m) => {
276
276
  const t = n.__vccOpts || n;
277
- for (const [X, o] of g)
277
+ for (const [X, o] of m)
278
278
  t[X] = o;
279
279
  return t;
280
- }, yA = /* @__PURE__ */ vA(pA, [["__scopeId", "data-v-c8f793e3"]]), gA = () => {
280
+ }, gA = /* @__PURE__ */ vA(pA, [["__scopeId", "data-v-c8f793e3"]]), mA = () => {
281
281
  if (typeof document < "u") {
282
282
  const n = document.createElement("link");
283
283
  n.rel = "stylesheet", n.href = "https://unpkg.com/@junfuhuang/tcamp-components/dist/index.css", document.head.appendChild(n);
284
284
  }
285
285
  };
286
286
  export {
287
- yA as NavigationBar,
288
- gA as importStyles
287
+ gA as NavigationBar,
288
+ mA as importStyles
289
289
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@junfuhuang/tcamp-components",
3
3
  "private": false,
4
- "version": "1.0.20",
4
+ "version": "1.0.22",
5
5
  "description": "TCamp 组件库 - 基于 Vue 3 和 TDesign 的企业级组件库",
6
6
  "keywords": [
7
7
  "vue",