ar-design 0.1.36 → 0.1.37
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/css/components/navigation/steps/steps.css +8 -3
- package/dist/components/feedback/confirm/index.d.ts +2 -1
- package/dist/components/feedback/confirm/index.js +3 -2
- package/dist/components/navigation/steps/IProps.d.ts +2 -1
- package/dist/components/navigation/steps/index.js +15 -3
- package/dist/libs/core/service/index.js +1 -2
- package/package.json +1 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
.ar-steps {
|
|
2
|
-
}
|
|
3
1
|
.ar-steps > .steps {
|
|
4
2
|
display: flex;
|
|
5
3
|
flex-direction: row;
|
|
@@ -131,7 +129,14 @@
|
|
|
131
129
|
letter-spacing: 1px;
|
|
132
130
|
}
|
|
133
131
|
|
|
134
|
-
.ar-steps > .content {
|
|
132
|
+
.ar-steps > .content > .buttons {
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: row;
|
|
135
|
+
justify-content: flex-end;
|
|
136
|
+
gap: 0 1rem;
|
|
137
|
+
margin-top: 2.5rem;
|
|
138
|
+
padding-top: 2.5rem;
|
|
139
|
+
border-top: solid 4px var(--gray-100);
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
@import url("./animation.css");
|
|
@@ -3,7 +3,8 @@ import "../../../assets/css/components/feedback/confirm/confirm.css";
|
|
|
3
3
|
import { IChildren } from "../../../libs/types/IGlobalProps";
|
|
4
4
|
declare const Confirm: React.FC<{
|
|
5
5
|
title: string;
|
|
6
|
-
message
|
|
6
|
+
message?: string;
|
|
7
|
+
content?: React.JSX.Element;
|
|
7
8
|
onConfirm: (confirm: boolean) => void;
|
|
8
9
|
} & IChildren>;
|
|
9
10
|
export default Confirm;
|
|
@@ -4,7 +4,7 @@ import "../../../assets/css/components/feedback/confirm/confirm.css";
|
|
|
4
4
|
import Button from "../../form/button";
|
|
5
5
|
import Typography from "../../data-display/typography";
|
|
6
6
|
const { Title } = Typography;
|
|
7
|
-
const Confirm = ({ children, title, message, onConfirm }) => {
|
|
7
|
+
const Confirm = ({ children, title, message, content, onConfirm }) => {
|
|
8
8
|
// refs
|
|
9
9
|
const _arConfirmWrapper = useRef(null);
|
|
10
10
|
const _arConfirm = useRef(null);
|
|
@@ -42,7 +42,8 @@ const Confirm = ({ children, title, message, onConfirm }) => {
|
|
|
42
42
|
return (React.createElement("div", { ref: _arConfirmWrapper, className: "ar-confirm-wrapper", role: "dialog" },
|
|
43
43
|
React.createElement("div", { ref: _arConfirm, className: `ar-confirm ${open ? "opened" : "closed"}`, style: { top: coordinateY, left: coordinateX } },
|
|
44
44
|
React.createElement(Title, { Level: "h4" }, title),
|
|
45
|
-
React.createElement("p", { className: "message" }, message),
|
|
45
|
+
message && React.createElement("p", { className: "message" }, message),
|
|
46
|
+
content && React.createElement("div", { className: "content" }, content),
|
|
46
47
|
React.createElement("div", { className: "footer" },
|
|
47
48
|
React.createElement(Button, { status: "success", size: "small", onClick: () => {
|
|
48
49
|
onConfirm(true);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { StepProps } from "../../../libs/types";
|
|
2
|
+
import { IChildren } from "../../../libs/types/IGlobalProps";
|
|
2
3
|
/**
|
|
3
4
|
* Stepper component props
|
|
4
5
|
*/
|
|
5
|
-
interface IProps {
|
|
6
|
+
interface IProps extends IChildren {
|
|
6
7
|
/**
|
|
7
8
|
* Step'leri temsil eden dizisi.
|
|
8
9
|
* Her bir `Step` için gerekli özellikler `StepProps` tipinde olmalıdır.
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import React, { useState } from "react";
|
|
3
3
|
import "../../../assets/css/components/navigation/steps/steps.css";
|
|
4
4
|
import Typography from "../../data-display/typography";
|
|
5
|
+
import Button from "../../form/button";
|
|
5
6
|
const { Title } = Typography;
|
|
6
|
-
const Steps = ({ steps = [], onChange }) => {
|
|
7
|
+
const Steps = ({ children, steps = [], onChange }) => {
|
|
7
8
|
// states
|
|
8
9
|
const [currentStep, setCurrentStep] = useState(0);
|
|
9
10
|
// methods
|
|
@@ -24,7 +25,7 @@ const Steps = ({ steps = [], onChange }) => {
|
|
|
24
25
|
itemIcon.push(changeItemIcon(currentStep, index));
|
|
25
26
|
return (React.createElement("div", { key: step.title || index, className: "item", onClick: () => {
|
|
26
27
|
setCurrentStep(index);
|
|
27
|
-
onChange(index
|
|
28
|
+
onChange(index);
|
|
28
29
|
} },
|
|
29
30
|
React.createElement("div", { className: itemIcon.map((c) => c).join(" ") },
|
|
30
31
|
React.createElement("span", { className: changeItemIcon(currentStep, index) })),
|
|
@@ -34,6 +35,17 @@ const Steps = ({ steps = [], onChange }) => {
|
|
|
34
35
|
index + 1),
|
|
35
36
|
React.createElement(Title, { Level: "h3" }, step.title))));
|
|
36
37
|
})),
|
|
37
|
-
React.createElement("div", { className: "content" },
|
|
38
|
+
React.createElement("div", { className: "content" },
|
|
39
|
+
steps.map((step, index) => currentStep === index && step.content),
|
|
40
|
+
React.createElement("div", { className: "buttons" },
|
|
41
|
+
currentStep > 0 && (React.createElement(Button, { status: "light", onClick: () => {
|
|
42
|
+
setCurrentStep((prev) => prev - 1);
|
|
43
|
+
onChange(currentStep - 1);
|
|
44
|
+
} }, "Geri")),
|
|
45
|
+
children && children,
|
|
46
|
+
currentStep < steps.length - 1 && (React.createElement(Button, { onClick: () => {
|
|
47
|
+
setCurrentStep((prev) => prev + 1);
|
|
48
|
+
onChange(currentStep + 1);
|
|
49
|
+
} }, "\u0130leri"))))));
|
|
38
50
|
};
|
|
39
51
|
export default Steps;
|
|
@@ -39,8 +39,7 @@ class Service {
|
|
|
39
39
|
});
|
|
40
40
|
const text = (await response.text()).trim();
|
|
41
41
|
return {
|
|
42
|
-
|
|
43
|
-
data: text.length > 0 ? JSON.parse(text) : null,
|
|
42
|
+
data: text.length > 0 ? (typeof text !== "string" ? JSON.parse(text) : text) : null,
|
|
44
43
|
__ok__: response.ok,
|
|
45
44
|
__statusCode__: response.status,
|
|
46
45
|
__statusText__: response.statusText,
|