sccoreui 2.3.5 → 2.3.7
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/assets/sccoreui.css +1 -1
- package/dist/components/progress-steps/progress-steps.js +84 -0
- package/dist/index.js +5 -1
- package/dist/pages/file-upload/file-upload.js +1 -1
- package/dist/pages/home.js +1 -1
- package/dist/pages/progress-bar/progress-bar.js +4 -4
- package/dist/types/{pages → components}/progress-steps/progress-steps.d.ts +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/pages/types/type.d.ts +9 -1
- package/package.json +1 -1
- package/dist/pages/progress-steps/progress-steps.js +0 -82
- /package/dist/{pages → components}/progress_bar_round/circle-progress-bar.js +0 -0
- /package/dist/{pages → components}/progress_bar_round/half-circle-progres-bar.js +0 -0
- /package/dist/types/{pages → components}/progress_bar_round/circle-progress-bar.d.ts +0 -0
- /package/dist/types/{pages → components}/progress_bar_round/half-circle-progres-bar.d.ts +0 -0
package/dist/assets/sccoreui.css
CHANGED
|
@@ -5519,7 +5519,7 @@ box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px var(--gray-100);
|
|
|
5519
5519
|
/* box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12); */
|
|
5520
5520
|
border-radius: 8px;
|
|
5521
5521
|
border: 1px solid #eaecf0;
|
|
5522
|
-
padding:
|
|
5522
|
+
padding: 12px 16px 12px 16px;
|
|
5523
5523
|
}
|
|
5524
5524
|
.p-card:hover {
|
|
5525
5525
|
box-shadow: 0px 0px 2px #c5c5c5;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProgressSteps = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const button_1 = require("primereact/button");
|
|
7
|
+
const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
|
|
8
|
+
require("./progress-steps.scss");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const ProgressSteps = (props) => {
|
|
11
|
+
const { stepsItems, orientation, activeIndex, withButtons = true, icons, className, style, } = props;
|
|
12
|
+
const [currentActive, setCurrentActive] = (0, react_1.useState)(activeIndex || 0);
|
|
13
|
+
const progressRef = (0, react_1.useRef)(null);
|
|
14
|
+
(0, react_1.useEffect)(() => {
|
|
15
|
+
if (!orientation || orientation === "horizontal") {
|
|
16
|
+
progressRef.current.style.width = `${(currentActive / (stepsItems.length - 1)) * 100}%`;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
progressRef.current.style.height = `${(currentActive / (stepsItems.length - 1)) * 100}%`;
|
|
20
|
+
}
|
|
21
|
+
}, [currentActive]);
|
|
22
|
+
const handleNext = () => {
|
|
23
|
+
if (currentActive > stepsItems.length) {
|
|
24
|
+
setCurrentActive(stepsItems.length);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
setCurrentActive(currentActive + 1);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const handlePrev = () => {
|
|
31
|
+
if (currentActive < 1) {
|
|
32
|
+
setCurrentActive(1);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
setCurrentActive(currentActive - 1);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const orientationClass = !orientation ? "horizontal" : orientation;
|
|
39
|
+
const userClassNames = !className ? "" : className;
|
|
40
|
+
if (!stepsItems) {
|
|
41
|
+
throw new Error("stepItems must be specified in order to generate steps");
|
|
42
|
+
}
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `progress-container flex justify-content-between relative ${orientationClass === "horizontal"
|
|
44
|
+
? "flex-row max-w-full"
|
|
45
|
+
: "flex-column max-h-full"} ${orientationClass} ${userClassNames}`, style: style }, { children: [(0, jsx_runtime_1.jsx)("div", { className: `progressbar bg-primary-600 absolute ${orientationClass}`, ref: progressRef }), stepsItems.map((eachItem, index) => ((0, jsx_runtime_1.jsxs)("section", Object.assign({ className: `progress-step-item ${orientationClass === "horizontal"
|
|
46
|
+
? "flex flex-column align-items-center gap-5"
|
|
47
|
+
: "flex align-items-start gap-5"} ${orientationClass}`, onClick: () => {
|
|
48
|
+
if (eachItem.action) {
|
|
49
|
+
eachItem.action();
|
|
50
|
+
}
|
|
51
|
+
} }, { children: [!icons ? ((0, jsx_runtime_1.jsx)(svg_component_1.default, { iconName: index === currentActive
|
|
52
|
+
? "step-current"
|
|
53
|
+
: index > currentActive
|
|
54
|
+
? "step-unvisited"
|
|
55
|
+
: "step-checked" })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: index === currentActive
|
|
56
|
+
? icons.current
|
|
57
|
+
: index > currentActive
|
|
58
|
+
? icons.unvisited
|
|
59
|
+
: icons.visited })), !eachItem.template ? ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "font-medium" }, { children: eachItem.title }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: `flex flex-column line-height-2 ${orientationClass === "horizontal"
|
|
60
|
+
? "align-items-center"
|
|
61
|
+
: "align-items-start"} ${orientationClass}` }, { children: eachItem.template })))] }), eachItem.id)))] })), withButtons && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `flex${orientationClass === "horizontal"
|
|
62
|
+
? ""
|
|
63
|
+
: " flex-column align-self-center"} gap-2 mt-5` }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ disabled: currentActive === 0, onClick: handlePrev }, { children: "Prev" })), (0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ disabled: currentActive === stepsItems.length - 1, onClick: handleNext }, { children: "Next" }))] })))] }));
|
|
64
|
+
};
|
|
65
|
+
exports.ProgressSteps = ProgressSteps;
|
|
66
|
+
const ProgressStepsComponent = () => {
|
|
67
|
+
const itemTemplate = (label, description) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-gray-700 font-semibold" }, { children: label })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-gray-600 font-normal" }, { children: description }))] }));
|
|
68
|
+
const items = [
|
|
69
|
+
{
|
|
70
|
+
id: "1",
|
|
71
|
+
template: itemTemplate("Your Details", "Provide Your Details"),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "2",
|
|
75
|
+
template: itemTemplate("Company details", "A few details of your company"),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "3",
|
|
79
|
+
template: itemTemplate("Invite your team", "Start collaborating"),
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column align-items-center justify-content-between gap-5 h-30rem" }, { children: [(0, jsx_runtime_1.jsx)(exports.ProgressSteps, { stepsItems: items }), (0, jsx_runtime_1.jsx)(exports.ProgressSteps, { stepsItems: items, orientation: "vertical" })] })));
|
|
83
|
+
};
|
|
84
|
+
exports.default = ProgressStepsComponent;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Chart = exports.ProgressSpinner = exports.Skeleton = exports.Chip = exports.Chips = exports.Rating = exports.InputTextarea = exports.InputSwitch = exports.InputMask = exports.SpeedDial = exports.SplitButton = exports.DataViewLayoutOptions = exports.DataView = exports.Toast = exports.InputNumber = exports.OverlayPanel = exports.Tag = exports.Carousel = exports.ToggleButton = exports.Slider = exports.Card = exports.Dialog = exports.Password = exports.confirmPopup = exports.ConfirmDialog = exports.RadioButton = exports.Badge = exports.Tooltip = exports.Calendar = exports.Image = exports.AvatarGroup = exports.Avatar = exports.classNames = exports.Paginator = exports.MultiSelect = exports.FileUpload = exports.TabMenu = exports.TabPanel = exports.TabView = exports.Sidebar = exports.Column = exports.DataTable = exports.Checkbox = exports.AutoComplete = exports.ColorPicker = exports.AccordionTab = exports.Accordion = exports.InputText = exports.Dropdown = exports.Button = void 0;
|
|
4
|
-
exports.ProgressBar = exports.Divider = exports.MegaMenu = exports.BreadCrumb = void 0;
|
|
4
|
+
exports.CircleProgressComponent = exports.ProgressSteps = exports.ProgressBar = exports.Divider = exports.MegaMenu = exports.BreadCrumb = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const client_1 = tslib_1.__importDefault(require("react-dom/client"));
|
|
@@ -112,4 +112,8 @@ var divider_1 = require("./components/divider/divider");
|
|
|
112
112
|
Object.defineProperty(exports, "Divider", { enumerable: true, get: function () { return tslib_1.__importDefault(divider_1).default; } });
|
|
113
113
|
var progress_bar_1 = require("./components/progress-bar/progress-bar");
|
|
114
114
|
Object.defineProperty(exports, "ProgressBar", { enumerable: true, get: function () { return tslib_1.__importDefault(progress_bar_1).default; } });
|
|
115
|
+
var progress_steps_1 = require("./components/progress-steps/progress-steps");
|
|
116
|
+
Object.defineProperty(exports, "ProgressSteps", { enumerable: true, get: function () { return tslib_1.__importDefault(progress_steps_1).default; } });
|
|
117
|
+
var circle_progress_bar_1 = require("./components/progress_bar_round/circle-progress-bar");
|
|
118
|
+
Object.defineProperty(exports, "CircleProgressComponent", { enumerable: true, get: function () { return tslib_1.__importDefault(circle_progress_bar_1).default; } });
|
|
115
119
|
client_1.default.createRoot(document.getElementById('root')).render((0, jsx_runtime_1.jsx)(App_1.default, {}));
|
|
@@ -6,7 +6,7 @@ const fileupload_1 = require("primereact/fileupload");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
|
|
8
8
|
const progressbar_1 = require("primereact/progressbar");
|
|
9
|
-
const circle_progress_bar_1 = tslib_1.__importDefault(require("
|
|
9
|
+
const circle_progress_bar_1 = tslib_1.__importDefault(require("../../components/progress_bar_round/circle-progress-bar"));
|
|
10
10
|
const checkbox_1 = require("primereact/checkbox");
|
|
11
11
|
require("./file-upload.scss");
|
|
12
12
|
// import { Checkbox } from "primereact/checkbox";
|
package/dist/pages/home.js
CHANGED
|
@@ -22,7 +22,7 @@ const tooltip_1 = tslib_1.__importDefault(require("./tooltip/tooltip"));
|
|
|
22
22
|
const loader_indicator_1 = tslib_1.__importDefault(require("./loader-indicator/loader-indicator"));
|
|
23
23
|
const pagination_1 = tslib_1.__importDefault(require("../pages/paginator/pagination"));
|
|
24
24
|
const shadows_1 = tslib_1.__importDefault(require("../pages/shadows/shadows"));
|
|
25
|
-
const progress_steps_1 = tslib_1.__importDefault(require("
|
|
25
|
+
const progress_steps_1 = tslib_1.__importDefault(require("../components/progress-steps/progress-steps"));
|
|
26
26
|
const tabs_1 = tslib_1.__importDefault(require("./tabs/tabs"));
|
|
27
27
|
const breadcrumb_1 = tslib_1.__importDefault(require("./breadcrumb/breadcrumb"));
|
|
28
28
|
const button_1 = tslib_1.__importDefault(require("./button/button"));
|
|
@@ -5,8 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const progressbar_1 = require("primereact/progressbar");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const slider_1 = require("primereact/slider");
|
|
8
|
-
const circle_progress_bar_1 = tslib_1.__importDefault(require("
|
|
9
|
-
const half_circle_progres_bar_1 = tslib_1.__importDefault(require("
|
|
8
|
+
const circle_progress_bar_1 = tslib_1.__importDefault(require("../../components/progress_bar_round/circle-progress-bar"));
|
|
9
|
+
const half_circle_progres_bar_1 = tslib_1.__importDefault(require("../../components/progress_bar_round/half-circle-progres-bar"));
|
|
10
10
|
require("./progress-bar.scss");
|
|
11
11
|
const ProgressBarComponent = () => {
|
|
12
12
|
const [value, setValue] = (0, react_1.useState)("");
|
|
@@ -16,12 +16,12 @@ const ProgressBarComponent = () => {
|
|
|
16
16
|
left: `${value}%`,
|
|
17
17
|
transition: "left 1s ease-in-out",
|
|
18
18
|
transform: "translate(-50%, -50%)",
|
|
19
|
-
}, className: "px-3 p-progress-value h-2rem border-1 border-gray-200 py-2 flex align-items-center border-round-lg text-center text-sm" }, { children: [value, "%"] }))] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: " col-6 md:col-4 lg:col-3 px-7 flex flex-column justify-content-center" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [(0, jsx_runtime_1.jsx)(progressbar_1.ProgressBar, { value: value, className: "w-10" }), (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: " px-3 w-2 flex align-items-start text-center text-sm" }, { children: [value, "%"] }))] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: " col-6 md:col-4 lg:col-3 px-7 flex flex-column justify-content-center" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "relative " }, { children: [(0, jsx_runtime_1.jsx)(progressbar_1.ProgressBar, { value: value }), (0, jsx_runtime_1.jsxs)("span", Object.assign({ style: {
|
|
19
|
+
}, className: "px-3 p-progress-value bg-white shadow-3 h-2rem border-1 border-gray-200 py-2 flex align-items-center border-round-lg text-center text-sm" }, { children: [value, "%"] }))] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: " col-6 md:col-4 lg:col-3 px-7 flex flex-column justify-content-center" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [(0, jsx_runtime_1.jsx)(progressbar_1.ProgressBar, { value: value, className: "w-10" }), (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: " px-3 w-2 flex align-items-start text-center text-sm" }, { children: [value, "%"] }))] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: " col-6 md:col-4 lg:col-3 px-7 flex flex-column justify-content-center" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "relative " }, { children: [(0, jsx_runtime_1.jsx)(progressbar_1.ProgressBar, { value: value }), (0, jsx_runtime_1.jsxs)("span", Object.assign({ style: {
|
|
20
20
|
position: "absolute",
|
|
21
21
|
top: -24,
|
|
22
22
|
left: `${value}%`,
|
|
23
23
|
transition: "left 1s ease-in-out",
|
|
24
24
|
transform: "translate(-50%, -50%)",
|
|
25
|
-
}, className: "p-progress-value h-2rem px-3 border-1 border-gray-200 py-2 flex align-items-center border-round-lg text-center text-sm" }, { children: [value, "%"] }))] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "col-6 md:col-4 lg:col-3 px-7 mt-8 flex flex-column justify-content-center" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column align-items-end" }, { children: [(0, jsx_runtime_1.jsx)(progressbar_1.ProgressBar, { value: value, className: "w-full" }), (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "p-progress-value py-2 flex align-items-center text-center text-sm" }, { children: [value, "%"] }))] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "col-6 md:col-4 lg:col-3 px-7 mt-8 flex flex-column justify-content-center" }, { children: (0, jsx_runtime_1.jsx)(circle_progress_bar_1.default, { text: "Active users", value: value, height: 200, strokeColor: "var(--primary-500)", strokeWidth: 8, strokeBgColor: "var(--gray-300)" }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "col-6 md:col-4 lg:col-3 px-7 mt-8 flex flex-column justify-content-center" }, { children: (0, jsx_runtime_1.jsx)(half_circle_progres_bar_1.default, { text: "Active users", value: value, height: 200, strokeColor: "var(--primary-500)", strokeWidth: 8, strokeBgColor: "var(--gray-300)" }) }))] })) }))] }));
|
|
25
|
+
}, className: "p-progress-value bg-white shadow-3 h-2rem px-3 border-1 border-gray-200 py-2 flex align-items-center border-round-lg text-center text-sm" }, { children: [value, "%"] }))] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "col-6 md:col-4 lg:col-3 px-7 mt-8 flex flex-column justify-content-center" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column align-items-end" }, { children: [(0, jsx_runtime_1.jsx)(progressbar_1.ProgressBar, { value: value, className: "w-full" }), (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "p-progress-value bg-white shadow-3 py-2 flex align-items-center text-center text-sm" }, { children: [value, "%"] }))] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "col-6 md:col-4 lg:col-3 px-7 mt-8 flex flex-column justify-content-center" }, { children: (0, jsx_runtime_1.jsx)(circle_progress_bar_1.default, { text: "Active users", value: value, height: 200, strokeColor: "var(--primary-500)", strokeWidth: 8, strokeBgColor: "var(--gray-300)" }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "col-6 md:col-4 lg:col-3 px-7 mt-8 flex flex-column justify-content-center" }, { children: (0, jsx_runtime_1.jsx)(half_circle_progres_bar_1.default, { text: "Active users", value: value, height: 200, strokeColor: "var(--primary-500)", strokeWidth: 8, strokeBgColor: "var(--gray-300)" }) }))] })) }))] }));
|
|
26
26
|
};
|
|
27
27
|
exports.default = ProgressBarComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./progress-steps.scss";
|
|
2
|
-
import { StepsItemProps } from "
|
|
2
|
+
import { StepsItemProps } from "../../pages/types/type";
|
|
3
3
|
export declare const ProgressSteps: (props: StepsItemProps) => JSX.Element;
|
|
4
4
|
declare const ProgressStepsComponent: () => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default ProgressStepsComponent;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DropdownChangeEvent } from 'primereact/dropdown';
|
|
2
2
|
import { ColorPickerChangeEvent } from 'primereact/colorpicker';
|
|
3
3
|
import { SliderChangeEvent } from 'primereact/slider';
|
|
4
|
+
import { FileUploadHandlerEvent, FileUploadHeaderTemplateOptions, FileUploadSelectEvent, FileUploadUploadEvent, ItemTemplateOptions } from 'primereact/fileupload';
|
|
4
5
|
import { CarouselResponsiveOption } from 'primereact/carousel';
|
|
5
6
|
import { MenuItem } from 'primereact/menuitem';
|
|
6
7
|
export { default as Button } from './components/button/button';
|
|
@@ -54,4 +55,6 @@ export { default as BreadCrumb } from './components/breadcrumb/breacrumb';
|
|
|
54
55
|
export { default as MegaMenu } from './components/megamenu/mega-menu';
|
|
55
56
|
export { default as Divider } from './components/divider/divider';
|
|
56
57
|
export { default as ProgressBar } from './components/progress-bar/progress-bar';
|
|
57
|
-
export
|
|
58
|
+
export { default as ProgressSteps } from './components/progress-steps/progress-steps';
|
|
59
|
+
export { default as CircleProgressComponent } from './components/progress_bar_round/circle-progress-bar';
|
|
60
|
+
export type { DropdownChangeEvent, CarouselResponsiveOption, ColorPickerChangeEvent, SliderChangeEvent, MenuItem, FileUploadHandlerEvent, FileUploadHeaderTemplateOptions, FileUploadSelectEvent, FileUploadUploadEvent, ItemTemplateOptions };
|
|
@@ -8,14 +8,22 @@ export interface CustomActionEvent {
|
|
|
8
8
|
}
|
|
9
9
|
export interface StepItem {
|
|
10
10
|
id: string;
|
|
11
|
-
|
|
11
|
+
title?: string;
|
|
12
|
+
template?: JSX.Element;
|
|
12
13
|
action?(event?: CustomActionEvent): void;
|
|
13
14
|
style?: React.CSSProperties | undefined;
|
|
14
15
|
className?: string | undefined;
|
|
15
16
|
}
|
|
17
|
+
export interface StepIcons {
|
|
18
|
+
unvisited: React.HTMLAttributes<HTMLSpanElement | SVGSVGElement> | undefined;
|
|
19
|
+
visited: React.HTMLAttributes<HTMLSpanElement | SVGSVGElement> | undefined;
|
|
20
|
+
current: React.HTMLAttributes<HTMLSpanElement | SVGSVGElement> | undefined;
|
|
21
|
+
}
|
|
16
22
|
export interface StepsItemProps {
|
|
17
23
|
stepsItems: StepItem[];
|
|
18
24
|
orientation?: "horizontal" | "vertical";
|
|
25
|
+
withButtons?: boolean;
|
|
26
|
+
icons?: StepIcons;
|
|
19
27
|
activeIndex?: number;
|
|
20
28
|
style?: React.CSSProperties | undefined;
|
|
21
29
|
className?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProgressSteps = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const button_1 = require("primereact/button");
|
|
7
|
-
const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
|
|
8
|
-
require("./progress-steps.scss");
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const ProgressSteps = (props) => {
|
|
11
|
-
const { stepsItems, orientation, activeIndex, className, style } = props;
|
|
12
|
-
const [currentActive, setCurrentActive] = (0, react_1.useState)(activeIndex || 0);
|
|
13
|
-
const progressRef = (0, react_1.useRef)(null);
|
|
14
|
-
(0, react_1.useEffect)(() => {
|
|
15
|
-
if (!orientation || orientation === "horizontal") {
|
|
16
|
-
progressRef.current.style.width = `${(currentActive / (stepsItems.length - 1)) * 100}%`;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
progressRef.current.style.height = `${(currentActive / (stepsItems.length - 1)) * 100}%`;
|
|
20
|
-
}
|
|
21
|
-
}, [currentActive]);
|
|
22
|
-
const handleNext = () => {
|
|
23
|
-
if (currentActive > stepsItems.length) {
|
|
24
|
-
setCurrentActive(stepsItems.length);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
setCurrentActive(currentActive + 1);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const handlePrev = () => {
|
|
31
|
-
if (currentActive < 1) {
|
|
32
|
-
setCurrentActive(1);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
setCurrentActive(currentActive - 1);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const orientationClass = !orientation ? "horizontal" : orientation;
|
|
39
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `progress-container mb-2 ${orientationClass} ${className}`, style: style }, { children: [(0, jsx_runtime_1.jsx)("div", { className: `progressbar ${orientationClass}`, ref: progressRef }), stepsItems.map((eachItem, index) => ((0, jsx_runtime_1.jsxs)("section", Object.assign({ className: `progress-step-item ${orientationClass}`, onClick: () => {
|
|
40
|
-
if (eachItem.action) {
|
|
41
|
-
eachItem.action();
|
|
42
|
-
}
|
|
43
|
-
} }, { children: [(0, jsx_runtime_1.jsx)(svg_component_1.default, { iconName: index === currentActive
|
|
44
|
-
? "step-current"
|
|
45
|
-
: index > currentActive
|
|
46
|
-
? "step-unvisited"
|
|
47
|
-
: "step-checked" }), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: eachItem.template })] }), eachItem.id)))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex gap-2 mt-8" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ disabled: currentActive === 0, onClick: handlePrev }, { children: "Prev" })), (0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ disabled: currentActive === stepsItems.length - 1, onClick: handleNext }, { children: "Next" }))] }))] }));
|
|
48
|
-
};
|
|
49
|
-
exports.ProgressSteps = ProgressSteps;
|
|
50
|
-
const ProgressStepsComponent = () => {
|
|
51
|
-
const itemTemplate = (label, description, orientation = "horizontal") => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `step-item-data ${orientation}` }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-gray-700 font-semibold" }, { children: label })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-gray-600 font-normal" }, { children: description }))] })));
|
|
52
|
-
const itemsHorizontal = [
|
|
53
|
-
{
|
|
54
|
-
id: "1",
|
|
55
|
-
template: itemTemplate("Your Details", "Please provide Your Details"),
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id: "2",
|
|
59
|
-
template: itemTemplate("Company details", "A few details about your company"),
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: "3",
|
|
63
|
-
template: itemTemplate("Invite your team", "Start collaborating with your team"),
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
const itemsVertical = [
|
|
67
|
-
{
|
|
68
|
-
id: "1",
|
|
69
|
-
template: itemTemplate("Your Details", "Please provide Your Details", "vertical"),
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: "2",
|
|
73
|
-
template: itemTemplate("Company details", "A few details about your company", "vertical"),
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: "3",
|
|
77
|
-
template: itemTemplate("Invite your team", "Start collaborating with your team", "vertical"),
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column gap-8 ml-8 mt-8 pl-8" }, { children: [(0, jsx_runtime_1.jsx)(exports.ProgressSteps, { stepsItems: itemsHorizontal }), (0, jsx_runtime_1.jsx)(exports.ProgressSteps, { stepsItems: itemsVertical, orientation: "vertical" })] })));
|
|
81
|
-
};
|
|
82
|
-
exports.default = ProgressStepsComponent;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|