@apexhub/apex-ui-react-source 1.2.3 → 1.3.1
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/files/AGENTS.md +1 -1
- package/dist/files/alert/llm.txt +1 -1
- package/dist/files/alert/tokens.txt +1 -1
- package/dist/files/apex-provider/llm.txt +1 -1
- package/dist/files/auto-complete/llm.txt +1 -1
- package/dist/files/auto-complete/tokens.txt +1 -1
- package/dist/files/avatar/llm.txt +1 -1
- package/dist/files/avatar/tokens.txt +1 -1
- package/dist/files/breadcrumb/Breadcrumb.stories.css +8 -0
- package/dist/files/breadcrumb/Breadcrumb.tsx +15 -14
- package/dist/files/breadcrumb/breadcrumb.css +6 -19
- package/dist/files/breadcrumb/interface.ts +6 -6
- package/dist/files/breadcrumb/llm.txt +24 -40
- package/dist/files/breadcrumb/tokens.txt +20 -20
- package/dist/files/breadcrumb/variants.ts +4 -9
- package/dist/files/button/llm.txt +1 -1
- package/dist/files/button/tokens.txt +1 -1
- package/dist/files/card/llm.txt +1 -1
- package/dist/files/card/tokens.txt +1 -1
- package/dist/files/cascader/llm.txt +1 -1
- package/dist/files/cascader/tokens.txt +1 -1
- package/dist/files/checkbox/llm.txt +6 -4
- package/dist/files/checkbox/tokens.txt +1 -1
- package/dist/files/collapse/llm.txt +4 -3
- package/dist/files/collapse/tokens.txt +1 -1
- package/dist/files/date-picker/RangePicker.tsx +6 -4
- package/dist/files/date-picker/date-picker-hover.stories.css +21 -0
- package/dist/files/date-picker/date-picker.css +30 -18
- package/dist/files/date-picker/interface.ts +3 -0
- package/dist/files/date-picker/llm.txt +2 -2
- package/dist/files/date-picker/tokens.txt +10 -10
- package/dist/files/divider/llm.txt +1 -1
- package/dist/files/divider/tokens.txt +1 -1
- package/dist/files/drawer/drawer.css +14 -1
- package/dist/files/drawer/llm.txt +1 -1
- package/dist/files/drawer/tokens.txt +3 -2
- package/dist/files/dropdown/llm.txt +1 -1
- package/dist/files/dropdown/tokens.txt +1 -1
- package/dist/files/form/llm.txt +1 -1
- package/dist/files/form/tokens.txt +1 -1
- package/dist/files/grid/llm.txt +2 -2
- package/dist/files/image/llm.txt +1 -1
- package/dist/files/image/tokens.txt +1 -1
- package/dist/files/input/llm.txt +1 -1
- package/dist/files/input/tokens.txt +1 -1
- package/dist/files/input-number/llm.txt +9 -1
- package/dist/files/input-number/tokens.txt +1 -1
- package/dist/files/layout/llm.txt +1 -1
- package/dist/files/layout/tokens.txt +1 -1
- package/dist/files/llms.txt +20 -4
- package/dist/files/menu/llm.txt +1 -3
- package/dist/files/menu/menu.css +2 -1
- package/dist/files/menu/tokens.txt +1 -1
- package/dist/files/message/llm.txt +1 -1
- package/dist/files/message/tokens.txt +1 -1
- package/dist/files/modal/lib/useModal.tsx +2 -1
- package/dist/files/modal/llm.txt +5 -1
- package/dist/files/modal/modal.css +1 -0
- package/dist/files/modal/tokens.txt +1 -1
- package/dist/files/notification/llm.txt +1 -1
- package/dist/files/notification/tokens.txt +1 -1
- package/dist/files/pagination/llm.txt +1 -1
- package/dist/files/pagination/tokens.txt +1 -1
- package/dist/files/popover/llm.txt +1 -1
- package/dist/files/popover/tokens.txt +1 -1
- package/dist/files/progress/llm.txt +2 -6
- package/dist/files/progress/tokens.txt +1 -1
- package/dist/files/radio/llm.txt +1 -1
- package/dist/files/radio/tokens.txt +1 -1
- package/dist/files/rate/llm.txt +1 -1
- package/dist/files/rate/tokens.txt +1 -1
- package/dist/files/select/llm.txt +1 -1
- package/dist/files/select/tokens.txt +1 -1
- package/dist/files/skeleton/llm.txt +1 -1
- package/dist/files/skeleton/tokens.txt +1 -1
- package/dist/files/spin/llm.txt +1 -1
- package/dist/files/spin/tokens.txt +1 -1
- package/dist/files/steps/llm.txt +1 -1
- package/dist/files/steps/steps.css +2 -2
- package/dist/files/steps/tokens.txt +2 -2
- package/dist/files/switch/llm.txt +1 -1
- package/dist/files/switch/tokens.txt +1 -1
- package/dist/files/table/Table.stories.css +16 -0
- package/dist/files/table/interface.ts +1 -1
- package/dist/files/table/llm.txt +6 -2
- package/dist/files/table/parts/TableCell.tsx +8 -2
- package/dist/files/table/table.css +16 -9
- package/dist/files/table/tokens.txt +1 -1
- package/dist/files/tabs/Tabs.tsx +69 -9
- package/dist/files/tabs/TabsOverflow.tsx +138 -0
- package/dist/files/tabs/interface.ts +14 -0
- package/dist/files/tabs/llm.txt +4 -2
- package/dist/files/tabs/overflow-layout.ts +50 -0
- package/dist/files/tabs/tabs-overflow.stories.css +25 -0
- package/dist/files/tabs/tabs.css +114 -17
- package/dist/files/tabs/tokens.txt +5 -1
- package/dist/files/tabs/useTabOverflow.ts +101 -0
- package/dist/files/tag/llm.txt +2 -15
- package/dist/files/tag/tokens.txt +1 -1
- package/dist/files/tooltip/llm.txt +1 -1
- package/dist/files/tooltip/tokens.txt +1 -1
- package/dist/files/tree/llm.txt +1 -1
- package/dist/files/tree/tokens.txt +1 -1
- package/dist/files/tree-select/llm.txt +1 -1
- package/dist/files/tree-select/tokens.txt +1 -1
- package/dist/files/typography/llm.txt +1 -1
- package/dist/files/typography/tokens.txt +1 -1
- package/dist/files/upload/llm.txt +1 -1
- package/dist/files/upload/tokens.txt +1 -1
- package/dist/manifest.json +110 -105
- package/package.json +2 -2
|
@@ -84,7 +84,7 @@ export const RangePicker: React.FC<RangePickerProps> = ({
|
|
|
84
84
|
ref,
|
|
85
85
|
disabledDate,
|
|
86
86
|
placeholder,
|
|
87
|
-
separator = '
|
|
87
|
+
separator = '—',
|
|
88
88
|
presets = EMPTY_PRESETS,
|
|
89
89
|
}) => {
|
|
90
90
|
// ---------- format ----------
|
|
@@ -923,7 +923,6 @@ export const RangePicker: React.FC<RangePickerProps> = ({
|
|
|
923
923
|
|
|
924
924
|
{/* Start trigger */}
|
|
925
925
|
<Trigger
|
|
926
|
-
style={{ display: 'flex', justifyContent: 'center' }}
|
|
927
926
|
ref={startTriggerRef}
|
|
928
927
|
dateValue={displayValue[0]}
|
|
929
928
|
format={resolvedFormat}
|
|
@@ -955,13 +954,16 @@ export const RangePicker: React.FC<RangePickerProps> = ({
|
|
|
955
954
|
/>
|
|
956
955
|
|
|
957
956
|
{/* Separator */}
|
|
958
|
-
<span
|
|
957
|
+
<span
|
|
958
|
+
className="apex-datepicker__separator"
|
|
959
|
+
data-placeholder={!displayValue[0] && !displayValue[1] ? true : undefined}
|
|
960
|
+
aria-hidden="true"
|
|
961
|
+
>
|
|
959
962
|
{separator}
|
|
960
963
|
</span>
|
|
961
964
|
|
|
962
965
|
{/* End trigger */}
|
|
963
966
|
<Trigger
|
|
964
|
-
style={{ display: 'flex', justifyContent: 'center' }}
|
|
965
967
|
dateValue={displayValue[1]}
|
|
966
968
|
format={resolvedFormat}
|
|
967
969
|
placeholder={endPlaceholder}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.apex-datepicker-hover-examples {
|
|
2
|
+
display: grid;
|
|
3
|
+
gap: 24px;
|
|
4
|
+
color: var(--apex-text-neutral-primary);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.apex-datepicker-hover-examples .apex-datepicker.apex-input:is(.apex-default-input, .apex-elevated-input).apex-datepicker-demo-single-wide {
|
|
8
|
+
width: 260px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.apex-datepicker-hover-examples .apex-datepicker.apex-input:is(.apex-default-input, .apex-elevated-input).apex-datepicker-demo-single-threshold {
|
|
12
|
+
width: 128px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.apex-datepicker-hover-examples .apex-datepicker.apex-input:is(.apex-default-input, .apex-elevated-input).apex-datepicker-demo-range-wide {
|
|
16
|
+
width: 380px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.apex-datepicker-hover-examples .apex-datepicker.apex-input:is(.apex-default-input, .apex-elevated-input).apex-datepicker-demo-range-threshold {
|
|
20
|
+
width: 260px;
|
|
21
|
+
}
|
|
@@ -135,31 +135,31 @@
|
|
|
135
135
|
white-space: nowrap;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
.apex-datepicker__value--placeholder {
|
|
138
|
+
:is(.apex-datepicker__value--placeholder, .apex-datepicker__separator[data-placeholder]) {
|
|
139
139
|
color: var(--input-text-placeholder-default);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
.apex-datepicker .apex-input__inner:hover:not([data-disabled]):not([data-readonly])
|
|
143
|
-
.apex-datepicker__value--placeholder {
|
|
143
|
+
:is(.apex-datepicker__value--placeholder, .apex-datepicker__separator[data-placeholder]) {
|
|
144
144
|
color: var(--input-text-placeholder-hover);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
.apex-datepicker .apex-input__inner[data-status='error']:not([data-disabled]):not([data-readonly])
|
|
148
|
-
.apex-datepicker__value--placeholder {
|
|
148
|
+
:is(.apex-datepicker__value--placeholder, .apex-datepicker__separator[data-placeholder]) {
|
|
149
149
|
color: var(--input-text-placeholder-error);
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
.apex-datepicker .apex-input__inner[data-status='loading']:not([data-disabled]):not([data-readonly])
|
|
153
|
-
.apex-datepicker__value--placeholder {
|
|
153
|
+
:is(.apex-datepicker__value--placeholder, .apex-datepicker__separator[data-placeholder]) {
|
|
154
154
|
color: var(--input-text-placeholder-disabled);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
.apex-datepicker .apex-input__inner[data-disabled] .apex-datepicker__value--placeholder {
|
|
157
|
+
.apex-datepicker .apex-input__inner[data-disabled] :is(.apex-datepicker__value--placeholder, .apex-datepicker__separator[data-placeholder]) {
|
|
158
158
|
color: var(--input-text-placeholder-disabled);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
.apex-datepicker .apex-input__inner[data-readonly]:not([data-disabled])
|
|
162
|
-
.apex-datepicker__value--placeholder {
|
|
162
|
+
:is(.apex-datepicker__value--placeholder, .apex-datepicker__separator[data-placeholder]) {
|
|
163
163
|
color: var(--input-text-placeholder-disabled);
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -170,17 +170,6 @@
|
|
|
170
170
|
flex-shrink: 0;
|
|
171
171
|
padding: 0 var(--input-spacing-gap-x);
|
|
172
172
|
user-select: none;
|
|
173
|
-
color: inherit;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.apex-datepicker__separator::before {
|
|
177
|
-
content: '';
|
|
178
|
-
position: absolute;
|
|
179
|
-
inset-block: var(--apex-spacing-6);
|
|
180
|
-
inset-inline-start: 50%;
|
|
181
|
-
width: var(--apex-border-1);
|
|
182
|
-
transform: translateX(-50%);
|
|
183
|
-
background: var(--input-stroke-default);
|
|
184
173
|
}
|
|
185
174
|
|
|
186
175
|
/* Icon 默认渲染 16px,但 DatePicker 槽位应遵循 Input 的 --input-icon-icon。 */
|
|
@@ -249,9 +238,15 @@
|
|
|
249
238
|
display: inline-flex;
|
|
250
239
|
}
|
|
251
240
|
|
|
252
|
-
/*
|
|
241
|
+
/* clear 独立定位,显隐不重新分配两段日期的宽度。 */
|
|
242
|
+
.apex-datepicker--range .apex-datepicker__inner {
|
|
243
|
+
position: relative;
|
|
244
|
+
}
|
|
245
|
+
|
|
253
246
|
.apex-datepicker--range .apex-clear {
|
|
254
247
|
display: inline-flex;
|
|
248
|
+
position: absolute;
|
|
249
|
+
inset-inline-end: var(--input-spacing-padding-x);
|
|
255
250
|
visibility: hidden;
|
|
256
251
|
pointer-events: none;
|
|
257
252
|
}
|
|
@@ -261,6 +256,23 @@
|
|
|
261
256
|
pointer-events: auto;
|
|
262
257
|
}
|
|
263
258
|
|
|
259
|
+
.apex-datepicker--range .apex-datepicker__trigger {
|
|
260
|
+
justify-content: center;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* 按文字自然宽度居中:空间充足时,hover 不改变文字的位置。 */
|
|
264
|
+
.apex-datepicker--range .apex-datepicker__value {
|
|
265
|
+
flex: 0 1 auto;
|
|
266
|
+
max-width: 100%;
|
|
267
|
+
text-align: center;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* 仅出现 clear 时收窄结束日期的可用区域;保持中心锚点,空间不足才省略。 */
|
|
271
|
+
.apex-datepicker--range:hover:not([data-disabled]):not([data-readonly])
|
|
272
|
+
.apex-datepicker__inner:has(> .apex-clear)
|
|
273
|
+
.apex-datepicker__trigger--end .apex-datepicker__value {
|
|
274
|
+
max-width: max(0px, calc(100% - 2 * (var(--clear-size-size, var(--apex-icon-14)) + var(--input-spacing-gap-x))));
|
|
275
|
+
}
|
|
264
276
|
|
|
265
277
|
/* Popover portal shell — above Modal/Drawer (default z-index 1000); align with Select dropdown */
|
|
266
278
|
.apex-datepicker__popup {
|
|
@@ -103,6 +103,9 @@ export interface RangePickerProps extends CommonPickerProps {
|
|
|
103
103
|
/** RangePicker 面板左侧的业务快捷区。 */
|
|
104
104
|
presets?: RangePickerPreset[]
|
|
105
105
|
placeholder?: [string, string]
|
|
106
|
+
/** 起止日期之间的分隔符。
|
|
107
|
+
* @default '—'
|
|
108
|
+
*/
|
|
106
109
|
separator?: ReactNode
|
|
107
110
|
ref?: React.Ref<HTMLDivElement>
|
|
108
111
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> DatePicker:用户需要选择单个日期或日期范围,且精确到日、周、月、季、年等不同粒度时。
|
|
4
4
|
|
|
5
|
-
版本:`1.
|
|
5
|
+
版本:`1.3.1`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`DatePicker`、`RangePicker`。
|
|
8
8
|
|
|
@@ -98,7 +98,7 @@ export default () => (
|
|
|
98
98
|
| disabledDate | — | `DisabledRangeDateFn` | 否 | — |
|
|
99
99
|
| presets | RangePicker 面板左侧的业务快捷区。 | `RangePickerPreset[]` | 否 | — |
|
|
100
100
|
| placeholder | — | `[string, string]` | 否 | — |
|
|
101
|
-
| separator |
|
|
101
|
+
| separator | 起止日期之间的分隔符。 | `ReactNode` | 否 | `'—'` |
|
|
102
102
|
| ref | — | `React.Ref<HTMLDivElement>` | 否 | — |
|
|
103
103
|
|
|
104
104
|
### RangePresetValue
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DatePicker Token 明细
|
|
2
2
|
|
|
3
|
-
包:`@apexhub/apex-ui-react`;版本:`1.
|
|
3
|
+
包:`@apexhub/apex-ui-react`;版本:`1.3.0`(当前源码快照)。
|
|
4
4
|
|
|
5
5
|
按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
|
|
6
6
|
|
|
@@ -117,17 +117,17 @@
|
|
|
117
117
|
| `--input-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-input.apex-md-input` |
|
|
118
118
|
| `--input-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-input.apex-sm-input` |
|
|
119
119
|
| `--input-spacing-char-counter-gap` | `gap` | `var(--apex-spacing-4)` | `.apex-input.apex-textarea-input` |
|
|
120
|
-
| `--input-spacing-gap-x` | `gap`、`min-height`、`padding`、`padding-right`、`padding-top` | `var(--apex-spacing-4)` | `.apex-input.apex-lg-input` |
|
|
121
|
-
| `--input-spacing-gap-x` | `gap`、`min-height`、`padding`、`padding-right`、`padding-top` | `var(--apex-spacing-4)` | `.apex-input.apex-md-input` |
|
|
122
|
-
| `--input-spacing-gap-x` | `gap`、`min-height`、`padding`、`padding-right`、`padding-top` | `var(--apex-spacing-4)` | `.apex-input.apex-sm-input` |
|
|
120
|
+
| `--input-spacing-gap-x` | `gap`、`max-width`、`min-height`、`padding`、`padding-right`、`padding-top` | `var(--apex-spacing-4)` | `.apex-input.apex-lg-input` |
|
|
121
|
+
| `--input-spacing-gap-x` | `gap`、`max-width`、`min-height`、`padding`、`padding-right`、`padding-top` | `var(--apex-spacing-4)` | `.apex-input.apex-md-input` |
|
|
122
|
+
| `--input-spacing-gap-x` | `gap`、`max-width`、`min-height`、`padding`、`padding-right`、`padding-top` | `var(--apex-spacing-4)` | `.apex-input.apex-sm-input` |
|
|
123
123
|
| `--input-spacing-height` | `height`、`min-height`、`padding-top` | `var(--apex-size-44)` | `.apex-input.apex-lg-input` |
|
|
124
124
|
| `--input-spacing-height` | `height`、`min-height`、`padding-top` | `var(--apex-size-32)` | `.apex-input.apex-md-input` |
|
|
125
125
|
| `--input-spacing-height` | `height`、`min-height`、`padding-top` | `var(--apex-size-24)` | `.apex-input.apex-sm-input` |
|
|
126
126
|
| `--input-spacing-height-max` | `max-height` | `var(--apex-size-130)` | `.apex-input.apex-textarea-input` |
|
|
127
|
-
| `--input-spacing-padding-x` | `padding-inline`、`width` | `var(--apex-spacing-12)` | `.apex-input.apex-lg-input` |
|
|
128
|
-
| `--input-spacing-padding-x` | `padding-inline`、`width` | `var(--apex-spacing-12)` | `.apex-input.apex-md-input` |
|
|
129
|
-
| `--input-spacing-padding-x` | `padding-inline`、`width` | `var(--apex-spacing-8)` | `.apex-input.apex-sm-input` |
|
|
130
|
-
| `--input-spacing-padding-x` | `padding-inline`、`width` | `var(--apex-spacing-12)` | `.apex-input.apex-textarea-input` |
|
|
127
|
+
| `--input-spacing-padding-x` | `inset-inline-end`、`padding-inline`、`width` | `var(--apex-spacing-12)` | `.apex-input.apex-lg-input` |
|
|
128
|
+
| `--input-spacing-padding-x` | `inset-inline-end`、`padding-inline`、`width` | `var(--apex-spacing-12)` | `.apex-input.apex-md-input` |
|
|
129
|
+
| `--input-spacing-padding-x` | `inset-inline-end`、`padding-inline`、`width` | `var(--apex-spacing-8)` | `.apex-input.apex-sm-input` |
|
|
130
|
+
| `--input-spacing-padding-x` | `inset-inline-end`、`padding-inline`、`width` | `var(--apex-spacing-12)` | `.apex-input.apex-textarea-input` |
|
|
131
131
|
| `--input-spacing-padding-y` | `padding-block` | `var(--apex-spacing-12)` | `.apex-input.apex-lg-input` |
|
|
132
132
|
| `--input-spacing-padding-y` | `padding-block` | `var(--apex-spacing-6)` | `.apex-input.apex-md-input` |
|
|
133
133
|
| `--input-spacing-padding-y` | `padding-block` | `var(--apex-spacing-4)` | `.apex-input.apex-sm-input` |
|
|
@@ -135,8 +135,8 @@
|
|
|
135
135
|
| `--input-spacing-width-min` | `min-width`、`width` | `var(--apex-size-120)` | `.apex-input.apex-lg-input` |
|
|
136
136
|
| `--input-spacing-width-min` | `min-width`、`width` | `var(--apex-size-120)` | `.apex-input.apex-md-input` |
|
|
137
137
|
| `--input-spacing-width-min` | `min-width`、`width` | `var(--apex-size-120)` | `.apex-input.apex-sm-input` |
|
|
138
|
-
| `--input-stroke-default` | `
|
|
139
|
-
| `--input-stroke-default` | `
|
|
138
|
+
| `--input-stroke-default` | `border-color` | `var(--apex-stroke-neutral-quaternary)` | `.apex-input.apex-default-input` |
|
|
139
|
+
| `--input-stroke-default` | `border-color` | `var(--apex-stroke-neutral-quaternary)` | `.apex-input.apex-elevated-input` |
|
|
140
140
|
| `--input-stroke-disabled` | `border-color` | `var(--apex-stroke-neutral-quaternary)` | `.apex-input.apex-default-input` |
|
|
141
141
|
| `--input-stroke-disabled` | `border-color` | `var(--apex-stroke-neutral-quaternary)` | `.apex-input.apex-elevated-input` |
|
|
142
142
|
| `--input-stroke-error` | `border-color` | `var(--apex-stroke-error-primary)` | `.apex-input.apex-default-input` |
|
|
@@ -86,11 +86,23 @@
|
|
|
86
86
|
animation: apex-drawer-slide-out-left 0.15s ease forwards;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/* 标题行下方始终保留 16px,换行或带副标题时随内容增高。
|
|
90
|
+
最小高度保留标题区尺寸 Token,分隔线贴合下内边距末端。 */
|
|
89
91
|
.apex-drawer__header {
|
|
90
92
|
display: flex;
|
|
91
93
|
flex-shrink: 0;
|
|
92
|
-
align-items:
|
|
94
|
+
align-items: flex-start;
|
|
93
95
|
justify-content: space-between;
|
|
96
|
+
box-sizing: border-box;
|
|
97
|
+
min-height: var(--drawer-spacing-header);
|
|
98
|
+
padding-block-end: var(--drawer-spacing-padding);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* 标题区分隔线贴合 header 底边,不再叠加 Divider 自带的 8 间距。
|
|
102
|
+
`>` 只命中 header 下方的分隔线,footer 内的分隔线不受影响;
|
|
103
|
+
三类选择器确保压过 component-tokens 里 `.apex-divider.apex-primary-divider` 的定义。 */
|
|
104
|
+
.apex-drawer > .apex-divider[data-slot='divider'] {
|
|
105
|
+
--divider-spacing-gap: 0px;
|
|
94
106
|
}
|
|
95
107
|
|
|
96
108
|
.apex-drawer__title {
|
|
@@ -126,6 +138,7 @@
|
|
|
126
138
|
min-height: 0;
|
|
127
139
|
overflow-x: hidden;
|
|
128
140
|
overflow-y: auto;
|
|
141
|
+
scrollbar-gutter: stable;
|
|
129
142
|
box-sizing: border-box;
|
|
130
143
|
padding-block-start: var(--drawer-spacing-padding);
|
|
131
144
|
margin-inline-end: calc((var(--drawer-spacing-padding) - var(--drawer-scrollbar-inset)) * -1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Drawer Token 明细
|
|
2
2
|
|
|
3
|
-
包:`@apexhub/apex-ui-react`;版本:`1.
|
|
3
|
+
包:`@apexhub/apex-ui-react`;版本:`1.3.0`(当前源码快照)。
|
|
4
4
|
|
|
5
5
|
按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
|
|
6
6
|
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
| `--drawer-icon-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-drawer.apex-default-drawer` |
|
|
16
16
|
| `--drawer-icon-hover` | `color` | `var(--apex-icon-neutral-secondary)` | `.apex-drawer.apex-default-drawer` |
|
|
17
17
|
| `--drawer-radius-radius` | `border-radius` | `var(--apex-radius-12)` | `.apex-drawer.apex-default-drawer` |
|
|
18
|
+
| `--drawer-spacing-header` | `min-height` | `var(--apex-size-40)` | `.apex-drawer.apex-default-drawer` |
|
|
18
19
|
| `--drawer-spacing-margin` | `height`、`margin`、`max-height` | `var(--apex-spacing-8)` | `.apex-drawer.apex-default-drawer` |
|
|
19
|
-
| `--drawer-spacing-padding` | `margin-inline-end`、`padding`、`padding-block-start`、`padding-inline-end` | `var(--apex-spacing-16)` | `.apex-drawer.apex-default-drawer` |
|
|
20
|
+
| `--drawer-spacing-padding` | `margin-inline-end`、`padding`、`padding-block-end`、`padding-block-start`、`padding-inline-end` | `var(--apex-spacing-16)` | `.apex-drawer.apex-default-drawer` |
|
|
20
21
|
| `--drawer-spacing-width` | `width` | `var(--apex-size-800)` | `.apex-drawer.apex-default-drawer` |
|
|
21
22
|
| `--drawer-stroke-default` | `border` | `var(--apex-stroke-neutral-quinary)` | `.apex-drawer.apex-default-drawer` |
|
|
22
23
|
| `--drawer-stroke-stroke` | `border` | `var(--apex-border-1)` | `.apex-drawer.apex-default-drawer` |
|
package/dist/files/form/llm.txt
CHANGED
package/dist/files/grid/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Grid:页面区块需要按 24 栅格划分宽度与响应式列数时。
|
|
4
4
|
|
|
5
|
-
版本:`1.
|
|
5
|
+
版本:`1.3.1`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`Col`、`Row`、`useBreakpoint`。
|
|
8
8
|
|
|
@@ -288,7 +288,7 @@ export default () => (
|
|
|
288
288
|
{justifies.map((justify) => (
|
|
289
289
|
<Row key={justify} justify="end" style={{ width: '100%' }}>
|
|
290
290
|
<Divider titlePlacement="start" style={{ margin: '16px 0' }}>
|
|
291
|
-
<Typography.Text
|
|
291
|
+
<Typography.Text type="secondary">
|
|
292
292
|
{justify[0].toUpperCase() + justify.slice(1)}
|
|
293
293
|
</Typography.Text>
|
|
294
294
|
</Divider>
|
package/dist/files/image/llm.txt
CHANGED
package/dist/files/input/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> InputNumber:需要录入有上下界的数值,并支持步进增减时。
|
|
4
4
|
|
|
5
|
-
版本:`1.
|
|
5
|
+
版本:`1.3.1`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`InputNumber`。
|
|
8
8
|
|
|
@@ -484,6 +484,14 @@ export default () => (
|
|
|
484
484
|
|
|
485
485
|
## FAQ
|
|
486
486
|
|
|
487
|
+
### 为什么 InputNumber 没有撑满表单栅格?
|
|
488
|
+
|
|
489
|
+
InputNumber 默认固定宽度为 `120px`,放进表单栅格也不会自动撑满。需要占满一格时,传 `style={{ width: '100%' }}`。
|
|
490
|
+
|
|
491
|
+
### 为什么清空 InputNumber 后显示为 0?
|
|
492
|
+
|
|
493
|
+
空值传给 `formatter` 的是 `''`,此时应原样返回 `''`。不要直接把空字符串转成数字再格式化,否则空值会显示成 `0`。
|
|
494
|
+
|
|
487
495
|
### `changeOnBlur` 为 true 时,为什么输入过程中 `onChange` 不触发?
|
|
488
496
|
|
|
489
497
|
默认在失焦时再 `onChange` 并按 `min` / `max` / `precision` 校正,避免输入中途被格式化打断。需要即时回调可设 `changeOnBlur={false}`。
|
package/dist/files/llms.txt
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
每个组件一段:用途和最小写法。要用更多属性时,读对应目录的 llm.txt,按属性名搜索。
|
|
4
4
|
|
|
5
|
-
写之前先看 skill 的 references/pitfalls.md:这些 API 像 antd 但不是 antd。
|
|
6
|
-
|
|
7
5
|
## Alert (`alert`)
|
|
8
6
|
|
|
9
7
|
Alert:需要在当前页面内展示操作结果、风险提示或补充说明,且信息应持续可见时。
|
|
@@ -75,9 +73,9 @@ import type { BreadcrumbItemType } from '@/components/apex/breadcrumb'
|
|
|
75
73
|
import { Breadcrumb, BreadcrumbSeparatorIcon } from '@/components/apex/breadcrumb'
|
|
76
74
|
|
|
77
75
|
const items: BreadcrumbItemType[] = [
|
|
78
|
-
{ type: 'section', title: '
|
|
76
|
+
{ type: 'section', title: '项目管理' },
|
|
79
77
|
{ title: 'Button', href: '/components/button' },
|
|
80
|
-
{ title: 'Breadcrumb' },
|
|
78
|
+
{ title: 'Breadcrumb', href: '/components/breadcrumb' },
|
|
81
79
|
]
|
|
82
80
|
|
|
83
81
|
export default () => <Breadcrumb items={items} separator={<BreadcrumbSeparatorIcon />} />
|
|
@@ -900,3 +898,21 @@ const uploadDemoCustomRequest: NonNullable<UploadProps['customRequest']> = ({
|
|
|
900
898
|
|
|
901
899
|
export default () => <Upload customRequest={uploadDemoCustomRequest} listType="text" />
|
|
902
900
|
```
|
|
901
|
+
|
|
902
|
+
## 没有的组件和替代做法
|
|
903
|
+
|
|
904
|
+
以下组件未提供,请使用表中的替代做法。不要为这些组件另装其他 UI 组件库。
|
|
905
|
+
|
|
906
|
+
| 没有的组件 | 替代做法 |
|
|
907
|
+
| --- | --- |
|
|
908
|
+
| Space | 用 flex 容器加 `gap`,或用 Grid 提供的 `Row` / `Col`。 |
|
|
909
|
+
| Empty | 表格用 `Table` 自带的空状态,其他地方用 `Typography` 写一行说明。 |
|
|
910
|
+
| Badge | 用 `Tag`。 |
|
|
911
|
+
| Popconfirm | 用 `Modal.useModal()` 返回的 `modal.confirm()`,并在组件树中渲染 `contextHolder`。 |
|
|
912
|
+
| Descriptions | 用 `Row` / `Col` 加 `Typography`。 |
|
|
913
|
+
| Statistic | 用 `Card` 加 `Typography`。 |
|
|
914
|
+
| Result | 用 `Alert`,或用 `Typography` 加 `Button`。 |
|
|
915
|
+
| List | 用 `Table`,或用 `Card` 加 flex 布局。 |
|
|
916
|
+
| Segmented | 用 `RadioGroup` 或 `Tabs`。 |
|
|
917
|
+
| Slider | 用 `InputNumber`。 |
|
|
918
|
+
| Timeline | 没有替代组件。不要另装组件库;先把页面其余部分做完,再问用户要不要在项目里用现有组件组合一个。 |
|
package/dist/files/menu/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Menu:侧栏持久导航,需要在图标 rail 与展开列表之间切换时。
|
|
4
4
|
|
|
5
|
-
版本:`1.
|
|
5
|
+
版本:`1.3.1`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`isKeySelected`、`Menu`。
|
|
8
8
|
|
|
@@ -553,7 +553,6 @@ export default () => {
|
|
|
553
553
|
collapsed ? (
|
|
554
554
|
<div
|
|
555
555
|
style={{
|
|
556
|
-
fontSize: 12,
|
|
557
556
|
opacity: 0.7,
|
|
558
557
|
display: 'flex',
|
|
559
558
|
justifyContent: 'center',
|
|
@@ -578,7 +577,6 @@ export default () => {
|
|
|
578
577
|
) : (
|
|
579
578
|
<div
|
|
580
579
|
style={{
|
|
581
|
-
fontSize: 12,
|
|
582
580
|
opacity: 0.7,
|
|
583
581
|
display: 'flex',
|
|
584
582
|
justifyContent: 'start',
|
package/dist/files/menu/menu.css
CHANGED
|
@@ -456,13 +456,14 @@
|
|
|
456
456
|
list-style: none;
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
+
/* Guide line between a parent item and its inline children. */
|
|
459
460
|
.apex-menu .apex-menu__submenu > .apex-menu__sublist::before {
|
|
460
461
|
content: '';
|
|
461
462
|
position: absolute;
|
|
462
463
|
inset-block: 0;
|
|
463
464
|
inset-inline-start: 0;
|
|
464
465
|
width: var(--menu-stroke-stroke);
|
|
465
|
-
background-color: var(--menu-
|
|
466
|
+
background-color: var(--menu-stroke-container-default);
|
|
466
467
|
pointer-events: none;
|
|
467
468
|
}
|
|
468
469
|
|
|
@@ -73,6 +73,7 @@ HookModal.displayName = 'ApexHookModal'
|
|
|
73
73
|
*/
|
|
74
74
|
export function useModal(): [ModalHookApi, React.ReactElement] {
|
|
75
75
|
const [elements, patchElement] = usePatchElement()
|
|
76
|
+
const holderKey = React.useId()
|
|
76
77
|
const uuidRef = React.useRef(0)
|
|
77
78
|
|
|
78
79
|
const getConfirmFunc = React.useCallback(
|
|
@@ -124,7 +125,7 @@ export function useModal(): [ModalHookApi, React.ReactElement] {
|
|
|
124
125
|
[getConfirmFunc],
|
|
125
126
|
)
|
|
126
127
|
|
|
127
|
-
const contextHolder = <React.Fragment key=
|
|
128
|
+
const contextHolder = <React.Fragment key={holderKey}>{elements}</React.Fragment>
|
|
128
129
|
|
|
129
130
|
return [api, contextHolder]
|
|
130
131
|
}
|
package/dist/files/modal/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Modal:需要用户阅读并确认、取消或提交,且应暂时阻断当前页面操作时。
|
|
4
4
|
|
|
5
|
-
版本:`1.
|
|
5
|
+
版本:`1.3.1`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`Modal`。
|
|
8
8
|
|
|
@@ -577,6 +577,10 @@ export default () => {
|
|
|
577
577
|
|
|
578
578
|
声明式 `<Modal>` 是受控组件,须在 `onCancel` / `onOk` 中将 `open` 设为 `false`。命令式 API 会在回调 `resolve` 或调用 `close()` 后自动关闭。
|
|
579
579
|
|
|
580
|
+
### 声明式 Modal 关闭时怎么执行业务逻辑或重置内容?
|
|
581
|
+
|
|
582
|
+
不要给声明式 `<Modal>` 传 `afterClose`,它只属于 `Modal.confirm` 等命令式方法的参数。关闭后要执行的业务逻辑放在 `onOk` / `onCancel` 中,需要重置内容时用条件渲染 `{open && <Modal ...>}`,在关闭时卸载弹窗。
|
|
583
|
+
|
|
580
584
|
### 路由切换时如何关闭所有命令式弹窗?
|
|
581
585
|
|
|
582
586
|
调用 `Modal.destroyAll()` 可一次性关闭全部 `Modal.info` / `confirm` 等命令式弹窗,适合路由跳转前清理残留浮层。
|
|
@@ -156,6 +156,7 @@
|
|
|
156
156
|
gap: var(--modal-spacing-gap-body, var(--apex-spacing-8));
|
|
157
157
|
color: var(--modal-text-body-default);
|
|
158
158
|
overflow-y: auto;
|
|
159
|
+
scrollbar-gutter: stable;
|
|
159
160
|
box-sizing: border-box;
|
|
160
161
|
margin-inline-end: calc(
|
|
161
162
|
(var(--modal-spacing-padding-x) - var(--modal-scrollbar-inset)) * -1
|