@cst-ui/nano-buttons 0.5.2 → 0.6.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 +56 -2
- package/dist/NanoUnfreezeButton.vue_vue_type_script_setup_true_lang-CYOJwieV.js +692 -0
- package/dist/NanoUnfreezeButton.vue_vue_type_script_setup_true_lang-ClUhZWV4.cjs +1 -0
- package/dist/buttons/components/NanoCompleteButton.vue.d.ts +108 -0
- package/dist/buttons/components/NanoConfirmButton.vue.d.ts +108 -0
- package/dist/buttons/components/NanoConfirmedButton.vue.d.ts +93 -0
- package/dist/buttons/components/NanoInterruptButton.vue.d.ts +108 -0
- package/dist/buttons/components/NanoResetButton.vue.d.ts +93 -0
- package/dist/buttons/components/NanoSendButton.vue.d.ts +93 -0
- package/dist/buttons/index.cjs +1 -1
- package/dist/buttons/index.d.ts +7 -1
- package/dist/buttons/index.mjs +30 -18
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.mjs +30 -18
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/NanoUnfreezeButton.vue_vue_type_script_setup_true_lang-BADq5GB3.cjs +0 -1
- package/dist/NanoUnfreezeButton.vue_vue_type_script_setup_true_lang-CeKsmoZi.js +0 -412
package/README.md
CHANGED
|
@@ -79,6 +79,12 @@ import { CstPagination, CstTable } from '@cst-ui/nano-buttons/table'
|
|
|
79
79
|
<nano-export-button />
|
|
80
80
|
<nano-edit-button />
|
|
81
81
|
<nano-manage-button />
|
|
82
|
+
<nano-confirm-button />
|
|
83
|
+
<nano-confirmed-button />
|
|
84
|
+
<nano-interrupt-button />
|
|
85
|
+
<nano-complete-button />
|
|
86
|
+
<nano-send-button />
|
|
87
|
+
<nano-reset-button />
|
|
82
88
|
<nano-delete-button />
|
|
83
89
|
<nano-freeze-button />
|
|
84
90
|
<nano-unfreeze-button />
|
|
@@ -97,6 +103,12 @@ import { CstPagination, CstTable } from '@cst-ui/nano-buttons/table'
|
|
|
97
103
|
<nano-add-button />
|
|
98
104
|
<nano-import-button />
|
|
99
105
|
<nano-export-button />
|
|
106
|
+
<nano-send-button />
|
|
107
|
+
<nano-reset-button />
|
|
108
|
+
<nano-confirm-button />
|
|
109
|
+
<nano-confirmed-button />
|
|
110
|
+
<nano-interrupt-button />
|
|
111
|
+
<nano-complete-button />
|
|
100
112
|
<nano-delete-button />
|
|
101
113
|
<nano-freeze-button />
|
|
102
114
|
<nano-unfreeze-button />
|
|
@@ -104,6 +116,48 @@ import { CstPagination, CstTable } from '@cst-ui/nano-buttons/table'
|
|
|
104
116
|
<nano-cancel-button>取消</nano-cancel-button>
|
|
105
117
|
```
|
|
106
118
|
|
|
119
|
+
确认、中断、完成分别使用 Element Plus Icons 的 `Check`、`CircleClose`、`CircleCheck` 图标,并用主色、危险色、成功色区分操作语义。三个组件支持与删除按钮一致的气泡确认能力:
|
|
120
|
+
|
|
121
|
+
```vue
|
|
122
|
+
<nano-confirm-button confirm-title="确定确认选中记录吗?" @confirm="onConfirm">
|
|
123
|
+
批量确认
|
|
124
|
+
</nano-confirm-button>
|
|
125
|
+
<nano-interrupt-button confirm-title="确定中断选中记录吗?" @confirm="onInterrupt">
|
|
126
|
+
批量中断
|
|
127
|
+
</nano-interrupt-button>
|
|
128
|
+
<nano-complete-button confirm-title="确定完成选中记录吗?" @confirm="onComplete">
|
|
129
|
+
批量完成
|
|
130
|
+
</nano-complete-button>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
确认成功后,业务状态更新为已确认,并通过 `v-if / v-else` 把确认按钮切换为 `NanoConfirmedButton`。确认完成按钮保持相同的 `Check` 图标和尺寸,固定使用 success 主题禁用色且不可点击:
|
|
134
|
+
|
|
135
|
+
```vue
|
|
136
|
+
<nano-confirm-button
|
|
137
|
+
v-if="row.IS_ACK === 'N'"
|
|
138
|
+
confirm-title="确定确认吗?"
|
|
139
|
+
@confirm="onConfirmRow(row)"
|
|
140
|
+
/>
|
|
141
|
+
<nano-confirmed-button v-else />
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
传入默认插槽时可用于批量操作栏:`<nano-confirmed-button>确认完成</nano-confirmed-button>`。组件的禁用文字、背景和边框跟随宿主亮暗主题变化。
|
|
145
|
+
|
|
146
|
+
不传默认插槽时,三个组件仅显示图标,适合表格操作列。图标按钮内置默认 `aria-label`,业务也可以传入最终显示语义进行覆盖:
|
|
147
|
+
|
|
148
|
+
```vue
|
|
149
|
+
<nano-confirm-button aria-label="确认" confirm-title="确定确认吗?" @confirm="onConfirm" />
|
|
150
|
+
<nano-interrupt-button aria-label="中断" confirm-title="确定中断吗?" @confirm="onInterrupt" />
|
|
151
|
+
<nano-complete-button aria-label="完成" confirm-title="确定完成吗?" @confirm="onComplete" />
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
发送按钮默认使用 `Promotion` 图标、主色和“发送”文案;重置按钮默认使用 `RefreshLeft` 图标、次级浅色和“重置”文案:
|
|
155
|
+
|
|
156
|
+
```vue
|
|
157
|
+
<nano-send-button @click="onSend" />
|
|
158
|
+
<nano-reset-button @click="onReset" />
|
|
159
|
+
```
|
|
160
|
+
|
|
107
161
|
删除按钮默认与普通按钮一致,直接触发 `click`。传入 `confirm-title` 后会启用气泡确认,并在用户确认或取消时分别触发 `confirm`、`cancel`:
|
|
108
162
|
|
|
109
163
|
```vue
|
|
@@ -116,7 +170,7 @@ import { CstPagination, CstTable } from '@cst-ui/nano-buttons/table'
|
|
|
116
170
|
/>
|
|
117
171
|
```
|
|
118
172
|
|
|
119
|
-
`confirm-title`、`confirm-button-text
|
|
173
|
+
`NanoConfirmButton`、`NanoInterruptButton`、`NanoCompleteButton`、`NanoDeleteButton`、`NanoFreezeButton` 和 `NanoUnfreezeButton` 都支持 `confirm-title`、`confirm-button-text`、`cancel-button-text` 以及 `confirm`、`cancel` 事件。三个文案属性接收最终显示文本,国际化由业务项目调用 `$t()` 后传入。启用确认时,业务操作应绑定 `confirm`,不要绑定 `click`。
|
|
120
174
|
|
|
121
175
|
冻结按钮使用 EMS 现有的红色 `Hide` 图标样式,解冻按钮使用配套的绿色 `View` 图标样式。默认直接触发 `click`;传入 `confirm-title` 后启用确认框,并在确认时触发 `confirm`:
|
|
122
176
|
|
|
@@ -156,7 +210,7 @@ import { CstPagination, CstTable } from '@cst-ui/nano-buttons/table'
|
|
|
156
210
|
/>
|
|
157
211
|
```
|
|
158
212
|
|
|
159
|
-
分页激活态和按钮主色共同使用宿主项目的 `--color-brand-primary`。业务项目覆盖一次该 token
|
|
213
|
+
分页激活态和按钮主色共同使用宿主项目的 `--color-brand-primary`。业务项目覆盖一次该 token,按钮和分页会同步跟随主题变化。按钮禁用态继续使用 Element Plus 的 `--el-button-disabled-*` 变量;宿主覆盖语义色阶或切换亮暗主题时,禁用文字、背景和边框会同步变化,且悬停、按下不再切换交互色。
|
|
160
214
|
|
|
161
215
|
`CstTable` 组合了 Element Plus Table 和 `CstPagination`,默认对传入的完整数组做前端分页。列定义和其他表格属性继续按照 Element Plus Table 使用:
|
|
162
216
|
|