@robot-admin/naive-ui-components 0.29.1 → 0.29.3

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.
Files changed (102) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +1 -1
  3. package/README_EN.md +1 -1
  4. package/dist/C_ActionBar.css +49 -49
  5. package/dist/C_ActionBar2.cjs +1 -1
  6. package/dist/C_ActionBar2.js +1 -1
  7. package/dist/C_BatchResult.css +11 -7
  8. package/dist/C_BatchResult2.cjs +1 -1
  9. package/dist/C_BatchResult2.js +1 -1
  10. package/dist/C_DataPicker.css +29 -21
  11. package/dist/C_DataPicker.d.cts +2 -2
  12. package/dist/C_DataPicker.d.ts +2 -2
  13. package/dist/C_DataPicker2.cjs +1 -1
  14. package/dist/C_DataPicker2.js +1 -1
  15. package/dist/C_FormModal.css +49 -49
  16. package/dist/C_Table.base.css +49 -49
  17. package/dist/C_Table.css +49 -49
  18. package/dist/C_Table.d.cts +1 -1
  19. package/dist/C_Table.d.ts +1 -1
  20. package/dist/constants.d.cts +1 -1
  21. package/dist/constants.d.ts +1 -1
  22. package/dist/constants2.d.cts +1 -1
  23. package/dist/constants2.d.ts +1 -1
  24. package/dist/constants3.d.cts +3 -3
  25. package/dist/constants3.d.ts +3 -3
  26. package/dist/constants4.d.cts +10 -10
  27. package/dist/constants4.d.ts +10 -10
  28. package/dist/constants5.d.cts +2 -2
  29. package/dist/constants5.d.ts +2 -2
  30. package/dist/data2.d.cts +9 -9
  31. package/dist/data2.d.ts +9 -9
  32. package/dist/dateRange.d.cts +7 -2
  33. package/dist/dateRange.d.ts +7 -2
  34. package/dist/index.d.cts +2 -2
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.vue.d.cts +4 -4
  37. package/dist/index.vue.d.ts +4 -4
  38. package/dist/index10.vue.d.cts +4 -4
  39. package/dist/index10.vue.d.ts +4 -4
  40. package/dist/index11.vue.d.cts +4 -4
  41. package/dist/index11.vue.d.ts +9 -4
  42. package/dist/index12.vue.d.cts +9 -4
  43. package/dist/index13.vue.d.ts +3 -3
  44. package/dist/index14.vue.d.cts +3 -3
  45. package/dist/index16.vue.d.ts +1 -1
  46. package/dist/index17.vue.d.cts +1 -1
  47. package/dist/index17.vue.d.ts +6 -6
  48. package/dist/index18.vue.d.cts +6 -6
  49. package/dist/index2.vue.d.cts +2 -2
  50. package/dist/index2.vue.d.ts +2 -2
  51. package/dist/index20.vue.d.ts +1 -1
  52. package/dist/index21.vue.d.cts +1 -1
  53. package/dist/index21.vue.d.ts +2 -2
  54. package/dist/index22.vue.d.cts +2 -2
  55. package/dist/index22.vue.d.ts +2 -2
  56. package/dist/index23.vue.d.cts +1 -1
  57. package/dist/index23.vue.d.ts +1 -1
  58. package/dist/index24.vue.d.cts +1 -1
  59. package/dist/index24.vue.d.ts +1 -1
  60. package/dist/index26.vue.d.cts +2 -2
  61. package/dist/index26.vue.d.ts +2 -2
  62. package/dist/index27.vue.d.cts +1 -1
  63. package/dist/index27.vue.d.ts +1 -1
  64. package/dist/index3.vue.d.cts +4 -4
  65. package/dist/index3.vue.d.ts +4 -4
  66. package/dist/index30.vue.d.cts +2 -2
  67. package/dist/index30.vue.d.ts +2 -2
  68. package/dist/index31.vue.d.cts +2 -2
  69. package/dist/index31.vue.d.ts +2 -2
  70. package/dist/index5.vue.d.cts +2 -2
  71. package/dist/index9.vue.d.ts +4 -4
  72. package/dist/mapUtils.d.cts +2 -2
  73. package/dist/mapUtils.d.ts +2 -2
  74. package/dist/style.css +89 -77
  75. package/dist/useCalendarEvents.d.cts +1 -1
  76. package/dist/useCalendarEvents.d.ts +1 -1
  77. package/dist/useCollapsePanel.d.cts +3 -3
  78. package/dist/useCollapsePanel.d.ts +3 -3
  79. package/dist/useCropperCore.d.cts +7 -7
  80. package/dist/useCropperCore.d.ts +7 -7
  81. package/dist/useEdgeInteraction.d.cts +3 -3
  82. package/dist/useEdgeInteraction.d.ts +3 -3
  83. package/dist/useFullscreen.d.cts +2 -2
  84. package/dist/useFullscreen.d.ts +2 -2
  85. package/dist/useInfiniteScroll.d.cts +2 -2
  86. package/dist/useInfiniteScroll.d.ts +2 -2
  87. package/dist/useQRCode.d.cts +3 -3
  88. package/dist/useQRCode.d.ts +3 -3
  89. package/dist/useSignatureHistory.d.cts +5 -5
  90. package/dist/useSignatureHistory.d.ts +5 -5
  91. package/dist/useSplitResize.d.cts +7 -7
  92. package/dist/useSplitResize.d.ts +7 -7
  93. package/dist/useTableQuery.d.cts +12 -12
  94. package/dist/useTableQuery.d.ts +12 -12
  95. package/dist/useWorkflowValidation.d.cts +99 -99
  96. package/dist/useWorkflowValidation.d.ts +99 -99
  97. package/dist/verification.d.cts +5 -5
  98. package/dist/verification.d.ts +5 -5
  99. package/docs/guides/data-picker.md +8 -8
  100. package/docs/guides/usage.en.md +16 -15
  101. package/docs/guides/usage.md +16 -15
  102. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @robot-admin/naive-ui-components
2
2
 
3
+ ## 0.29.3
4
+
5
+ ### Patch Changes
6
+
7
+ - `C_DataPicker` 提交行键时可省略 `source.value`。显式映射继续支持;回显与确认复用已解析的键,避免重复调用业务取值函数。
8
+ - `C_FormSearch` 的自定义 `render` 随字段名推导读取值和回填参数,保留已有宽上下文回调。
9
+ - `C_ActionBar` 按原始分组位置识别无 key 动作,相邻按钮隐藏时执行锁不会串位。
10
+
11
+ ## 0.29.2
12
+
13
+ ### Patch Changes
14
+
15
+ - `C_DataPicker` 的查询、清空、重试、取消和确认统一使用随组件样式分发的图标。
16
+ - `C_BatchResult` 的重试按钮使用同一套图标。
17
+
3
18
  ## 0.29.1
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -33,7 +33,7 @@
33
33
  | 按需消费 | 60 个独立组件入口、自动导入 Resolver、组件样式入口,以及表单/表格的基础样式层级 |
34
34
  | 独立接入 | 支持全量注册与局部导入;反馈、文案和全局配置可由宿主提供,表单弹窗可接入结构兼容的 Headless CRUD |
35
35
 
36
- 组件库负责界面与交互。业务接口、身份权限、上传服务和第三方平台配置由应用接入。当前仓库版本 **0.29.1**,版本变化见 [CHANGELOG](./CHANGELOG.md)。
36
+ 组件库负责界面与交互。业务接口、身份权限、上传服务和第三方平台配置由应用接入。当前仓库版本 **0.29.2**,版本变化见 [CHANGELOG](./CHANGELOG.md)。
37
37
 
38
38
  搜索条件、录入字段和操作按钮可以由响应式配置生成。筛选和编辑共享紧凑密度,支持校验、异步选项和业务弹窗。后端字典或权限由项目接入,表单和搜索消费普通选项,表格消费普通列配置。
39
39
 
package/README_EN.md CHANGED
@@ -33,7 +33,7 @@
33
33
  | Selective loading | 60 component entries, an auto-import resolver, component CSS and base styles for forms and tables |
34
34
  | Application integration | Global registration or local imports; injectable feedback, locale and defaults; form dialogs compatible with structurally matching headless CRUD controllers |
35
35
 
36
- The library handles UI and interaction. Applications supply business APIs, authentication, authorization, upload services and platform configuration. The current repository version is **0.29.1**. See the [changelog](./CHANGELOG.md) for release details.
36
+ The library handles UI and interaction. Applications supply business APIs, authentication, authorization, upload services and platform configuration. The current repository version is **0.29.2**. See the [changelog](./CHANGELOG.md) for release details.
37
37
 
38
38
  Search fields, form fields, and actions can be generated from reactive configuration. Compact density applies consistently across search and data entry, including validation, async options, and dialogs. The application owns dictionaries and permissions, supplying ordinary options and column definitions to components.
39
39
 
@@ -67,7 +67,7 @@
67
67
 
68
68
  /* 通用操作按钮组件样式 */
69
69
  /* ================= 主容器 ================= */
