@gx-design-vue/pro-layout 0.1.0-alpha.10 → 0.1.0-alpha.11

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.
@@ -1,6 +1,14 @@
1
1
  import { proGenStyleHooks, setAlpha } from "@gx-design-vue/pro-provider";
2
2
  import { unit as unit$1 } from "@antdv-next/cssinjs";
3
3
  //#region src/components/Menu/style/siderMenu.ts
4
+ function hasActiveBarWidth(activeBarWidth) {
5
+ if (activeBarWidth == null) return false;
6
+ if (typeof activeBarWidth === "number") return activeBarWidth !== 0;
7
+ const width = activeBarWidth.trim();
8
+ if (!width) return false;
9
+ const numericWidth = Number.parseFloat(width);
10
+ return Number.isNaN(numericWidth) || numericWidth !== 0;
11
+ }
4
12
  const prepareComponentToken = (token) => {
5
13
  const { colorPrimary, colorError, colorTextDisabled, colorErrorBg, colorText, colorTextDescription, colorBgContainer, colorFillAlter, colorFillContent, lineWidth, lineWidthBold, controlItemBgActive, colorBgTextHover, controlHeightLG, lineHeight, colorBgElevated, marginXXS, padding, fontSize, controlHeightSM, fontSizeLG, colorTextLightSolid, colorErrorHover } = token;
6
14
  const activeBarWidth = token.activeBarWidth ?? 0;
@@ -77,7 +85,7 @@ const prepareComponentToken = (token) => {
77
85
  darkDangerItemHoverColor: colorErrorHover,
78
86
  darkDangerItemSelectedColor: colorTextLightSolid,
79
87
  darkDangerItemActiveBg: colorError,
80
- itemWidth: activeBarWidth ? `calc(100% + ${activeBarBorderWidth}px)` : `calc(100% - ${itemMarginInline * 2}px)`
88
+ itemWidth: hasActiveBarWidth(activeBarWidth) ? `calc(100% + ${unit$1(activeBarBorderWidth)})` : `calc(100% - ${itemMarginInline * 2}px)`
81
89
  };
82
90
  };
83
91
  /**
@@ -152,7 +160,7 @@ const genSiderMenuStyle = (token) => {
152
160
  marginBlock: siderMenuItemMarginBlock,
153
161
  marginInline: siderMenuItemMarginInline,
154
162
  paddingInlineStart: `calc(${unit$1(siderMenuBasePadding)} + var(--pro-layout-sider-menu-level, 0) * var(--pro-layout-sider-menu-indent, 24px))`,
155
- paddingInlineEnd: siderMenuPaddingWithArrow,
163
+ paddingInlineEnd: siderMenuBasePadding,
156
164
  overflow: "hidden",
157
165
  color: token.siderColorTextMenu || token.itemColor,
158
166
  lineHeight: unit$1(siderMenuItemHeight),
@@ -205,9 +213,11 @@ const genSiderMenuStyle = (token) => {
205
213
  justifyContent: "center",
206
214
  paddingInline: `calc(50% - ${iconSize} / 2 - ${unit$1(siderMenuItemMarginInline)})`,
207
215
  textOverflow: "clip"
208
- }
216
+ },
217
+ "> *": { flex: "none" }
209
218
  },
210
219
  [`${componentCls}-submenu-title`]: {
220
+ paddingInlineEnd: siderMenuPaddingWithArrow,
211
221
  [`&:not(${componentCls}-item-selected):not(${componentCls}-item-active):not(${componentCls}-item-disabled):hover`]: {
212
222
  color: token.siderColorTextMenuItemHover || token.itemHoverColor,
213
223
  backgroundColor: token.siderColorBgMenuItemHover || token.itemHoverBg
@@ -242,7 +252,7 @@ const genSiderMenuStyle = (token) => {
242
252
  fontSize: collapsedIconSize
243
253
  },
244
254
  [`${componentCls}-title`]: {
245
- flex: "1 1 auto",
255
+ flex: "auto",
246
256
  minWidth: 0,
247
257
  overflow: "hidden",
248
258
  textOverflow: "ellipsis",