@greypan/web-ui 3.0.1 → 4.0.0
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/README.CN.md +292 -31
- package/README.md +294 -31
- package/dist/_virtual/{_@oxc-project_runtime@0.140.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/decorate.js +1 -1
- package/dist/assets/glass.js +1 -1
- package/dist/assets/glass.js.map +1 -1
- package/dist/assets/menu-portal.js +1 -1
- package/dist/assets/menu-portal.js.map +1 -1
- package/dist/assets/overlay-motion.js +1 -1
- package/dist/assets/overlay-motion.js.map +1 -1
- package/dist/assets/toast-containers.js +1 -1
- package/dist/assets/toast-containers.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +4 -12
- package/dist/components/autocomplete/index.js +95 -102
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/autocomplete/style.js +1 -1
- package/dist/components/autocomplete/style.js.map +1 -1
- package/dist/components/avatar/index.d.ts +0 -1
- package/dist/components/avatar/index.js +8 -13
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/back-top/index.js +1 -1
- package/dist/components/back-top/style.js +1 -1
- package/dist/components/back-top/style.js.map +1 -1
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/index.js +12 -14
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +51 -38
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/style.js +1 -1
- package/dist/components/button/style.js.map +1 -1
- package/dist/components/button-group/index.d.ts +1 -2
- package/dist/components/button-group/index.js +19 -23
- package/dist/components/button-group/index.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +4 -7
- package/dist/components/checkbox/index.js +48 -37
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/style.js +1 -1
- package/dist/components/checkbox/style.js.map +1 -1
- package/dist/components/checkbox-group/index.d.ts +4 -10
- package/dist/components/checkbox-group/index.js +74 -60
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/context-menu/index.js +7 -8
- package/dist/components/context-menu/index.js.map +1 -1
- package/dist/components/dialog/index.js +6 -6
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/style.js +1 -1
- package/dist/components/dialog/style.js.map +1 -1
- package/dist/components/drawer/index.d.ts +15 -0
- package/dist/components/drawer/index.js +58 -34
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/style.js +1 -1
- package/dist/components/drawer/style.js.map +1 -1
- package/dist/components/dropdown/index.js +1 -1
- package/dist/components/dropdown-divider/index.js +1 -1
- package/dist/components/dropdown-header/index.js +1 -1
- package/dist/components/dropdown-header/style.js +1 -1
- package/dist/components/dropdown-header/style.js.map +1 -1
- package/dist/components/dropdown-item/index.js +3 -2
- package/dist/components/dropdown-item/index.js.map +1 -1
- package/dist/components/empty/index.js +1 -1
- package/dist/components/empty/style.js +1 -1
- package/dist/components/empty/style.js.map +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/index.js +9 -9
- package/dist/components/input/index.d.ts +2 -3
- package/dist/components/input/index.js +62 -52
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/style.js +1 -1
- package/dist/components/input/style.js.map +1 -1
- package/dist/components/input-number/index.d.ts +2 -3
- package/dist/components/input-number/index.js +58 -38
- package/dist/components/input-number/index.js.map +1 -1
- package/dist/components/input-number/style.js +1 -1
- package/dist/components/input-number/style.js.map +1 -1
- package/dist/components/layout/index.d.ts +53 -3
- package/dist/components/layout/index.js +146 -39
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/style.js +1 -1
- package/dist/components/layout/style.js.map +1 -1
- package/dist/components/option/index.js +1 -1
- package/dist/components/option/style.js +1 -1
- package/dist/components/option/style.js.map +1 -1
- package/dist/components/popover/index.js +7 -5
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/style.js +1 -1
- package/dist/components/popover/style.js.map +1 -1
- package/dist/components/radio/index.d.ts +4 -7
- package/dist/components/radio/index.js +48 -37
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/style.js +1 -1
- package/dist/components/radio/style.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +4 -10
- package/dist/components/radio-group/index.js +70 -52
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/segmented/index.d.ts +6 -11
- package/dist/components/segmented/index.js +67 -55
- package/dist/components/segmented/index.js.map +1 -1
- package/dist/components/segmented/style.js +1 -1
- package/dist/components/segmented/style.js.map +1 -1
- package/dist/components/segmented-trigger/index.d.ts +1 -2
- package/dist/components/segmented-trigger/index.js +18 -19
- package/dist/components/segmented-trigger/index.js.map +1 -1
- package/dist/components/segmented-trigger/style.js +1 -1
- package/dist/components/segmented-trigger/style.js.map +1 -1
- package/dist/components/select/index.d.ts +13 -8
- package/dist/components/select/index.js +110 -75
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/select/style.js +1 -1
- package/dist/components/select/style.js.map +1 -1
- package/dist/components/slider/index.d.ts +3 -5
- package/dist/components/slider/index.js +59 -42
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/style.js +1 -1
- package/dist/components/slider/style.js.map +1 -1
- package/dist/components/spinner/index.d.ts +0 -2
- package/dist/components/spinner/index.js +14 -13
- package/dist/components/spinner/index.js.map +1 -1
- package/dist/components/spinner/style.js +1 -1
- package/dist/components/spinner/style.js.map +1 -1
- package/dist/components/svg-draw-lines/index.js +1 -1
- package/dist/components/switch/index.d.ts +5 -6
- package/dist/components/switch/index.js +51 -37
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/style.js +1 -1
- package/dist/components/switch/style.js.map +1 -1
- package/dist/components/textarea/index.d.ts +5 -6
- package/dist/components/textarea/index.js +73 -63
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/textarea/style.js +1 -1
- package/dist/components/textarea/style.js.map +1 -1
- package/dist/components/theme/index.js +1 -1
- package/dist/components/theme/style.js +1 -1
- package/dist/components/theme/style.js.map +1 -1
- package/dist/components/toast/style.js +1 -1
- package/dist/components/toast/style.js.map +1 -1
- package/dist/components/toast/toast.js +12 -12
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/style.js +1 -1
- package/dist/components/tooltip/style.js.map +1 -1
- package/dist/icons/generated/lucide-clapperboard.d.ts +6 -0
- package/dist/icons/generated/lucide-clapperboard.js +10 -0
- package/dist/icons/generated/lucide-clapperboard.js.map +1 -0
- package/dist/icons/generated/lucide-eye.d.ts +6 -0
- package/dist/icons/generated/lucide-eye.js +10 -0
- package/dist/icons/generated/lucide-eye.js.map +1 -0
- package/dist/icons/generated/lucide-headphones.d.ts +6 -0
- package/dist/icons/generated/lucide-headphones.js +10 -0
- package/dist/icons/generated/lucide-headphones.js.map +1 -0
- package/dist/icons/generated/lucide-link.d.ts +6 -0
- package/dist/icons/generated/lucide-link.js +10 -0
- package/dist/icons/generated/lucide-link.js.map +1 -0
- package/dist/icons/generated/lucide-pen-line.d.ts +6 -0
- package/dist/icons/generated/lucide-pen-line.js +10 -0
- package/dist/icons/generated/lucide-pen-line.js.map +1 -0
- package/dist/icons/generated/lucide-play.d.ts +6 -0
- package/dist/icons/generated/lucide-play.js +10 -0
- package/dist/icons/generated/lucide-play.js.map +1 -0
- package/dist/icons/generated/lucide-sliders-horizontal.d.ts +6 -0
- package/dist/icons/generated/lucide-sliders-horizontal.js +10 -0
- package/dist/icons/generated/lucide-sliders-horizontal.js.map +1 -0
- package/dist/icons/index.d.ts +7 -0
- package/dist/icons/index.js +8 -1
- package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js +1 -3
- package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -1
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +2 -1
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -1
- package/dist/shared/events/user-change.js.map +1 -1
- package/dist/shared/form-association/index.js +41 -0
- package/dist/shared/form-association/index.js.map +1 -0
- package/dist/shared/group-management/index.js +109 -0
- package/dist/shared/group-management/index.js.map +1 -0
- package/dist/shared/menu-portal/menu-tree.js +20 -7
- package/dist/shared/menu-portal/menu-tree.js.map +1 -1
- package/dist/shared/option-portal/index.js +65 -0
- package/dist/shared/option-portal/index.js.map +1 -0
- package/dist/shared/overlay/overlay.js +1 -1
- package/dist/shared/overlay/overlay.js.map +1 -1
- package/dist/shared/overlay/portal.js +9 -6
- package/dist/shared/overlay/portal.js.map +1 -1
- package/dist/shared/overlay/presence.js.map +1 -1
- package/dist/shared/visible-area/index.js +69 -0
- package/dist/shared/visible-area/index.js.map +1 -0
- package/package.json +6 -4
package/README.CN.md
CHANGED
|
@@ -31,6 +31,29 @@ import '@greypan/web-ui'
|
|
|
31
31
|
|
|
32
32
|
## 框架集成
|
|
33
33
|
|
|
34
|
+
### 跨框架 API 约定
|
|
35
|
+
|
|
36
|
+
`web-ui-*` 元素暴露三面 API,**DOM / JavaScript API 是事实来源**:Property 使用 camelCase,Attribute 使用
|
|
37
|
+
kebab-case,Event 使用 kebab-case。
|
|
38
|
+
|
|
39
|
+
| 表面 | 命名 | 示例 |
|
|
40
|
+
| --------- | ---------- | --------------------------------------------- |
|
|
41
|
+
| Property | camelCase | `open`、`sidebarCollapsed`、`noScrollLock` |
|
|
42
|
+
| Attribute | kebab-case | `open`、`sidebar-collapsed`、`no-scroll-lock` |
|
|
43
|
+
| Event | kebab-case | `open-change`、`sidebar-collapsed-change` |
|
|
44
|
+
|
|
45
|
+
- **布尔 Attribute** 遵循原生 HTML 存在语义:不存在 → `false`,存在 → `true`。框架绑定写入的
|
|
46
|
+
`disabled="false"` 是字符串 `"false"`,会被视为 true——**动态布尔必须绑定 Property**(camelCase),
|
|
47
|
+
才能把 `false` 写成真实 property。
|
|
48
|
+
- **Vue**:动态绑定必须走 **Property**,使用 camelCase 属性名(`:sidebarCollapsed="x"`、`:open="x"`)。
|
|
49
|
+
kebab-case 绑定(`:sidebar-collapsed="x"`)会被写成字符串 attribute,无法表达 `false`,请使用 camelCase
|
|
50
|
+
property。`.prop` 修饰符只在 camelCase 属性名下有效(`:sidebarCollapsed.prop="x"`)。String/Number 值可
|
|
51
|
+
保留 kebab-case attribute(`:max-height="120"`)。带值控件(`web-ui-input`、`web-ui-select`、
|
|
52
|
+
`web-ui-autocomplete` 等)支持 `v-model`,编译为元素的 `value` property + `input` 事件。
|
|
53
|
+
- **React**:React 19 对 custom element 的 props 直接写 DOM property,因此使用 camelCase props
|
|
54
|
+
(`open={open}`、`noScrollLock`、`value={value}`)。**不要把复杂数据(对象、数组)放进 attribute 字符串**,
|
|
55
|
+
一律绑定为 property。kebab-case JSX prop 在 custom element 上会写成 attribute。
|
|
56
|
+
|
|
34
57
|
### React
|
|
35
58
|
|
|
36
59
|
需要 `@types/react >= 19` 作为可选 peer 依赖。
|
|
@@ -127,6 +150,20 @@ import '@greypan/web-ui/types/vue'
|
|
|
127
150
|
</template>
|
|
128
151
|
```
|
|
129
152
|
|
|
153
|
+
Boolean 属性必须用 **camelCase 属性名**绑定,而不是 kebab-case attribute。Vue 会把 attribute 绑定写成字符串,
|
|
154
|
+
而布尔 attribute 遵循「存在即 true」的语义——所以 `:sidebar-collapsed="false"` 会写出字符串 `"false"`,被当作 true。
|
|
155
|
+
改用 camelCase 属性名(`:sidebarCollapsed="false"`,或 `.prop` 修饰符)会让 Vue 直接写 DOM property:
|
|
156
|
+
|
|
157
|
+
```vue
|
|
158
|
+
<web-ui-layout
|
|
159
|
+
header-glow
|
|
160
|
+
:sidebarCollapsed="sidebarCollapsed"
|
|
161
|
+
:sidebarOpen="sidebarOpen"
|
|
162
|
+
@sidebar-collapsed-change="sidebarCollapsed = $event.detail.collapsed"
|
|
163
|
+
@sidebar-open-change="sidebarOpen = $event.detail.open"
|
|
164
|
+
/>
|
|
165
|
+
```
|
|
166
|
+
|
|
130
167
|
Vue 事件类型零 cast:带值组件上的 `@input`/`@change` 解析到组件 emit,`$event.target` 即为组件实例,
|
|
131
168
|
`value`/`checked` 直接读取;kebab-case 事件(如 `open-change`)的 `$event.detail` 保持 `CustomEvent` 载荷类型。
|
|
132
169
|
命名 handler 用 `WebUiEvent<WebUiXxx, 'change'>` 标注;当变量或泛型表示事件名时,使用
|
|
@@ -143,6 +180,10 @@ ARIA 属性同样必须显式支持:使用组件文档化的命名属性,而
|
|
|
143
180
|
`click`、`input`、`change` 等浏览器 composed 原生事件仍是主要交互 API。`open-change` 等 kebab-case 自定义事件
|
|
144
181
|
仅描述用户操作导致的组件状态变化;程序化赋值 property 不会触发它们。
|
|
145
182
|
|
|
183
|
+
### 表单关联控件
|
|
184
|
+
|
|
185
|
+
所有表单控件均参与原生 `FormData`、约束校验、`form.reset()` 和浏览器表单状态恢复。控件会在**首次连接且声明式属性完成初始化后**捕获一次重置默认值;之后的运行时 property 更新不会改写该默认值。祖先 `fieldset` 的禁用状态会禁用交互和校验,但不会改写控件公开的 `disabled` 属性。对于 checkbox/radio group,父 group 是提交、重置和状态恢复的唯一所有者;被管理的子项不会独立提交或恢复状态。
|
|
186
|
+
|
|
146
187
|
## 所有组件
|
|
147
188
|
|
|
148
189
|
| 分类 | 组件 |
|
|
@@ -211,6 +252,12 @@ ARIA 属性同样必须显式支持:使用组件文档化的命名属性,而
|
|
|
211
252
|
|
|
212
253
|
**插槽:** `prefix`, `default`, `suffix`
|
|
213
254
|
|
|
255
|
+
**CSS 自定义属性:**
|
|
256
|
+
|
|
257
|
+
| 属性 | 默认值 | 说明 |
|
|
258
|
+
| ------------------------- | -------------------------------- | ------------ |
|
|
259
|
+
| `--wui-input-clear-color` | `var(--wui-color-text-tertiary)` | 清除按钮颜色 |
|
|
260
|
+
|
|
214
261
|
#### `<web-ui-textarea>`
|
|
215
262
|
|
|
216
263
|
多行文本输入框,支持自动调整高度。
|
|
@@ -240,6 +287,13 @@ ARIA 属性同样必须显式支持:使用组件文档化的命名属性,而
|
|
|
240
287
|
|
|
241
288
|
**插槽:** `prefix`, `suffix`
|
|
242
289
|
|
|
290
|
+
**CSS 自定义属性:**
|
|
291
|
+
|
|
292
|
+
| 属性 | 默认值 | 说明 |
|
|
293
|
+
| ---------------------------- | -------------------------------- | ------------ |
|
|
294
|
+
| `--wui-textarea-width` | `200px` | 文本域宽度 |
|
|
295
|
+
| `--wui-textarea-clear-color` | `var(--wui-color-text-tertiary)` | 清除按钮颜色 |
|
|
296
|
+
|
|
243
297
|
#### `<web-ui-input-number>`
|
|
244
298
|
|
|
245
299
|
数字输入框,支持步进按钮和键盘操作。
|
|
@@ -282,6 +336,13 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
|
|
|
282
336
|
|
|
283
337
|
子 `<web-ui-option>` 通过 `option-register` / `option-unregister` 注册。支持 ArrowDown/ArrowUp/Enter/Escape 键盘导航。
|
|
284
338
|
|
|
339
|
+
**CSS 自定义属性:**
|
|
340
|
+
|
|
341
|
+
| 属性 | 默认值 | 说明 |
|
|
342
|
+
| ------------------------- | ------- | -------------- |
|
|
343
|
+
| `--wui-select-max-width` | `500px` | 下拉框最大宽度 |
|
|
344
|
+
| `--wui-overlay-min-width` | `200px` | 下拉框最小宽度 |
|
|
345
|
+
|
|
285
346
|
#### `<web-ui-autocomplete>`
|
|
286
347
|
|
|
287
348
|
可输入并过滤候选的单值选择器。
|
|
@@ -308,6 +369,13 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
|
|
|
308
369
|
|
|
309
370
|
键入时按 label 过滤候选(`contains` 或 `prefix`,`none` 关闭过滤)。选择 option 时文本回填为该项 label,`selected-value` 暴露该项的 value;`change` 在选择提交时触发。支持 ArrowDown/ArrowUp/Enter/Escape 键盘导航。
|
|
310
371
|
|
|
372
|
+
**CSS 自定义属性:**
|
|
373
|
+
|
|
374
|
+
| 属性 | 默认值 | 说明 |
|
|
375
|
+
| ------------------------------ | ------- | -------------- |
|
|
376
|
+
| `--wui-autocomplete-max-width` | `500px` | 下拉框最大宽度 |
|
|
377
|
+
| `--wui-overlay-min-width` | `200px` | 下拉框最小宽度 |
|
|
378
|
+
|
|
311
379
|
#### `<web-ui-slider>`
|
|
312
380
|
|
|
313
381
|
范围滑块,支持刻度标记和垂直方向。
|
|
@@ -330,6 +398,18 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
|
|
|
330
398
|
|
|
331
399
|
支持 ArrowLeft/Right/Up/Down、Home/End、PageUp/PageDown 键盘导航。使用 pointer capture 处理鼠标、触控笔和触摸交互。
|
|
332
400
|
|
|
401
|
+
**CSS 自定义属性:**
|
|
402
|
+
|
|
403
|
+
| 属性 | 默认值 | 说明 |
|
|
404
|
+
| ------------------------------ | ----------------------------------- | ------------ |
|
|
405
|
+
| `--wui-slider-width` | `200px` | 滑块宽度 |
|
|
406
|
+
| `--wui-slider-vertical-height` | `200px` | 垂直滑块高度 |
|
|
407
|
+
| `--wui-slider-height` | `var(--wui-slider-track-size, 6px)` | 轨道厚度 |
|
|
408
|
+
| `--wui-slider-track-size` | `6px` | 轨道尺寸 |
|
|
409
|
+
| `--wui-slider-thumb-width` | `24px` | 滑块短轴 |
|
|
410
|
+
| `--wui-slider-thumb-height` | `32px` | 滑块长轴 |
|
|
411
|
+
| `--wui-slider-marks-inset` | `0` | 刻度内缩 |
|
|
412
|
+
|
|
333
413
|
#### `<web-ui-checkbox>`
|
|
334
414
|
|
|
335
415
|
单个复选框。
|
|
@@ -442,16 +522,16 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
|
|
|
442
522
|
|
|
443
523
|
样式化按钮,支持多种变体和加载状态。
|
|
444
524
|
|
|
445
|
-
| 属性 | 类型 | 默认值 | 说明
|
|
446
|
-
| ------------ | ------------------------------------------------------------ | ---------- |
|
|
447
|
-
| `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'danger' \| 'glass'` | `'glass'` | 按钮变体
|
|
448
|
-
| `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | 内部按钮类型;非法值回退为 `button`
|
|
449
|
-
| `disabled` | `boolean` | `false` | 禁用状态
|
|
450
|
-
| `loading` | `boolean` | `false` | 加载旋转动画
|
|
451
|
-
| `full` | `boolean` | `false` | 全宽
|
|
452
|
-
| `icon` | `boolean` | `false` | 纯图标模式
|
|
453
|
-
| `size` | `string` | `''` |
|
|
454
|
-
| `aria-label` | `string` | — | 无障碍标签(委托给内部按钮)
|
|
525
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
526
|
+
| ------------ | ------------------------------------------------------------ | ---------- | ------------------------------------------------------------- |
|
|
527
|
+
| `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'danger' \| 'glass'` | `'glass'` | 按钮变体 |
|
|
528
|
+
| `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | 内部按钮类型;非法值回退为 `button` |
|
|
529
|
+
| `disabled` | `boolean` | `false` | 禁用状态 |
|
|
530
|
+
| `loading` | `boolean` | `false` | 加载旋转动画 |
|
|
531
|
+
| `full` | `boolean` | `false` | 全宽 |
|
|
532
|
+
| `icon` | `boolean` | `false` | 纯图标模式 |
|
|
533
|
+
| `size` | `string` | `''` | 按钮高度(px);icon 模式下同时设为 min-width,默认保持正方形 |
|
|
534
|
+
| `aria-label` | `string` | — | 无障碍标签(委托给内部按钮) |
|
|
455
535
|
|
|
456
536
|
**事件:** 标准 `click`
|
|
457
537
|
|
|
@@ -461,6 +541,18 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
|
|
|
461
541
|
|
|
462
542
|
禁用和加载状态阻止 `click` 事件。
|
|
463
543
|
|
|
544
|
+
**CSS 自定义属性:**
|
|
545
|
+
|
|
546
|
+
| 属性 | 默认值 | 说明 |
|
|
547
|
+
| ------------------------ | ------------- | ---------------------- |
|
|
548
|
+
| `--wui-button-width` | `max-content` | 按钮宽度 |
|
|
549
|
+
| `--wui-button-px` | `12px` | 水平内边距 |
|
|
550
|
+
| `--wui-button-gap` | `8px` | 前缀/默认/后缀插槽间距 |
|
|
551
|
+
| `--wui-button-color` | 随 variant | 按钮文字颜色 |
|
|
552
|
+
| `--wui-button-bg` | 随 variant | 按钮背景颜色 |
|
|
553
|
+
| `--wui-button-bg-hover` | 随 variant | 悬停背景颜色 |
|
|
554
|
+
| `--wui-button-bg-active` | 随 variant | 按下背景颜色 |
|
|
555
|
+
|
|
464
556
|
#### `<web-ui-button-group>`
|
|
465
557
|
|
|
466
558
|
按钮组,管理子按钮布局和方向。
|
|
@@ -471,7 +563,7 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
|
|
|
471
563
|
|
|
472
564
|
**插槽:** `default`(投影 `<web-ui-button>` 元素)
|
|
473
565
|
|
|
474
|
-
|
|
566
|
+
以内部派生的视觉上下文控制按钮组方向,不改写子按钮属性。
|
|
475
567
|
|
|
476
568
|
---
|
|
477
569
|
|
|
@@ -496,26 +588,47 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
|
|
|
496
588
|
|
|
497
589
|
使用原生 `<dialog>`,`@cancel` 阻止默认关闭行为。除非存在 `no-escape-close`,否则 Escape 调用 `close()`;除非存在 `no-backdrop-close`,否则点击遮罩关闭。
|
|
498
590
|
|
|
591
|
+
**CSS 自定义属性:**
|
|
592
|
+
|
|
593
|
+
| 属性 | 默认值 | 说明 |
|
|
594
|
+
| ------------------------- | --------------------------- | -------------- |
|
|
595
|
+
| `--wui-dialog-max-width` | `360px` | 对话框最大宽度 |
|
|
596
|
+
| `--wui-dialog-overlay-bg` | `var(--wui-color-backdrop)` | 遮罩背景色 |
|
|
597
|
+
|
|
499
598
|
#### `<web-ui-drawer>`
|
|
500
599
|
|
|
501
600
|
侧边抽屉,使用原生 `<dialog>` 并自带关闭动画。
|
|
502
601
|
|
|
503
|
-
| 属性 | 类型 | 默认值 | 说明
|
|
504
|
-
| ------------------- | ---------------------------------------- | --------- |
|
|
505
|
-
| `open` | `boolean` | `false` | 抽屉可见性
|
|
506
|
-
| `placement` | `'right' \| 'left' \| 'top' \| 'bottom'` | `'right'` | 滑入方向
|
|
507
|
-
| `heading` | `string` | `''` | 标题文字(无 header 插槽时显示)
|
|
508
|
-
| `closable` | `boolean` | `false` | 显示关闭按钮
|
|
509
|
-
| `no-scroll-lock` | `boolean` | `false` | 打开时不锁定页面滚动
|
|
510
|
-
| `no-backdrop-close` | `boolean` | `false` | 禁止点击遮罩关闭
|
|
602
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
603
|
+
| ------------------- | ---------------------------------------- | --------- | ---------------------------------------------------- |
|
|
604
|
+
| `open` | `boolean` | `false` | 抽屉可见性 |
|
|
605
|
+
| `placement` | `'right' \| 'left' \| 'top' \| 'bottom'` | `'right'` | 滑入方向 |
|
|
606
|
+
| `heading` | `string` | `''` | 标题文字(无 header 插槽时显示) |
|
|
607
|
+
| `closable` | `boolean` | `false` | 显示关闭按钮 |
|
|
608
|
+
| `no-scroll-lock` | `boolean` | `false` | 打开时不锁定页面滚动 |
|
|
609
|
+
| `no-backdrop-close` | `boolean` | `false` | 禁止点击遮罩关闭 |
|
|
610
|
+
| `request-only` | `boolean` | `false` | 用户关闭仅请求 `open=false`,由 Consumer 回写 `open` |
|
|
611
|
+
| `headless` | `boolean` | `false` | 仅保留 overlay 行为,默认插槽不渲染内置抽屉 UI |
|
|
612
|
+
| `dialog-label` | `string` | `''` | 内部原生 dialog 的可访问名称;headless 模式必须提供 |
|
|
511
613
|
|
|
512
|
-
**事件:** `open-change` (`CustomEvent<{ open: boolean }>`)
|
|
614
|
+
**事件:** `open-change` (`CustomEvent<{ open: boolean }>`)。启用 `request-only` 后,Escape、遮罩和内置关闭按钮仅请求 `open=false`;Consumer 写入 `open=false` 前抽屉保持打开。若原生 dialog 在请求被拒绝期间关闭,组件会恢复其打开的 top layer 状态并发出同一关闭请求。
|
|
513
615
|
|
|
514
|
-
**插槽:** `header`, `default`, `footer`
|
|
616
|
+
**插槽:** `header`, `default`, `footer`;启用 `headless` 时仅渲染 `default` 插槽。
|
|
515
617
|
|
|
516
618
|
**方法:** `show()`, `close()`
|
|
517
619
|
|
|
518
|
-
|
|
620
|
+
`headless` 保留原生 dialog、遮罩、placement 动画、Escape/遮罩关闭行为和滚动锁定,但不渲染内置 glass 主体、header、关闭按钮或 footer;Consumer 负责完整定义默认插槽内容的样式,并且必须提供 `dialog-label`,确保原生 dialog 具有可访问名称。
|
|
621
|
+
|
|
622
|
+
关闭时保留原生 dialog 的 top layer,待退出过渡完成后调用 `dialog.close()`。Escape 始终走此关闭路径;`no-backdrop-close` 仅控制遮罩点击。
|
|
623
|
+
|
|
624
|
+
**CSS 自定义属性:**
|
|
625
|
+
|
|
626
|
+
| 属性 | 默认值 | 说明 |
|
|
627
|
+
| ------------------------- | ---------------------------------- | ----------------- |
|
|
628
|
+
| `--wui-drawer-width` | `320px` | 抽屉宽度 |
|
|
629
|
+
| `--wui-drawer-height` | `300px` | 抽屉高度(上/下) |
|
|
630
|
+
| `--wui-drawer-bg` | `var(--wui-color-surface-overlay)` | 抽屉背景色 |
|
|
631
|
+
| `--wui-drawer-overlay-bg` | `rgb(0 0 0 / 0.12)` | 遮罩背景色 |
|
|
519
632
|
|
|
520
633
|
---
|
|
521
634
|
|
|
@@ -565,6 +678,13 @@ Hover 模式使用 `pointerenter`/`pointerleave` 加延迟控制。Click 模式
|
|
|
565
678
|
|
|
566
679
|
`open` 是受控可见性属性。指针/焦点触发会更新它,直接设置也会同步本地或 Portal 面板。第一个 Tooltip 显示后,相邻 Tooltip 会立即切换;其余 pointer/focus 触发使用延迟计时器。
|
|
567
680
|
|
|
681
|
+
**CSS 自定义属性:**
|
|
682
|
+
|
|
683
|
+
| 属性 | 默认值 | 说明 |
|
|
684
|
+
| ------------------------- | ------- | ------------ |
|
|
685
|
+
| `--wui-tooltip-max-width` | `240px` | 提示最大宽度 |
|
|
686
|
+
| `--wui-tooltip-font-size` | `13px` | 提示字号 |
|
|
687
|
+
|
|
568
688
|
#### `<web-ui-context-menu>`
|
|
569
689
|
|
|
570
690
|
右键上下文菜单。
|
|
@@ -677,6 +797,17 @@ Hover 模式使用 `pointerenter`/`pointerleave` 加延迟控制。Click 模式
|
|
|
677
797
|
|
|
678
798
|
**插槽:** `default`(标题,覆盖 `title` 属性)、`icon`、`description`、`action`
|
|
679
799
|
|
|
800
|
+
**CSS 自定义属性:**
|
|
801
|
+
|
|
802
|
+
| 属性 | 默认值 | 说明 |
|
|
803
|
+
| ----------------------------------- | ----------- | ------------------ |
|
|
804
|
+
| `--wui-empty-min-height` | `240px` | 最小高度(medium) |
|
|
805
|
+
| `--wui-empty-padding` | `32px 24px` | 内边距(medium) |
|
|
806
|
+
| `--wui-empty-icon-size` | `56px` | 图标容器尺寸 |
|
|
807
|
+
| `--wui-empty-content-width` | `480px` | 标题/描述最大宽度 |
|
|
808
|
+
| `--wui-empty-title-font-size` | `16px` | 标题字号(medium) |
|
|
809
|
+
| `--wui-empty-description-font-size` | `14px` | 描述字号(medium) |
|
|
810
|
+
|
|
680
811
|
#### `<web-ui-icon>`
|
|
681
812
|
|
|
682
813
|
图标渲染组件。接受 Iconify 数据对象。
|
|
@@ -695,6 +826,12 @@ import { lucideLoaderCircle } from '@greypan/web-ui/icons'
|
|
|
695
826
|
html`<web-ui-icon .icon=${lucideLoaderCircle} spin />`
|
|
696
827
|
```
|
|
697
828
|
|
|
829
|
+
**CSS 自定义属性:**
|
|
830
|
+
|
|
831
|
+
| 属性 | 默认值 | 说明 |
|
|
832
|
+
| ------------------ | --------- | -------- |
|
|
833
|
+
| `--wui-icon-color` | `inherit` | 图标颜色 |
|
|
834
|
+
|
|
698
835
|
#### `<web-ui-spinner>`
|
|
699
836
|
|
|
700
837
|
加载旋转器。
|
|
@@ -727,14 +864,37 @@ WebUiSpinner.hide() // 隐藏
|
|
|
727
864
|
|
|
728
865
|
#### `<web-ui-layout>`
|
|
729
866
|
|
|
730
|
-
|
|
867
|
+
响应式页面布局:支持可选全宽 Banner、桌面端可折叠侧边栏,以及移动端 headless drawer。页面本身滚动;Banner 滚出后,桌面端 sidebar 和 header 固定在视口内。
|
|
868
|
+
|
|
869
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
870
|
+
| ------------------- | --------- | --------- | ------------------------------------ |
|
|
871
|
+
| `sidebar-collapsed` | `boolean` | `false` | 桌面端侧边栏受控折叠状态 |
|
|
872
|
+
| `sidebar-open` | `boolean` | `false` | 移动端侧边栏 Drawer 受控打开状态 |
|
|
873
|
+
| `header-glow` | `boolean` | `false` | 在 header 插槽内容背后显示装饰性晕染 |
|
|
874
|
+
| `sidebar-width` | `string` | `'240px'` | 桌面端和移动端展开时的侧边栏宽度 |
|
|
875
|
+
| `collapsed-width` | `string` | `'72px'` | 桌面端折叠时的侧边栏宽度 |
|
|
876
|
+
|
|
877
|
+
**事件:** `sidebar-collapsed-change`(`CustomEvent<{ collapsed: boolean }>`)用于请求更新桌面端折叠状态;`sidebar-open-change`(`CustomEvent<{ open: boolean }>`)用于请求更新移动端 Drawer 打开状态。Consumer 必须将请求值回写到对应的受控属性。
|
|
878
|
+
|
|
879
|
+
| 插槽 | 说明 |
|
|
880
|
+
| --------- | ------------------------------------------------------------ |
|
|
881
|
+
| `banner` | 位于布局主体上方的可选全宽 Banner |
|
|
882
|
+
| `header` | 内容区的 sticky header |
|
|
883
|
+
| `sidebar` | 侧边栏卡片内容;内部固定区域与滚动容器均由 Consumer 自行定义 |
|
|
884
|
+
| `default` | 主内容区 |
|
|
885
|
+
| `tabbar` | 底部 tabbar |
|
|
886
|
+
|
|
887
|
+
`web-ui-layout` 只约束侧边栏卡片的可用空间并管理桌面端 Toggle,不创建侧边栏 scrollport。若仅让侧边栏的一部分滚动,请将 `sidebar` 插槽根节点设为 `height: 100%; min-height: 0` 的 flex column,再将 `overflow-y: auto` 设置到目标子元素。这样 Consumer 可自行固定头部和底部,无需额外的公共 slot。
|
|
731
888
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
889
|
+
在 `640px` 及以下,侧边栏会切换为 headless 模式的 `web-ui-drawer`。Consumer 内容仍渲染在相同的圆角侧边栏卡片中,移动端 Toggle 位于 header 行内。
|
|
890
|
+
|
|
891
|
+
`header-glow` 会在 header 插槽内容和移动端 Toggle 的背后添加 `pointer-events: none` 的装饰性晕染。它属于 Header 背景而非前景层,因此插槽内容始终位于其上方;可通过 `--wui-layout-header-glow-color` 覆盖颜色,默认值为 `--wui-color-page`。晕染浓度和范围由内部变量 `--wui-layout-header-glow-height`(默认 `150%`)控制;增大可加强覆盖,减小则更柔和。布局层级顺序为 Header(`10`)< Auxiliary(`20`)< Banner(`30`)< Tabbar(`40`)< Sidebar(`50`)。
|
|
892
|
+
|
|
893
|
+
**CSS 自定义属性:**
|
|
894
|
+
|
|
895
|
+
| 属性 | 默认值 | 说明 |
|
|
896
|
+
| ----------------------------- | ------ | ------------------------------------ |
|
|
897
|
+
| `--wui-layout-sidebar-radius` | `28px` | 侧边栏卡片圆角(桌面端和移动端共用) |
|
|
738
898
|
|
|
739
899
|
#### `<web-ui-back-top>`
|
|
740
900
|
|
|
@@ -751,10 +911,21 @@ WebUiSpinner.hide() // 隐藏
|
|
|
751
911
|
|
|
752
912
|
**方法:** `toTop()`
|
|
753
913
|
|
|
754
|
-
**定位:** `scrollTarget` 为 `window` 时按钮固定在视口角落;为 `HTMLElement` 时需将元素放置在容器内部,按钮通过 `position: sticky` 悬浮于容器底部角落。偏移量沿用 `--
|
|
914
|
+
**定位:** `scrollTarget` 为 `window` 时按钮固定在视口角落;为 `HTMLElement` 时需将元素放置在容器内部,按钮通过 `position: sticky` 悬浮于容器底部角落。偏移量沿用 `--wui-back-top-top/right/bottom/left` CSS 变量。
|
|
755
915
|
|
|
756
916
|
角色:`button`,键盘 Enter 触发回到顶部。
|
|
757
917
|
|
|
918
|
+
**CSS 自定义属性:**
|
|
919
|
+
|
|
920
|
+
| 属性 | 默认值 | 说明 |
|
|
921
|
+
| ------------------------- | -------------------------------- | -------- |
|
|
922
|
+
| `--wui-back-top-position` | `fixed` | CSS 定位 |
|
|
923
|
+
| `--wui-back-top-z-index` | `var(--wui-layer-auxiliary, 20)` | 层级 |
|
|
924
|
+
| `--wui-back-top-top` | `auto` | 上偏移 |
|
|
925
|
+
| `--wui-back-top-right` | `20px` | 右偏移 |
|
|
926
|
+
| `--wui-back-top-bottom` | `20px` | 下偏移 |
|
|
927
|
+
| `--wui-back-top-left` | `auto` | 左偏移 |
|
|
928
|
+
|
|
758
929
|
#### `<web-ui-svg-draw-lines>`
|
|
759
930
|
|
|
760
931
|
SVG 线条绘制动画,基于 `stroke-dashoffset`。直接在原元素上动画 —— 不克隆、不操作 DOM。
|
|
@@ -783,7 +954,76 @@ SVG 线条绘制动画,基于 `stroke-dashoffset`。直接在原元素上动
|
|
|
783
954
|
|
|
784
955
|
**方法:** `getOverlayRoot()` — 返回 Portal 浮层容器
|
|
785
956
|
|
|
786
|
-
|
|
957
|
+
在其子树中定义基础、颜色、层级、阴影和动效 token。`motion="system"` 跟随 `prefers-reduced-motion`;使用 `motion="reduced"` 降低当前作用域动效,或在嵌套主题中使用 `motion="full"` 恢复默认 token。System 配色模式跟随 `prefers-color-scheme`。
|
|
958
|
+
|
|
959
|
+
**基础 token:**
|
|
960
|
+
|
|
961
|
+
| 属性 | 默认值 | 说明 |
|
|
962
|
+
| ------------------------- | ------- | ------------------------ |
|
|
963
|
+
| `--wui-font-size` | `14px` | 控件基础字号 |
|
|
964
|
+
| `--wui-input-width` | `200px` | 紧凑表单控件默认宽度 |
|
|
965
|
+
| `--wui-control-size` | `40px` | 控件默认高度和方形最小宽 |
|
|
966
|
+
| `--wui-overlay-min-width` | `200px` | 锚定浮层最小宽度 |
|
|
967
|
+
| `--wui-focus-ring-width` | `3px` | Focus 指示器宽度 |
|
|
968
|
+
|
|
969
|
+
**层级 token:**
|
|
970
|
+
|
|
971
|
+
| 属性 | 默认值 | 说明 |
|
|
972
|
+
| ---------------------------- | ------ | -------------- |
|
|
973
|
+
| `--wui-layer-base` | `0` | 基础内容 |
|
|
974
|
+
| `--wui-layer-inline-overlay` | `1` | 组件内部浮层 |
|
|
975
|
+
| `--wui-layer-header` | `10` | 页面 Header |
|
|
976
|
+
| `--wui-layer-auxiliary` | `20` | 悬浮工具控件 |
|
|
977
|
+
| `--wui-layer-banner` | `30` | Banner |
|
|
978
|
+
| `--wui-layer-tabbar` | `40` | Tab Bar |
|
|
979
|
+
| `--wui-layer-sidebar` | `50` | 侧边栏 |
|
|
980
|
+
| `--wui-layer-menu` | `100` | 菜单/浮动面板 |
|
|
981
|
+
| `--wui-layer-menu-nested` | `110` | 嵌套菜单 |
|
|
982
|
+
| `--wui-layer-toast` | `200` | Toast |
|
|
983
|
+
| `--wui-layer-loading` | `300` | 阻塞式 Loading |
|
|
984
|
+
|
|
985
|
+
**动效 token:** duration 默认值为 `--wui-duration-press: 80ms`、`--wui-duration-feedback: 100ms`、`--wui-duration-trigger: 160ms`、`--wui-duration-focus: 200ms`、`--wui-duration-menu-enter: 140ms`、`--wui-duration-menu-exit: 100ms`、`--wui-duration-overlay-enter: 180ms`、`--wui-duration-overlay-exit: 140ms`、`--wui-duration-drawer-enter: 280ms`、`--wui-duration-drawer-exit: 240ms`、`--wui-duration-layout: 200ms`。Easing token 是 `--wui-ease-enter` 和 `--wui-ease-slide`;进入缩放是 `--wui-scale-enter: 0.97`。
|
|
986
|
+
|
|
987
|
+
**颜色 token:**
|
|
988
|
+
|
|
989
|
+
| 属性 | 浅色默认值 | 深色默认值 | 说明 |
|
|
990
|
+
| ---------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---------------------- |
|
|
991
|
+
| `--wui-color-page` | `#fff` | `#18181a` | 页面背景 |
|
|
992
|
+
| `--wui-color-surface` | `#fff` | `#2c2c2e` | 普通 表面 |
|
|
993
|
+
| `--wui-color-surface-raised` | `#f2f2f7` | `#2c2c2e` | 抬升表面 |
|
|
994
|
+
| `--wui-color-surface-control` | `#dfdfdf` | `#3a3a3c` | 中性可交互控件表面 |
|
|
995
|
+
| `--wui-color-surface-track` | `#e5e5ea` | `#444446` | Slider/Switch 轨道表面 |
|
|
996
|
+
| `--wui-color-surface-glass` | `rgb(250 250 250 / 0.34)` | `rgb(44 44 46 / 0.42)` | 液态玻璃表面 |
|
|
997
|
+
| `--wui-color-surface-glass-hover` | `color-mix(... text 6%, surface-glass)` | `color-mix(... text 6%, surface-glass)` | Glass 完整悬停背景 |
|
|
998
|
+
| `--wui-color-surface-glass-active` | `color-mix(... text 15%, surface-glass)` | `color-mix(... text 15%, surface-glass)` | Glass 完整按下背景 |
|
|
999
|
+
| `--wui-color-surface-overlay` | `rgb(246 246 246 / 0.82)` | `rgb(44 44 46 / 0.82)` | 半透明浮层表面 |
|
|
1000
|
+
| `--wui-color-text` | `#1b1b1b` | `#f5f5f7` | 主要文本 |
|
|
1001
|
+
| `--wui-color-text-secondary` | `#6a6a6a` | `#a1a1a6` | 次要文本 |
|
|
1002
|
+
| `--wui-color-text-tertiary` | `color-mix(in srgb, var(--wui-color-text) 35%, transparent)` | `color-mix(in srgb, var(--wui-color-text) 42%, transparent)` | 三级文本和弱意图图标 |
|
|
1003
|
+
| `--wui-color-text-disabled` | `color-mix(in srgb, var(--wui-color-text) 32%, transparent)` | `color-mix(in srgb, var(--wui-color-text) 38%, transparent)` | 禁用态前景文本 |
|
|
1004
|
+
| `--wui-color-state-layer-hover` | `color-mix(in srgb, var(--wui-color-text) 6%, transparent)` | `color-mix(in srgb, var(--wui-color-text) 6%, transparent)` | 透明悬停层 |
|
|
1005
|
+
| `--wui-color-state-layer-active` | `color-mix(in srgb, var(--wui-color-text) 15%, transparent)` | `color-mix(in srgb, var(--wui-color-text) 15%, transparent)` | 透明按下层 |
|
|
1006
|
+
| `--wui-color-border` | `rgb(0 0 0 / 0.1)` | `rgb(255 255 255 / 0.14)` | 常规边框和分隔线 |
|
|
1007
|
+
| `--wui-color-glass-border` | `rgb(51 51 51 / 0.12)` | `rgb(255 255 255 / 0.16)` | Glass 边框色调 |
|
|
1008
|
+
| `--wui-color-glass-highlight` | `rgb(255 255 255 / 0.9)` | `rgb(255 255 255 / 0.22)` | Glass 高光边缘 |
|
|
1009
|
+
| `--wui-color-accent` | `#08f` | `#0a84ff` | Accent 和输入焦点边框 |
|
|
1010
|
+
| `--wui-color-on-accent` | `#fff` | `#fff` | Accent 上的前景色 |
|
|
1011
|
+
| `--wui-color-success` | `#16a34a` | `#30d158` | 成功 |
|
|
1012
|
+
| `--wui-color-warning` | `#d97706` | `#ff9f0a` | 警告 |
|
|
1013
|
+
| `--wui-color-danger` | `#dc2626` | `#ff453a` | 危险 |
|
|
1014
|
+
| `--wui-color-info` | `#2563eb` | `#64d2ff` | 信息 |
|
|
1015
|
+
| `--wui-color-backdrop` | `rgb(0 0 0 / 0.12)` | `rgb(0 0 0 / 0.48)` | Modal 遮罩 |
|
|
1016
|
+
| `--wui-color-focus-ring` | `rgb(0 136 255 / 0.4)` | `rgb(10 132 255 / 0.62)` | Focus 指示器颜色 |
|
|
1017
|
+
|
|
1018
|
+
**阴影 token:**
|
|
1019
|
+
|
|
1020
|
+
| 属性 | 浅色默认值 | 深色默认值 | 说明 |
|
|
1021
|
+
| ---------------------- | -------------------------------- | ------------------------------- | ----------------- |
|
|
1022
|
+
| `--wui-shadow-overlay` | `2px 16px 40px rgb(0 0 0 / 0.4)` | `0 18px 48px rgb(0 0 0 / 0.54)` | Modal/Drawer 阴影 |
|
|
1023
|
+
| `--wui-shadow-panel` | `0 3px 9px rgb(0 0 0 / 0.27)` | `0 4px 16px rgb(0 0 0 / 0.35)` | 小型浮动面板阴影 |
|
|
1024
|
+
| `--wui-shadow-glass` | 四层扩散阴影 | `0 12px 32px rgb(0 0 0 / 0.38)` | 液态玻璃基础阴影 |
|
|
1025
|
+
|
|
1026
|
+
**内部 token:** 以 `--wui-internal-*` 为前缀的变量是 Shadow DOM 内部接线变量,不属于公共 token API,消费方不应覆盖。
|
|
787
1027
|
|
|
788
1028
|
---
|
|
789
1029
|
|
|
@@ -837,6 +1077,13 @@ toast.updateMessage(id, { message: '上传已完成 60%', heading: '正在上传
|
|
|
837
1077
|
|
|
838
1078
|
悬停暂停自动关闭计时器(使用 `pointerenter`/`pointerleave`)。同一微任务中批量挂载 Toast。
|
|
839
1079
|
|
|
1080
|
+
**CSS 自定义属性:**
|
|
1081
|
+
|
|
1082
|
+
| 属性 | 默认值 | 说明 |
|
|
1083
|
+
| ------------------------------- | ------ | -------------------------- |
|
|
1084
|
+
| `--wui-toast-viewport-gap` | `16px` | Toast 到视口边缘的可见距离 |
|
|
1085
|
+
| `--wui-toast-container-padding` | `40px` | 容器预留的扩散阴影绘制空间 |
|
|
1086
|
+
|
|
840
1087
|
---
|
|
841
1088
|
|
|
842
1089
|
### 子项
|
|
@@ -856,6 +1103,12 @@ toast.updateMessage(id, { message: '上传已完成 60%', heading: '正在上传
|
|
|
856
1103
|
|
|
857
1104
|
非表单关联组件(父级 select 统一提交)。
|
|
858
1105
|
|
|
1106
|
+
**CSS 自定义属性:**
|
|
1107
|
+
|
|
1108
|
+
| 属性 | 默认值 | 说明 |
|
|
1109
|
+
| ---------------------------- | ------- | ------------------------- |
|
|
1110
|
+
| `--wui-option-check-display` | `block` | 选中勾选图标的 display 值 |
|
|
1111
|
+
|
|
859
1112
|
#### `<web-ui-segmented-trigger>`
|
|
860
1113
|
|
|
861
1114
|
`<web-ui-segmented>` 的分段按钮。
|
|
@@ -869,3 +1122,11 @@ toast.updateMessage(id, { message: '上传已完成 60%', heading: '正在上传
|
|
|
869
1122
|
**事件:** `change`
|
|
870
1123
|
|
|
871
1124
|
非表单关联组件(父级 segmented 统一提交)。
|
|
1125
|
+
|
|
1126
|
+
**CSS 自定义属性:**
|
|
1127
|
+
|
|
1128
|
+
| 属性 | 默认值 | 说明 |
|
|
1129
|
+
| ----------------------------------- | -------------------------------- | ---------------- |
|
|
1130
|
+
| `--wui-segmented-trigger-px` | `12px` | 水平内边距 |
|
|
1131
|
+
| `--wui-segmented-trigger-bg-hover` | `--wui-color-state-layer-hover` | Trigger 悬停背景 |
|
|
1132
|
+
| `--wui-segmented-trigger-bg-active` | `--wui-color-state-layer-active` | Trigger 按下背景 |
|