@sydsoft/base 1.56.0 → 1.58.0
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/package.json +7 -7
- package/dist/esm/_lib/baseFunctions.d.ts +0 -11
- package/dist/esm/_lib/baseFunctions.js +0 -97
- package/dist/esm/_lib/inputMask.d.ts +0 -7
- package/dist/esm/_lib/inputMask.js +0 -229
- package/dist/esm/_lib/listFunctions.d.ts +0 -2
- package/dist/esm/_lib/listFunctions.js +0 -114
- package/dist/esm/_lib/storage/cookies.d.ts +0 -4
- package/dist/esm/_lib/storage/cookies.js +0 -34
- package/dist/esm/_lib/storage/encData.d.ts +0 -2
- package/dist/esm/_lib/storage/encData.js +0 -43
- package/dist/esm/_lib/storage/localStorage.d.ts +0 -6
- package/dist/esm/_lib/storage/localStorage.js +0 -69
- package/dist/esm/_lib/storage/sessionStorage.d.ts +0 -6
- package/dist/esm/_lib/storage/sessionStorage.js +0 -69
- package/dist/esm/_lib/useInterval.d.ts +0 -6
- package/dist/esm/_lib/useInterval.js +0 -24
- package/dist/esm/alert/index.d.ts +0 -18
- package/dist/esm/alert/index.js +0 -107
- package/dist/esm/alert/index.module.css +0 -119
- package/dist/esm/box/Box.d.ts +0 -9
- package/dist/esm/box/Box.js +0 -15
- package/dist/esm/box/Box.module.css +0 -153
- package/dist/esm/box/BoxContent.d.ts +0 -9
- package/dist/esm/box/BoxContent.js +0 -7
- package/dist/esm/box/BoxFooter.d.ts +0 -10
- package/dist/esm/box/BoxFooter.js +0 -8
- package/dist/esm/box/BoxHeader.d.ts +0 -16
- package/dist/esm/box/BoxHeader.js +0 -9
- package/dist/esm/box/index.d.ts +0 -9
- package/dist/esm/box/index.js +0 -9
- package/dist/esm/countDown/index.d.ts +0 -22
- package/dist/esm/countDown/index.js +0 -97
- package/dist/esm/dateTime/index.d.ts +0 -12
- package/dist/esm/dateTime/index.js +0 -76
- package/dist/esm/form/Button.d.ts +0 -27
- package/dist/esm/form/Button.js +0 -76
- package/dist/esm/form/Checkbox.d.ts +0 -23
- package/dist/esm/form/Checkbox.js +0 -23
- package/dist/esm/form/Dialog.d.ts +0 -20
- package/dist/esm/form/Dialog.js +0 -40
- package/dist/esm/form/Form.d.ts +0 -10
- package/dist/esm/form/Form.js +0 -12
- package/dist/esm/form/FormOlustur.d.ts +0 -39
- package/dist/esm/form/FormOlustur.js +0 -52
- package/dist/esm/form/Input.d.ts +0 -66
- package/dist/esm/form/Input.js +0 -196
- package/dist/esm/form/Label.d.ts +0 -7
- package/dist/esm/form/Label.js +0 -9
- package/dist/esm/form/SearchableInput.d.ts +0 -37
- package/dist/esm/form/SearchableInput.js +0 -272
- package/dist/esm/form/UploadBase.d.ts +0 -25
- package/dist/esm/form/UploadBase.js +0 -86
- package/dist/esm/form/index.d.ts +0 -9
- package/dist/esm/form/index.js +0 -9
- package/dist/esm/form/styles/Button.module.css +0 -145
- package/dist/esm/form/styles/Input.module.css +0 -221
- package/dist/esm/form/styles/Label.module.css +0 -31
- package/dist/esm/form/styles/SearchableInput.module.css +0 -80
- package/dist/esm/grid/index.d.ts +0 -38
- package/dist/esm/grid/index.js +0 -97
- package/dist/esm/grid/index.module.css +0 -805
- package/dist/esm/icon/icons.d.ts +0 -22
- package/dist/esm/icon/icons.js +0 -23
- package/dist/esm/icon/index.d.ts +0 -34
- package/dist/esm/icon/index.js +0 -26
- package/dist/esm/icon/mui.d.ts +0 -1
- package/dist/esm/icon/mui.js +0 -1
- package/dist/esm/index.d.ts +0 -19
- package/dist/esm/index.js +0 -19
- package/dist/esm/menu/index.d.ts +0 -69
- package/dist/esm/menu/index.js +0 -52
- package/dist/esm/menu/index.module.css +0 -92
- package/dist/esm/modal/index.d.ts +0 -23
- package/dist/esm/modal/index.js +0 -66
- package/dist/esm/modal/index.module.css +0 -77
- package/dist/esm/popover/index.d.ts +0 -26
- package/dist/esm/popover/index.js +0 -343
- package/dist/esm/popover/index.module.css +0 -89
- package/dist/esm/tooltip/index.d.ts +0 -11
- package/dist/esm/tooltip/index.js +0 -119
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useInterval } from '../_lib/useInterval';
|
|
4
|
-
export var useCountDown = function (_a) {
|
|
5
|
-
var _b = _a.autoStart, autoStart = _b === void 0 ? false : _b, onComplete = _a.onComplete, getStatus = _a.getStatus, targetTime = _a.targetTime, _c = _a.timerType, timerType = _c === void 0 ? 'countdown' : _c, _d = _a.countType, countType = _d === void 0 ? 'seconds' : _d, _e = _a.speed, speed = _e === void 0 ? 1000 : _e, hide = _a.hide;
|
|
6
|
-
var refCountDownRender = useRef(null);
|
|
7
|
-
var _f = useState(timerType === 'datetime' || autoStart), enabled = _f[0], setEnabled = _f[1];
|
|
8
|
-
var _g = useState(0), timer = _g[0], setTimer = _g[1];
|
|
9
|
-
var _h = useState(typeof speed === 'number' && speed > 0 ? speed : 1000), timerSpeed = _h[0], setTimerSpeed = _h[1];
|
|
10
|
-
useEffect(function () { return prepareTimer(targetTime); }, [targetTime]);
|
|
11
|
-
useEffect(function () {
|
|
12
|
-
if (!hide)
|
|
13
|
-
render();
|
|
14
|
-
}, [timer]);
|
|
15
|
-
useInterval(function () {
|
|
16
|
-
if (enabled) {
|
|
17
|
-
if (timer <= 1) {
|
|
18
|
-
stopCountDown();
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
setTimer(timer - 1);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}, enabled ? timerSpeed : null);
|
|
25
|
-
var prepareTimer = function (timeORstring) {
|
|
26
|
-
if (timerType === 'datetime') {
|
|
27
|
-
setTimer(Math.floor((new Date(timeORstring).getTime() - new Date().getTime()) / 1000));
|
|
28
|
-
setEnabled(true);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
setTimer(timeORstring);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
var stopCountDown = function () {
|
|
35
|
-
setTimer(0);
|
|
36
|
-
setEnabled(false);
|
|
37
|
-
if ((enabled && onComplete) || (timerType === 'datetime' && onComplete)) {
|
|
38
|
-
onComplete();
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var padNumber = function (num, padLength, padString) {
|
|
42
|
-
if (padLength === void 0) { padLength = 2; }
|
|
43
|
-
if (padString === void 0) { padString = '0'; }
|
|
44
|
-
return (typeof targetTime === 'number' && targetTime < 10 ? num : String(num).padStart(padLength, padString));
|
|
45
|
-
};
|
|
46
|
-
var render = function () {
|
|
47
|
-
var days = 0, hours = 0, minutes = 0, seconds = timer;
|
|
48
|
-
if (countType === 'minutes:seconds') {
|
|
49
|
-
minutes = Math.floor(seconds / 60);
|
|
50
|
-
seconds -= minutes * 60;
|
|
51
|
-
}
|
|
52
|
-
else if (countType === 'hours:minutes:seconds') {
|
|
53
|
-
hours = Math.floor(seconds / (60 * 60));
|
|
54
|
-
seconds -= hours * 60 * 60;
|
|
55
|
-
minutes = Math.floor(seconds / 60);
|
|
56
|
-
seconds -= minutes * 60;
|
|
57
|
-
}
|
|
58
|
-
else if (countType === 'days:hours:minutes:seconds') {
|
|
59
|
-
days = Math.floor(seconds / (60 * 60 * 24));
|
|
60
|
-
seconds -= days * 60 * 60 * 24;
|
|
61
|
-
hours = Math.floor(seconds / (60 * 60));
|
|
62
|
-
seconds -= hours * 60 * 60;
|
|
63
|
-
minutes = Math.floor(seconds / 60);
|
|
64
|
-
seconds -= minutes * 60;
|
|
65
|
-
}
|
|
66
|
-
seconds = Math.floor(seconds);
|
|
67
|
-
if (getStatus && timer > 0)
|
|
68
|
-
getStatus({ days: days, hours: hours, minutes: minutes, seconds: seconds, timer: timer });
|
|
69
|
-
if (refCountDownRender.current) {
|
|
70
|
-
var getPadValues = function (div) {
|
|
71
|
-
var length = div.dataset.padlength || 2;
|
|
72
|
-
var string = div.dataset.padstring || '0';
|
|
73
|
-
return { length: length, string: string };
|
|
74
|
-
};
|
|
75
|
-
var divGun = refCountDownRender.current.querySelector("[data-name='days']");
|
|
76
|
-
if (divGun)
|
|
77
|
-
divGun.innerHTML = padNumber(days, getPadValues(divGun).length, getPadValues(divGun).string).toString();
|
|
78
|
-
var divSaat = refCountDownRender.current.querySelector("[data-name='hours']");
|
|
79
|
-
if (divSaat)
|
|
80
|
-
divSaat.innerHTML = padNumber(hours, getPadValues(divSaat).length, getPadValues(divSaat).string).toString();
|
|
81
|
-
var divDakika = refCountDownRender.current.querySelector("[data-name='minutes']");
|
|
82
|
-
if (divDakika)
|
|
83
|
-
divDakika.innerHTML = padNumber(minutes, getPadValues(divDakika).length, getPadValues(divDakika).string).toString();
|
|
84
|
-
var divSaniye = refCountDownRender.current.querySelector("[data-name='seconds']");
|
|
85
|
-
if (divSaniye)
|
|
86
|
-
divSaniye.innerHTML = padNumber(seconds, getPadValues(divSaniye).length, getPadValues(divSaniye).string).toString();
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
return {
|
|
90
|
-
ComponentCountDown: function (children) { return (hide ? null : React.cloneElement(children, { ref: refCountDownRender })); },
|
|
91
|
-
startCountDown: function () { return setEnabled(true); },
|
|
92
|
-
stopCountDown: function () { return setEnabled(false); },
|
|
93
|
-
setTargetTime: function (targetTime) { return prepareTimer(targetTime); },
|
|
94
|
-
setTimerSpeed: function (timerSpeed) { return setTimerSpeed(timerSpeed); },
|
|
95
|
-
getChildrenRef: function () { return refCountDownRender.current || null; }
|
|
96
|
-
};
|
|
97
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export default class dateTime {
|
|
2
|
-
private datetime;
|
|
3
|
-
private resut_format;
|
|
4
|
-
constructor(datetime?: Date | string | null, format?: string);
|
|
5
|
-
addDays(days: number): this;
|
|
6
|
-
private parse;
|
|
7
|
-
getResult(): string;
|
|
8
|
-
format(format?: string): this;
|
|
9
|
-
today(): string;
|
|
10
|
-
getTime(): number;
|
|
11
|
-
nextMonthFirstDay(format?: string): string;
|
|
12
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var dateTime = /** @class */ (function () {
|
|
2
|
-
function dateTime(datetime, format) {
|
|
3
|
-
if (datetime === void 0) { datetime = null; }
|
|
4
|
-
if (format === void 0) { format = "y-m-d h:i:s"; }
|
|
5
|
-
this.resut_format = "y-m-d h:i:s";
|
|
6
|
-
this.format(format);
|
|
7
|
-
this.datetime = datetime !== "0000-00-00 00:00:00" && datetime !== "0000-00-00" && datetime ? datetime : new Date().toISOString(); // GMT ekli halde
|
|
8
|
-
return this;
|
|
9
|
-
}
|
|
10
|
-
dateTime.prototype.addDays = function (days) {
|
|
11
|
-
var datetime = new Date(this.datetime);
|
|
12
|
-
datetime.setDate(datetime.getDate() + days);
|
|
13
|
-
this.datetime = datetime.toISOString();
|
|
14
|
-
return this;
|
|
15
|
-
};
|
|
16
|
-
dateTime.prototype.parse = function () {
|
|
17
|
-
var datetime = new Date(this.datetime);
|
|
18
|
-
var monthNames = ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"];
|
|
19
|
-
var dayNames = ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"];
|
|
20
|
-
return {
|
|
21
|
-
y: datetime.getFullYear().toString(),
|
|
22
|
-
m: (datetime.getMonth() + 1).toString().padStart(2, "0"),
|
|
23
|
-
d: datetime.getDate().toString().padStart(2, "0"),
|
|
24
|
-
h: datetime.getHours().toString().padStart(2, "0"),
|
|
25
|
-
i: datetime.getMinutes().toString().padStart(2, "0"),
|
|
26
|
-
s: datetime.getSeconds().toString().padStart(2, "0"),
|
|
27
|
-
ms: (datetime.getMilliseconds() / 10).toFixed(0).toString().padStart(2, "0"),
|
|
28
|
-
z: (datetime.getTimezoneOffset() / 60).toString(),
|
|
29
|
-
// TAM STRING ICEREN IFADELER SONA EKLENMELI
|
|
30
|
-
TAMAY: monthNames[datetime.getMonth()],
|
|
31
|
-
TAMGUN: dayNames[datetime.getDay()]
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
dateTime.prototype.getResult = function () {
|
|
35
|
-
var parse = this.parse();
|
|
36
|
-
var result = this.resut_format;
|
|
37
|
-
result = result.replace(new RegExp("y", "g"), parse.y.toString());
|
|
38
|
-
result = result.replace(new RegExp("m", "g"), parse.m.toString());
|
|
39
|
-
result = result.replace(new RegExp("d", "g"), parse.d.toString());
|
|
40
|
-
result = result.replace(new RegExp("h", "g"), parse.h.toString());
|
|
41
|
-
result = result.replace(new RegExp("i", "g"), parse.i.toString());
|
|
42
|
-
result = result.replace(new RegExp("s", "g"), parse.s.toString());
|
|
43
|
-
result = result.replace(new RegExp("ms", "g"), parse.ms.toString());
|
|
44
|
-
result = result.replace(new RegExp("z", "g"), parse.z.toString());
|
|
45
|
-
result = result.replace(new RegExp("TAMAY", "g"), parse.TAMAY.toString());
|
|
46
|
-
result = result.replace(new RegExp("TAMGUN", "g"), parse.TAMGUN.toString());
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
dateTime.prototype.format = function (format) {
|
|
50
|
-
if (format === void 0) { format = "y-m-d h:i:s"; }
|
|
51
|
-
this.resut_format = format;
|
|
52
|
-
return this;
|
|
53
|
-
};
|
|
54
|
-
dateTime.prototype.today = function () {
|
|
55
|
-
this.datetime = new Date().toISOString();
|
|
56
|
-
this.format("y-m-d");
|
|
57
|
-
return this.getResult();
|
|
58
|
-
};
|
|
59
|
-
dateTime.prototype.getTime = function () {
|
|
60
|
-
var convertDateTime = new dateTime(this.datetime).format("y-m-d h:i:s").getResult();
|
|
61
|
-
var datetime = new Date(convertDateTime);
|
|
62
|
-
return datetime.getTime();
|
|
63
|
-
};
|
|
64
|
-
dateTime.prototype.nextMonthFirstDay = function (format) {
|
|
65
|
-
if (format === void 0) { format = "y-m-d"; }
|
|
66
|
-
// Verilen tarihin bir sonraki ayının ilk gününü bul
|
|
67
|
-
this.datetime = new Date(this.datetime);
|
|
68
|
-
this.datetime.setMonth(this.datetime.getMonth() + 1);
|
|
69
|
-
this.datetime.setDate(1);
|
|
70
|
-
this.datetime = this.datetime.toISOString();
|
|
71
|
-
this.format(format);
|
|
72
|
-
return this.getResult();
|
|
73
|
-
};
|
|
74
|
-
return dateTime;
|
|
75
|
-
}());
|
|
76
|
-
export default dateTime;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { propsDialog } from "./Dialog";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { typeTooltipPosition } from "../tooltip";
|
|
4
|
-
interface Props {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
onlyIcon?: React.ReactNode;
|
|
7
|
-
buttonClass?: "default" | "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link";
|
|
8
|
-
buttonSize?: "small" | "medium" | "large";
|
|
9
|
-
autoFocus?: boolean;
|
|
10
|
-
hidden?: boolean;
|
|
11
|
-
component?: "button" | "a" | "div" | any;
|
|
12
|
-
className?: string;
|
|
13
|
-
type?: "submit" | "reset" | "button";
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
fullWidth?: boolean;
|
|
16
|
-
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
17
|
-
href?: string | undefined;
|
|
18
|
-
target?: string | undefined;
|
|
19
|
-
style?: React.CSSProperties;
|
|
20
|
-
tabIndex?: number;
|
|
21
|
-
title?: string;
|
|
22
|
-
titlePosition?: typeTooltipPosition;
|
|
23
|
-
titleArrow?: boolean;
|
|
24
|
-
dialog?: propsDialog;
|
|
25
|
-
}
|
|
26
|
-
export declare const Button: React.NamedExoticComponent<Props>;
|
|
27
|
-
export {};
|
package/dist/esm/form/Button.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Dialog } from "./Dialog";
|
|
4
|
-
import { memo, useCallback, useEffect, useState } from "react";
|
|
5
|
-
import { Tooltip } from "../tooltip";
|
|
6
|
-
import Link from "next/link";
|
|
7
|
-
import styles from "./styles/Button.module.css";
|
|
8
|
-
export var Button = memo(function MemoFunction(_a) {
|
|
9
|
-
var children = _a.children, _b = _a.component, component = _b === void 0 ? "button" : _b, className = _a.className, _c = _a.buttonClass, buttonClass = _c === void 0 ? "default" : _c, _d = _a.buttonSize, buttonSize = _d === void 0 ? "medium" : _d, style = _a.style, _e = _a.type, type = _e === void 0 ? "button" : _e, _f = _a.fullWidth, fullWidth = _f === void 0 ? false : _f, onlyIcon = _a.onlyIcon, onClick = _a.onClick, href = _a.href, target = _a.target, tabIndex = _a.tabIndex, title = _a.title, titlePosition = _a.titlePosition, titleArrow = _a.titleArrow, dialog = _a.dialog, autoFocus = _a.autoFocus, other = __rest(_a, ["children", "component", "className", "buttonClass", "buttonSize", "style", "type", "fullWidth", "onlyIcon", "onClick", "href", "target", "tabIndex", "title", "titlePosition", "titleArrow", "dialog", "autoFocus"]);
|
|
10
|
-
var Comp = component;
|
|
11
|
-
var ripple = function (e) {
|
|
12
|
-
var el = e.currentTarget;
|
|
13
|
-
var circle = document.createElement("span");
|
|
14
|
-
var diameter = Math.max(el.clientWidth, el.clientHeight);
|
|
15
|
-
circle.style.width = circle.style.height = "".concat(diameter, "px");
|
|
16
|
-
circle.classList.add(styles.ripple);
|
|
17
|
-
var ripple = el.getElementsByClassName(styles.ripple)[0];
|
|
18
|
-
if (ripple)
|
|
19
|
-
ripple.remove();
|
|
20
|
-
el.appendChild(circle);
|
|
21
|
-
};
|
|
22
|
-
var handleClick = function (e) {
|
|
23
|
-
ripple(e);
|
|
24
|
-
if (dialog) {
|
|
25
|
-
Dialog(dialog).then(function (result) {
|
|
26
|
-
if (result && onClick) {
|
|
27
|
-
onClick(e);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
if (onClick)
|
|
33
|
-
onClick(e);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var createClassList = useCallback(function () {
|
|
37
|
-
var list = ["sbutton", styles.button];
|
|
38
|
-
if (buttonClass)
|
|
39
|
-
list.push(styles[buttonClass]);
|
|
40
|
-
if (className)
|
|
41
|
-
list.push(className);
|
|
42
|
-
if (onlyIcon)
|
|
43
|
-
list.push(styles.iconbutton);
|
|
44
|
-
if (fullWidth)
|
|
45
|
-
list.push(styles.fullwidth);
|
|
46
|
-
return list.join(" ");
|
|
47
|
-
}, [buttonClass, className, onlyIcon, fullWidth]);
|
|
48
|
-
var _g = useState(function () { return createClassList(); }), classList = _g[0], setClassList = _g[1];
|
|
49
|
-
useEffect(function () {
|
|
50
|
-
var newClassList = createClassList().split(" ").filter(Boolean);
|
|
51
|
-
if (href && typeof window !== "undefined" && window.location.pathname === href) {
|
|
52
|
-
newClassList.push("active");
|
|
53
|
-
}
|
|
54
|
-
setClassList(newClassList.join(" "));
|
|
55
|
-
}, [href, createClassList]);
|
|
56
|
-
var ortakProps = __assign({ className: classList, style: style, onClick: handleClick, tabIndex: tabIndex, autoFocus: autoFocus, "data-button-size": (!onlyIcon) ? buttonSize : null }, other);
|
|
57
|
-
var renderComponent;
|
|
58
|
-
if (href !== undefined) {
|
|
59
|
-
if (other === null || other === void 0 ? void 0 : other.hidden) {
|
|
60
|
-
renderComponent = null;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
var checkHref = (other === null || other === void 0 ? void 0 : other.disabled) ? "#" : href;
|
|
64
|
-
renderComponent = (_jsx(Link, { href: checkHref, target: (other === null || other === void 0 ? void 0 : other.disabled) ? "_self" : target, children: _jsx(Comp, __assign({}, ortakProps, { children: onlyIcon ? onlyIcon : children })) }));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
renderComponent = (_jsx(Comp, __assign({ type: type }, ortakProps, { children: onlyIcon ? onlyIcon : children })));
|
|
69
|
-
}
|
|
70
|
-
if (title && renderComponent) {
|
|
71
|
-
return (_jsx(Tooltip, { title: title, position: titlePosition, arrow: titleArrow, children: renderComponent }));
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
return renderComponent;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface Props {
|
|
3
|
-
checked: "0" | "1" | boolean;
|
|
4
|
-
ref?: React.Ref<any>;
|
|
5
|
-
name?: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
onToogle?: (e: {
|
|
10
|
-
target: {
|
|
11
|
-
name?: string;
|
|
12
|
-
value: "0" | "1";
|
|
13
|
-
};
|
|
14
|
-
}) => void;
|
|
15
|
-
style?: React.CSSProperties;
|
|
16
|
-
styleCheckbox?: React.CSSProperties;
|
|
17
|
-
styleLabel?: React.CSSProperties;
|
|
18
|
-
tabIndex?: number;
|
|
19
|
-
required?: boolean;
|
|
20
|
-
children?: React.ReactNode;
|
|
21
|
-
}
|
|
22
|
-
export declare const Checkbox: React.FC<Props>;
|
|
23
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import styles from "./styles/Input.module.css";
|
|
4
|
-
export var Checkbox = function (_a) {
|
|
5
|
-
var ref = _a.ref, children = _a.children, name = _a.name, label = _a.label, checked = _a.checked, className = _a.className, style = _a.style, styleCheckbox = _a.styleCheckbox, styleLabel = _a.styleLabel, onToogle = _a.onToogle, disabled = _a.disabled, tabIndex = _a.tabIndex, _b = _a.required, required = _b === void 0 ? false : _b;
|
|
6
|
-
var refMain = useRef(null);
|
|
7
|
-
// checked değerini boolean hâline getiriyoruz
|
|
8
|
-
var isChecked = checked === "1" || checked === true;
|
|
9
|
-
var handleChange = function (newChecked) {
|
|
10
|
-
if (disabled)
|
|
11
|
-
return;
|
|
12
|
-
onToogle === null || onToogle === void 0 ? void 0 : onToogle({
|
|
13
|
-
target: {
|
|
14
|
-
name: name,
|
|
15
|
-
value: newChecked ? "1" : "0"
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
var toggleCheck = function () {
|
|
20
|
-
handleChange(!isChecked);
|
|
21
|
-
};
|
|
22
|
-
return (_jsxs("div", { ref: refMain, className: "".concat(styles.checkbox, " ").concat(className || ""), style: style, tabIndex: tabIndex, onClick: toggleCheck, children: [_jsx("input", { ref: ref, type: "checkbox", name: name, onChange: function (e) { return handleChange(e.target.checked); }, checked: isChecked, required: required, style: styleCheckbox, disabled: disabled }), label && _jsx("label", { style: styleLabel, children: label }), children && _jsx("div", { children: children })] }));
|
|
23
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
export type propsDialog = {
|
|
3
|
-
message: any;
|
|
4
|
-
acceptButtonShow?: boolean;
|
|
5
|
-
cancelButtonShow?: boolean;
|
|
6
|
-
acceptButtonText?: string | ReactNode;
|
|
7
|
-
cancelButtonText?: string | ReactNode;
|
|
8
|
-
acceptButtonClass?: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'link';
|
|
9
|
-
cancelButtonClass?: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'link';
|
|
10
|
-
vertialAlign?: 'flex-start' | 'center' | 'flex-end';
|
|
11
|
-
horizontalAlign?: 'flex-start' | 'center' | 'flex-end';
|
|
12
|
-
hideBackdrop?: boolean;
|
|
13
|
-
hideEsc?: boolean;
|
|
14
|
-
styleMessage?: React.CSSProperties;
|
|
15
|
-
styleBox?: React.CSSProperties;
|
|
16
|
-
styleBoxFooter?: React.CSSProperties;
|
|
17
|
-
autoFocus?: 'accept' | 'cancel';
|
|
18
|
-
backdropStyle?: React.CSSProperties;
|
|
19
|
-
};
|
|
20
|
-
export declare const Dialog: (config: propsDialog) => Promise<unknown>;
|
package/dist/esm/form/Dialog.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Box, BoxFooter } from '../box';
|
|
4
|
-
import { createRoot } from 'react-dom/client';
|
|
5
|
-
import { Modal } from '../modal';
|
|
6
|
-
import { Button } from './Button';
|
|
7
|
-
export var Dialog = function (config) {
|
|
8
|
-
return new Promise(function (resolve) {
|
|
9
|
-
if (typeof window === 'undefined')
|
|
10
|
-
return false;
|
|
11
|
-
var mainDiv = document.getElementById('sdialog');
|
|
12
|
-
if (!mainDiv) {
|
|
13
|
-
var createDiv = document.createElement('div');
|
|
14
|
-
createDiv.setAttribute('id', 'sdialog');
|
|
15
|
-
document.body.appendChild(createDiv);
|
|
16
|
-
mainDiv = createDiv;
|
|
17
|
-
}
|
|
18
|
-
var root = createRoot(mainDiv);
|
|
19
|
-
var settings = __assign({ acceptButtonShow: true, cancelButtonShow: true, acceptButtonText: 'EVET', cancelButtonText: 'HAYIR', acceptButtonClass: 'danger', cancelButtonClass: 'secondary', vertialAlign: 'center', horizontalAlign: 'center', hideBackdrop: true, hideEsc: true, styleMessage: {
|
|
20
|
-
fontSize: '1.1rem',
|
|
21
|
-
padding: '10px 20px'
|
|
22
|
-
}, styleBox: { padding: 0, margin: 0, minWidth: 250 }, styleBoxFooter: { padding: '8px 5px' }, autoFocus: 'accept' }, config);
|
|
23
|
-
var close = function () {
|
|
24
|
-
if (mainDiv) {
|
|
25
|
-
root.unmount();
|
|
26
|
-
mainDiv.remove();
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var onCancel = function () {
|
|
30
|
-
resolve(false);
|
|
31
|
-
close();
|
|
32
|
-
};
|
|
33
|
-
var onAccept = function () {
|
|
34
|
-
resolve(true);
|
|
35
|
-
close();
|
|
36
|
-
};
|
|
37
|
-
var Component = (_jsx(Modal, { open: true, keepMounted: false, close: onCancel, hideBackdrop: settings.hideBackdrop, hideEsc: settings.hideEsc, hideCloseButton: true, vertialAlign: settings.vertialAlign, horizontalAlign: settings.horizontalAlign, backdropStyle: settings.backdropStyle, children: _jsxs(Box, { style: settings.styleBox, children: [_jsx("div", { className: "sbox_content", style: settings.styleMessage, dangerouslySetInnerHTML: { __html: settings.message } }), (settings.acceptButtonShow || settings.cancelButtonShow) && (_jsxs(BoxFooter, { style: settings.styleBoxFooter, children: [settings.cancelButtonShow && (_jsx(Button, { autoFocus: settings.autoFocus === 'cancel', buttonClass: settings.cancelButtonClass, onClick: onCancel, children: settings.cancelButtonText })), settings.acceptButtonShow && (_jsx(Button, { autoFocus: settings.autoFocus === 'accept', buttonClass: settings.acceptButtonClass, onClick: onAccept, children: settings.acceptButtonText }))] }))] }) }));
|
|
38
|
-
root.render(Component);
|
|
39
|
-
});
|
|
40
|
-
};
|
package/dist/esm/form/Form.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { FormEventHandler } from "react";
|
|
2
|
-
interface Props {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
encType?: React.FormHTMLAttributes<HTMLFormElement>["encType"];
|
|
5
|
-
onSubmit?: FormEventHandler<HTMLFormElement>;
|
|
6
|
-
style?: React.CSSProperties;
|
|
7
|
-
disableOnEnterSubmit?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const Form: React.NamedExoticComponent<Props>;
|
|
10
|
-
export {};
|
package/dist/esm/form/Form.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { memo } from "react";
|
|
4
|
-
export var Form = memo(function FunctionMemo(_a) {
|
|
5
|
-
var _b = _a.encType, encType = _b === void 0 ? "multipart/form-data" : _b, onSubmit = _a.onSubmit, style = _a.style, _c = _a.disableOnEnterSubmit, disableOnEnterSubmit = _c === void 0 ? false : _c, other = __rest(_a, ["encType", "onSubmit", "style", "disableOnEnterSubmit"]);
|
|
6
|
-
var onKeyDown = function (e) {
|
|
7
|
-
if (e.key === "Enter" && disableOnEnterSubmit) {
|
|
8
|
-
e.preventDefault();
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
return _jsx("form", __assign({ style: style, encType: encType, onSubmit: onSubmit, onKeyDown: onKeyDown }, other));
|
|
12
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { typeJustifyContent, typeSpacingValues } from '../grid';
|
|
3
|
-
type gridValues = 'auto' | 'full' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
4
|
-
type grid = {
|
|
5
|
-
xs?: gridValues;
|
|
6
|
-
sm?: gridValues;
|
|
7
|
-
md?: gridValues;
|
|
8
|
-
lg?: gridValues;
|
|
9
|
-
xl?: gridValues;
|
|
10
|
-
xxl?: gridValues;
|
|
11
|
-
};
|
|
12
|
-
export type PropsFormOgeler = {
|
|
13
|
-
label?: string | null;
|
|
14
|
-
noRender?: boolean;
|
|
15
|
-
fullComponent?: any;
|
|
16
|
-
component?: any;
|
|
17
|
-
propsComponent?: object;
|
|
18
|
-
propsRow?: object;
|
|
19
|
-
propsLabel?: object;
|
|
20
|
-
gridLabel?: grid;
|
|
21
|
-
gridInput?: grid;
|
|
22
|
-
};
|
|
23
|
-
interface Props {
|
|
24
|
-
form: {
|
|
25
|
-
[key: string | number]: any;
|
|
26
|
-
};
|
|
27
|
-
formOgeler: PropsFormOgeler[];
|
|
28
|
-
onChange: Function;
|
|
29
|
-
sabitGrid: {
|
|
30
|
-
label: grid;
|
|
31
|
-
input: grid;
|
|
32
|
-
};
|
|
33
|
-
formType: 'label' | 'noLabel';
|
|
34
|
-
justifyContent: typeJustifyContent;
|
|
35
|
-
rowSpacing?: typeSpacingValues;
|
|
36
|
-
colSpacing?: typeSpacingValues;
|
|
37
|
-
}
|
|
38
|
-
export declare const FormOlustur: React.NamedExoticComponent<Props>;
|
|
39
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import React, { memo, useEffect, useMemo } from 'react';
|
|
4
|
-
import { Col, Row } from '../grid';
|
|
5
|
-
import { isDev } from '../_lib/baseFunctions';
|
|
6
|
-
import { Label } from './Label';
|
|
7
|
-
export var FormOlustur = memo(function FunctionMemo(props) {
|
|
8
|
-
var form = props.form, formOgeler = props.formOgeler, onChange = props.onChange, formType = props.formType, sabitGrid = props.sabitGrid, justifyContent = props.justifyContent, rowSpacing = props.rowSpacing, colSpacing = props.colSpacing;
|
|
9
|
-
useEffect(function () {
|
|
10
|
-
if (formOgeler && onChange && form) {
|
|
11
|
-
formOgeler.forEach(function (formOgeler) {
|
|
12
|
-
var _a, _b, _c, _d;
|
|
13
|
-
var fieldName = (_b = (_a = formOgeler === null || formOgeler === void 0 ? void 0 : formOgeler.component) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.name;
|
|
14
|
-
if (formOgeler.noRender && fieldName && form[fieldName] && form[fieldName] != '') {
|
|
15
|
-
isDev && console.log('noRenderGuncelle');
|
|
16
|
-
if ((formOgeler === null || formOgeler === void 0 ? void 0 : formOgeler.component) && ((_d = (_c = formOgeler === null || formOgeler === void 0 ? void 0 : formOgeler.component) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.name)) {
|
|
17
|
-
onChange({
|
|
18
|
-
target: {
|
|
19
|
-
name: fieldName,
|
|
20
|
-
value: ''
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}, [JSON.stringify(form), formOgeler]);
|
|
28
|
-
var result = useMemo(function () {
|
|
29
|
-
return formOgeler.map(function (_a, i) {
|
|
30
|
-
var noRender = _a.noRender, fullComponent = _a.fullComponent, component = _a.component, propsComponent = _a.propsComponent, propsRow = _a.propsRow, label = _a.label, propsLabel = _a.propsLabel, gridLabel = _a.gridLabel, gridInput = _a.gridInput;
|
|
31
|
-
if (noRender) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
if (fullComponent)
|
|
35
|
-
return React.cloneElement(fullComponent, { key: i });
|
|
36
|
-
var newProps = __assign({}, propsComponent);
|
|
37
|
-
if (onChange && component && !component.props.onChange) {
|
|
38
|
-
newProps = __assign(__assign({}, newProps), { onChange: onChange });
|
|
39
|
-
}
|
|
40
|
-
if (onChange && form && component.props.name && !component.props.value) {
|
|
41
|
-
newProps = __assign(__assign({}, newProps), { value: form[component.props.name] && form[component.props.name].length > 0 ? String(form[component.props.name]) : '' });
|
|
42
|
-
}
|
|
43
|
-
if (formType === 'label')
|
|
44
|
-
newProps = __assign(__assign({}, newProps), { label: '' });
|
|
45
|
-
var detectLabel = label || component.props.label;
|
|
46
|
-
gridLabel = __assign(__assign({}, sabitGrid.label), gridLabel);
|
|
47
|
-
gridInput = __assign(__assign({}, sabitGrid.input), gridInput);
|
|
48
|
-
return (_jsxs(Row, __assign({ justifyContent: justifyContent, rowSpacing: rowSpacing, colSpacing: colSpacing }, propsRow, { children: [formType === 'label' && detectLabel && (_jsx(Col, __assign({}, gridLabel, { children: _jsx(Label, __assign({ required: component.props.required }, propsLabel, { children: detectLabel })) }))), _jsx(Col, __assign({}, gridInput, { children: React.cloneElement(component, newProps) }))] }), i));
|
|
49
|
-
});
|
|
50
|
-
}, [form, formOgeler, onChange, formType, sabitGrid, justifyContent, rowSpacing, colSpacing]);
|
|
51
|
-
return _jsx(React.Fragment, { children: result });
|
|
52
|
-
});
|
package/dist/esm/form/Input.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author : izzetseydaoglu
|
|
3
|
-
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
-
* @version : 2026-01-21 21:35:48
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
type maskSettingsTranslation = {
|
|
8
|
-
[key: string]: {
|
|
9
|
-
pattern: any;
|
|
10
|
-
transform?: (value: string) => string;
|
|
11
|
-
optional?: boolean;
|
|
12
|
-
recursive?: boolean;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
type maskSettings = {
|
|
16
|
-
clearIfNotMatch?: boolean;
|
|
17
|
-
reverse?: boolean;
|
|
18
|
-
translation?: maskSettingsTranslation;
|
|
19
|
-
selectOnFocus?: boolean;
|
|
20
|
-
onChange?: (maskedValue: string, cleanValue: string, targetInput: React.ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
-
};
|
|
22
|
-
export interface PropsInput {
|
|
23
|
-
componentRef?: any;
|
|
24
|
-
inputRef?: any;
|
|
25
|
-
className?: string;
|
|
26
|
-
id?: string;
|
|
27
|
-
name?: string;
|
|
28
|
-
value?: any;
|
|
29
|
-
label?: string;
|
|
30
|
-
loading?: boolean;
|
|
31
|
-
autoFocus?: boolean | undefined;
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
required?: boolean;
|
|
34
|
-
placeholder?: string;
|
|
35
|
-
type?: 'text' | 'number' | 'email' | 'color' | 'date' | 'time' | 'datetime-local' | 'hidden' | 'file' | 'password' | 'tel' | 'search';
|
|
36
|
-
select?: any[];
|
|
37
|
-
ilkSec?: boolean;
|
|
38
|
-
valueKey?: string;
|
|
39
|
-
labelKey?: string;
|
|
40
|
-
multiline?: boolean;
|
|
41
|
-
rows?: number | undefined;
|
|
42
|
-
onChange?: (e: any) => void;
|
|
43
|
-
onFocus?: (e: any) => void;
|
|
44
|
-
onBlur?: (e: any) => void;
|
|
45
|
-
onClick?: (e: any) => void;
|
|
46
|
-
onKeyPress?: (e: any) => void;
|
|
47
|
-
onKeyUp?: (e: any) => void;
|
|
48
|
-
onKeyDown?: (e: any) => void;
|
|
49
|
-
propsComponent?: object | any;
|
|
50
|
-
propsInput?: object;
|
|
51
|
-
startAdornment?: any;
|
|
52
|
-
endAdornment?: any;
|
|
53
|
-
sadeceYazi?: boolean;
|
|
54
|
-
sadeceSayi?: boolean;
|
|
55
|
-
tumuBuyuk?: boolean;
|
|
56
|
-
tumuKucuk?: boolean;
|
|
57
|
-
seoCevir?: boolean;
|
|
58
|
-
dosyaNoGiris?: boolean;
|
|
59
|
-
fileNameGiris?: boolean;
|
|
60
|
-
dateGecmisKontrol?: boolean;
|
|
61
|
-
autoSelectText?: boolean;
|
|
62
|
-
mask?: string;
|
|
63
|
-
maskSettings?: maskSettings;
|
|
64
|
-
}
|
|
65
|
-
export declare const Input: React.FC<PropsInput>;
|
|
66
|
-
export {};
|