@cloudtower/eagle 0.32.32 → 0.32.34
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/Progress/progress.widgets.js +2 -5
- 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/index.js +119 -117
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/utils/constants.js +11 -0
- package/dist/components.css +3481 -3425
- package/dist/esm/antd.js +3 -3
- package/dist/esm/core/Progress/progress.widgets.js +1 -4
- 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/index.js +3 -2
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/utils/constants.js +7 -1
- package/dist/src/antd.d.ts +2 -2
- 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/utils/constants.d.ts +2 -0
- package/dist/stories/docs/core/Timeline.stories.d.ts +38 -0
- package/dist/style.css +3141 -3091
- 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 };
|
|
@@ -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')({
|
|
@@ -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 };
|
package/dist/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { units as Units, units } from './core/index.js';
|
|
|
2
2
|
export { UIKitStore, closeModal, popModal, pushModal } from './store/index.js';
|
|
3
3
|
export { MessageContext, default as UIKitProvider, kitContext, useMessage, useUIKit } from './UIKitProvider/index.js';
|
|
4
4
|
export * from '@cloudtower/parrot';
|
|
5
|
-
export { AntdModal, AntdOption, AntdSelectOptGroup, DatePickerRangePicker, ListItem, MenuItemGroup, SkeletonButton, TabsTabPane,
|
|
5
|
+
export { AntdModal, AntdOption, AntdSelectOptGroup, AntdTimelineItem, DatePickerRangePicker, ListItem, MenuItemGroup, SkeletonButton, TabsTabPane, TypographyText, UploadDragger } from './antd.js';
|
|
6
6
|
export { antdKit, getAntdKit } from './legacy-antd.js';
|
|
7
7
|
export { default as useElementsSize } from './hooks/useElementsSize.js';
|
|
8
8
|
export { ModalActions } from './store/modal.js';
|
|
@@ -61,7 +61,7 @@ export { default as Second } from './core/Second/index.js';
|
|
|
61
61
|
export { default as SegmentControl } from './core/SegmentControl/index.js';
|
|
62
62
|
export { default as Select } from './core/Select/index.js';
|
|
63
63
|
export { default as SimplePagination } from './core/SimplePagination/index.js';
|
|
64
|
-
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, Space, Tabs,
|
|
64
|
+
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, Space, Tabs, Tree, Typography, Upload } from 'antd';
|
|
65
65
|
export { default as Speed } from './core/Speed/index.js';
|
|
66
66
|
export { default as StatusCapsule, StatusIcon, StatusPresetColors } from './core/StatusCapsule/index.js';
|
|
67
67
|
export { default as Steps } from './core/Steps/index.js';
|
|
@@ -76,6 +76,7 @@ export { default as TimeZoneSelect } from './core/TimeZoneSelect/index.js';
|
|
|
76
76
|
export { default as Token, TokenPresetColors } from './core/Token/index.js';
|
|
77
77
|
export { default as Tooltip } from './core/Tooltip/index.js';
|
|
78
78
|
export { default as Truncate } from './core/Truncate/index.js';
|
|
79
|
+
export { Timeline } from './core/Timeline/index.js';
|
|
79
80
|
export { Antd5Dropdown } from './core/Antd5Dropdown/Antd5Dropdown.js';
|
|
80
81
|
export { Architecture } from './core/Arch/arch.type.js';
|
|
81
82
|
export { CascaderDefaultHeader, CascaderDefaultHeaderContainer, CascaderDefaultHeaderSearch, CascaderDefaultOptionLabel, CascaderDropdown, CascaderInputStyle, CascaderLargeDropdown, CascaderNotData, CascaderSmallDropdown, DoubleRowOptionStyleWrapper, Hide } from './core/Cascader/cascader.style.js';
|