@manohub/ui 1.0.4 → 1.0.6
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 +28 -62
- package/dist/components/checkbox/index.d.ts +1 -9
- package/dist/components/code-block/index.d.ts +28 -55
- package/dist/components/collapse/index.d.ts +2 -0
- package/dist/components/dialog/index.d.ts +9 -18
- package/dist/components/dialog/index.js +3 -2
- 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 +86 -218
- package/dist/components/form/index.js +5 -12
- package/dist/components/input/bordered.d.ts +4 -6
- package/dist/components/input/index.d.ts +36 -83
- package/dist/components/input/index.js +6 -11
- 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 +29 -71
- 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 +33 -70
- 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 +13 -17
- package/dist/components/search/index.d.ts +12 -32
- package/dist/components/select/index.d.ts +30 -49
- 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 +20 -72
- package/dist/components/table/index.js +4 -8
- 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 +51 -101
- package/dist/components/tree/index.js +17 -33
- package/dist/components/upload/index.d.ts +1 -4
- package/dist/index.d.ts +2 -2
- package/dist/services/base.d.ts +32 -8
- package/dist/services/dialog.d.ts +13 -23
- package/dist/services/dialog.js +2 -0
- 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/avatar.css +5 -7
- package/dist/styles/components/avatar.tokens.css +4 -9
- package/dist/styles/components/badge.css +3 -6
- package/dist/styles/components/badge.tokens.css +5 -17
- package/dist/styles/components/button.css +35 -57
- package/dist/styles/components/button.tokens.css +5 -14
- package/dist/styles/components/capsule.css +13 -20
- package/dist/styles/components/capsule.tokens.css +4 -9
- package/dist/styles/components/card.css +13 -24
- package/dist/styles/components/checkbox.css +11 -15
- package/dist/styles/components/checkbox.tokens.css +4 -9
- package/dist/styles/components/code-block.css +30 -40
- package/dist/styles/components/code-block.tokens.css +7 -20
- package/dist/styles/components/collapse.css +6 -10
- package/dist/styles/components/collapse.tokens.css +4 -9
- package/dist/styles/components/dialog.css +19 -27
- package/dist/styles/components/dialog.tokens.css +9 -9
- package/dist/styles/components/divider.css +9 -14
- package/dist/styles/components/divider.tokens.css +4 -9
- package/dist/styles/components/drawer.css +12 -16
- package/dist/styles/components/drawer.tokens.css +7 -9
- package/dist/styles/components/filter.css +13 -24
- package/dist/styles/components/form.css +77 -149
- package/dist/styles/components/form.tokens.css +9 -6
- package/dist/styles/components/input.css +73 -177
- package/dist/styles/components/input.tokens.css +5 -13
- package/dist/styles/components/layout.css +13 -29
- package/dist/styles/components/loading.css +6 -10
- package/dist/styles/components/loading.tokens.css +4 -9
- package/dist/styles/components/notice.css +3 -1
- package/dist/styles/components/notice.tokens.css +8 -6
- package/dist/styles/components/notification.css +9 -12
- package/dist/styles/components/notification.tokens.css +4 -12
- package/dist/styles/components/page.css +32 -48
- package/dist/styles/components/pagination.css +14 -15
- package/dist/styles/components/pagination.tokens.css +4 -9
- package/dist/styles/components/query-state.css +1 -1
- package/dist/styles/components/query-state.tokens.css +6 -0
- package/dist/styles/components/radio.css +12 -25
- package/dist/styles/components/radio.tokens.css +4 -9
- package/dist/styles/components/search.css +8 -18
- package/dist/styles/components/select.css +63 -109
- package/dist/styles/components/select.tokens.css +4 -12
- package/dist/styles/components/skeleton.css +4 -7
- package/dist/styles/components/skeleton.tokens.css +4 -9
- package/dist/styles/components/steps.css +9 -12
- package/dist/styles/components/steps.tokens.css +4 -12
- package/dist/styles/components/switch.css +7 -8
- package/dist/styles/components/switch.tokens.css +4 -9
- package/dist/styles/components/tabbar.css +12 -11
- package/dist/styles/components/tabbar.tokens.css +4 -9
- package/dist/styles/components/table.css +52 -93
- package/dist/styles/components/table.tokens.css +5 -6
- package/dist/styles/components/tag.css +13 -23
- package/dist/styles/components/tag.tokens.css +5 -11
- package/dist/styles/components/text.css +11 -23
- package/dist/styles/components/toast.css +11 -18
- package/dist/styles/components/toast.tokens.css +6 -9
- package/dist/styles/components/tooltip.css +9 -11
- package/dist/styles/components/tooltip.tokens.css +5 -9
- package/dist/styles/components/tree.css +14 -27
- package/dist/styles/components/tree.tokens.css +5 -6
- package/dist/styles/components/upload.css +10 -13
- package/dist/styles/components/upload.tokens.css +4 -9
- package/dist/styles/index.css +27 -50
- package/dist/styles/operations/collapse.css +12 -25
- package/dist/styles/operations/popup.css +41 -79
- package/dist/styles/operations/tabs.css +14 -32
- package/dist/styles/reset.css +0 -61
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
2
|
-
export type DialogWidth = 'md' | 'lg';
|
|
2
|
+
export type DialogWidth = 'sm' | 'md' | 'lg';
|
|
3
3
|
/** 语义档:决定标题左侧图标的图形与颜色(缺省不渲染图标) */
|
|
4
4
|
export type DialogTone = 'info' | 'success' | 'warning' | 'error';
|
|
5
5
|
/**
|
|
@@ -7,14 +7,14 @@ export type DialogTone = 'info' | 'success' | 'warning' | 'error';
|
|
|
7
7
|
*
|
|
8
8
|
* ## JS 只做「原生做不到的那两件」
|
|
9
9
|
*
|
|
10
|
-
* 模态语义、Esc、焦点陷阱、`::backdrop` 遮罩、top layer
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* 模态语义、Esc、焦点陷阱、`::backdrop` 遮罩、top layer 渲染都是浏览器给 `<dialog>` 的原生能力,本件
|
|
11
|
+
* **不自建浮层**(不做定位计算、不做 focus trap、不写遮罩层),只做:① 把**受控的 `open` 同步到原生 API**
|
|
12
|
+
* (`open` 变真 → `showModal()`,变假 → `close()`);② 内建底栏的「确定」在 `onOk` 返回 Promise 时自动进
|
|
13
|
+
* 加载态并吞重复点击。
|
|
14
14
|
*
|
|
15
15
|
* ## 关闭是受控的
|
|
16
16
|
*
|
|
17
|
-
* 关闭位、Esc(原生 `cancel`
|
|
17
|
+
* 关闭位、Esc(原生 `cancel` 事件)与点遮罩都只回调(`update:open(false)` + `onClose()` / `onCancel()`);
|
|
18
18
|
* 可见性归消费方 —— 避免「组件自己消失、业务状态还以为开着」两套口径。
|
|
19
19
|
*
|
|
20
20
|
* ## 底栏三态(**由消费方按需选一**,不要混着用)
|
|
@@ -25,16 +25,7 @@ export type DialogTone = 'info' | 'success' | 'warning' | 'error';
|
|
|
25
25
|
* | 给 `okText` / `onOk` | 内建底栏:`[取消] [确定]`,按钮就是本包 `Button` |
|
|
26
26
|
* | `:show-footer="false"` | 不渲染底栏(纯提示 / 只有关闭位) |
|
|
27
27
|
*
|
|
28
|
-
*
|
|
29
|
-
* <Dialog v-model:open="visible" title="删除确认" ok-text="删除" :on-ok="remove" :on-cancel="() => (visible = false)">
|
|
30
|
-
* 删除后不可恢复,确认继续?
|
|
31
|
-
* </Dialog>
|
|
32
|
-
*
|
|
33
|
-
* @example 自绘底栏
|
|
34
|
-
* <Dialog v-model:open="visible" title="详情">
|
|
35
|
-
* 正文
|
|
36
|
-
* <template #footer><Button variant="text" @click="visible = false">关闭</Button></template>
|
|
37
|
-
* </Dialog>
|
|
28
|
+
* 用法见 `docs/demos/dialog/`(每个维度一份可运行样例;文档页 `docs/components/dialog.md`)。
|
|
38
29
|
*/
|
|
39
30
|
export declare const Dialog: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
40
31
|
/** 受控开合 */
|
|
@@ -56,7 +47,7 @@ export declare const Dialog: import("vue").DefineComponent<import("vue").Extract
|
|
|
56
47
|
type: PropType<DialogTone>;
|
|
57
48
|
default: undefined;
|
|
58
49
|
};
|
|
59
|
-
/** 宽度:尺寸档 `md` 520 / `lg` 760,或直接给像素数 */
|
|
50
|
+
/** 宽度:尺寸档 `sm` 400 / `md` 520 / `lg` 760,或直接给像素数 */
|
|
60
51
|
width: {
|
|
61
52
|
type: PropType<DialogWidth | number>;
|
|
62
53
|
default: string;
|
|
@@ -163,7 +154,7 @@ export declare const Dialog: import("vue").DefineComponent<import("vue").Extract
|
|
|
163
154
|
type: PropType<DialogTone>;
|
|
164
155
|
default: undefined;
|
|
165
156
|
};
|
|
166
|
-
/** 宽度:尺寸档 `md` 520 / `lg` 760,或直接给像素数 */
|
|
157
|
+
/** 宽度:尺寸档 `sm` 400 / `md` 520 / `lg` 760,或直接给像素数 */
|
|
167
158
|
width: {
|
|
168
159
|
type: PropType<DialogWidth | number>;
|
|
169
160
|
default: string;
|
|
@@ -30,7 +30,7 @@ const Dialog = /* @__PURE__ */ defineComponent({
|
|
|
30
30
|
type: String,
|
|
31
31
|
default: void 0
|
|
32
32
|
},
|
|
33
|
-
/** 宽度:尺寸档 `md` 520 / `lg` 760,或直接给像素数 */
|
|
33
|
+
/** 宽度:尺寸档 `sm` 400 / `md` 520 / `lg` 760,或直接给像素数 */
|
|
34
34
|
width: {
|
|
35
35
|
type: [String, Number],
|
|
36
36
|
default: "md"
|
|
@@ -169,12 +169,13 @@ const Dialog = /* @__PURE__ */ defineComponent({
|
|
|
169
169
|
};
|
|
170
170
|
return void 0;
|
|
171
171
|
});
|
|
172
|
+
const widthClass = computed(() => typeof props.width === "string" && props.width !== "md" ? `mh-dialog--${props.width}` : "");
|
|
172
173
|
const heightStyle = computed(() => props.panelHeight ? {
|
|
173
174
|
height: props.panelHeight
|
|
174
175
|
} : void 0);
|
|
175
176
|
return () => createVNode("dialog", {
|
|
176
177
|
"ref": dialogRef,
|
|
177
|
-
"class": ["mh-popup", "mh-dialog",
|
|
178
|
+
"class": ["mh-popup", "mh-dialog", widthClass.value, props.tone ? `mh-dialog--${props.tone}` : "", attrs.class].filter(Boolean).join(" "),
|
|
178
179
|
"style": {
|
|
179
180
|
...widthStyle.value,
|
|
180
181
|
...heightStyle.value,
|
|
@@ -16,18 +16,7 @@ export interface DividerProps {
|
|
|
16
16
|
* `vertical` 档的高度走 `align-self: stretch`:父级是 flex 行时自动占满整行高;
|
|
17
17
|
* 父级没有确定高度时退到 `1em`(不会塌成 0)。
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* <Divider />
|
|
21
|
-
*
|
|
22
|
-
* @example 带中段文字
|
|
23
|
-
* <Divider label="高级筛选" />
|
|
24
|
-
*
|
|
25
|
-
* @example 左侧树栏与主栏之间的一条竖线
|
|
26
|
-
* <div style="display:flex">
|
|
27
|
-
* <aside>…</aside>
|
|
28
|
-
* <Divider direction="vertical" />
|
|
29
|
-
* <main>…</main>
|
|
30
|
-
* </div>
|
|
19
|
+
* 用法见 `docs/demos/divider/`(每个维度一份可运行样例;文档页 `docs/components/divider.md`)。
|
|
31
20
|
*/
|
|
32
21
|
export declare const Divider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
33
22
|
direction: {
|
|
@@ -6,18 +6,16 @@ export type DrawerSide = 'left' | 'right';
|
|
|
6
6
|
*
|
|
7
7
|
* ## 与 `Dialog` 的关系:同一套行为,只换落位
|
|
8
8
|
*
|
|
9
|
-
* 模态语义、Esc、焦点陷阱、`::backdrop` 遮罩、top layer 渲染都是**原生 `<dialog>`**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* ② 内建底栏的「确定」在 `onOk` 返回 Promise 时自动进加载态并吞重复点击。
|
|
9
|
+
* 模态语义、Esc、焦点陷阱、`::backdrop` 遮罩、top layer 渲染都是**原生 `<dialog>`** 给的,本件因此与
|
|
10
|
+
* `Dialog` 共用同一条「JS 只做原生做不到的那两件」的取舍:① 把受控的 `open` 同步到原生 API(真 →
|
|
11
|
+
* `showModal()`,假 → `close()`);② 内建底栏的「确定」在 `onOk` 返回 Promise 时自动进加载态并吞重复点击。
|
|
13
12
|
* 差异只有一条:本件贴屏幕某一侧、**整屏高**,而不是视口居中。
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* 所以类名同样并列 `.mh-popup`(操作层状态根)+ 本族皮肤,开合、遮罩、UA 装饰归零全部免费继承。
|
|
13
|
+
* **不另开一套浮层机制**:抽屉不是「新的定位体系」,是同一张面板换个落位 —— 故类名同样并列 `.mh-popup`
|
|
14
|
+
* (操作层状态根)+ 本族皮肤,开合 / 遮罩 / UA 装饰归零全部免费继承。
|
|
17
15
|
*
|
|
18
16
|
* ## 关闭是受控的
|
|
19
17
|
*
|
|
20
|
-
* 关闭位、Esc(原生 `cancel`
|
|
18
|
+
* 关闭位、Esc(原生 `cancel` 事件)与点遮罩都只回调(`update:open(false)` + `onClose()` / `onCancel()`);
|
|
21
19
|
* 可见性归消费方 —— 避免「组件自己消失、业务状态还以为开着」两套口径。
|
|
22
20
|
*
|
|
23
21
|
* ## 底栏三态(**由消费方按需选一**,不要混着用)
|
|
@@ -28,13 +26,7 @@ export type DrawerSide = 'left' | 'right';
|
|
|
28
26
|
* | 给 `okText` / `onOk` | 内建底栏:`[取消] [确定]`,按钮就是本包 `Button` |
|
|
29
27
|
* | `:show-footer="false"` | 不渲染底栏(纯展示抽屉) |
|
|
30
28
|
*
|
|
31
|
-
*
|
|
32
|
-
* <Drawer v-model:open="visible" title="MCP 配置" width={640} :on-ok="save" :on-cancel="() => (visible = false)">
|
|
33
|
-
* …抽屉内容…
|
|
34
|
-
* </Drawer>
|
|
35
|
-
*
|
|
36
|
-
* @example 右侧属性面板(窄、无底栏、自绘关闭位)
|
|
37
|
-
* <Drawer v-model:open="visible" title="属性" :width="320" :show-footer="false">…</Drawer>
|
|
29
|
+
* 用法见 `docs/demos/drawer/`(每个维度一份可运行样例;文档页 `docs/components/drawer.md`)。
|
|
38
30
|
*/
|
|
39
31
|
export declare const Drawer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
40
32
|
/** 受控开合 */
|
|
@@ -1,36 +1,29 @@
|
|
|
1
1
|
import { type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
2
2
|
/**
|
|
3
3
|
* 条件值:单值(文本 / 单选)或数组(多选)。数字与字符串同等对待(取值原样透传)。
|
|
4
|
+
*
|
|
5
|
+
* 用法见 `docs/demos/filter/`(每个维度一份可运行样例;文档页 `docs/components/filter.md`)。
|
|
4
6
|
*/
|
|
5
7
|
export type FilterValue = string | number | Array<string | number>;
|
|
6
8
|
/** 条件快照:`条件名 → 值`(未选条件的值为空串,语义是「不过滤」) */
|
|
7
9
|
export type FilterValues = Record<string, FilterValue>;
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* 自绘场景更推荐直接用 `placeholder="全部"` 表达未选(本包 `Select` 把空串视为未选中,
|
|
13
|
-
* 会显示占位文案)—— 两条路子的最终视觉一致,见 `docs/components/filter.md`。
|
|
11
|
+
* 「全部」哨兵:选项值等于它即「不过滤」。与既有查询方案(骨架层的筛选适配件)同词,便于迁移时**选项表原样搬运**;
|
|
12
|
+
* 自绘场景更推荐直接用 `placeholder="全部"` 表达未选(本包 `Select` 把空串视为未选中 → 显示占位文案)—— 两条路子
|
|
13
|
+
* 的最终视觉一致,见 `docs/components/filter.md`。
|
|
14
14
|
*/
|
|
15
15
|
export declare const FILTER_ALL = "all";
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* - `auto`:值变化即查询(发 `onQuery`)—— 适合「改即查」的轻量条件区。
|
|
22
|
-
* 此时**同一次变化不再发 `onChange`**(一个变化只对应一个事件,消费方两处都接也不会查两遍),
|
|
23
|
-
* 且操作区默认不渲染(见 `showReset`)。
|
|
24
|
-
*
|
|
25
|
-
* 两种时机下**值变化都会发 `update:modelValue`**(`v-model` 落地不受时机影响)。
|
|
17
|
+
* 筛选时机:`manual`(缺省)—— 值变化只回写快照(`onChange`),查询由**回车 / 「筛选」按钮**显式触发
|
|
18
|
+
* (`onQuery`),适合「几个字段填完再查」的条件区;`auto` —— 值变化即查询(发 `onQuery`),适合「改即查」的轻量
|
|
19
|
+
* 条件区,此时**同一次变化不再发 `onChange`**(一个变化只对应一个事件,消费方两处都接也不会查两遍),且操作区
|
|
20
|
+
* 默认不渲染(见 `showReset`)。两种时机下**值变化都会发 `update:modelValue`**(`v-model` 落地不受时机影响)。
|
|
26
21
|
*/
|
|
27
22
|
export type FilterTrigger = 'manual' | 'auto';
|
|
28
23
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* (`'all'` 哨兵 / `null` / 空数组都归到空串),于是消费方直接把 `value` 绑给控件即可,
|
|
33
|
-
* 不必自己处理哨兵——这是 `Filter.Item` 相对 `Form.Item` 唯一的增量。
|
|
24
|
+
* 筛选字段的作用域插槽:控件由消费方渲染,本件交出**归一后**的当前值。与 `Form.Item` 的作用域同形,差别只在归一:
|
|
25
|
+
* 筛选语义里「未选」一律是空串(`'all'` 哨兵 / `null` / 空数组都归到空串),故消费方直接把 `value` 绑给控件即可
|
|
26
|
+
* —— 这是 `Filter.Item` 相对 `Form.Item` 唯一的增量。
|
|
34
27
|
*/
|
|
35
28
|
export interface FilterItemSlotScope {
|
|
36
29
|
/** 当前条件值(已归一:空串 = 未选) */
|
|
@@ -41,11 +34,9 @@ export interface FilterItemSlotScope {
|
|
|
41
34
|
clear: () => void;
|
|
42
35
|
}
|
|
43
36
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* - 数字原样(`0` 是有效值,不是「空」);
|
|
48
|
-
* - 其余原样(不做 trim:归一不负责改写用户输入)。
|
|
37
|
+
* 归一(读与写**同一份实现**,两处不各写一套):`'all'`(哨兵)/ `''` / `null` / `undefined` → `''`(= 不过滤);
|
|
38
|
+
* 数组逐项归一后去空、全空 → `''`(**只剩一项仍是数组**,多选值的类型不降级成标量);数字原样(`0` 是有效值,
|
|
39
|
+
* 不是「空」);其余原样(不做 trim:归一不负责改写用户输入)。
|
|
49
40
|
*/
|
|
50
41
|
export declare function normalizeFilterValue(value: FilterValue | null | undefined): FilterValue;
|
|
51
42
|
export interface FilterProps {
|
|
@@ -53,12 +44,7 @@ export interface FilterProps {
|
|
|
53
44
|
title?: string;
|
|
54
45
|
/** 标题下的说明小字(透传给 `Form.Header`) */
|
|
55
46
|
description?: string;
|
|
56
|
-
/**
|
|
57
|
-
* label 列宽(px),透传给 `Form`。
|
|
58
|
-
*
|
|
59
|
-
* **缺省不设**:不传即与 `Form` 一致(取令牌 `--ui-form-label-width`,120)。
|
|
60
|
-
* 想收窄(筛选条的标签多为四字)就显式传,例如 `labelWidth={68}`。
|
|
61
|
-
*/
|
|
47
|
+
/** label 列宽(px),透传给 `Form`;**缺省不设**(不传即与 `Form` 一致,取令牌 `--ui-form-label-width` = 120)。想收窄(筛选条标签多为四字)就显式传,如 `labelWidth={68}`。 */
|
|
62
48
|
labelWidth?: number;
|
|
63
49
|
/** 受控条件快照(`条件名 → 值`);不传即非受控(由 `defaultValue` 起) */
|
|
64
50
|
modelValue?: FilterValues;
|
|
@@ -68,15 +54,9 @@ export interface FilterProps {
|
|
|
68
54
|
queryText?: string;
|
|
69
55
|
/** 「重置」按钮文案 */
|
|
70
56
|
resetText?: string;
|
|
71
|
-
/**
|
|
72
|
-
* 是否渲染「重置」按钮 —— **两档的缺省口径不同**(故本项缺省是 `undefined` 而非 `true`):
|
|
73
|
-
* `manual` 缺省渲染(`:show-reset="false"` 才隐藏);`auto` 缺省**不**渲染(显式传 `true` 才留一颗)。
|
|
74
|
-
*/
|
|
57
|
+
/** 是否渲染「重置」按钮 —— **两档缺省口径不同**(故缺省是 `undefined` 而非 `true`):`manual` 缺省渲染,`auto` 缺省**不**渲染(显式 `true` 才留一颗)。 */
|
|
75
58
|
showReset?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* 筛选时机:`manual`(缺省)值变化只回写、查询靠「筛选」按钮 / 字段区回车;
|
|
78
|
-
* `auto` 值变化**即**查询,且操作区默认不渲染(详见组件说明「筛选时机」一节)。
|
|
79
|
-
*/
|
|
59
|
+
/** 筛选时机:`manual`(缺省)值变化只回写、查询靠「筛选」按钮 / 字段区回车;`auto` 值变化**即**查询,且操作区默认不渲染(详见组件说明「筛选时机」)。 */
|
|
80
60
|
trigger?: FilterTrigger;
|
|
81
61
|
/** 条件值变化(快照已归一)。**`auto` 下不发** —— 同一次变化改走 `onQuery` */
|
|
82
62
|
onChange?: (values: FilterValues) => void;
|
|
@@ -106,13 +86,6 @@ export interface FilterItemProps {
|
|
|
106
86
|
*
|
|
107
87
|
* 字段宽**自适应**:字段区是 `Form` 的多列动态档(`Filter` 传 `columns="auto"`),
|
|
108
88
|
* 故本件只输出 `Form.Item` 自己的类 —— 列宽由那条网格轨道算,换行下来的字段与上一行逐列对齐。
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* <Filter.Item code="status" label="授权状态">
|
|
112
|
-
* {{ default: ({ value, setValue }) => (
|
|
113
|
-
* <Select options={statusOptions} modelValue={String(value)} placeholder="全部" onChange={setValue} />
|
|
114
|
-
* ) }}
|
|
115
|
-
* </Filter.Item>
|
|
116
89
|
*/
|
|
117
90
|
export declare const FilterItem: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
118
91
|
code: {
|
|
@@ -196,14 +169,9 @@ export declare const Filter: {
|
|
|
196
169
|
default: string;
|
|
197
170
|
};
|
|
198
171
|
/**
|
|
199
|
-
* 是否渲染「重置」按钮。**缺省值随时机而变**(故本 prop 缺省是 `undefined
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
* - `trigger="auto"`:缺省**不渲染** —— 自动模式下操作区整块让位给字段,
|
|
203
|
-
* 要留一颗重置按钮就得**显式**写 `show-reset`。
|
|
204
|
-
*
|
|
205
|
-
* 自动模式下一键清空的另一条路是各字段自带的清除位(控件自己的 `clearable`),
|
|
206
|
-
* 或页面级入口(`Form.Header` 的 `extra` 一侧)。
|
|
172
|
+
* 是否渲染「重置」按钮。**缺省值随时机而变**(故本 prop 缺省是 `undefined`、不是 `true`):`manual` 缺省**渲染**
|
|
173
|
+
* (只有显式 `:show-reset="false"` 才隐藏);`auto` 缺省**不渲染**(操作区整块让位给字段,要留一颗就得**显式**写
|
|
174
|
+
* `show-reset`)。自动模式下一键清空的另一条路是各字段自带的清除位,或页面级入口。
|
|
207
175
|
*/
|
|
208
176
|
showReset: {
|
|
209
177
|
type: BooleanConstructor;
|
|
@@ -282,14 +250,9 @@ export declare const Filter: {
|
|
|
282
250
|
default: string;
|
|
283
251
|
};
|
|
284
252
|
/**
|
|
285
|
-
* 是否渲染「重置」按钮。**缺省值随时机而变**(故本 prop 缺省是 `undefined
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
* - `trigger="auto"`:缺省**不渲染** —— 自动模式下操作区整块让位给字段,
|
|
289
|
-
* 要留一颗重置按钮就得**显式**写 `show-reset`。
|
|
290
|
-
*
|
|
291
|
-
* 自动模式下一键清空的另一条路是各字段自带的清除位(控件自己的 `clearable`),
|
|
292
|
-
* 或页面级入口(`Form.Header` 的 `extra` 一侧)。
|
|
253
|
+
* 是否渲染「重置」按钮。**缺省值随时机而变**(故本 prop 缺省是 `undefined`、不是 `true`):`manual` 缺省**渲染**
|
|
254
|
+
* (只有显式 `:show-reset="false"` 才隐藏);`auto` 缺省**不渲染**(操作区整块让位给字段,要留一颗就得**显式**写
|
|
255
|
+
* `show-reset`)。自动模式下一键清空的另一条路是各字段自带的清除位,或页面级入口。
|
|
293
256
|
*/
|
|
294
257
|
showReset: {
|
|
295
258
|
type: BooleanConstructor;
|
|
@@ -361,14 +324,9 @@ export declare const Filter: {
|
|
|
361
324
|
default: string;
|
|
362
325
|
};
|
|
363
326
|
/**
|
|
364
|
-
* 是否渲染「重置」按钮。**缺省值随时机而变**(故本 prop 缺省是 `undefined
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
* - `trigger="auto"`:缺省**不渲染** —— 自动模式下操作区整块让位给字段,
|
|
368
|
-
* 要留一颗重置按钮就得**显式**写 `show-reset`。
|
|
369
|
-
*
|
|
370
|
-
* 自动模式下一键清空的另一条路是各字段自带的清除位(控件自己的 `clearable`),
|
|
371
|
-
* 或页面级入口(`Form.Header` 的 `extra` 一侧)。
|
|
327
|
+
* 是否渲染「重置」按钮。**缺省值随时机而变**(故本 prop 缺省是 `undefined`、不是 `true`):`manual` 缺省**渲染**
|
|
328
|
+
* (只有显式 `:show-reset="false"` 才隐藏);`auto` 缺省**不渲染**(操作区整块让位给字段,要留一颗就得**显式**写
|
|
329
|
+
* `show-reset`)。自动模式下一键清空的另一条路是各字段自带的清除位,或页面级入口。
|
|
372
330
|
*/
|
|
373
331
|
showReset: {
|
|
374
332
|
type: BooleanConstructor;
|
|
@@ -51,14 +51,9 @@ const FilterRoot = /* @__PURE__ */ defineComponent({
|
|
|
51
51
|
default: "重置"
|
|
52
52
|
},
|
|
53
53
|
/**
|
|
54
|
-
* 是否渲染「重置」按钮。**缺省值随时机而变**(故本 prop 缺省是 `undefined
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* - `trigger="auto"`:缺省**不渲染** —— 自动模式下操作区整块让位给字段,
|
|
58
|
-
* 要留一颗重置按钮就得**显式**写 `show-reset`。
|
|
59
|
-
*
|
|
60
|
-
* 自动模式下一键清空的另一条路是各字段自带的清除位(控件自己的 `clearable`),
|
|
61
|
-
* 或页面级入口(`Form.Header` 的 `extra` 一侧)。
|
|
54
|
+
* 是否渲染「重置」按钮。**缺省值随时机而变**(故本 prop 缺省是 `undefined`、不是 `true`):`manual` 缺省**渲染**
|
|
55
|
+
* (只有显式 `:show-reset="false"` 才隐藏);`auto` 缺省**不渲染**(操作区整块让位给字段,要留一颗就得**显式**写
|
|
56
|
+
* `show-reset`)。自动模式下一键清空的另一条路是各字段自带的清除位,或页面级入口。
|
|
62
57
|
*/
|
|
63
58
|
showReset: {
|
|
64
59
|
type: Boolean,
|