@manohub/ui 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/index.d.ts +8 -8
- package/dist/components/input/bordered.d.ts +15 -0
- package/dist/components/input/bordered.js +8 -0
- package/dist/components/input/index.d.ts +82 -31
- package/dist/components/input/index.js +16 -6
- package/dist/components/input/number-input.d.ts +239 -0
- package/dist/components/input/number-input.js +240 -0
- package/dist/components/notice/index.d.ts +1 -1
- package/dist/components/notification/index.d.ts +1 -1
- package/dist/components/select/index.d.ts +19 -0
- package/dist/components/select/index.js +10 -0
- package/dist/components/select/select-tree.d.ts +11 -0
- package/dist/components/select/select-tree.js +6 -0
- package/dist/components/select/select-trigger.d.ts +17 -0
- package/dist/components/select/select-trigger.js +9 -0
- package/dist/components/table/index.d.ts +85 -10
- package/dist/components/table/index.js +38 -9
- package/dist/components/toast/index.d.ts +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -0
- package/dist/styles/components/form.css +14 -0
- package/dist/styles/components/form.tokens.css +4 -0
- package/dist/styles/components/input.css +159 -38
- package/dist/styles/components/table.css +6 -0
- package/package.json +2 -2
|
@@ -218,7 +218,7 @@ export declare const Button: import("vue").DefineComponent<import("vue").Extract
|
|
|
218
218
|
}>> & Readonly<{}>, {
|
|
219
219
|
block: boolean;
|
|
220
220
|
size: ControlSize;
|
|
221
|
-
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "
|
|
221
|
+
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "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" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
222
222
|
menu: boolean;
|
|
223
223
|
caret: boolean;
|
|
224
224
|
disabled: boolean;
|
|
@@ -229,7 +229,7 @@ export declare const Button: import("vue").DefineComponent<import("vue").Extract
|
|
|
229
229
|
variant: ButtonVariant;
|
|
230
230
|
danger: boolean;
|
|
231
231
|
shape: ButtonShape;
|
|
232
|
-
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "
|
|
232
|
+
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "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" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
233
233
|
href: string;
|
|
234
234
|
target: string;
|
|
235
235
|
popoverTarget: string;
|
|
@@ -325,7 +325,7 @@ export declare const ButtonCompound: {
|
|
|
325
325
|
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
326
326
|
block: boolean;
|
|
327
327
|
size: ControlSize;
|
|
328
|
-
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "
|
|
328
|
+
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "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" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
329
329
|
menu: boolean;
|
|
330
330
|
caret: boolean;
|
|
331
331
|
disabled: boolean;
|
|
@@ -336,7 +336,7 @@ export declare const ButtonCompound: {
|
|
|
336
336
|
variant: ButtonVariant;
|
|
337
337
|
danger: boolean;
|
|
338
338
|
shape: ButtonShape;
|
|
339
|
-
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "
|
|
339
|
+
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "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" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
340
340
|
href: string;
|
|
341
341
|
target: string;
|
|
342
342
|
popoverTarget: string;
|
|
@@ -437,7 +437,7 @@ export declare const ButtonCompound: {
|
|
|
437
437
|
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
438
438
|
block: boolean;
|
|
439
439
|
size: ControlSize;
|
|
440
|
-
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "
|
|
440
|
+
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "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" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
441
441
|
menu: boolean;
|
|
442
442
|
caret: boolean;
|
|
443
443
|
disabled: boolean;
|
|
@@ -448,7 +448,7 @@ export declare const ButtonCompound: {
|
|
|
448
448
|
variant: ButtonVariant;
|
|
449
449
|
danger: boolean;
|
|
450
450
|
shape: ButtonShape;
|
|
451
|
-
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "
|
|
451
|
+
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "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" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
452
452
|
href: string;
|
|
453
453
|
target: string;
|
|
454
454
|
popoverTarget: string;
|
|
@@ -543,7 +543,7 @@ export declare const ButtonCompound: {
|
|
|
543
543
|
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
544
544
|
block: boolean;
|
|
545
545
|
size: ControlSize;
|
|
546
|
-
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "
|
|
546
|
+
icon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "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" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
547
547
|
menu: boolean;
|
|
548
548
|
caret: boolean;
|
|
549
549
|
disabled: boolean;
|
|
@@ -554,7 +554,7 @@ export declare const ButtonCompound: {
|
|
|
554
554
|
variant: ButtonVariant;
|
|
555
555
|
danger: boolean;
|
|
556
556
|
shape: ButtonShape;
|
|
557
|
-
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "
|
|
557
|
+
trailingIcon: "search" | "link" | "filter" | "copy" | "help" | "table" | "menu" | "delete" | "image" | "close" | "key" | "application" | "client" | "service" | "schema" | "compose" | "log" | "mcp" | "agent" | "server" | "exposure" | "openapi" | "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" | "page-title" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "info-circle" | "check-circle" | "alert-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
|
|
558
558
|
href: string;
|
|
559
559
|
target: string;
|
|
560
560
|
popoverTarget: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `bordered` 三档 → 控件类名(**唯一来源**)。
|
|
3
|
+
*
|
|
4
|
+
* 输入族三个件(`Input` / `Textarea` / `NumberInput`)共用同一份面与同一个 prop,判定表抄三份必然漂,
|
|
5
|
+
* 故收在这里。类名口径:prop 是**肯定式**(`bordered`)、类名是**否定式**(`--borderless`)——
|
|
6
|
+
* 那一对的反差是库内既定口径(见 `docs/guide/naming-and-defaults.md` §2.1);
|
|
7
|
+
* `'focus'` 档的类名 `--border-on-focus` 是这套口径下的新成员:它说的就是「聚焦时才有框」。
|
|
8
|
+
*
|
|
9
|
+
* | `bordered` | 类名 | 常态 | 悬停 | 聚焦 |
|
|
10
|
+
* | --- | --- | --- | --- | --- |
|
|
11
|
+
* | `true`(缺省) | (无) | 有框 | 框变色 | 框变色 + 主色环 |
|
|
12
|
+
* | `'focus'` | `.mh-input--border-on-focus` | 无框无底 | 复用有框档那句 | 显框 + 主色环(复用) |
|
|
13
|
+
* | `false` | `.mh-input--borderless` | 无框无底 | 无 | 无(本档效果只有一种) |
|
|
14
|
+
*/
|
|
15
|
+
export declare const borderedClassOf: (bordered: boolean | "focus" | undefined) => string;
|
|
@@ -109,11 +109,19 @@ export declare const Input: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
109
109
|
default: boolean;
|
|
110
110
|
};
|
|
111
111
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
112
|
+
* 有无边框,三档(判定表见 `./bordered.ts`,输入族三件共用):
|
|
113
|
+
*
|
|
114
|
+
* - `true`(缺省)**常有框**;
|
|
115
|
+
* - `false` **无框** —— 常态、悬停、聚焦都不出现(本档的效果只有一种);
|
|
116
|
+
* - `'focus'` **聚焦(与悬停)才显出框** —— 行内编辑那档:常态看着像「值」,点进去才亮框;
|
|
117
|
+
* 悬停 / 聚焦的表现**复用有框档那两条**,不另写一套。
|
|
118
|
+
*
|
|
119
|
+
* 配 `readonly` 即**只读值档**(摘要 / 详情里回显业务值的推荐写法,也是 `Form.Item` 的
|
|
120
|
+
* `readonly` 行配的那一档):几何与可编辑输入框完全一致,但不给任何「可编辑」线索。
|
|
121
|
+
* 只读值档请写 `readonly` + `bordered={false}`;`readonly` + `'focus'` 会被中和(兜底,不推荐)。
|
|
114
122
|
*/
|
|
115
123
|
bordered: {
|
|
116
|
-
type:
|
|
124
|
+
type: PropType<boolean | "focus">;
|
|
117
125
|
default: boolean;
|
|
118
126
|
};
|
|
119
127
|
maxlength: {
|
|
@@ -228,11 +236,19 @@ export declare const Input: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
228
236
|
default: boolean;
|
|
229
237
|
};
|
|
230
238
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
239
|
+
* 有无边框,三档(判定表见 `./bordered.ts`,输入族三件共用):
|
|
240
|
+
*
|
|
241
|
+
* - `true`(缺省)**常有框**;
|
|
242
|
+
* - `false` **无框** —— 常态、悬停、聚焦都不出现(本档的效果只有一种);
|
|
243
|
+
* - `'focus'` **聚焦(与悬停)才显出框** —— 行内编辑那档:常态看着像「值」,点进去才亮框;
|
|
244
|
+
* 悬停 / 聚焦的表现**复用有框档那两条**,不另写一套。
|
|
245
|
+
*
|
|
246
|
+
* 配 `readonly` 即**只读值档**(摘要 / 详情里回显业务值的推荐写法,也是 `Form.Item` 的
|
|
247
|
+
* `readonly` 行配的那一档):几何与可编辑输入框完全一致,但不给任何「可编辑」线索。
|
|
248
|
+
* 只读值档请写 `readonly` + `bordered={false}`;`readonly` + `'focus'` 会被中和(兜底,不推荐)。
|
|
233
249
|
*/
|
|
234
250
|
bordered: {
|
|
235
|
-
type:
|
|
251
|
+
type: PropType<boolean | "focus">;
|
|
236
252
|
default: boolean;
|
|
237
253
|
};
|
|
238
254
|
maxlength: {
|
|
@@ -289,7 +305,7 @@ export declare const Input: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
289
305
|
type: string;
|
|
290
306
|
onChange: (v: string) => void;
|
|
291
307
|
invalid: boolean;
|
|
292
|
-
bordered: boolean;
|
|
308
|
+
bordered: boolean | "focus";
|
|
293
309
|
defaultValue: string;
|
|
294
310
|
placeholder: string;
|
|
295
311
|
autofocus: boolean;
|
|
@@ -297,10 +313,10 @@ export declare const Input: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
297
313
|
status: InputStatus;
|
|
298
314
|
as: "button" | "input";
|
|
299
315
|
readonly: boolean;
|
|
316
|
+
onEnter: (v: string) => void;
|
|
300
317
|
clearable: boolean;
|
|
301
318
|
maxlength: number;
|
|
302
319
|
showCount: boolean;
|
|
303
|
-
onEnter: (v: string) => void;
|
|
304
320
|
controlClass: string;
|
|
305
321
|
controlAttrs: Record<string, unknown>;
|
|
306
322
|
hasValue: boolean;
|
|
@@ -328,8 +344,8 @@ export interface TextareaProps {
|
|
|
328
344
|
invalid?: boolean;
|
|
329
345
|
/** 校验状态(`invalid` 的显式写法) */
|
|
330
346
|
status?: InputStatus;
|
|
331
|
-
/**
|
|
332
|
-
bordered?: boolean;
|
|
347
|
+
/** 是否带边框(三档口径见 `Input` 的同名 prop:`true` / `false` / `'focus'`) */
|
|
348
|
+
bordered?: boolean | 'focus';
|
|
333
349
|
maxlength?: number;
|
|
334
350
|
/** 右下角字数统计(须给 `maxlength` 才渲染) */
|
|
335
351
|
showCount?: boolean;
|
|
@@ -388,8 +404,9 @@ export declare const Textarea: import("vue").DefineComponent<import("vue").Extra
|
|
|
388
404
|
type: PropType<InputStatus>;
|
|
389
405
|
default: undefined;
|
|
390
406
|
};
|
|
407
|
+
/** 是否带边框(三档口径见 `Input` 的同名 prop:`true` 常有框 / `false` 无框 / `'focus'` 聚焦才显框) */
|
|
391
408
|
bordered: {
|
|
392
|
-
type:
|
|
409
|
+
type: PropType<boolean | "focus">;
|
|
393
410
|
default: boolean;
|
|
394
411
|
};
|
|
395
412
|
maxlength: {
|
|
@@ -453,8 +470,9 @@ export declare const Textarea: import("vue").DefineComponent<import("vue").Extra
|
|
|
453
470
|
type: PropType<InputStatus>;
|
|
454
471
|
default: undefined;
|
|
455
472
|
};
|
|
473
|
+
/** 是否带边框(三档口径见 `Input` 的同名 prop:`true` 常有框 / `false` 无框 / `'focus'` 聚焦才显框) */
|
|
456
474
|
bordered: {
|
|
457
|
-
type:
|
|
475
|
+
type: PropType<boolean | "focus">;
|
|
458
476
|
default: boolean;
|
|
459
477
|
};
|
|
460
478
|
maxlength: {
|
|
@@ -481,7 +499,7 @@ export declare const Textarea: import("vue").DefineComponent<import("vue").Extra
|
|
|
481
499
|
disabled: boolean;
|
|
482
500
|
onChange: (v: string) => void;
|
|
483
501
|
invalid: boolean;
|
|
484
|
-
bordered: boolean;
|
|
502
|
+
bordered: boolean | "focus";
|
|
485
503
|
defaultValue: string;
|
|
486
504
|
placeholder: string;
|
|
487
505
|
rows: number;
|
|
@@ -558,11 +576,19 @@ export declare const InputCompound: {
|
|
|
558
576
|
default: boolean;
|
|
559
577
|
};
|
|
560
578
|
/**
|
|
561
|
-
*
|
|
562
|
-
*
|
|
579
|
+
* 有无边框,三档(判定表见 `./bordered.ts`,输入族三件共用):
|
|
580
|
+
*
|
|
581
|
+
* - `true`(缺省)**常有框**;
|
|
582
|
+
* - `false` **无框** —— 常态、悬停、聚焦都不出现(本档的效果只有一种);
|
|
583
|
+
* - `'focus'` **聚焦(与悬停)才显出框** —— 行内编辑那档:常态看着像「值」,点进去才亮框;
|
|
584
|
+
* 悬停 / 聚焦的表现**复用有框档那两条**,不另写一套。
|
|
585
|
+
*
|
|
586
|
+
* 配 `readonly` 即**只读值档**(摘要 / 详情里回显业务值的推荐写法,也是 `Form.Item` 的
|
|
587
|
+
* `readonly` 行配的那一档):几何与可编辑输入框完全一致,但不给任何「可编辑」线索。
|
|
588
|
+
* 只读值档请写 `readonly` + `bordered={false}`;`readonly` + `'focus'` 会被中和(兜底,不推荐)。
|
|
563
589
|
*/
|
|
564
590
|
bordered: {
|
|
565
|
-
type:
|
|
591
|
+
type: PropType<boolean | "focus">;
|
|
566
592
|
default: boolean;
|
|
567
593
|
};
|
|
568
594
|
maxlength: {
|
|
@@ -621,7 +647,7 @@ export declare const InputCompound: {
|
|
|
621
647
|
type: string;
|
|
622
648
|
onChange: (v: string) => void;
|
|
623
649
|
invalid: boolean;
|
|
624
|
-
bordered: boolean;
|
|
650
|
+
bordered: boolean | "focus";
|
|
625
651
|
defaultValue: string;
|
|
626
652
|
placeholder: string;
|
|
627
653
|
autofocus: boolean;
|
|
@@ -629,10 +655,10 @@ export declare const InputCompound: {
|
|
|
629
655
|
status: InputStatus;
|
|
630
656
|
as: "button" | "input";
|
|
631
657
|
readonly: boolean;
|
|
658
|
+
onEnter: (v: string) => void;
|
|
632
659
|
clearable: boolean;
|
|
633
660
|
maxlength: number;
|
|
634
661
|
showCount: boolean;
|
|
635
|
-
onEnter: (v: string) => void;
|
|
636
662
|
controlClass: string;
|
|
637
663
|
controlAttrs: Record<string, unknown>;
|
|
638
664
|
hasValue: boolean;
|
|
@@ -711,11 +737,19 @@ export declare const InputCompound: {
|
|
|
711
737
|
default: boolean;
|
|
712
738
|
};
|
|
713
739
|
/**
|
|
714
|
-
*
|
|
715
|
-
*
|
|
740
|
+
* 有无边框,三档(判定表见 `./bordered.ts`,输入族三件共用):
|
|
741
|
+
*
|
|
742
|
+
* - `true`(缺省)**常有框**;
|
|
743
|
+
* - `false` **无框** —— 常态、悬停、聚焦都不出现(本档的效果只有一种);
|
|
744
|
+
* - `'focus'` **聚焦(与悬停)才显出框** —— 行内编辑那档:常态看着像「值」,点进去才亮框;
|
|
745
|
+
* 悬停 / 聚焦的表现**复用有框档那两条**,不另写一套。
|
|
746
|
+
*
|
|
747
|
+
* 配 `readonly` 即**只读值档**(摘要 / 详情里回显业务值的推荐写法,也是 `Form.Item` 的
|
|
748
|
+
* `readonly` 行配的那一档):几何与可编辑输入框完全一致,但不给任何「可编辑」线索。
|
|
749
|
+
* 只读值档请写 `readonly` + `bordered={false}`;`readonly` + `'focus'` 会被中和(兜底,不推荐)。
|
|
716
750
|
*/
|
|
717
751
|
bordered: {
|
|
718
|
-
type:
|
|
752
|
+
type: PropType<boolean | "focus">;
|
|
719
753
|
default: boolean;
|
|
720
754
|
};
|
|
721
755
|
maxlength: {
|
|
@@ -772,7 +806,7 @@ export declare const InputCompound: {
|
|
|
772
806
|
type: string;
|
|
773
807
|
onChange: (v: string) => void;
|
|
774
808
|
invalid: boolean;
|
|
775
|
-
bordered: boolean;
|
|
809
|
+
bordered: boolean | "focus";
|
|
776
810
|
defaultValue: string;
|
|
777
811
|
placeholder: string;
|
|
778
812
|
autofocus: boolean;
|
|
@@ -780,10 +814,10 @@ export declare const InputCompound: {
|
|
|
780
814
|
status: InputStatus;
|
|
781
815
|
as: "button" | "input";
|
|
782
816
|
readonly: boolean;
|
|
817
|
+
onEnter: (v: string) => void;
|
|
783
818
|
clearable: boolean;
|
|
784
819
|
maxlength: number;
|
|
785
820
|
showCount: boolean;
|
|
786
|
-
onEnter: (v: string) => void;
|
|
787
821
|
controlClass: string;
|
|
788
822
|
controlAttrs: Record<string, unknown>;
|
|
789
823
|
hasValue: boolean;
|
|
@@ -855,11 +889,19 @@ export declare const InputCompound: {
|
|
|
855
889
|
default: boolean;
|
|
856
890
|
};
|
|
857
891
|
/**
|
|
858
|
-
*
|
|
859
|
-
*
|
|
892
|
+
* 有无边框,三档(判定表见 `./bordered.ts`,输入族三件共用):
|
|
893
|
+
*
|
|
894
|
+
* - `true`(缺省)**常有框**;
|
|
895
|
+
* - `false` **无框** —— 常态、悬停、聚焦都不出现(本档的效果只有一种);
|
|
896
|
+
* - `'focus'` **聚焦(与悬停)才显出框** —— 行内编辑那档:常态看着像「值」,点进去才亮框;
|
|
897
|
+
* 悬停 / 聚焦的表现**复用有框档那两条**,不另写一套。
|
|
898
|
+
*
|
|
899
|
+
* 配 `readonly` 即**只读值档**(摘要 / 详情里回显业务值的推荐写法,也是 `Form.Item` 的
|
|
900
|
+
* `readonly` 行配的那一档):几何与可编辑输入框完全一致,但不给任何「可编辑」线索。
|
|
901
|
+
* 只读值档请写 `readonly` + `bordered={false}`;`readonly` + `'focus'` 会被中和(兜底,不推荐)。
|
|
860
902
|
*/
|
|
861
903
|
bordered: {
|
|
862
|
-
type:
|
|
904
|
+
type: PropType<boolean | "focus">;
|
|
863
905
|
default: boolean;
|
|
864
906
|
};
|
|
865
907
|
maxlength: {
|
|
@@ -918,7 +960,7 @@ export declare const InputCompound: {
|
|
|
918
960
|
type: string;
|
|
919
961
|
onChange: (v: string) => void;
|
|
920
962
|
invalid: boolean;
|
|
921
|
-
bordered: boolean;
|
|
963
|
+
bordered: boolean | "focus";
|
|
922
964
|
defaultValue: string;
|
|
923
965
|
placeholder: string;
|
|
924
966
|
autofocus: boolean;
|
|
@@ -926,10 +968,10 @@ export declare const InputCompound: {
|
|
|
926
968
|
status: InputStatus;
|
|
927
969
|
as: "button" | "input";
|
|
928
970
|
readonly: boolean;
|
|
971
|
+
onEnter: (v: string) => void;
|
|
929
972
|
clearable: boolean;
|
|
930
973
|
maxlength: number;
|
|
931
974
|
showCount: boolean;
|
|
932
|
-
onEnter: (v: string) => void;
|
|
933
975
|
controlClass: string;
|
|
934
976
|
controlAttrs: Record<string, unknown>;
|
|
935
977
|
hasValue: boolean;
|
|
@@ -980,8 +1022,9 @@ export declare const InputCompound: {
|
|
|
980
1022
|
type: PropType<InputStatus>;
|
|
981
1023
|
default: undefined;
|
|
982
1024
|
};
|
|
1025
|
+
/** 是否带边框(三档口径见 `Input` 的同名 prop:`true` 常有框 / `false` 无框 / `'focus'` 聚焦才显框) */
|
|
983
1026
|
bordered: {
|
|
984
|
-
type:
|
|
1027
|
+
type: PropType<boolean | "focus">;
|
|
985
1028
|
default: boolean;
|
|
986
1029
|
};
|
|
987
1030
|
maxlength: {
|
|
@@ -1045,8 +1088,9 @@ export declare const InputCompound: {
|
|
|
1045
1088
|
type: PropType<InputStatus>;
|
|
1046
1089
|
default: undefined;
|
|
1047
1090
|
};
|
|
1091
|
+
/** 是否带边框(三档口径见 `Input` 的同名 prop:`true` 常有框 / `false` 无框 / `'focus'` 聚焦才显框) */
|
|
1048
1092
|
bordered: {
|
|
1049
|
-
type:
|
|
1093
|
+
type: PropType<boolean | "focus">;
|
|
1050
1094
|
default: boolean;
|
|
1051
1095
|
};
|
|
1052
1096
|
maxlength: {
|
|
@@ -1073,7 +1117,7 @@ export declare const InputCompound: {
|
|
|
1073
1117
|
disabled: boolean;
|
|
1074
1118
|
onChange: (v: string) => void;
|
|
1075
1119
|
invalid: boolean;
|
|
1076
|
-
bordered: boolean;
|
|
1120
|
+
bordered: boolean | "focus";
|
|
1077
1121
|
defaultValue: string;
|
|
1078
1122
|
placeholder: string;
|
|
1079
1123
|
rows: number;
|
|
@@ -1102,3 +1146,10 @@ export declare const InputCompound: {
|
|
|
1102
1146
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1103
1147
|
};
|
|
1104
1148
|
export type InputCompoundType = typeof InputCompound;
|
|
1149
|
+
/**
|
|
1150
|
+
* 数字输入与 `Input` **同族**(同一个表壳 / 内距 / 状态协议,同一份面 `input.css`),
|
|
1151
|
+
* 故与 `Textarea` 同款处置:**平级导出、共用本目录**(`AGENTS.md` 硬约束 1)。
|
|
1152
|
+
* 它**不是** `Input` 的点号成员 —— 成员位留给「同一件自己的形态」(`.Textarea` / `.Display`),
|
|
1153
|
+
* 而数字输入是另一件(值模型 `number | null` vs `string`)。
|
|
1154
|
+
*/
|
|
1155
|
+
export { NumberInput, type NumberInputProps } from './number-input';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, createVNode, mergeProps, createTextVNode } from "vue";
|
|
2
2
|
import { Icon } from "@manohub/icon";
|
|
3
|
+
import { borderedClassOf } from "./bordered.js";
|
|
3
4
|
const Input = /* @__PURE__ */ defineComponent({
|
|
4
5
|
name: "Input",
|
|
5
6
|
inheritAttrs: false,
|
|
@@ -67,11 +68,19 @@ const Input = /* @__PURE__ */ defineComponent({
|
|
|
67
68
|
default: false
|
|
68
69
|
},
|
|
69
70
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
71
|
+
* 有无边框,三档(判定表见 `./bordered.ts`,输入族三件共用):
|
|
72
|
+
*
|
|
73
|
+
* - `true`(缺省)**常有框**;
|
|
74
|
+
* - `false` **无框** —— 常态、悬停、聚焦都不出现(本档的效果只有一种);
|
|
75
|
+
* - `'focus'` **聚焦(与悬停)才显出框** —— 行内编辑那档:常态看着像「值」,点进去才亮框;
|
|
76
|
+
* 悬停 / 聚焦的表现**复用有框档那两条**,不另写一套。
|
|
77
|
+
*
|
|
78
|
+
* 配 `readonly` 即**只读值档**(摘要 / 详情里回显业务值的推荐写法,也是 `Form.Item` 的
|
|
79
|
+
* `readonly` 行配的那一档):几何与可编辑输入框完全一致,但不给任何「可编辑」线索。
|
|
80
|
+
* 只读值档请写 `readonly` + `bordered={false}`;`readonly` + `'focus'` 会被中和(兜底,不推荐)。
|
|
72
81
|
*/
|
|
73
82
|
bordered: {
|
|
74
|
-
type: Boolean,
|
|
83
|
+
type: [Boolean, String],
|
|
75
84
|
default: true
|
|
76
85
|
},
|
|
77
86
|
maxlength: {
|
|
@@ -174,7 +183,7 @@ const Input = /* @__PURE__ */ defineComponent({
|
|
|
174
183
|
};
|
|
175
184
|
const inputType = computed(() => props.type === "password" && revealed.value ? "text" : props.type);
|
|
176
185
|
const isTrigger = computed(() => props.as === "button");
|
|
177
|
-
const controlClasses = computed(() => ["mh-input", isTrigger.value ? "mh-input--trigger" : "", props.size === "md" ? "" : `mh-input--${props.size}`, props.bordered
|
|
186
|
+
const controlClasses = computed(() => ["mh-input", isTrigger.value ? "mh-input--trigger" : "", props.size === "md" ? "" : `mh-input--${props.size}`, borderedClassOf(props.bordered), visualStatus.value ? `is-${visualStatus.value}` : "", props.disabled ? "is-disabled" : "", props.controlClass].filter(Boolean).join(" "));
|
|
178
187
|
const showClear = computed(() => props.clearable && (props.hasValue ?? !!current.value));
|
|
179
188
|
const showCounter = computed(() => !isTrigger.value && props.showCount && props.maxlength !== void 0);
|
|
180
189
|
const showPlaceholder = computed(() => isTrigger.value && props.hasValue === false && !!props.placeholder);
|
|
@@ -283,8 +292,9 @@ const Textarea = /* @__PURE__ */ defineComponent({
|
|
|
283
292
|
type: String,
|
|
284
293
|
default: void 0
|
|
285
294
|
},
|
|
295
|
+
/** 是否带边框(三档口径见 `Input` 的同名 prop:`true` 常有框 / `false` 无框 / `'focus'` 聚焦才显框) */
|
|
286
296
|
bordered: {
|
|
287
|
-
type: Boolean,
|
|
297
|
+
type: [Boolean, String],
|
|
288
298
|
default: true
|
|
289
299
|
},
|
|
290
300
|
maxlength: {
|
|
@@ -344,7 +354,7 @@ const Textarea = /* @__PURE__ */ defineComponent({
|
|
|
344
354
|
"class": ["mh-input__wrap", attrs.class].filter(Boolean).join(" "),
|
|
345
355
|
"style": attrs.style
|
|
346
356
|
}, [createVNode("textarea", mergeProps(forwardAttrs.value, {
|
|
347
|
-
"class": ["mh-input", "mh-input--textarea", props.size === "md" ? "" : `mh-input--${props.size}`, props.bordered
|
|
357
|
+
"class": ["mh-input", "mh-input--textarea", props.size === "md" ? "" : `mh-input--${props.size}`, borderedClassOf(props.bordered), visualStatus.value ? `is-${visualStatus.value}` : "", props.disabled ? "is-disabled" : ""].filter(Boolean).join(" "),
|
|
348
358
|
"rows": autoRows.value,
|
|
349
359
|
"value": current.value,
|
|
350
360
|
"placeholder": props.placeholder,
|