@cloudtower/eagle 0.33.1 → 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/dist/cjs/antd.js +6 -6
- 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/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/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 +122 -112
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/store/modal.js +3 -0
- package/dist/cjs/utils/constants.js +11 -0
- package/dist/components.css +1800 -1552
- package/dist/esm/antd.js +3 -3
- 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/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/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 +8 -4
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/store/modal.js +3 -0
- package/dist/esm/utils/constants.js +7 -1
- 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/Modal/modal.type.d.ts +25 -2
- package/dist/src/core/SearchInput/searchInput.type.d.ts +33 -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/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/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/Modal.stories.d.ts +4 -0
- package/dist/stories/docs/core/Timeline.stories.d.ts +38 -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 +1294 -1075
- package/package.json +4 -4
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 };
|
|
@@ -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;
|
|
@@ -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 };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React__default, { useState, useCallback } from 'react';
|
|
2
|
+
import useParrotTranslation from '../../hooks/useParrotTranslation.js';
|
|
3
|
+
import { XmarkFailedSeriousWarningFill16RedIcon, CheckmarkDoneSuccessCircleFill16GreenIcon, Loading16GradientBlueIcon, NoticeTriangleFill16YellowIcon } from '@cloudtower/icons-react';
|
|
4
|
+
import { List } from 'antd5';
|
|
5
|
+
import { cx } from '@linaria/core';
|
|
6
|
+
import { CheckPointItemStyle, CheckPointListStyle, EmptyWrapper } from './checkpointlist.style.js';
|
|
7
|
+
import { Show } from '../Show/index.js';
|
|
8
|
+
import Icon from '../../core/Icon/index.js';
|
|
9
|
+
import { Typo } from '../../core/Typo/index.js';
|
|
10
|
+
import Tag from '../../core/Tag/index.js';
|
|
11
|
+
import Alert from '../../core/Alert/index.js';
|
|
12
|
+
import Switch from '../../core/Switch/index.js';
|
|
13
|
+
|
|
14
|
+
var __defProp = Object.defineProperty;
|
|
15
|
+
var __defProps = Object.defineProperties;
|
|
16
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
17
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
18
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
19
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
20
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
21
|
+
var __spreadValues = (a, b) => {
|
|
22
|
+
for (var prop in b || (b = {}))
|
|
23
|
+
if (__hasOwnProp.call(b, prop))
|
|
24
|
+
__defNormalProp(a, prop, b[prop]);
|
|
25
|
+
if (__getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
27
|
+
if (__propIsEnum.call(b, prop))
|
|
28
|
+
__defNormalProp(a, prop, b[prop]);
|
|
29
|
+
}
|
|
30
|
+
return a;
|
|
31
|
+
};
|
|
32
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
33
|
+
const CheckPointItem = ({
|
|
34
|
+
description,
|
|
35
|
+
status,
|
|
36
|
+
key,
|
|
37
|
+
tagProps,
|
|
38
|
+
alertProps
|
|
39
|
+
}) => {
|
|
40
|
+
const icon = {
|
|
41
|
+
failed: XmarkFailedSeriousWarningFill16RedIcon,
|
|
42
|
+
success: CheckmarkDoneSuccessCircleFill16GreenIcon,
|
|
43
|
+
loading: Loading16GradientBlueIcon,
|
|
44
|
+
warning: NoticeTriangleFill16YellowIcon
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(List.Item, { className: cx(CheckPointItemStyle), key }, /* @__PURE__ */ React__default.createElement(Show, { condition: Boolean(icon) }, /* @__PURE__ */ React__default.createElement(
|
|
47
|
+
Icon,
|
|
48
|
+
{
|
|
49
|
+
src: icon[status],
|
|
50
|
+
className: "icon-wrapper",
|
|
51
|
+
isRotate: status === "loading"
|
|
52
|
+
}
|
|
53
|
+
)), /* @__PURE__ */ React__default.createElement("span", { className: cx(Typo.Label.l4_regular, "description") }, description), /* @__PURE__ */ React__default.createElement(Show, { condition: Boolean(tagProps) }, /* @__PURE__ */ React__default.createElement(Tag, __spreadValues({}, tagProps)))), /* @__PURE__ */ React__default.createElement(Show, { condition: Boolean(alertProps) }, /* @__PURE__ */ React__default.createElement(Alert, __spreadValues({ showIcon: false }, alertProps))));
|
|
54
|
+
};
|
|
55
|
+
const CheckPointList = ({
|
|
56
|
+
items = [],
|
|
57
|
+
showSwitchControl = true,
|
|
58
|
+
title,
|
|
59
|
+
switchText,
|
|
60
|
+
emptyRender,
|
|
61
|
+
emptyText,
|
|
62
|
+
emptyTextClassName,
|
|
63
|
+
onClickSwitch
|
|
64
|
+
}) => {
|
|
65
|
+
const { t } = useParrotTranslation();
|
|
66
|
+
const [checked, setChecked] = useState(false);
|
|
67
|
+
const onClickSwitchFn = useCallback(() => {
|
|
68
|
+
const nextChecked = !checked;
|
|
69
|
+
setChecked(nextChecked);
|
|
70
|
+
onClickSwitch == null ? void 0 : onClickSwitch(checked);
|
|
71
|
+
}, [onClickSwitch, checked]);
|
|
72
|
+
const isEmpty = !items.length;
|
|
73
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: cx(CheckPointListStyle) }, /* @__PURE__ */ React__default.createElement("header", { className: cx(Typo.Label.l4_bold) }, title, /* @__PURE__ */ React__default.createElement(Show, { condition: showSwitchControl }, /* @__PURE__ */ React__default.createElement("span", { className: "switch-text" }, /* @__PURE__ */ React__default.createElement(Switch, { checked, onChange: onClickSwitchFn, size: "small" }), /* @__PURE__ */ React__default.createElement("span", null, switchText || t("common.show_unpassed"))))), /* @__PURE__ */ React__default.createElement(
|
|
74
|
+
Show,
|
|
75
|
+
{
|
|
76
|
+
condition: isEmpty,
|
|
77
|
+
fallback: /* @__PURE__ */ React__default.createElement(List, { split: false, bordered: false }, items.map((item, index) => /* @__PURE__ */ React__default.createElement(CheckPointItem, __spreadProps(__spreadValues({}, item), { key: `checklist-item-${index}` }))))
|
|
78
|
+
},
|
|
79
|
+
emptyRender ? emptyRender(emptyText) : /* @__PURE__ */ React__default.createElement("div", { className: cx(EmptyWrapper, emptyTextClassName) }, emptyText)
|
|
80
|
+
));
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export { CheckPointItem, CheckPointList };
|
|
@@ -139,12 +139,14 @@ function time2string(time) {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
function getDateText(date, t) {
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
const count = date.value;
|
|
143
|
+
const dateString = {
|
|
144
|
+
d: t("common.day_count", { count }),
|
|
145
|
+
h: t("common.hour_count", { count }),
|
|
146
|
+
m: t("common.minute_count", { count }),
|
|
147
|
+
M: t("common.month_measure_count", { count })
|
|
146
148
|
}[date.unit];
|
|
147
|
-
return `${t("components.past")} ${
|
|
149
|
+
return `${t("components.past")} ${dateString}`;
|
|
148
150
|
}
|
|
149
151
|
function checkDateNotInRange(date, minDate, maxDate) {
|
|
150
152
|
if (!minDate && !maxDate) {
|