@dovetail-v2/refine 0.4.2-beta.0 → 0.4.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.
- package/dist/components/EditMetadataForm/LabelFormatPopover.d.ts +0 -1
- package/dist/components/Form/ExtraSubmitFooter.d.ts +23 -0
- package/dist/components/Form/FormModal.d.ts +1 -1
- package/dist/components/Form/RawYamlFormModal.d.ts +1 -1
- package/dist/components/Form/RefineFormContainer.d.ts +1 -1
- package/dist/components/Form/useReactHookForm.d.ts +1 -2
- package/dist/components/Form/useRefineForm.d.ts +1 -1
- package/dist/components/KeyValueTableForm/FormatRulePopover.d.ts +7 -0
- package/dist/components/KeyValueTableForm/index.d.ts +3 -1
- package/dist/hooks/use409Retry.d.ts +68 -0
- package/dist/hooks/useOpenForm.d.ts +1 -1
- package/dist/i18n.d.ts +6 -0
- package/dist/locales/en-US/index.d.ts +3 -0
- package/dist/locales/zh-CN/index.d.ts +3 -0
- package/dist/refine.cjs +389 -252
- package/dist/refine.js +392 -255
- package/dist/style.css +148 -130
- package/dist/types/resource.d.ts +24 -0
- package/package.json +2 -2
package/dist/style.css
CHANGED
|
@@ -1148,113 +1148,6 @@
|
|
|
1148
1148
|
/* box shadow */
|
|
1149
1149
|
/* fisheye */
|
|
1150
1150
|
/* z-index */
|
|
1151
|
-
.wwyz7ti.ant-btn.ant-btn.ant-btn-primary {
|
|
1152
|
-
background-color: #fea008;
|
|
1153
|
-
}
|
|
1154
|
-
.wwyz7ti.ant-btn.ant-btn.ant-btn-primary:hover {
|
|
1155
|
-
background-color: #feba33;
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
.c1xsou5f.ant-btn {
|
|
1159
|
-
border-radius: 6px;
|
|
1160
|
-
border: 1px solid rgba(172, 186, 211, 0.6) !important;
|
|
1161
|
-
}/* // basic */
|
|
1162
|
-
/* FishEye Color Variables and Functions */
|
|
1163
|
-
/*
|
|
1164
|
-
--------------------------- Primary Color ---------------------------
|
|
1165
|
-
*/
|
|
1166
|
-
/*
|
|
1167
|
-
---------------------------When necessary to add at any time---------------------------
|
|
1168
|
-
*/
|
|
1169
|
-
/* computed */
|
|
1170
|
-
/* blue */
|
|
1171
|
-
/* green */
|
|
1172
|
-
/* yellow */
|
|
1173
|
-
/* red */
|
|
1174
|
-
/* purple */
|
|
1175
|
-
/* palette global token*/
|
|
1176
|
-
/* color opaque */
|
|
1177
|
-
/* color transparent */
|
|
1178
|
-
/* blue transparent */
|
|
1179
|
-
/* green transparent */
|
|
1180
|
-
/* yellow transparent */
|
|
1181
|
-
/* red transparent */
|
|
1182
|
-
/* gray transparent */
|
|
1183
|
-
/* white transparent */
|
|
1184
|
-
/* gradient opaque */
|
|
1185
|
-
/* blue radial gradient */
|
|
1186
|
-
/* blue linear gradient */
|
|
1187
|
-
/* green radial gradient */
|
|
1188
|
-
/* yellow radial gradient */
|
|
1189
|
-
/* red radial gradient */
|
|
1190
|
-
/* gray radial gradient */
|
|
1191
|
-
/* white to gray radial gradient */
|
|
1192
|
-
/* white to gray linear gradient */
|
|
1193
|
-
/* gradient transparent */
|
|
1194
|
-
/* secondary palette */
|
|
1195
|
-
/* purple radial gradient */
|
|
1196
|
-
/* refine alias color */
|
|
1197
|
-
/* text */
|
|
1198
|
-
/* link */
|
|
1199
|
-
/* fill */
|
|
1200
|
-
/* fill element */
|
|
1201
|
-
/* fill interaction */
|
|
1202
|
-
/* stroke */
|
|
1203
|
-
/* background */
|
|
1204
|
-
/* dim */
|
|
1205
|
-
/* box shadow */
|
|
1206
|
-
/* fisheye */
|
|
1207
|
-
/* z-index */
|
|
1208
|
-
.n609wlp {
|
|
1209
|
-
margin-top: 8px;
|
|
1210
|
-
color: #2d3a56;
|
|
1211
|
-
}/* // basic */
|
|
1212
|
-
/* FishEye Color Variables and Functions */
|
|
1213
|
-
/*
|
|
1214
|
-
--------------------------- Primary Color ---------------------------
|
|
1215
|
-
*/
|
|
1216
|
-
/*
|
|
1217
|
-
---------------------------When necessary to add at any time---------------------------
|
|
1218
|
-
*/
|
|
1219
|
-
/* computed */
|
|
1220
|
-
/* blue */
|
|
1221
|
-
/* green */
|
|
1222
|
-
/* yellow */
|
|
1223
|
-
/* red */
|
|
1224
|
-
/* purple */
|
|
1225
|
-
/* palette global token*/
|
|
1226
|
-
/* color opaque */
|
|
1227
|
-
/* color transparent */
|
|
1228
|
-
/* blue transparent */
|
|
1229
|
-
/* green transparent */
|
|
1230
|
-
/* yellow transparent */
|
|
1231
|
-
/* red transparent */
|
|
1232
|
-
/* gray transparent */
|
|
1233
|
-
/* white transparent */
|
|
1234
|
-
/* gradient opaque */
|
|
1235
|
-
/* blue radial gradient */
|
|
1236
|
-
/* blue linear gradient */
|
|
1237
|
-
/* green radial gradient */
|
|
1238
|
-
/* yellow radial gradient */
|
|
1239
|
-
/* red radial gradient */
|
|
1240
|
-
/* gray radial gradient */
|
|
1241
|
-
/* white to gray radial gradient */
|
|
1242
|
-
/* white to gray linear gradient */
|
|
1243
|
-
/* gradient transparent */
|
|
1244
|
-
/* secondary palette */
|
|
1245
|
-
/* purple radial gradient */
|
|
1246
|
-
/* refine alias color */
|
|
1247
|
-
/* text */
|
|
1248
|
-
/* link */
|
|
1249
|
-
/* fill */
|
|
1250
|
-
/* fill element */
|
|
1251
|
-
/* fill interaction */
|
|
1252
|
-
/* stroke */
|
|
1253
|
-
/* background */
|
|
1254
|
-
/* dim */
|
|
1255
|
-
/* box shadow */
|
|
1256
|
-
/* fisheye */
|
|
1257
|
-
/* z-index */
|
|
1258
1151
|
.w1akirqw {
|
|
1259
1152
|
height: 100%;
|
|
1260
1153
|
display: flex;
|
|
@@ -2068,47 +1961,35 @@
|
|
|
2068
1961
|
/* box shadow */
|
|
2069
1962
|
/* fisheye */
|
|
2070
1963
|
/* z-index */
|
|
2071
|
-
.
|
|
1964
|
+
.f1eyh8ow .ant-popover-inner {
|
|
2072
1965
|
border-radius: 8px;
|
|
2073
1966
|
}
|
|
2074
|
-
.
|
|
2075
|
-
padding: 12px;
|
|
2076
|
-
}
|
|
2077
|
-
.p5jt6nm .ant-popover-content > .ant-popover-arrow {
|
|
1967
|
+
.f1eyh8ow .ant-popover-content > .ant-popover-arrow {
|
|
2078
1968
|
display: none;
|
|
2079
1969
|
}
|
|
2080
|
-
.
|
|
2081
|
-
vertical-align: middle;
|
|
2082
|
-
}
|
|
2083
|
-
.p5jt6nm .rule-list {
|
|
2084
|
-
list-style: disc;
|
|
2085
|
-
list-style-position: inside;
|
|
2086
|
-
}
|
|
2087
|
-
.p5jt6nm .ant-table {
|
|
1970
|
+
.f1eyh8ow .ant-table {
|
|
2088
1971
|
font-size: 12px;
|
|
2089
1972
|
line-height: 18px;
|
|
2090
1973
|
}
|
|
2091
|
-
.
|
|
1974
|
+
.f1eyh8ow .ant-table .ant-table-container {
|
|
2092
1975
|
border: none !important;
|
|
2093
1976
|
}
|
|
2094
|
-
.
|
|
1977
|
+
.f1eyh8ow .ant-table .ant-table-thead {
|
|
2095
1978
|
font-weight: 700;
|
|
2096
1979
|
}
|
|
2097
|
-
.
|
|
1980
|
+
.f1eyh8ow .ant-table .ant-table-thead > tr > th {
|
|
2098
1981
|
background: #fff;
|
|
2099
1982
|
}
|
|
2100
|
-
.
|
|
2101
|
-
.
|
|
1983
|
+
.f1eyh8ow .ant-table thead > tr > th:last-child,
|
|
1984
|
+
.f1eyh8ow .ant-table tbody > tr > td:last-child {
|
|
2102
1985
|
border-right: none !important;
|
|
2103
1986
|
}
|
|
2104
|
-
.
|
|
1987
|
+
.f1eyh8ow .ant-table tbody > tr:last-child > td {
|
|
2105
1988
|
border-bottom: none;
|
|
2106
1989
|
}
|
|
2107
|
-
.
|
|
1990
|
+
.f1eyh8ow .ant-table .ant-table-cell {
|
|
2108
1991
|
padding: 4px 8px !important;
|
|
2109
|
-
|
|
2110
|
-
.p5jt6nm .ant-table li {
|
|
2111
|
-
text-indent: 8px;
|
|
1992
|
+
vertical-align: middle;
|
|
2112
1993
|
}/* // basic */
|
|
2113
1994
|
/* FishEye Color Variables and Functions */
|
|
2114
1995
|
/*
|
|
@@ -4376,6 +4257,63 @@
|
|
|
4376
4257
|
/* box shadow */
|
|
4377
4258
|
/* fisheye */
|
|
4378
4259
|
/* z-index */
|
|
4260
|
+
.wwyz7ti.ant-btn.ant-btn.ant-btn-primary {
|
|
4261
|
+
background-color: #fea008;
|
|
4262
|
+
}
|
|
4263
|
+
.wwyz7ti.ant-btn.ant-btn.ant-btn-primary:hover {
|
|
4264
|
+
background-color: #feba33;
|
|
4265
|
+
}
|
|
4266
|
+
|
|
4267
|
+
.c1xsou5f.ant-btn {
|
|
4268
|
+
border-radius: 6px;
|
|
4269
|
+
border: 1px solid rgba(172, 186, 211, 0.6) !important;
|
|
4270
|
+
}/* // basic */
|
|
4271
|
+
/* FishEye Color Variables and Functions */
|
|
4272
|
+
/*
|
|
4273
|
+
--------------------------- Primary Color ---------------------------
|
|
4274
|
+
*/
|
|
4275
|
+
/*
|
|
4276
|
+
---------------------------When necessary to add at any time---------------------------
|
|
4277
|
+
*/
|
|
4278
|
+
/* computed */
|
|
4279
|
+
/* blue */
|
|
4280
|
+
/* green */
|
|
4281
|
+
/* yellow */
|
|
4282
|
+
/* red */
|
|
4283
|
+
/* purple */
|
|
4284
|
+
/* palette global token*/
|
|
4285
|
+
/* color opaque */
|
|
4286
|
+
/* color transparent */
|
|
4287
|
+
/* blue transparent */
|
|
4288
|
+
/* green transparent */
|
|
4289
|
+
/* yellow transparent */
|
|
4290
|
+
/* red transparent */
|
|
4291
|
+
/* gray transparent */
|
|
4292
|
+
/* white transparent */
|
|
4293
|
+
/* gradient opaque */
|
|
4294
|
+
/* blue radial gradient */
|
|
4295
|
+
/* blue linear gradient */
|
|
4296
|
+
/* green radial gradient */
|
|
4297
|
+
/* yellow radial gradient */
|
|
4298
|
+
/* red radial gradient */
|
|
4299
|
+
/* gray radial gradient */
|
|
4300
|
+
/* white to gray radial gradient */
|
|
4301
|
+
/* white to gray linear gradient */
|
|
4302
|
+
/* gradient transparent */
|
|
4303
|
+
/* secondary palette */
|
|
4304
|
+
/* purple radial gradient */
|
|
4305
|
+
/* refine alias color */
|
|
4306
|
+
/* text */
|
|
4307
|
+
/* link */
|
|
4308
|
+
/* fill */
|
|
4309
|
+
/* fill element */
|
|
4310
|
+
/* fill interaction */
|
|
4311
|
+
/* stroke */
|
|
4312
|
+
/* background */
|
|
4313
|
+
/* dim */
|
|
4314
|
+
/* box shadow */
|
|
4315
|
+
/* fisheye */
|
|
4316
|
+
/* z-index */
|
|
4379
4317
|
.fq4465w.ant-modal.fullscreen .ant-modal-header {
|
|
4380
4318
|
padding: 60px 0 32px 0;
|
|
4381
4319
|
max-width: var(--max-modal-width, 1024px);
|
|
@@ -4462,6 +4400,86 @@
|
|
|
4462
4400
|
/* box shadow */
|
|
4463
4401
|
/* fisheye */
|
|
4464
4402
|
/* z-index */
|
|
4403
|
+
.f16wn4bu {
|
|
4404
|
+
display: flex;
|
|
4405
|
+
align-items: center;
|
|
4406
|
+
justify-content: space-between;
|
|
4407
|
+
width: 100%;
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
.fk5l2b4 {
|
|
4411
|
+
display: flex;
|
|
4412
|
+
align-items: center;
|
|
4413
|
+
min-width: 0;
|
|
4414
|
+
}
|
|
4415
|
+
|
|
4416
|
+
.f1r3vl4u {
|
|
4417
|
+
display: flex;
|
|
4418
|
+
align-items: center;
|
|
4419
|
+
gap: 8px;
|
|
4420
|
+
}
|
|
4421
|
+
|
|
4422
|
+
.e1y8i1r4 {
|
|
4423
|
+
display: inline-flex;
|
|
4424
|
+
align-items: center;
|
|
4425
|
+
min-width: 0;
|
|
4426
|
+
color: var(--color-red-6);
|
|
4427
|
+
}
|
|
4428
|
+
|
|
4429
|
+
.e16fn5cj {
|
|
4430
|
+
flex: none;
|
|
4431
|
+
margin-right: 4px;
|
|
4432
|
+
}
|
|
4433
|
+
|
|
4434
|
+
.prji3wx {
|
|
4435
|
+
margin-right: 4px;
|
|
4436
|
+
}/* // basic */
|
|
4437
|
+
/* FishEye Color Variables and Functions */
|
|
4438
|
+
/*
|
|
4439
|
+
--------------------------- Primary Color ---------------------------
|
|
4440
|
+
*/
|
|
4441
|
+
/*
|
|
4442
|
+
---------------------------When necessary to add at any time---------------------------
|
|
4443
|
+
*/
|
|
4444
|
+
/* computed */
|
|
4445
|
+
/* blue */
|
|
4446
|
+
/* green */
|
|
4447
|
+
/* yellow */
|
|
4448
|
+
/* red */
|
|
4449
|
+
/* purple */
|
|
4450
|
+
/* palette global token*/
|
|
4451
|
+
/* color opaque */
|
|
4452
|
+
/* color transparent */
|
|
4453
|
+
/* blue transparent */
|
|
4454
|
+
/* green transparent */
|
|
4455
|
+
/* yellow transparent */
|
|
4456
|
+
/* red transparent */
|
|
4457
|
+
/* gray transparent */
|
|
4458
|
+
/* white transparent */
|
|
4459
|
+
/* gradient opaque */
|
|
4460
|
+
/* blue radial gradient */
|
|
4461
|
+
/* blue linear gradient */
|
|
4462
|
+
/* green radial gradient */
|
|
4463
|
+
/* yellow radial gradient */
|
|
4464
|
+
/* red radial gradient */
|
|
4465
|
+
/* gray radial gradient */
|
|
4466
|
+
/* white to gray radial gradient */
|
|
4467
|
+
/* white to gray linear gradient */
|
|
4468
|
+
/* gradient transparent */
|
|
4469
|
+
/* secondary palette */
|
|
4470
|
+
/* purple radial gradient */
|
|
4471
|
+
/* refine alias color */
|
|
4472
|
+
/* text */
|
|
4473
|
+
/* link */
|
|
4474
|
+
/* fill */
|
|
4475
|
+
/* fill element */
|
|
4476
|
+
/* fill interaction */
|
|
4477
|
+
/* stroke */
|
|
4478
|
+
/* background */
|
|
4479
|
+
/* dim */
|
|
4480
|
+
/* box shadow */
|
|
4481
|
+
/* fisheye */
|
|
4482
|
+
/* z-index */
|
|
4465
4483
|
.tdr270q {
|
|
4466
4484
|
color: #00122e;
|
|
4467
4485
|
padding: 7px 0;
|
package/dist/types/resource.d.ts
CHANGED
|
@@ -45,6 +45,15 @@ export type RefineFormConfig<Model extends ResourceModel = ResourceModel> = {
|
|
|
45
45
|
steps?: {
|
|
46
46
|
title: string;
|
|
47
47
|
}[];
|
|
48
|
+
/** 在指定步骤展示额外提交按钮,用于跳过后续可选步骤并复用当前表单提交链路。 */
|
|
49
|
+
extraSubmitButton?: {
|
|
50
|
+
/** 按钮生效的表单操作类型;不填则创建和编辑都生效。 */
|
|
51
|
+
action?: 'create' | 'edit';
|
|
52
|
+
/** 按钮出现的步骤索引,从 0 开始。 */
|
|
53
|
+
step: number;
|
|
54
|
+
/** 按钮文案;不填则使用当前表单默认提交文案。 */
|
|
55
|
+
text?: string;
|
|
56
|
+
};
|
|
48
57
|
/**
|
|
49
58
|
* 表单字段配置函数
|
|
50
59
|
* @param props 包含记录和动作类型的配置对象
|
|
@@ -149,6 +158,21 @@ export type CommonFormConfig<Model extends ResourceModel = ResourceModel> = {
|
|
|
149
158
|
from: string[];
|
|
150
159
|
to: string[];
|
|
151
160
|
}[];
|
|
161
|
+
/**
|
|
162
|
+
* 自定义数据就绪检查(编辑模式下判断初始数据是否加载完成)
|
|
163
|
+
* 默认检查 metadata.name,非标准 K8s 资源可覆盖
|
|
164
|
+
*/
|
|
165
|
+
isDataReady?: (formValues: Record<string, unknown>) => boolean;
|
|
166
|
+
/**
|
|
167
|
+
* 自定义成功 toast 消息
|
|
168
|
+
*/
|
|
169
|
+
successMessage?: string | ((action: 'create' | 'edit') => string);
|
|
170
|
+
/**
|
|
171
|
+
* 自定义切换 YAML 模式时的提示 Alert 内容
|
|
172
|
+
* 设为 false 可隐藏 Alert,设为 string/ReactNode 可替换默认文案
|
|
173
|
+
* 默认显示 dovetail.change_form_mode_alert
|
|
174
|
+
*/
|
|
175
|
+
changeModeAlert?: React.ReactNode | false;
|
|
152
176
|
};
|
|
153
177
|
export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
|
|
154
178
|
/** 资源名称,用于 API 调用和路由。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dovetail-v2/refine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dayjs": "^1.11.10",
|
|
31
31
|
"i18next": "^23.2.3",
|
|
32
32
|
"js-yaml": "^4.1.0",
|
|
33
|
-
"k8s-api-provider": "^0.0.
|
|
33
|
+
"k8s-api-provider": "^0.0.37",
|
|
34
34
|
"ky": "^0.33.3",
|
|
35
35
|
"lodash-es": "^4.17.21",
|
|
36
36
|
"mitt": "^3.0.1",
|