@sydsoft/base 1.58.0 → 2.0.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/dist/esm/_lib/baseFunctions.d.ts +16 -0
- package/dist/esm/_lib/baseFunctions.js +102 -0
- package/dist/esm/_lib/inputMask.d.ts +12 -0
- package/dist/esm/_lib/inputMask.js +234 -0
- package/dist/esm/_lib/listFunctions.d.ts +7 -0
- package/dist/esm/_lib/listFunctions.js +119 -0
- package/dist/esm/_lib/storage/cookies.d.ts +9 -0
- package/dist/esm/_lib/storage/cookies.js +39 -0
- package/dist/esm/_lib/storage/encData.d.ts +7 -0
- package/dist/esm/_lib/storage/encData.js +48 -0
- package/dist/esm/_lib/storage/localStorage.d.ts +11 -0
- package/dist/esm/_lib/storage/localStorage.js +74 -0
- package/dist/esm/_lib/storage/sessionStorage.d.ts +11 -0
- package/dist/esm/_lib/storage/sessionStorage.js +74 -0
- package/dist/esm/_lib/useInterval.d.ts +6 -0
- package/dist/esm/_lib/useInterval.js +24 -0
- package/dist/esm/alert/index.d.ts +23 -0
- package/dist/esm/alert/index.js +112 -0
- package/dist/esm/alert/index.module.css +125 -0
- package/dist/esm/box/Box.d.ts +14 -0
- package/dist/esm/box/Box.js +20 -0
- package/dist/esm/box/Box.module.css +159 -0
- package/dist/esm/box/BoxContent.d.ts +14 -0
- package/dist/esm/box/BoxContent.js +7 -0
- package/dist/esm/box/BoxFooter.d.ts +15 -0
- package/dist/esm/box/BoxFooter.js +13 -0
- package/dist/esm/box/BoxHeader.d.ts +21 -0
- package/dist/esm/box/BoxHeader.js +14 -0
- package/dist/esm/box/index.d.ts +9 -0
- package/dist/esm/box/index.js +9 -0
- package/dist/esm/countDown/index.d.ts +27 -0
- package/dist/esm/countDown/index.js +102 -0
- package/dist/esm/dateTime/index.d.ts +17 -0
- package/dist/esm/dateTime/index.js +81 -0
- package/dist/esm/form/Button.d.ts +32 -0
- package/dist/esm/form/Button.js +81 -0
- package/dist/esm/form/Checkbox.d.ts +28 -0
- package/dist/esm/form/Checkbox.js +28 -0
- package/dist/esm/form/Dialog.d.ts +25 -0
- package/dist/esm/form/Dialog.js +40 -0
- package/dist/esm/form/Form.d.ts +15 -0
- package/dist/esm/form/Form.js +17 -0
- package/dist/esm/form/FormOlustur.d.ts +44 -0
- package/dist/esm/form/FormOlustur.js +57 -0
- package/dist/esm/form/Input.d.ts +66 -0
- package/dist/esm/form/Input.js +196 -0
- package/dist/esm/form/Label.d.ts +12 -0
- package/dist/esm/form/Label.js +14 -0
- package/dist/esm/form/SearchableInput.d.ts +42 -0
- package/dist/esm/form/SearchableInput.js +277 -0
- package/dist/esm/form/UploadBase.d.ts +25 -0
- package/dist/esm/form/UploadBase.js +86 -0
- package/dist/esm/form/index.d.ts +14 -0
- package/dist/esm/form/index.js +14 -0
- package/dist/esm/form/styles/Button.module.css +151 -0
- package/dist/esm/form/styles/Input.module.css +227 -0
- package/dist/esm/form/styles/Label.module.css +37 -0
- package/dist/esm/form/styles/SearchableInput.module.css +86 -0
- package/dist/esm/grid/index.d.ts +43 -0
- package/dist/esm/grid/index.js +102 -0
- package/dist/esm/grid/index.module.css +812 -0
- package/dist/esm/icon/icons.d.ts +27 -0
- package/dist/esm/icon/icons.js +28 -0
- package/dist/esm/icon/index.d.ts +38 -0
- package/dist/esm/icon/index.js +25 -0
- package/dist/esm/icon/mui.d.ts +6 -0
- package/dist/esm/icon/mui.js +6 -0
- package/dist/esm/index.d.ts +24 -0
- package/dist/esm/index.js +24 -0
- package/dist/esm/menu/index.d.ts +75 -0
- package/dist/esm/menu/index.js +59 -0
- package/dist/esm/menu/index.module.css +106 -0
- package/dist/esm/modal/index.d.ts +23 -0
- package/dist/esm/modal/index.js +66 -0
- package/dist/esm/modal/index.module.css +83 -0
- package/dist/esm/popover/index.d.ts +26 -0
- package/dist/esm/popover/index.js +343 -0
- package/dist/esm/popover/index.module.css +95 -0
- package/dist/esm/tooltip/index.d.ts +16 -0
- package/dist/esm/tooltip/index.js +124 -0
- package/package.json +12 -8
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* @author : izzetseydaoglu
|
|
5
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
6
|
+
* @version : 2026-02-10 20:23:07
|
|
7
|
+
*/
|
|
8
|
+
import { memo } from "react";
|
|
9
|
+
import styles from "./Box.module.css";
|
|
10
|
+
export var BoxFooter = memo(function FunctionMemo(_a) {
|
|
11
|
+
var children = _a.children, className = _a.className, style = _a.style, align = _a.align, marginTop = _a.marginTop;
|
|
12
|
+
return (_jsx("div", { className: "sbox_footer ".concat(styles.footer, " ").concat(className || ""), style: __assign({ marginTop: marginTop, justifyContent: align }, style), children: children }));
|
|
13
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 20:23:07
|
|
5
|
+
*/
|
|
6
|
+
import React, { ReactNode } from 'react';
|
|
7
|
+
interface Props {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
title?: string | ReactNode;
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
menu?: ReactNode;
|
|
13
|
+
mainStyle?: React.CSSProperties;
|
|
14
|
+
iconStyle?: React.CSSProperties;
|
|
15
|
+
titleStyle?: React.CSSProperties;
|
|
16
|
+
menuStyle?: React.CSSProperties;
|
|
17
|
+
component?: any;
|
|
18
|
+
marginBottom?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const BoxHeader: React.NamedExoticComponent<Props>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* @author : izzetseydaoglu
|
|
5
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
6
|
+
* @version : 2026-02-10 20:23:07
|
|
7
|
+
*/
|
|
8
|
+
import { memo } from 'react';
|
|
9
|
+
import styles from './Box.module.css';
|
|
10
|
+
export var BoxHeader = memo(function FunctionMemo(_a) {
|
|
11
|
+
var children = _a.children, className = _a.className, title = _a.title, icon = _a.icon, menu = _a.menu, mainStyle = _a.mainStyle, iconStyle = _a.iconStyle, titleStyle = _a.titleStyle, menuStyle = _a.menuStyle, marginBottom = _a.marginBottom, _b = _a.component, component = _b === void 0 ? 'div' : _b;
|
|
12
|
+
var Comp = component;
|
|
13
|
+
return (_jsxs("div", { className: "sbox_header ".concat(styles.header, " ").concat(className || ''), style: __assign({ marginBottom: marginBottom }, mainStyle), children: [icon && (_jsx("div", { className: styles.icon, style: iconStyle, children: icon })), _jsx(Comp, { className: "sbox_title ".concat(styles.title), style: titleStyle, children: children || title }), menu && (_jsx("div", { className: styles.menu, style: menuStyle, children: menu }))] }));
|
|
14
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 20:23:07
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
type Props = {
|
|
8
|
+
targetTime: number | string;
|
|
9
|
+
timerType?: 'countdown' | 'datetime';
|
|
10
|
+
speed?: number;
|
|
11
|
+
countType?: 'seconds' | 'minutes:seconds' | 'hours:minutes:seconds' | 'days:hours:minutes:seconds';
|
|
12
|
+
hide?: boolean;
|
|
13
|
+
onComplete?: () => void;
|
|
14
|
+
getStatus?: ({ days, hours, minutes, seconds, timer }: any) => void;
|
|
15
|
+
autoStart?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const useCountDown: ({ autoStart, onComplete, getStatus, targetTime, timerType, countType, speed, hide }: Props) => {
|
|
18
|
+
ComponentCountDown: (children: any) => React.FunctionComponentElement<{
|
|
19
|
+
ref: React.MutableRefObject<any>;
|
|
20
|
+
}> | null;
|
|
21
|
+
startCountDown: () => void;
|
|
22
|
+
stopCountDown: () => void;
|
|
23
|
+
setTargetTime: (targetTime: number | string) => void;
|
|
24
|
+
setTimerSpeed: (timerSpeed: number) => void;
|
|
25
|
+
getChildrenRef: () => any;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 20:23:07
|
|
5
|
+
*/
|
|
6
|
+
import { useEffect, useRef, useState } from 'react';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { useInterval } from '../_lib/useInterval';
|
|
9
|
+
export var useCountDown = function (_a) {
|
|
10
|
+
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;
|
|
11
|
+
var refCountDownRender = useRef(null);
|
|
12
|
+
var _f = useState(timerType === 'datetime' || autoStart), enabled = _f[0], setEnabled = _f[1];
|
|
13
|
+
var _g = useState(0), timer = _g[0], setTimer = _g[1];
|
|
14
|
+
var _h = useState(typeof speed === 'number' && speed > 0 ? speed : 1000), timerSpeed = _h[0], setTimerSpeed = _h[1];
|
|
15
|
+
useEffect(function () { return prepareTimer(targetTime); }, [targetTime]);
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
if (!hide)
|
|
18
|
+
render();
|
|
19
|
+
}, [timer]);
|
|
20
|
+
useInterval(function () {
|
|
21
|
+
if (enabled) {
|
|
22
|
+
if (timer <= 1) {
|
|
23
|
+
stopCountDown();
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
setTimer(timer - 1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, enabled ? timerSpeed : null);
|
|
30
|
+
var prepareTimer = function (timeORstring) {
|
|
31
|
+
if (timerType === 'datetime') {
|
|
32
|
+
setTimer(Math.floor((new Date(timeORstring).getTime() - new Date().getTime()) / 1000));
|
|
33
|
+
setEnabled(true);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
setTimer(timeORstring);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var stopCountDown = function () {
|
|
40
|
+
setTimer(0);
|
|
41
|
+
setEnabled(false);
|
|
42
|
+
if ((enabled && onComplete) || (timerType === 'datetime' && onComplete)) {
|
|
43
|
+
onComplete();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var padNumber = function (num, padLength, padString) {
|
|
47
|
+
if (padLength === void 0) { padLength = 2; }
|
|
48
|
+
if (padString === void 0) { padString = '0'; }
|
|
49
|
+
return (typeof targetTime === 'number' && targetTime < 10 ? num : String(num).padStart(padLength, padString));
|
|
50
|
+
};
|
|
51
|
+
var render = function () {
|
|
52
|
+
var days = 0, hours = 0, minutes = 0, seconds = timer;
|
|
53
|
+
if (countType === 'minutes:seconds') {
|
|
54
|
+
minutes = Math.floor(seconds / 60);
|
|
55
|
+
seconds -= minutes * 60;
|
|
56
|
+
}
|
|
57
|
+
else if (countType === 'hours:minutes:seconds') {
|
|
58
|
+
hours = Math.floor(seconds / (60 * 60));
|
|
59
|
+
seconds -= hours * 60 * 60;
|
|
60
|
+
minutes = Math.floor(seconds / 60);
|
|
61
|
+
seconds -= minutes * 60;
|
|
62
|
+
}
|
|
63
|
+
else if (countType === 'days:hours:minutes:seconds') {
|
|
64
|
+
days = Math.floor(seconds / (60 * 60 * 24));
|
|
65
|
+
seconds -= days * 60 * 60 * 24;
|
|
66
|
+
hours = Math.floor(seconds / (60 * 60));
|
|
67
|
+
seconds -= hours * 60 * 60;
|
|
68
|
+
minutes = Math.floor(seconds / 60);
|
|
69
|
+
seconds -= minutes * 60;
|
|
70
|
+
}
|
|
71
|
+
seconds = Math.floor(seconds);
|
|
72
|
+
if (getStatus && timer > 0)
|
|
73
|
+
getStatus({ days: days, hours: hours, minutes: minutes, seconds: seconds, timer: timer });
|
|
74
|
+
if (refCountDownRender.current) {
|
|
75
|
+
var getPadValues = function (div) {
|
|
76
|
+
var length = div.dataset.padlength || 2;
|
|
77
|
+
var string = div.dataset.padstring || '0';
|
|
78
|
+
return { length: length, string: string };
|
|
79
|
+
};
|
|
80
|
+
var divGun = refCountDownRender.current.querySelector("[data-name='days']");
|
|
81
|
+
if (divGun)
|
|
82
|
+
divGun.innerHTML = padNumber(days, getPadValues(divGun).length, getPadValues(divGun).string).toString();
|
|
83
|
+
var divSaat = refCountDownRender.current.querySelector("[data-name='hours']");
|
|
84
|
+
if (divSaat)
|
|
85
|
+
divSaat.innerHTML = padNumber(hours, getPadValues(divSaat).length, getPadValues(divSaat).string).toString();
|
|
86
|
+
var divDakika = refCountDownRender.current.querySelector("[data-name='minutes']");
|
|
87
|
+
if (divDakika)
|
|
88
|
+
divDakika.innerHTML = padNumber(minutes, getPadValues(divDakika).length, getPadValues(divDakika).string).toString();
|
|
89
|
+
var divSaniye = refCountDownRender.current.querySelector("[data-name='seconds']");
|
|
90
|
+
if (divSaniye)
|
|
91
|
+
divSaniye.innerHTML = padNumber(seconds, getPadValues(divSaniye).length, getPadValues(divSaniye).string).toString();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
return {
|
|
95
|
+
ComponentCountDown: function (children) { return (hide ? null : React.cloneElement(children, { ref: refCountDownRender })); },
|
|
96
|
+
startCountDown: function () { return setEnabled(true); },
|
|
97
|
+
stopCountDown: function () { return setEnabled(false); },
|
|
98
|
+
setTargetTime: function (targetTime) { return prepareTimer(targetTime); },
|
|
99
|
+
setTimerSpeed: function (timerSpeed) { return setTimerSpeed(timerSpeed); },
|
|
100
|
+
getChildrenRef: function () { return refCountDownRender.current || null; }
|
|
101
|
+
};
|
|
102
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 20:23:07
|
|
5
|
+
*/
|
|
6
|
+
export default class dateTime {
|
|
7
|
+
private datetime;
|
|
8
|
+
private resut_format;
|
|
9
|
+
constructor(datetime?: Date | string | null, format?: string);
|
|
10
|
+
addDays(days: number): this;
|
|
11
|
+
private parse;
|
|
12
|
+
getResult(): string;
|
|
13
|
+
format(format?: string): this;
|
|
14
|
+
today(): string;
|
|
15
|
+
getTime(): number;
|
|
16
|
+
nextMonthFirstDay(format?: string): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 20:23:07
|
|
5
|
+
*/
|
|
6
|
+
var dateTime = /** @class */ (function () {
|
|
7
|
+
function dateTime(datetime, format) {
|
|
8
|
+
if (datetime === void 0) { datetime = null; }
|
|
9
|
+
if (format === void 0) { format = "y-m-d h:i:s"; }
|
|
10
|
+
this.resut_format = "y-m-d h:i:s";
|
|
11
|
+
this.format(format);
|
|
12
|
+
this.datetime = datetime !== "0000-00-00 00:00:00" && datetime !== "0000-00-00" && datetime ? datetime : new Date().toISOString(); // GMT ekli halde
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
dateTime.prototype.addDays = function (days) {
|
|
16
|
+
var datetime = new Date(this.datetime);
|
|
17
|
+
datetime.setDate(datetime.getDate() + days);
|
|
18
|
+
this.datetime = datetime.toISOString();
|
|
19
|
+
return this;
|
|
20
|
+
};
|
|
21
|
+
dateTime.prototype.parse = function () {
|
|
22
|
+
var datetime = new Date(this.datetime);
|
|
23
|
+
var monthNames = ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"];
|
|
24
|
+
var dayNames = ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"];
|
|
25
|
+
return {
|
|
26
|
+
y: datetime.getFullYear().toString(),
|
|
27
|
+
m: (datetime.getMonth() + 1).toString().padStart(2, "0"),
|
|
28
|
+
d: datetime.getDate().toString().padStart(2, "0"),
|
|
29
|
+
h: datetime.getHours().toString().padStart(2, "0"),
|
|
30
|
+
i: datetime.getMinutes().toString().padStart(2, "0"),
|
|
31
|
+
s: datetime.getSeconds().toString().padStart(2, "0"),
|
|
32
|
+
ms: (datetime.getMilliseconds() / 10).toFixed(0).toString().padStart(2, "0"),
|
|
33
|
+
z: (datetime.getTimezoneOffset() / 60).toString(),
|
|
34
|
+
// TAM STRING ICEREN IFADELER SONA EKLENMELI
|
|
35
|
+
TAMAY: monthNames[datetime.getMonth()],
|
|
36
|
+
TAMGUN: dayNames[datetime.getDay()]
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
dateTime.prototype.getResult = function () {
|
|
40
|
+
var parse = this.parse();
|
|
41
|
+
var result = this.resut_format;
|
|
42
|
+
result = result.replace(new RegExp("y", "g"), parse.y.toString());
|
|
43
|
+
result = result.replace(new RegExp("m", "g"), parse.m.toString());
|
|
44
|
+
result = result.replace(new RegExp("d", "g"), parse.d.toString());
|
|
45
|
+
result = result.replace(new RegExp("h", "g"), parse.h.toString());
|
|
46
|
+
result = result.replace(new RegExp("i", "g"), parse.i.toString());
|
|
47
|
+
result = result.replace(new RegExp("s", "g"), parse.s.toString());
|
|
48
|
+
result = result.replace(new RegExp("ms", "g"), parse.ms.toString());
|
|
49
|
+
result = result.replace(new RegExp("z", "g"), parse.z.toString());
|
|
50
|
+
result = result.replace(new RegExp("TAMAY", "g"), parse.TAMAY.toString());
|
|
51
|
+
result = result.replace(new RegExp("TAMGUN", "g"), parse.TAMGUN.toString());
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
dateTime.prototype.format = function (format) {
|
|
55
|
+
if (format === void 0) { format = "y-m-d h:i:s"; }
|
|
56
|
+
this.resut_format = format;
|
|
57
|
+
return this;
|
|
58
|
+
};
|
|
59
|
+
dateTime.prototype.today = function () {
|
|
60
|
+
this.datetime = new Date().toISOString();
|
|
61
|
+
this.format("y-m-d");
|
|
62
|
+
return this.getResult();
|
|
63
|
+
};
|
|
64
|
+
dateTime.prototype.getTime = function () {
|
|
65
|
+
var convertDateTime = new dateTime(this.datetime).format("y-m-d h:i:s").getResult();
|
|
66
|
+
var datetime = new Date(convertDateTime);
|
|
67
|
+
return datetime.getTime();
|
|
68
|
+
};
|
|
69
|
+
dateTime.prototype.nextMonthFirstDay = function (format) {
|
|
70
|
+
if (format === void 0) { format = "y-m-d"; }
|
|
71
|
+
// Verilen tarihin bir sonraki ayının ilk gününü bul
|
|
72
|
+
this.datetime = new Date(this.datetime);
|
|
73
|
+
this.datetime.setMonth(this.datetime.getMonth() + 1);
|
|
74
|
+
this.datetime.setDate(1);
|
|
75
|
+
this.datetime = this.datetime.toISOString();
|
|
76
|
+
this.format(format);
|
|
77
|
+
return this.getResult();
|
|
78
|
+
};
|
|
79
|
+
return dateTime;
|
|
80
|
+
}());
|
|
81
|
+
export default dateTime;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 20:23:07
|
|
5
|
+
*/
|
|
6
|
+
import { propsDialog } from "./Dialog";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { typeTooltipPosition } from "../tooltip";
|
|
9
|
+
interface Props {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
onlyIcon?: React.ReactNode;
|
|
12
|
+
buttonClass?: "default" | "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link";
|
|
13
|
+
buttonSize?: "small" | "medium" | "large";
|
|
14
|
+
autoFocus?: boolean;
|
|
15
|
+
hidden?: boolean;
|
|
16
|
+
component?: "button" | "a" | "div" | any;
|
|
17
|
+
className?: string;
|
|
18
|
+
type?: "submit" | "reset" | "button";
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
22
|
+
href?: string | undefined;
|
|
23
|
+
target?: string | undefined;
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
tabIndex?: number;
|
|
26
|
+
title?: string;
|
|
27
|
+
titlePosition?: typeTooltipPosition;
|
|
28
|
+
titleArrow?: boolean;
|
|
29
|
+
dialog?: propsDialog;
|
|
30
|
+
}
|
|
31
|
+
export declare const Button: React.NamedExoticComponent<Props>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* @author : izzetseydaoglu
|
|
5
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
6
|
+
* @version : 2026-02-10 20:23:07
|
|
7
|
+
*/
|
|
8
|
+
import { Dialog } from "./Dialog";
|
|
9
|
+
import { memo, useCallback, useEffect, useState } from "react";
|
|
10
|
+
import { Tooltip } from "../tooltip";
|
|
11
|
+
import Link from "next/link";
|
|
12
|
+
import styles from "./styles/Button.module.css";
|
|
13
|
+
export var Button = memo(function MemoFunction(_a) {
|
|
14
|
+
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"]);
|
|
15
|
+
var Comp = component;
|
|
16
|
+
var ripple = function (e) {
|
|
17
|
+
var el = e.currentTarget;
|
|
18
|
+
var circle = document.createElement("span");
|
|
19
|
+
var diameter = Math.max(el.clientWidth, el.clientHeight);
|
|
20
|
+
circle.style.width = circle.style.height = "".concat(diameter, "px");
|
|
21
|
+
circle.classList.add(styles.ripple);
|
|
22
|
+
var ripple = el.getElementsByClassName(styles.ripple)[0];
|
|
23
|
+
if (ripple)
|
|
24
|
+
ripple.remove();
|
|
25
|
+
el.appendChild(circle);
|
|
26
|
+
};
|
|
27
|
+
var handleClick = function (e) {
|
|
28
|
+
ripple(e);
|
|
29
|
+
if (dialog) {
|
|
30
|
+
Dialog(dialog).then(function (result) {
|
|
31
|
+
if (result && onClick) {
|
|
32
|
+
onClick(e);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
if (onClick)
|
|
38
|
+
onClick(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var createClassList = useCallback(function () {
|
|
42
|
+
var list = ["sbutton", styles.button];
|
|
43
|
+
if (buttonClass)
|
|
44
|
+
list.push(styles[buttonClass]);
|
|
45
|
+
if (className)
|
|
46
|
+
list.push(className);
|
|
47
|
+
if (onlyIcon)
|
|
48
|
+
list.push(styles.iconbutton);
|
|
49
|
+
if (fullWidth)
|
|
50
|
+
list.push(styles.fullwidth);
|
|
51
|
+
return list.join(" ");
|
|
52
|
+
}, [buttonClass, className, onlyIcon, fullWidth]);
|
|
53
|
+
var _g = useState(function () { return createClassList(); }), classList = _g[0], setClassList = _g[1];
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
var newClassList = createClassList().split(" ").filter(Boolean);
|
|
56
|
+
if (href && typeof window !== "undefined" && window.location.pathname === href) {
|
|
57
|
+
newClassList.push("active");
|
|
58
|
+
}
|
|
59
|
+
setClassList(newClassList.join(" "));
|
|
60
|
+
}, [href, createClassList]);
|
|
61
|
+
var ortakProps = __assign({ className: classList, style: style, onClick: handleClick, tabIndex: tabIndex, autoFocus: autoFocus, "data-button-size": (!onlyIcon) ? buttonSize : null }, other);
|
|
62
|
+
var renderComponent;
|
|
63
|
+
if (href !== undefined) {
|
|
64
|
+
if (other === null || other === void 0 ? void 0 : other.hidden) {
|
|
65
|
+
renderComponent = null;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
var checkHref = (other === null || other === void 0 ? void 0 : other.disabled) ? "#" : href;
|
|
69
|
+
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 })) }));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
renderComponent = (_jsx(Comp, __assign({ type: type }, ortakProps, { children: onlyIcon ? onlyIcon : children })));
|
|
74
|
+
}
|
|
75
|
+
if (title && renderComponent) {
|
|
76
|
+
return (_jsx(Tooltip, { title: title, position: titlePosition, arrow: titleArrow, children: renderComponent }));
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
return renderComponent;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 20:23:07
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
interface Props {
|
|
8
|
+
checked: "0" | "1" | boolean;
|
|
9
|
+
ref?: React.Ref<any>;
|
|
10
|
+
name?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onToogle?: (e: {
|
|
15
|
+
target: {
|
|
16
|
+
name?: string;
|
|
17
|
+
value: "0" | "1";
|
|
18
|
+
};
|
|
19
|
+
}) => void;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
styleCheckbox?: React.CSSProperties;
|
|
22
|
+
styleLabel?: React.CSSProperties;
|
|
23
|
+
tabIndex?: number;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare const Checkbox: React.FC<Props>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @author : izzetseydaoglu
|
|
4
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
5
|
+
* @version : 2026-02-10 20:23:07
|
|
6
|
+
*/
|
|
7
|
+
import { useRef } from "react";
|
|
8
|
+
import styles from "./styles/Input.module.css";
|
|
9
|
+
export var Checkbox = function (_a) {
|
|
10
|
+
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;
|
|
11
|
+
var refMain = useRef(null);
|
|
12
|
+
// checked değerini boolean hâline getiriyoruz
|
|
13
|
+
var isChecked = checked === "1" || checked === true;
|
|
14
|
+
var handleChange = function (newChecked) {
|
|
15
|
+
if (disabled)
|
|
16
|
+
return;
|
|
17
|
+
onToogle === null || onToogle === void 0 ? void 0 : onToogle({
|
|
18
|
+
target: {
|
|
19
|
+
name: name,
|
|
20
|
+
value: newChecked ? "1" : "0"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var toggleCheck = function () {
|
|
25
|
+
handleChange(!isChecked);
|
|
26
|
+
};
|
|
27
|
+
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 })] }));
|
|
28
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 20:23:07
|
|
5
|
+
*/
|
|
6
|
+
import React, { ReactNode } from 'react';
|
|
7
|
+
export type propsDialog = {
|
|
8
|
+
message: any;
|
|
9
|
+
acceptButtonShow?: boolean;
|
|
10
|
+
cancelButtonShow?: boolean;
|
|
11
|
+
acceptButtonText?: string | ReactNode;
|
|
12
|
+
cancelButtonText?: string | ReactNode;
|
|
13
|
+
acceptButtonClass?: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'link';
|
|
14
|
+
cancelButtonClass?: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'link';
|
|
15
|
+
vertialAlign?: 'flex-start' | 'center' | 'flex-end';
|
|
16
|
+
horizontalAlign?: 'flex-start' | 'center' | 'flex-end';
|
|
17
|
+
hideBackdrop?: boolean;
|
|
18
|
+
hideEsc?: boolean;
|
|
19
|
+
styleMessage?: React.CSSProperties;
|
|
20
|
+
styleBox?: React.CSSProperties;
|
|
21
|
+
styleBoxFooter?: React.CSSProperties;
|
|
22
|
+
autoFocus?: 'accept' | 'cancel';
|
|
23
|
+
backdropStyle?: React.CSSProperties;
|
|
24
|
+
};
|
|
25
|
+
export declare const Dialog: (config: propsDialog) => Promise<unknown>;
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 20:23:07
|
|
5
|
+
*/
|
|
6
|
+
import React, { FormEventHandler } from "react";
|
|
7
|
+
interface Props {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
encType?: React.FormHTMLAttributes<HTMLFormElement>["encType"];
|
|
10
|
+
onSubmit?: FormEventHandler<HTMLFormElement>;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
disableOnEnterSubmit?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const Form: React.NamedExoticComponent<Props>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* @author : izzetseydaoglu
|
|
5
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
6
|
+
* @version : 2026-02-10 20:23:07
|
|
7
|
+
*/
|
|
8
|
+
import { memo } from "react";
|
|
9
|
+
export var Form = memo(function FunctionMemo(_a) {
|
|
10
|
+
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"]);
|
|
11
|
+
var onKeyDown = function (e) {
|
|
12
|
+
if (e.key === "Enter" && disableOnEnterSubmit) {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
return _jsx("form", __assign({ style: style, encType: encType, onSubmit: onSubmit, onKeyDown: onKeyDown }, other));
|
|
17
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author : izzetseydaoglu
|
|
3
|
+
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
|
+
* @version : 2026-02-10 20:23:07
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { typeJustifyContent, typeSpacingValues } from '../grid';
|
|
8
|
+
type gridValues = 'auto' | 'full' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
9
|
+
type grid = {
|
|
10
|
+
xs?: gridValues;
|
|
11
|
+
sm?: gridValues;
|
|
12
|
+
md?: gridValues;
|
|
13
|
+
lg?: gridValues;
|
|
14
|
+
xl?: gridValues;
|
|
15
|
+
xxl?: gridValues;
|
|
16
|
+
};
|
|
17
|
+
export type PropsFormOgeler = {
|
|
18
|
+
label?: string | null;
|
|
19
|
+
noRender?: boolean;
|
|
20
|
+
fullComponent?: any;
|
|
21
|
+
component?: any;
|
|
22
|
+
propsComponent?: object;
|
|
23
|
+
propsRow?: object;
|
|
24
|
+
propsLabel?: object;
|
|
25
|
+
gridLabel?: grid;
|
|
26
|
+
gridInput?: grid;
|
|
27
|
+
};
|
|
28
|
+
interface Props {
|
|
29
|
+
form: {
|
|
30
|
+
[key: string | number]: any;
|
|
31
|
+
};
|
|
32
|
+
formOgeler: PropsFormOgeler[];
|
|
33
|
+
onChange: Function;
|
|
34
|
+
sabitGrid: {
|
|
35
|
+
label: grid;
|
|
36
|
+
input: grid;
|
|
37
|
+
};
|
|
38
|
+
formType: 'label' | 'noLabel';
|
|
39
|
+
justifyContent: typeJustifyContent;
|
|
40
|
+
rowSpacing?: typeSpacingValues;
|
|
41
|
+
colSpacing?: typeSpacingValues;
|
|
42
|
+
}
|
|
43
|
+
export declare const FormOlustur: React.NamedExoticComponent<Props>;
|
|
44
|
+
export {};
|