@manohub/ui 0.7.0 → 0.7.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/README.md +3 -3
- package/dist/components/button/index.d.ts +8 -8
- package/dist/components/capsule/index.d.ts +13 -9
- package/dist/components/capsule/index.js +1 -1
- package/dist/components/card/index.js +7 -4
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/form/index.d.ts +115 -17
- package/dist/components/form/index.js +39 -9
- package/dist/components/layout/index.d.ts +43 -1
- package/dist/components/layout/index.js +22 -2
- package/dist/components/notice/index.d.ts +2 -2
- package/dist/components/notification/index.d.ts +2 -2
- package/dist/components/page/index.js +4 -4
- package/dist/components/panel/index.js +4 -4
- package/dist/components/part-padding.d.ts +9 -6
- package/dist/components/part-padding.js +2 -1
- package/dist/components/radio/index.d.ts +1 -1
- package/dist/components/radio/index.js +1 -0
- package/dist/components/steps/index.d.ts +232 -6
- package/dist/components/steps/index.js +84 -26
- package/dist/components/switch/index.d.ts +29 -5
- package/dist/components/switch/index.js +8 -2
- package/dist/components/tabbar/index.d.ts +184 -0
- package/dist/components/tabbar/index.js +161 -0
- package/dist/components/table/index.d.ts +74 -8
- package/dist/components/table/index.js +69 -16
- package/dist/components/tabs/index.d.ts +142 -126
- package/dist/components/tabs/index.js +87 -119
- package/dist/components/tag/index.d.ts +2 -2
- package/dist/components/toast/index.d.ts +8 -8
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -3
- package/dist/styles/components/capsule.css +4 -4
- package/dist/styles/components/form.css +206 -26
- package/dist/styles/components/input.css +28 -1
- package/dist/styles/components/layout.css +2 -0
- package/dist/styles/components/steps.css +48 -0
- package/dist/styles/components/{tabs.css → tabbar.css} +66 -65
- package/dist/styles/components/tabbar.tokens.css +30 -0
- package/dist/styles/components/table.css +50 -1
- package/dist/styles/components/table.tokens.css +3 -0
- package/dist/styles/index.css +3 -3
- package/dist/styles/operations/tabs.css +73 -0
- package/package.json +2 -2
- package/dist/components/tabset/index.d.ts +0 -109
- package/dist/components/tabset/index.js +0 -75
- package/dist/styles/components/tabs.tokens.css +0 -30
- package/dist/styles/operations/tabset.css +0 -57
package/README.md
CHANGED
|
@@ -59,13 +59,13 @@ import { Card, Form, Tree, Checkbox } from '@manohub/ui'
|
|
|
59
59
|
| 数据展示 | `Tree`、`ListView`(+ `.CardItem`)、`Badge`、`Tag`(常规 / 状态 / 可选 / 新增 / 筛选片) |
|
|
60
60
|
| 展示 | `Avatar`(+ `.Group`)、`Skeleton`(行 / 列表 / 块状) |
|
|
61
61
|
| 表单基础(**自绘**) | `Button`(+ `.Group` / `.Divider`;五型 / 小号 / 加载 / 菜单按钮 / 连体切换)、`Input`(+ `.Group` / `.Chip` / `.Display` / `.Textarea`;清除 / 可见性切换 / 校验)、`Search`(搜索框:值 / 搜索 / 清空三条回调)、`Select`(单选 / 多选 / 搜索 / 加载;面板用原生 popover)、`Switch`(表格档 / 表单档) |
|
|
62
|
-
| 表单与选择 | `Form`(+ `.Header` / `.Item`;标签体系、成员归位、`v-model` 值收集与命令式 `clear()`)、`Filter`(+ `.Item`;`Form` 的壳:条件字段写成子件、控件自放、查询/重置与快照归一)、`Checkbox`、`Radio`(+ `.Group` / `.Card`;卡片式单选)、`Capsule`(胶囊选择器;胶囊 / 方形两档外形,与 `
|
|
62
|
+
| 表单与选择 | `Form`(+ `.Header` / `.Item`;标签体系、成员归位、`v-model` 值收集与命令式 `clear()`)、`Filter`(+ `.Item`;`Form` 的壳:条件字段写成子件、控件自放、查询/重置与快照归一)、`Checkbox`、`Radio`(+ `.Group` / `.Card`;卡片式单选)、`Capsule`(胶囊选择器;胶囊 / 方形两档外形,与 `Tabs` 组合即页签) |
|
|
63
63
|
| 反馈与三态 | `Notice`(条状提示)、`Notification`(通知卡:标题 + 头像 / 标签 / 操作 / 关闭位)、`QueryState`(三态容器;内建空 / 错误插画取自设计交付的四张 SVG,原样内联在 `src/utils/state-illustration.ts`)、`Loading`(转圈 + 遮罩:行内 / 区域 / 全屏三形态) |
|
|
64
64
|
| 反馈与引导(**自绘**) | `Toast`(消息提示:语义四档 / loading + 可选动作 + 自动消失计时 + `.Stack` 堆叠)、`Steps`(步骤条:节点式 / 燕尾段式 / `.Progress` 进度条) |
|
|
65
|
-
| 数据展示(**自绘**) | `Table`(列 × 数据 + 选择列 + 排序事件 + 固定表头 / 固定列 + 批量栏 / 合计行;排序与列宽拖拽算法归调用方)、`Pagination`(总数 / 每页条数 / 页码窗口 / 简单档 / 外框档)、`
|
|
65
|
+
| 数据展示(**自绘**) | `Table`(列 × 数据 + 选择列 + 排序事件 + 固定表头 / 固定列 + 批量栏 / 合计行;排序与列宽拖拽算法归调用方)、`Pagination`(总数 / 每页条数 / 页码窗口 / 简单档 / 外框档)、`TabBar`(下划线页签 + 「更多」收纳) |
|
|
66
66
|
| 内容与文件 | `Code`(行内 chip / 代码块 + 语言角标 + 图标复制位,**只读展示**)、`CodeEditor`(等宽多行可编辑代码区:按行自适应 / 限高内滚 / 只读、禁用)、`Upload`(+ `.Thumbs`;拖拽 / 点击上传区 + 已传文件列表) |
|
|
67
67
|
| 浮层(**自绘**) | `Dialog`(原生 `<dialog>` + 模态皮肤;关闭受控)、`Tooltip`(**零 JS**:显隐与定位全走操作层 hover 档) |
|
|
68
|
-
|
|
|
68
|
+
| 操作层(跨件原语) | `Collapse`(+ `.Stack`)、`Tabs`(+ `TabPanel`,面板切换骨架 —— 显隐归组件层,非零 JS 原语);浮层只提供样式层(`styles/operations/popup.css`,零 JS 可直接用),Vue 浮层仍用 farris 适配件 |
|
|
69
69
|
|
|
70
70
|
## 三态的操作按钮
|
|
71
71
|
|
|
@@ -212,7 +212,7 @@ export declare const Button: import("vue").DefineComponent<import("vue").Extract
|
|
|
212
212
|
}>> & Readonly<{}>, {
|
|
213
213
|
block: boolean;
|
|
214
214
|
size: ControlSize;
|
|
215
|
-
icon: "
|
|
215
|
+
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
216
216
|
menu: boolean;
|
|
217
217
|
caret: boolean;
|
|
218
218
|
disabled: boolean;
|
|
@@ -223,7 +223,7 @@ export declare const Button: import("vue").DefineComponent<import("vue").Extract
|
|
|
223
223
|
variant: ButtonVariant;
|
|
224
224
|
danger: boolean;
|
|
225
225
|
shape: ButtonShape;
|
|
226
|
-
trailingIcon: "
|
|
226
|
+
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
227
227
|
href: string;
|
|
228
228
|
target: string;
|
|
229
229
|
popoverTarget: string;
|
|
@@ -319,7 +319,7 @@ export declare const ButtonCompound: {
|
|
|
319
319
|
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
320
320
|
block: boolean;
|
|
321
321
|
size: ControlSize;
|
|
322
|
-
icon: "
|
|
322
|
+
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
323
323
|
menu: boolean;
|
|
324
324
|
caret: boolean;
|
|
325
325
|
disabled: boolean;
|
|
@@ -330,7 +330,7 @@ export declare const ButtonCompound: {
|
|
|
330
330
|
variant: ButtonVariant;
|
|
331
331
|
danger: boolean;
|
|
332
332
|
shape: ButtonShape;
|
|
333
|
-
trailingIcon: "
|
|
333
|
+
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
334
334
|
href: string;
|
|
335
335
|
target: string;
|
|
336
336
|
popoverTarget: string;
|
|
@@ -431,7 +431,7 @@ export declare const ButtonCompound: {
|
|
|
431
431
|
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
432
432
|
block: boolean;
|
|
433
433
|
size: ControlSize;
|
|
434
|
-
icon: "
|
|
434
|
+
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
435
435
|
menu: boolean;
|
|
436
436
|
caret: boolean;
|
|
437
437
|
disabled: boolean;
|
|
@@ -442,7 +442,7 @@ export declare const ButtonCompound: {
|
|
|
442
442
|
variant: ButtonVariant;
|
|
443
443
|
danger: boolean;
|
|
444
444
|
shape: ButtonShape;
|
|
445
|
-
trailingIcon: "
|
|
445
|
+
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
446
446
|
href: string;
|
|
447
447
|
target: string;
|
|
448
448
|
popoverTarget: string;
|
|
@@ -537,7 +537,7 @@ export declare const ButtonCompound: {
|
|
|
537
537
|
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
538
538
|
block: boolean;
|
|
539
539
|
size: ControlSize;
|
|
540
|
-
icon: "
|
|
540
|
+
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
541
541
|
menu: boolean;
|
|
542
542
|
caret: boolean;
|
|
543
543
|
disabled: boolean;
|
|
@@ -548,7 +548,7 @@ export declare const ButtonCompound: {
|
|
|
548
548
|
variant: ButtonVariant;
|
|
549
549
|
danger: boolean;
|
|
550
550
|
shape: ButtonShape;
|
|
551
|
-
trailingIcon: "
|
|
551
|
+
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
552
552
|
href: string;
|
|
553
553
|
target: string;
|
|
554
554
|
popoverTarget: string;
|
|
@@ -25,15 +25,16 @@ export type CapsuleShape = 'pill' | 'square';
|
|
|
25
25
|
*
|
|
26
26
|
* ## 与面板组合(页签用法)
|
|
27
27
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* 塞进 `Tabs` 的 `selector` 插槽即可:本件的 `onChange` 把选中值递给 `Tabs` 的 `select`,
|
|
29
|
+
* 面板显隐由 `Tabs` 按受控值下发 `hidden`。本件不认识 tabs,tabs 也不认识本件(两层零互指)。
|
|
30
|
+
* 故**不必**为了组合而给它 `name`(组名不传即按实例自动生成)。
|
|
30
31
|
*
|
|
31
32
|
* 状态三源等价:原生 `input:checked` / 组件下发 `[data-state='active'|'inactive']` / 静态档 `.is-selected`。
|
|
32
33
|
*
|
|
33
34
|
* ## 必须有值
|
|
34
35
|
*
|
|
35
36
|
* 单选语义就是必选其一:受控传 `modelValue`,非受控由 `defaultValue` 起,**两者都没给时缺省选中第一个
|
|
36
|
-
* 可选项**(跳过禁用项;没有可选项才是空值)—— 与 `Radio.Group` / `Radio.Card` / `
|
|
37
|
+
* 可选项**(跳过禁用项;没有可选项才是空值)—— 与 `Radio.Group` / `Radio.Card` / `Tabs` 同一条口径。
|
|
37
38
|
*
|
|
38
39
|
* @example 选项表
|
|
39
40
|
* <Capsule :options="[{label:'全部',value:'all'}]" v-model="v" />
|
|
@@ -42,10 +43,13 @@ export type CapsuleShape = 'pill' | 'square';
|
|
|
42
43
|
* <Capsule shape="square" :options="[{label:'全部',value:'all'}]" v-model="v" />
|
|
43
44
|
*
|
|
44
45
|
* @example 与面板组合(页签)
|
|
45
|
-
* <
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
46
|
+
* <Tabs v-model:value="v">
|
|
47
|
+
* {{
|
|
48
|
+
* selector: ({ value, options, select }) =>
|
|
49
|
+
* <Capsule :options="options" modelValue={value} onChange={select} />,
|
|
50
|
+
* default: () => [<TabPanel name="全部">…</TabPanel>, <TabPanel name="进行中">…</TabPanel>],
|
|
51
|
+
* }}
|
|
52
|
+
* </Tabs>
|
|
49
53
|
*/
|
|
50
54
|
export declare const Capsule: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
51
55
|
/** 选项表(也可用默认插槽自排) */
|
|
@@ -63,7 +67,7 @@ export declare const Capsule: import("vue").DefineComponent<import("vue").Extrac
|
|
|
63
67
|
type: PropType<string | number | undefined>;
|
|
64
68
|
default: undefined;
|
|
65
69
|
};
|
|
66
|
-
/**
|
|
70
|
+
/** 原生分组名(同名才互斥;不传即按实例自动生成) */
|
|
67
71
|
name: {
|
|
68
72
|
type: StringConstructor;
|
|
69
73
|
default: undefined;
|
|
@@ -111,7 +115,7 @@ export declare const Capsule: import("vue").DefineComponent<import("vue").Extrac
|
|
|
111
115
|
type: PropType<string | number | undefined>;
|
|
112
116
|
default: undefined;
|
|
113
117
|
};
|
|
114
|
-
/**
|
|
118
|
+
/** 原生分组名(同名才互斥;不传即按实例自动生成) */
|
|
115
119
|
name: {
|
|
116
120
|
type: StringConstructor;
|
|
117
121
|
default: undefined;
|
|
@@ -36,7 +36,10 @@ function renderHeaderParts(parts) {
|
|
|
36
36
|
}, [parts.extra])];
|
|
37
37
|
}
|
|
38
38
|
const mergeSegmentStyle = (attrsStyle, padding) => {
|
|
39
|
-
if (padding === void 0) return attrsStyle;
|
|
39
|
+
if (padding === void 0 || padding === "") return attrsStyle;
|
|
40
|
+
if (typeof padding === "string") return [attrsStyle, {
|
|
41
|
+
padding
|
|
42
|
+
}];
|
|
40
43
|
const y = typeof padding === "number" ? padding : padding.y;
|
|
41
44
|
const x = typeof padding === "number" ? padding : padding.x;
|
|
42
45
|
const style = {};
|
|
@@ -54,7 +57,7 @@ const CardHeader = /* @__PURE__ */ defineComponent({
|
|
|
54
57
|
props: {
|
|
55
58
|
/** 这一段的内距(横向 + 段间距):缺省吃组件令牌 `--mh-card-padding`(20px);下边由卡片末段统一补 */
|
|
56
59
|
padding: {
|
|
57
|
-
type: [Number, Object],
|
|
60
|
+
type: [Number, Object, String],
|
|
58
61
|
default: void 0
|
|
59
62
|
},
|
|
60
63
|
/** 图标:图片地址或返回节点的函数(图标一律来自 `@manohub/icon`) */
|
|
@@ -96,7 +99,7 @@ const CardBody = /* @__PURE__ */ defineComponent({
|
|
|
96
99
|
props: {
|
|
97
100
|
/** 这一段的内距(横向 + 段间距):缺省吃组件令牌 `--mh-card-padding`(20px);下边由卡片末段统一补 */
|
|
98
101
|
padding: {
|
|
99
|
-
type: [Number, Object],
|
|
102
|
+
type: [Number, Object, String],
|
|
100
103
|
default: void 0
|
|
101
104
|
}
|
|
102
105
|
},
|
|
@@ -117,7 +120,7 @@ const CardFooter = /* @__PURE__ */ defineComponent({
|
|
|
117
120
|
props: {
|
|
118
121
|
/** 这一段的内距(横向 + 段间距):缺省吃组件令牌 `--mh-card-padding`(20px);下边由卡片末段统一补 */
|
|
119
122
|
padding: {
|
|
120
|
-
type: [Number, Object],
|
|
123
|
+
type: [Number, Object, String],
|
|
121
124
|
default: void 0
|
|
122
125
|
}
|
|
123
126
|
},
|
|
@@ -63,6 +63,7 @@ const Checkbox = /* @__PURE__ */ defineComponent({
|
|
|
63
63
|
const state = props.indeterminate ? "indeterminate" : props.modelValue ? "checked" : "unchecked";
|
|
64
64
|
return createVNode("label", {
|
|
65
65
|
"class": ["mh-checkbox", props.size === "md" ? "" : `mh-checkbox--${props.size}`, props.disabled ? "is-disabled" : "", attrs.class].filter(Boolean).join(" "),
|
|
66
|
+
"data-inline-control": "true",
|
|
66
67
|
"style": attrs.style
|
|
67
68
|
}, [createVNode("input", mergeProps(inputAttrs.value, {
|
|
68
69
|
"ref": inputRef,
|
|
@@ -256,8 +256,8 @@ export declare const Dialog: import("vue").DefineComponent<import("vue").Extract
|
|
|
256
256
|
onCancel: () => void;
|
|
257
257
|
onClose: () => void;
|
|
258
258
|
width: number | DialogWidth;
|
|
259
|
-
tone: DialogTone;
|
|
260
259
|
closable: boolean;
|
|
260
|
+
tone: DialogTone;
|
|
261
261
|
closeOnBackdrop: boolean;
|
|
262
262
|
maskClosable: boolean;
|
|
263
263
|
keyboard: boolean;
|
|
@@ -4,6 +4,33 @@ import { type Padding } from '../part-padding';
|
|
|
4
4
|
export type FormPadding = Padding;
|
|
5
5
|
/** label 列的水平对齐:`right`(默认,与 farris / 主流水平表单一致)或 `left` */
|
|
6
6
|
export type FormLabelAlign = 'left' | 'right';
|
|
7
|
+
/**
|
|
8
|
+
* 字段行的排布档:
|
|
9
|
+
*
|
|
10
|
+
* - `1`(默认):逐行;
|
|
11
|
+
* - `2 ~ 6`:**列数上限** —— 容器放得下 N 列就并排,放不下**少排一列**(不会把控件压成窄条)。
|
|
12
|
+
* 高列数(5 / 6)在默认最小宽 320 下要容器 1632 / 1960px 才排得出来,普通表单页用不到 ——
|
|
13
|
+
* 留着它是给「宽屏展示页 / 大屏看板」这类场景,配 `columnMinWidth` 才好落地;
|
|
14
|
+
* - `'auto'`:**列数随容器宽度动态变化** —— 能排几列排几列,每列宽由 `columnMinWidth` 决定。
|
|
15
|
+
*
|
|
16
|
+
* 两类的差别是**可预期性**(不是能力高低):
|
|
17
|
+
*
|
|
18
|
+
* - 数字档承诺「最多 N 列」,所以「哪几个字段同排」在够宽的容器里是确定的;
|
|
19
|
+
* - 动态档会一路排下去(默认参数下 1320px 就够 4 列),窄了就减 ——
|
|
20
|
+
* 同一个表单在不同容器里列数不同 ⇒ **字段的相对位置会变**。要「两个字段必须并肩」就别用它。
|
|
21
|
+
*/
|
|
22
|
+
export type FormColumns = 1 | 2 | 3 | 4 | 5 | 6 | 'auto';
|
|
23
|
+
/**
|
|
24
|
+
* 行内**垂直**对齐(label 与控件在控件行内怎么对齐):
|
|
25
|
+
*
|
|
26
|
+
* - `center`(默认):label 文字与控件**中线**对齐 —— 单行控件(输入框 / 选择器 / 开关)用它;
|
|
27
|
+
* - `start`:label 与控件**首行文字**对齐 —— 多行控件(文本域)与整块内容用它,
|
|
28
|
+
* 否则 label 会落到整块高度的中间。
|
|
29
|
+
*
|
|
30
|
+
* 不传即**自动判定**(样式按控件类型切档:文本域行零配置就是顶对齐);
|
|
31
|
+
* 显式传入优先于自动判定,用于自绘内容(卡片组 / 表格 / 富文本这类样式认不出来的块)。
|
|
32
|
+
*/
|
|
33
|
+
export type FormItemAlign = 'center' | 'start';
|
|
7
34
|
/** 表单值:**字段名 → 值**(键就是 `Form.Item` 的 `name`) */
|
|
8
35
|
export type FormValues = Record<string, unknown>;
|
|
9
36
|
/**
|
|
@@ -31,16 +58,27 @@ export interface FormProps {
|
|
|
31
58
|
*
|
|
32
59
|
* 宽表单(>600px)里让输入框一路拉到右边缘很难看,两种收法二选一:
|
|
33
60
|
* ① 收宽度 —— 传 `controlWidth={360}`,控件列封顶、右侧留白;
|
|
34
|
-
* ②
|
|
61
|
+
* ② 分列 —— 传 `columns`(`2 | 3 | 4` 上限档,或 `'auto'` 动态),把行并排起来(见下)。
|
|
35
62
|
*/
|
|
36
63
|
controlWidth?: number;
|
|
37
64
|
/**
|
|
38
|
-
* 列数:`1
|
|
65
|
+
* 列数:`1`(默认,逐行)/ `2 ~ 6`(**容器够宽才并排**,窄了按列最小宽度自动回落一列)/
|
|
66
|
+
* `'auto'`(列数随容器宽度动态变化,取舍见 `FormColumns`)。
|
|
39
67
|
*
|
|
40
|
-
*
|
|
41
|
-
* 在对应 `Form.Item` 上给 `fullWidth
|
|
68
|
+
* 多列下每一行都要能独立成格,所以「整行内容」(说明行、卡片组、表格、文本域)记得
|
|
69
|
+
* 在对应 `Form.Item` 上给 `fullWidth`,否则会被压成一格。
|
|
42
70
|
*/
|
|
43
|
-
columns?:
|
|
71
|
+
columns?: FormColumns;
|
|
72
|
+
/**
|
|
73
|
+
* 一列的**最小宽度**(px);缺省取令牌 `--ui-form-column-min`(320 = 「label 120 + 一个还能用的
|
|
74
|
+
* 输入框」的下限)。
|
|
75
|
+
*
|
|
76
|
+
* 它同时是**回落阈值**与**动态列数的除数**:数字档下容器窄于
|
|
77
|
+
* `N × 最小宽 + (N − 1) × 行距` 就少排一列;动态档下列数 =
|
|
78
|
+
* `floor((容器宽 + 行距) / (最小宽 + 行距))`。抽屉 / 弹窗里嫌字段太窄就调小(如 280),
|
|
79
|
+
* 宽页面里嫌列太多就调大(如 380)。
|
|
80
|
+
*/
|
|
81
|
+
columnMinWidth?: number;
|
|
44
82
|
/**
|
|
45
83
|
* 表单内距(**px 数字**,与 `Panel` 同一口径):`number` = 四边同值;`{ y, x }` = 上下 / 左右分别给。
|
|
46
84
|
*
|
|
@@ -112,6 +150,11 @@ export interface FormItemProps {
|
|
|
112
150
|
* 两个都给时 `text` 优先(`readonly` 只是把 label 的弱化带过去)。
|
|
113
151
|
*/
|
|
114
152
|
readonly?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* 行内**垂直**对齐:`center`(默认,label 与控件中线对齐)/ `start`(label 与控件首行文字对齐,
|
|
155
|
+
* 用于多行与整块内容)。不传即按控件类型自动判定(文本域自动顶对齐),显式传入优先。
|
|
156
|
+
*/
|
|
157
|
+
align?: FormItemAlign;
|
|
115
158
|
}
|
|
116
159
|
/**
|
|
117
160
|
* 表单行(**自建**):`label + 控件 + 错误 + 说明` 四件。
|
|
@@ -128,13 +171,28 @@ export interface FormItemProps {
|
|
|
128
171
|
* ## 宽表单怎么处理(两条杠杆,可叠加)
|
|
129
172
|
*
|
|
130
173
|
* - **限宽**:`controlWidth` 封顶控件列(表单级给默认、逐行可覆盖)—— 单列表单不至于把输入框拉成长条;
|
|
131
|
-
* -
|
|
132
|
-
*
|
|
133
|
-
*
|
|
174
|
+
* - **分列**:`columns` 让行并排,宽度用得更充分。档位见 `FormColumns`:
|
|
175
|
+
* `2 ~ 6` 是**列数上限**(宽够就并排、窄了自动少排一列);`'auto'` 是**列数随宽度动态变化**。
|
|
176
|
+
* 回落阈值与动态列数都由 `columnMinWidth`(缺省令牌 `--ui-form-column-min` = 320)决定,
|
|
177
|
+
* **不需要消费方写媒体查询**;多列下「整块内容」记得 `fullWidth`。
|
|
134
178
|
*
|
|
135
179
|
* `Form.Item` 是唯一入口(`Form` 只承载表单级设置、行间距/列数与容器内距),
|
|
136
180
|
* 控件从默认插槽进,因此输入框 / 下拉 / 文本域 / 自绘分组卡片共用同一个容器。
|
|
137
181
|
*
|
|
182
|
+
* ## 行内垂直对齐(label 与控件怎么对齐)
|
|
183
|
+
*
|
|
184
|
+
* 对齐参照是**控件那一行**,不是整行:控件列与 label 同处第 1 行,错误 / 说明自然落第 2 行起 ——
|
|
185
|
+
* 所以提示文案的有无与长短都不会带动 label 的位置。规则按控件形态自动切档,消费方零配置:
|
|
186
|
+
*
|
|
187
|
+
* - **单行控件**(输入框 / 选择器 / 开关 / 自绘单行内容):label 与控件**中线**对齐,**与控件高度无关**
|
|
188
|
+
* —— 档位切 sm/md/lg、换主题、放自绘控件都自动成立;
|
|
189
|
+
* - **多行与整块内容**(文本域这类样式认得出形态的):label 与控件**首行文字**对齐,不会落到整块中间;
|
|
190
|
+
* - 样式认不出形态的自绘块(卡片组 / 表格 / 富文本)用 `align="start"` 显式声明;要强制居中用 `align="center"`。
|
|
191
|
+
*
|
|
192
|
+
* **本件不再依赖任何「控件高度」常量**:从前用一个外部注入的高度变量把 label 撑到控件高,
|
|
193
|
+
* 而那个变量在骨架层没有任何出处(回退成 `auto`),于是 label 盒退化成一行文字并贴行顶 ——
|
|
194
|
+
* 输入框中线偏高 6px、大号档偏高 10px、文本域偏高 9px,档位越高错得越多。
|
|
195
|
+
*
|
|
138
196
|
* ## 容器内距(`padding`)
|
|
139
197
|
*
|
|
140
198
|
* 与 `Panel` **同一口径同一实现**(`src/components/part-padding.ts`):`number` 四边同值、
|
|
@@ -211,6 +269,11 @@ export declare const FormItem: import("vue").DefineComponent<import("vue").Extra
|
|
|
211
269
|
type: BooleanConstructor;
|
|
212
270
|
default: boolean;
|
|
213
271
|
};
|
|
272
|
+
/** 行内垂直对齐;不传即自动(单行居中、多行顶对齐) */
|
|
273
|
+
align: {
|
|
274
|
+
type: PropType<FormItemAlign>;
|
|
275
|
+
default: undefined;
|
|
276
|
+
};
|
|
214
277
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
215
278
|
/** 字段名(绑定的键);不传即纯布局行(值由消费方自己在控件上绑定) */
|
|
216
279
|
name: {
|
|
@@ -259,12 +322,18 @@ export declare const FormItem: import("vue").DefineComponent<import("vue").Extra
|
|
|
259
322
|
type: BooleanConstructor;
|
|
260
323
|
default: boolean;
|
|
261
324
|
};
|
|
325
|
+
/** 行内垂直对齐;不传即自动(单行居中、多行顶对齐) */
|
|
326
|
+
align: {
|
|
327
|
+
type: PropType<FormItemAlign>;
|
|
328
|
+
default: undefined;
|
|
329
|
+
};
|
|
262
330
|
}>> & Readonly<{}>, {
|
|
263
331
|
text: string;
|
|
264
332
|
name: string;
|
|
265
333
|
label: string;
|
|
266
334
|
error: string;
|
|
267
335
|
required: boolean;
|
|
336
|
+
align: FormItemAlign;
|
|
268
337
|
readonly: boolean;
|
|
269
338
|
hint: string;
|
|
270
339
|
labelWidth: number;
|
|
@@ -345,11 +414,16 @@ export declare const Form: {
|
|
|
345
414
|
type: NumberConstructor;
|
|
346
415
|
default: undefined;
|
|
347
416
|
};
|
|
348
|
-
/** 列数:1(逐行,默认)/ 2
|
|
417
|
+
/** 列数:1(逐行,默认)/ 2~6(够宽才并排,窄了回落一列)/ 'auto'(列数随容器宽度动态变化) */
|
|
349
418
|
columns: {
|
|
350
|
-
type: PropType<
|
|
419
|
+
type: PropType<FormColumns>;
|
|
351
420
|
default: number;
|
|
352
421
|
};
|
|
422
|
+
/** 一列的最小宽度(px);缺省取令牌 --ui-form-column-min(320);它同时是回落阈值 */
|
|
423
|
+
columnMinWidth: {
|
|
424
|
+
type: NumberConstructor;
|
|
425
|
+
default: undefined;
|
|
426
|
+
};
|
|
353
427
|
/** 表单内距(px 数字,或 `{ y, x }`);缺省 0 = 贴容器边(弹窗 / 抽屉里常用它自带内距) */
|
|
354
428
|
padding: {
|
|
355
429
|
type: PropType<FormPadding>;
|
|
@@ -398,11 +472,12 @@ export declare const Form: {
|
|
|
398
472
|
onChange: (values: FormValues) => void;
|
|
399
473
|
defaultValue: FormValues;
|
|
400
474
|
gap: number;
|
|
401
|
-
columns:
|
|
475
|
+
columns: FormColumns;
|
|
402
476
|
modelValue: FormValues;
|
|
403
477
|
labelWidth: number;
|
|
404
478
|
labelAlign: FormLabelAlign;
|
|
405
479
|
controlWidth: number;
|
|
480
|
+
columnMinWidth: number;
|
|
406
481
|
}, true, {}, SlotsType<{
|
|
407
482
|
default?: () => VNodeChild;
|
|
408
483
|
}>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
@@ -428,11 +503,16 @@ export declare const Form: {
|
|
|
428
503
|
type: NumberConstructor;
|
|
429
504
|
default: undefined;
|
|
430
505
|
};
|
|
431
|
-
/** 列数:1(逐行,默认)/ 2
|
|
506
|
+
/** 列数:1(逐行,默认)/ 2~6(够宽才并排,窄了回落一列)/ 'auto'(列数随容器宽度动态变化) */
|
|
432
507
|
columns: {
|
|
433
|
-
type: PropType<
|
|
508
|
+
type: PropType<FormColumns>;
|
|
434
509
|
default: number;
|
|
435
510
|
};
|
|
511
|
+
/** 一列的最小宽度(px);缺省取令牌 --ui-form-column-min(320);它同时是回落阈值 */
|
|
512
|
+
columnMinWidth: {
|
|
513
|
+
type: NumberConstructor;
|
|
514
|
+
default: undefined;
|
|
515
|
+
};
|
|
436
516
|
/** 表单内距(px 数字,或 `{ y, x }`);缺省 0 = 贴容器边(弹窗 / 抽屉里常用它自带内距) */
|
|
437
517
|
padding: {
|
|
438
518
|
type: PropType<FormPadding>;
|
|
@@ -479,11 +559,12 @@ export declare const Form: {
|
|
|
479
559
|
onChange: (values: FormValues) => void;
|
|
480
560
|
defaultValue: FormValues;
|
|
481
561
|
gap: number;
|
|
482
|
-
columns:
|
|
562
|
+
columns: FormColumns;
|
|
483
563
|
modelValue: FormValues;
|
|
484
564
|
labelWidth: number;
|
|
485
565
|
labelAlign: FormLabelAlign;
|
|
486
566
|
controlWidth: number;
|
|
567
|
+
columnMinWidth: number;
|
|
487
568
|
}>;
|
|
488
569
|
__isFragment?: never;
|
|
489
570
|
__isTeleport?: never;
|
|
@@ -504,11 +585,16 @@ export declare const Form: {
|
|
|
504
585
|
type: NumberConstructor;
|
|
505
586
|
default: undefined;
|
|
506
587
|
};
|
|
507
|
-
/** 列数:1(逐行,默认)/ 2
|
|
588
|
+
/** 列数:1(逐行,默认)/ 2~6(够宽才并排,窄了回落一列)/ 'auto'(列数随容器宽度动态变化) */
|
|
508
589
|
columns: {
|
|
509
|
-
type: PropType<
|
|
590
|
+
type: PropType<FormColumns>;
|
|
510
591
|
default: number;
|
|
511
592
|
};
|
|
593
|
+
/** 一列的最小宽度(px);缺省取令牌 --ui-form-column-min(320);它同时是回落阈值 */
|
|
594
|
+
columnMinWidth: {
|
|
595
|
+
type: NumberConstructor;
|
|
596
|
+
default: undefined;
|
|
597
|
+
};
|
|
512
598
|
/** 表单内距(px 数字,或 `{ y, x }`);缺省 0 = 贴容器边(弹窗 / 抽屉里常用它自带内距) */
|
|
513
599
|
padding: {
|
|
514
600
|
type: PropType<FormPadding>;
|
|
@@ -557,11 +643,12 @@ export declare const Form: {
|
|
|
557
643
|
onChange: (values: FormValues) => void;
|
|
558
644
|
defaultValue: FormValues;
|
|
559
645
|
gap: number;
|
|
560
|
-
columns:
|
|
646
|
+
columns: FormColumns;
|
|
561
647
|
modelValue: FormValues;
|
|
562
648
|
labelWidth: number;
|
|
563
649
|
labelAlign: FormLabelAlign;
|
|
564
650
|
controlWidth: number;
|
|
651
|
+
columnMinWidth: number;
|
|
565
652
|
}, {}, string, SlotsType<{
|
|
566
653
|
default?: () => VNodeChild;
|
|
567
654
|
}>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
@@ -637,6 +724,11 @@ export declare const Form: {
|
|
|
637
724
|
type: BooleanConstructor;
|
|
638
725
|
default: boolean;
|
|
639
726
|
};
|
|
727
|
+
/** 行内垂直对齐;不传即自动(单行居中、多行顶对齐) */
|
|
728
|
+
align: {
|
|
729
|
+
type: PropType<FormItemAlign>;
|
|
730
|
+
default: undefined;
|
|
731
|
+
};
|
|
640
732
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
641
733
|
/** 字段名(绑定的键);不传即纯布局行(值由消费方自己在控件上绑定) */
|
|
642
734
|
name: {
|
|
@@ -685,12 +777,18 @@ export declare const Form: {
|
|
|
685
777
|
type: BooleanConstructor;
|
|
686
778
|
default: boolean;
|
|
687
779
|
};
|
|
780
|
+
/** 行内垂直对齐;不传即自动(单行居中、多行顶对齐) */
|
|
781
|
+
align: {
|
|
782
|
+
type: PropType<FormItemAlign>;
|
|
783
|
+
default: undefined;
|
|
784
|
+
};
|
|
688
785
|
}>> & Readonly<{}>, {
|
|
689
786
|
text: string;
|
|
690
787
|
name: string;
|
|
691
788
|
label: string;
|
|
692
789
|
error: string;
|
|
693
790
|
required: boolean;
|
|
791
|
+
align: FormItemAlign;
|
|
694
792
|
readonly: boolean;
|
|
695
793
|
hint: string;
|
|
696
794
|
labelWidth: number;
|
|
@@ -55,6 +55,11 @@ const FormItem = /* @__PURE__ */ defineComponent({
|
|
|
55
55
|
readonly: {
|
|
56
56
|
type: Boolean,
|
|
57
57
|
default: false
|
|
58
|
+
},
|
|
59
|
+
/** 行内垂直对齐;不传即自动(单行居中、多行顶对齐) */
|
|
60
|
+
align: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: void 0
|
|
58
63
|
}
|
|
59
64
|
},
|
|
60
65
|
slots: Object,
|
|
@@ -95,6 +100,10 @@ const FormItem = /* @__PURE__ */ defineComponent({
|
|
|
95
100
|
"mh-form-item",
|
|
96
101
|
props.error ? "is-invalid" : "",
|
|
97
102
|
props.fullWidth ? "mh-form-item--full" : "",
|
|
103
|
+
// 无 label 列:控件位与提示横跨整行(两列 grid 下第一列不能留空位)
|
|
104
|
+
showLabel ? "" : "mh-form-item--no-label",
|
|
105
|
+
// 行内垂直对齐:**只在显式传入时**挂类;不传即由样式按控件类型自动判定(见 form.css 的顶对齐档)
|
|
106
|
+
props.align ? `mh-form-item--align-${props.align}` : "",
|
|
98
107
|
// 右对齐是基类默认值,只有左对齐需要额外的修饰类(两处都挂会让「谁胜出」依赖源码顺序)
|
|
99
108
|
labelAlign === "left" ? "mh-form-item--label-left" : "",
|
|
100
109
|
// 只读展示行:label 降一档为次要色,与值拉开层级(样式见 `.mh-form-item--readonly .mh-form-item__label`)
|
|
@@ -123,11 +132,11 @@ const FormItem = /* @__PURE__ */ defineComponent({
|
|
|
123
132
|
"class": "mh-form-item__text",
|
|
124
133
|
"data-empty": textIsEmpty ? "true" : "false"
|
|
125
134
|
}, [textIsEmpty ? FORM_TEXT_EMPTY : props.text])
|
|
126
|
-
) : slots.default?.(scope()), props.error ? createVNode("div", {
|
|
135
|
+
) : slots.default?.(scope())]), props.error ? createVNode("div", {
|
|
127
136
|
"class": "mh-form-item__error"
|
|
128
137
|
}, [props.error]) : null, props.hint ? createVNode("div", {
|
|
129
138
|
"class": "mh-form-item__hint"
|
|
130
|
-
}, [props.hint]) : null])
|
|
139
|
+
}, [props.hint]) : null]);
|
|
131
140
|
};
|
|
132
141
|
}
|
|
133
142
|
});
|
|
@@ -198,14 +207,19 @@ const FormRoot = /* @__PURE__ */ defineComponent({
|
|
|
198
207
|
type: Number,
|
|
199
208
|
default: void 0
|
|
200
209
|
},
|
|
201
|
-
/** 列数:1(逐行,默认)/ 2
|
|
210
|
+
/** 列数:1(逐行,默认)/ 2~6(够宽才并排,窄了回落一列)/ 'auto'(列数随容器宽度动态变化) */
|
|
202
211
|
columns: {
|
|
203
|
-
type: Number,
|
|
212
|
+
type: [Number, String],
|
|
204
213
|
default: 1
|
|
205
214
|
},
|
|
215
|
+
/** 一列的最小宽度(px);缺省取令牌 --ui-form-column-min(320);它同时是回落阈值 */
|
|
216
|
+
columnMinWidth: {
|
|
217
|
+
type: Number,
|
|
218
|
+
default: void 0
|
|
219
|
+
},
|
|
206
220
|
/** 表单内距(px 数字,或 `{ y, x }`);缺省 0 = 贴容器边(弹窗 / 抽屉里常用它自带内距) */
|
|
207
221
|
padding: {
|
|
208
|
-
type: [Number, Object],
|
|
222
|
+
type: [Number, Object, String],
|
|
209
223
|
default: void 0
|
|
210
224
|
},
|
|
211
225
|
/**
|
|
@@ -302,6 +316,12 @@ const FormRoot = /* @__PURE__ */ defineComponent({
|
|
|
302
316
|
return cleared;
|
|
303
317
|
}
|
|
304
318
|
});
|
|
319
|
+
const columnsClass = () => {
|
|
320
|
+
const value = props.columns;
|
|
321
|
+
if (value === "auto") return "mh-form--columns-auto";
|
|
322
|
+
if (typeof value !== "number" || value <= 1) return "";
|
|
323
|
+
return value === 2 ? "mh-form--two-column" : `mh-form--columns-${value}`;
|
|
324
|
+
};
|
|
305
325
|
return () => {
|
|
306
326
|
const raw = slots.default?.();
|
|
307
327
|
const list = Array.isArray(raw) ? raw : raw == null ? [] : [raw];
|
|
@@ -310,10 +330,20 @@ const FormRoot = /* @__PURE__ */ defineComponent({
|
|
|
310
330
|
rest
|
|
311
331
|
} = splitFormHeader(list);
|
|
312
332
|
return createVNode("div", {
|
|
313
|
-
"class": ["mh-form",
|
|
314
|
-
"style": [
|
|
315
|
-
|
|
316
|
-
|
|
333
|
+
"class": ["mh-form", columnsClass(), props.layout === "vertical" ? "mh-form--vertical" : "", attrs.class].filter(Boolean).join(" "),
|
|
334
|
+
"style": [
|
|
335
|
+
mergePartStyle(attrs.style, props.padding),
|
|
336
|
+
/* 行距同时下发实体 `gap` 与变量:多列的轨道下限公式要用**同一个**行距值算 ——
|
|
337
|
+
从前公式里硬编码 8px,`gap={16}` 时列宽会算偏(临界宽度上还会误判回落)。 */
|
|
338
|
+
props.gap !== void 0 ? {
|
|
339
|
+
gap: `${props.gap}px`,
|
|
340
|
+
"--mh-form-gap": `${props.gap}px`
|
|
341
|
+
} : null,
|
|
342
|
+
/* 一列最小宽度:动态档列数的除数、数字档的回落阈值 */
|
|
343
|
+
props.columnMinWidth !== void 0 ? {
|
|
344
|
+
"--mh-form-column-min": `${props.columnMinWidth}px`
|
|
345
|
+
} : null
|
|
346
|
+
]
|
|
317
347
|
}, [header, rest]);
|
|
318
348
|
};
|
|
319
349
|
}
|