@dovetail-v2/refine 0.3.33 → 0.4.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/dist/refine.cjs +23 -14
- package/dist/refine.js +23 -14
- package/dist/types/resource.d.ts +2 -0
- package/package.json +2 -2
package/dist/refine.cjs
CHANGED
|
@@ -11741,7 +11741,7 @@ function YamlFormContainer({
|
|
|
11741
11741
|
const RawYamlFormModal_1nvs0vj = "";
|
|
11742
11742
|
const FormDescStyle$1 = "fdhreji";
|
|
11743
11743
|
function RawYamlFormModal(props) {
|
|
11744
|
-
var _a, _b;
|
|
11744
|
+
var _a, _b, _c;
|
|
11745
11745
|
const {
|
|
11746
11746
|
id,
|
|
11747
11747
|
yamlFormProps: customYamlFormProps,
|
|
@@ -11762,16 +11762,20 @@ function RawYamlFormModal(props) {
|
|
|
11762
11762
|
(_a2 = saveButtonProps.onClick) == null ? void 0 : _a2.call(saveButtonProps, e2);
|
|
11763
11763
|
}, [saveButtonProps]);
|
|
11764
11764
|
const errorText = React.useMemo(() => {
|
|
11765
|
+
var _a2;
|
|
11765
11766
|
if (isError) {
|
|
11767
|
+
const customText = (_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formFailedText;
|
|
11768
|
+
if (customText)
|
|
11769
|
+
return customText;
|
|
11766
11770
|
return i18n2.t(id ? "dovetail.save_failed" : "dovetail.create_failed");
|
|
11767
11771
|
}
|
|
11768
11772
|
return "";
|
|
11769
|
-
}, [isError, id, i18n2]);
|
|
11773
|
+
}, [isError, id, i18n2, (_a = resourceConfig.formConfig) == null ? void 0 : _a.formFailedText]);
|
|
11770
11774
|
const title = React.useMemo(() => {
|
|
11771
|
-
var _a2, _b2,
|
|
11775
|
+
var _a2, _b2, _c2, _d;
|
|
11772
11776
|
if (typeof ((_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formTitle) === "string")
|
|
11773
11777
|
return (_b2 = resourceConfig.formConfig) == null ? void 0 : _b2.formTitle;
|
|
11774
|
-
if (typeof ((
|
|
11778
|
+
if (typeof ((_c2 = resourceConfig.formConfig) == null ? void 0 : _c2.formTitle) === "function") {
|
|
11775
11779
|
return (_d = resourceConfig.formConfig) == null ? void 0 : _d.formTitle(action);
|
|
11776
11780
|
}
|
|
11777
11781
|
const label2 = resourceConfig.displayName || (resourceConfig == null ? void 0 : resourceConfig.kind);
|
|
@@ -11780,10 +11784,10 @@ function RawYamlFormModal(props) {
|
|
|
11780
11784
|
});
|
|
11781
11785
|
}, [action, resourceConfig.formConfig, resourceConfig.displayName, resourceConfig == null ? void 0 : resourceConfig.kind, i18n2, id]);
|
|
11782
11786
|
const desc = React.useMemo(() => {
|
|
11783
|
-
var _a2, _b2,
|
|
11787
|
+
var _a2, _b2, _c2, _d;
|
|
11784
11788
|
if (typeof ((_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formDesc) === "string")
|
|
11785
11789
|
return (_b2 = resourceConfig.formConfig) == null ? void 0 : _b2.formDesc;
|
|
11786
|
-
if (typeof ((
|
|
11790
|
+
if (typeof ((_c2 = resourceConfig.formConfig) == null ? void 0 : _c2.formDesc) === "function") {
|
|
11787
11791
|
return (_d = resourceConfig.formConfig) == null ? void 0 : _d.formDesc(action);
|
|
11788
11792
|
}
|
|
11789
11793
|
return "";
|
|
@@ -11813,9 +11817,9 @@ function RawYamlFormModal(props) {
|
|
|
11813
11817
|
onOk,
|
|
11814
11818
|
okButtonProps: {
|
|
11815
11819
|
...lodashEs.omit(saveButtonProps, "onClick"),
|
|
11816
|
-
children: (
|
|
11820
|
+
children: (_b = resourceConfig.formConfig) == null ? void 0 : _b.saveButtonText
|
|
11817
11821
|
},
|
|
11818
|
-
okText: ((
|
|
11822
|
+
okText: ((_c = resourceConfig.formConfig) == null ? void 0 : _c.saveButtonText) || okText,
|
|
11819
11823
|
destroyOnClose: true,
|
|
11820
11824
|
children: [desc ? /* @__PURE__ */ common.jsxRuntimeExports.jsx("div", {
|
|
11821
11825
|
className: FormDescStyle$1,
|
|
@@ -14801,7 +14805,8 @@ const PodLog = ({
|
|
|
14801
14805
|
data: logs,
|
|
14802
14806
|
theme: "light",
|
|
14803
14807
|
isTextWrapped: wrap,
|
|
14804
|
-
onScroll
|
|
14808
|
+
onScroll,
|
|
14809
|
+
fastRowHeightEstimationLimit: 100
|
|
14805
14810
|
})
|
|
14806
14811
|
})]
|
|
14807
14812
|
});
|
|
@@ -17364,7 +17369,7 @@ function ConfirmModal({
|
|
|
17364
17369
|
});
|
|
17365
17370
|
}
|
|
17366
17371
|
function FormModal(props) {
|
|
17367
|
-
var _a, _b, _c, _d;
|
|
17372
|
+
var _a, _b, _c, _d, _e;
|
|
17368
17373
|
const {
|
|
17369
17374
|
id,
|
|
17370
17375
|
yamlFormProps: customYamlFormProps,
|
|
@@ -17410,11 +17415,15 @@ function FormModal(props) {
|
|
|
17410
17415
|
}
|
|
17411
17416
|
}, [pushModal]);
|
|
17412
17417
|
const errorText = React.useMemo(() => {
|
|
17418
|
+
var _a2;
|
|
17413
17419
|
if (isError) {
|
|
17420
|
+
const customText = (_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formFailedText;
|
|
17421
|
+
if (customText)
|
|
17422
|
+
return customText;
|
|
17414
17423
|
return i18n2.t(id ? "dovetail.save_failed" : "dovetail.create_failed");
|
|
17415
17424
|
}
|
|
17416
17425
|
return "";
|
|
17417
|
-
}, [isError, id, i18n2]);
|
|
17426
|
+
}, [isError, id, i18n2, (_b = resourceConfig.formConfig) == null ? void 0 : _b.formFailedText]);
|
|
17418
17427
|
const title = React.useMemo(() => {
|
|
17419
17428
|
var _a2, _b2, _c2, _d2;
|
|
17420
17429
|
if (typeof ((_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formTitle) === "string")
|
|
@@ -17506,7 +17515,7 @@ function FormModal(props) {
|
|
|
17506
17515
|
className: TitleWrapperStyle,
|
|
17507
17516
|
children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
|
|
17508
17517
|
children: title
|
|
17509
|
-
}), ((
|
|
17518
|
+
}), ((_c = resourceConfig.formConfig) == null ? void 0 : _c.formType) === FormType.FORM ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(FormModeSegmentControl, {
|
|
17510
17519
|
formConfig: resourceConfig.formConfig,
|
|
17511
17520
|
mode,
|
|
17512
17521
|
onChangeMode
|
|
@@ -17519,9 +17528,9 @@ function FormModal(props) {
|
|
|
17519
17528
|
onOk,
|
|
17520
17529
|
okButtonProps: {
|
|
17521
17530
|
...lodashEs.omit(saveButtonProps, "onClick"),
|
|
17522
|
-
children: (
|
|
17531
|
+
children: (_d = resourceConfig.formConfig) == null ? void 0 : _d.saveButtonText
|
|
17523
17532
|
},
|
|
17524
|
-
okText: ((
|
|
17533
|
+
okText: ((_e = resourceConfig.formConfig) == null ? void 0 : _e.saveButtonText) || okText,
|
|
17525
17534
|
destroyOnClose: true,
|
|
17526
17535
|
destroyOtherStep: true,
|
|
17527
17536
|
...modalProps,
|
package/dist/refine.js
CHANGED
|
@@ -11722,7 +11722,7 @@ function YamlFormContainer({
|
|
|
11722
11722
|
const RawYamlFormModal_1nvs0vj = "";
|
|
11723
11723
|
const FormDescStyle$1 = "fdhreji";
|
|
11724
11724
|
function RawYamlFormModal(props) {
|
|
11725
|
-
var _a, _b;
|
|
11725
|
+
var _a, _b, _c;
|
|
11726
11726
|
const {
|
|
11727
11727
|
id,
|
|
11728
11728
|
yamlFormProps: customYamlFormProps,
|
|
@@ -11743,16 +11743,20 @@ function RawYamlFormModal(props) {
|
|
|
11743
11743
|
(_a2 = saveButtonProps.onClick) == null ? void 0 : _a2.call(saveButtonProps, e2);
|
|
11744
11744
|
}, [saveButtonProps]);
|
|
11745
11745
|
const errorText = useMemo(() => {
|
|
11746
|
+
var _a2;
|
|
11746
11747
|
if (isError) {
|
|
11748
|
+
const customText = (_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formFailedText;
|
|
11749
|
+
if (customText)
|
|
11750
|
+
return customText;
|
|
11747
11751
|
return i18n2.t(id ? "dovetail.save_failed" : "dovetail.create_failed");
|
|
11748
11752
|
}
|
|
11749
11753
|
return "";
|
|
11750
|
-
}, [isError, id, i18n2]);
|
|
11754
|
+
}, [isError, id, i18n2, (_a = resourceConfig.formConfig) == null ? void 0 : _a.formFailedText]);
|
|
11751
11755
|
const title = useMemo(() => {
|
|
11752
|
-
var _a2, _b2,
|
|
11756
|
+
var _a2, _b2, _c2, _d;
|
|
11753
11757
|
if (typeof ((_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formTitle) === "string")
|
|
11754
11758
|
return (_b2 = resourceConfig.formConfig) == null ? void 0 : _b2.formTitle;
|
|
11755
|
-
if (typeof ((
|
|
11759
|
+
if (typeof ((_c2 = resourceConfig.formConfig) == null ? void 0 : _c2.formTitle) === "function") {
|
|
11756
11760
|
return (_d = resourceConfig.formConfig) == null ? void 0 : _d.formTitle(action);
|
|
11757
11761
|
}
|
|
11758
11762
|
const label2 = resourceConfig.displayName || (resourceConfig == null ? void 0 : resourceConfig.kind);
|
|
@@ -11761,10 +11765,10 @@ function RawYamlFormModal(props) {
|
|
|
11761
11765
|
});
|
|
11762
11766
|
}, [action, resourceConfig.formConfig, resourceConfig.displayName, resourceConfig == null ? void 0 : resourceConfig.kind, i18n2, id]);
|
|
11763
11767
|
const desc = useMemo(() => {
|
|
11764
|
-
var _a2, _b2,
|
|
11768
|
+
var _a2, _b2, _c2, _d;
|
|
11765
11769
|
if (typeof ((_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formDesc) === "string")
|
|
11766
11770
|
return (_b2 = resourceConfig.formConfig) == null ? void 0 : _b2.formDesc;
|
|
11767
|
-
if (typeof ((
|
|
11771
|
+
if (typeof ((_c2 = resourceConfig.formConfig) == null ? void 0 : _c2.formDesc) === "function") {
|
|
11768
11772
|
return (_d = resourceConfig.formConfig) == null ? void 0 : _d.formDesc(action);
|
|
11769
11773
|
}
|
|
11770
11774
|
return "";
|
|
@@ -11794,9 +11798,9 @@ function RawYamlFormModal(props) {
|
|
|
11794
11798
|
onOk,
|
|
11795
11799
|
okButtonProps: {
|
|
11796
11800
|
...omit$1(saveButtonProps, "onClick"),
|
|
11797
|
-
children: (
|
|
11801
|
+
children: (_b = resourceConfig.formConfig) == null ? void 0 : _b.saveButtonText
|
|
11798
11802
|
},
|
|
11799
|
-
okText: ((
|
|
11803
|
+
okText: ((_c = resourceConfig.formConfig) == null ? void 0 : _c.saveButtonText) || okText,
|
|
11800
11804
|
destroyOnClose: true,
|
|
11801
11805
|
children: [desc ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11802
11806
|
className: FormDescStyle$1,
|
|
@@ -14782,7 +14786,8 @@ const PodLog = ({
|
|
|
14782
14786
|
data: logs,
|
|
14783
14787
|
theme: "light",
|
|
14784
14788
|
isTextWrapped: wrap,
|
|
14785
|
-
onScroll
|
|
14789
|
+
onScroll,
|
|
14790
|
+
fastRowHeightEstimationLimit: 100
|
|
14786
14791
|
})
|
|
14787
14792
|
})]
|
|
14788
14793
|
});
|
|
@@ -17345,7 +17350,7 @@ function ConfirmModal({
|
|
|
17345
17350
|
});
|
|
17346
17351
|
}
|
|
17347
17352
|
function FormModal(props) {
|
|
17348
|
-
var _a, _b, _c, _d;
|
|
17353
|
+
var _a, _b, _c, _d, _e;
|
|
17349
17354
|
const {
|
|
17350
17355
|
id,
|
|
17351
17356
|
yamlFormProps: customYamlFormProps,
|
|
@@ -17391,11 +17396,15 @@ function FormModal(props) {
|
|
|
17391
17396
|
}
|
|
17392
17397
|
}, [pushModal]);
|
|
17393
17398
|
const errorText = useMemo(() => {
|
|
17399
|
+
var _a2;
|
|
17394
17400
|
if (isError) {
|
|
17401
|
+
const customText = (_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formFailedText;
|
|
17402
|
+
if (customText)
|
|
17403
|
+
return customText;
|
|
17395
17404
|
return i18n2.t(id ? "dovetail.save_failed" : "dovetail.create_failed");
|
|
17396
17405
|
}
|
|
17397
17406
|
return "";
|
|
17398
|
-
}, [isError, id, i18n2]);
|
|
17407
|
+
}, [isError, id, i18n2, (_b = resourceConfig.formConfig) == null ? void 0 : _b.formFailedText]);
|
|
17399
17408
|
const title = useMemo(() => {
|
|
17400
17409
|
var _a2, _b2, _c2, _d2;
|
|
17401
17410
|
if (typeof ((_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formTitle) === "string")
|
|
@@ -17487,7 +17496,7 @@ function FormModal(props) {
|
|
|
17487
17496
|
className: TitleWrapperStyle,
|
|
17488
17497
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
17489
17498
|
children: title
|
|
17490
|
-
}), ((
|
|
17499
|
+
}), ((_c = resourceConfig.formConfig) == null ? void 0 : _c.formType) === FormType.FORM ? /* @__PURE__ */ jsxRuntimeExports.jsx(FormModeSegmentControl, {
|
|
17491
17500
|
formConfig: resourceConfig.formConfig,
|
|
17492
17501
|
mode,
|
|
17493
17502
|
onChangeMode
|
|
@@ -17500,9 +17509,9 @@ function FormModal(props) {
|
|
|
17500
17509
|
onOk,
|
|
17501
17510
|
okButtonProps: {
|
|
17502
17511
|
...omit$1(saveButtonProps, "onClick"),
|
|
17503
|
-
children: (
|
|
17512
|
+
children: (_d = resourceConfig.formConfig) == null ? void 0 : _d.saveButtonText
|
|
17504
17513
|
},
|
|
17505
|
-
okText: ((
|
|
17514
|
+
okText: ((_e = resourceConfig.formConfig) == null ? void 0 : _e.saveButtonText) || okText,
|
|
17506
17515
|
destroyOnClose: true,
|
|
17507
17516
|
destroyOtherStep: true,
|
|
17508
17517
|
...modalProps,
|
package/dist/types/resource.d.ts
CHANGED
|
@@ -134,6 +134,8 @@ export type CommonFormConfig<Model extends ResourceModel = ResourceModel> = {
|
|
|
134
134
|
formDesc?: string | ((action: 'create' | 'edit') => string);
|
|
135
135
|
/** 保存按钮文本 */
|
|
136
136
|
saveButtonText?: string;
|
|
137
|
+
/** 提交失败时 Footer 的提示文本,如"克隆失败" */
|
|
138
|
+
formFailedText?: string;
|
|
137
139
|
/**
|
|
138
140
|
* 错误信息格式化函数,待完善
|
|
139
141
|
* @param errorBody 错误信息体
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dovetail-v2/refine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@cloudtower/eagle": "^490.0.1",
|
|
14
14
|
"@cloudtower/icons-react": "^490.0.1",
|
|
15
15
|
"@patternfly/react-core": "^5.1.1",
|
|
16
|
-
"@patternfly/react-log-viewer": "^5.
|
|
16
|
+
"@patternfly/react-log-viewer": "^5.2.0",
|
|
17
17
|
"@refinedev/core": "^4.47.2",
|
|
18
18
|
"@refinedev/inferencer": "^4.5.20",
|
|
19
19
|
"@refinedev/react-hook-form": "^4.8.14",
|