@capillarytech/blaze-ui 6.1.6 → 6.1.8
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/CapDragAndDrop/index.d.ts +3 -19
- package/CapDragAndDrop/index.d.ts.map +1 -1
- package/CapDragAndDrop/index.js +24 -29
- package/CapDragAndDrop/messages.d.ts +25 -0
- package/CapDragAndDrop/messages.d.ts.map +1 -0
- package/CapDragAndDrop/messages.js +28 -0
- package/CapDragAndDrop/styles.css +17 -15
- package/CapDragAndDrop/styles.module.scss.js +21 -0
- package/CapDragAndDrop/styles.scss +18 -16
- package/CapDragAndDrop/types.d.ts +17 -0
- package/CapDragAndDrop/types.d.ts.map +1 -0
- package/CapDragAndDrop/types.js +1 -0
- package/CapIcon/index.js +12 -12
- package/CapIcon/styles.css +17 -21
- package/CapIcon/styles.module.scss.js +3 -4
- package/CapIcon/styles.scss +10 -15
- package/CapMediaPreview/ImageRenderer.d.ts +2 -15
- package/CapMediaPreview/ImageRenderer.d.ts.map +1 -1
- package/CapMediaPreview/ImageRenderer.js +3 -11
- package/CapMediaPreview/MediaRenderer.d.ts +2 -1
- package/CapMediaPreview/MediaRenderer.d.ts.map +1 -1
- package/CapMediaPreview/MediaRenderer.js +17 -15
- package/CapMediaPreview/VideoPlayer.d.ts +2 -1
- package/CapMediaPreview/VideoPlayer.d.ts.map +1 -1
- package/CapMediaPreview/VideoPlayer.js +16 -15
- package/CapMediaPreview/index.d.ts +4 -51
- package/CapMediaPreview/index.d.ts.map +1 -1
- package/CapMediaPreview/index.js +86 -69
- package/CapMediaPreview/styles.css +31 -21
- package/CapMediaPreview/styles.module.scss.js +24 -0
- package/CapMediaPreview/styles.scss +38 -27
- package/CapMediaPreview/types.d.ts +48 -0
- package/CapMediaPreview/types.d.ts.map +1 -0
- package/CapMediaPreview/types.js +1 -0
- package/CapSelectFilter/types.d.ts +1 -1
- package/CapSelectFilter/types.d.ts.map +1 -1
- package/CapTimeline/CapTimelineCard.d.ts +4 -27
- package/CapTimeline/CapTimelineCard.d.ts.map +1 -1
- package/CapTimeline/CapTimelineCard.js +40 -157
- package/CapTimeline/CapTimelinePanesWrapper.d.ts +4 -25
- package/CapTimeline/CapTimelinePanesWrapper.d.ts.map +1 -1
- package/CapTimeline/CapTimelinePanesWrapper.js +24 -20
- package/CapTimeline/index.d.ts +2 -17
- package/CapTimeline/index.d.ts.map +1 -1
- package/CapTimeline/index.js +62 -23
- package/CapTimeline/messages.d.ts +21 -0
- package/CapTimeline/messages.d.ts.map +1 -0
- package/CapTimeline/messages.js +24 -0
- package/CapTimeline/styles.css +40 -40
- package/CapTimeline/styles.module.scss.js +30 -0
- package/CapTimeline/styles.scss +76 -57
- package/CapTimeline/tests/CapTimeline.mockData.d.ts +14 -0
- package/CapTimeline/tests/CapTimeline.mockData.d.ts.map +1 -0
- package/CapTimeline/types.d.ts +60 -0
- package/CapTimeline/types.d.ts.map +1 -0
- package/CapTimeline/types.js +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -1
- package/index.js +175 -169
- package/package.json +2 -2
- package/utils/getCapThemeConfig.d.ts +1 -1
- package/utils/getCapThemeConfig.d.ts.map +1 -1
- package/utils/getCapThemeConfig.js +9 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ModalProps } from 'antd-v5';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl';
|
|
3
|
+
export interface MediaItem {
|
|
4
|
+
type: string;
|
|
5
|
+
file: string | File;
|
|
6
|
+
name?: string;
|
|
7
|
+
imageProps?: Record<string, unknown>;
|
|
8
|
+
videoProps?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface CapMediaPreviewProps extends Omit<ModalProps, 'open' | 'visible' | 'onVisibleChange' | 'onOpenChange'> {
|
|
11
|
+
/** Override className for Modal */
|
|
12
|
+
overrideClassName?: string;
|
|
13
|
+
/** Override className for Modal wrapper */
|
|
14
|
+
overrideWrapperClassName?: string;
|
|
15
|
+
/** Whether the media preview modal is visible */
|
|
16
|
+
isMediaPreviewVisible?: boolean;
|
|
17
|
+
/** Array of media items to display */
|
|
18
|
+
media?: MediaItem[];
|
|
19
|
+
/** Starting index for media carousel */
|
|
20
|
+
startIndex?: number;
|
|
21
|
+
/** Width of the modal */
|
|
22
|
+
width?: ModalProps['width'];
|
|
23
|
+
/** Height of the modal */
|
|
24
|
+
height?: string;
|
|
25
|
+
/** Top navigation height (used for CSS variable) */
|
|
26
|
+
topNavigationHeight?: string;
|
|
27
|
+
/** Callback when modal is closed */
|
|
28
|
+
onClose?: () => void;
|
|
29
|
+
/** Additional props to pass to Modal component */
|
|
30
|
+
modalProps?: Omit<ModalProps, 'open' | 'visible' | 'onVisibleChange' | 'onOpenChange'>;
|
|
31
|
+
}
|
|
32
|
+
export interface MediaRendererProps extends WrappedComponentProps {
|
|
33
|
+
/** Current media item to render */
|
|
34
|
+
currentMedia?: MediaItem;
|
|
35
|
+
}
|
|
36
|
+
export interface ImageRendererProps {
|
|
37
|
+
/** Image source URL */
|
|
38
|
+
src?: string | null;
|
|
39
|
+
/** Additional props to pass to CapImage */
|
|
40
|
+
imageProps?: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
export interface VideoPlayerProps extends WrappedComponentProps {
|
|
43
|
+
/** Video source URL */
|
|
44
|
+
src?: string | null;
|
|
45
|
+
/** Additional props to pass to video element */
|
|
46
|
+
videoProps?: Record<string, unknown>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapMediaPreview/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,GAAG,cAAc,CAAC;IACjF,mCAAmC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,iDAAiD;IACjD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sCAAsC;IACtC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,kDAAkD;IAClD,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,GAAG,cAAc,CAAC,CAAC;CACxF;AAED,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,mCAAmC;IACnC,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;IAC7D,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapSelectFilter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapSelectFilter/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CACjC;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,cAAc,CAAC;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC1D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,YAAY,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,KAAK,GAAG,UAAU,CAAC;IACrF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
children: PropTypes.Requireable<any>;
|
|
8
|
-
className: PropTypes.Requireable<string>;
|
|
9
|
-
isSelected: PropTypes.Requireable<boolean>;
|
|
10
|
-
handleClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
-
milestoneHeader: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
12
|
-
milestoneDescription: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
13
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
14
|
-
configuringMessage: PropTypes.Requireable<string>;
|
|
15
|
-
notConfiguredMessage: PropTypes.Requireable<string>;
|
|
16
|
-
alwaysShowDescription: PropTypes.Requireable<boolean>;
|
|
17
|
-
complete: PropTypes.Requireable<boolean>;
|
|
18
|
-
configError: PropTypes.Requireable<boolean>;
|
|
19
|
-
defaultConfiguringMessage: PropTypes.Requireable<string>;
|
|
20
|
-
defaultNotConfiguredMessage: PropTypes.Requireable<string>;
|
|
21
|
-
toConfigure: PropTypes.Requireable<string>;
|
|
22
|
-
completePrevSteps: PropTypes.Requireable<string>;
|
|
23
|
-
paneKey: PropTypes.Requireable<any>;
|
|
24
|
-
isLastPane: PropTypes.Requireable<boolean>;
|
|
25
|
-
width: PropTypes.Requireable<number>;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
declare const _default: React.ComponentType<Omit<any, "intl">>;
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl';
|
|
3
|
+
import type { CapTimelineCardProps } from './types';
|
|
4
|
+
export declare const CapTimelineCard: (props: CapTimelineCardProps & WrappedComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const _default: React.ComponentType<Omit<CapTimelineCardProps & WrappedComponentProps, "intl">>;
|
|
29
6
|
export default _default;
|
|
30
7
|
//# sourceMappingURL=CapTimelineCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CapTimelineCard.d.ts","sourceRoot":"","sources":["../../components/CapTimeline/CapTimelineCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CapTimelineCard.d.ts","sourceRoot":"","sources":["../../components/CapTimeline/CapTimelineCard.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAQxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAIpD,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,GAAG,qBAAqB,4CAyElF,CAAC;;AAEF,wBAA2C"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Timeline } from "antd";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
import classNames from "classnames";
|
|
4
|
-
import
|
|
3
|
+
import { injectIntl } from "react-intl";
|
|
5
4
|
import CapCard from "../CapCard/index.js";
|
|
6
|
-
import CapIcon from "../CapIcon/index.js";
|
|
7
5
|
import CapRow from "../CapRow/index.js";
|
|
8
6
|
import CapTooltip from "../CapTooltip/index.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import './styles.css';/* empty css */
|
|
12
|
-
const { FONT_SIZE_M, CAP_G04, CAP_RED } = styles__variables;
|
|
7
|
+
import messages from "./messages.js";
|
|
8
|
+
import styles from "./styles.module.scss.js";
|
|
13
9
|
const clsPrefix = "cap-timeline-card-v1";
|
|
14
10
|
const CapTimelineCard = (props) => {
|
|
15
11
|
const {
|
|
16
|
-
className,
|
|
17
12
|
isSelected = false,
|
|
18
13
|
handleClick = () => {
|
|
19
14
|
},
|
|
@@ -25,170 +20,58 @@ const CapTimelineCard = (props) => {
|
|
|
25
20
|
alwaysShowDescription = false,
|
|
26
21
|
complete = false,
|
|
27
22
|
configError = false,
|
|
28
|
-
defaultConfiguringMessage,
|
|
29
23
|
paneKey,
|
|
30
|
-
isLastPane = false,
|
|
31
24
|
width = 380,
|
|
32
|
-
|
|
33
|
-
defaultNotConfiguredMessage,
|
|
34
|
-
toConfigure,
|
|
35
|
-
completePrevSteps,
|
|
36
|
-
edited
|
|
25
|
+
intl: { formatMessage }
|
|
37
26
|
} = props;
|
|
27
|
+
const defaultConfiguringMessage = formatMessage(messages.defaultConfiguringMessage);
|
|
28
|
+
const defaultNotConfiguredMessage = formatMessage(messages.defaultNotConfiguredMessage);
|
|
29
|
+
const toConfigure = formatMessage(messages.toConfigure);
|
|
30
|
+
const completePrevSteps = formatMessage(messages.completePrevSteps);
|
|
38
31
|
const getDescriptionForDisabled = () => {
|
|
39
|
-
if (alwaysShowDescription)
|
|
40
|
-
return milestoneDescription;
|
|
41
|
-
}
|
|
32
|
+
if (alwaysShowDescription) return milestoneDescription;
|
|
42
33
|
return notConfiguredMessage ? notConfiguredMessage : defaultNotConfiguredMessage;
|
|
43
34
|
};
|
|
44
35
|
const getDescriptionForEnabled = () => {
|
|
45
|
-
if (alwaysShowDescription)
|
|
46
|
-
return milestoneDescription;
|
|
47
|
-
}
|
|
36
|
+
if (alwaysShowDescription) return milestoneDescription;
|
|
48
37
|
return notConfiguredMessage ? configuringMessage : defaultConfiguringMessage;
|
|
49
38
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
fontSize: FONT_SIZE_M,
|
|
70
|
-
marginTop: "1px"
|
|
71
|
-
},
|
|
72
|
-
type: "exclamation-circle"
|
|
73
|
-
}
|
|
74
|
-
) });
|
|
75
|
-
}
|
|
76
|
-
return /* @__PURE__ */ jsx(CapTooltip, { title: "Completed", children: /* @__PURE__ */ jsx(CapRow, { className: classNames(`${clsPrefix}-icon-parent`), children: /* @__PURE__ */ jsx(CapIcon, { type: "check" }) }) });
|
|
77
|
-
};
|
|
78
|
-
return /* @__PURE__ */ jsxs(
|
|
79
|
-
CapRow,
|
|
39
|
+
if (disabled) {
|
|
40
|
+
return /* @__PURE__ */ jsx(CapTooltip, { placement: "right", title: `${toConfigure} ${paneKey}, ${completePrevSteps}`, children: /* @__PURE__ */ jsx(CapRow, { className: styles[`${clsPrefix}-disabled-card`], onClick: handleClick, children: /* @__PURE__ */ jsxs(
|
|
41
|
+
CapCard,
|
|
42
|
+
{
|
|
43
|
+
style: { width },
|
|
44
|
+
className: classNames(
|
|
45
|
+
styles[`${clsPrefix}-card-body`],
|
|
46
|
+
styles[`${clsPrefix}-incomplete-card`],
|
|
47
|
+
configError && styles[`${clsPrefix}-warning-card`]
|
|
48
|
+
),
|
|
49
|
+
children: [
|
|
50
|
+
milestoneHeader,
|
|
51
|
+
/* @__PURE__ */ jsx(CapRow, { className: styles[`${clsPrefix}-card-description`], children: getDescriptionForDisabled() })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
) }) });
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ jsx(CapRow, { onClick: handleClick, children: /* @__PURE__ */ jsxs(
|
|
57
|
+
CapCard,
|
|
80
58
|
{
|
|
59
|
+
style: { width },
|
|
81
60
|
className: classNames(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
61
|
+
isSelected && styles[`${clsPrefix}-pane-selected`],
|
|
62
|
+
styles[`${clsPrefix}-enabled-card`],
|
|
63
|
+
styles[`${clsPrefix}-card-body`],
|
|
64
|
+
!complete && styles[`${clsPrefix}-incomplete-card`],
|
|
65
|
+
configError && styles[`${clsPrefix}-warning-card`]
|
|
86
66
|
),
|
|
87
|
-
type: "flex",
|
|
88
|
-
align: "middle",
|
|
89
|
-
justify: "space-between",
|
|
90
67
|
children: [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
{
|
|
94
|
-
dot: configError ? /* @__PURE__ */ jsx(
|
|
95
|
-
CapIcon,
|
|
96
|
-
{
|
|
97
|
-
style: {
|
|
98
|
-
color: CAP_RED,
|
|
99
|
-
fontSize: FONT_SIZE_M
|
|
100
|
-
},
|
|
101
|
-
type: "warning"
|
|
102
|
-
}
|
|
103
|
-
) : /* @__PURE__ */ jsx(
|
|
104
|
-
CapIcon,
|
|
105
|
-
{
|
|
106
|
-
style: {
|
|
107
|
-
color: CAP_G04,
|
|
108
|
-
fontSize: FONT_SIZE_M,
|
|
109
|
-
marginTop: "1px"
|
|
110
|
-
},
|
|
111
|
-
type: "exclamation-circle"
|
|
112
|
-
}
|
|
113
|
-
),
|
|
114
|
-
className: classNames(
|
|
115
|
-
`${clsPrefix}-disabled-timeline-item`,
|
|
116
|
-
isLastPane && `${clsPrefix}-last-pane`
|
|
117
|
-
),
|
|
118
|
-
children: /* @__PURE__ */ jsx(CapRow, { className: classNames(`${clsPrefix}-disabled-card`), onClick: handleClick, children: /* @__PURE__ */ jsxs(
|
|
119
|
-
CapCard,
|
|
120
|
-
{
|
|
121
|
-
style: { width },
|
|
122
|
-
className: classNames(
|
|
123
|
-
`${clsPrefix}-card-body`,
|
|
124
|
-
`${clsPrefix}-incomplete-card`,
|
|
125
|
-
configError && `${clsPrefix}-warning-card`
|
|
126
|
-
),
|
|
127
|
-
children: [
|
|
128
|
-
milestoneHeader,
|
|
129
|
-
/* @__PURE__ */ jsx(CapRow, { className: classNames(`${clsPrefix}-card-description`), children: getDescriptionForDisabled() })
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
) })
|
|
133
|
-
}
|
|
134
|
-
) }),
|
|
135
|
-
!disabled && /* @__PURE__ */ jsx(
|
|
136
|
-
Timeline.Item,
|
|
137
|
-
{
|
|
138
|
-
dot: getTimelineIcon(),
|
|
139
|
-
className: classNames(
|
|
140
|
-
`${clsPrefix}-enabled-timeline-item`,
|
|
141
|
-
isLastPane && `${clsPrefix}-last-pane`,
|
|
142
|
-
complete && `${clsPrefix}-completed-tail`,
|
|
143
|
-
configError && `${clsPrefix}-warning-tail`,
|
|
144
|
-
configError && `${clsPrefix}-warning-card`,
|
|
145
|
-
complete && !isSelected && `${clsPrefix}-complete-head`
|
|
146
|
-
),
|
|
147
|
-
children: /* @__PURE__ */ jsx(CapRow, { onClick: handleClick, children: /* @__PURE__ */ jsxs(
|
|
148
|
-
CapCard,
|
|
149
|
-
{
|
|
150
|
-
style: { width },
|
|
151
|
-
className: classNames(
|
|
152
|
-
isSelected && `${clsPrefix}-pane-selected`,
|
|
153
|
-
`${clsPrefix}-enabled-card`,
|
|
154
|
-
`${clsPrefix}-card-body`,
|
|
155
|
-
!complete && `${clsPrefix}-incomplete-card`,
|
|
156
|
-
configError && `${clsPrefix}-warning-card`
|
|
157
|
-
),
|
|
158
|
-
children: [
|
|
159
|
-
milestoneHeader,
|
|
160
|
-
/* @__PURE__ */ jsx(CapRow, { className: classNames(`${clsPrefix}-card-description`), children: isSelected ? getDescriptionForEnabled() : milestoneDescription })
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
) })
|
|
164
|
-
}
|
|
165
|
-
)
|
|
68
|
+
milestoneHeader,
|
|
69
|
+
/* @__PURE__ */ jsx(CapRow, { className: styles[`${clsPrefix}-card-description`], children: isSelected ? getDescriptionForEnabled() : milestoneDescription })
|
|
166
70
|
]
|
|
167
71
|
}
|
|
168
|
-
);
|
|
169
|
-
};
|
|
170
|
-
CapTimelineCard.propTypes = {
|
|
171
|
-
children: PropTypes.any,
|
|
172
|
-
className: PropTypes.string,
|
|
173
|
-
isSelected: PropTypes.bool,
|
|
174
|
-
handleClick: PropTypes.func,
|
|
175
|
-
milestoneHeader: PropTypes.element,
|
|
176
|
-
milestoneDescription: PropTypes.element,
|
|
177
|
-
disabled: PropTypes.bool,
|
|
178
|
-
configuringMessage: PropTypes.string,
|
|
179
|
-
notConfiguredMessage: PropTypes.string,
|
|
180
|
-
alwaysShowDescription: PropTypes.bool,
|
|
181
|
-
complete: PropTypes.bool,
|
|
182
|
-
configError: PropTypes.bool,
|
|
183
|
-
defaultConfiguringMessage: PropTypes.string,
|
|
184
|
-
defaultNotConfiguredMessage: PropTypes.string,
|
|
185
|
-
toConfigure: PropTypes.string,
|
|
186
|
-
completePrevSteps: PropTypes.string,
|
|
187
|
-
paneKey: PropTypes.any,
|
|
188
|
-
isLastPane: PropTypes.bool,
|
|
189
|
-
width: PropTypes.number
|
|
72
|
+
) });
|
|
190
73
|
};
|
|
191
|
-
const CapTimelineCard$1 =
|
|
74
|
+
const CapTimelineCard$1 = injectIntl(CapTimelineCard);
|
|
192
75
|
export {
|
|
193
76
|
CapTimelineCard,
|
|
194
77
|
CapTimelineCard$1 as default
|
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
isReviewScreen: any;
|
|
8
|
-
activeTab: any;
|
|
9
|
-
timelineLeftPaneContents: any;
|
|
10
|
-
timelineRightCards: any;
|
|
11
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
propTypes: {
|
|
13
|
-
className: PropTypes.Requireable<string>;
|
|
14
|
-
isReviewScreen: PropTypes.Requireable<boolean>;
|
|
15
|
-
activeTab: PropTypes.Requireable<string>;
|
|
16
|
-
timelineLeftPaneContents: PropTypes.Requireable<object>;
|
|
17
|
-
timelineRightCards: PropTypes.Requireable<any[]>;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
declare const _default: React.ComponentType<Omit<{
|
|
21
|
-
className: any;
|
|
22
|
-
isReviewScreen: any;
|
|
23
|
-
activeTab: any;
|
|
24
|
-
timelineLeftPaneContents: any;
|
|
25
|
-
timelineRightCards: any;
|
|
26
|
-
} & import("react-intl").WrappedComponentProps, "intl">>;
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl';
|
|
3
|
+
import type { CapTimelinePanesWrapperProps } from './types';
|
|
4
|
+
export declare const CapTimelinePanesWrapper: ({ className, isReviewScreen, activeTab, timelineLeftPaneContents, timelineRightCards, timelineClassName, }: CapTimelinePanesWrapperProps & WrappedComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const _default: React.ComponentType<Omit<CapTimelinePanesWrapperProps & WrappedComponentProps, "intl">>;
|
|
27
6
|
export default _default;
|
|
28
7
|
//# sourceMappingURL=CapTimelinePanesWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CapTimelinePanesWrapper.d.ts","sourceRoot":"","sources":["../../components/CapTimeline/CapTimelinePanesWrapper.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CapTimelinePanesWrapper.d.ts","sourceRoot":"","sources":["../../components/CapTimeline/CapTimelinePanesWrapper.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAOxD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAI5D,eAAO,MAAM,uBAAuB,GAAI,4GAOrC,4BAA4B,GAAG,qBAAqB,4CA+CtD,CAAC;;AAEF,wBAAmD"}
|
|
@@ -1,47 +1,51 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Timeline } from "antd-v5";
|
|
2
3
|
import classNames from "classnames";
|
|
3
|
-
import
|
|
4
|
+
import { injectIntl } from "react-intl";
|
|
4
5
|
import CapColumn from "../CapColumn/index.js";
|
|
5
6
|
import CapDivider from "../CapDivider/index.js";
|
|
6
7
|
import CapRow from "../CapRow/index.js";
|
|
7
|
-
import
|
|
8
|
-
import './styles.css';/* empty css */
|
|
8
|
+
import styles from "./styles.module.scss.js";
|
|
9
9
|
const clsPrefix = "cap-timeline-panes-wrapper-v1";
|
|
10
10
|
const CapTimelinePanesWrapper = ({
|
|
11
11
|
className,
|
|
12
12
|
isReviewScreen,
|
|
13
13
|
activeTab,
|
|
14
14
|
timelineLeftPaneContents,
|
|
15
|
-
timelineRightCards
|
|
15
|
+
timelineRightCards,
|
|
16
|
+
timelineClassName
|
|
16
17
|
}) => {
|
|
17
18
|
const renderActiveTabContent = () => {
|
|
18
19
|
return Object.keys(timelineLeftPaneContents).map((key, index) => {
|
|
19
|
-
const
|
|
20
|
-
return /* @__PURE__ */ jsx(CapRow, { className: classNames(
|
|
20
|
+
const paneClassName = activeTab === key || isReviewScreen ? styles[`${clsPrefix}-active-pane`] : styles[`${clsPrefix}-inactive-pane`];
|
|
21
|
+
return /* @__PURE__ */ jsx(CapRow, { className: classNames(paneClassName), id: key, children: timelineLeftPaneContents[key] }, index);
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
|
-
return /* @__PURE__ */ jsxs(CapRow, { className: classNames(className, `${clsPrefix}-pane-wrapper`), children: [
|
|
24
|
-
/* @__PURE__ */ jsx(CapColumn, { className: classNames(`${clsPrefix}-left-pane-col`, `${clsPrefix}-custom-scroll`), children: timelineRightCards }),
|
|
25
|
-
/* @__PURE__ */ jsx(CapColumn, { className: classNames(`${clsPrefix}-divider-col`), children: /* @__PURE__ */ jsx(CapDivider, { className: `${clsPrefix}-timelinePane-divider`, type: "vertical" }) }),
|
|
24
|
+
return /* @__PURE__ */ jsxs(CapRow, { className: classNames(className, styles[`${clsPrefix}-pane-wrapper`]), children: [
|
|
26
25
|
/* @__PURE__ */ jsx(
|
|
27
26
|
CapColumn,
|
|
28
27
|
{
|
|
29
|
-
className: classNames(
|
|
28
|
+
className: classNames(
|
|
29
|
+
styles[`${clsPrefix}-left-pane-col`],
|
|
30
|
+
styles[`${clsPrefix}-custom-scroll`]
|
|
31
|
+
),
|
|
32
|
+
children: /* @__PURE__ */ jsx(Timeline, { className: timelineClassName, children: timelineRightCards.map((item) => /* @__PURE__ */ jsx(Timeline.Item, { dot: item.icon, className: item.className, children: item.content }, item.key)) })
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ jsx(CapColumn, { className: classNames(styles[`${clsPrefix}-divider-col`]), children: /* @__PURE__ */ jsx(CapDivider, { className: styles[`${clsPrefix}-timelinePane-divider`], type: "vertical" }) }),
|
|
36
|
+
/* @__PURE__ */ jsx(
|
|
37
|
+
CapColumn,
|
|
38
|
+
{
|
|
39
|
+
className: classNames(
|
|
40
|
+
styles[`${clsPrefix}-right-pane-col`],
|
|
41
|
+
styles[`${clsPrefix}-custom-scroll`]
|
|
42
|
+
),
|
|
30
43
|
children: renderActiveTabContent()
|
|
31
44
|
}
|
|
32
45
|
)
|
|
33
46
|
] });
|
|
34
47
|
};
|
|
35
|
-
CapTimelinePanesWrapper
|
|
36
|
-
className: PropTypes.string,
|
|
37
|
-
isReviewScreen: PropTypes.bool,
|
|
38
|
-
activeTab: PropTypes.string,
|
|
39
|
-
timelineLeftPaneContents: PropTypes.object,
|
|
40
|
-
timelineRightCards: PropTypes.array
|
|
41
|
-
};
|
|
42
|
-
const CapTimelinePanesWrapper$1 = LocaleHoc(CapTimelinePanesWrapper, {
|
|
43
|
-
key: "CapTimelinePanesWrapper"
|
|
44
|
-
});
|
|
48
|
+
const CapTimelinePanesWrapper$1 = injectIntl(CapTimelinePanesWrapper);
|
|
45
49
|
export {
|
|
46
50
|
CapTimelinePanesWrapper,
|
|
47
51
|
CapTimelinePanesWrapper$1 as default
|
package/CapTimeline/index.d.ts
CHANGED
|
@@ -3,22 +3,7 @@
|
|
|
3
3
|
* CapTimeline
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
declare const CapTimeline: {
|
|
9
|
-
({ className, timelinePanes, activeTab, isReviewScreen, width }: {
|
|
10
|
-
className: any;
|
|
11
|
-
timelinePanes: any;
|
|
12
|
-
activeTab: any;
|
|
13
|
-
isReviewScreen: any;
|
|
14
|
-
width: any;
|
|
15
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
propTypes: {
|
|
17
|
-
timelinePanes: PropTypes.Requireable<any[]>;
|
|
18
|
-
currentStep: PropTypes.Requireable<string>;
|
|
19
|
-
setCurrentStep: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
|
-
width: PropTypes.Requireable<number>;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
6
|
+
import type { CapTimelineProps } from './types';
|
|
7
|
+
declare const CapTimeline: ({ className, timelinePanes, activeTab, isReviewScreen, width, }: CapTimelineProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
8
|
export default CapTimeline;
|
|
24
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapTimeline/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapTimeline/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,SAAS,CAAC;AAMlE,QAAA,MAAM,WAAW,GAAI,iEAMlB,gBAAgB,4CAoHlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/CapTimeline/index.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Timeline } from "antd";
|
|
3
2
|
import classNames from "classnames";
|
|
4
|
-
import
|
|
3
|
+
import CapIcon from "../CapIcon/index.js";
|
|
5
4
|
import CapRow from "../CapRow/index.js";
|
|
5
|
+
import CapTooltip from "../CapTooltip/index.js";
|
|
6
|
+
import * as styles__variables from "../styles/_variables.js";
|
|
6
7
|
import CapTimelineCard from "./CapTimelineCard.js";
|
|
7
8
|
import CapTimelinePanesWrapper from "./CapTimelinePanesWrapper.js";
|
|
8
|
-
import
|
|
9
|
+
import styles from "./styles.module.scss.js";
|
|
10
|
+
const { FONT_SIZE_M, CAP_G04, CAP_RED } = styles__variables;
|
|
11
|
+
const clsCardPrefix = "cap-timeline-card-v1";
|
|
9
12
|
const clsPrefix = "cap-timeline-v1";
|
|
10
|
-
const CapTimeline = ({
|
|
13
|
+
const CapTimeline = ({
|
|
14
|
+
className,
|
|
15
|
+
timelinePanes,
|
|
16
|
+
activeTab,
|
|
17
|
+
isReviewScreen,
|
|
18
|
+
width = 380
|
|
19
|
+
}) => {
|
|
11
20
|
const { timelineLeftPaneContents, timelineRightCards } = timelinePanes.reduce(
|
|
12
21
|
(accumulator, {
|
|
13
22
|
milestoneHeader,
|
|
@@ -22,10 +31,37 @@ const CapTimeline = ({ className, timelinePanes, activeTab, isReviewScreen, widt
|
|
|
22
31
|
content,
|
|
23
32
|
configError,
|
|
24
33
|
edited,
|
|
25
|
-
handleClick
|
|
34
|
+
handleClick = () => {
|
|
35
|
+
}
|
|
26
36
|
}, index) => {
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
const isSelected = activeTab === key;
|
|
38
|
+
const isLastPane = index === (timelinePanes == null ? void 0 : timelinePanes.length) - 1;
|
|
39
|
+
let icon;
|
|
40
|
+
if (disabled) {
|
|
41
|
+
icon = configError ? /* @__PURE__ */ jsx(CapIcon, { style: { color: CAP_RED, fontSize: FONT_SIZE_M }, type: "warning" }) : /* @__PURE__ */ jsx(
|
|
42
|
+
CapIcon,
|
|
43
|
+
{
|
|
44
|
+
style: { color: CAP_G04, fontSize: FONT_SIZE_M, marginTop: "1px" },
|
|
45
|
+
type: "exclamation-circle"
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
} else if (configError) {
|
|
49
|
+
icon = /* @__PURE__ */ jsx(CapTooltip, { title: "Warning", children: /* @__PURE__ */ jsx(CapIcon, { style: { color: CAP_RED, fontSize: FONT_SIZE_M }, type: "warning", size: "l" }) });
|
|
50
|
+
} else if (!complete || edited) {
|
|
51
|
+
icon = /* @__PURE__ */ jsx(CapTooltip, { title: "Pending", children: /* @__PURE__ */ jsx(
|
|
52
|
+
CapIcon,
|
|
53
|
+
{
|
|
54
|
+
style: { color: CAP_G04, fontSize: FONT_SIZE_M, marginTop: "1px" },
|
|
55
|
+
type: "exclamation-circle"
|
|
56
|
+
}
|
|
57
|
+
) });
|
|
58
|
+
} else {
|
|
59
|
+
icon = /* @__PURE__ */ jsx(CapTooltip, { title: "Completed", children: /* @__PURE__ */ jsx("span", { className: styles[`${clsCardPrefix}-icon-parent`], children: /* @__PURE__ */ jsx(CapIcon, { type: "check", style: { fontSize: FONT_SIZE_M } }) }) });
|
|
60
|
+
}
|
|
61
|
+
const item = {
|
|
62
|
+
key,
|
|
63
|
+
icon,
|
|
64
|
+
content: /* @__PURE__ */ jsx(
|
|
29
65
|
CapTimelineCard,
|
|
30
66
|
{
|
|
31
67
|
milestoneHeader,
|
|
@@ -37,15 +73,23 @@ const CapTimeline = ({ className, timelinePanes, activeTab, isReviewScreen, widt
|
|
|
37
73
|
alwaysShowDescription,
|
|
38
74
|
complete,
|
|
39
75
|
configError,
|
|
40
|
-
isLastPane: index === (timelinePanes == null ? void 0 : timelinePanes.length) - 1 ? true : false,
|
|
41
|
-
width,
|
|
42
|
-
edited,
|
|
43
76
|
handleClick,
|
|
44
|
-
isSelected
|
|
45
|
-
|
|
46
|
-
|
|
77
|
+
isSelected,
|
|
78
|
+
isLastPane,
|
|
79
|
+
width
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
className: classNames(
|
|
83
|
+
disabled ? styles[`${clsCardPrefix}-disabled-timeline-item`] : styles[`${clsCardPrefix}-enabled-timeline-item`],
|
|
84
|
+
isLastPane && styles[`${clsCardPrefix}-last-pane`],
|
|
85
|
+
!disabled && complete && styles[`${clsCardPrefix}-completed-tail`],
|
|
86
|
+
!disabled && configError && styles[`${clsCardPrefix}-warning-tail`],
|
|
87
|
+
!disabled && configError && styles[`${clsCardPrefix}-warning-card`],
|
|
88
|
+
!disabled && complete && !isSelected && styles[`${clsCardPrefix}-complete-head`],
|
|
89
|
+
!configError ? styles[`${clsCardPrefix}-division`] : styles[`${clsCardPrefix}-warning-division`]
|
|
47
90
|
)
|
|
48
|
-
|
|
91
|
+
};
|
|
92
|
+
accumulator.timelineRightCards.push(item);
|
|
49
93
|
accumulator.timelineLeftPaneContents[key] = content;
|
|
50
94
|
return accumulator;
|
|
51
95
|
},
|
|
@@ -54,21 +98,16 @@ const CapTimeline = ({ className, timelinePanes, activeTab, isReviewScreen, widt
|
|
|
54
98
|
timelineRightCards: []
|
|
55
99
|
}
|
|
56
100
|
);
|
|
57
|
-
return /* @__PURE__ */ jsx(CapRow, { className, children: /* @__PURE__ */ jsx(
|
|
101
|
+
return /* @__PURE__ */ jsx(CapRow, { className, children: /* @__PURE__ */ jsx(
|
|
58
102
|
CapTimelinePanesWrapper,
|
|
59
103
|
{
|
|
60
104
|
activeTab,
|
|
61
105
|
timelineLeftPaneContents,
|
|
62
106
|
timelineRightCards,
|
|
63
|
-
isReviewScreen
|
|
107
|
+
isReviewScreen,
|
|
108
|
+
timelineClassName: styles[`${clsPrefix}-body`]
|
|
64
109
|
}
|
|
65
|
-
) })
|
|
66
|
-
};
|
|
67
|
-
CapTimeline.propTypes = {
|
|
68
|
-
timelinePanes: PropTypes.array,
|
|
69
|
-
currentStep: PropTypes.string,
|
|
70
|
-
setCurrentStep: PropTypes.func,
|
|
71
|
-
width: PropTypes.number
|
|
110
|
+
) });
|
|
72
111
|
};
|
|
73
112
|
export {
|
|
74
113
|
CapTimeline as default
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const scope = "app.commonUtils.capUiLibrary.CapTimelineCard";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
defaultConfiguringMessage: {
|
|
4
|
+
id: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
};
|
|
7
|
+
defaultNotConfiguredMessage: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
};
|
|
11
|
+
toConfigure: {
|
|
12
|
+
id: string;
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
};
|
|
15
|
+
completePrevSteps: {
|
|
16
|
+
id: string;
|
|
17
|
+
defaultMessage: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../components/CapTimeline/messages.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,iDAAiD,CAAC;;;;;;;;;;;;;;;;;;;AAEpE,wBAiBG"}
|