@mxmweb/zui-layouts 1.1.0 → 1.1.2

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/index.js +155 -145
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsx as n, jsxs as k, Fragment as ne } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as k, Fragment as ie } from "react/jsx-runtime";
2
2
  import * as u from "react";
3
- import x, { forwardRef as J, createElement as j } from "react";
3
+ import x, { forwardRef as U, createElement as V } from "react";
4
4
  import s from "styled-components";
5
- import { deepMergeTheme as Q, defaultTheme as z } from "@mxmweb/zui-theme";
6
- import { GoogleNavbar as le, CustomDock as ie } from "@mxmweb/zui-components";
5
+ import { useTheme as E, deepMergeTheme as O, defaultTheme as L } from "@mxmweb/zui-theme";
6
+ import { GoogleNavbar as re, CustomDock as ae } from "@mxmweb/zui-components";
7
7
  /**
8
8
  * React Router v6.30.1
9
9
  *
@@ -14,33 +14,33 @@ import { GoogleNavbar as le, CustomDock as ie } from "@mxmweb/zui-components";
14
14
  *
15
15
  * @license MIT
16
16
  */
17
- const re = /* @__PURE__ */ u.createContext(null);
18
- process.env.NODE_ENV !== "production" && (re.displayName = "DataRouter");
19
- const ae = /* @__PURE__ */ u.createContext(null);
20
- process.env.NODE_ENV !== "production" && (ae.displayName = "DataRouterState");
21
17
  const ce = /* @__PURE__ */ u.createContext(null);
22
- process.env.NODE_ENV !== "production" && (ce.displayName = "Await");
18
+ process.env.NODE_ENV !== "production" && (ce.displayName = "DataRouter");
23
19
  const se = /* @__PURE__ */ u.createContext(null);
24
- process.env.NODE_ENV !== "production" && (se.displayName = "Navigation");
20
+ process.env.NODE_ENV !== "production" && (se.displayName = "DataRouterState");
25
21
  const de = /* @__PURE__ */ u.createContext(null);