70
- .c-action-bar[data-v-48eb3073] {
70
+ .c-action-bar[data-v-144e59ae] {
71
71
  display: flex;
72
72
  min-width: 0;
73
73
  align-items: center;
@@ -79,26 +79,26 @@
79
79
  border: 1px solid var(--c-border);
80
80
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
81
81
  }
82
- .c-action-bar.is-align-left[data-v-48eb3073] {
82
+ .c-action-bar.is-align-left[data-v-144e59ae] {
83
83
  justify-content: flex-start;
84
84
  }
85
- .c-action-bar.is-align-center[data-v-48eb3073] {
85
+ .c-action-bar.is-align-center[data-v-144e59ae] {
86
86
  justify-content: center;
87
87
  }
88
- .c-action-bar.is-align-right[data-v-48eb3073] {
88
+ .c-action-bar.is-align-right[data-v-144e59ae] {
89
89
  justify-content: flex-end;
90
90
  }
91
- .c-action-bar.is-align-space-between[data-v-48eb3073] {
91
+ .c-action-bar.is-align-space-between[data-v-144e59ae] {
92
92
  justify-content: space-between;
93
93
  }
94
- .c-action-bar.is-align-space-around[data-v-48eb3073] {
94
+ .c-action-bar.is-align-space-around[data-v-144e59ae] {
95
95
  justify-content: space-around;
96
96
  }
97
- .c-action-bar.is-compact[data-v-48eb3073] {
97
+ .c-action-bar.is-compact[data-v-144e59ae] {
98
98
  padding: 8px;
99
99
  margin-bottom: 8px;
100
100
  }
101
- .c-action-bar.is-inline[data-v-48eb3073] {
101
+ .c-action-bar.is-inline[data-v-144e59ae] {
102
102
  padding: 0;
103
103
  margin-bottom: 0;
104
104
  background: transparent;
@@ -106,104 +106,104 @@
106
106
  border-radius: 0;
107
107
  box-shadow: none;
108
108
  }
109
- .c-action-bar.is-wrap[data-v-48eb3073] {
109
+ .c-action-bar.is-wrap[data-v-144e59ae] {
110
110
  flex-wrap: wrap;
111
111
  gap: 8px;
112
112
  }
113
- .c-action-bar.is-wrap .actions-group[data-v-48eb3073] {
113
+ .c-action-bar.is-wrap .actions-group[data-v-144e59ae] {
114
114
  flex-wrap: wrap;
115
115
  min-width: 0;
116
116
  max-width: 100%;
117
117
  }
118
118
  @media (max-width: 768px) {
119
- .c-action-bar[data-v-48eb3073] {
119
+ .c-action-bar[data-v-144e59ae] {
120
120
  flex-direction: column;
121
121
  gap: 12px;
122
122
  }
123
- .c-action-bar .actions-group[data-v-48eb3073] {
123
+ .c-action-bar .actions-group[data-v-144e59ae] {
124
124
  width: 100%;
125
125
  justify-content: center;
126
126
  }
127
127
  }
128
128
 
129
129
  /* ================= 按钮组 ================= */
130
- .actions-group[data-v-48eb3073] {
130
+ .actions-group[data-v-144e59ae] {
131
131
  display: flex;
132
132
  align-items: center;
133
133
  gap: 12px;
134
134
  flex-wrap: nowrap;
135
135
  flex-shrink: 0;
136
136
  }
137
- .actions-group.actions-left[data-v-48eb3073] {
137
+ .actions-group.actions-left[data-v-144e59ae] {
138
138
  justify-content: flex-start;
139
139
  }
140
- .actions-group.actions-right[data-v-48eb3073] {
140
+ .actions-group.actions-right[data-v-144e59ae] {
141
141
  justify-content: flex-end;
142
142
  }
143
- .c-action-bar.has-only-left.is-align-center .actions-group.actions-left[data-v-48eb3073], .c-action-bar.has-only-right.is-align-center .actions-group.actions-right[data-v-48eb3073] {
143
+ .c-action-bar.has-only-left.is-align-center .actions-group.actions-left[data-v-144e59ae], .c-action-bar.has-only-right.is-align-center .actions-group.actions-right[data-v-144e59ae] {
144
144
  width: 100%;
145
145
  justify-content: center;
146
146
  }
147
- .c-action-bar.has-only-left.is-align-space-between .actions-group.actions-left[data-v-48eb3073], .c-action-bar.has-only-right.is-align-space-between .actions-group.actions-right[data-v-48eb3073] {
147
+ .c-action-bar.has-only-left.is-align-space-between .actions-group.actions-left[data-v-144e59ae], .c-action-bar.has-only-right.is-align-space-between .actions-group.actions-right[data-v-144e59ae] {
148
148
  width: 100%;
149
149
  justify-content: space-between;
150
150
  }
151
- .c-action-bar.has-only-left.is-align-space-around .actions-group.actions-left[data-v-48eb3073], .c-action-bar.has-only-right.is-align-space-around .actions-group.actions-right[data-v-48eb3073] {
151
+ .c-action-bar.has-only-left.is-align-space-around .actions-group.actions-left[data-v-144e59ae], .c-action-bar.has-only-right.is-align-space-around .actions-group.actions-right[data-v-144e59ae] {
152
152
  width: 100%;
153
153
  justify-content: space-around;
154
154
  }
155
- .c-action-bar.has-only-left.is-align-right .actions-group.actions-left[data-v-48eb3073] {
155
+ .c-action-bar.has-only-left.is-align-right .actions-group.actions-left[data-v-144e59ae] {
156
156
  width: 100%;
157
157
  justify-content: flex-end;
158
158
  }
159
- .c-action-bar.has-only-right.is-align-left .actions-group.actions-right[data-v-48eb3073] {
159
+ .c-action-bar.has-only-right.is-align-left .actions-group.actions-right[data-v-144e59ae] {
160
160
  width: 100%;
161
161
  justify-content: flex-start;
162
162
  }
163
- .actions-group[data-v-48eb3073] .n-button {
163
+ .actions-group[data-v-144e59ae] .n-button {
164
164
  flex-shrink: 0;
165
165
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
166
166
  font-weight: 500;
167
167
  }
168
- .actions-group[data-v-48eb3073] .n-button .n-icon {
168
+ .actions-group[data-v-144e59ae] .n-button .n-icon {
169
169
  transition: transform 0.3s ease;
170
170
  }
171
- .actions-group[data-v-48eb3073] .n-button:hover:not(:disabled) {
171
+ .actions-group[data-v-144e59ae] .n-button:hover:not(:disabled) {
172
172
  transform: translateY(-1px);
173
173
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
174
174
  }
175
- .actions-group[data-v-48eb3073] .n-button:hover:not(:disabled) .n-icon {
175
+ .actions-group[data-v-144e59ae] .n-button:hover:not(:disabled) .n-icon {
176
176
  transform: scale(1.1);
177
177
  }
178
- .actions-group[data-v-48eb3073] .n-button:active:not(:disabled) {
178
+ .actions-group[data-v-144e59ae] .n-button:active:not(:disabled) {
179
179
  transform: translateY(0);
180
180
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
181
181
  }
182
- .actions-group[data-v-48eb3073] .n-button:disabled {
182
+ .actions-group[data-v-144e59ae] .n-button:disabled {
183
183
  cursor: not-allowed;
184
184
  opacity: 0.5;
185
185
  }
186
- .actions-group[data-v-48eb3073] .n-button.n-button--loading {
186
+ .actions-group[data-v-144e59ae] .n-button.n-button--loading {
187
187
  pointer-events: none;
188
188
  }
189
- .actions-group[data-v-48eb3073] .n-button--primary-type:hover:not(:disabled) {
189
+ .actions-group[data-v-144e59ae] .n-button--primary-type:hover:not(:disabled) {
190
190
  box-shadow: 0 4px 12px rgba(24, 160, 88, 0.3);
191
191
  }
192
- .actions-group[data-v-48eb3073] .n-button--info-type:hover:not(:disabled) {
192
+ .actions-group[data-v-144e59ae] .n-button--info-type:hover:not(:disabled) {
193
193
  box-shadow: 0 4px 12px rgba(42, 148, 125, 0.3);
194
194
  }
195
- .actions-group[data-v-48eb3073] .n-button--success-type:hover:not(:disabled) {
195
+ .actions-group[data-v-144e59ae] .n-button--success-type:hover:not(:disabled) {
196
196
  box-shadow: 0 4px 12px rgba(99, 226, 183, 0.3);
197
197
  }
198
- .actions-group[data-v-48eb3073] .n-button--warning-type:hover:not(:disabled) {
198
+ .actions-group[data-v-144e59ae] .n-button--warning-type:hover:not(:disabled) {
199
199
  box-shadow: 0 4px 12px rgba(240, 138, 0, 0.3);
200
200
  }
201
- .actions-group[data-v-48eb3073] .n-button--error-type:hover:not(:disabled) {
201
+ .actions-group[data-v-144e59ae] .n-button--error-type:hover:not(:disabled) {
202
202
  box-shadow: 0 4px 12px rgba(208, 48, 80, 0.3);
203
203
  }
204
204
 
205
205
  /* ================= 中间插槽区域 ================= */
206
- .actions-center[data-v-48eb3073] {
206
+ .actions-center[data-v-144e59ae] {
207
207
  display: flex;
208
208
  align-items: center;
209
209
  justify-content: center;
@@ -213,32 +213,32 @@
213
213
  }
214
214
 
215
215
  /* ================= 分隔线 ================= */
216
- .action-divider[data-v-48eb3073] {
216
+ .action-divider[data-v-144e59ae] {
217
217
  margin: 0 8px !important;
218
218
  height: 20px;
219
219
  opacity: 0.3;
220
220
  transition: opacity 0.3s ease;
221
221
  }
222
- .action-divider[data-v-48eb3073]:hover {
222
+ .action-divider[data-v-144e59ae]:hover {
223
223
  opacity: 0.6;
224
224
  }
225
225
 
226
226
  /* ================= 下拉菜单优化 ================= */
227
- [data-v-48eb3073] .n-dropdown-option {
227
+ [data-v-144e59ae] .n-dropdown-option {
228
228
  transition: all 0.2s ease;
229
229
  }
230
- [data-v-48eb3073] .n-dropdown-option:hover {
230
+ [data-v-144e59ae] .n-dropdown-option:hover {
231
231
  transform: translateX(4px);
232
232
  }
233
- [data-v-48eb3073] .n-dropdown-option .n-icon {
233
+ [data-v-144e59ae] .n-dropdown-option .n-icon {
234
234
  transition: transform 0.2s ease;
235
235
  }
236
- [data-v-48eb3073] .n-dropdown-option:hover .n-icon {
236
+ [data-v-144e59ae] .n-dropdown-option:hover .n-icon {
237
237
  transform: scale(1.15);
238
238
  }
239
239
 
240
240
  /* ================= 加载动画 ================= */
241
- @keyframes button-loading-48eb3073 {
241
+ @keyframes button-loading-144e59ae {
242
242
  0% {
243
243
  opacity: 0.6;
244
244
  }
@@ -249,12 +249,12 @@
249
249
  opacity: 0.6;
250
250
  }
251
251
  }
252
- [data-v-48eb3073] .n-button--loading {
253
- animation: button-loading-48eb3073 1.5s ease-in-out infinite;
252
+ [data-v-144e59ae] .n-button--loading {
253
+ animation: button-loading-144e59ae 1.5s ease-in-out infinite;
254
254
  }
255
255
 
256
256
  /* ================= Tooltip 样式 ================= */
257
- [data-v-48eb3073] .n-tooltip .n-tooltip__content {
257
+ [data-v-144e59ae] .n-tooltip .n-tooltip__content {
258
258
  font-size: 12px;
259
259
  padding: 6px 10px;
260
260
  border-radius: 4px;
@@ -263,20 +263,20 @@
263
263
  }
264
264
 
265
265
  /* ================= 暗黑模式适配 ================= */
266
- html.dark .c-action-bar[data-v-48eb3073] {
266
+ html.dark .c-action-bar[data-v-144e59ae] {
267
267
  border-color: rgba(255, 255, 255, 0.09);
268
268
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
269
269
  }
270
- html.dark .actions-group[data-v-48eb3073] .n-button:hover:not(:disabled) {
270
+ html.dark .actions-group[data-v-144e59ae] .n-button:hover:not(:disabled) {
271
271
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
272
272
  }
273
- html.dark .action-divider[data-v-48eb3073] {
273
+ html.dark .action-divider[data-v-144e59ae] {
274
274
  opacity: 0.15;
275
275
  }
276
- html.dark .action-divider[data-v-48eb3073]:hover {
276
+ html.dark .action-divider[data-v-144e59ae]:hover {
277
277
  opacity: 0.4;
278
278
  }
279
279
 
280
280
  /* layer: default */
281
- .inline[data-v-48eb3073]{display:inline;}
282
- .px[data-v-48eb3073]{padding-left:1rem;padding-right:1rem;}
281
+ .inline[data-v-144e59ae]{display:inline;}
282
+ .px[data-v-144e59ae]{padding-left:1rem;padding-right:1rem;}
@@ -1 +1 @@
1
- require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`),n=require(`./useActionTask.cjs`);let r=require(`vue`),i=require(`naive-ui`);const a=`mdi:gesture-tap-button`,o={align:`left`,size:`tiny`,gap:6,wrap:!1,showDivider:!1,dividerType:`vertical`,compact:!0,inline:!0},s={add:{label:`新增`,icon:`mdi:plus`,type:`primary`},create:{label:`新增`,icon:`mdi:plus`,type:`primary`},save:{label:`保存`,icon:`mdi:content-save-outline`,type:`primary`},confirm:{label:`确认`,icon:`mdi:check`,type:`primary`},cancel:{label:`取消`,icon:`mdi:close`},close:{label:`关闭`,icon:`mdi:close`},view:{label:`查看`,icon:`mdi:eye-outline`},edit:{label:`编辑`,icon:`mdi:pencil-outline`},delete:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},remove:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},refresh:{label:`刷新`,icon:`mdi:refresh`},import:{label:`导入`,icon:`mdi:file-import-outline`},export:{label:`导出`,icon:`mdi:file-export-outline`},print:{label:`打印`,icon:`mdi:printer-outline`},reset:{label:`重置`,icon:`mdi:restore`},columns:{label:`列设置`,icon:`mdi:view-column-outline`},fullscreen:{label:`全屏`,icon:`mdi:fullscreen`},settings:{label:`功能配置`,icon:`mdi:tune-variant`},more:{label:`更多`,icon:`mdi:dots-horizontal`}},c=e=>{let t=e.key?s[e.key]:void 0;return{...t,...e,label:e.label||t?.label||e.key||`操作`,icon:e.icon||t?.icon||a}},l=e=>typeof e==`function`?e():(0,r.unref)(e),u=e=>e,d={key:1,class:`actions-center`},f=(0,r.defineComponent)({name:`C_ActionBar`,__name:`index`,props:{actions:{default:()=>[]},leftActions:{default:()=>[]},rightActions:{default:()=>[]},config:{default:()=>({})}},emits:[`action-click`,`dropdown-click`,`action-error`],setup(t,{emit:a}){let s=t,u=a,f=(0,r.computed)(()=>({...o,...s.config,gap:s.config.gap??(s.config.compact===!1?12:o.gap)})),p=(0,r.computed)(()=>{if(s.leftActions&&s.leftActions.length>0)return s.leftActions.filter(e=>h(e));if(s.actions.length>0){let e=s.rightActions&&s.rightActions.length>0,t=s.actions.some(e=>e.group===`right`);return!e&&!t?s.actions.filter(e=>h(e)):s.actions.filter(e=>e.group!==`right`&&h(e))}return[]}),m=(0,r.computed)(()=>s.rightActions&&s.rightActions.length>0?s.rightActions.filter(e=>h(e)):s.actions.filter(e=>e.group===`right`&&h(e))),h=e=>e.show===void 0?!0:l(e.show)??!0,g=(e,t)=>{let n=new Map;return e.map((e,r)=>{let i=JSON.stringify(e.key===void 0?[`position`,t,r]:[`key`,e.key]),a=n.get(i)??0;return n.set(i,a+1),{action:e,taskKey:i,renderKey:`${i}:${a}`}})},_=(0,r.computed)(()=>g(p.value,`left`)),v=(0,r.computed)(()=>g(m.value,`right`)),y=n.t(),b=(e,t)=>!!(l(e.disabled)||e.buttonProps?.disabled||y.isRunning(t)),x=(e,t)=>!!(l(e.loading)||e.buttonProps?.loading||e.autoLoading!==!1&&y.isRunning(t)),S=async({action:e,taskKey:t})=>{if(!(e.dropdown&&e.dropdown.length>0))try{await y.run(t,async()=>{u(`action-click`,e),await e.onClick?.()},()=>!b(e,t)&&!x(e,t))}catch(t){throw u(`action-error`,t,e),t}},C=async(e,{action:t,taskKey:n})=>{try{await y.run(n,async()=>{u(`dropdown-click`,e,t),await e.onClick?.()},()=>!b(t,n)&&!x(t,n)&&l(e.disabled)!==!0&&l(e.show)!==!1)}catch(n){throw u(`action-error`,n,t,e),n}},w=(0,r.defineComponent)({name:`ActionButton`,props:{action:{type:Object,required:!0},taskKey:{type:String,required:!0}},emits:[`click`,`dropdown-select`],setup(t,{emit:n}){let a=(0,r.computed)(()=>t.action),o=(0,r.computed)(()=>c(a.value)),s=(0,r.computed)(()=>o.value.buttonProps?.size||o.value.size||f.value.size),u=(0,r.computed)(()=>({tiny:14,small:15,medium:16,large:18})[s.value]),d=(0,r.computed)(()=>o.value.dropdown?o.value.dropdown.filter(e=>e.show===void 0?!0:l(e.show)).map(n=>{let{icon:i}=n;return{key:n.key,label:n.label,icon:i?()=>(0,r.h)(e.t,{name:i,size:14,"aria-hidden":!0}):void 0,disabled:b(a.value,t.taskKey)||x(a.value,t.taskKey)||l(n.disabled)}}):[]),p=e=>{let r=o.value.dropdown?.find(t=>t.key===e);r&&!b(a.value,t.taskKey)&&!x(a.value,t.taskKey)&&l(r.disabled)!==!0&&l(r.show)!==!1&&n(`dropdown-select`,r)},m=n=>{let{icon:c,buttonProps:l}=o.value,d=e=>{if(b(a.value,t.taskKey)||x(a.value,t.taskKey))return;n?.();let r=l?.onClick;Array.isArray(r)?r.forEach(t=>t(e)):r?.(e)},f=(0,r.h)(i.NButton,{type:o.value.type||`default`,size:s.value,...l,loading:x(a.value,t.taskKey),disabled:b(a.value,t.taskKey),onClick:d},{default:()=>o.value.label,icon:c?()=>(0,r.h)(e.t,{name:c,size:u.value,"aria-hidden":!0}):void 0});return o.value.directives&&o.value.directives.length>0?(0,r.withDirectives)(f,o.value.directives):f},h=()=>{let e=m(()=>n(`click`));return o.value.tooltip?(0,r.h)(i.NTooltip,{placement:`top`},{trigger:()=>e,default:()=>o.value.tooltip}):e},g=()=>{let e=m();return(0,r.h)(i.NDropdown,{disabled:b(a.value,t.taskKey)||x(a.value,t.taskKey),options:d.value,onSelect:p},{default:()=>e})};return()=>o.value.dropdown&&o.value.dropdown.length>0?g():h()}});return(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)([`c-action-bar`,{"is-compact":f.value.compact,"is-inline":f.value.inline,"is-wrap":f.value.wrap,[`is-align-${f.value.align}`]:!0,"has-only-left":_.value.length>0&&v.value.length===0&&!e.$slots.center,"has-only-right":v.value.length>0&&_.value.length===0&&!e.$slots.center}])},[_.value.length>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:`actions-group actions-left`,style:(0,r.normalizeStyle)({gap:`${f.value.gap}px`})},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(_.value,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:e.renderKey},[(0,r.createVNode)((0,r.unref)(w),{action:e.action,"task-key":e.taskKey,onClick:t=>S(e),onDropdownSelect:t=>C(t,e)},null,8,[`action`,`task-key`,`onClick`,`onDropdownSelect`]),f.value.showDivider&&t<_.value.length-1&&f.value.dividerType===`vertical`?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(i.NDivider),{key:0,vertical:``,class:`action-divider`})):(0,r.createCommentVNode)(`v-if`,!0)],64))),128))],4)):(0,r.createCommentVNode)(`v-if`,!0),e.$slots.center?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,d,[(0,r.renderSlot)(e.$slots,`center`,{},void 0,!0)])):(0,r.createCommentVNode)(`v-if`,!0),v.value.length>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,class:`actions-group actions-right`,style:(0,r.normalizeStyle)({gap:`${f.value.gap}px`})},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(v.value,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:e.renderKey},[(0,r.createVNode)((0,r.unref)(w),{action:e.action,"task-key":e.taskKey,onClick:t=>S(e),onDropdownSelect:t=>C(t,e)},null,8,[`action`,`task-key`,`onClick`,`onDropdownSelect`]),f.value.showDivider&&t<v.value.length-1&&f.value.dividerType===`vertical`?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(i.NDivider),{key:0,vertical:``,class:`action-divider`})):(0,r.createCommentVNode)(`v-if`,!0)],64))),128))],4)):(0,r.createCommentVNode)(`v-if`,!0)],2))}});var p=t.t(f,[[`__scopeId`,`data-v-48eb3073`]]);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
1
+ require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`),n=require(`./useActionTask.cjs`);let r=require(`vue`),i=require(`naive-ui`);const a=`mdi:gesture-tap-button`,o={align:`left`,size:`tiny`,gap:6,wrap:!1,showDivider:!1,dividerType:`vertical`,compact:!0,inline:!0},s={add:{label:`新增`,icon:`mdi:plus`,type:`primary`},create:{label:`新增`,icon:`mdi:plus`,type:`primary`},save:{label:`保存`,icon:`mdi:content-save-outline`,type:`primary`},confirm:{label:`确认`,icon:`mdi:check`,type:`primary`},cancel:{label:`取消`,icon:`mdi:close`},close:{label:`关闭`,icon:`mdi:close`},view:{label:`查看`,icon:`mdi:eye-outline`},edit:{label:`编辑`,icon:`mdi:pencil-outline`},delete:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},remove:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},refresh:{label:`刷新`,icon:`mdi:refresh`},import:{label:`导入`,icon:`mdi:file-import-outline`},export:{label:`导出`,icon:`mdi:file-export-outline`},print:{label:`打印`,icon:`mdi:printer-outline`},reset:{label:`重置`,icon:`mdi:restore`},columns:{label:`列设置`,icon:`mdi:view-column-outline`},fullscreen:{label:`全屏`,icon:`mdi:fullscreen`},settings:{label:`功能配置`,icon:`mdi:tune-variant`},more:{label:`更多`,icon:`mdi:dots-horizontal`}},c=e=>{let t=e.key?s[e.key]:void 0;return{...t,...e,label:e.label||t?.label||e.key||`操作`,icon:e.icon||t?.icon||a}},l=e=>typeof e==`function`?e():(0,r.unref)(e),u=e=>e,d={key:1,class:`actions-center`},f=(0,r.defineComponent)({name:`C_ActionBar`,__name:`index`,props:{actions:{default:()=>[]},leftActions:{default:()=>[]},rightActions:{default:()=>[]},config:{default:()=>({})}},emits:[`action-click`,`dropdown-click`,`action-error`],setup(t,{emit:a}){let s=t,u=a,f=(0,r.computed)(()=>({...o,...s.config,gap:s.config.gap??(s.config.compact===!1?12:o.gap)})),p=(0,r.computed)(()=>s.leftActions?.length?s.leftActions:s.actions.filter(e=>e.group!==`right`)),m=(0,r.computed)(()=>s.rightActions?.length?s.rightActions:s.actions.filter(e=>e.group===`right`)),h=(e,t)=>{let n=new Map,r=[];return e.forEach((e,i)=>{let a=e.key===void 0?`position:${t}:${i}`:`key:${e.key}`,o=n.get(a)??0;n.set(a,o+1),l(e.show)!==!1&&r.push({action:e,taskKey:a,renderKey:`${a}:${o}`})}),r},g=(0,r.computed)(()=>h(p.value,`left`)),_=(0,r.computed)(()=>h(m.value,`right`)),v=n.t(),y=(e,t)=>!!(l(e.disabled)||e.buttonProps?.disabled||v.isRunning(t)),b=(e,t)=>!!(l(e.loading)||e.buttonProps?.loading||e.autoLoading!==!1&&v.isRunning(t)),x=async({action:e,taskKey:t})=>{if(!(e.dropdown&&e.dropdown.length>0))try{await v.run(t,async()=>{u(`action-click`,e),await e.onClick?.()},()=>!y(e,t)&&!b(e,t))}catch(t){throw u(`action-error`,t,e),t}},S=async(e,{action:t,taskKey:n})=>{try{await v.run(n,async()=>{u(`dropdown-click`,e,t),await e.onClick?.()},()=>!y(t,n)&&!b(t,n)&&l(e.disabled)!==!0&&l(e.show)!==!1)}catch(n){throw u(`action-error`,n,t,e),n}},C=(0,r.defineComponent)({name:`ActionButton`,props:{action:{type:Object,required:!0},taskKey:{type:String,required:!0}},emits:[`click`,`dropdown-select`],setup(t,{emit:n}){let a=(0,r.computed)(()=>t.action),o=(0,r.computed)(()=>c(a.value)),s=(0,r.computed)(()=>o.value.buttonProps?.size||o.value.size||f.value.size),u=(0,r.computed)(()=>({tiny:14,small:15,medium:16,large:18})[s.value]),d=(0,r.computed)(()=>o.value.dropdown?o.value.dropdown.filter(e=>e.show===void 0?!0:l(e.show)).map(n=>{let{icon:i}=n;return{key:n.key,label:n.label,icon:i?()=>(0,r.h)(e.t,{name:i,size:14,"aria-hidden":!0}):void 0,disabled:y(a.value,t.taskKey)||b(a.value,t.taskKey)||l(n.disabled)}}):[]),p=e=>{let r=o.value.dropdown?.find(t=>t.key===e);r&&!y(a.value,t.taskKey)&&!b(a.value,t.taskKey)&&l(r.disabled)!==!0&&l(r.show)!==!1&&n(`dropdown-select`,r)},m=n=>{let{icon:c,buttonProps:l}=o.value,d=e=>{if(y(a.value,t.taskKey)||b(a.value,t.taskKey))return;n?.();let r=l?.onClick;Array.isArray(r)?r.forEach(t=>t(e)):r?.(e)},f=(0,r.h)(i.NButton,{type:o.value.type||`default`,size:s.value,...l,loading:b(a.value,t.taskKey),disabled:y(a.value,t.taskKey),onClick:d},{default:()=>o.value.label,icon:c?()=>(0,r.h)(e.t,{name:c,size:u.value,"aria-hidden":!0}):void 0});return o.value.directives&&o.value.directives.length>0?(0,r.withDirectives)(f,o.value.directives):f},h=()=>{let e=m(()=>n(`click`));return o.value.tooltip?(0,r.h)(i.NTooltip,{placement:`top`},{trigger:()=>e,default:()=>o.value.tooltip}):e},g=()=>{let e=m();return(0,r.h)(i.NDropdown,{disabled:y(a.value,t.taskKey)||b(a.value,t.taskKey),options:d.value,onSelect:p},{default:()=>e})};return()=>o.value.dropdown&&o.value.dropdown.length>0?g():h()}});return(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)([`c-action-bar`,{"is-compact":f.value.compact,"is-inline":f.value.inline,"is-wrap":f.value.wrap,[`is-align-${f.value.align}`]:!0,"has-only-left":g.value.length>0&&_.value.length===0&&!e.$slots.center,"has-only-right":_.value.length>0&&g.value.length===0&&!e.$slots.center}])},[g.value.length>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:`actions-group actions-left`,style:(0,r.normalizeStyle)({gap:`${f.value.gap}px`})},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(g.value,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:e.renderKey},[(0,r.createVNode)((0,r.unref)(C),{action:e.action,"task-key":e.taskKey,onClick:t=>x(e),onDropdownSelect:t=>S(t,e)},null,8,[`action`,`task-key`,`onClick`,`onDropdownSelect`]),f.value.showDivider&&t<g.value.length-1&&f.value.dividerType===`vertical`?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(i.NDivider),{key:0,vertical:``,class:`action-divider`})):(0,r.createCommentVNode)(`v-if`,!0)],64))),128))],4)):(0,r.createCommentVNode)(`v-if`,!0),e.$slots.center?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,d,[(0,r.renderSlot)(e.$slots,`center`,{},void 0,!0)])):(0,r.createCommentVNode)(`v-if`,!0),_.value.length>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,class:`actions-group actions-right`,style:(0,r.normalizeStyle)({gap:`${f.value.gap}px`})},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(_.value,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:e.renderKey},[(0,r.createVNode)((0,r.unref)(C),{action:e.action,"task-key":e.taskKey,onClick:t=>x(e),onDropdownSelect:t=>S(t,e)},null,8,[`action`,`task-key`,`onClick`,`onDropdownSelect`]),f.value.showDivider&&t<_.value.length-1&&f.value.dividerType===`vertical`?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(i.NDivider),{key:0,vertical:``,class:`action-divider`})):(0,r.createCommentVNode)(`v-if`,!0)],64))),128))],4)):(0,r.createCommentVNode)(`v-if`,!0)],2))}});var p=t.t(f,[[`__scopeId`,`data-v-144e59ae`]]);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
@@ -1 +1 @@
1
- import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{t as n}from"./useActionTask.js";import{Fragment as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createVNode as c,defineComponent as l,h as u,normalizeClass as d,normalizeStyle as f,openBlock as p,renderList as m,renderSlot as h,unref as g,withDirectives as _}from"vue";import{NButton as v,NDivider as y,NDropdown as b,NTooltip as x}from"naive-ui";const S=`mdi:gesture-tap-button`,C={align:`left`,size:`tiny`,gap:6,wrap:!1,showDivider:!1,dividerType:`vertical`,compact:!0,inline:!0},w={add:{label:`新增`,icon:`mdi:plus`,type:`primary`},create:{label:`新增`,icon:`mdi:plus`,type:`primary`},save:{label:`保存`,icon:`mdi:content-save-outline`,type:`primary`},confirm:{label:`确认`,icon:`mdi:check`,type:`primary`},cancel:{label:`取消`,icon:`mdi:close`},close:{label:`关闭`,icon:`mdi:close`},view:{label:`查看`,icon:`mdi:eye-outline`},edit:{label:`编辑`,icon:`mdi:pencil-outline`},delete:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},remove:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},refresh:{label:`刷新`,icon:`mdi:refresh`},import:{label:`导入`,icon:`mdi:file-import-outline`},export:{label:`导出`,icon:`mdi:file-export-outline`},print:{label:`打印`,icon:`mdi:printer-outline`},reset:{label:`重置`,icon:`mdi:restore`},columns:{label:`列设置`,icon:`mdi:view-column-outline`},fullscreen:{label:`全屏`,icon:`mdi:fullscreen`},settings:{label:`功能配置`,icon:`mdi:tune-variant`},more:{label:`更多`,icon:`mdi:dots-horizontal`}},T=e=>{let t=e.key?w[e.key]:void 0;return{...t,...e,label:e.label||t?.label||e.key||`操作`,icon:e.icon||t?.icon||S}},E=e=>typeof e==`function`?e():g(e),D=e=>e,O={key:1,class:`actions-center`};var k=t(l({name:`C_ActionBar`,__name:`index`,props:{actions:{default:()=>[]},leftActions:{default:()=>[]},rightActions:{default:()=>[]},config:{default:()=>({})}},emits:[`action-click`,`dropdown-click`,`action-error`],setup(t,{emit:S}){let w=t,D=S,k=i(()=>({...C,...w.config,gap:w.config.gap??(w.config.compact===!1?12:C.gap)})),A=i(()=>{if(w.leftActions&&w.leftActions.length>0)return w.leftActions.filter(e=>M(e));if(w.actions.length>0){let e=w.rightActions&&w.rightActions.length>0,t=w.actions.some(e=>e.group===`right`);return!e&&!t?w.actions.filter(e=>M(e)):w.actions.filter(e=>e.group!==`right`&&M(e))}return[]}),j=i(()=>w.rightActions&&w.rightActions.length>0?w.rightActions.filter(e=>M(e)):w.actions.filter(e=>e.group===`right`&&M(e))),M=e=>e.show===void 0?!0:E(e.show)??!0,N=(e,t)=>{let n=new Map;return e.map((e,r)=>{let i=JSON.stringify(e.key===void 0?[`position`,t,r]:[`key`,e.key]),a=n.get(i)??0;return n.set(i,a+1),{action:e,taskKey:i,renderKey:`${i}:${a}`}})},P=i(()=>N(A.value,`left`)),F=i(()=>N(j.value,`right`)),I=n(),L=(e,t)=>!!(E(e.disabled)||e.buttonProps?.disabled||I.isRunning(t)),R=(e,t)=>!!(E(e.loading)||e.buttonProps?.loading||e.autoLoading!==!1&&I.isRunning(t)),z=async({action:e,taskKey:t})=>{if(!(e.dropdown&&e.dropdown.length>0))try{await I.run(t,async()=>{D(`action-click`,e),await e.onClick?.()},()=>!L(e,t)&&!R(e,t))}catch(t){throw D(`action-error`,t,e),t}},B=async(e,{action:t,taskKey:n})=>{try{await I.run(n,async()=>{D(`dropdown-click`,e,t),await e.onClick?.()},()=>!L(t,n)&&!R(t,n)&&E(e.disabled)!==!0&&E(e.show)!==!1)}catch(n){throw D(`action-error`,n,t,e),n}},V=l({name:`ActionButton`,props:{action:{type:Object,required:!0},taskKey:{type:String,required:!0}},emits:[`click`,`dropdown-select`],setup(t,{emit:n}){let r=i(()=>t.action),a=i(()=>T(r.value)),o=i(()=>a.value.buttonProps?.size||a.value.size||k.value.size),s=i(()=>({tiny:14,small:15,medium:16,large:18})[o.value]),c=i(()=>a.value.dropdown?a.value.dropdown.filter(e=>e.show===void 0?!0:E(e.show)).map(n=>{let{icon:i}=n;return{key:n.key,label:n.label,icon:i?()=>u(e,{name:i,size:14,"aria-hidden":!0}):void 0,disabled:L(r.value,t.taskKey)||R(r.value,t.taskKey)||E(n.disabled)}}):[]),l=e=>{let i=a.value.dropdown?.find(t=>t.key===e);i&&!L(r.value,t.taskKey)&&!R(r.value,t.taskKey)&&E(i.disabled)!==!0&&E(i.show)!==!1&&n(`dropdown-select`,i)},d=n=>{let{icon:i,buttonProps:c}=a.value,l=e=>{if(L(r.value,t.taskKey)||R(r.value,t.taskKey))return;n?.();let i=c?.onClick;Array.isArray(i)?i.forEach(t=>t(e)):i?.(e)},d=u(v,{type:a.value.type||`default`,size:o.value,...c,loading:R(r.value,t.taskKey),disabled:L(r.value,t.taskKey),onClick:l},{default:()=>a.value.label,icon:i?()=>u(e,{name:i,size:s.value,"aria-hidden":!0}):void 0});return a.value.directives&&a.value.directives.length>0?_(d,a.value.directives):d},f=()=>{let e=d(()=>n(`click`));return a.value.tooltip?u(x,{placement:`top`},{trigger:()=>e,default:()=>a.value.tooltip}):e},p=()=>{let e=d();return u(b,{disabled:L(r.value,t.taskKey)||R(r.value,t.taskKey),options:c.value,onSelect:l},{default:()=>e})};return()=>a.value.dropdown&&a.value.dropdown.length>0?p():f()}});return(e,t)=>(p(),s(`div`,{class:d([`c-action-bar`,{"is-compact":k.value.compact,"is-inline":k.value.inline,"is-wrap":k.value.wrap,[`is-align-${k.value.align}`]:!0,"has-only-left":P.value.length>0&&F.value.length===0&&!e.$slots.center,"has-only-right":F.value.length>0&&P.value.length===0&&!e.$slots.center}])},[P.value.length>0?(p(),s(`div`,{key:0,class:`actions-group actions-left`,style:f({gap:`${k.value.gap}px`})},[(p(!0),s(r,null,m(P.value,(e,t)=>(p(),s(r,{key:e.renderKey},[c(g(V),{action:e.action,"task-key":e.taskKey,onClick:t=>z(e),onDropdownSelect:t=>B(t,e)},null,8,[`action`,`task-key`,`onClick`,`onDropdownSelect`]),k.value.showDivider&&t<P.value.length-1&&k.value.dividerType===`vertical`?(p(),a(g(y),{key:0,vertical:``,class:`action-divider`})):o(`v-if`,!0)],64))),128))],4)):o(`v-if`,!0),e.$slots.center?(p(),s(`div`,O,[h(e.$slots,`center`,{},void 0,!0)])):o(`v-if`,!0),F.value.length>0?(p(),s(`div`,{key:2,class:`actions-group actions-right`,style:f({gap:`${k.value.gap}px`})},[(p(!0),s(r,null,m(F.value,(e,t)=>(p(),s(r,{key:e.renderKey},[c(g(V),{action:e.action,"task-key":e.taskKey,onClick:t=>z(e),onDropdownSelect:t=>B(t,e)},null,8,[`action`,`task-key`,`onClick`,`onDropdownSelect`]),k.value.showDivider&&t<F.value.length-1&&k.value.dividerType===`vertical`?(p(),a(g(y),{key:0,vertical:``,class:`action-divider`})):o(`v-if`,!0)],64))),128))],4)):o(`v-if`,!0)],2))}}),[[`__scopeId`,`data-v-48eb3073`]]);export{D as a,S as i,C as n,T as o,w as r,k as t};
1
+ import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{t as n}from"./useActionTask.js";import{Fragment as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createVNode as c,defineComponent as l,h as u,normalizeClass as d,normalizeStyle as f,openBlock as p,renderList as m,renderSlot as h,unref as g,withDirectives as _}from"vue";import{NButton as v,NDivider as y,NDropdown as b,NTooltip as x}from"naive-ui";const S=`mdi:gesture-tap-button`,C={align:`left`,size:`tiny`,gap:6,wrap:!1,showDivider:!1,dividerType:`vertical`,compact:!0,inline:!0},w={add:{label:`新增`,icon:`mdi:plus`,type:`primary`},create:{label:`新增`,icon:`mdi:plus`,type:`primary`},save:{label:`保存`,icon:`mdi:content-save-outline`,type:`primary`},confirm:{label:`确认`,icon:`mdi:check`,type:`primary`},cancel:{label:`取消`,icon:`mdi:close`},close:{label:`关闭`,icon:`mdi:close`},view:{label:`查看`,icon:`mdi:eye-outline`},edit:{label:`编辑`,icon:`mdi:pencil-outline`},delete:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},remove:{label:`删除`,icon:`mdi:delete-outline`,type:`error`},refresh:{label:`刷新`,icon:`mdi:refresh`},import:{label:`导入`,icon:`mdi:file-import-outline`},export:{label:`导出`,icon:`mdi:file-export-outline`},print:{label:`打印`,icon:`mdi:printer-outline`},reset:{label:`重置`,icon:`mdi:restore`},columns:{label:`列设置`,icon:`mdi:view-column-outline`},fullscreen:{label:`全屏`,icon:`mdi:fullscreen`},settings:{label:`功能配置`,icon:`mdi:tune-variant`},more:{label:`更多`,icon:`mdi:dots-horizontal`}},T=e=>{let t=e.key?w[e.key]:void 0;return{...t,...e,label:e.label||t?.label||e.key||`操作`,icon:e.icon||t?.icon||S}},E=e=>typeof e==`function`?e():g(e),D=e=>e,O={key:1,class:`actions-center`};var k=t(l({name:`C_ActionBar`,__name:`index`,props:{actions:{default:()=>[]},leftActions:{default:()=>[]},rightActions:{default:()=>[]},config:{default:()=>({})}},emits:[`action-click`,`dropdown-click`,`action-error`],setup(t,{emit:S}){let w=t,D=S,k=i(()=>({...C,...w.config,gap:w.config.gap??(w.config.compact===!1?12:C.gap)})),A=i(()=>w.leftActions?.length?w.leftActions:w.actions.filter(e=>e.group!==`right`)),j=i(()=>w.rightActions?.length?w.rightActions:w.actions.filter(e=>e.group===`right`)),M=(e,t)=>{let n=new Map,r=[];return e.forEach((e,i)=>{let a=e.key===void 0?`position:${t}:${i}`:`key:${e.key}`,o=n.get(a)??0;n.set(a,o+1),E(e.show)!==!1&&r.push({action:e,taskKey:a,renderKey:`${a}:${o}`})}),r},N=i(()=>M(A.value,`left`)),P=i(()=>M(j.value,`right`)),F=n(),I=(e,t)=>!!(E(e.disabled)||e.buttonProps?.disabled||F.isRunning(t)),L=(e,t)=>!!(E(e.loading)||e.buttonProps?.loading||e.autoLoading!==!1&&F.isRunning(t)),R=async({action:e,taskKey:t})=>{if(!(e.dropdown&&e.dropdown.length>0))try{await F.run(t,async()=>{D(`action-click`,e),await e.onClick?.()},()=>!I(e,t)&&!L(e,t))}catch(t){throw D(`action-error`,t,e),t}},z=async(e,{action:t,taskKey:n})=>{try{await F.run(n,async()=>{D(`dropdown-click`,e,t),await e.onClick?.()},()=>!I(t,n)&&!L(t,n)&&E(e.disabled)!==!0&&E(e.show)!==!1)}catch(n){throw D(`action-error`,n,t,e),n}},B=l({name:`ActionButton`,props:{action:{type:Object,required:!0},taskKey:{type:String,required:!0}},emits:[`click`,`dropdown-select`],setup(t,{emit:n}){let r=i(()=>t.action),a=i(()=>T(r.value)),o=i(()=>a.value.buttonProps?.size||a.value.size||k.value.size),s=i(()=>({tiny:14,small:15,medium:16,large:18})[o.value]),c=i(()=>a.value.dropdown?a.value.dropdown.filter(e=>e.show===void 0?!0:E(e.show)).map(n=>{let{icon:i}=n;return{key:n.key,label:n.label,icon:i?()=>u(e,{name:i,size:14,"aria-hidden":!0}):void 0,disabled:I(r.value,t.taskKey)||L(r.value,t.taskKey)||E(n.disabled)}}):[]),l=e=>{let i=a.value.dropdown?.find(t=>t.key===e);i&&!I(r.value,t.taskKey)&&!L(r.value,t.taskKey)&&E(i.disabled)!==!0&&E(i.show)!==!1&&n(`dropdown-select`,i)},d=n=>{let{icon:i,buttonProps:c}=a.value,l=e=>{if(I(r.value,t.taskKey)||L(r.value,t.taskKey))return;n?.();let i=c?.onClick;Array.isArray(i)?i.forEach(t=>t(e)):i?.(e)},d=u(v,{type:a.value.type||`default`,size:o.value,...c,loading:L(r.value,t.taskKey),disabled:I(r.value,t.taskKey),onClick:l},{default:()=>a.value.label,icon:i?()=>u(e,{name:i,size:s.value,"aria-hidden":!0}):void 0});return a.value.directives&&a.value.directives.length>0?_(d,a.value.directives):d},f=()=>{let e=d(()=>n(`click`));return a.value.tooltip?u(x,{placement:`top`},{trigger:()=>e,default:()=>a.value.tooltip}):e},p=()=>{let e=d();return u(b,{disabled:I(r.value,t.taskKey)||L(r.value,t.taskKey),options:c.value,onSelect:l},{default:()=>e})};return()=>a.value.dropdown&&a.value.dropdown.length>0?p():f()}});return(e,t)=>(p(),s(`div`,{class:d([`c-action-bar`,{"is-compact":k.value.compact,"is-inline":k.value.inline,"is-wrap":k.value.wrap,[`is-align-${k.value.align}`]:!0,"has-only-left":N.value.length>0&&P.value.length===0&&!e.$slots.center,"has-only-right":P.value.length>0&&N.value.length===0&&!e.$slots.center}])},[N.value.length>0?(p(),s(`div`,{key:0,class:`actions-group actions-left`,style:f({gap:`${k.value.gap}px`})},[(p(!0),s(r,null,m(N.value,(e,t)=>(p(),s(r,{key:e.renderKey},[c(g(B),{action:e.action,"task-key":e.taskKey,onClick:t=>R(e),onDropdownSelect:t=>z(t,e)},null,8,[`action`,`task-key`,`onClick`,`onDropdownSelect`]),k.value.showDivider&&t<N.value.length-1&&k.value.dividerType===`vertical`?(p(),a(g(y),{key:0,vertical:``,class:`action-divider`})):o(`v-if`,!0)],64))),128))],4)):o(`v-if`,!0),e.$slots.center?(p(),s(`div`,O,[h(e.$slots,`center`,{},void 0,!0)])):o(`v-if`,!0),P.value.length>0?(p(),s(`div`,{key:2,class:`actions-group actions-right`,style:f({gap:`${k.value.gap}px`})},[(p(!0),s(r,null,m(P.value,(e,t)=>(p(),s(r,{key:e.renderKey},[c(g(B),{action:e.action,"task-key":e.taskKey,onClick:t=>R(e),onDropdownSelect:t=>z(t,e)},null,8,[`action`,`task-key`,`onClick`,`onDropdownSelect`]),k.value.showDivider&&t<P.value.length-1&&k.value.dividerType===`vertical`?(p(),a(g(y),{key:0,vertical:``,class:`action-divider`})):o(`v-if`,!0)],64))),128))],4)):o(`v-if`,!0)],2))}}),[[`__scopeId`,`data-v-144e59ae`]]);export{D as a,S as i,C as n,T as o,w as r,k as t};
@@ -1,32 +1,36 @@
1
1
  @import "./C_Table.base.css";
2
- .c-batch-result[data-v-0a4af1f2] {
2
+ .c-batch-result[data-v-62bc5106] {
3
3
  min-width: 0;
4
4
  }
5
- .c-batch-result__header[data-v-0a4af1f2] {
5
+ .c-batch-result__header[data-v-62bc5106] {
6
6
  display: flex;
7
7
  gap: 8px 16px;
8
8
  align-items: baseline;
9
9
  flex-wrap: wrap;
10
10
  margin-bottom: 12px;
11
11
  }
12
- .c-batch-result__header span[data-v-0a4af1f2] {
12
+ .c-batch-result__header span[data-v-62bc5106] {
13
13
  font-size: 12px;
14
14
  opacity: 0.72;
15
15
  }
16
- .c-batch-result__toolbar[data-v-0a4af1f2] {
16
+ .c-batch-result__toolbar[data-v-62bc5106] {
17
17
  display: flex;
18
18
  gap: 12px;
19
19
  align-items: center;
20
20
  justify-content: space-between;
21
21
  margin-bottom: 12px;
22
22
  }
23
- .c-batch-result__toolbar[data-v-0a4af1f2] .n-select {
23
+ .c-batch-result__toolbar[data-v-62bc5106] .n-select {
24
24
  width: min(180px, 50%);
25
25
  }
26
- .c-batch-result[data-v-0a4af1f2] .n-pagination {
26
+ .c-batch-result[data-v-62bc5106] .n-pagination {
27
27
  justify-content: flex-end;
28
28
  margin-top: 12px;
29
29
  }
30
30
 
31
+ /* layer: icons */
32
+ .i-mdi\:refresh[data-v-62bc5106]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
31
33
  /* layer: default */
32
- .filter[data-v-0a4af1f2]{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
34
+ .h-4[data-v-62bc5106]{height:1rem;}
35
+ .w-4[data-v-62bc5106]{width:1rem;}
36
+ .filter[data-v-62bc5106]{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
@@ -1 +1 @@
1
- require(`./chunk.cjs`);const e=require(`./batchPatch.cjs`),t=require(`./useComponentLocale.cjs`),n=require(`./export-helper.cjs`),r=require(`./C_Table2.cjs`);let i=require(`vue`),a=require(`naive-ui`);const o=[`success`,`failure`,`conflict`,`skipped`];function s(n){let{t:r}=t.t(()=>n.locale),a=(0,i.shallowRef)(`all`),s=(0,i.shallowRef)(1),c=(0,i.computed)(()=>Number.isFinite(n.pageSize)&&n.pageSize>0?Math.max(1,Math.trunc(n.pageSize)):20),l=(0,i.computed)(()=>[...new Map(n.results.map(e=>[e.key,e])).values()]),u=(0,i.computed)(()=>{let e={all:l.value.length,success:0,failure:0,conflict:0,skipped:0};for(let t of l.value)e[t.status]++;return e}),d=(0,i.computed)(()=>[{value:`all`,label:`${r(`batch.all`)} ${u.value.all}`},...o.map(e=>({value:e,label:`${r(`batch.${e}`)} ${u.value[e]}`}))]),f=(0,i.computed)(()=>a.value===`all`?l.value:l.value.filter(e=>e.status===a.value)),p=(0,i.computed)(()=>f.value.slice((s.value-1)*c.value,s.value*c.value)),m=(0,i.computed)(()=>e.n(l.value));return(0,i.watch)([a,c],()=>{s.value=1}),(0,i.watch)(()=>f.value.length,e=>{s.value=Math.min(s.value,Math.max(1,Math.ceil(e/c.value)))}),{filter:a,page:s,pageSize:c,counts:u,options:d,filtered:f,rows:p,retryKeys:m,t:r}}const c=[`aria-label`],l={class:`c-batch-result__header`},u={role:`status`},d={class:`c-batch-result__toolbar`},f=(0,i.defineComponent)({name:`C_BatchResult`,__name:`index`,props:{results:{},title:{},pageSize:{default:20},locale:{}},emits:[`retry`],setup(e,{emit:t}){let n=e,o=t,{filter:f,page:p,pageSize:m,counts:h,options:g,filtered:_,rows:v,retryKeys:y,t:b}=s(n),x=(0,i.computed)(()=>n.title??b(`batch.title`)),S={success:`success`,failure:`error`,conflict:`warning`,skipped:`default`},C=(0,i.computed)(()=>[{key:`key`,title:b(`batch.id`),minWidth:130},{key:`status`,title:b(`batch.status`),width:90,render:e=>(0,i.h)(a.NTag,{size:`small`,type:S[e.status]},{default:()=>b(`batch.${e.status}`)})},{key:`message`,title:b(`batch.message`),minWidth:220},{key:`retryable`,title:b(`batch.retryColumn`),width:90,render:e=>e.retryable&&(e.status===`failure`||e.status===`conflict`)?b(`batch.retryable`):`—`}]),w=(0,i.computed)(()=>({locale:n.locale,density:`compact`,pagination:!1,toolbar:{show:!1},display:{singleLine:!1},virtualScroll:{enabled:!0,maxHeight:420}}));return(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`section`,{class:`c-batch-result`,"aria-label":x.value},[(0,i.createElementVNode)(`header`,l,[(0,i.createElementVNode)(`strong`,null,(0,i.toDisplayString)(x.value),1),(0,i.createElementVNode)(`span`,u,(0,i.toDisplayString)((0,i.unref)(b)(`batch.summary`,{total:(0,i.unref)(h).all,success:(0,i.unref)(h).success,failure:(0,i.unref)(h).failure,conflict:(0,i.unref)(h).conflict,skipped:(0,i.unref)(h).skipped})),1)]),(0,i.createElementVNode)(`div`,d,[(0,i.createVNode)((0,i.unref)(a.NSelect),{value:(0,i.unref)(f),"onUpdate:value":t[0]||=e=>(0,i.isRef)(f)?f.value=e:null,options:(0,i.unref)(g),size:`small`,"aria-label":(0,i.unref)(b)(`batch.filterLabel`)},null,8,[`value`,`options`,`aria-label`]),(0,i.createVNode)((0,i.unref)(a.NButton),{size:`small`,disabled:!(0,i.unref)(y).length,onClick:t[1]||=e=>o(`retry`,[...(0,i.unref)(y)])},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(b)(`batch.retry`,{count:(0,i.unref)(y).length})),1)]),_:1},8,[`disabled`])]),(0,i.createVNode)(r.t,{data:(0,i.unref)(v),columns:C.value,"row-key":`key`,config:w.value},null,8,[`data`,`columns`,`config`]),(0,i.unref)(_).length>(0,i.unref)(m)?((0,i.openBlock)(),(0,i.createBlock)((0,i.unref)(a.NPagination),{key:0,page:(0,i.unref)(p),"onUpdate:page":t[2]||=e=>(0,i.isRef)(p)?p.value=e:null,"page-size":(0,i.unref)(m),"item-count":(0,i.unref)(_).length,size:`small`},null,8,[`page`,`page-size`,`item-count`])):(0,i.createCommentVNode)(`v-if`,!0)],8,c))}});var p=n.t(f,[[`__scopeId`,`data-v-0a4af1f2`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
1
+ require(`./chunk.cjs`);const e=require(`./batchPatch.cjs`),t=require(`./useComponentLocale.cjs`),n=require(`./export-helper.cjs`),r=require(`./C_Table2.cjs`);let i=require(`vue`),a=require(`naive-ui`);const o=[`success`,`failure`,`conflict`,`skipped`];function s(n){let{t:r}=t.t(()=>n.locale),a=(0,i.shallowRef)(`all`),s=(0,i.shallowRef)(1),c=(0,i.computed)(()=>Number.isFinite(n.pageSize)&&n.pageSize>0?Math.max(1,Math.trunc(n.pageSize)):20),l=(0,i.computed)(()=>[...new Map(n.results.map(e=>[e.key,e])).values()]),u=(0,i.computed)(()=>{let e={all:l.value.length,success:0,failure:0,conflict:0,skipped:0};for(let t of l.value)e[t.status]++;return e}),d=(0,i.computed)(()=>[{value:`all`,label:`${r(`batch.all`)} ${u.value.all}`},...o.map(e=>({value:e,label:`${r(`batch.${e}`)} ${u.value[e]}`}))]),f=(0,i.computed)(()=>a.value===`all`?l.value:l.value.filter(e=>e.status===a.value)),p=(0,i.computed)(()=>f.value.slice((s.value-1)*c.value,s.value*c.value)),m=(0,i.computed)(()=>e.n(l.value));return(0,i.watch)([a,c],()=>{s.value=1}),(0,i.watch)(()=>f.value.length,e=>{s.value=Math.min(s.value,Math.max(1,Math.ceil(e/c.value)))}),{filter:a,page:s,pageSize:c,counts:u,options:d,filtered:f,rows:p,retryKeys:m,t:r}}const c=[`aria-label`],l={class:`c-batch-result__header`},u={role:`status`},d={class:`c-batch-result__toolbar`},f=(0,i.defineComponent)({name:`C_BatchResult`,__name:`index`,props:{results:{},title:{},pageSize:{default:20},locale:{}},emits:[`retry`],setup(e,{emit:t}){let n=e,o=t,{filter:f,page:p,pageSize:m,counts:h,options:g,filtered:_,rows:v,retryKeys:y,t:b}=s(n),x=(0,i.computed)(()=>n.title??b(`batch.title`)),S={success:`success`,failure:`error`,conflict:`warning`,skipped:`default`},C=(0,i.computed)(()=>[{key:`key`,title:b(`batch.id`),minWidth:130},{key:`status`,title:b(`batch.status`),width:90,render:e=>(0,i.h)(a.NTag,{size:`small`,type:S[e.status]},{default:()=>b(`batch.${e.status}`)})},{key:`message`,title:b(`batch.message`),minWidth:220},{key:`retryable`,title:b(`batch.retryColumn`),width:90,render:e=>e.retryable&&(e.status===`failure`||e.status===`conflict`)?b(`batch.retryable`):`—`}]),w=(0,i.computed)(()=>({locale:n.locale,density:`compact`,pagination:!1,toolbar:{show:!1},display:{singleLine:!1},virtualScroll:{enabled:!0,maxHeight:420}}));return(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`section`,{class:`c-batch-result`,"aria-label":x.value},[(0,i.createElementVNode)(`header`,l,[(0,i.createElementVNode)(`strong`,null,(0,i.toDisplayString)(x.value),1),(0,i.createElementVNode)(`span`,u,(0,i.toDisplayString)((0,i.unref)(b)(`batch.summary`,{total:(0,i.unref)(h).all,success:(0,i.unref)(h).success,failure:(0,i.unref)(h).failure,conflict:(0,i.unref)(h).conflict,skipped:(0,i.unref)(h).skipped})),1)]),(0,i.createElementVNode)(`div`,d,[(0,i.createVNode)((0,i.unref)(a.NSelect),{value:(0,i.unref)(f),"onUpdate:value":t[0]||=e=>(0,i.isRef)(f)?f.value=e:null,options:(0,i.unref)(g),size:`small`,"aria-label":(0,i.unref)(b)(`batch.filterLabel`)},null,8,[`value`,`options`,`aria-label`]),(0,i.createVNode)((0,i.unref)(a.NButton),{size:`small`,disabled:!(0,i.unref)(y).length,onClick:t[1]||=e=>o(`retry`,[...(0,i.unref)(y)])},{icon:(0,i.withCtx)(()=>[...t[3]||=[(0,i.createElementVNode)(`span`,{class:`i-mdi:refresh w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,i.withCtx)(()=>[(0,i.createTextVNode)(` `+(0,i.toDisplayString)((0,i.unref)(b)(`batch.retry`,{count:(0,i.unref)(y).length})),1)]),_:1},8,[`disabled`])]),(0,i.createVNode)(r.t,{data:(0,i.unref)(v),columns:C.value,"row-key":`key`,config:w.value},null,8,[`data`,`columns`,`config`]),(0,i.unref)(_).length>(0,i.unref)(m)?((0,i.openBlock)(),(0,i.createBlock)((0,i.unref)(a.NPagination),{key:0,page:(0,i.unref)(p),"onUpdate:page":t[2]||=e=>(0,i.isRef)(p)?p.value=e:null,"page-size":(0,i.unref)(m),"item-count":(0,i.unref)(_).length,size:`small`},null,8,[`page`,`page-size`,`item-count`])):(0,i.createCommentVNode)(`v-if`,!0)],8,c))}});var p=n.t(f,[[`__scopeId`,`data-v-62bc5106`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
@@ -1 +1 @@
1
- import{n as e}from"./batchPatch.js";import{t}from"./useComponentLocale.js";import{t as n}from"./export-helper.js";import{t as r}from"./C_Table2.js";import{computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,createTextVNode as l,createVNode as u,defineComponent as d,h as f,isRef as p,openBlock as m,shallowRef as h,toDisplayString as g,unref as _,watch as v,withCtx as y}from"vue";import{NButton as b,NPagination as x,NSelect as S,NTag as C}from"naive-ui";const w=[`success`,`failure`,`conflict`,`skipped`];function T(n){let{t:r}=t(()=>n.locale),a=h(`all`),o=h(1),s=i(()=>Number.isFinite(n.pageSize)&&n.pageSize>0?Math.max(1,Math.trunc(n.pageSize)):20),c=i(()=>[...new Map(n.results.map(e=>[e.key,e])).values()]),l=i(()=>{let e={all:c.value.length,success:0,failure:0,conflict:0,skipped:0};for(let t of c.value)e[t.status]++;return e}),u=i(()=>[{value:`all`,label:`${r(`batch.all`)} ${l.value.all}`},...w.map(e=>({value:e,label:`${r(`batch.${e}`)} ${l.value[e]}`}))]),d=i(()=>a.value===`all`?c.value:c.value.filter(e=>e.status===a.value)),f=i(()=>d.value.slice((o.value-1)*s.value,o.value*s.value)),p=i(()=>e(c.value));return v([a,s],()=>{o.value=1}),v(()=>d.value.length,e=>{o.value=Math.min(o.value,Math.max(1,Math.ceil(e/s.value)))}),{filter:a,page:o,pageSize:s,counts:l,options:u,filtered:d,rows:f,retryKeys:p,t:r}}const E=[`aria-label`],D={class:`c-batch-result__header`},O={role:`status`},k={class:`c-batch-result__toolbar`};var A=n(d({name:`C_BatchResult`,__name:`index`,props:{results:{},title:{},pageSize:{default:20},locale:{}},emits:[`retry`],setup(e,{emit:t}){let n=e,d=t,{filter:h,page:v,pageSize:w,counts:A,options:j,filtered:M,rows:N,retryKeys:P,t:F}=T(n),I=i(()=>n.title??F(`batch.title`)),L={success:`success`,failure:`error`,conflict:`warning`,skipped:`default`},R=i(()=>[{key:`key`,title:F(`batch.id`),minWidth:130},{key:`status`,title:F(`batch.status`),width:90,render:e=>f(C,{size:`small`,type:L[e.status]},{default:()=>F(`batch.${e.status}`)})},{key:`message`,title:F(`batch.message`),minWidth:220},{key:`retryable`,title:F(`batch.retryColumn`),width:90,render:e=>e.retryable&&(e.status===`failure`||e.status===`conflict`)?F(`batch.retryable`):`—`}]),z=i(()=>({locale:n.locale,density:`compact`,pagination:!1,toolbar:{show:!1},display:{singleLine:!1},virtualScroll:{enabled:!0,maxHeight:420}}));return(e,t)=>(m(),s(`section`,{class:`c-batch-result`,"aria-label":I.value},[c(`header`,D,[c(`strong`,null,g(I.value),1),c(`span`,O,g(_(F)(`batch.summary`,{total:_(A).all,success:_(A).success,failure:_(A).failure,conflict:_(A).conflict,skipped:_(A).skipped})),1)]),c(`div`,k,[u(_(S),{value:_(h),"onUpdate:value":t[0]||=e=>p(h)?h.value=e:null,options:_(j),size:`small`,"aria-label":_(F)(`batch.filterLabel`)},null,8,[`value`,`options`,`aria-label`]),u(_(b),{size:`small`,disabled:!_(P).length,onClick:t[1]||=e=>d(`retry`,[..._(P)])},{default:y(()=>[l(g(_(F)(`batch.retry`,{count:_(P).length})),1)]),_:1},8,[`disabled`])]),u(r,{data:_(N),columns:R.value,"row-key":`key`,config:z.value},null,8,[`data`,`columns`,`config`]),_(M).length>_(w)?(m(),a(_(x),{key:0,page:_(v),"onUpdate:page":t[2]||=e=>p(v)?v.value=e:null,"page-size":_(w),"item-count":_(M).length,size:`small`},null,8,[`page`,`page-size`,`item-count`])):o(`v-if`,!0)],8,E))}}),[[`__scopeId`,`data-v-0a4af1f2`]]);export{A as t};
1
+ import{n as e}from"./batchPatch.js";import{t}from"./useComponentLocale.js";import{t as n}from"./export-helper.js";import{t as r}from"./C_Table2.js";import{computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,createTextVNode as l,createVNode as u,defineComponent as d,h as f,isRef as p,openBlock as m,shallowRef as h,toDisplayString as g,unref as _,watch as v,withCtx as y}from"vue";import{NButton as b,NPagination as x,NSelect as S,NTag as C}from"naive-ui";const w=[`success`,`failure`,`conflict`,`skipped`];function T(n){let{t:r}=t(()=>n.locale),a=h(`all`),o=h(1),s=i(()=>Number.isFinite(n.pageSize)&&n.pageSize>0?Math.max(1,Math.trunc(n.pageSize)):20),c=i(()=>[...new Map(n.results.map(e=>[e.key,e])).values()]),l=i(()=>{let e={all:c.value.length,success:0,failure:0,conflict:0,skipped:0};for(let t of c.value)e[t.status]++;return e}),u=i(()=>[{value:`all`,label:`${r(`batch.all`)} ${l.value.all}`},...w.map(e=>({value:e,label:`${r(`batch.${e}`)} ${l.value[e]}`}))]),d=i(()=>a.value===`all`?c.value:c.value.filter(e=>e.status===a.value)),f=i(()=>d.value.slice((o.value-1)*s.value,o.value*s.value)),p=i(()=>e(c.value));return v([a,s],()=>{o.value=1}),v(()=>d.value.length,e=>{o.value=Math.min(o.value,Math.max(1,Math.ceil(e/s.value)))}),{filter:a,page:o,pageSize:s,counts:l,options:u,filtered:d,rows:f,retryKeys:p,t:r}}const E=[`aria-label`],D={class:`c-batch-result__header`},O={role:`status`},k={class:`c-batch-result__toolbar`};var A=n(d({name:`C_BatchResult`,__name:`index`,props:{results:{},title:{},pageSize:{default:20},locale:{}},emits:[`retry`],setup(e,{emit:t}){let n=e,d=t,{filter:h,page:v,pageSize:w,counts:A,options:j,filtered:M,rows:N,retryKeys:P,t:F}=T(n),I=i(()=>n.title??F(`batch.title`)),L={success:`success`,failure:`error`,conflict:`warning`,skipped:`default`},R=i(()=>[{key:`key`,title:F(`batch.id`),minWidth:130},{key:`status`,title:F(`batch.status`),width:90,render:e=>f(C,{size:`small`,type:L[e.status]},{default:()=>F(`batch.${e.status}`)})},{key:`message`,title:F(`batch.message`),minWidth:220},{key:`retryable`,title:F(`batch.retryColumn`),width:90,render:e=>e.retryable&&(e.status===`failure`||e.status===`conflict`)?F(`batch.retryable`):`—`}]),z=i(()=>({locale:n.locale,density:`compact`,pagination:!1,toolbar:{show:!1},display:{singleLine:!1},virtualScroll:{enabled:!0,maxHeight:420}}));return(e,t)=>(m(),s(`section`,{class:`c-batch-result`,"aria-label":I.value},[c(`header`,D,[c(`strong`,null,g(I.value),1),c(`span`,O,g(_(F)(`batch.summary`,{total:_(A).all,success:_(A).success,failure:_(A).failure,conflict:_(A).conflict,skipped:_(A).skipped})),1)]),c(`div`,k,[u(_(S),{value:_(h),"onUpdate:value":t[0]||=e=>p(h)?h.value=e:null,options:_(j),size:`small`,"aria-label":_(F)(`batch.filterLabel`)},null,8,[`value`,`options`,`aria-label`]),u(_(b),{size:`small`,disabled:!_(P).length,onClick:t[1]||=e=>d(`retry`,[..._(P)])},{icon:y(()=>[...t[3]||=[c(`span`,{class:`i-mdi:refresh w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:y(()=>[l(` `+g(_(F)(`batch.retry`,{count:_(P).length})),1)]),_:1},8,[`disabled`])]),u(r,{data:_(N),columns:R.value,"row-key":`key`,config:z.value},null,8,[`data`,`columns`,`config`]),_(M).length>_(w)?(m(),a(_(x),{key:0,page:_(v),"onUpdate:page":t[2]||=e=>p(v)?v.value=e:null,"page-size":_(w),"item-count":_(M).length,size:`small`},null,8,[`page`,`page-size`,`item-count`])):o(`v-if`,!0)],8,E))}}),[[`__scopeId`,`data-v-62bc5106`]]);export{A as t};
@@ -1,43 +1,43 @@
1
1
  @import "./C_Table.base.css";
2
- .c-data-picker[data-v-df1cef8f] {
2
+ .c-data-picker[data-v-744d7765] {
3
3
  width: 100%;
4
4
  min-width: 0;
5
5
  }
6
- .c-data-picker__inline[data-v-df1cef8f] {
6
+ .c-data-picker__inline[data-v-744d7765] {
7
7
  margin-top: 8px;
8
8
  min-width: 0;
9
9
  }
10
- .c-data-picker__content[data-v-df1cef8f]:focus {
10
+ .c-data-picker__content[data-v-744d7765]:focus {
11
11
  outline: none;
12
12
  }
13
- .c-data-picker__trigger[data-v-df1cef8f], .c-data-picker__search[data-v-df1cef8f], .c-data-picker__actions[data-v-df1cef8f], .c-data-picker__selection[data-v-df1cef8f] {
13
+ .c-data-picker__trigger[data-v-744d7765], .c-data-picker__search[data-v-744d7765], .c-data-picker__actions[data-v-744d7765], .c-data-picker__selection[data-v-744d7765] {
14
14
  display: flex;
15
15
  align-items: center;
16
16
  gap: 8px;
17
17
  }
18
- .c-data-picker__open[data-v-df1cef8f] {
18
+ .c-data-picker__open[data-v-744d7765] {
19
19
  flex: 1;
20
20
  min-width: 0;
21
21
  }
22
- .c-data-picker__open[data-v-df1cef8f] .n-button__content {
22
+ .c-data-picker__open[data-v-744d7765] .n-button__content {
23
23
  display: flex;
24
24
  gap: 12px;
25
25
  width: 100%;
26
26
  justify-content: space-between;
27
27
  overflow: hidden;
28
28
  }
29
- .c-data-picker__open span[data-v-df1cef8f]:first-child {
29
+ .c-data-picker__open span[data-v-744d7765]:first-child {
30
30
  overflow: hidden;
31
31
  text-overflow: ellipsis;
32
32
  white-space: nowrap;
33
33
  }
34
- .c-data-picker__placeholder[data-v-df1cef8f] {
34
+ .c-data-picker__placeholder[data-v-744d7765] {
35
35
  opacity: 0.55;
36
36
  }
37
- .c-data-picker__search[data-v-df1cef8f] {
37
+ .c-data-picker__search[data-v-744d7765] {
38
38
  margin-bottom: 12px;
39
39
  }
40
- .c-data-picker__result-bar[data-v-df1cef8f] {
40
+ .c-data-picker__result-bar[data-v-744d7765] {
41
41
  display: flex;
42
42
  align-items: center;
43
43
  justify-content: space-between;
@@ -45,38 +45,46 @@
45
45
  gap: 6px 12px;
46
46
  margin-block-start: 10px;
47
47
  }
48
- .c-data-picker__pagination[data-v-df1cef8f] {
48
+ .c-data-picker__pagination[data-v-744d7765] {
49
49
  margin-inline-start: auto;
50
50
  max-width: 100%;
51
51
  }
52
- .c-data-picker__pagination[data-v-df1cef8f] .n-pagination {
52
+ .c-data-picker__pagination[data-v-744d7765] .n-pagination {
53
53
  flex-wrap: wrap;
54
54
  justify-content: flex-end;
55
55
  }
56
- .c-data-picker__selection[data-v-df1cef8f] {
56
+ .c-data-picker__selection[data-v-744d7765] {
57
57
  flex-wrap: wrap;
58
58
  min-width: 0;
59
59
  max-width: 100%;
60
60
  font-size: 12px;
61
61
  }
62
- .c-data-picker__selection[data-v-df1cef8f] .n-tag {
62
+ .c-data-picker__selection[data-v-744d7765] .n-tag {
63
63
  max-width: 100%;
64
64
  }
65
- .c-data-picker__selection[data-v-df1cef8f] .n-tag__content {
65
+ .c-data-picker__selection[data-v-744d7765] .n-tag__content {
66
66
  overflow: hidden;
67
67
  text-overflow: ellipsis;
68
68
  white-space: nowrap;
69
69
  }
70
- .c-data-picker__actions[data-v-df1cef8f] {
70
+ .c-data-picker__actions[data-v-744d7765] {
71
71
  justify-content: flex-end;
72
72
  }
73
- .c-data-picker__error[data-v-df1cef8f], .c-data-picker__label-error[data-v-df1cef8f] {
73
+ .c-data-picker__error[data-v-744d7765], .c-data-picker__label-error[data-v-744d7765] {
74
74
  font-size: 12px;
75
75
  color: var(--n-text-color);
76
76
  }
77
77
 
78
+ /* layer: icons */
79
+ .i-mdi\:check[data-v-744d7765]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
80
+ .i-mdi\:close[data-v-744d7765]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
81
+ .i-mdi\:magnify[data-v-744d7765]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
82
+ .i-mdi\:refresh[data-v-744d7765]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
78
83
  /* layer: default */
79
- .\!inline[data-v-df1cef8f]{display:inline !important;}
80
- .inline[data-v-df1cef8f]{display:inline;}
81
- .hidden[data-v-df1cef8f]{display:none;}
82
- .table[data-v-df1cef8f]{display:table;}
84
+ .\!inline[data-v-744d7765]{display:inline !important;}
85
+ .inline[data-v-744d7765]{display:inline;}
86
+ .hidden[data-v-744d7765]{display:none;}
87
+ .h-4[data-v-744d7765]{height:1rem;}
88
+ .w-4[data-v-744d7765]{width:1rem;}
89
+ .shrink-0[data-v-744d7765]{flex-shrink:0;}
90
+ .table[data-v-744d7765]{display:table;}
@@ -1,2 +1,2 @@
1
- import { a as DataPickerSource, i as DataPickerRequest, n as DataPickerEmits, o as DataPickerValue, r as DataPickerProps, t as _default } from "./index12.vue.cjs";
2
- export { _default as C_DataPicker, type DataPickerEmits, type DataPickerProps, type DataPickerRequest, type DataPickerSource, type DataPickerValue };
1
+ import { a as DataPickerSource, i as DataPickerRequest, n as DataPickerEmits, o as DataPickerSourceInput, r as DataPickerProps, s as DataPickerValue, t as _default } from "./index12.vue.cjs";
2
+ export { _default as C_DataPicker, type DataPickerEmits, type DataPickerProps, type DataPickerRequest, type DataPickerSource, type DataPickerSourceInput, type DataPickerValue };
@@ -1,5 +1,5 @@
1
1
  import "./types.js";
2
2
  import "./useFormConfig.js";
3
3
  import "./config2.js";
4
- import { a as DataPickerSource, i as DataPickerRequest, n as DataPickerEmits, o as DataPickerValue, r as DataPickerProps, t as _default } from "./index11.vue.js";
5
- export { _default as C_DataPicker, type DataPickerEmits, type DataPickerProps, type DataPickerRequest, type DataPickerSource, type DataPickerValue };
4
+ import { a as DataPickerSource, i as DataPickerRequest, n as DataPickerEmits, o as DataPickerSourceInput, r as DataPickerProps, s as DataPickerValue, t as _default } from "./index11.vue.js";
5
+ export { _default as C_DataPicker, type DataPickerEmits, type DataPickerProps, type DataPickerRequest, type DataPickerSource, type DataPickerSourceInput, type DataPickerValue };