@cloudtower/eagle 0.33.0 → 0.33.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/README.md +6 -0
- package/dist/cjs/UIKitProvider/index.js +3 -4
- package/dist/cjs/antd.js +6 -6
- package/dist/cjs/core/Alert/index.js +10 -4
- package/dist/cjs/core/BitPerSecond/index.js +3 -3
- package/dist/cjs/core/KitStoreProvider/index.js +10 -0
- package/dist/cjs/core/Modal/index.js +53 -42
- package/dist/cjs/core/ModalStack/index.js +6 -0
- package/dist/cjs/core/Progress/progress.widgets.js +2 -5
- package/dist/cjs/core/SearchInput/index.js +21 -11
- package/dist/cjs/core/TableForm/TableFormBodyCell.js +2 -1
- package/dist/cjs/core/TableForm/TableFormHeaderCell.js +4 -2
- package/dist/cjs/core/Timeline/Timeline.style.js +13 -0
- package/dist/cjs/core/Timeline/Timeline.widget.js +114 -0
- package/dist/cjs/core/Timeline/index.js +122 -0
- package/dist/cjs/core/message/index.js +7 -2
- package/dist/cjs/core/message-group/index.js +3 -1
- package/dist/cjs/coreX/CheckPointList/checkpointlist.style.js +9 -0
- package/dist/cjs/coreX/CheckPointList/index.js +90 -0
- package/dist/cjs/coreX/DateRangePicker/common.js +7 -5
- package/dist/cjs/coreX/DateRangePicker/index.js +10 -5
- package/dist/cjs/coreX/InfoRowList/InfoRow.js +31 -0
- package/dist/cjs/coreX/InfoRowList/InfoRowList.js +60 -0
- package/dist/cjs/coreX/Show/index.js +20 -0
- package/dist/cjs/index.js +123 -112
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/store/modal.js +3 -0
- package/dist/cjs/styles/token/color.js +24 -0
- package/dist/cjs/utils/constants.js +11 -0
- package/dist/components.css +2098 -1744
- package/dist/esm/UIKitProvider/index.js +3 -4
- package/dist/esm/antd.js +3 -3
- package/dist/esm/core/Alert/index.js +10 -4
- package/dist/esm/core/BitPerSecond/index.js +3 -3
- package/dist/esm/core/KitStoreProvider/index.js +10 -1
- package/dist/esm/core/Modal/index.js +53 -42
- package/dist/esm/core/ModalStack/index.js +7 -1
- package/dist/esm/core/Progress/progress.widgets.js +1 -4
- package/dist/esm/core/SearchInput/index.js +21 -11
- package/dist/esm/core/TableForm/TableFormBodyCell.js +2 -1
- package/dist/esm/core/TableForm/TableFormHeaderCell.js +4 -2
- package/dist/esm/core/Timeline/Timeline.style.js +7 -0
- package/dist/esm/core/Timeline/Timeline.widget.js +107 -0
- package/dist/esm/core/Timeline/index.js +115 -0
- package/dist/esm/core/message/index.js +7 -3
- package/dist/esm/core/message-group/index.js +3 -1
- package/dist/esm/coreX/CheckPointList/checkpointlist.style.js +5 -0
- package/dist/esm/coreX/CheckPointList/index.js +83 -0
- package/dist/esm/coreX/DateRangePicker/common.js +7 -5
- package/dist/esm/coreX/DateRangePicker/index.js +10 -5
- package/dist/esm/coreX/InfoRowList/InfoRow.js +25 -0
- package/dist/esm/coreX/InfoRowList/InfoRowList.js +54 -0
- package/dist/esm/coreX/Show/index.js +14 -0
- package/dist/esm/index.js +9 -5
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/store/modal.js +3 -0
- package/dist/esm/styles/token/color.js +24 -0
- package/dist/esm/utils/constants.js +7 -1
- package/dist/src/UIKitProvider/index.d.ts +4 -4
- package/dist/src/antd.d.ts +2 -2
- package/dist/src/core/Alert/alert.type.d.ts +5 -4
- package/dist/src/core/BitPerSecond/index.d.ts +2 -2
- package/dist/src/core/KitStoreProvider/index.d.ts +1 -0
- package/dist/src/core/Legend/__test__/h5_css.test.d.ts +1 -0
- package/dist/src/core/Legend/index.d.ts +9 -0
- package/dist/src/core/Legend/legend.type.d.ts +25 -0
- package/dist/src/core/Modal/modal.type.d.ts +25 -2
- package/dist/src/core/SearchInput/searchInput.type.d.ts +33 -0
- package/dist/src/core/TableForm/types.d.ts +1 -0
- package/dist/src/core/Timeline/Timeline.style.d.ts +5 -0
- package/dist/src/core/Timeline/Timeline.type.d.ts +209 -0
- package/dist/src/core/Timeline/Timeline.widget.d.ts +5 -0
- package/dist/src/core/Timeline/index.d.ts +10 -0
- package/dist/src/core/index.d.ts +1 -0
- package/dist/src/core/message/index.d.ts +1 -0
- package/dist/src/coreX/CheckPointList/checkpointlist.style.d.ts +3 -0
- package/dist/src/coreX/CheckPointList/checkpointlist.type.d.ts +93 -0
- package/dist/src/coreX/CheckPointList/index.d.ts +8 -0
- package/dist/src/coreX/DateRangePicker/dateRangePicker.type.d.ts +6 -1
- package/dist/src/coreX/InfoRowList/InfoRow.d.ts +7 -0
- package/dist/src/coreX/InfoRowList/InfoRowList.d.ts +3 -0
- package/dist/src/coreX/InfoRowList/InfoRowList.type.d.ts +63 -0
- package/dist/src/coreX/InfoRowList/index.d.ts +1 -0
- package/dist/src/coreX/Show/index.d.ts +3 -0
- package/dist/src/coreX/Show/show.type.d.ts +13 -0
- package/dist/src/coreX/index.d.ts +5 -2
- package/dist/src/store/modal.d.ts +8 -2
- package/dist/src/styles/token/color.d.ts +24 -0
- package/dist/src/utils/constants.d.ts +2 -0
- package/dist/stories/docs/core/Button.stories.d.ts +11 -0
- package/dist/stories/docs/core/KitStoreProvider.stories.d.ts +1 -1
- package/dist/stories/docs/core/Legend.stories.d.ts +19 -0
- package/dist/stories/docs/core/Modal.stories.d.ts +4 -0
- package/dist/stories/docs/core/SearchInput.stories.d.ts +20 -20
- package/dist/stories/docs/core/Select.stories.d.ts +94 -13
- package/dist/stories/docs/core/StatusCapsule.stories.d.ts +8 -0
- package/dist/stories/docs/core/Timeline.stories.d.ts +38 -0
- package/dist/stories/docs/core/message-group.stories.d.ts +4 -0
- package/dist/stories/docs/coreX/CheckPointList.stories.d.ts +67 -0
- package/dist/stories/docs/coreX/DateRangePicker.stories.d.ts +1 -0
- package/dist/stories/docs/coreX/I18nNameTag.stories.d.ts +8 -0
- package/dist/stories/docs/coreX/InfoRowList.stories.d.ts +36 -0
- package/dist/stories/docs/coreX/Show.stories.d.ts +31 -0
- package/dist/style.css +1592 -1271
- package/dist/token.css +20 -26
- package/dist/variables.scss +21 -0
- package/package.json +7 -7
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { parrotI18n } from '@cloudtower/parrot';
|
|
2
2
|
import _message from '../core/message/index.js';
|
|
3
3
|
import { antdKit } from '../legacy-antd.js';
|
|
4
|
+
import { omit } from 'lodash';
|
|
4
5
|
import React__default, { createContext, useMemo, useEffect, useContext } from 'react';
|
|
5
6
|
import { ConfigProvider } from '../core/ConfigProvider/index.js';
|
|
6
7
|
import { createBatchMessageMethods } from '../core/message-group/index.js';
|
|
@@ -39,10 +40,8 @@ const UIKitProvider = (props) => {
|
|
|
39
40
|
});
|
|
40
41
|
}, [batchMessage, kit]);
|
|
41
42
|
useEffect(() => {
|
|
42
|
-
_message.config(
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
}, [message == null ? void 0 : message.maxCount]);
|
|
43
|
+
_message.config(omit(message, "batch"));
|
|
44
|
+
}, [message]);
|
|
46
45
|
useEffect(() => {
|
|
47
46
|
if (parrotI18n.language !== lng) {
|
|
48
47
|
parrotI18n.changeLanguage(lng);
|
package/dist/esm/antd.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { DatePicker, List, Menu, Skeleton, Tabs, Timeline, Typography, Upload, Select, Modal } from 'antd';
|
|
2
|
-
export { Badge as AntdBadge, Button as AntdButton, Checkbox as AntdCheckbox, Collapse as AntdCollapse, Divider as AntdDivider, Drawer as AntdDrawer, Empty as AntdEmpty, Input as AntdInput, message as AntdMessage, Select as AntdSelect, Skeleton as AntdSkeleton, Steps as AntdSteps, Switch as AntdSwitch, Table as AntdTable, TimePicker as AntdTimePicker, Tooltip as AntdTooltip, TreeSelect as AntdTreeSelect, AutoComplete, Col, DatePicker, Dropdown, Layout, List, Menu, Popover, Row, Tabs,
|
|
2
|
+
export { Badge as AntdBadge, Button as AntdButton, Checkbox as AntdCheckbox, Collapse as AntdCollapse, Divider as AntdDivider, Drawer as AntdDrawer, Empty as AntdEmpty, Input as AntdInput, message as AntdMessage, Select as AntdSelect, Skeleton as AntdSkeleton, Steps as AntdSteps, Switch as AntdSwitch, Table as AntdTable, TimePicker as AntdTimePicker, Timeline as AntdTimeline, Tooltip as AntdTooltip, TreeSelect as AntdTreeSelect, AutoComplete, Col, DatePicker, Dropdown, Layout, List, Menu, Popover, Row, Tabs, Tree, Typography, Upload } from 'antd';
|
|
3
3
|
|
|
4
4
|
const DatePickerRangePicker = DatePicker.RangePicker;
|
|
5
5
|
const ListItem = List.Item;
|
|
6
6
|
const MenuItemGroup = Menu.ItemGroup;
|
|
7
7
|
const SkeletonButton = Skeleton.Button;
|
|
8
8
|
const TabsTabPane = Tabs.TabPane;
|
|
9
|
-
const
|
|
9
|
+
const AntdTimelineItem = Timeline.Item;
|
|
10
10
|
const TypographyText = Typography.Text;
|
|
11
11
|
const UploadDragger = Upload.Dragger;
|
|
12
12
|
const AntdOption = Select.Option;
|
|
13
13
|
const AntdSelectOptGroup = Select.OptGroup;
|
|
14
14
|
const AntdModal = Modal;
|
|
15
15
|
|
|
16
|
-
export { AntdModal, AntdOption, AntdSelectOptGroup, DatePickerRangePicker, ListItem, MenuItemGroup, SkeletonButton, TabsTabPane,
|
|
16
|
+
export { AntdModal, AntdOption, AntdSelectOptGroup, AntdTimelineItem, DatePickerRangePicker, ListItem, MenuItemGroup, SkeletonButton, TabsTabPane, TypographyText, UploadDragger };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { XmarkRemove16RegularTertiaryCapsOffIcon, XmarkRemove16RegularPrimaryCapsOffIcon } from '@cloudtower/icons-react';
|
|
1
2
|
import Icon from '../Icon/index.js';
|
|
2
3
|
import { Alert as Alert$2 } from 'antd';
|
|
3
4
|
import cs from 'classnames';
|
|
@@ -44,14 +45,16 @@ const Alert = _a => {
|
|
|
44
45
|
onClose,
|
|
45
46
|
closeText,
|
|
46
47
|
action,
|
|
47
|
-
message
|
|
48
|
+
message,
|
|
49
|
+
closable
|
|
48
50
|
} = _b,
|
|
49
|
-
props = __objRest(_b, ["type", "icon", "showIcon", "className", "onClose", "closeText", "action", "message"]);
|
|
51
|
+
props = __objRest(_b, ["type", "icon", "showIcon", "className", "onClose", "closeText", "action", "message", "closable"]);
|
|
50
52
|
const _icon = /* @__PURE__ */React__default.createElement(Icon, {
|
|
51
53
|
alt: type,
|
|
52
54
|
src: getAlertIcon(type)
|
|
53
55
|
});
|
|
54
56
|
const _type = type === "normal" ? "info" : type;
|
|
57
|
+
const _closable = closable || Boolean(onClose) || Boolean(closeText);
|
|
55
58
|
return /* @__PURE__ */React__default.createElement(Alert$2, __spreadProps(__spreadValues({}, props), {
|
|
56
59
|
className: cs(AlertStyle, type ? `alert-${type}` : "", className, {
|
|
57
60
|
action
|
|
@@ -69,8 +72,11 @@ const Alert = _a => {
|
|
|
69
72
|
icon: icon || _icon,
|
|
70
73
|
showIcon,
|
|
71
74
|
onClose,
|
|
72
|
-
closeText,
|
|
73
|
-
|
|
75
|
+
closeText: closeText || _closable && /* @__PURE__ */React__default.createElement(Icon, {
|
|
76
|
+
src: XmarkRemove16RegularTertiaryCapsOffIcon,
|
|
77
|
+
hoverSrc: XmarkRemove16RegularPrimaryCapsOffIcon
|
|
78
|
+
}),
|
|
79
|
+
closable: _closable
|
|
74
80
|
}));
|
|
75
81
|
};
|
|
76
82
|
var Alert$1 = Alert;
|
|
@@ -21,7 +21,7 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
}
|
|
22
22
|
return a;
|
|
23
23
|
};
|
|
24
|
-
const
|
|
24
|
+
const BitPerSecond = ({
|
|
25
25
|
rawValue,
|
|
26
26
|
decimals,
|
|
27
27
|
valueClassName,
|
|
@@ -34,6 +34,6 @@ const BitPerSeconds = ({
|
|
|
34
34
|
const { value, unit } = formatBitPerSecond(rawValue, decimals);
|
|
35
35
|
return /* @__PURE__ */ React__default.createElement("span", null, /* @__PURE__ */ React__default.createElement("span", { className: cx("value", valueClassName) }, value), /* @__PURE__ */ React__default.createElement("span", { className: cx("unit", UnitStyle, unitClassName) }, ` ${unit}`));
|
|
36
36
|
};
|
|
37
|
-
var BitPerSecond =
|
|
37
|
+
var BitPerSecond$1 = BitPerSecond;
|
|
38
38
|
|
|
39
|
-
export { BitPerSecond as default };
|
|
39
|
+
export { BitPerSecond$1 as default };
|
|
@@ -51,5 +51,14 @@ const usePopModal = () => {
|
|
|
51
51
|
}, [dispatch]);
|
|
52
52
|
return popModal;
|
|
53
53
|
};
|
|
54
|
+
const useResetModal = () => {
|
|
55
|
+
const dispatch = useKitDispatch();
|
|
56
|
+
const resetModal = useCallback(() => {
|
|
57
|
+
dispatch({
|
|
58
|
+
type: ModalActions.RESET_MODAL
|
|
59
|
+
});
|
|
60
|
+
}, [dispatch]);
|
|
61
|
+
return resetModal;
|
|
62
|
+
};
|
|
54
63
|
|
|
55
|
-
export { KitStoreProvider$1 as default, useCloseModal, useKitDispatch, useKitSelector, usePopModal, usePushModal };
|
|
64
|
+
export { KitStoreProvider$1 as default, useCloseModal, useKitDispatch, useKitSelector, usePopModal, usePushModal, useResetModal };
|
|
@@ -62,7 +62,8 @@ const Modal = (props) => {
|
|
|
62
62
|
showCancel = true,
|
|
63
63
|
showOk = true,
|
|
64
64
|
afterClose,
|
|
65
|
-
closeIcon
|
|
65
|
+
closeIcon,
|
|
66
|
+
hideFooterButtonBorder = true
|
|
66
67
|
} = _a, restProps = __objRest(_a, [
|
|
67
68
|
"error",
|
|
68
69
|
"okText",
|
|
@@ -82,7 +83,8 @@ const Modal = (props) => {
|
|
|
82
83
|
"showCancel",
|
|
83
84
|
"showOk",
|
|
84
85
|
"afterClose",
|
|
85
|
-
"closeIcon"
|
|
86
|
+
"closeIcon",
|
|
87
|
+
"hideFooterButtonBorder"
|
|
86
88
|
]);
|
|
87
89
|
const stack = useKitSelector(
|
|
88
90
|
(state) => state.modal.stack
|
|
@@ -142,50 +144,59 @@ const Modal = (props) => {
|
|
|
142
144
|
dispatch({ type: ModalActions.REMOVE_MODAL, id: idRef.current });
|
|
143
145
|
},
|
|
144
146
|
visible: idRef.current !== id,
|
|
145
|
-
footer: /* @__PURE__ */ React__default.createElement(
|
|
146
|
-
"
|
|
147
|
+
footer: /* @__PURE__ */ React__default.createElement(
|
|
148
|
+
"div",
|
|
147
149
|
{
|
|
148
|
-
className:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
(_c = (_b2 = wizard.steps[wizard.step]).onPrev) == null ? void 0 : _c.call(_b2);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
(_d = wizard.onStepChange) == null ? void 0 : _d.call(wizard, wizard.step - 1);
|
|
156
|
-
}
|
|
150
|
+
className: cs(
|
|
151
|
+
"footer-content",
|
|
152
|
+
hideFooterButtonBorder && "no-button-border"
|
|
153
|
+
)
|
|
157
154
|
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
},
|
|
170
|
-
className: cs(cancelButtonProps == null ? void 0 : cancelButtonProps.className)
|
|
171
|
-
}, cancelButtonProps),
|
|
172
|
-
cancelText
|
|
173
|
-
), showOk && /* @__PURE__ */ React__default.createElement(
|
|
174
|
-
Button,
|
|
175
|
-
__spreadValues({
|
|
176
|
-
onClick: (e) => {
|
|
177
|
-
var _a2, _b2;
|
|
178
|
-
onOk == null ? void 0 : onOk(e);
|
|
179
|
-
if (typeof wizard === "object" && wizard.steps[wizard.step]) {
|
|
180
|
-
(_b2 = (_a2 = wizard.steps[wizard.step]).onOk) == null ? void 0 : _b2.call(_a2, e);
|
|
155
|
+
footer === void 0 ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "modal-footer-left" }, wizard && typeof wizard === "object" && !wizard.disablePrevStep && wizard.step !== 0 && /* @__PURE__ */ React__default.createElement(
|
|
156
|
+
"span",
|
|
157
|
+
{
|
|
158
|
+
className: "prev-step",
|
|
159
|
+
onClick: () => {
|
|
160
|
+
var _a2, _b2, _c, _d;
|
|
161
|
+
if (typeof wizard === "object" && ((_a2 = wizard.steps[wizard.step]) == null ? void 0 : _a2.onPrev)) {
|
|
162
|
+
(_c = (_b2 = wizard.steps[wizard.step]).onPrev) == null ? void 0 : _c.call(_b2);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
(_d = wizard.onStepChange) == null ? void 0 : _d.call(wizard, wizard.step - 1);
|
|
181
166
|
}
|
|
182
|
-
transitionClass.current = fullscreen ? "" : "modal-send";
|
|
183
167
|
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
168
|
+
prevText
|
|
169
|
+
), error && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("span", { className: "modal-error" }, error))), /* @__PURE__ */ React__default.createElement("div", { className: "modal-footer-btn-group" }, showCancel && /* @__PURE__ */ React__default.createElement(
|
|
170
|
+
Button,
|
|
171
|
+
__spreadValues({
|
|
172
|
+
type: "quiet",
|
|
173
|
+
onMouseDown: (e) => {
|
|
174
|
+
e.preventDefault();
|
|
175
|
+
},
|
|
176
|
+
onClick: (e) => {
|
|
177
|
+
onCancel == null ? void 0 : onCancel(e);
|
|
178
|
+
transitionClass.current = fullscreen ? "" : "modal-zoom";
|
|
179
|
+
},
|
|
180
|
+
className: cs(cancelButtonProps == null ? void 0 : cancelButtonProps.className)
|
|
181
|
+
}, cancelButtonProps),
|
|
182
|
+
cancelText
|
|
183
|
+
), showOk && /* @__PURE__ */ React__default.createElement(
|
|
184
|
+
Button,
|
|
185
|
+
__spreadValues({
|
|
186
|
+
onClick: (e) => {
|
|
187
|
+
var _a2, _b2;
|
|
188
|
+
onOk == null ? void 0 : onOk(e);
|
|
189
|
+
if (typeof wizard === "object" && wizard.steps[wizard.step]) {
|
|
190
|
+
(_b2 = (_a2 = wizard.steps[wizard.step]).onOk) == null ? void 0 : _b2.call(_a2, e);
|
|
191
|
+
}
|
|
192
|
+
transitionClass.current = fullscreen ? "" : "modal-send";
|
|
193
|
+
},
|
|
194
|
+
type: "primary",
|
|
195
|
+
loading: confirmLoading
|
|
196
|
+
}, okButtonProps),
|
|
197
|
+
confirmText
|
|
198
|
+
))) : footer
|
|
199
|
+
)
|
|
189
200
|
}),
|
|
190
201
|
wizard && typeof wizard === "object" ? /* @__PURE__ */ React__default.createElement(WizardBody, null, /* @__PURE__ */ React__default.createElement("div", { className: "left" }, wizard.hideLeft ? null : /* @__PURE__ */ React__default.createElement(
|
|
191
202
|
Steps,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useKitSelector, useCloseModal } from '../KitStoreProvider/index.js';
|
|
1
|
+
import { useKitSelector, useCloseModal, useResetModal } from '../KitStoreProvider/index.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -25,6 +25,7 @@ const ModalStack = () => {
|
|
|
25
25
|
(state) => state.modal.stack
|
|
26
26
|
);
|
|
27
27
|
const closeModal = useCloseModal();
|
|
28
|
+
const resetModal = useResetModal();
|
|
28
29
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, stack.map((modal) => /* @__PURE__ */ React__default.createElement(
|
|
29
30
|
modal.component,
|
|
30
31
|
__spreadProps(__spreadValues({}, modal.props), {
|
|
@@ -36,6 +37,11 @@ const ModalStack = () => {
|
|
|
36
37
|
}
|
|
37
38
|
closeModal(modal.id);
|
|
38
39
|
},
|
|
40
|
+
closeAllModal: () => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
(_b = (_a = modal.props).closeAllModal) == null ? void 0 : _b.call(_a);
|
|
43
|
+
resetModal();
|
|
44
|
+
},
|
|
39
45
|
key: modal.id
|
|
40
46
|
})
|
|
41
47
|
)));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DotIntervalSeparation16TertiaryIcon } from '@cloudtower/icons-react';
|
|
2
1
|
import { styled } from '@linaria/react';
|
|
3
2
|
import Link from '../Link/index.js';
|
|
3
|
+
import { splitMap } from '../../utils/constants.js';
|
|
4
4
|
import { IconField, Info } from './components.js';
|
|
5
5
|
import Tag from '../Tag/index.js';
|
|
6
6
|
import React__default from 'react';
|
|
@@ -33,9 +33,6 @@ var __objRest = (source, exclude) => {
|
|
|
33
33
|
}
|
|
34
34
|
return target;
|
|
35
35
|
};
|
|
36
|
-
const splitMap = {
|
|
37
|
-
dot: /* @__PURE__ */React__default.createElement(DotIntervalSeparation16TertiaryIcon, null)
|
|
38
|
-
};
|
|
39
36
|
const titleAreaStyle = "E_t1gvlxt5";
|
|
40
37
|
const _exp = /*#__PURE__*/() => props => props.gap;
|
|
41
38
|
const AreaWrapper = /*#__PURE__*/styled('div')({
|
|
@@ -48,9 +48,17 @@ const SearchInput = props => {
|
|
|
48
48
|
debounceWait = 300,
|
|
49
49
|
total = 0,
|
|
50
50
|
onSearchNext,
|
|
51
|
-
onSearchPrev
|
|
51
|
+
onSearchPrev,
|
|
52
|
+
prefixHoverIcon,
|
|
53
|
+
nextHoverIcon,
|
|
54
|
+
clearHoverIcon,
|
|
55
|
+
prefixIcon,
|
|
56
|
+
nextIcon,
|
|
57
|
+
clearIcon,
|
|
58
|
+
width,
|
|
59
|
+
searchIcon
|
|
52
60
|
} = _a,
|
|
53
|
-
restProps = __objRest(_a, ["onChange", "debounceWait", "total", "onSearchNext", "onSearchPrev"]);
|
|
61
|
+
restProps = __objRest(_a, ["onChange", "debounceWait", "total", "onSearchNext", "onSearchPrev", "prefixHoverIcon", "nextHoverIcon", "clearHoverIcon", "prefixIcon", "nextIcon", "clearIcon", "width", "searchIcon"]);
|
|
54
62
|
const [current, setCurrent] = useState(0);
|
|
55
63
|
const [value, setValue] = useState(props.value || "");
|
|
56
64
|
const {
|
|
@@ -71,7 +79,7 @@ const SearchInput = props => {
|
|
|
71
79
|
}
|
|
72
80
|
}, [onSearchPrev, current, total, value]);
|
|
73
81
|
const suffix = onSearchNext && onSearchPrev && value ? /* @__PURE__ */React__default.createElement(React__default.Fragment, null, typeof total === "number" ? /* @__PURE__ */React__default.createElement("span", {
|
|
74
|
-
className: cx(Typo.Label.l4_regular, CountTextStyle)
|
|
82
|
+
className: cx(Typo.Label.l4_regular, "counter-text", CountTextStyle)
|
|
75
83
|
}, current, "/", total) : null, /* @__PURE__ */React__default.createElement("span", {
|
|
76
84
|
className: IconContainerStyle
|
|
77
85
|
}, isNoMatch ? /* @__PURE__ */React__default.createElement(Icon, {
|
|
@@ -83,8 +91,8 @@ const SearchInput = props => {
|
|
|
83
91
|
}) : /* @__PURE__ */React__default.createElement(Tooltip, {
|
|
84
92
|
title: t("components.prev")
|
|
85
93
|
}, /* @__PURE__ */React__default.createElement(Icon, {
|
|
86
|
-
src: ArrowChevronUp16SecondaryIcon,
|
|
87
|
-
hoverSrc: ArrowChevronUp16BlueIcon,
|
|
94
|
+
src: prefixIcon != null ? prefixIcon : ArrowChevronUp16SecondaryIcon,
|
|
95
|
+
hoverSrc: prefixHoverIcon != null ? prefixHoverIcon : ArrowChevronUp16BlueIcon,
|
|
88
96
|
onClick: prev
|
|
89
97
|
})), isNoMatch ? /* @__PURE__ */React__default.createElement(Icon, {
|
|
90
98
|
className: DisabledIconStyle,
|
|
@@ -95,14 +103,14 @@ const SearchInput = props => {
|
|
|
95
103
|
}) : /* @__PURE__ */React__default.createElement(Tooltip, {
|
|
96
104
|
title: t("components.next")
|
|
97
105
|
}, /* @__PURE__ */React__default.createElement(Icon, {
|
|
98
|
-
src: ArrowChevronDown16SecondaryIcon,
|
|
99
|
-
hoverSrc: ArrowChevronDown16BlueIcon,
|
|
106
|
+
src: nextIcon != null ? nextIcon : ArrowChevronDown16SecondaryIcon,
|
|
107
|
+
hoverSrc: nextHoverIcon != null ? nextHoverIcon : ArrowChevronDown16BlueIcon,
|
|
100
108
|
onClick: next
|
|
101
109
|
})), /* @__PURE__ */React__default.createElement(Tooltip, {
|
|
102
110
|
title: t("components.clear")
|
|
103
111
|
}, /* @__PURE__ */React__default.createElement(Icon, {
|
|
104
|
-
src: XmarkCloseCircleFill16TertiaryIcon,
|
|
105
|
-
hoverSrc: XmarkCloseCircleFill16SecondaryIcon,
|
|
112
|
+
src: clearIcon != null ? clearIcon : XmarkCloseCircleFill16TertiaryIcon,
|
|
113
|
+
hoverSrc: clearHoverIcon != null ? clearHoverIcon : XmarkCloseCircleFill16SecondaryIcon,
|
|
106
114
|
onClick: () => {
|
|
107
115
|
onSearch("");
|
|
108
116
|
setValue("");
|
|
@@ -116,9 +124,11 @@ const SearchInput = props => {
|
|
|
116
124
|
}, [value, total]);
|
|
117
125
|
return /* @__PURE__ */React__default.createElement(Input, __spreadProps(__spreadValues({
|
|
118
126
|
style: {
|
|
119
|
-
width: 276
|
|
127
|
+
width: width != null ? width : 276
|
|
120
128
|
},
|
|
121
|
-
prefix: /* @__PURE__ */React__default.createElement(
|
|
129
|
+
prefix: searchIcon ? /* @__PURE__ */React__default.createElement(Icon, {
|
|
130
|
+
src: searchIcon
|
|
131
|
+
}) : /* @__PURE__ */React__default.createElement(SearchOutlined, null),
|
|
122
132
|
suffix,
|
|
123
133
|
onChange: e => {
|
|
124
134
|
const newValue = e.target.value;
|
|
@@ -71,7 +71,8 @@ const BatchInputListHeaderCell = (props) => {
|
|
|
71
71
|
isHeader: true,
|
|
72
72
|
disabled,
|
|
73
73
|
onChange: headerOnChange,
|
|
74
|
-
onBlur: headerOnBlur
|
|
74
|
+
onBlur: headerOnBlur,
|
|
75
|
+
formValue: data
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
78
|
if (disableBatchFilling) {
|
|
@@ -89,7 +90,8 @@ const BatchInputListHeaderCell = (props) => {
|
|
|
89
90
|
isHeader: true,
|
|
90
91
|
disabled,
|
|
91
92
|
onChange: headerOnChange,
|
|
92
|
-
onBlur: headerOnBlur
|
|
93
|
+
onBlur: headerOnBlur,
|
|
94
|
+
formValue: data
|
|
93
95
|
}) : renderDefaultComponent()
|
|
94
96
|
);
|
|
95
97
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const TimelineWrapper = "E_t59qhqp";
|
|
2
|
+
const TimelineItemWrapper = "E_t2e44lg";
|
|
3
|
+
const EmptyWrapper = "E_e14ua30y";
|
|
4
|
+
const SubInfoTextWrapper = "E_s1ikqzph";
|
|
5
|
+
const InfoTextWrapper = "E_i15astnl";
|
|
6
|
+
|
|
7
|
+
export { EmptyWrapper, InfoTextWrapper, SubInfoTextWrapper, TimelineItemWrapper, TimelineWrapper };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { cx } from '@linaria/core';
|
|
3
|
+
import { splitMap } from '../../utils/constants.js';
|
|
4
|
+
import Link from '../Link/index.js';
|
|
5
|
+
import { Typo } from '../Typo/index.js';
|
|
6
|
+
import OverflowTooltip from '../../coreX/OverflowTooltip/index.js';
|
|
7
|
+
import Tag from '../Tag/index.js';
|
|
8
|
+
import { Flex } from 'antd5';
|
|
9
|
+
import cs from 'classnames';
|
|
10
|
+
import { InfoTextWrapper, SubInfoTextWrapper } from './Timeline.style.js';
|
|
11
|
+
import { Show } from '../../coreX/Show/index.js';
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
17
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
+
var __spreadValues = (a, b) => {
|
|
19
|
+
for (var prop in b || (b = {}))
|
|
20
|
+
if (__hasOwnProp.call(b, prop))
|
|
21
|
+
__defNormalProp(a, prop, b[prop]);
|
|
22
|
+
if (__getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
24
|
+
if (__propIsEnum.call(b, prop))
|
|
25
|
+
__defNormalProp(a, prop, b[prop]);
|
|
26
|
+
}
|
|
27
|
+
return a;
|
|
28
|
+
};
|
|
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
|
+
const TimelineBasicText = ({
|
|
42
|
+
children,
|
|
43
|
+
className,
|
|
44
|
+
multiLines
|
|
45
|
+
}) => {
|
|
46
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
47
|
+
OverflowTooltip,
|
|
48
|
+
{
|
|
49
|
+
className,
|
|
50
|
+
multiLines: multiLines != null ? multiLines : 2,
|
|
51
|
+
content: children
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
const TimelineArea = ({ items, gap = 1, split, suffix, className, compact }) => {
|
|
56
|
+
const splitNode = typeof split === "string" ? splitMap[split] || split : split;
|
|
57
|
+
const rendetItem = (category, props, compact2) => {
|
|
58
|
+
const _a = props, { className: className2 } = _a, restProps = __objRest(_a, ["className"]);
|
|
59
|
+
switch (category) {
|
|
60
|
+
case "subinfo_label":
|
|
61
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
62
|
+
TimelineBasicText,
|
|
63
|
+
__spreadValues({
|
|
64
|
+
className: cx(SubInfoTextWrapper, Typo.Label.l4_regular, className2)
|
|
65
|
+
}, restProps)
|
|
66
|
+
);
|
|
67
|
+
case "info":
|
|
68
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
69
|
+
TimelineBasicText,
|
|
70
|
+
__spreadValues({
|
|
71
|
+
className: cs(
|
|
72
|
+
InfoTextWrapper,
|
|
73
|
+
{
|
|
74
|
+
[Typo.Label.l4_regular]: compact2,
|
|
75
|
+
[Typo.Label.l2_regular]: !compact2
|
|
76
|
+
},
|
|
77
|
+
className2
|
|
78
|
+
)
|
|
79
|
+
}, restProps)
|
|
80
|
+
);
|
|
81
|
+
case "info_bold":
|
|
82
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
83
|
+
TimelineBasicText,
|
|
84
|
+
__spreadValues({
|
|
85
|
+
className: cs(
|
|
86
|
+
InfoTextWrapper,
|
|
87
|
+
{
|
|
88
|
+
[Typo.Label.l4_bold]: compact2,
|
|
89
|
+
[Typo.Label.l2_bold]: !compact2
|
|
90
|
+
},
|
|
91
|
+
className2
|
|
92
|
+
)
|
|
93
|
+
}, restProps)
|
|
94
|
+
);
|
|
95
|
+
case "link":
|
|
96
|
+
return /* @__PURE__ */ React__default.createElement(Link, __spreadValues({}, props));
|
|
97
|
+
case "tag":
|
|
98
|
+
return /* @__PURE__ */ React__default.createElement(Tag, __spreadValues({}, props));
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
return /* @__PURE__ */ React__default.createElement(Flex, { justify: "space-between", align: "center", className }, /* @__PURE__ */ React__default.createElement(Flex, { align: "center", gap }, items.map((item, idx) => {
|
|
102
|
+
const { category } = item;
|
|
103
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: idx }, rendetItem(category, item, compact), /* @__PURE__ */ React__default.createElement(Show, { condition: Boolean(split) }, /* @__PURE__ */ React__default.createElement(Show, { condition: idx < items.length - 1 }, splitNode)));
|
|
104
|
+
})), /* @__PURE__ */ React__default.createElement(Show, { condition: Boolean(suffix) }, /* @__PURE__ */ React__default.createElement(Show, { condition: Boolean(split) }, splitNode), suffix));
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export { TimelineArea };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { CheckmarkDoneSuccessCorrect16GreenIcon, XmarkFailed16RedIcon, Loading16GradientBlueIcon, NoticeTriangleFill16YellowIcon, WaitingBreathingLed16YellowIcon, TimelineNotStart16GrayIcon } from '@cloudtower/icons-react';
|
|
2
|
+
import { cx } from '@linaria/core';
|
|
3
|
+
import { Timeline as Timeline$1, Flex } from 'antd5';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
import { EmptyWrapper, TimelineWrapper, TimelineItemWrapper } from './Timeline.style.js';
|
|
6
|
+
import Alert from '../Alert/index.js';
|
|
7
|
+
import Icon from '../Icon/index.js';
|
|
8
|
+
import cs from 'classnames';
|
|
9
|
+
import { TimelineArea } from './Timeline.widget.js';
|
|
10
|
+
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __defProps = Object.defineProperties;
|
|
13
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
14
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
17
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
+
var __spreadValues = (a, b) => {
|
|
19
|
+
for (var prop in b || (b = {}))
|
|
20
|
+
if (__hasOwnProp.call(b, prop))
|
|
21
|
+
__defNormalProp(a, prop, b[prop]);
|
|
22
|
+
if (__getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
24
|
+
if (__propIsEnum.call(b, prop))
|
|
25
|
+
__defNormalProp(a, prop, b[prop]);
|
|
26
|
+
}
|
|
27
|
+
return a;
|
|
28
|
+
};
|
|
29
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
30
|
+
const Timeline = ({
|
|
31
|
+
items,
|
|
32
|
+
emptyText,
|
|
33
|
+
emptyRender,
|
|
34
|
+
compact,
|
|
35
|
+
emptyTextClassName
|
|
36
|
+
}) => {
|
|
37
|
+
if (!items.length) {
|
|
38
|
+
if (emptyRender) {
|
|
39
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, emptyRender(emptyText));
|
|
40
|
+
}
|
|
41
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: cx(EmptyWrapper, emptyTextClassName) }, emptyText);
|
|
42
|
+
}
|
|
43
|
+
const iconMap = {
|
|
44
|
+
success: CheckmarkDoneSuccessCorrect16GreenIcon,
|
|
45
|
+
failed: XmarkFailed16RedIcon,
|
|
46
|
+
progress: Loading16GradientBlueIcon,
|
|
47
|
+
notice: NoticeTriangleFill16YellowIcon,
|
|
48
|
+
pending: WaitingBreathingLed16YellowIcon,
|
|
49
|
+
idle: TimelineNotStart16GrayIcon
|
|
50
|
+
};
|
|
51
|
+
const alertTypeMap = {
|
|
52
|
+
success: "success",
|
|
53
|
+
failed: "error",
|
|
54
|
+
progress: "info",
|
|
55
|
+
notice: "warning",
|
|
56
|
+
pending: "info",
|
|
57
|
+
idle: "normal"
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: cx(TimelineWrapper) }, /* @__PURE__ */ React__default.createElement(Timeline$1, null, items.map((item, index) => {
|
|
60
|
+
const {
|
|
61
|
+
status,
|
|
62
|
+
infos,
|
|
63
|
+
infosRender,
|
|
64
|
+
infoAction,
|
|
65
|
+
subInfo,
|
|
66
|
+
subInfoRender,
|
|
67
|
+
detailMessage,
|
|
68
|
+
detailMessageRender
|
|
69
|
+
} = item;
|
|
70
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
71
|
+
Timeline$1.Item,
|
|
72
|
+
{
|
|
73
|
+
key: `timeline-item-${index}`,
|
|
74
|
+
className: cs(TimelineItemWrapper, { compact }),
|
|
75
|
+
dot: /* @__PURE__ */ React__default.createElement(
|
|
76
|
+
Icon,
|
|
77
|
+
{
|
|
78
|
+
src: iconMap[status],
|
|
79
|
+
iconHeight: 16,
|
|
80
|
+
iconWidth: 16,
|
|
81
|
+
isRotate: status === "progress"
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
},
|
|
85
|
+
infosRender ? infosRender(infos) : /* @__PURE__ */ React__default.createElement(
|
|
86
|
+
Flex,
|
|
87
|
+
{
|
|
88
|
+
vertical: true,
|
|
89
|
+
justify: "space-between",
|
|
90
|
+
gap: 2,
|
|
91
|
+
className: "info-wrapper"
|
|
92
|
+
},
|
|
93
|
+
infos.map((item2, index2) => /* @__PURE__ */ React__default.createElement(
|
|
94
|
+
TimelineArea,
|
|
95
|
+
__spreadProps(__spreadValues({
|
|
96
|
+
gap: 6,
|
|
97
|
+
key: `title-area-${index2}`
|
|
98
|
+
}, item2), {
|
|
99
|
+
compact,
|
|
100
|
+
suffix: !index2 && infoAction ? /* @__PURE__ */ React__default.createElement("span", { className: "info-action" }, infoAction) : void 0
|
|
101
|
+
})
|
|
102
|
+
))
|
|
103
|
+
),
|
|
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), detailMessageRender ? detailMessageRender(detailMessage) : detailMessage ? /* @__PURE__ */ React__default.createElement(
|
|
105
|
+
Alert,
|
|
106
|
+
__spreadValues({
|
|
107
|
+
showIcon: false,
|
|
108
|
+
type: alertTypeMap[status]
|
|
109
|
+
}, detailMessage)
|
|
110
|
+
) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null))
|
|
111
|
+
);
|
|
112
|
+
})));
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export { Timeline };
|
|
@@ -26,8 +26,9 @@ var __spreadValues = (a, b) => {
|
|
|
26
26
|
return a;
|
|
27
27
|
};
|
|
28
28
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
29
|
+
const DEFAULT_DURATION = 3;
|
|
29
30
|
let messageInstance;
|
|
30
|
-
let defaultDuration =
|
|
31
|
+
let defaultDuration = DEFAULT_DURATION;
|
|
31
32
|
let defaultTop;
|
|
32
33
|
let key = 1;
|
|
33
34
|
let localPrefixCls = "ant-message";
|
|
@@ -135,7 +136,10 @@ function notice(args) {
|
|
|
135
136
|
}
|
|
136
137
|
getRCNotificationInstance(args, ({ prefixCls, instance }) => {
|
|
137
138
|
instance.notice(
|
|
138
|
-
getRCNoticeProps(
|
|
139
|
+
getRCNoticeProps(
|
|
140
|
+
__spreadProps(__spreadValues({}, args), { key: target, onClose: callback }),
|
|
141
|
+
prefixCls
|
|
142
|
+
)
|
|
139
143
|
);
|
|
140
144
|
});
|
|
141
145
|
});
|
|
@@ -179,4 +183,4 @@ function attachTypeApi(originalApi, type) {
|
|
|
179
183
|
api.warn = api.warning;
|
|
180
184
|
var _message = api;
|
|
181
185
|
|
|
182
|
-
export { attachTypeApi, _message as default, getKeyThenIncreaseKey };
|
|
186
|
+
export { DEFAULT_DURATION, attachTypeApi, _message as default, getKeyThenIncreaseKey };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DEFAULT_DURATION } from '../message/index.js';
|
|
2
|
+
|
|
1
3
|
var __defProp = Object.defineProperty;
|
|
2
4
|
var __defProps = Object.defineProperties;
|
|
3
5
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -135,7 +137,7 @@ function normalizeContent(args, type) {
|
|
|
135
137
|
}
|
|
136
138
|
return {
|
|
137
139
|
content: c,
|
|
138
|
-
duration: typeof args[1] === "number" ? args[1] :
|
|
140
|
+
duration: typeof args[1] === "number" ? args[1] : DEFAULT_DURATION,
|
|
139
141
|
type: type === "warn" ? "warning" : type
|
|
140
142
|
};
|
|
141
143
|
}
|