ep-craft 0.1.41 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/input-number/EpInputNumber.vue.js +62 -63
- package/dist/components/input-number/input-number.d.ts +5 -0
- package/dist/components/input-number/input-number.js +6 -6
- package/dist/components/select/index.d.ts +6 -3
- package/dist/components/select/select.d.ts +1 -0
- package/dist/components/select/select.js +3 -3
- package/dist/components/select/select.vue.d.ts +3 -1
- package/dist/components/select/select.vue.js +9 -9
- package/dist/components/select/select2.vue.js +73 -75
- package/dist/components/select-v2/src/defaults.d.ts +1 -0
- package/dist/components/select-v2/src/defaults.js +1 -1
- package/dist/components/select-v2/src/select.vue.d.ts +3 -1
- package/dist/components/select-v2/src/select.vue.js +21 -21
- package/dist/components/select-v2/src/select2.vue.js +27 -29
- package/dist/components/tree-select/src/tree-select.vue.d.ts +2 -0
- package/dist-ai/components/affix.json +152 -0
- package/dist-ai/components/affix.md +73 -0
- package/dist-ai/components/alert.json +186 -0
- package/dist-ai/components/alert.md +89 -0
- package/dist-ai/components/anchor-link.json +102 -0
- package/dist-ai/components/anchor-link.md +67 -0
- package/dist-ai/components/anchor.json +179 -0
- package/dist-ai/components/anchor.md +87 -0
- package/dist-ai/components/aside.json +87 -0
- package/dist-ai/components/aside.md +63 -0
- package/dist-ai/components/autocomplete.json +613 -0
- package/dist-ai/components/autocomplete.md +140 -0
- package/dist-ai/components/avatar.json +163 -0
- package/dist-ai/components/avatar.md +83 -0
- package/dist-ai/components/backtop.json +118 -0
- package/dist-ai/components/backtop.md +66 -0
- package/dist-ai/components/badge.json +186 -0
- package/dist-ai/components/badge.md +85 -0
- package/dist-ai/components/breadcrumb-item.json +97 -0
- package/dist-ai/components/breadcrumb-item.md +65 -0
- package/dist-ai/components/breadcrumb.json +100 -0
- package/dist-ai/components/breadcrumb.md +68 -0
- package/dist-ai/components/button-group.json +123 -0
- package/dist-ai/components/button-group.md +65 -0
- package/dist-ai/components/button.json +349 -0
- package/dist-ai/components/button.md +124 -0
- package/dist-ai/components/calendar.json +148 -0
- package/dist-ai/components/calendar.md +74 -0
- package/dist-ai/components/card.json +168 -0
- package/dist-ai/components/card.md +87 -0
- package/dist-ai/components/carousel-item.json +99 -0
- package/dist-ai/components/carousel-item.md +68 -0
- package/dist-ai/components/carousel.json +245 -0
- package/dist-ai/components/carousel.md +97 -0
- package/dist-ai/components/cascader-panel.json +242 -0
- package/dist-ai/components/cascader-panel.md +108 -0
- package/dist-ai/components/cascader.json +531 -0
- package/dist-ai/components/cascader.md +146 -0
- package/dist-ai/components/check-tag.json +133 -0
- package/dist-ai/components/check-tag.md +72 -0
- package/dist-ai/components/checkbox-button.json +279 -0
- package/dist-ai/components/checkbox-button.md +94 -0
- package/dist-ai/components/checkbox-group.json +236 -0
- package/dist-ai/components/checkbox-group.md +90 -0
- package/dist-ai/components/checkbox.json +278 -0
- package/dist-ai/components/checkbox.md +91 -0
- package/dist-ai/components/col.json +168 -0
- package/dist-ai/components/col.md +72 -0
- package/dist-ai/components/collapse-item.json +133 -0
- package/dist-ai/components/collapse-item.md +75 -0
- package/dist-ai/components/collapse-transition.json +75 -0
- package/dist-ai/components/collapse-transition.md +59 -0
- package/dist-ai/components/collapse.json +129 -0
- package/dist-ai/components/collapse.md +76 -0
- package/dist-ai/components/color-picker.json +280 -0
- package/dist-ai/components/color-picker.md +85 -0
- package/dist-ai/components/config-provider.json +222 -0
- package/dist-ai/components/config-provider.md +76 -0
- package/dist-ai/components/container.json +95 -0
- package/dist-ai/components/container.md +70 -0
- package/dist-ai/components/countdown.json +155 -0
- package/dist-ai/components/countdown.md +73 -0
- package/dist-ai/components/date-picker-panel.json +346 -0
- package/dist-ai/components/date-picker-panel.md +91 -0
- package/dist-ai/components/date-picker.json +574 -0
- package/dist-ai/components/date-picker.md +153 -0
- package/dist-ai/components/descriptions-item.json +175 -0
- package/dist-ai/components/descriptions-item.md +73 -0
- package/dist-ai/components/descriptions.json +171 -0
- package/dist-ai/components/descriptions.md +78 -0
- package/dist-ai/components/dialog.json +403 -0
- package/dist-ai/components/dialog.md +108 -0
- package/dist-ai/components/divider.json +102 -0
- package/dist-ai/components/divider.md +59 -0
- package/dist-ai/components/drawer.json +468 -0
- package/dist-ai/components/drawer.md +115 -0
- package/dist-ai/components/dropdown-item.json +156 -0
- package/dist-ai/components/dropdown-item.md +84 -0
- package/dist-ai/components/dropdown-menu.json +92 -0
- package/dist-ai/components/dropdown-menu.md +70 -0
- package/dist-ai/components/dropdown.json +374 -0
- package/dist-ai/components/dropdown.md +108 -0
- package/dist-ai/components/empty.json +116 -0
- package/dist-ai/components/empty.md +62 -0
- package/dist-ai/components/footer.json +86 -0
- package/dist-ai/components/footer.md +63 -0
- package/dist-ai/components/form-item.json +242 -0
- package/dist-ai/components/form-item.md +93 -0
- package/dist-ai/components/form.json +277 -0
- package/dist-ai/components/form.md +117 -0
- package/dist-ai/components/header.json +86 -0
- package/dist-ai/components/header.md +63 -0
- package/dist-ai/components/icon.json +95 -0
- package/dist-ai/components/icon.md +61 -0
- package/dist-ai/components/image-viewer.json +235 -0
- package/dist-ai/components/image-viewer.md +88 -0
- package/dist-ai/components/image.json +299 -0
- package/dist-ai/components/image.md +96 -0
- package/dist-ai/components/input-number.json +370 -0
- package/dist-ai/components/input-number.md +127 -0
- package/dist-ai/components/input.json +545 -0
- package/dist-ai/components/input.md +166 -0
- package/dist-ai/components/link.json +162 -0
- package/dist-ai/components/link.md +72 -0
- package/dist-ai/components/main.json +77 -0
- package/dist-ai/components/main.md +58 -0
- package/dist-ai/components/mention.json +598 -0
- package/dist-ai/components/mention.md +136 -0
- package/dist-ai/components/menu-item-group.json +101 -0
- package/dist-ai/components/menu-item-group.md +69 -0
- package/dist-ai/components/menu-item.json +131 -0
- package/dist-ai/components/menu-item.md +76 -0
- package/dist-ai/components/menu.json +314 -0
- package/dist-ai/components/menu.md +104 -0
- package/dist-ai/components/option-group.json +113 -0
- package/dist-ai/components/option-group.md +79 -0
- package/dist-ai/components/option.json +122 -0
- package/dist-ai/components/option.md +70 -0
- package/dist-ai/components/page-header.json +131 -0
- package/dist-ai/components/page-header.md +70 -0
- package/dist-ai/components/pagination.json +325 -0
- package/dist-ai/components/pagination.md +115 -0
- package/dist-ai/components/popconfirm.json +240 -0
- package/dist-ai/components/popconfirm.md +89 -0
- package/dist-ai/components/popover.json +351 -0
- package/dist-ai/components/popover.md +99 -0
- package/dist-ai/components/popper.json +93 -0
- package/dist-ai/components/popper.md +66 -0
- package/dist-ai/components/progress.json +219 -0
- package/dist-ai/components/progress.md +74 -0
- package/dist-ai/components/radio-button.json +142 -0
- package/dist-ai/components/radio-button.md +76 -0
- package/dist-ai/components/radio-group.json +219 -0
- package/dist-ai/components/radio-group.md +88 -0
- package/dist-ai/components/radio.json +177 -0
- package/dist-ai/components/radio.md +83 -0
- package/dist-ai/components/rate.json +286 -0
- package/dist-ai/components/rate.md +83 -0
- package/dist-ai/components/result.json +118 -0
- package/dist-ai/components/result.md +66 -0
- package/dist-ai/components/row.json +115 -0
- package/dist-ai/components/row.md +68 -0
- package/dist-ai/components/scrollbar.json +280 -0
- package/dist-ai/components/scrollbar.md +89 -0
- package/dist-ai/components/segmented.json +204 -0
- package/dist-ai/components/segmented.md +81 -0
- package/dist-ai/components/select-v2.json +729 -0
- package/dist-ai/components/select-v2.md +193 -0
- package/dist-ai/components/select.json +697 -0
- package/dist-ai/components/select.md +188 -0
- package/dist-ai/components/skeleton-item.json +80 -0
- package/dist-ai/components/skeleton-item.md +57 -0
- package/dist-ai/components/skeleton.json +134 -0
- package/dist-ai/components/skeleton.md +65 -0
- package/dist-ai/components/slider.json +326 -0
- package/dist-ai/components/slider.md +88 -0
- package/dist-ai/components/space.json +178 -0
- package/dist-ai/components/space.md +73 -0
- package/dist-ai/components/statistic.json +167 -0
- package/dist-ai/components/statistic.md +66 -0
- package/dist-ai/components/step.json +124 -0
- package/dist-ai/components/step.md +69 -0
- package/dist-ai/components/steps.json +157 -0
- package/dist-ai/components/steps.md +79 -0
- package/dist-ai/components/sub-menu.json +211 -0
- package/dist-ai/components/sub-menu.md +88 -0
- package/dist-ai/components/switch.json +292 -0
- package/dist-ai/components/switch.md +88 -0
- package/dist-ai/components/tab-pane.json +137 -0
- package/dist-ai/components/tab-pane.md +72 -0
- package/dist-ai/components/table-column.json +368 -0
- package/dist-ai/components/table-column.md +103 -0
- package/dist-ai/components/table-v2.json +486 -0
- package/dist-ai/components/table-v2.md +123 -0
- package/dist-ai/components/table.json +734 -0
- package/dist-ai/components/table.md +205 -0
- package/dist-ai/components/tabs.json +231 -0
- package/dist-ai/components/tabs.md +127 -0
- package/dist-ai/components/tag.json +205 -0
- package/dist-ai/components/tag.md +105 -0
- package/dist-ai/components/text.json +143 -0
- package/dist-ai/components/text.md +66 -0
- package/dist-ai/components/time-picker.json +555 -0
- package/dist-ai/components/time-picker.md +123 -0
- package/dist-ai/components/time-select.json +321 -0
- package/dist-ai/components/time-select.md +93 -0
- package/dist-ai/components/timeline-item.json +186 -0
- package/dist-ai/components/timeline-item.md +78 -0
- package/dist-ai/components/timeline.json +99 -0
- package/dist-ai/components/timeline.md +65 -0
- package/dist-ai/components/tooltip.json +599 -0
- package/dist-ai/components/tooltip.md +137 -0
- package/dist-ai/components/tour-step.json +219 -0
- package/dist-ai/components/tour-step.md +88 -0
- package/dist-ai/components/tour.json +258 -0
- package/dist-ai/components/tour.md +96 -0
- package/dist-ai/components/transfer.json +275 -0
- package/dist-ai/components/transfer.md +95 -0
- package/dist-ai/components/tree-select.json +945 -0
- package/dist-ai/components/tree-select.md +181 -0
- package/dist-ai/components/tree-v2.json +395 -0
- package/dist-ai/components/tree-v2.md +113 -0
- package/dist-ai/components/tree.json +485 -0
- package/dist-ai/components/tree.md +131 -0
- package/dist-ai/components/upload.json +382 -0
- package/dist-ai/components/upload.md +130 -0
- package/dist-ai/components/watermark.json +157 -0
- package/dist-ai/components/watermark.md +66 -0
- package/dist-ai/directives/click-outside.json +61 -0
- package/dist-ai/directives/click-outside.md +50 -0
- package/dist-ai/directives/infinite-scroll.json +83 -0
- package/dist-ai/directives/infinite-scroll.md +62 -0
- package/dist-ai/directives/loading.json +89 -0
- package/dist-ai/directives/loading.md +69 -0
- package/dist-ai/directives/mousewheel.json +54 -0
- package/dist-ai/directives/mousewheel.md +48 -0
- package/dist-ai/directives/repeat-click.json +68 -0
- package/dist-ai/directives/repeat-click.md +49 -0
- package/dist-ai/directives/trap-focus.json +46 -0
- package/dist-ai/directives/trap-focus.md +46 -0
- package/dist-ai/icons.json +1 -0
- package/dist-ai/index.json +1 -0
- package/dist-ai/llms.txt +170 -0
- package/dist-ai/manifest.json +26590 -0
- package/dist-ai/schema/manifest.schema.json +793 -0
- package/dist-ai/services/infinite-scroll.json +80 -0
- package/dist-ai/services/infinite-scroll.md +71 -0
- package/dist-ai/services/loading.json +108 -0
- package/dist-ai/services/loading.md +58 -0
- package/dist-ai/services/message-box.json +159 -0
- package/dist-ai/services/message-box.md +78 -0
- package/dist-ai/services/message.json +137 -0
- package/dist-ai/services/message.md +72 -0
- package/dist-ai/services/notification.json +136 -0
- package/dist-ai/services/notification.md +73 -0
- package/package.json +12 -2
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"callForm": "EpMessage(options) 或 EpMessage.success(message, options)",
|
|
4
|
+
"category": "feedback",
|
|
5
|
+
"constraints": [
|
|
6
|
+
"需要应用上下文时先执行 app.use(EpMessage),否则调用缺少全局上下文",
|
|
7
|
+
"短反馈使用 Message;需要标题与较长描述时使用 EpNotification",
|
|
8
|
+
"duration 为 0 时消息常驻,必须提供关闭方式避免遮挡页面"
|
|
9
|
+
],
|
|
10
|
+
"directiveId": null,
|
|
11
|
+
"exampleOmittedReason": null,
|
|
12
|
+
"examples": [
|
|
13
|
+
{
|
|
14
|
+
"code": "<script setup lang=\"ts\">\nimport { EpButton, EpMessage } from 'ep-craft'\n\nconst notify = () => {\n EpMessage.success('保存成功')\n}\n</script>\n\n<template>\n <ep-button type=\"primary\" @click=\"notify\">保存</ep-button>\n</template>",
|
|
15
|
+
"id": "message-1",
|
|
16
|
+
"language": "vue",
|
|
17
|
+
"title": "快捷消息"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"code": "import { EpMessage } from 'ep-craft'\n\nconst handler = EpMessage({\n message: '正在同步数据',\n type: 'info',\n duration: 0,\n showClose: true,\n})\n\nconst finish = () => {\n handler.close()\n EpMessage.closeAll()\n}",
|
|
21
|
+
"id": "message-2",
|
|
22
|
+
"language": "ts",
|
|
23
|
+
"title": "带选项与关闭"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"id": "service:message",
|
|
27
|
+
"keywords": {
|
|
28
|
+
"en": [
|
|
29
|
+
"message",
|
|
30
|
+
"toast",
|
|
31
|
+
"notice",
|
|
32
|
+
"feedback"
|
|
33
|
+
],
|
|
34
|
+
"zh": [
|
|
35
|
+
"消息",
|
|
36
|
+
"提示",
|
|
37
|
+
"轻提示",
|
|
38
|
+
"反馈",
|
|
39
|
+
"toast"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"kind": "service",
|
|
43
|
+
"methods": [
|
|
44
|
+
{
|
|
45
|
+
"description": "按类型创建消息的快捷方法",
|
|
46
|
+
"name": "success / warning / error / info / primary",
|
|
47
|
+
"signature": "(message: string | VNode, options?: MessageOptions) => MessageHandler"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"description": "关闭全部消息,可只关闭指定类型",
|
|
51
|
+
"name": "closeAll",
|
|
52
|
+
"signature": "(type?: MessageType) => void"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"description": "关闭指定位置的全部消息",
|
|
56
|
+
"name": "closeAllByPlacement",
|
|
57
|
+
"signature": "(placement: MessagePlacement) => void"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"description": "返回值 MessageHandler 上的关闭方法",
|
|
61
|
+
"name": "close",
|
|
62
|
+
"signature": "(handler.close()) => void"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"name": "EpMessage",
|
|
66
|
+
"options": [
|
|
67
|
+
{
|
|
68
|
+
"defaultText": "''",
|
|
69
|
+
"description": "提示正文;使用 HTML 时需开启 dangerouslyUseHTMLString",
|
|
70
|
+
"name": "message",
|
|
71
|
+
"required": true,
|
|
72
|
+
"type": "string | VNode | (() => VNode)"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"defaultText": "'info'",
|
|
76
|
+
"description": "提示类型,决定图标与配色",
|
|
77
|
+
"name": "type",
|
|
78
|
+
"required": false,
|
|
79
|
+
"type": "'primary' | 'success' | 'info' | 'warning' | 'error'"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"defaultText": "3000",
|
|
83
|
+
"description": "自动关闭毫秒数;为 0 时不自动关闭",
|
|
84
|
+
"name": "duration",
|
|
85
|
+
"required": false,
|
|
86
|
+
"type": "number"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"defaultText": "false",
|
|
90
|
+
"description": "是否显示关闭按钮",
|
|
91
|
+
"name": "showClose",
|
|
92
|
+
"required": false,
|
|
93
|
+
"type": "boolean"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"defaultText": "false",
|
|
97
|
+
"description": "是否使用朴素样式",
|
|
98
|
+
"name": "plain",
|
|
99
|
+
"required": false,
|
|
100
|
+
"type": "boolean"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"defaultText": "'top'",
|
|
104
|
+
"description": "消息出现的屏幕位置",
|
|
105
|
+
"name": "placement",
|
|
106
|
+
"required": false,
|
|
107
|
+
"type": "'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right'"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"defaultText": "16",
|
|
111
|
+
"description": "距离视口顶部的偏移量",
|
|
112
|
+
"name": "offset",
|
|
113
|
+
"required": false,
|
|
114
|
+
"type": "number"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"defaultText": "false",
|
|
118
|
+
"description": "合并内容与类型相同的消息并累加计数",
|
|
119
|
+
"name": "grouping",
|
|
120
|
+
"required": false,
|
|
121
|
+
"type": "boolean"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"defaultText": null,
|
|
125
|
+
"description": "关闭后的回调",
|
|
126
|
+
"name": "onClose",
|
|
127
|
+
"required": false,
|
|
128
|
+
"type": "() => void"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"slug": "message",
|
|
132
|
+
"summary": "全局轻量消息提示,展示短暂操作反馈"
|
|
133
|
+
},
|
|
134
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
135
|
+
"libraryVersion": "0.2.0",
|
|
136
|
+
"schemaVersion": 1
|
|
137
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# EpMessage
|
|
2
|
+
|
|
3
|
+
`EpMessage(options) 或 EpMessage.success(message, options)` · feedback(反馈) · `service:message`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
全局轻量消息提示,展示短暂操作反馈
|
|
8
|
+
|
|
9
|
+
## 关键词
|
|
10
|
+
|
|
11
|
+
- 中文:消息、提示、轻提示、反馈、toast
|
|
12
|
+
- English: message, toast, notice, feedback
|
|
13
|
+
|
|
14
|
+
## 调用方式
|
|
15
|
+
|
|
16
|
+
- 调用形式:EpMessage(options) 或 EpMessage.success(message, options)
|
|
17
|
+
- 选项 message(string | VNode | (() => VNode),必填,默认 ''):提示正文;使用 HTML 时需开启 dangerouslyUseHTMLString
|
|
18
|
+
- 选项 type('primary' | 'success' | 'info' | 'warning' | 'error',默认 'info'):提示类型,决定图标与配色
|
|
19
|
+
- 选项 duration(number,默认 3000):自动关闭毫秒数;为 0 时不自动关闭
|
|
20
|
+
- 选项 showClose(boolean,默认 false):是否显示关闭按钮
|
|
21
|
+
- 选项 plain(boolean,默认 false):是否使用朴素样式
|
|
22
|
+
- 选项 placement('top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right',默认 'top'):消息出现的屏幕位置
|
|
23
|
+
- 选项 offset(number,默认 16):距离视口顶部的偏移量
|
|
24
|
+
- 选项 grouping(boolean,默认 false):合并内容与类型相同的消息并累加计数
|
|
25
|
+
- 选项 onClose(() => void):关闭后的回调
|
|
26
|
+
- 方法 success / warning / error / info / primary(message: string | VNode, options?: MessageOptions) => MessageHandler:按类型创建消息的快捷方法
|
|
27
|
+
- 方法 closeAll(type?: MessageType) => void:关闭全部消息,可只关闭指定类型
|
|
28
|
+
- 方法 closeAllByPlacement(placement: MessagePlacement) => void:关闭指定位置的全部消息
|
|
29
|
+
- 方法 close(handler.close()) => void:返回值 MessageHandler 上的关闭方法
|
|
30
|
+
- 约束:需要应用上下文时先执行 app.use(EpMessage),否则调用缺少全局上下文
|
|
31
|
+
- 约束:短反馈使用 Message;需要标题与较长描述时使用 EpNotification
|
|
32
|
+
- 约束:duration 为 0 时消息常驻,必须提供关闭方式避免遮挡页面
|
|
33
|
+
|
|
34
|
+
## 示例
|
|
35
|
+
|
|
36
|
+
### 快捷消息
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<script setup lang="ts">
|
|
40
|
+
import { EpButton, EpMessage } from 'ep-craft'
|
|
41
|
+
|
|
42
|
+
const notify = () => {
|
|
43
|
+
EpMessage.success('保存成功')
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<ep-button type="primary" @click="notify">保存</ep-button>
|
|
49
|
+
</template>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 带选项与关闭
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { EpMessage } from 'ep-craft'
|
|
56
|
+
|
|
57
|
+
const handler = EpMessage({
|
|
58
|
+
message: '正在同步数据',
|
|
59
|
+
type: 'info',
|
|
60
|
+
duration: 0,
|
|
61
|
+
showClose: true,
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const finish = () => {
|
|
65
|
+
handler.close()
|
|
66
|
+
EpMessage.closeAll()
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
ep-craft 0.2.0
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"callForm": "EpNotification(options) 或 EpNotification.success(options)",
|
|
4
|
+
"category": "feedback",
|
|
5
|
+
"constraints": [
|
|
6
|
+
"onClose 在组件 props 中为必填,但调用时可由服务内部提供,业务侧无需手动传入",
|
|
7
|
+
"通知保留在屏幕角落,不阻断页面操作;确认类交互使用 MessageBox",
|
|
8
|
+
"需要应用上下文时先执行 app.use(EpNotification)"
|
|
9
|
+
],
|
|
10
|
+
"directiveId": null,
|
|
11
|
+
"exampleOmittedReason": null,
|
|
12
|
+
"examples": [
|
|
13
|
+
{
|
|
14
|
+
"code": "<script setup lang=\"ts\">\nimport { EpButton, EpNotification } from 'ep-craft'\n\nconst notify = () => {\n EpNotification({\n title: '部署完成',\n message: '生产环境已更新到最新版本',\n type: 'success',\n duration: 4500,\n })\n}\n</script>\n\n<template>\n <ep-button @click=\"notify\">发送通知</ep-button>\n</template>",
|
|
15
|
+
"id": "notification-1",
|
|
16
|
+
"language": "vue",
|
|
17
|
+
"title": "基础通知"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"code": "import { EpNotification } from 'ep-craft'\n\nEpNotification.warning({\n title: '磁盘空间不足',\n message: '请清理日志后重试',\n position: 'bottom-right',\n})\n\nEpNotification.closeAll()",
|
|
21
|
+
"id": "notification-2",
|
|
22
|
+
"language": "ts",
|
|
23
|
+
"title": "关闭全部通知"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"id": "service:notification",
|
|
27
|
+
"keywords": {
|
|
28
|
+
"en": [
|
|
29
|
+
"notification",
|
|
30
|
+
"notice",
|
|
31
|
+
"alert",
|
|
32
|
+
"message"
|
|
33
|
+
],
|
|
34
|
+
"zh": [
|
|
35
|
+
"通知",
|
|
36
|
+
"提醒",
|
|
37
|
+
"消息",
|
|
38
|
+
"角落通知"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"kind": "service",
|
|
42
|
+
"methods": [
|
|
43
|
+
{
|
|
44
|
+
"description": "按类型创建通知的快捷方法",
|
|
45
|
+
"name": "success / warning / error / info / primary",
|
|
46
|
+
"signature": "(options?: NotificationOptionsTyped) => NotificationHandle"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"description": "关闭全部通知",
|
|
50
|
+
"name": "closeAll",
|
|
51
|
+
"signature": "() => void"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"description": "重新计算指定位置通知的堆叠偏移",
|
|
55
|
+
"name": "updateOffsets",
|
|
56
|
+
"signature": "(position?: NotificationPosition) => void"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"description": "返回值 NotificationHandle 上的关闭方法",
|
|
60
|
+
"name": "close",
|
|
61
|
+
"signature": "(handle.close()) => void"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"name": "EpNotification",
|
|
65
|
+
"options": [
|
|
66
|
+
{
|
|
67
|
+
"defaultText": "''",
|
|
68
|
+
"description": "通知标题",
|
|
69
|
+
"name": "title",
|
|
70
|
+
"required": false,
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"defaultText": "''",
|
|
75
|
+
"description": "通知正文",
|
|
76
|
+
"name": "message",
|
|
77
|
+
"required": true,
|
|
78
|
+
"type": "string | VNode | (() => VNode)"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"defaultText": "'info'",
|
|
82
|
+
"description": "通知类型,决定图标与配色",
|
|
83
|
+
"name": "type",
|
|
84
|
+
"required": false,
|
|
85
|
+
"type": "'primary' | 'success' | 'info' | 'warning' | 'error'"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"defaultText": "'top-right'",
|
|
89
|
+
"description": "通知出现的屏幕角落",
|
|
90
|
+
"name": "position",
|
|
91
|
+
"required": false,
|
|
92
|
+
"type": "'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"defaultText": "4500",
|
|
96
|
+
"description": "自动关闭毫秒数;为 0 时不自动关闭",
|
|
97
|
+
"name": "duration",
|
|
98
|
+
"required": false,
|
|
99
|
+
"type": "number"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"defaultText": "0",
|
|
103
|
+
"description": "同一位置通知的顶部偏移",
|
|
104
|
+
"name": "offset",
|
|
105
|
+
"required": false,
|
|
106
|
+
"type": "number"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"defaultText": "true",
|
|
110
|
+
"description": "是否显示关闭按钮",
|
|
111
|
+
"name": "showClose",
|
|
112
|
+
"required": false,
|
|
113
|
+
"type": "boolean"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"defaultText": null,
|
|
117
|
+
"description": "点击通知时的回调",
|
|
118
|
+
"name": "onClick",
|
|
119
|
+
"required": false,
|
|
120
|
+
"type": "() => void"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"defaultText": null,
|
|
124
|
+
"description": "关闭后的回调",
|
|
125
|
+
"name": "onClose",
|
|
126
|
+
"required": false,
|
|
127
|
+
"type": "(vm: VNode) => void"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"slug": "notification",
|
|
131
|
+
"summary": "角落通知提醒,展示带标题的较完整消息"
|
|
132
|
+
},
|
|
133
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
134
|
+
"libraryVersion": "0.2.0",
|
|
135
|
+
"schemaVersion": 1
|
|
136
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# EpNotification
|
|
2
|
+
|
|
3
|
+
`EpNotification(options) 或 EpNotification.success(options)` · feedback(反馈) · `service:notification`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
角落通知提醒,展示带标题的较完整消息
|
|
8
|
+
|
|
9
|
+
## 关键词
|
|
10
|
+
|
|
11
|
+
- 中文:通知、提醒、消息、角落通知
|
|
12
|
+
- English: notification, notice, alert, message
|
|
13
|
+
|
|
14
|
+
## 调用方式
|
|
15
|
+
|
|
16
|
+
- 调用形式:EpNotification(options) 或 EpNotification.success(options)
|
|
17
|
+
- 选项 title(string,默认 ''):通知标题
|
|
18
|
+
- 选项 message(string | VNode | (() => VNode),必填,默认 ''):通知正文
|
|
19
|
+
- 选项 type('primary' | 'success' | 'info' | 'warning' | 'error',默认 'info'):通知类型,决定图标与配色
|
|
20
|
+
- 选项 position('top-right' | 'top-left' | 'bottom-right' | 'bottom-left',默认 'top-right'):通知出现的屏幕角落
|
|
21
|
+
- 选项 duration(number,默认 4500):自动关闭毫秒数;为 0 时不自动关闭
|
|
22
|
+
- 选项 offset(number,默认 0):同一位置通知的顶部偏移
|
|
23
|
+
- 选项 showClose(boolean,默认 true):是否显示关闭按钮
|
|
24
|
+
- 选项 onClick(() => void):点击通知时的回调
|
|
25
|
+
- 选项 onClose((vm: VNode) => void):关闭后的回调
|
|
26
|
+
- 方法 success / warning / error / info / primary(options?: NotificationOptionsTyped) => NotificationHandle:按类型创建通知的快捷方法
|
|
27
|
+
- 方法 closeAll() => void:关闭全部通知
|
|
28
|
+
- 方法 updateOffsets(position?: NotificationPosition) => void:重新计算指定位置通知的堆叠偏移
|
|
29
|
+
- 方法 close(handle.close()) => void:返回值 NotificationHandle 上的关闭方法
|
|
30
|
+
- 约束:onClose 在组件 props 中为必填,但调用时可由服务内部提供,业务侧无需手动传入
|
|
31
|
+
- 约束:通知保留在屏幕角落,不阻断页面操作;确认类交互使用 MessageBox
|
|
32
|
+
- 约束:需要应用上下文时先执行 app.use(EpNotification)
|
|
33
|
+
|
|
34
|
+
## 示例
|
|
35
|
+
|
|
36
|
+
### 基础通知
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<script setup lang="ts">
|
|
40
|
+
import { EpButton, EpNotification } from 'ep-craft'
|
|
41
|
+
|
|
42
|
+
const notify = () => {
|
|
43
|
+
EpNotification({
|
|
44
|
+
title: '部署完成',
|
|
45
|
+
message: '生产环境已更新到最新版本',
|
|
46
|
+
type: 'success',
|
|
47
|
+
duration: 4500,
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<ep-button @click="notify">发送通知</ep-button>
|
|
54
|
+
</template>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 关闭全部通知
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
import { EpNotification } from 'ep-craft'
|
|
61
|
+
|
|
62
|
+
EpNotification.warning({
|
|
63
|
+
title: '磁盘空间不足',
|
|
64
|
+
message: '请清理日志后重试',
|
|
65
|
+
position: 'bottom-right',
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
EpNotification.closeAll()
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
ep-craft 0.2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ep-craft",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A self-contained Vue 3 component library with ep- prefix",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.34.4",
|
|
@@ -45,10 +45,13 @@
|
|
|
45
45
|
"types": "./dist/icons.d.ts",
|
|
46
46
|
"import": "./dist/icons.js"
|
|
47
47
|
},
|
|
48
|
+
"./ai/*": "./dist-ai/*",
|
|
49
|
+
"./package.json": "./package.json",
|
|
48
50
|
"./theme-chalk/*": "./theme-chalk/*"
|
|
49
51
|
},
|
|
50
52
|
"files": [
|
|
51
53
|
"dist",
|
|
54
|
+
"dist-ai",
|
|
52
55
|
"theme-chalk",
|
|
53
56
|
"LICENSE",
|
|
54
57
|
"THIRD_PARTY_NOTICES.md"
|
|
@@ -58,11 +61,18 @@
|
|
|
58
61
|
"**/*.scss"
|
|
59
62
|
],
|
|
60
63
|
"scripts": {
|
|
61
|
-
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly --outDir dist && tsx scripts/rewrite-declarations.ts && tsx scripts/check-element-plus.ts",
|
|
64
|
+
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly --outDir dist && tsx scripts/rewrite-declarations.ts && tsx scripts/check-element-plus.ts && tsx scripts/gen-ai.ts",
|
|
62
65
|
"typecheck": "vue-tsc -p tsconfig.typecheck.json",
|
|
63
66
|
"check:dist": "tsx scripts/check-element-plus.ts",
|
|
64
67
|
"gen": "tsx scripts/gen-components.ts",
|
|
65
68
|
"gen:check": "tsx scripts/gen-components.ts --check",
|
|
69
|
+
"gen:ai": "tsx scripts/gen-ai.ts",
|
|
70
|
+
"gen:ai:check": "tsx scripts/gen-ai.ts --check",
|
|
71
|
+
"gen:ai:eval": "tsx scripts/eval-ai.ts",
|
|
72
|
+
"ai:mcp:build": "pnpm --filter ep-craft-mcp build",
|
|
73
|
+
"ai:mcp:start": "node scripts/start-mcp.mjs",
|
|
74
|
+
"ai:mcp:test": "pnpm --filter ep-craft-mcp test",
|
|
75
|
+
"ai:mcp:bench": "pnpm --filter ep-craft-mcp bench",
|
|
66
76
|
"gen:docs": "tsx scripts/gen-docs.ts",
|
|
67
77
|
"verify:autocomplete": "node scripts/verify-autocomplete.mjs",
|
|
68
78
|
"verify:backtop": "node scripts/verify-backtop.mjs",
|