26
- process.env.NODE_ENV !== "production" && (de.displayName = "Location");
27
- const U = /* @__PURE__ */ u.createContext({
22
+ process.env.NODE_ENV !== "production" && (de.displayName = "Await");
23
+ const he = /* @__PURE__ */ u.createContext(null);
24
+ process.env.NODE_ENV !== "production" && (he.displayName = "Navigation");
25
+ const fe = /* @__PURE__ */ u.createContext(null);
26
+ process.env.NODE_ENV !== "production" && (fe.displayName = "Location");
27
+ const ee = /* @__PURE__ */ u.createContext({
28
28
  outlet: null,
29
29
  matches: [],
30
30
  isDataRoute: !1
31
31
  });
32
- process.env.NODE_ENV !== "production" && (U.displayName = "Route");
33
- const he = /* @__PURE__ */ u.createContext(null);
34
- process.env.NODE_ENV !== "production" && (he.displayName = "RouteError");
35
- const fe = /* @__PURE__ */ u.createContext(null);
36
- function pe(t) {
37
- let i = u.useContext(U).outlet;
38
- return i && /* @__PURE__ */ u.createElement(fe.Provider, {
32
+ process.env.NODE_ENV !== "production" && (ee.displayName = "Route");
33
+ const pe = /* @__PURE__ */ u.createContext(null);
34
+ process.env.NODE_ENV !== "production" && (pe.displayName = "RouteError");
35
+ const ue = /* @__PURE__ */ u.createContext(null);
36
+ function ge(t) {
37
+ let l = u.useContext(ee).outlet;
38
+ return l && /* @__PURE__ */ u.createElement(ue.Provider, {
39
39
  value: t
40
- }, i);
40
+ }, l);
41
41
  }
42
- function ue(t) {
43
- return pe(t.context);
42
+ function xe(t) {
43
+ return ge(t.context);
44
44
  }
45
45
  new Promise(() => {
46
46
  });
@@ -50,14 +50,14 @@ new Promise(() => {
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
52
  */
53
- const ge = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), E = (...t) => t.filter((i, c, d) => !!i && i.trim() !== "" && d.indexOf(i) === c).join(" ").trim();
53
+ const ke = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (...t) => t.filter((l, c, d) => !!l && l.trim() !== "" && d.indexOf(l) === c).join(" ").trim();
54
54
  /**
55
55
  * @license lucide-react v0.456.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
59
  */
60
- var xe = {
60
+ var Ce = {
61
61
  xmlns: "http://www.w3.org/2000/svg",
62
62
  width: 24,
63
63
  height: 24,
@@ -74,30 +74,30 @@ var xe = {
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
76
  */
77
- const ke = J(
77
+ const we = U(
78
78
  ({
79
79
  color: t = "currentColor",
80
- size: i = 24,
80
+ size: l = 24,
81
81
  strokeWidth: c = 2,
82
82
  absoluteStrokeWidth: d,
83
83
  className: e = "",
84
84
  children: p,
85
- iconNode: D,
86
- ...N
87
- }, $) => j(
85
+ iconNode: N,
86
+ ...$
87
+ }, A) => V(
88
88
  "svg",
89
89
  {
90
- ref: $,
91
- ...xe,
92
- width: i,
93
- height: i,
90
+ ref: A,
91
+ ...Ce,
92
+ width: l,
93
+ height: l,
94
94
  stroke: t,
95
- strokeWidth: d ? Number(c) * 24 / Number(i) : c,
96
- className: E("lucide", e),
97
- ...N
95
+ strokeWidth: d ? Number(c) * 24 / Number(l) : c,
96
+ className: te("lucide", e),
97
+ ...$
98
98
  },
99
99
  [
100
- ...D.map(([a, l]) => j(a, l)),
100
+ ...N.map(([a, i]) => V(a, i)),
101
101
  ...Array.isArray(p) ? p : [p]
102
102
  ]
103
103
  )
@@ -108,12 +108,12 @@ const ke = J(
108
108
  * This source code is licensed under the ISC license.
109
109
  * See the LICENSE file in the root directory of this source tree.
110
110
  */
111
- const ee = (t, i) => {
112
- const c = J(
113
- ({ className: d, ...e }, p) => j(ke, {
111
+ const oe = (t, l) => {
112
+ const c = U(
113
+ ({ className: d, ...e }, p) => V(we, {
114
114
  ref: p,
115
- iconNode: i,
116
- className: E(`lucide-${ge(t)}`, d),
115
+ iconNode: l,
116
+ className: te(`lucide-${ke(t)}`, d),
117
117
  ...e
118
118
  })
119
119
  );
@@ -125,7 +125,7 @@ const ee = (t, i) => {
125
125
  * This source code is licensed under the ISC license.
126
126
  * See the LICENSE file in the root directory of this source tree.
127
127
  */
128
- const Ce = ee("ArrowLeft", [
128
+ const ye = oe("ArrowLeft", [
129
129
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
130
130
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
131
131
  ]);
@@ -135,9 +135,9 @@ const Ce = ee("ArrowLeft", [
135
135
  * This source code is licensed under the ISC license.
136
136
  * See the LICENSE file in the root directory of this source tree.
137
137
  */
138
- const B = ee("ChevronRight", [
138
+ const I = oe("ChevronRight", [
139
139
  ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
140
- ]), we = s.div`
140
+ ]), me = s.div`
141
141
  display: flex;
142
142
  justify-content: flex-start;
143
143
  align-items: flex-start;
@@ -147,7 +147,7 @@ const B = ee("ChevronRight", [
147
147
  width: 100%;
148
148
  max-width: 98%;
149
149
  position: relative;
150
- `, ye = s.div`
150
+ `, ve = s.div`
151
151
  display: flex;
152
152
  height: 38px;
153
153
  z-index: 10;
@@ -158,7 +158,7 @@ const B = ee("ChevronRight", [
158
158
  justify-content: flex-start;
159
159
  width: 100%;
160
160
  min-width: 0; /* 确保 flex 子元素可以收缩 */
161
- `, ve = s.button`
161
+ `, be = s.button`
162
162
  display: flex;
163
163
  align-items: center;
164
164
  justify-content: center;
@@ -184,7 +184,7 @@ const B = ee("ChevronRight", [
184
184
  &:active svg {
185
185
  transform: translateY(0);
186
186
  }
187
- `, me = s.div`
187
+ `, De = s.div`
188
188
  line-height: 1.4;
189
189
  cursor: pointer;
190
190
  transition: color 0.2s ease;
@@ -197,14 +197,14 @@ const B = ee("ChevronRight", [
197
197
  &:hover {
198
198
  color: #007bff;
199
199
  }
200
- `, be = s.div`
200
+ `, Ne = s.div`
201
201
  line-height: 1.4;
202
202
  white-space: nowrap;
203
203
  overflow: hidden;
204
204
  text-overflow: ellipsis;
205
205
  flex: 1;
206
206
  min-width: 0;
207
- `, Z = s.div`
207
+ `, Q = s.div`
208
208
  display: flex;
209
209
  align-items: center;
210
210
  gap: 4px;
@@ -212,7 +212,7 @@ const B = ee("ChevronRight", [
212
212
  max-width: 50%;
213
213
  min-width: 0;
214
214
  overflow: hidden;
215
- `, I = s.div`
215
+ `, S = s.div`
216
216
  display: flex;
217
217
  align-items: center;
218
218
  gap: 4px;
@@ -229,12 +229,12 @@ const B = ee("ChevronRight", [
229
229
  &:hover {
230
230
  color: ${(t) => t.$isLast ? "#007bff" : "inherit"};
231
231
  }
232
- `, S = s.div`
232
+ `, z = s.div`
233
233
  display: flex;
234
234
  align-items: center;
235
235
  color: #6c757d;
236
236
  margin: 0 2px;
237
- `, De = s.div`
237
+ `, $e = s.div`
238
238
  display: flex;
239
239
  flex-direction: column;
240
240
  width: 100%;
@@ -249,60 +249,65 @@ s.div`
249
249
  transform: translateX(-50%);
250
250
  z-index: 1000;
251
251
  `;
252
- const Te = ({
252
+ const Fe = ({
253
253
  children: t,
254
- goBack: i,
254
+ goBack: l,
255
255
  title: c,
256
256
  description: d,
257
257
  breadcrumbs: e,
258
258
  dockItems: p,
259
- dockActiveMode: D = "single",
260
- defaultDockActiveId: N,
261
- defaultDockActiveIds: $,
259
+ dockActiveMode: N = "single",
260
+ defaultDockActiveId: $,
261
+ defaultDockActiveIds: A,
262
262
  styles: a,
263
- eventsEmit: l
263
+ eventsEmit: i
264
264
  }) => {
265
- var V, _, H, G, P, Y, q, K;
266
- const w = Q({ theme: z, mode: "light" }, a), o = (w == null ? void 0 : w.theme) || z, O = x.useRef(null), L = () => {
267
- l != null && l.onGoBack ? l.onGoBack() : i && i();
268
- }, A = () => {
269
- l != null && l.onTitleClick && l.onTitleClick();
270
- }, y = (h, b) => {
271
- l != null && l.onBreadcrumbClick ? l.onBreadcrumbClick(h, b) : h.onClick && h.onClick();
272
- }, g = (h, b) => {
273
- l != null && l.onDockItemClick && l.onDockItemClick(h, b);
265
+ var H, G, P, Y, q, K, X, Z;
266
+ const b = E(), w = O(
267
+ // 基础:默认主题 + useTheme的配置
268
+ O({ theme: L, mode: "light" }, b),
269
+ // 最高层:用户手动传入的styles
270
+ a
271
+ ), o = (w == null ? void 0 : w.theme) || L, W = x.useRef(null), T = () => {
272
+ i != null && i.onGoBack ? i.onGoBack() : l && l();
273
+ }, R = () => {
274
+ i != null && i.onTitleClick && i.onTitleClick();
275
+ }, y = (h, D) => {
276
+ i != null && i.onBreadcrumbClick ? i.onBreadcrumbClick(h, D) : h.onClick && h.onClick();
277
+ }, g = (h, D) => {
278
+ i != null && i.onDockItemClick && i.onDockItemClick(h, D);
274
279
  }, C = () => {
275
280
  if (!e || e.length === 0) return null;
276
- const h = x.useRef(null), [b, W] = x.useState({ start: 0, end: e.length, showEllipsis: !1 }), M = x.useCallback(() => {
281
+ const h = x.useRef(null), [D, M] = x.useState({ start: 0, end: e.length, showEllipsis: !1 }), j = x.useCallback(() => {
277
282
  if (!h.current || e.length <= 3) {
278
- W({ start: 0, end: e.length, showEllipsis: !1 });
283
+ M({ start: 0, end: e.length, showEllipsis: !1 });
279
284
  return;
280
285
  }
281
286
  const f = h.current.offsetWidth * 0.5;
282
- let R = Math.floor((f - 30) / (120 + 20));
283
- if (R < 2 && (R = 2), R >= e.length) {
284
- W({ start: 0, end: e.length, showEllipsis: !1 });
287
+ let B = Math.floor((f - 30) / (120 + 20));
288
+ if (B < 2 && (B = 2), B >= e.length) {
289
+ M({ start: 0, end: e.length, showEllipsis: !1 });
285
290
  return;
286
291
  }
287
- const oe = 0, X = Math.min(R - 1, e.length);
288
- W({
289
- start: oe,
290
- end: X,
291
- showEllipsis: X < e.length - 1
292
+ const le = 0, J = Math.min(B - 1, e.length);
293
+ M({
294
+ start: le,
295
+ end: J,
296
+ showEllipsis: J < e.length - 1
292
297
  });
293
298
  }, [e.length]);
294
299
  if (x.useEffect(() => {
295
- M();
300
+ j();
296
301
  const r = new ResizeObserver(() => {
297
- M();
302
+ j();
298
303
  });
299
304
  return h.current && r.observe(h.current), () => {
300
305
  r.disconnect();
301
306
  };
302
- }, [M]), e.length <= 3)
303
- return /* @__PURE__ */ n(Z, { children: e.map((r, f) => /* @__PURE__ */ k(x.Fragment, { children: [
307
+ }, [j]), e.length <= 3)
308
+ return /* @__PURE__ */ n(Q, { children: e.map((r, f) => /* @__PURE__ */ k(x.Fragment, { children: [
304
309
  /* @__PURE__ */ n(
305
- I,
310
+ S,
306
311
  {
307
312
  $isLast: f === e.length - 1,
308
313
  $isClickable: !!(f < e.length - 1 || r.onClick),
@@ -314,30 +319,30 @@ const Te = ({
314
319
  children: r.label
315
320
  }
316
321
  ),
317
- f < e.length - 1 && /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(B, { size: 14 }) })
322
+ f < e.length - 1 && /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(I, { size: 14 }) })
318
323
  ] }, r.id)) });
319
- const { start: v, end: m, showEllipsis: T } = b;
320
- return /* @__PURE__ */ k(Z, { children: [
321
- e.slice(v, m).map((r, f) => /* @__PURE__ */ k(x.Fragment, { children: [
324
+ const { start: m, end: v, showEllipsis: F } = D;
325
+ return /* @__PURE__ */ k(Q, { children: [
326
+ e.slice(m, v).map((r, f) => /* @__PURE__ */ k(x.Fragment, { children: [
322
327
  /* @__PURE__ */ n(
323
- I,
328
+ S,
324
329
  {
325
- $isLast: f === m - v - 1 && !T,
326
- $isClickable: !!(f < m - v - 1 || r.onClick),
327
- onClick: () => y(r, v + f),
330
+ $isLast: f === v - m - 1 && !F,
331
+ $isClickable: !!(f < v - m - 1 || r.onClick),
332
+ onClick: () => y(r, m + f),
328
333
  style: {
329
- color: f === m - v - 1 && !T ? o.colors.text : o.colors.textSecondary || o.colors.disabledText
334
+ color: f === v - m - 1 && !F ? o.colors.text : o.colors.textSecondary || o.colors.disabledText
330
335
  },
331
336
  title: r.label,
332
337
  children: r.label
333
338
  }
334
339
  ),
335
- f < m - v - 1 && /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(B, { size: 14 }) })
340
+ f < v - m - 1 && /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(I, { size: 14 }) })
336
341
  ] }, r.id)),
337
- T && /* @__PURE__ */ k(ne, { children: [
338
- /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(B, { size: 14 }) }),
342
+ F && /* @__PURE__ */ k(ie, { children: [
343
+ /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(I, { size: 14 }) }),
339
344
  /* @__PURE__ */ n(
340
- I,
345
+ S,
341
346
  {
342
347
  $isLast: !1,
343
348
  $isClickable: !1,
@@ -346,13 +351,13 @@ const Te = ({
346
351
  cursor: "default",
347
352
  maxWidth: "auto"
348
353
  },
349
- title: `${e.slice(m, -1).map((r) => r.label).join(" > ")}`,
354
+ title: `${e.slice(v, -1).map((r) => r.label).join(" > ")}`,
350
355
  children: "..."
351
356
  }
352
357
  ),
353
- /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(B, { size: 14 }) }),
358
+ /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(I, { size: 14 }) }),
354
359
  /* @__PURE__ */ n(
355
- I,
360
+ S,
356
361
  {
357
362
  $isLast: !0,
358
363
  $isClickable: !!e[e.length - 1].onClick,
@@ -366,58 +371,58 @@ const Te = ({
366
371
  )
367
372
  ] })
368
373
  ] });
369
- }, [F, te] = x.useState(!0);
374
+ }, [_, ne] = x.useState(!0);
370
375
  return /* @__PURE__ */ n(
371
- we,
376
+ me,
372
377
  {
373
378
  style: {
374
379
  background: o.colors.appBackground,
375
380
  color: o.colors.text,
376
- fontFamily: ((_ = (V = o.fonts) == null ? void 0 : V.body) == null ? void 0 : _.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
381
+ fontFamily: ((G = (H = o.fonts) == null ? void 0 : H.body) == null ? void 0 : G.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
377
382
  },
378
383
  children: /* @__PURE__ */ k("div", { style: { height: "100%", display: "flex", width: "100%", gap: 12 }, children: [
379
- p && p.length > 0 && /* @__PURE__ */ n("div", { style: { flex: `0 0 ${F ? 72 : 28}px`, transition: "flex-basis .2s ease" }, children: /* @__PURE__ */ n(
380
- le,
384
+ p && p.length > 0 && /* @__PURE__ */ n("div", { style: { flex: `0 0 ${_ ? 72 : 28}px`, transition: "flex-basis .2s ease" }, children: /* @__PURE__ */ n(
385
+ re,
381
386
  {
382
387
  items: p,
383
- open: F,
384
- onOpenChange: te,
388
+ open: _,
389
+ onOpenChange: ne,
385
390
  onItemClick: (h) => g({ id: String(h.key), label: h.name }, 0),
386
391
  defaultOpen: !0
387
392
  }
388
393
  ) }),
389
394
  /* @__PURE__ */ k("div", { style: { display: "flex", flexDirection: "column", flex: 1, minWidth: 0 }, children: [
390
- (c || d || i || e) && /* @__PURE__ */ k(ye, { ref: O, children: [
391
- i && /* @__PURE__ */ n(
392
- ve,
395
+ (c || d || l || e) && /* @__PURE__ */ k(ve, { ref: W, children: [
396
+ l && /* @__PURE__ */ n(
397
+ be,
393
398
  {
394
- onClick: L,
399
+ onClick: T,
395
400
  style: { color: o.colors.primary, borderRadius: o.space.radius || "6px" },
396
401
  title: "\u8FD4\u56DE",
397
- children: /* @__PURE__ */ n(Ce, { size: 18 })
402
+ children: /* @__PURE__ */ n(ye, { size: 18 })
398
403
  }
399
404
  ),
400
405
  C(),
401
406
  c && /* @__PURE__ */ n(
402
- me,
407
+ De,
403
408
  {
404
- onClick: A,
409
+ onClick: R,
405
410
  style: {
406
411
  color: o.colors.text,
407
- fontSize: ((G = (H = o.fonts) == null ? void 0 : H.heading) == null ? void 0 : G.size) || "16px",
408
- fontWeight: ((Y = (P = o.fonts) == null ? void 0 : P.heading) == null ? void 0 : Y.weight) || "600"
412
+ fontSize: ((Y = (P = o.fonts) == null ? void 0 : P.heading) == null ? void 0 : Y.size) || "16px",
413
+ fontWeight: ((K = (q = o.fonts) == null ? void 0 : q.heading) == null ? void 0 : K.weight) || "600"
409
414
  },
410
415
  title: c,
411
416
  children: c
412
417
  }
413
418
  ),
414
419
  d && /* @__PURE__ */ n(
415
- be,
420
+ Ne,
416
421
  {
417
422
  style: {
418
423
  color: o.colors.textSecondary || o.colors.disabledText,
419
424
  opacity: 0.7,
420
- fontSize: ((K = (q = o.fonts) == null ? void 0 : q.body) == null ? void 0 : K.size) || "12px"
425
+ fontSize: ((Z = (X = o.fonts) == null ? void 0 : X.body) == null ? void 0 : Z.size) || "12px"
421
426
  },
422
427
  title: d,
423
428
  children: d
@@ -425,7 +430,7 @@ const Te = ({
425
430
  )
426
431
  ] }),
427
432
  /* @__PURE__ */ n(
428
- De,
433
+ $e,
429
434
  {
430
435
  style: {
431
436
  background: o.colors.dashboardBackground || "transparent",
@@ -433,14 +438,14 @@ const Te = ({
433
438
  borderRadius: o.space.radius || void 0,
434
439
  boxShadow: o.colors.shadow || void 0
435
440
  },
436
- children: t || /* @__PURE__ */ n(ue, {})
441
+ children: t || /* @__PURE__ */ n(xe, {})
437
442
  }
438
443
  )
439
444
  ] })
440
445
  ] })
441
446
  }
442
447
  );
443
- }, Ne = s.div.withConfig({
448
+ }, Ae = s.div.withConfig({
444
449
  shouldForwardProp: (t) => !["backgroundImage", "backgroundColor"].includes(t)
445
450
  })`
446
451
  position: fixed;
@@ -453,7 +458,7 @@ const Te = ({
453
458
  flex-direction: column;
454
459
  overflow: hidden;
455
460
  z-index: 1;
456
- `, $e = s.div`
461
+ `, Re = s.div`
457
462
  height: 48px;
458
463
  width: 100%;
459
464
  display: flex;
@@ -462,7 +467,7 @@ const Te = ({
462
467
  background: transparent;
463
468
  z-index: 10;
464
469
  flex-shrink: 0;
465
- `, Ae = s.div`
470
+ `, Be = s.div`
466
471
  flex: 1;
467
472
  width: 100%;
468
473
  overflow-y: auto;
@@ -489,7 +494,7 @@ const Te = ({
489
494
  &::-webkit-scrollbar-thumb:hover {
490
495
  background: rgba(255, 255, 255, 0.5);
491
496
  }
492
- `, Re = s.div`
497
+ `, Ie = s.div`
493
498
  height: 80px;
494
499
  width: 100%;
495
500
  display: flex;
@@ -499,45 +504,50 @@ const Te = ({
499
504
  background: transparent;
500
505
  z-index: 10;
501
506
  flex-shrink: 0;
502
- `, je = ({
507
+ `, Ve = ({
503
508
  children: t,
504
- backgroundImage: i,
509
+ backgroundImage: l,
505
510
  backgroundColor: c,
506
511
  header: d,
507
512
  dockItems: e,
508
513
  dockActiveMode: p = "single",
509
- defaultDockActiveId: D,
510
- defaultDockActiveIds: N,
511
- styles: $,
514
+ defaultDockActiveId: N,
515
+ defaultDockActiveIds: $,
516
+ styles: A,
512
517
  eventsEmit: a
513
518
  }) => {
514
- var A, y;
515
- const l = Q({ theme: z, mode: "light" }, $), w = (l == null ? void 0 : l.theme) || z, o = (g, C) => {
519
+ var R, y;
520
+ const i = E(), b = O(
521
+ // 基础:默认主题 + useTheme的配置
522
+ O({ theme: L, mode: "light" }, i),
523
+ // 最高层:用户手动传入的styles
524
+ A
525
+ ), w = (b == null ? void 0 : b.theme) || L, o = (g, C) => {
516
526
  a != null && a.onDockItemClick ? a.onDockItemClick(g, C) : g.onClick && g.onClick();
517
- }, O = (g, C) => {
527
+ }, W = (g, C) => {
518
528
  a != null && a.onDockActiveChange && a.onDockActiveChange(g, C);
519
- }, L = (g, C) => {
529
+ }, T = (g, C) => {
520
530
  a != null && a.onDockActiveChangeMultiple && a.onDockActiveChangeMultiple(g, C);
521
531
  };
522
532
  return /* @__PURE__ */ k(
523
- Ne,
533
+ Ae,
524
534
  {
525
- backgroundImage: i,
535
+ backgroundImage: l,
526
536
  backgroundColor: c,
527
537
  children: [
528
- d && /* @__PURE__ */ n($e, { children: d }),
538
+ d && /* @__PURE__ */ n(Re, { children: d }),
529
539
  /* @__PURE__ */ n(
530
- Ae,
540
+ Be,
531
541
  {
532
542
  style: {
533
543
  color: w.colors.text,
534
- fontFamily: ((y = (A = w.fonts) == null ? void 0 : A.body) == null ? void 0 : y.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
544
+ fontFamily: ((y = (R = w.fonts) == null ? void 0 : R.body) == null ? void 0 : y.family) || "PingFang SC, Microsoft YaHei, Arial, sans-serif"
535
545
  },
536
546
  children: t
537
547
  }
538
548
  ),
539
- e && e.length > 0 && /* @__PURE__ */ n(Re, { children: /* @__PURE__ */ n(
540
- ie,
549
+ e && e.length > 0 && /* @__PURE__ */ n(Ie, { children: /* @__PURE__ */ n(
550
+ ae,
541
551
  {
542
552
  items: e,
543
553
  itemWidth: 48,
@@ -545,11 +555,11 @@ const Te = ({
545
555
  magnification: 1.5,
546
556
  itemGap: 8,
547
557
  activeMode: p,
548
- defaultActiveId: D,
549
- defaultActiveIds: N,
558
+ defaultActiveId: N,
559
+ defaultActiveIds: $,
550
560
  onItemClick: o,
551
- onActiveChange: O,
552
- onActiveChangeMultiple: L
561
+ onActiveChange: W,
562
+ onActiveChangeMultiple: T
553
563
  }
554
564
  ) })
555
565
  ]
@@ -557,6 +567,6 @@ const Te = ({
557
567
  );
558
568
  };
559
569
  export {
560
- Te as DashboardContainer,
561
- je as DockContainer
570
+ Fe as DashboardContainer,
571
+ Ve as DockContainer
562
572
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "style": "assets/style.css",
6
6
  "types": "lib_enter.d.ts",
7
7
  "private": false,
8
- "version": "1.1.0",
8
+ "version": "1.1.2",
9
9
  "author": "hanfeng_Zhang",
10
10
  "type": "module",
11
11
  "scripts": {
@@ -24,8 +24,8 @@
24
24
  "@mxmweb/zui-components": "*",
25
25
  "@mxmweb/zui-elements": "*",
26
26
  "@mxmweb/zui-theme": "*",
27
- "react": ">=18",
28
- "react-dom": ">=18",
27
+ "react": ">=18 <20",
28
+ "react-dom": ">=18 <20",
29
29
  "styled-components": "^6"
30
30
  }
31
31
  }