@cloudtower/eagle 0.34.0 → 0.34.2
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/cjs/UIKitProvider/index.js +13 -18
- package/dist/cjs/core/Banner/banner.style.js +11 -0
- package/dist/cjs/core/Banner/index.js +32 -0
- package/dist/cjs/core/BasicCTError/BasicCTError.style.js +5 -0
- package/dist/cjs/core/BasicCTError/index.js +40 -0
- package/dist/cjs/core/ConfigProvider/index.js +8 -2
- package/dist/cjs/core/Fields/FieldsDateTimeRange/index.js +20 -3
- package/dist/cjs/core/ImmersiveDialog/index.js +188 -0
- package/dist/cjs/core/ImmersiveDialog/styles.js +31 -0
- package/dist/cjs/core/LineChart/LineChartLegend.js +7 -5
- package/dist/cjs/core/LineChart/TooltipFormatter.js +7 -6
- package/dist/cjs/core/MediumDialog/MediumDialog.js +54 -0
- package/dist/cjs/core/SmallDialog/SmallDialog.js +144 -0
- package/dist/cjs/core/SmallDialog/SmallDialog.style.js +11 -0
- package/dist/cjs/core/TableForm/AddRowButton.js +2 -2
- package/dist/cjs/core/TableForm/index.js +21 -6
- package/dist/cjs/core/Timeline/index.js +13 -7
- package/dist/cjs/core/WizardDialog/index.js +170 -0
- package/dist/cjs/core/WizardDialog/styles.js +11 -0
- package/dist/cjs/core/index.js +9 -9
- package/dist/cjs/core/message/index.js +5 -215
- package/dist/cjs/core/message/message.js +222 -0
- package/dist/cjs/core/message/useMessage.js +12 -0
- package/dist/cjs/core/message-group/index.js +2 -2
- package/dist/cjs/coreX/DateRangePicker/AbsoluteDate.js +2 -1
- package/dist/cjs/coreX/DateRangePicker/Calendar.js +78 -58
- package/dist/cjs/coreX/DateRangePicker/index.js +13 -1
- package/dist/cjs/coreX/DateRangePicker/utils.js +5 -0
- package/dist/cjs/coreX/Dialogs/DeleteDialog/DeleteDialog.js +5 -3
- package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.js +1 -1
- package/dist/cjs/coreX/KubeConfigModal/KubeConfigModal.style.js +29 -0
- package/dist/cjs/coreX/KubeConfigModal/index.js +102 -0
- package/dist/cjs/coreX/KubeConfigModal/utils.js +25 -0
- package/dist/cjs/hooks/useCTErrorMsg.js +25 -0
- package/dist/cjs/index.js +225 -197
- package/dist/cjs/legacy-antd.js +81 -81
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/utils/cterror.js +64 -0
- package/dist/cjs/utils/unit.js +19 -0
- package/dist/components.css +3147 -3859
- package/dist/esm/UIKitProvider/index.js +3 -6
- package/dist/esm/core/Banner/banner.style.js +6 -0
- package/dist/esm/core/Banner/index.js +25 -0
- package/dist/esm/core/BasicCTError/BasicCTError.style.js +3 -0
- package/dist/esm/core/BasicCTError/index.js +34 -0
- package/dist/esm/core/ConfigProvider/index.js +9 -4
- package/dist/esm/core/Fields/FieldsDateTimeRange/index.js +20 -3
- package/dist/esm/core/ImmersiveDialog/index.js +182 -0
- package/dist/esm/core/ImmersiveDialog/styles.js +16 -0
- package/dist/esm/core/LineChart/LineChartLegend.js +4 -2
- package/dist/esm/core/LineChart/TooltipFormatter.js +7 -6
- package/dist/esm/core/MediumDialog/MediumDialog.js +48 -0
- package/dist/esm/core/SmallDialog/SmallDialog.js +137 -0
- package/dist/esm/core/SmallDialog/SmallDialog.style.js +6 -0
- package/dist/esm/core/TableForm/AddRowButton.js +2 -2
- package/dist/esm/core/TableForm/index.js +21 -6
- package/dist/esm/core/Timeline/index.js +13 -7
- package/dist/esm/core/WizardDialog/index.js +164 -0
- package/dist/esm/core/WizardDialog/styles.js +6 -0
- package/dist/esm/core/message/index.js +4 -184
- package/dist/esm/core/message/message.js +186 -0
- package/dist/esm/core/message/useMessage.js +9 -0
- package/dist/esm/core/message-group/index.js +1 -1
- package/dist/esm/coreX/DateRangePicker/AbsoluteDate.js +2 -1
- package/dist/esm/coreX/DateRangePicker/Calendar.js +79 -59
- package/dist/esm/coreX/DateRangePicker/index.js +13 -1
- package/dist/esm/coreX/DateRangePicker/utils.js +3 -0
- package/dist/esm/coreX/Dialogs/DeleteDialog/DeleteDialog.js +5 -3
- package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.js +1 -1
- package/dist/esm/coreX/KubeConfigModal/KubeConfigModal.style.js +20 -0
- package/dist/esm/coreX/KubeConfigModal/index.js +96 -0
- package/dist/esm/coreX/KubeConfigModal/utils.js +22 -0
- package/dist/esm/hooks/useCTErrorMsg.js +23 -0
- package/dist/esm/index.js +14 -5
- package/dist/esm/legacy-antd.js +1 -1
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/utils/cterror.js +58 -0
- package/dist/esm/utils/unit.js +17 -0
- package/dist/linaria.merged.scss +3157 -2720
- package/dist/src/UIKitProvider/index.d.ts +1 -3
- package/dist/src/core/Antd5Flex/index.d.ts +2 -0
- package/dist/src/core/Antd5Tree/Antd5Tree.d.ts +1 -0
- package/dist/src/core/Antd5Tree/Antd5Tree.type.d.ts +4 -0
- package/dist/src/core/Antd5Tree/index.d.ts +2 -0
- package/dist/src/core/Banner/banner.style.d.ts +4 -0
- package/dist/src/core/Banner/banner.types.d.ts +28 -0
- package/dist/src/core/Banner/index.d.ts +3 -0
- package/dist/src/core/BasicCTError/BasicCTError.style.d.ts +1 -0
- package/dist/src/core/BasicCTError/BasicCTError.type.d.ts +56 -0
- package/dist/src/core/BasicCTError/index.d.ts +3 -0
- package/dist/src/core/ConfigProvider/index.d.ts +6 -1
- package/dist/src/core/ImmersiveDialog/index.d.ts +3 -0
- package/dist/src/core/ImmersiveDialog/styles.d.ts +14 -0
- package/dist/src/core/ImmersiveDialog/type.d.ts +37 -0
- package/dist/src/core/Input/index.d.ts +2 -4
- package/dist/src/core/Input/input.type.d.ts +4 -0
- package/dist/src/core/LineChart/type.d.ts +1 -0
- package/dist/src/core/MediumDialog/MediumDialog.d.ts +3 -0
- package/dist/src/core/MediumDialog/index.d.ts +1 -0
- package/dist/src/core/SmallDialog/SmallDialog.d.ts +3 -0
- package/dist/src/core/SmallDialog/SmallDialog.style.d.ts +4 -0
- package/dist/src/{coreX/Dialogs/SmallDialog.d.ts → core/SmallDialog/SmallDialog.type.d.ts} +12 -4
- package/dist/src/core/SmallDialog/index.d.ts +3 -0
- package/dist/src/core/TableForm/types.d.ts +7 -2
- package/dist/src/core/Timeline/Timeline.type.d.ts +27 -7
- package/dist/src/core/Timeline/index.d.ts +5 -1
- package/dist/src/core/WizardDialog/index.d.ts +3 -0
- package/dist/src/core/WizardDialog/styles.d.ts +4 -0
- package/dist/src/core/WizardDialog/type.d.ts +31 -0
- package/dist/src/core/index.d.ts +10 -14
- package/dist/src/core/message/index.d.ts +4 -53
- package/dist/src/core/message/message.d.ts +53 -0
- package/dist/src/core/message/useMessage.d.ts +4 -0
- package/dist/src/coreX/DateRangePicker/__tests__/utils.test.d.ts +1 -0
- package/dist/src/coreX/DateRangePicker/dateRangePicker.type.d.ts +10 -2
- package/dist/src/coreX/DateRangePicker/utils.d.ts +7 -0
- package/dist/src/coreX/Dialogs/DeleteDialog/DeleteDialog.type.d.ts +2 -0
- package/dist/src/coreX/Dialogs/index.d.ts +0 -1
- package/dist/src/coreX/KubeConfigModal/KubeConfigModal.style.d.ts +9 -0
- package/dist/src/coreX/KubeConfigModal/KubeConfigModal.type.d.ts +21 -0
- package/dist/src/coreX/KubeConfigModal/index.d.ts +4 -0
- package/dist/src/coreX/KubeConfigModal/utils.d.ts +2 -0
- package/dist/src/coreX/index.d.ts +2 -0
- package/dist/src/hooks/__tests__/useCTErrorMsg.test.d.ts +1 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/useCTErrorMsg.d.ts +7 -0
- package/dist/src/utils/__test__/cterror.test.d.ts +1 -0
- package/dist/src/utils/__test__/unit.spec.d.ts +1 -0
- package/dist/src/utils/cterror.d.ts +29 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/type.d.ts +32 -0
- package/dist/src/utils/unit.d.ts +14 -0
- package/dist/stories/docs/core/Antd5Tree.stories.d.ts +44 -0
- package/dist/stories/docs/core/Banner.stories.d.ts +53 -0
- package/dist/stories/docs/core/BasicCTError.stories.d.ts +47 -0
- package/dist/stories/docs/core/FieldsDateTimeRange.stories.d.ts +1 -0
- package/dist/stories/docs/core/ImmersiveDialog.stories.d.ts +96 -0
- package/dist/stories/docs/core/Input.simple.stories.d.ts +1 -3
- package/dist/stories/docs/core/LineChart.stories.d.ts +1 -0
- package/dist/stories/docs/core/MediumDialog.stories.d.ts +35 -0
- package/dist/stories/docs/core/Modal.stories.d.ts +0 -2
- package/dist/stories/docs/core/SmallDialog.stories.d.ts +37 -0
- package/dist/stories/docs/core/Timeline.stories.d.ts +4 -1
- package/dist/stories/docs/core/WizardDialog.stories.d.ts +109 -0
- package/dist/stories/docs/coreX/DateRangePicker.stories.d.ts +1 -0
- package/dist/stories/docs/coreX/Dialogs/DeleteDialog.stories.d.ts +5 -0
- package/dist/stories/docs/coreX/KubeConfigModal.stories.d.ts +83 -0
- package/dist/style.css +2867 -2469
- package/package.json +8 -7
- package/dist/cjs/coreX/Dialogs/SmallDialog.js +0 -86
- package/dist/esm/coreX/Dialogs/SmallDialog.js +0 -80
|
@@ -44,6 +44,7 @@ const TableForm = React__default.forwardRef(
|
|
|
44
44
|
onHeaderChange,
|
|
45
45
|
onHeaderBlur,
|
|
46
46
|
onBodyChange,
|
|
47
|
+
onBodyAdd,
|
|
47
48
|
onBodyBlur,
|
|
48
49
|
row,
|
|
49
50
|
errors,
|
|
@@ -64,6 +65,16 @@ const TableForm = React__default.forwardRef(
|
|
|
64
65
|
},
|
|
65
66
|
[onBodyChange]
|
|
66
67
|
);
|
|
68
|
+
const addData = useCallback(
|
|
69
|
+
(value) => {
|
|
70
|
+
setLatestData(value);
|
|
71
|
+
setData(value);
|
|
72
|
+
onBodyChange == null ? void 0 : onBodyChange(value);
|
|
73
|
+
const rowIndex = value.length - 1;
|
|
74
|
+
onBodyAdd == null ? void 0 : onBodyAdd(value, rowIndex);
|
|
75
|
+
},
|
|
76
|
+
[onBodyChange, onBodyAdd]
|
|
77
|
+
);
|
|
67
78
|
const handleBatchChange = useCallback(
|
|
68
79
|
(newData, columnKey, shouldUpdateData) => {
|
|
69
80
|
setLatestData(newData);
|
|
@@ -76,19 +87,19 @@ const TableForm = React__default.forwardRef(
|
|
|
76
87
|
[onHeaderChange, onBodyChange]
|
|
77
88
|
);
|
|
78
89
|
const handleBatchBlur = useCallback(
|
|
79
|
-
(
|
|
90
|
+
(columnKey, error) => {
|
|
80
91
|
if (error) {
|
|
81
92
|
const newData = latestData.map((cell) => {
|
|
82
93
|
return __spreadProps(__spreadValues({}, cell), {
|
|
83
|
-
[
|
|
94
|
+
[columnKey]: ""
|
|
84
95
|
});
|
|
85
96
|
});
|
|
86
97
|
setLatestData(newData);
|
|
87
|
-
onHeaderBlur == null ? void 0 : onHeaderBlur(newData);
|
|
98
|
+
onHeaderBlur == null ? void 0 : onHeaderBlur(newData, columnKey);
|
|
88
99
|
} else {
|
|
89
100
|
setData(latestData);
|
|
90
|
-
onBodyChange == null ? void 0 : onBodyChange(latestData, void 0,
|
|
91
|
-
onHeaderBlur == null ? void 0 : onHeaderBlur(latestData);
|
|
101
|
+
onBodyChange == null ? void 0 : onBodyChange(latestData, void 0, columnKey);
|
|
102
|
+
onHeaderBlur == null ? void 0 : onHeaderBlur(latestData, columnKey);
|
|
92
103
|
}
|
|
93
104
|
},
|
|
94
105
|
[latestData, onHeaderBlur, onBodyChange]
|
|
@@ -99,6 +110,10 @@ const TableForm = React__default.forwardRef(
|
|
|
99
110
|
setData: (data2) => {
|
|
100
111
|
updateData(data2);
|
|
101
112
|
},
|
|
113
|
+
setDataWithoutTriggerChange: (data2) => {
|
|
114
|
+
setLatestData(data2);
|
|
115
|
+
setData(data2);
|
|
116
|
+
},
|
|
102
117
|
validateWholeFields() {
|
|
103
118
|
formValidMapRef.current = {};
|
|
104
119
|
setValidateAll(true);
|
|
@@ -177,7 +192,7 @@ const TableForm = React__default.forwardRef(
|
|
|
177
192
|
AddRowButton,
|
|
178
193
|
{
|
|
179
194
|
config: rowAddConfig,
|
|
180
|
-
|
|
195
|
+
addData,
|
|
181
196
|
columns,
|
|
182
197
|
data
|
|
183
198
|
}
|
|
@@ -32,6 +32,7 @@ const Timeline = ({
|
|
|
32
32
|
emptyText,
|
|
33
33
|
emptyRender,
|
|
34
34
|
compact,
|
|
35
|
+
timelineContainerClassName,
|
|
35
36
|
emptyTextClassName
|
|
36
37
|
}) => {
|
|
37
38
|
if (!items.length) {
|
|
@@ -56,7 +57,7 @@ const Timeline = ({
|
|
|
56
57
|
pending: "info",
|
|
57
58
|
idle: "normal"
|
|
58
59
|
};
|
|
59
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: cx(TimelineWrapper) }, /* @__PURE__ */ React__default.createElement(Timeline$1, null, items.map((item, index) => {
|
|
60
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: cx(TimelineWrapper, timelineContainerClassName) }, /* @__PURE__ */ React__default.createElement(Timeline$1, null, items.map((item, index) => {
|
|
60
61
|
const {
|
|
61
62
|
status,
|
|
62
63
|
infos,
|
|
@@ -65,8 +66,10 @@ const Timeline = ({
|
|
|
65
66
|
subInfo,
|
|
66
67
|
subInfoRender,
|
|
67
68
|
detailMessage,
|
|
69
|
+
detailMessages,
|
|
68
70
|
detailMessageRender
|
|
69
71
|
} = item;
|
|
72
|
+
const finalDetailMessages = detailMessages != null ? detailMessages : detailMessage ? [detailMessage] : [];
|
|
70
73
|
return /* @__PURE__ */ React__default.createElement(
|
|
71
74
|
Timeline$1.Item,
|
|
72
75
|
{
|
|
@@ -101,12 +104,15 @@ const Timeline = ({
|
|
|
101
104
|
})
|
|
102
105
|
))
|
|
103
106
|
),
|
|
104
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "item-time" }, subInfoRender ? subInfoRender(subInfo) : subInfo ? /* @__PURE__ */ React__default.createElement(TimelineArea, __spreadValues({}, subInfo)) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "item-time" }, subInfoRender ? subInfoRender(subInfo) : subInfo ? /* @__PURE__ */ React__default.createElement(TimelineArea, __spreadValues({}, subInfo)) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null), finalDetailMessages.length > 0 ? finalDetailMessages.map(
|
|
108
|
+
(detailMessage2, index2) => detailMessageRender ? detailMessageRender(detailMessage2, index2) : /* @__PURE__ */ React__default.createElement(
|
|
109
|
+
Alert,
|
|
110
|
+
__spreadValues({
|
|
111
|
+
key: `detail-message-${index2}`,
|
|
112
|
+
showIcon: false,
|
|
113
|
+
type: alertTypeMap[status]
|
|
114
|
+
}, detailMessage2)
|
|
115
|
+
)
|
|
110
116
|
) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null))
|
|
111
117
|
);
|
|
112
118
|
})));
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { ArrowChevronLeft16BoldBlueIcon } from '@cloudtower/icons-react';
|
|
2
|
+
import Button from '../Button/index.js';
|
|
3
|
+
import { ImmersiveDialog } from '../ImmersiveDialog/index.js';
|
|
4
|
+
import Steps from '../Steps/index.js';
|
|
5
|
+
import useParrotTranslation from '../../hooks/useParrotTranslation.js';
|
|
6
|
+
import React__default, { useState, useMemo, useEffect } from 'react';
|
|
7
|
+
import { StepContentStyle, PrevIconStyle, StepStyle, RightPanelStyle } from './styles.js';
|
|
8
|
+
import { cx } from '@linaria/core';
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __defProps = Object.defineProperties;
|
|
12
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
13
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
14
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
16
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17
|
+
var __spreadValues = (a, b) => {
|
|
18
|
+
for (var prop in b || (b = {}))
|
|
19
|
+
if (__hasOwnProp.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
if (__getOwnPropSymbols)
|
|
22
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
23
|
+
if (__propIsEnum.call(b, prop))
|
|
24
|
+
__defNormalProp(a, prop, b[prop]);
|
|
25
|
+
}
|
|
26
|
+
return a;
|
|
27
|
+
};
|
|
28
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
29
|
+
var __objRest = (source, exclude) => {
|
|
30
|
+
var target = {};
|
|
31
|
+
for (var prop in source)
|
|
32
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
if (source != null && __getOwnPropSymbols)
|
|
35
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
36
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
37
|
+
target[prop] = source[prop];
|
|
38
|
+
}
|
|
39
|
+
return target;
|
|
40
|
+
};
|
|
41
|
+
function WizardDialog(props) {
|
|
42
|
+
const _a = props, {
|
|
43
|
+
className,
|
|
44
|
+
steps,
|
|
45
|
+
step,
|
|
46
|
+
children,
|
|
47
|
+
hideSteps,
|
|
48
|
+
destroyOtherStep,
|
|
49
|
+
prevText,
|
|
50
|
+
nextText,
|
|
51
|
+
onPrevStep,
|
|
52
|
+
onNextStep,
|
|
53
|
+
onStepChange,
|
|
54
|
+
left,
|
|
55
|
+
right,
|
|
56
|
+
rightClassName,
|
|
57
|
+
okText,
|
|
58
|
+
onOk
|
|
59
|
+
} = _a, restProps = __objRest(_a, [
|
|
60
|
+
"className",
|
|
61
|
+
"steps",
|
|
62
|
+
"step",
|
|
63
|
+
"children",
|
|
64
|
+
"hideSteps",
|
|
65
|
+
"destroyOtherStep",
|
|
66
|
+
"prevText",
|
|
67
|
+
"nextText",
|
|
68
|
+
"onPrevStep",
|
|
69
|
+
"onNextStep",
|
|
70
|
+
"onStepChange",
|
|
71
|
+
"left",
|
|
72
|
+
"right",
|
|
73
|
+
"rightClassName",
|
|
74
|
+
"okText",
|
|
75
|
+
"onOk"
|
|
76
|
+
]);
|
|
77
|
+
const { t } = useParrotTranslation();
|
|
78
|
+
const [_step, _setStep] = useState(step || 0);
|
|
79
|
+
const stepVal = useMemo(() => step != null ? step : _step, [step, _step]);
|
|
80
|
+
const content = useMemo(() => {
|
|
81
|
+
var _a2;
|
|
82
|
+
if (destroyOtherStep) {
|
|
83
|
+
return ((_a2 = steps == null ? void 0 : steps[stepVal]) == null ? void 0 : _a2.children) || children;
|
|
84
|
+
}
|
|
85
|
+
return (steps == null ? void 0 : steps.map((s, index) => /* @__PURE__ */ React__default.createElement(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
key: s.title,
|
|
89
|
+
className: StepContentStyle,
|
|
90
|
+
style: {
|
|
91
|
+
display: stepVal === index ? "block" : "none"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
s.children
|
|
95
|
+
))) || children;
|
|
96
|
+
}, [children, destroyOtherStep, steps, stepVal]);
|
|
97
|
+
const _confirmText = useMemo(() => {
|
|
98
|
+
let text = okText || t("common.confirm");
|
|
99
|
+
if (steps == null ? void 0 : steps.length) {
|
|
100
|
+
text = stepVal < steps.length - 1 ? nextText || t("common.next_step") : text;
|
|
101
|
+
}
|
|
102
|
+
return text;
|
|
103
|
+
}, [okText, t, steps == null ? void 0 : steps.length, stepVal, nextText]);
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (step) {
|
|
106
|
+
_setStep(step);
|
|
107
|
+
}
|
|
108
|
+
}, [step]);
|
|
109
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
110
|
+
ImmersiveDialog,
|
|
111
|
+
__spreadProps(__spreadValues({
|
|
112
|
+
className,
|
|
113
|
+
footerLeftAction: stepVal > 0 ? /* @__PURE__ */ React__default.createElement(
|
|
114
|
+
Button,
|
|
115
|
+
{
|
|
116
|
+
type: "link",
|
|
117
|
+
onClick: () => {
|
|
118
|
+
const newStep = stepVal - 1;
|
|
119
|
+
_setStep(newStep);
|
|
120
|
+
onPrevStep == null ? void 0 : onPrevStep(newStep);
|
|
121
|
+
onStepChange == null ? void 0 : onStepChange(newStep);
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
/* @__PURE__ */ React__default.createElement(ArrowChevronLeft16BoldBlueIcon, { className: PrevIconStyle }),
|
|
125
|
+
prevText || t("common.prev_step")
|
|
126
|
+
) : null,
|
|
127
|
+
left: left || (steps && steps.length > 0 && !hideSteps ? /* @__PURE__ */ React__default.createElement(
|
|
128
|
+
Steps,
|
|
129
|
+
{
|
|
130
|
+
containerClassname: StepStyle,
|
|
131
|
+
current: stepVal,
|
|
132
|
+
onChange: (value) => {
|
|
133
|
+
_setStep(value);
|
|
134
|
+
onStepChange == null ? void 0 : onStepChange(value);
|
|
135
|
+
},
|
|
136
|
+
direction: "vertical",
|
|
137
|
+
stepsConfig: steps.map((s) => ({
|
|
138
|
+
title: s.title
|
|
139
|
+
}))
|
|
140
|
+
}
|
|
141
|
+
) : null),
|
|
142
|
+
right,
|
|
143
|
+
okText: _confirmText,
|
|
144
|
+
onOk: (e) => {
|
|
145
|
+
if (stepVal < ((steps == null ? void 0 : steps.length) || 0) - 1) {
|
|
146
|
+
const newStep = stepVal + 1;
|
|
147
|
+
const prevent = (onNextStep == null ? void 0 : onNextStep(newStep)) === false;
|
|
148
|
+
if (!prevent) {
|
|
149
|
+
_setStep(newStep);
|
|
150
|
+
onStepChange == null ? void 0 : onStepChange(newStep);
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
onOk == null ? void 0 : onOk(e);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
rightClassName: cx(RightPanelStyle, rightClassName)
|
|
157
|
+
}, restProps), {
|
|
158
|
+
isContentFull: false
|
|
159
|
+
}),
|
|
160
|
+
content
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export { WizardDialog };
|
|
@@ -1,186 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled';
|
|
4
|
-
import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled';
|
|
5
|
-
import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
|
|
6
|
-
import RCNotification from '@cloudtower/rc-notification';
|
|
7
|
-
import cs from 'classnames';
|
|
8
|
-
import * as React from 'react';
|
|
1
|
+
import _message from './message.js';
|
|
2
|
+
export { DEFAULT_DURATION, attachTypeApi, getKeyThenIncreaseKey } from './message.js';
|
|
9
3
|
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __defProps = Object.defineProperties;
|
|
12
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
13
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
14
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
16
|
-
var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
17
|
-
var __spreadValues = (a, b) => {
|
|
18
|
-
for (var prop in b || (b = {}))
|
|
19
|
-
if (__hasOwnProp.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
if (__getOwnPropSymbols)
|
|
22
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
23
|
-
if (__propIsEnum.call(b, prop))
|
|
24
|
-
__defNormalProp(a, prop, b[prop]);
|
|
25
|
-
}
|
|
26
|
-
return a;
|
|
27
|
-
};
|
|
28
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
29
|
-
const DEFAULT_DURATION = 3;
|
|
30
|
-
let messageInstance;
|
|
31
|
-
let defaultDuration = DEFAULT_DURATION;
|
|
32
|
-
let defaultTop;
|
|
33
|
-
let key = 1;
|
|
34
|
-
let localPrefixCls = "ant-message";
|
|
35
|
-
let transitionName = "move-up";
|
|
36
|
-
let getContainer;
|
|
37
|
-
let maxCount;
|
|
38
|
-
let rtl = false;
|
|
39
|
-
function getKeyThenIncreaseKey() {
|
|
40
|
-
return key++;
|
|
41
|
-
}
|
|
42
|
-
function setMessageConfig(options) {
|
|
43
|
-
if (options.top !== void 0) {
|
|
44
|
-
defaultTop = options.top;
|
|
45
|
-
messageInstance = null;
|
|
46
|
-
}
|
|
47
|
-
if (options.duration !== void 0) {
|
|
48
|
-
defaultDuration = options.duration;
|
|
49
|
-
}
|
|
50
|
-
if (options.prefixCls !== void 0) {
|
|
51
|
-
localPrefixCls = options.prefixCls;
|
|
52
|
-
}
|
|
53
|
-
if (options.getContainer !== void 0) {
|
|
54
|
-
getContainer = options.getContainer;
|
|
55
|
-
}
|
|
56
|
-
if (options.transitionName !== void 0) {
|
|
57
|
-
transitionName = options.transitionName;
|
|
58
|
-
messageInstance = null;
|
|
59
|
-
}
|
|
60
|
-
if (options.maxCount !== void 0) {
|
|
61
|
-
maxCount = options.maxCount;
|
|
62
|
-
messageInstance = null;
|
|
63
|
-
}
|
|
64
|
-
if (options.rtl !== void 0) {
|
|
65
|
-
rtl = options.rtl;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function getRCNotificationInstance(args, callback) {
|
|
69
|
-
const prefixCls = args.prefixCls || localPrefixCls;
|
|
70
|
-
if (messageInstance) {
|
|
71
|
-
callback({
|
|
72
|
-
prefixCls,
|
|
73
|
-
instance: messageInstance
|
|
74
|
-
});
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
RCNotification.newInstance(
|
|
78
|
-
{
|
|
79
|
-
prefixCls,
|
|
80
|
-
transitionName,
|
|
81
|
-
style: { top: defaultTop },
|
|
82
|
-
// 覆盖原来的样式
|
|
83
|
-
getContainer,
|
|
84
|
-
maxCount
|
|
85
|
-
},
|
|
86
|
-
(instance) => {
|
|
87
|
-
if (messageInstance) {
|
|
88
|
-
callback({
|
|
89
|
-
prefixCls,
|
|
90
|
-
instance: messageInstance
|
|
91
|
-
});
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
messageInstance = instance;
|
|
95
|
-
callback({
|
|
96
|
-
prefixCls,
|
|
97
|
-
instance
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
const typeToIcon = {
|
|
103
|
-
info: InfoCircleFilled,
|
|
104
|
-
success: CheckCircleFilled,
|
|
105
|
-
error: CloseCircleFilled,
|
|
106
|
-
warning: ExclamationCircleFilled,
|
|
107
|
-
loading: LoadingOutlined
|
|
108
|
-
};
|
|
109
|
-
function getRCNoticeProps(args, prefixCls) {
|
|
110
|
-
const duration = args.duration !== void 0 ? args.duration : defaultDuration;
|
|
111
|
-
const IconComponent = args.type != null ? typeToIcon[args.type] : void 0;
|
|
112
|
-
const messageClass = cs(`${prefixCls}-custom-content`, {
|
|
113
|
-
[`${prefixCls}-${args.type}`]: args.type,
|
|
114
|
-
[`${prefixCls}-rtl`]: rtl === true
|
|
115
|
-
});
|
|
116
|
-
return {
|
|
117
|
-
key: args.key,
|
|
118
|
-
duration,
|
|
119
|
-
style: args.style || {},
|
|
120
|
-
className: args.className,
|
|
121
|
-
content: /* @__PURE__ */ React.createElement("div", { className: messageClass }, args.icon || IconComponent && /* @__PURE__ */ React.createElement(IconComponent, null), /* @__PURE__ */ React.createElement("span", null, args.content)),
|
|
122
|
-
onClose: args.onClose
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
function notice(args) {
|
|
126
|
-
const target = args.key || key++;
|
|
127
|
-
const closePromise = new Promise((resolve) => {
|
|
128
|
-
const callback = () => {
|
|
129
|
-
if (typeof args.onClose === "function") {
|
|
130
|
-
args.onClose();
|
|
131
|
-
}
|
|
132
|
-
return resolve(true);
|
|
133
|
-
};
|
|
134
|
-
if (document.hidden) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
getRCNotificationInstance(args, ({ prefixCls, instance }) => {
|
|
138
|
-
instance.notice(
|
|
139
|
-
getRCNoticeProps(
|
|
140
|
-
__spreadProps(__spreadValues({}, args), { key: target, onClose: callback }),
|
|
141
|
-
prefixCls
|
|
142
|
-
)
|
|
143
|
-
);
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
const result = () => {
|
|
147
|
-
if (messageInstance) {
|
|
148
|
-
messageInstance.removeNotice(target);
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
result.then = (filled, rejected) => closePromise.then(filled, rejected);
|
|
152
|
-
result.promise = closePromise;
|
|
153
|
-
return result;
|
|
154
|
-
}
|
|
155
|
-
function isArgsProps(content) {
|
|
156
|
-
return Object.prototype.toString.call(content) === "[object Object]" && !!content.content;
|
|
157
|
-
}
|
|
158
|
-
const api = {
|
|
159
|
-
open: notice,
|
|
160
|
-
config: setMessageConfig,
|
|
161
|
-
destroy() {
|
|
162
|
-
if (messageInstance) {
|
|
163
|
-
messageInstance.destroy();
|
|
164
|
-
messageInstance = null;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
function attachTypeApi(originalApi, type) {
|
|
169
|
-
originalApi[type] = (content, duration, onClose) => {
|
|
170
|
-
if (isArgsProps(content)) {
|
|
171
|
-
return originalApi.open(__spreadProps(__spreadValues({}, content), { type }));
|
|
172
|
-
}
|
|
173
|
-
if (typeof duration === "function") {
|
|
174
|
-
onClose = duration;
|
|
175
|
-
duration = void 0;
|
|
176
|
-
}
|
|
177
|
-
return originalApi.open({ content, duration, type, onClose });
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
["success", "info", "warning", "error", "loading"].forEach(
|
|
181
|
-
(type) => attachTypeApi(api, type)
|
|
182
|
-
);
|
|
183
|
-
api.warn = api.warning;
|
|
184
|
-
var _message = api;
|
|
185
4
|
|
|
186
|
-
|
|
5
|
+
|
|
6
|
+
export { _message as default };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled';
|
|
2
|
+
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
|
|
3
|
+
import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled';
|
|
4
|
+
import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled';
|
|
5
|
+
import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
|
|
6
|
+
import RCNotification from '@cloudtower/rc-notification';
|
|
7
|
+
import cs from 'classnames';
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __defProps = Object.defineProperties;
|
|
12
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
13
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
14
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
16
|
+
var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
17
|
+
var __spreadValues = (a, b) => {
|
|
18
|
+
for (var prop in b || (b = {}))
|
|
19
|
+
if (__hasOwnProp.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
if (__getOwnPropSymbols)
|
|
22
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
23
|
+
if (__propIsEnum.call(b, prop))
|
|
24
|
+
__defNormalProp(a, prop, b[prop]);
|
|
25
|
+
}
|
|
26
|
+
return a;
|
|
27
|
+
};
|
|
28
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
29
|
+
const DEFAULT_DURATION = 3;
|
|
30
|
+
let messageInstance;
|
|
31
|
+
let defaultDuration = DEFAULT_DURATION;
|
|
32
|
+
let defaultTop;
|
|
33
|
+
let key = 1;
|
|
34
|
+
let localPrefixCls = "ant-message";
|
|
35
|
+
let transitionName = "move-up";
|
|
36
|
+
let getContainer;
|
|
37
|
+
let maxCount;
|
|
38
|
+
let rtl = false;
|
|
39
|
+
function getKeyThenIncreaseKey() {
|
|
40
|
+
return key++;
|
|
41
|
+
}
|
|
42
|
+
function setMessageConfig(options) {
|
|
43
|
+
if (options.top !== void 0) {
|
|
44
|
+
defaultTop = options.top;
|
|
45
|
+
messageInstance = null;
|
|
46
|
+
}
|
|
47
|
+
if (options.duration !== void 0) {
|
|
48
|
+
defaultDuration = options.duration;
|
|
49
|
+
}
|
|
50
|
+
if (options.prefixCls !== void 0) {
|
|
51
|
+
localPrefixCls = options.prefixCls;
|
|
52
|
+
}
|
|
53
|
+
if (options.getContainer !== void 0) {
|
|
54
|
+
getContainer = options.getContainer;
|
|
55
|
+
}
|
|
56
|
+
if (options.transitionName !== void 0) {
|
|
57
|
+
transitionName = options.transitionName;
|
|
58
|
+
messageInstance = null;
|
|
59
|
+
}
|
|
60
|
+
if (options.maxCount !== void 0) {
|
|
61
|
+
maxCount = options.maxCount;
|
|
62
|
+
messageInstance = null;
|
|
63
|
+
}
|
|
64
|
+
if (options.rtl !== void 0) {
|
|
65
|
+
rtl = options.rtl;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function getRCNotificationInstance(args, callback) {
|
|
69
|
+
const prefixCls = args.prefixCls || localPrefixCls;
|
|
70
|
+
if (messageInstance) {
|
|
71
|
+
callback({
|
|
72
|
+
prefixCls,
|
|
73
|
+
instance: messageInstance
|
|
74
|
+
});
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
RCNotification.newInstance(
|
|
78
|
+
{
|
|
79
|
+
prefixCls,
|
|
80
|
+
transitionName,
|
|
81
|
+
style: { top: defaultTop },
|
|
82
|
+
// 覆盖原来的样式
|
|
83
|
+
getContainer,
|
|
84
|
+
maxCount
|
|
85
|
+
},
|
|
86
|
+
(instance) => {
|
|
87
|
+
if (messageInstance) {
|
|
88
|
+
callback({
|
|
89
|
+
prefixCls,
|
|
90
|
+
instance: messageInstance
|
|
91
|
+
});
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
messageInstance = instance;
|
|
95
|
+
callback({
|
|
96
|
+
prefixCls,
|
|
97
|
+
instance
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
const typeToIcon = {
|
|
103
|
+
info: InfoCircleFilled,
|
|
104
|
+
success: CheckCircleFilled,
|
|
105
|
+
error: CloseCircleFilled,
|
|
106
|
+
warning: ExclamationCircleFilled,
|
|
107
|
+
loading: LoadingOutlined
|
|
108
|
+
};
|
|
109
|
+
function getRCNoticeProps(args, prefixCls) {
|
|
110
|
+
const duration = args.duration !== void 0 ? args.duration : defaultDuration;
|
|
111
|
+
const IconComponent = args.type != null ? typeToIcon[args.type] : void 0;
|
|
112
|
+
const messageClass = cs(`${prefixCls}-custom-content`, {
|
|
113
|
+
[`${prefixCls}-${args.type}`]: args.type,
|
|
114
|
+
[`${prefixCls}-rtl`]: rtl === true
|
|
115
|
+
});
|
|
116
|
+
return {
|
|
117
|
+
key: args.key,
|
|
118
|
+
duration,
|
|
119
|
+
style: args.style || {},
|
|
120
|
+
className: args.className,
|
|
121
|
+
content: /* @__PURE__ */ React.createElement("div", { className: messageClass }, args.icon || IconComponent && /* @__PURE__ */ React.createElement(IconComponent, null), /* @__PURE__ */ React.createElement("span", null, args.content)),
|
|
122
|
+
onClose: args.onClose
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function notice(args) {
|
|
126
|
+
const target = args.key || key++;
|
|
127
|
+
const closePromise = new Promise((resolve) => {
|
|
128
|
+
const callback = () => {
|
|
129
|
+
if (typeof args.onClose === "function") {
|
|
130
|
+
args.onClose();
|
|
131
|
+
}
|
|
132
|
+
return resolve(true);
|
|
133
|
+
};
|
|
134
|
+
if (document.hidden) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
getRCNotificationInstance(args, ({ prefixCls, instance }) => {
|
|
138
|
+
instance.notice(
|
|
139
|
+
getRCNoticeProps(
|
|
140
|
+
__spreadProps(__spreadValues({}, args), { key: target, onClose: callback }),
|
|
141
|
+
prefixCls
|
|
142
|
+
)
|
|
143
|
+
);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
const result = () => {
|
|
147
|
+
if (messageInstance) {
|
|
148
|
+
messageInstance.removeNotice(target);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
result.then = (filled, rejected) => closePromise.then(filled, rejected);
|
|
152
|
+
result.promise = closePromise;
|
|
153
|
+
return result;
|
|
154
|
+
}
|
|
155
|
+
function isArgsProps(content) {
|
|
156
|
+
return Object.prototype.toString.call(content) === "[object Object]" && !!content.content;
|
|
157
|
+
}
|
|
158
|
+
const api = {
|
|
159
|
+
open: notice,
|
|
160
|
+
config: setMessageConfig,
|
|
161
|
+
destroy() {
|
|
162
|
+
if (messageInstance) {
|
|
163
|
+
messageInstance.destroy();
|
|
164
|
+
messageInstance = null;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
function attachTypeApi(originalApi, type) {
|
|
169
|
+
originalApi[type] = (content, duration, onClose) => {
|
|
170
|
+
if (isArgsProps(content)) {
|
|
171
|
+
return originalApi.open(__spreadProps(__spreadValues({}, content), { type }));
|
|
172
|
+
}
|
|
173
|
+
if (typeof duration === "function") {
|
|
174
|
+
onClose = duration;
|
|
175
|
+
duration = void 0;
|
|
176
|
+
}
|
|
177
|
+
return originalApi.open({ content, duration, type, onClose });
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
["success", "info", "warning", "error", "loading"].forEach(
|
|
181
|
+
(type) => attachTypeApi(api, type)
|
|
182
|
+
);
|
|
183
|
+
api.warn = api.warning;
|
|
184
|
+
var _message = api;
|
|
185
|
+
|
|
186
|
+
export { DEFAULT_DURATION, attachTypeApi, _message as default, getKeyThenIncreaseKey };
|
|
@@ -139,7 +139,7 @@ const Time = React__default.forwardRef((props, ref) => {
|
|
|
139
139
|
});
|
|
140
140
|
const AbsoluteDate = React__default.forwardRef(
|
|
141
141
|
(props, ref) => {
|
|
142
|
-
const { range, minDate, maxDate, onChange, onOk } = props;
|
|
142
|
+
const { range, minDate, maxDate, maxRange, onChange, onOk } = props;
|
|
143
143
|
const timeRef = useRef(null);
|
|
144
144
|
useImperativeHandle(ref, () => {
|
|
145
145
|
var _a;
|
|
@@ -158,6 +158,7 @@ const AbsoluteDate = React__default.forwardRef(
|
|
|
158
158
|
range,
|
|
159
159
|
minDate,
|
|
160
160
|
maxDate,
|
|
161
|
+
maxRange,
|
|
161
162
|
onChange
|
|
162
163
|
}
|
|
163
164
|
), /* @__PURE__ */ React__default.createElement(
|