@manohub/ui 1.0.5 → 1.0.8
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.md +8 -2
- package/dist/components/badge/index.d.ts +24 -46
- package/dist/components/badge/index.js +7 -11
- package/dist/components/button/index.d.ts +11 -31
- package/dist/components/capsule/index.d.ts +13 -27
- package/dist/components/card/index.d.ts +21 -54
- package/dist/components/checkbox/index.d.ts +1 -9
- package/dist/components/code-block/index.d.ts +35 -62
- package/dist/components/collapse/index.d.ts +2 -0
- package/dist/components/dialog/index.d.ts +6 -15
- package/dist/components/divider/index.d.ts +1 -12
- package/dist/components/drawer/index.d.ts +7 -15
- package/dist/components/filter/index.d.ts +27 -69
- package/dist/components/filter/index.js +3 -8
- package/dist/components/form/index.d.ts +52 -132
- package/dist/components/form/index.js +5 -12
- package/dist/components/input/bordered.d.ts +4 -6
- package/dist/components/input/index.d.ts +47 -66
- package/dist/components/input/index.js +7 -8
- package/dist/components/input/number-input.d.ts +11 -23
- package/dist/components/layout/index.d.ts +21 -28
- package/dist/components/layout/index.js +5 -8
- package/dist/components/list-view/index.d.ts +10 -43
- package/dist/components/loading/index.d.ts +8 -19
- package/dist/components/nav/index.d.ts +14 -35
- package/dist/components/nav/index.js +1 -3
- package/dist/components/notice/index.d.ts +13 -33
- package/dist/components/notice/index.js +3 -5
- package/dist/components/notification/index.d.ts +0 -9
- package/dist/components/page/index.d.ts +8 -43
- package/dist/components/page/split-resize.d.ts +9 -18
- package/dist/components/pagination/index.d.ts +1 -5
- package/dist/components/panel/index.d.ts +27 -62
- package/dist/components/panel/index.js +1 -4
- package/dist/components/part-padding.d.ts +5 -13
- package/dist/components/query-state/index.d.ts +8 -32
- package/dist/components/radio/index.d.ts +2 -3
- package/dist/components/search/index.d.ts +12 -32
- package/dist/components/select/index.d.ts +7 -14
- package/dist/components/select/index.js +3 -3
- package/dist/components/select/select-panel.d.ts +23 -35
- package/dist/components/select/select-panel.js +5 -10
- package/dist/components/select/select-shared.d.ts +18 -44
- package/dist/components/select/select-tree.d.ts +11 -16
- package/dist/components/select/select-trigger.d.ts +6 -16
- package/dist/components/select/select-trigger.js +5 -11
- package/dist/components/skeleton/index.d.ts +1 -5
- package/dist/components/steps/index.d.ts +55 -111
- package/dist/components/steps/index.js +8 -16
- package/dist/components/switch/index.d.ts +17 -33
- package/dist/components/switch/index.js +2 -4
- package/dist/components/tabbar/index.d.ts +1 -6
- package/dist/components/table/index.d.ts +43 -105
- package/dist/components/table/index.js +166 -125
- package/dist/components/tabs/index.d.ts +22 -44
- package/dist/components/text/index.d.ts +10 -21
- package/dist/components/toast/index.d.ts +4 -13
- package/dist/components/tooltip/index.d.ts +1 -12
- package/dist/components/tree/index.d.ts +35 -77
- package/dist/components/tree/index.js +17 -33
- package/dist/components/upload/index.d.ts +1 -4
- package/dist/index.d.ts +3 -3
- package/dist/services/base.d.ts +32 -8
- package/dist/services/dialog.d.ts +10 -22
- package/dist/services/index.d.ts +2 -2
- package/dist/services/loading.d.ts +9 -12
- package/dist/services/loading.js +8 -1
- package/dist/services/toast.d.ts +4 -14
- package/dist/styles/components/button.css +2 -0
- package/dist/styles/components/capsule.css +2 -0
- package/dist/styles/components/checkbox.css +2 -0
- package/dist/styles/components/form.css +23 -28
- package/dist/styles/components/input.css +53 -71
- package/dist/styles/components/notice.css +2 -0
- package/dist/styles/components/page.css +25 -31
- package/dist/styles/components/pagination.css +4 -0
- package/dist/styles/components/radio.css +2 -0
- package/dist/styles/components/search.css +8 -10
- package/dist/styles/components/switch.css +2 -0
- package/dist/styles/components/tabbar.css +2 -0
- package/dist/styles/components/table.css +72 -58
- package/dist/styles/components/table.tokens.css +1 -1
- package/dist/styles/components/upload.css +2 -0
- package/package.json +2 -2
|
@@ -230,19 +230,14 @@ const FormRoot = /* @__PURE__ */ defineComponent({
|
|
|
230
230
|
default: void 0
|
|
231
231
|
},
|
|
232
232
|
/**
|
|
233
|
-
* 排布:`horizontal`(label 在左,缺省)/ `vertical`(label
|
|
234
|
-
*
|
|
235
|
-
* 窄容器(抽屉 / 移动端)与「字段名很长」的场景请用纵向 —— 横向时 label 列宽会把控件压得很窄。
|
|
233
|
+
* 排布:`horizontal`(label 在左,缺省)/ `vertical`(label 在控件上方)。窄容器(抽屉 / 移动端)与「字段名很
|
|
234
|
+
* 长」的场景请用纵向 —— 横向时 label 列宽会把控件压得很窄。
|
|
236
235
|
*/
|
|
237
236
|
layout: {
|
|
238
237
|
type: String,
|
|
239
238
|
default: "horizontal"
|
|
240
239
|
},
|
|
241
|
-
/**
|
|
242
|
-
* 行距(px,字段行之间 / 与 `Form.Header` 之间);缺省沿用样式里的 8px 档。
|
|
243
|
-
*
|
|
244
|
-
* 筛选条这类「上行 + 一行字段」的紧凑排布要 16(设计稿口径);长表单也可以调松。
|
|
245
|
-
*/
|
|
240
|
+
/** 行距(px,字段行之间 / 与 `Form.Header` 之间);缺省沿用样式里的 8px 档。筛选条这类「上行 + 一行字段」的紧凑排布要 16(设计稿口径),长表单也可以调松。 */
|
|
246
241
|
gap: {
|
|
247
242
|
type: Number,
|
|
248
243
|
default: void 0
|
|
@@ -316,10 +311,8 @@ const FormRoot = /* @__PURE__ */ defineComponent({
|
|
|
316
311
|
/** 当前快照(含全部已登记字段) */
|
|
317
312
|
getValues: () => values.value,
|
|
318
313
|
/**
|
|
319
|
-
* 清空全部字段(置 `undefined`;受控模式下同样会发 `update:modelValue
|
|
320
|
-
*
|
|
321
|
-
* **返回清空后的快照**:受控时外部还没回写 `modelValue`,调用方此刻再 `getValues()`
|
|
322
|
-
* 会读到清空前的旧值 —— 直接吃返回值才不依赖回写时序。
|
|
314
|
+
* 清空全部字段(置 `undefined`;受控模式下同样会发 `update:modelValue`)。**返回清空后的快照**:受控时外部
|
|
315
|
+
* 还没回写 `modelValue`,调用方此刻再 `getValues()` 会读到清空前的旧值 —— 直接吃返回值才不依赖回写时序。
|
|
323
316
|
*/
|
|
324
317
|
clear: () => {
|
|
325
318
|
const cleared = {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `bordered` 三档 →
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 那一对的反差是库内既定口径(见 `docs/guide/naming-and-defaults.md` §2.1);
|
|
7
|
-
* `'focus'` 档的类名 `--border-on-focus` 是这套口径下的新成员:它说的就是「聚焦时才有框」。
|
|
2
|
+
* `bordered` 三档 → 控件类名(**唯一来源**):输入族三个件(`Input` / `Textarea` / `NumberInput`)共用同一份面与同一个
|
|
3
|
+
* prop,判定表抄三份必然漂,故收在这里。类名口径:prop 是**肯定式**(`bordered`)、类名是**否定式**(`--borderless`)
|
|
4
|
+
* —— 那对反差是库内既定口径(见 `docs/guide/naming-and-defaults.md` §2.1);`'focus'` 档的
|
|
5
|
+
* `.mh-input--border-on-focus` 是这套口径下的新成员(它说的就是「聚焦时才有框」)。
|
|
8
6
|
*
|
|
9
7
|
* | `bordered` | 类名 | 常态 | 悬停 | 聚焦 |
|
|
10
8
|
* | --- | --- | --- | --- | --- |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
1
|
+
import { type HTMLAttributes, type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
2
2
|
import type { ControlSize } from '../control-size';
|
|
3
3
|
/** 校验状态(`error` 红、`warning` 黄;缺省无校验态) */
|
|
4
4
|
export type InputStatus = 'error' | 'warning';
|
|
@@ -26,26 +26,11 @@ export interface TextareaAutoSize {
|
|
|
26
26
|
* `class` / `style` → 表壳 `.mh-input__wrap`(整件的宽度与显式锚);**其余 attrs 一律透传到控件**
|
|
27
27
|
* (`id` / `name` / `aria-*` / `data-*` / `title` / 原生事件)—— 壳只是排版容器,属性落它上面等于丢掉
|
|
28
28
|
* —— 见 `forwardAttrs`;触发器形态另有 `controlClass` / `controlAttrs` 两个**专口子**(同名键以它为准)。
|
|
29
|
+
* 这组属性在**类型面**同步放开(两形态共认的键):`onClick` / `title` / `data-*` / `aria-*` 直接写在组件上即可。
|
|
29
30
|
*
|
|
30
|
-
*
|
|
31
|
-
* <Input modelValue={kw} placeholder="搜索" clearable prefix={<Icon name="search" />} onChange={setKw} />
|
|
32
|
-
*
|
|
33
|
-
* @example 密码(右端图标切换明/密文)
|
|
34
|
-
* <Input type="password" modelValue={pwd} onChange={setPwd} />
|
|
35
|
-
*
|
|
36
|
-
* @example 校验态与尺寸
|
|
37
|
-
* <Input status="error" size="lg" placeholder="请输入任务名" />
|
|
38
|
-
*
|
|
39
|
-
* @example 多行 + 字数 + 自适应高度
|
|
40
|
-
* <Textarea modelValue={note} autoSize={{ minRows: 2, maxRows: 6 }} maxlength={500} showCount onChange={setNote} />
|
|
41
|
-
*
|
|
42
|
-
* @example 触发器形态(复合件用:控件换成 `<button>`,表壳 / 清除位 / 右侧图标位全部复用)
|
|
43
|
-
* <Input as="button" clearable hasValue={!!value} placeholder="请选择" controlClass="my-picker"
|
|
44
|
-
* controlAttrs={{ popovertarget: id }}>
|
|
45
|
-
* {{ default: () => value, suffix: () => <Icon name="chevron-down" /> }}
|
|
46
|
-
* </Input>
|
|
31
|
+
* 用法见 `docs/demos/input/`(每个维度一份可运行样例;文档页 `docs/components/input.md`)。
|
|
47
32
|
*/
|
|
48
|
-
|
|
33
|
+
declare const InputBase: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
49
34
|
/** 受控值 */
|
|
50
35
|
modelValue: {
|
|
51
36
|
type: StringConstructor;
|
|
@@ -58,9 +43,8 @@ export declare const Input: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
58
43
|
};
|
|
59
44
|
/**
|
|
60
45
|
* 占位文案(两种形态都消费它):缺省(`as="input"`)走原生 `::placeholder` 伪元素;触发器形态
|
|
61
|
-
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder
|
|
62
|
-
*
|
|
63
|
-
* 的调用方行为不变。
|
|
46
|
+
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder`)—— 当且仅当
|
|
47
|
+
* `hasValue === false` 且本 prop 有值时渲染它,并**取代** `default` 插槽。
|
|
64
48
|
*/
|
|
65
49
|
placeholder: {
|
|
66
50
|
type: StringConstructor;
|
|
@@ -81,10 +65,9 @@ export declare const Input: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
81
65
|
default: boolean;
|
|
82
66
|
};
|
|
83
67
|
/**
|
|
84
|
-
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 /
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* 只读 ≠ 禁用:它照旧可聚焦、可选中复制,也不变灰。
|
|
68
|
+
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 / 详情里回显业务值,也是
|
|
69
|
+
* `Form.Item` 的 `readonly` 行推荐写法):几何与可编辑输入框**完全一致**(同高 / 同内距 / 值文字同左缘),但滑过
|
|
70
|
+
* 不亮浅底、聚焦不给边框与主色环 —— 一眼看去是「值」而不是「输入位」;只读 ≠ 禁用(照旧可聚焦、可复制、不变灰)。
|
|
88
71
|
*/
|
|
89
72
|
readonly: {
|
|
90
73
|
type: BooleanConstructor;
|
|
@@ -182,9 +165,8 @@ export declare const Input: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
182
165
|
};
|
|
183
166
|
/**
|
|
184
167
|
* 占位文案(两种形态都消费它):缺省(`as="input"`)走原生 `::placeholder` 伪元素;触发器形态
|
|
185
|
-
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder
|
|
186
|
-
*
|
|
187
|
-
* 的调用方行为不变。
|
|
168
|
+
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder`)—— 当且仅当
|
|
169
|
+
* `hasValue === false` 且本 prop 有值时渲染它,并**取代** `default` 插槽。
|
|
188
170
|
*/
|
|
189
171
|
placeholder: {
|
|
190
172
|
type: StringConstructor;
|
|
@@ -205,10 +187,9 @@ export declare const Input: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
205
187
|
default: boolean;
|
|
206
188
|
};
|
|
207
189
|
/**
|
|
208
|
-
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 /
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* 只读 ≠ 禁用:它照旧可聚焦、可选中复制,也不变灰。
|
|
190
|
+
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 / 详情里回显业务值,也是
|
|
191
|
+
* `Form.Item` 的 `readonly` 行推荐写法):几何与可编辑输入框**完全一致**(同高 / 同内距 / 值文字同左缘),但滑过
|
|
192
|
+
* 不亮浅底、聚焦不给边框与主色环 —— 一眼看去是「值」而不是「输入位」;只读 ≠ 禁用(照旧可聚焦、可复制、不变灰)。
|
|
212
193
|
*/
|
|
213
194
|
readonly: {
|
|
214
195
|
type: BooleanConstructor;
|
|
@@ -319,6 +300,16 @@ export declare const Input: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
319
300
|
prefix?: () => VNodeChild;
|
|
320
301
|
suffix?: () => VNodeChild;
|
|
321
302
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
303
|
+
/**
|
|
304
|
+
* 控件元素上的原生属性 / 事件(`HTMLAttributes` 即输入框与触发器共有的那张基表):
|
|
305
|
+
* 本件不登记它们,运行时按 attrs 透传到控件,这里只把类型面同步放开。
|
|
306
|
+
*/
|
|
307
|
+
type InputControlAttrs = Omit<HTMLAttributes, keyof InstanceType<typeof InputBase>['$props']>;
|
|
308
|
+
export declare const Input: typeof InputBase & {
|
|
309
|
+
new (): {
|
|
310
|
+
$props: InstanceType<typeof InputBase>["$props"] & InputControlAttrs;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
322
313
|
export interface TextareaProps {
|
|
323
314
|
/** 受控值 */
|
|
324
315
|
modelValue?: string;
|
|
@@ -348,13 +339,8 @@ export interface TextareaProps {
|
|
|
348
339
|
}
|
|
349
340
|
/**
|
|
350
341
|
* 多行输入(同一份面;结构与单行不同,故单列一个件)。
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
* —— 那会丢掉输入能力;目前只能由应用侧保留一条带 `font-family: var(--ui-font-mono)` 的样式登记
|
|
354
|
-
* (缺件登记见下游仓 `aihub-frontend/docs/kit-gaps.md`,本仓不复制那份台账)。
|
|
355
|
-
*
|
|
356
|
-
* @example 备注框:自适应 2~6 行 + 限长计数
|
|
357
|
-
* <Textarea modelValue={note} autoSize={{ minRows: 2, maxRows: 6 }} maxlength={500} showCount onChange={setNote} />
|
|
342
|
+
* ⚠️ **输入族没有 `mono` 档**(`Input` 与 `Textarea` 都没有):要等宽的输入框别拿 `Text mono` 去包(那会丢掉输入
|
|
343
|
+
* 能力),目前只能由应用侧保留一条带 `font-family: var(--ui-font-mono)` 的样式登记。
|
|
358
344
|
*/
|
|
359
345
|
export declare const Textarea: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
360
346
|
modelValue: {
|
|
@@ -519,9 +505,8 @@ export declare const InputCompound: {
|
|
|
519
505
|
};
|
|
520
506
|
/**
|
|
521
507
|
* 占位文案(两种形态都消费它):缺省(`as="input"`)走原生 `::placeholder` 伪元素;触发器形态
|
|
522
|
-
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder
|
|
523
|
-
*
|
|
524
|
-
* 的调用方行为不变。
|
|
508
|
+
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder`)—— 当且仅当
|
|
509
|
+
* `hasValue === false` 且本 prop 有值时渲染它,并**取代** `default` 插槽。
|
|
525
510
|
*/
|
|
526
511
|
placeholder: {
|
|
527
512
|
type: StringConstructor;
|
|
@@ -542,10 +527,9 @@ export declare const InputCompound: {
|
|
|
542
527
|
default: boolean;
|
|
543
528
|
};
|
|
544
529
|
/**
|
|
545
|
-
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 /
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
* 只读 ≠ 禁用:它照旧可聚焦、可选中复制,也不变灰。
|
|
530
|
+
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 / 详情里回显业务值,也是
|
|
531
|
+
* `Form.Item` 的 `readonly` 行推荐写法):几何与可编辑输入框**完全一致**(同高 / 同内距 / 值文字同左缘),但滑过
|
|
532
|
+
* 不亮浅底、聚焦不给边框与主色环 —— 一眼看去是「值」而不是「输入位」;只读 ≠ 禁用(照旧可聚焦、可复制、不变灰)。
|
|
549
533
|
*/
|
|
550
534
|
readonly: {
|
|
551
535
|
type: BooleanConstructor;
|
|
@@ -677,9 +661,8 @@ export declare const InputCompound: {
|
|
|
677
661
|
};
|
|
678
662
|
/**
|
|
679
663
|
* 占位文案(两种形态都消费它):缺省(`as="input"`)走原生 `::placeholder` 伪元素;触发器形态
|
|
680
|
-
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder
|
|
681
|
-
*
|
|
682
|
-
* 的调用方行为不变。
|
|
664
|
+
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder`)—— 当且仅当
|
|
665
|
+
* `hasValue === false` 且本 prop 有值时渲染它,并**取代** `default` 插槽。
|
|
683
666
|
*/
|
|
684
667
|
placeholder: {
|
|
685
668
|
type: StringConstructor;
|
|
@@ -700,10 +683,9 @@ export declare const InputCompound: {
|
|
|
700
683
|
default: boolean;
|
|
701
684
|
};
|
|
702
685
|
/**
|
|
703
|
-
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 /
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
* 只读 ≠ 禁用:它照旧可聚焦、可选中复制,也不变灰。
|
|
686
|
+
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 / 详情里回显业务值,也是
|
|
687
|
+
* `Form.Item` 的 `readonly` 行推荐写法):几何与可编辑输入框**完全一致**(同高 / 同内距 / 值文字同左缘),但滑过
|
|
688
|
+
* 不亮浅底、聚焦不给边框与主色环 —— 一眼看去是「值」而不是「输入位」;只读 ≠ 禁用(照旧可聚焦、可复制、不变灰)。
|
|
707
689
|
*/
|
|
708
690
|
readonly: {
|
|
709
691
|
type: BooleanConstructor;
|
|
@@ -826,9 +808,8 @@ export declare const InputCompound: {
|
|
|
826
808
|
};
|
|
827
809
|
/**
|
|
828
810
|
* 占位文案(两种形态都消费它):缺省(`as="input"`)走原生 `::placeholder` 伪元素;触发器形态
|
|
829
|
-
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder
|
|
830
|
-
*
|
|
831
|
-
* 的调用方行为不变。
|
|
811
|
+
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder`)—— 当且仅当
|
|
812
|
+
* `hasValue === false` 且本 prop 有值时渲染它,并**取代** `default` 插槽。
|
|
832
813
|
*/
|
|
833
814
|
placeholder: {
|
|
834
815
|
type: StringConstructor;
|
|
@@ -849,10 +830,9 @@ export declare const InputCompound: {
|
|
|
849
830
|
default: boolean;
|
|
850
831
|
};
|
|
851
832
|
/**
|
|
852
|
-
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 /
|
|
853
|
-
*
|
|
854
|
-
*
|
|
855
|
-
* 只读 ≠ 禁用:它照旧可聚焦、可选中复制,也不变灰。
|
|
833
|
+
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 / 详情里回显业务值,也是
|
|
834
|
+
* `Form.Item` 的 `readonly` 行推荐写法):几何与可编辑输入框**完全一致**(同高 / 同内距 / 值文字同左缘),但滑过
|
|
835
|
+
* 不亮浅底、聚焦不给边框与主色环 —— 一眼看去是「值」而不是「输入位」;只读 ≠ 禁用(照旧可聚焦、可复制、不变灰)。
|
|
856
836
|
*/
|
|
857
837
|
readonly: {
|
|
858
838
|
type: BooleanConstructor;
|
|
@@ -964,7 +944,9 @@ export declare const InputCompound: {
|
|
|
964
944
|
default?: () => VNodeChild;
|
|
965
945
|
prefix?: () => VNodeChild;
|
|
966
946
|
suffix?: () => VNodeChild;
|
|
967
|
-
}>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
947
|
+
}>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
948
|
+
$props: InstanceType<typeof InputBase>["$props"] & InputControlAttrs;
|
|
949
|
+
}) & {
|
|
968
950
|
Textarea: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
969
951
|
modelValue: {
|
|
970
952
|
type: StringConstructor;
|
|
@@ -1132,9 +1114,8 @@ export declare const InputCompound: {
|
|
|
1132
1114
|
};
|
|
1133
1115
|
export type InputCompoundType = typeof InputCompound;
|
|
1134
1116
|
/**
|
|
1135
|
-
* 数字输入与 `Input` **同族**(同一个表壳 / 内距 / 状态协议,同一份面 `input.css
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1138
|
-
* 而数字输入是另一件(值模型 `number | null` vs `string`)。
|
|
1117
|
+
* 数字输入与 `Input` **同族**(同一个表壳 / 内距 / 状态协议,同一份面 `input.css`),故与 `Textarea` 同款处置:
|
|
1118
|
+
* **平级导出、共用本目录**。它**不是** `Input` 的点号成员 —— 成员位留给「同一件自己的形态」(`.Textarea` /
|
|
1119
|
+
* `.Display`),而数字输入是另一件(值模型 `number | null` vs `string`)。
|
|
1139
1120
|
*/
|
|
1140
1121
|
export { NumberInput, type NumberInputProps } from './number-input';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, createVNode, mergeProps, createTextVNode } from "vue";
|
|
2
2
|
import { Icon } from "@manohub/icon";
|
|
3
3
|
import { borderedClassOf } from "./bordered.js";
|
|
4
|
-
const
|
|
4
|
+
const InputBase = /* @__PURE__ */ defineComponent({
|
|
5
5
|
name: "Input",
|
|
6
6
|
inheritAttrs: false,
|
|
7
7
|
props: {
|
|
@@ -17,9 +17,8 @@ const Input = /* @__PURE__ */ defineComponent({
|
|
|
17
17
|
},
|
|
18
18
|
/**
|
|
19
19
|
* 占位文案(两种形态都消费它):缺省(`as="input"`)走原生 `::placeholder` 伪元素;触发器形态
|
|
20
|
-
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder
|
|
21
|
-
*
|
|
22
|
-
* 的调用方行为不变。
|
|
20
|
+
* (`as="button"`)**没有 `::placeholder` 可用**,改由一个 span 承载(`.mh-input__placeholder`)—— 当且仅当
|
|
21
|
+
* `hasValue === false` 且本 prop 有值时渲染它,并**取代** `default` 插槽。
|
|
23
22
|
*/
|
|
24
23
|
placeholder: {
|
|
25
24
|
type: String,
|
|
@@ -40,10 +39,9 @@ const Input = /* @__PURE__ */ defineComponent({
|
|
|
40
39
|
default: false
|
|
41
40
|
},
|
|
42
41
|
/**
|
|
43
|
-
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 /
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* 只读 ≠ 禁用:它照旧可聚焦、可选中复制,也不变灰。
|
|
42
|
+
* **只读**:值可选中 / 复制,但不能改。与 `bordered={false}` 组合即**只读值档**(摘要 / 详情里回显业务值,也是
|
|
43
|
+
* `Form.Item` 的 `readonly` 行推荐写法):几何与可编辑输入框**完全一致**(同高 / 同内距 / 值文字同左缘),但滑过
|
|
44
|
+
* 不亮浅底、聚焦不给边框与主色环 —— 一眼看去是「值」而不是「输入位」;只读 ≠ 禁用(照旧可聚焦、可复制、不变灰)。
|
|
47
45
|
*/
|
|
48
46
|
readonly: {
|
|
49
47
|
type: Boolean,
|
|
@@ -244,6 +242,7 @@ const Input = /* @__PURE__ */ defineComponent({
|
|
|
244
242
|
}, [current.value?.length ?? 0, createTextVNode("/"), props.maxlength]) : null]);
|
|
245
243
|
}
|
|
246
244
|
});
|
|
245
|
+
const Input = InputBase;
|
|
247
246
|
const Textarea = /* @__PURE__ */ defineComponent({
|
|
248
247
|
name: "Textarea",
|
|
249
248
|
inheritAttrs: false,
|
|
@@ -4,38 +4,26 @@ import type { InputStatus } from './index';
|
|
|
4
4
|
/**
|
|
5
5
|
* 数字输入(**自绘**)。
|
|
6
6
|
*
|
|
7
|
-
* 与 `Input` **同族同面**(同一个表壳 / 内距 / 状态协议,样式归 `styles/components/input.css
|
|
8
|
-
*
|
|
9
|
-
* —— 与 `Input` / `Textarea` 的关系同款,故不另开组件目录、不新增面文件。
|
|
7
|
+
* 与 `Input` **同族同面**(同一个表壳 / 内距 / 状态协议,样式归 `styles/components/input.css`),按「同族两件
|
|
8
|
+
* 可并排平级导出、共用同一目录与同一份面」处置 —— 故不另开组件目录、不新增面文件。
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `
|
|
14
|
-
* 本件也**不接** `Input` 的 `as="button"` 触发器形态 —— 那是复合件(`Select` 一族)的口子。
|
|
10
|
+
* 为什么单列一件而不是加进 `Input`:`Input` 的 `modelValue` 是 **string**,且已串起「密码可见切换 / 清除位 /
|
|
11
|
+
* 字数统计 / 触发器形态」一条链;把数值语义(`min` / `max` / `step` / `precision` / 钳制 / 舍入 / 步进按钮)
|
|
12
|
+
* 塞进去会污染统一词表。本件也**不接** `Input` 的 `as="button"` 触发器形态(那是复合件一族的口子)。
|
|
15
13
|
*
|
|
16
14
|
* 统一词表(与 `Checkbox` / `Switch` / `Input` 同款):`modelValue` / `onChange` / `disabled` / `size`;
|
|
17
15
|
* 值变更时 `emit('update:modelValue')` 与 `onChange` **双走**。
|
|
18
16
|
*
|
|
19
|
-
* ##
|
|
20
|
-
*
|
|
17
|
+
* ## 值域口径(都是「原生数字框最被讨厌的点」的反面)
|
|
21
18
|
* 1. **空值是 `null`,不是 `0`**:留空与「填了 0」是两件事,前者不提交、后者要提交。
|
|
22
|
-
* 2. **输入中途不钳制**:`-` / `1.` /
|
|
23
|
-
*
|
|
19
|
+
* 2. **输入中途不钳制**:`-` / `1.` / 空串这些中间态一律原样留着(打一半就被改掉会打断输入);钳制与舍入发生
|
|
20
|
+
* 在**归一时刻** —— `blur` / `Enter` / 步进按钮 / `min`·`max`·`precision` 变化。
|
|
24
21
|
* 3. **非法输入回滚**:解析不出来(如 `1a`)就退回上一个合法值,**不静默变 0**。
|
|
25
22
|
*
|
|
26
|
-
* 属性落点与 `Input` 完全同款:`class` / `style` → 表壳 `.mh-input__wrap`;其余 attrs
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @example 受控 + 区间
|
|
30
|
-
* <NumberInput modelValue={timeout} min={0} max={43200} onChange={setTimeout} />
|
|
31
|
-
*
|
|
32
|
-
* @example 表格内 / 行内编辑档(无框)
|
|
33
|
-
* <NumberInput modelValue={row.value} bordered={false} precision={0} onChange={set} />
|
|
23
|
+
* 属性落点与 `Input` 完全同款:`class` / `style` → 表壳 `.mh-input__wrap`;其余 attrs 一律透传到控件
|
|
24
|
+
* (`id` / `name` / `aria-*` / `data-*` / 原生事件),见 `forwardAttrs`。
|
|
34
25
|
*
|
|
35
|
-
*
|
|
36
|
-
* <NumberInput modelValue={size} min={1}>
|
|
37
|
-
* {{ suffix: () => 'MB' }}
|
|
38
|
-
* </NumberInput>
|
|
26
|
+
* 用法见 `docs/demos/number-input/`(每个维度一份可运行样例;文档页 `docs/components/number-input.md`)。
|
|
39
27
|
*/
|
|
40
28
|
export interface NumberInputProps {
|
|
41
29
|
/** 受控值(空值为 `null`,不是 `0`) */
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
2
2
|
import { type Padding } from '../part-padding';
|
|
3
3
|
/**
|
|
4
|
-
* 布局间距档:**只开放令牌档位,不开放任意 px**(`none/sm/md/lg/xl` → `0 / --ui-space-1/2/3/4
|
|
4
|
+
* 布局间距档:**只开放令牌档位,不开放任意 px**(`none/sm/md/lg/xl` → `0 / --ui-space-1/2/3/4`)。间距一旦可以随手
|
|
5
|
+
* 写,同一个页面里就会出现 6/7/9/10/14 这些「看着差不多」的值、并在不同缩放档与不同人手里继续分叉 —— 与「应用侧只写
|
|
6
|
+
* 布局」是同一条理由的另一面。
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
* 而它们在不同缩放档、不同人手里会继续分叉 —— 与「应用侧只写布局」是同一条理由的另一面。
|
|
8
|
+
* 用法见 `docs/demos/layout/`(每个维度一份可运行样例;文档页 `docs/components/layout.md`)。
|
|
8
9
|
*/
|
|
9
10
|
export type LayoutGap = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
10
11
|
/** 交叉轴对齐(`align-items`);主轴排布用 `justify` */
|
|
@@ -25,18 +26,16 @@ export type LayoutSpan = 1 | 2 | 3 | 4;
|
|
|
25
26
|
*
|
|
26
27
|
* ## 命名与方向口径(别再改回去)
|
|
27
28
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* 在一份 import 清单里混读,也破坏「成族子件用点号」的约定(`Page.Header` / `Form.Item`)。
|
|
29
|
+
* **方向按表格语义定**(行与行上下相邻 ⇒ `Row` 竖排;列与列左右相邻 ⇒ `Column` 横排);`columns` 说的是
|
|
30
|
+
* 「**这一行分几列**」(每行摆几格),不是「这个容器有几种方向」;嵌套上要分栏 / 栅格就 `Row columns={n}` +
|
|
31
|
+
* `Column`,一格里要上下堆就在 `Column` 里再放 `Row`。**公开面只出 `Layout`**,不平级导出 `Row` / `Column`
|
|
32
|
+
* —— 通用词会与 `TableColumn` 在一份 import 清单里混读,也破坏「成族子件用点号」的约定。
|
|
33
33
|
*
|
|
34
34
|
* ## 与其它件的边界
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* - 只有「块与块怎么摆」这一件事归本族,滚动 / 工具位 / 卡片外观都不归它。
|
|
36
|
+
* 表单里并排字段用 `Form` 的 `columns`(它管 label 列、行距与**回落**),不要用本族拼表单 —— 本族的列数是
|
|
37
|
+
* **恒定**的、窄了只等分收窄,表单会被压出不可用的窄控件;页面级两栏(各自滚动)用 `Page.Split`;只有
|
|
38
|
+
* 「块与块怎么摆」这一件事归本族(滚动 / 工具位 / 卡片外观都不归它)。
|
|
40
39
|
*/
|
|
41
40
|
export declare const Layout: {
|
|
42
41
|
Row: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -66,14 +65,11 @@ export declare const Layout: {
|
|
|
66
65
|
default: undefined;
|
|
67
66
|
};
|
|
68
67
|
/**
|
|
69
|
-
* 内距:**走骨架件共享口径**(`Padding`,同 `Card` / `Form` / `Page` / `Panel`)——
|
|
70
|
-
* `
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* 内距在设计稿里常是**确定坐标**,令牌梯度(最大 24px)表达不了。
|
|
75
|
-
* ⚠️ 用它之前先想一次:这个数真是「内距」吗?若是「与某个内容列对齐」这类**布局坐标**,
|
|
76
|
-
* 优先改由结构表达(同轴容器 / `columns` / `minColumnWidth`)。
|
|
68
|
+
* 内距:**走骨架件共享口径**(`Padding`,同 `Card` / `Form` / `Page` / `Panel`)—— `number` 四边同值、
|
|
69
|
+
* `{ y, x }` 分上下 / 左右、`string` 原样下发(CSS 简写,**逃生舱**),口径与理由见 `part-padding.ts`。
|
|
70
|
+
* ⚠️ 与 `gap` 不同口径:`gap` 只开放令牌档(防间距分叉),`padding` 接具体值 —— 内距在设计稿里常是**确定坐标**,
|
|
71
|
+
* 令牌梯度(最大 24px)表达不了。⚠️ 用它之前先想一次:这个数真是「内距」吗?若是「与某个内容列对齐」这类**布局
|
|
72
|
+
* 坐标**,优先改由结构表达(同轴容器 / `columns` / `minColumnWidth`)。
|
|
77
73
|
*/
|
|
78
74
|
padding: {
|
|
79
75
|
type: PropType<Padding>;
|
|
@@ -106,14 +102,11 @@ export declare const Layout: {
|
|
|
106
102
|
default: undefined;
|
|
107
103
|
};
|
|
108
104
|
/**
|
|
109
|
-
* 内距:**走骨架件共享口径**(`Padding`,同 `Card` / `Form` / `Page` / `Panel`)——
|
|
110
|
-
* `
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* 内距在设计稿里常是**确定坐标**,令牌梯度(最大 24px)表达不了。
|
|
115
|
-
* ⚠️ 用它之前先想一次:这个数真是「内距」吗?若是「与某个内容列对齐」这类**布局坐标**,
|
|
116
|
-
* 优先改由结构表达(同轴容器 / `columns` / `minColumnWidth`)。
|
|
105
|
+
* 内距:**走骨架件共享口径**(`Padding`,同 `Card` / `Form` / `Page` / `Panel`)—— `number` 四边同值、
|
|
106
|
+
* `{ y, x }` 分上下 / 左右、`string` 原样下发(CSS 简写,**逃生舱**),口径与理由见 `part-padding.ts`。
|
|
107
|
+
* ⚠️ 与 `gap` 不同口径:`gap` 只开放令牌档(防间距分叉),`padding` 接具体值 —— 内距在设计稿里常是**确定坐标**,
|
|
108
|
+
* 令牌梯度(最大 24px)表达不了。⚠️ 用它之前先想一次:这个数真是「内距」吗?若是「与某个内容列对齐」这类**布局
|
|
109
|
+
* 坐标**,优先改由结构表达(同轴容器 / `columns` / `minColumnWidth`)。
|
|
117
110
|
*/
|
|
118
111
|
padding: {
|
|
119
112
|
type: PropType<Padding>;
|
|
@@ -79,14 +79,11 @@ const LayoutRow = /* @__PURE__ */ defineComponent({
|
|
|
79
79
|
default: void 0
|
|
80
80
|
},
|
|
81
81
|
/**
|
|
82
|
-
* 内距:**走骨架件共享口径**(`Padding`,同 `Card` / `Form` / `Page` / `Panel`)——
|
|
83
|
-
* `
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* 内距在设计稿里常是**确定坐标**,令牌梯度(最大 24px)表达不了。
|
|
88
|
-
* ⚠️ 用它之前先想一次:这个数真是「内距」吗?若是「与某个内容列对齐」这类**布局坐标**,
|
|
89
|
-
* 优先改由结构表达(同轴容器 / `columns` / `minColumnWidth`)。
|
|
82
|
+
* 内距:**走骨架件共享口径**(`Padding`,同 `Card` / `Form` / `Page` / `Panel`)—— `number` 四边同值、
|
|
83
|
+
* `{ y, x }` 分上下 / 左右、`string` 原样下发(CSS 简写,**逃生舱**),口径与理由见 `part-padding.ts`。
|
|
84
|
+
* ⚠️ 与 `gap` 不同口径:`gap` 只开放令牌档(防间距分叉),`padding` 接具体值 —— 内距在设计稿里常是**确定坐标**,
|
|
85
|
+
* 令牌梯度(最大 24px)表达不了。⚠️ 用它之前先想一次:这个数真是「内距」吗?若是「与某个内容列对齐」这类**布局
|
|
86
|
+
* 坐标**,优先改由结构表达(同轴容器 / `columns` / `minColumnWidth`)。
|
|
90
87
|
*/
|
|
91
88
|
padding: {
|
|
92
89
|
type: [Number, Object, String],
|
|
@@ -21,31 +21,13 @@ export interface ListViewStatus {
|
|
|
21
21
|
* ## 三态
|
|
22
22
|
*
|
|
23
23
|
* - `loading` → **骨架卡网格**(与卡片同尺寸占位,避免加载完成时高度跳动);
|
|
24
|
-
* - `error` / `empty` → 委托 `QueryState`(口径同 CONTRACT §4.6
|
|
25
|
-
*
|
|
24
|
+
* - `error` / `empty` → 委托 `QueryState`(口径同 CONTRACT §4.6:**错误不得塞进空态**,两条各自的恢复入口由
|
|
25
|
+
* `errorActionText` / `emptyActionText` 给)。
|
|
26
26
|
*
|
|
27
27
|
* 无数据或失败时消费方**不要渲染分页**(分页归属见 CONTRACT §4.17)。
|
|
28
|
+
* **卡片外观**:列表项一律用 `ListView.CardItem`(内部以 `Card interactive` 为壳),消费方不得自绘卡片外观。
|
|
28
29
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* 列表项一律用 `ListView.CardItem`(内部以 `Card interactive` 为壳),消费方不得自绘卡片外观。
|
|
32
|
-
*
|
|
33
|
-
* @example 服务卡片列表(三态;分页由承载它的容器给)
|
|
34
|
-
* <ListView
|
|
35
|
-
* minItemWidth={320}
|
|
36
|
-
* loading={query.isPending.value}
|
|
37
|
-
* error={query.isError.value}
|
|
38
|
-
* errorActionText="重试"
|
|
39
|
-
* onErrorAction={() => void query.refetch()}
|
|
40
|
-
* // 空态:传字符串即空态标题(传 true 会用内置的「暂无数据」)
|
|
41
|
-
* empty={items.value.length === 0 ? '暂无服务' : false}>
|
|
42
|
-
* {items.value.map((item) => (
|
|
43
|
-
* <ListView.CardItem key={item.id} title={item.name} description={item.desc}
|
|
44
|
-
* status={{ label: '在线', tone: 'success', dot: true }}
|
|
45
|
-
* onClick={() => openDetail(item.id)}
|
|
46
|
-
* actions={() => <Button title="编辑" onClick={() => openEdit(item.id)} />} />
|
|
47
|
-
* ))}
|
|
48
|
-
* </ListView>
|
|
30
|
+
* 用法见 `docs/demos/list-view/`(每个维度一份可运行样例;文档页 `docs/components/list-view.md`)。
|
|
49
31
|
*/
|
|
50
32
|
export interface ListViewProps {
|
|
51
33
|
/**
|
|
@@ -82,28 +64,13 @@ export interface ListViewProps {
|
|
|
82
64
|
/**
|
|
83
65
|
* 列表卡片项:卡片的**结构化形态**(图标 / 标题 / 副标题 / 描述 / 标签 / 状态胶囊 / 统计 / 操作位)。
|
|
84
66
|
*
|
|
85
|
-
* 以 `Card interactive`
|
|
86
|
-
*
|
|
87
|
-
* 几何来源同 `Card`(技能市场卡片实测)。
|
|
88
|
-
*
|
|
89
|
-
* 三处「有意为之」:
|
|
90
|
-
* 1. **操作位默认隐藏**(`opacity: 0`),卡片悬浮或卡内获得焦点时显形;触屏(无 hover 能力)恒显形 ——
|
|
91
|
-
* 因此按钮始终可聚焦、可点,只是平时不抢视觉;
|
|
92
|
-
* 2. **操作位点击不冒泡**:卡内按钮(编辑 / 删除)不会顺带触发整卡的 `onClick`(打开详情);
|
|
93
|
-
* 3. **状态胶囊与标签片由本件自绘**,不复用 `Badge`:原型是**全圆角胶囊**与无最小宽的标签片,
|
|
94
|
-
* 而 `Badge` 的几何是方角 + 最小宽(给徽标列宽用的),套进来会改变原型几何。
|
|
67
|
+
* 以 `Card interactive` 为壳,卡片外观与悬浮反馈都来自它;本件只管卡片**内部**的排版与几何(最小高 144、
|
|
68
|
+
* 图标 36、标题 16/600、描述两行截断、尾部贴底、胶囊与标签片),几何来源同 `Card`(技能市场卡片实测)。
|
|
95
69
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* subtitle={`V${item.version}`}
|
|
101
|
-
* description={item.desc}
|
|
102
|
-
* tags={[item.topic, item.domain]}
|
|
103
|
-
* status={{ label: '在线', tone: 'success', dot: true }}
|
|
104
|
-
* extra={() => <><Icon name="download" size={14} />{item.downloadCount}</>}
|
|
105
|
-
* actions={() => <Button title="编辑" onClick={() => openEdit(item.id)} />}
|
|
106
|
-
* onClick={() => openDetail(item.id)} />
|
|
70
|
+
* 三处「有意为之」:① **操作位默认隐藏**(`opacity: 0`),卡片悬浮或卡内获得焦点时显形、触屏恒显形 —— 因此
|
|
71
|
+
* 按钮始终可聚焦、可点,只是平时不抢视觉;② **操作位点击不冒泡**(卡内按钮不会顺带触发整卡的 `onClick`);
|
|
72
|
+
* ③ **状态胶囊与标签片由本件自绘**,不复用 `Badge` —— 原型是**全圆角胶囊**与无最小宽的标签片,而 `Badge` 的
|
|
73
|
+
* 几何是方角 + 最小宽(给徽标列宽用的),套进来会改变原型几何。
|
|
107
74
|
*/
|
|
108
75
|
export interface ListViewCardItemProps {
|
|
109
76
|
/** 图标:图片地址(`<img>`,`alt` 走空串——名称已由标题承担)或自定义节点 / 返回节点的函数 */
|
|
@@ -14,33 +14,22 @@ export interface LoadingProps {
|
|
|
14
14
|
* 加载态(转圈 + 可选文案;三种形态)。
|
|
15
15
|
*
|
|
16
16
|
* ## 三态与三个不同的东西
|
|
17
|
-
*
|
|
18
17
|
* | 形态 | 用什么 | 为什么不是本件 |
|
|
19
18
|
* | --- | --- | --- |
|
|
20
|
-
* |
|
|
19
|
+
* | 区域 / 页面的加载中 | `QueryState` 的 `loading` | 那件带骨架屏与三态切换,是「容器」 |
|
|
21
20
|
* | 内容占位 | `Skeleton` | 骨架屏表达「这里将出现什么」,不是「正在忙」 |
|
|
22
21
|
* | **正在忙、请等待** | 本件 | 遮罩 + 转圈,**拦住交互**才是它的职责 |
|
|
23
22
|
*
|
|
24
23
|
* ## 覆盖档必须由消费方给出定位上下文
|
|
24
|
+
* `overlay="area"` 走 `position: absolute`:它铺的是**最近的定位祖先**,故宿主元素要有 `position: relative`
|
|
25
|
+
* (`Panel.Body` / `Card.Body` 这类件自带)。宿主没有定位上下文时它会跑到更外层去 —— 这是 CSS 的规则,不是本件的缺陷;
|
|
26
|
+
* 界面上看不出错位但覆盖范围不对时,先查这一条。`overlay="screen"` 走 `position: fixed`:铺整个视口,层级压在 `Toast`
|
|
27
|
+
* 堆叠(1080)之上、模态层(原生 `<dialog>` 的 top layer)之下。
|
|
25
28
|
*
|
|
26
|
-
* `
|
|
27
|
-
* `
|
|
28
|
-
* 更外层去 —— 这是 CSS 的规则,不是本件的缺陷;界面上看不出错位但覆盖范围不对时,先查这一条。
|
|
29
|
-
*
|
|
30
|
-
* `overlay="screen"` 走 `position: fixed`:铺整个视口,层级压在 `Toast` 堆叠(1080)之上、
|
|
31
|
-
* 模态层(原生 `<dialog>` 的 top layer)之下。
|
|
32
|
-
*
|
|
33
|
-
* 转圈走 `@manohub/icon` 的 `loading` 字形 + CSS 旋转(**不手绘 SVG**);尺寸按全局图标档
|
|
34
|
-
* `--ui-font-icon` 用 `calc()` 派生,换主题时与其它图标一起缩放。
|
|
35
|
-
*
|
|
36
|
-
* @example 行内:小转圈 + 文案
|
|
37
|
-
* <Loading text="加载中" />
|
|
38
|
-
*
|
|
39
|
-
* @example 区域遮罩(宿主需自带 position: relative)
|
|
40
|
-
* <Panel.Body><Loading overlay="area" text="保存中" /></Panel.Body>
|
|
29
|
+
* 转圈走 `@manohub/icon` 的 `loading` 字形 + CSS 旋转(**不手绘 SVG**);尺寸按全局图标档 `--ui-font-icon` 用
|
|
30
|
+
* `calc()` 派生,换主题时与其它图标一起缩放。
|
|
41
31
|
*
|
|
42
|
-
*
|
|
43
|
-
* <Loading overlay="screen" text="正在导入,请勿关闭页面" />
|
|
32
|
+
* 用法见 `docs/demos/loading/`(每个维度一份可运行样例;文档页 `docs/components/loading.md`)。
|
|
44
33
|
*/
|
|
45
34
|
export declare const Loading: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
46
35
|
text: {
|