@sydsoft/base 1.54.0 → 1.57.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.
Files changed (81) hide show
  1. package/package.json +8 -16
  2. package/_dist/_lib/baseFunctions.d.ts +0 -11
  3. package/_dist/_lib/baseFunctions.js +0 -110
  4. package/_dist/_lib/inputMask.d.ts +0 -7
  5. package/_dist/_lib/inputMask.js +0 -233
  6. package/_dist/_lib/listFunctions.d.ts +0 -2
  7. package/_dist/_lib/listFunctions.js +0 -119
  8. package/_dist/_lib/storage/cookies.d.ts +0 -4
  9. package/_dist/_lib/storage/cookies.js +0 -41
  10. package/_dist/_lib/storage/encData.d.ts +0 -2
  11. package/_dist/_lib/storage/encData.js +0 -48
  12. package/_dist/_lib/storage/localStorage.d.ts +0 -6
  13. package/_dist/_lib/storage/localStorage.js +0 -78
  14. package/_dist/_lib/storage/sessionStorage.d.ts +0 -6
  15. package/_dist/_lib/storage/sessionStorage.js +0 -78
  16. package/_dist/_lib/useInterval.d.ts +0 -6
  17. package/_dist/_lib/useInterval.js +0 -27
  18. package/_dist/alert/index.d.ts +0 -18
  19. package/_dist/alert/index.js +0 -116
  20. package/_dist/alert/index.module.css +0 -119
  21. package/_dist/box/Box.d.ts +0 -9
  22. package/_dist/box/Box.js +0 -19
  23. package/_dist/box/Box.module.css +0 -153
  24. package/_dist/box/BoxContent.d.ts +0 -9
  25. package/_dist/box/BoxContent.js +0 -11
  26. package/_dist/box/BoxFooter.d.ts +0 -10
  27. package/_dist/box/BoxFooter.js +0 -11
  28. package/_dist/box/BoxHeader.d.ts +0 -16
  29. package/_dist/box/BoxHeader.js +0 -12
  30. package/_dist/box/index.d.ts +0 -9
  31. package/_dist/box/index.js +0 -12
  32. package/_dist/countDown/index.d.ts +0 -22
  33. package/_dist/countDown/index.js +0 -102
  34. package/_dist/dateTime/index.d.ts +0 -12
  35. package/_dist/dateTime/index.js +0 -78
  36. package/_dist/form/Button.d.ts +0 -27
  37. package/_dist/form/Button.js +0 -79
  38. package/_dist/form/Checkbox.d.ts +0 -23
  39. package/_dist/form/Checkbox.js +0 -28
  40. package/_dist/form/Dialog.d.ts +0 -20
  41. package/_dist/form/Dialog.js +0 -44
  42. package/_dist/form/Form.d.ts +0 -10
  43. package/_dist/form/Form.js +0 -15
  44. package/_dist/form/FormOlustur.d.ts +0 -39
  45. package/_dist/form/FormOlustur.js +0 -55
  46. package/_dist/form/Input.d.ts +0 -66
  47. package/_dist/form/Input.js +0 -200
  48. package/_dist/form/Label.d.ts +0 -7
  49. package/_dist/form/Label.js +0 -12
  50. package/_dist/form/SearchableInput.d.ts +0 -37
  51. package/_dist/form/SearchableInput.js +0 -275
  52. package/_dist/form/UploadBase.d.ts +0 -25
  53. package/_dist/form/UploadBase.js +0 -91
  54. package/_dist/form/index.d.ts +0 -9
  55. package/_dist/form/index.js +0 -12
  56. package/_dist/form/styles/Button.module.css +0 -145
  57. package/_dist/form/styles/Input.module.css +0 -221
  58. package/_dist/form/styles/Label.module.css +0 -31
  59. package/_dist/form/styles/SearchableInput.module.css +0 -80
  60. package/_dist/grid/index.d.ts +0 -38
  61. package/_dist/grid/index.js +0 -104
  62. package/_dist/grid/index.module.css +0 -805
  63. package/_dist/icon/icons.d.ts +0 -22
  64. package/_dist/icon/icons.js +0 -26
  65. package/_dist/icon/index.d.ts +0 -34
  66. package/_dist/icon/index.js +0 -30
  67. package/_dist/icon/mui.d.ts +0 -1
  68. package/_dist/icon/mui.js +0 -2
  69. package/_dist/index.d.ts +0 -19
  70. package/_dist/index.js +0 -22
  71. package/_dist/menu/index.d.ts +0 -69
  72. package/_dist/menu/index.js +0 -55
  73. package/_dist/menu/index.module.css +0 -92
  74. package/_dist/modal/index.d.ts +0 -23
  75. package/_dist/modal/index.js +0 -69
  76. package/_dist/modal/index.module.css +0 -77
  77. package/_dist/popover/index.d.ts +0 -26
  78. package/_dist/popover/index.js +0 -346
  79. package/_dist/popover/index.module.css +0 -89
  80. package/_dist/tooltip/index.d.ts +0 -11
  81. package/_dist/tooltip/index.js +0 -122
@@ -1,16 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- interface Props {
3
- children?: ReactNode;
4
- className?: string;
5
- title?: string | ReactNode;
6
- icon?: ReactNode;
7
- menu?: ReactNode;
8
- mainStyle?: React.CSSProperties;
9
- iconStyle?: React.CSSProperties;
10
- titleStyle?: React.CSSProperties;
11
- menuStyle?: React.CSSProperties;
12
- component?: any;
13
- marginBottom?: number;
14
- }
15
- export declare const BoxHeader: React.NamedExoticComponent<Props>;
16
- export {};
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BoxHeader = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var react_1 = require("react");
7
- var Box_module_css_1 = tslib_1.__importDefault(require("./Box.module.css"));
8
- exports.BoxHeader = (0, react_1.memo)(function FunctionMemo(_a) {
9
- 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;
10
- var Comp = component;
11
- return ((0, jsx_runtime_1.jsxs)("div", { className: "sbox_header ".concat(Box_module_css_1.default.header, " ").concat(className || ''), style: tslib_1.__assign({ marginBottom: marginBottom }, mainStyle), children: [icon && ((0, jsx_runtime_1.jsx)("div", { className: Box_module_css_1.default.icon, style: iconStyle, children: icon })), (0, jsx_runtime_1.jsx)(Comp, { className: "sbox_title ".concat(Box_module_css_1.default.title), style: titleStyle, children: children || title }), menu && ((0, jsx_runtime_1.jsx)("div", { className: Box_module_css_1.default.menu, style: menuStyle, children: menu }))] }));
12
- });
@@ -1,9 +0,0 @@
1
- /**
2
- * Copyright (c) 2023
3
- * @author: izzetseydaoglu
4
- * @last-modified: 29.01.2024 02:41
5
- */
6
- export * from "./Box";
7
- export * from './BoxContent';
8
- export * from './BoxFooter';
9
- export * from './BoxHeader';
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) 2023
4
- * @author: izzetseydaoglu
5
- * @last-modified: 29.01.2024 02:41
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- var tslib_1 = require("tslib");
9
- tslib_1.__exportStar(require("./Box"), exports);
10
- tslib_1.__exportStar(require("./BoxContent"), exports);
11
- tslib_1.__exportStar(require("./BoxFooter"), exports);
12
- tslib_1.__exportStar(require("./BoxHeader"), exports);
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- type Props = {
3
- targetTime: number | string;
4
- timerType?: 'countdown' | 'datetime';
5
- speed?: number;
6
- countType?: 'seconds' | 'minutes:seconds' | 'hours:minutes:seconds' | 'days:hours:minutes:seconds';
7
- hide?: boolean;
8
- onComplete?: () => void;
9
- getStatus?: ({ days, hours, minutes, seconds, timer }: any) => void;
10
- autoStart?: boolean;
11
- };
12
- export declare const useCountDown: ({ autoStart, onComplete, getStatus, targetTime, timerType, countType, speed, hide }: Props) => {
13
- ComponentCountDown: (children: any) => React.FunctionComponentElement<{
14
- ref: React.MutableRefObject<any>;
15
- }> | null;
16
- startCountDown: () => void;
17
- stopCountDown: () => void;
18
- setTargetTime: (targetTime: number | string) => void;
19
- setTimerSpeed: (timerSpeed: number) => void;
20
- getChildrenRef: () => any;
21
- };
22
- export {};
@@ -1,102 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCountDown = void 0;
4
- var tslib_1 = require("tslib");
5
- var react_1 = require("react");
6
- var react_2 = tslib_1.__importDefault(require("react"));
7
- var useInterval_1 = require("../_lib/useInterval");
8
- var useCountDown = function (_a) {
9
- 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;
10
- var refCountDownRender = (0, react_1.useRef)(null);
11
- var _f = (0, react_1.useState)(timerType === 'datetime' || autoStart), enabled = _f[0], setEnabled = _f[1];
12
- var _g = (0, react_1.useState)(0), timer = _g[0], setTimer = _g[1];
13
- var _h = (0, react_1.useState)(typeof speed === 'number' && speed > 0 ? speed : 1000), timerSpeed = _h[0], setTimerSpeed = _h[1];
14
- (0, react_1.useEffect)(function () { return prepareTimer(targetTime); }, [targetTime]);
15
- (0, react_1.useEffect)(function () {
16
- if (!hide)
17
- render();
18
- }, [timer]);
19
- (0, useInterval_1.useInterval)(function () {
20
- if (enabled) {
21
- if (timer <= 1) {
22
- stopCountDown();
23
- }
24
- else {
25
- setTimer(timer - 1);
26
- }
27
- }
28
- }, enabled ? timerSpeed : null);
29
- var prepareTimer = function (timeORstring) {
30
- if (timerType === 'datetime') {
31
- setTimer(Math.floor((new Date(timeORstring).getTime() - new Date().getTime()) / 1000));
32
- setEnabled(true);
33
- }
34
- else {
35
- setTimer(timeORstring);
36
- }
37
- };
38
- var stopCountDown = function () {
39
- setTimer(0);
40
- setEnabled(false);
41
- if ((enabled && onComplete) || (timerType === 'datetime' && onComplete)) {
42
- onComplete();
43
- }
44
- };
45
- var padNumber = function (num, padLength, padString) {
46
- if (padLength === void 0) { padLength = 2; }
47
- if (padString === void 0) { padString = '0'; }
48
- return (typeof targetTime === 'number' && targetTime < 10 ? num : String(num).padStart(padLength, padString));
49
- };
50
- var render = function () {
51
- var days = 0, hours = 0, minutes = 0, seconds = timer;
52
- if (countType === 'minutes:seconds') {
53
- minutes = Math.floor(seconds / 60);
54
- seconds -= minutes * 60;
55
- }
56
- else if (countType === 'hours:minutes:seconds') {
57
- hours = Math.floor(seconds / (60 * 60));
58
- seconds -= hours * 60 * 60;
59
- minutes = Math.floor(seconds / 60);
60
- seconds -= minutes * 60;
61
- }
62
- else if (countType === 'days:hours:minutes:seconds') {
63
- days = Math.floor(seconds / (60 * 60 * 24));
64
- seconds -= days * 60 * 60 * 24;
65
- hours = Math.floor(seconds / (60 * 60));
66
- seconds -= hours * 60 * 60;
67
- minutes = Math.floor(seconds / 60);
68
- seconds -= minutes * 60;
69
- }
70
- seconds = Math.floor(seconds);
71
- if (getStatus && timer > 0)
72
- getStatus({ days: days, hours: hours, minutes: minutes, seconds: seconds, timer: timer });
73
- if (refCountDownRender.current) {
74
- var getPadValues = function (div) {
75
- var length = div.dataset.padlength || 2;
76
- var string = div.dataset.padstring || '0';
77
- return { length: length, string: string };
78
- };
79
- var divGun = refCountDownRender.current.querySelector("[data-name='days']");
80
- if (divGun)
81
- divGun.innerHTML = padNumber(days, getPadValues(divGun).length, getPadValues(divGun).string).toString();
82
- var divSaat = refCountDownRender.current.querySelector("[data-name='hours']");
83
- if (divSaat)
84
- divSaat.innerHTML = padNumber(hours, getPadValues(divSaat).length, getPadValues(divSaat).string).toString();
85
- var divDakika = refCountDownRender.current.querySelector("[data-name='minutes']");
86
- if (divDakika)
87
- divDakika.innerHTML = padNumber(minutes, getPadValues(divDakika).length, getPadValues(divDakika).string).toString();
88
- var divSaniye = refCountDownRender.current.querySelector("[data-name='seconds']");
89
- if (divSaniye)
90
- divSaniye.innerHTML = padNumber(seconds, getPadValues(divSaniye).length, getPadValues(divSaniye).string).toString();
91
- }
92
- };
93
- return {
94
- ComponentCountDown: function (children) { return (hide ? null : react_2.default.cloneElement(children, { ref: refCountDownRender })); },
95
- startCountDown: function () { return setEnabled(true); },
96
- stopCountDown: function () { return setEnabled(false); },
97
- setTargetTime: function (targetTime) { return prepareTimer(targetTime); },
98
- setTimerSpeed: function (timerSpeed) { return setTimerSpeed(timerSpeed); },
99
- getChildrenRef: function () { return refCountDownRender.current || null; }
100
- };
101
- };
102
- exports.useCountDown = useCountDown;
@@ -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,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var dateTime = /** @class */ (function () {
4
- function dateTime(datetime, format) {
5
- if (datetime === void 0) { datetime = null; }
6
- if (format === void 0) { format = "y-m-d h:i:s"; }
7
- this.resut_format = "y-m-d h:i:s";
8
- this.format(format);
9
- this.datetime = datetime !== "0000-00-00 00:00:00" && datetime !== "0000-00-00" && datetime ? datetime : new Date().toISOString(); // GMT ekli halde
10
- return this;
11
- }
12
- dateTime.prototype.addDays = function (days) {
13
- var datetime = new Date(this.datetime);
14
- datetime.setDate(datetime.getDate() + days);
15
- this.datetime = datetime.toISOString();
16
- return this;
17
- };
18
- dateTime.prototype.parse = function () {
19
- var datetime = new Date(this.datetime);
20
- var monthNames = ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"];
21
- var dayNames = ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"];
22
- return {
23
- y: datetime.getFullYear().toString(),
24
- m: (datetime.getMonth() + 1).toString().padStart(2, "0"),
25
- d: datetime.getDate().toString().padStart(2, "0"),
26
- h: datetime.getHours().toString().padStart(2, "0"),
27
- i: datetime.getMinutes().toString().padStart(2, "0"),
28
- s: datetime.getSeconds().toString().padStart(2, "0"),
29
- ms: (datetime.getMilliseconds() / 10).toFixed(0).toString().padStart(2, "0"),
30
- z: (datetime.getTimezoneOffset() / 60).toString(),
31
- // TAM STRING ICEREN IFADELER SONA EKLENMELI
32
- TAMAY: monthNames[datetime.getMonth()],
33
- TAMGUN: dayNames[datetime.getDay()]
34
- };
35
- };
36
- dateTime.prototype.getResult = function () {
37
- var parse = this.parse();
38
- var result = this.resut_format;
39
- result = result.replace(new RegExp("y", "g"), parse.y.toString());
40
- result = result.replace(new RegExp("m", "g"), parse.m.toString());
41
- result = result.replace(new RegExp("d", "g"), parse.d.toString());
42
- result = result.replace(new RegExp("h", "g"), parse.h.toString());
43
- result = result.replace(new RegExp("i", "g"), parse.i.toString());
44
- result = result.replace(new RegExp("s", "g"), parse.s.toString());
45
- result = result.replace(new RegExp("ms", "g"), parse.ms.toString());
46
- result = result.replace(new RegExp("z", "g"), parse.z.toString());
47
- result = result.replace(new RegExp("TAMAY", "g"), parse.TAMAY.toString());
48
- result = result.replace(new RegExp("TAMGUN", "g"), parse.TAMGUN.toString());
49
- return result;
50
- };
51
- dateTime.prototype.format = function (format) {
52
- if (format === void 0) { format = "y-m-d h:i:s"; }
53
- this.resut_format = format;
54
- return this;
55
- };
56
- dateTime.prototype.today = function () {
57
- this.datetime = new Date().toISOString();
58
- this.format("y-m-d");
59
- return this.getResult();
60
- };
61
- dateTime.prototype.getTime = function () {
62
- var convertDateTime = new dateTime(this.datetime).format("y-m-d h:i:s").getResult();
63
- var datetime = new Date(convertDateTime);
64
- return datetime.getTime();
65
- };
66
- dateTime.prototype.nextMonthFirstDay = function (format) {
67
- if (format === void 0) { format = "y-m-d"; }
68
- // Verilen tarihin bir sonraki ayının ilk gününü bul
69
- this.datetime = new Date(this.datetime);
70
- this.datetime.setMonth(this.datetime.getMonth() + 1);
71
- this.datetime.setDate(1);
72
- this.datetime = this.datetime.toISOString();
73
- this.format(format);
74
- return this.getResult();
75
- };
76
- return dateTime;
77
- }());
78
- exports.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 {};
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Button = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var Dialog_1 = require("./Dialog");
7
- var react_1 = require("react");
8
- var tooltip_1 = require("../tooltip");
9
- var link_1 = tslib_1.__importDefault(require("next/link"));
10
- var Button_module_css_1 = tslib_1.__importDefault(require("./styles/Button.module.css"));
11
- exports.Button = (0, react_1.memo)(function MemoFunction(_a) {
12
- 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 = tslib_1.__rest(_a, ["children", "component", "className", "buttonClass", "buttonSize", "style", "type", "fullWidth", "onlyIcon", "onClick", "href", "target", "tabIndex", "title", "titlePosition", "titleArrow", "dialog", "autoFocus"]);
13
- var Comp = component;
14
- var ripple = function (e) {
15
- var el = e.currentTarget;
16
- var circle = document.createElement("span");
17
- var diameter = Math.max(el.clientWidth, el.clientHeight);
18
- circle.style.width = circle.style.height = "".concat(diameter, "px");
19
- circle.classList.add(Button_module_css_1.default.ripple);
20
- var ripple = el.getElementsByClassName(Button_module_css_1.default.ripple)[0];
21
- if (ripple)
22
- ripple.remove();
23
- el.appendChild(circle);
24
- };
25
- var handleClick = function (e) {
26
- ripple(e);
27
- if (dialog) {
28
- (0, Dialog_1.Dialog)(dialog).then(function (result) {
29
- if (result && onClick) {
30
- onClick(e);
31
- }
32
- });
33
- }
34
- else {
35
- if (onClick)
36
- onClick(e);
37
- }
38
- };
39
- var createClassList = (0, react_1.useCallback)(function () {
40
- var list = ["sbutton", Button_module_css_1.default.button];
41
- if (buttonClass)
42
- list.push(Button_module_css_1.default[buttonClass]);
43
- if (className)
44
- list.push(className);
45
- if (onlyIcon)
46
- list.push(Button_module_css_1.default.iconbutton);
47
- if (fullWidth)
48
- list.push(Button_module_css_1.default.fullwidth);
49
- return list.join(" ");
50
- }, [buttonClass, className, onlyIcon, fullWidth]);
51
- var _g = (0, react_1.useState)(function () { return createClassList(); }), classList = _g[0], setClassList = _g[1];
52
- (0, react_1.useEffect)(function () {
53
- var newClassList = createClassList().split(" ").filter(Boolean);
54
- if (href && typeof window !== "undefined" && window.location.pathname === href) {
55
- newClassList.push("active");
56
- }
57
- setClassList(newClassList.join(" "));
58
- }, [href, createClassList]);
59
- var ortakProps = tslib_1.__assign({ className: classList, style: style, onClick: handleClick, tabIndex: tabIndex, autoFocus: autoFocus, "data-button-size": (!onlyIcon) ? buttonSize : null }, other);
60
- var renderComponent;
61
- if (href !== undefined) {
62
- if (other === null || other === void 0 ? void 0 : other.hidden) {
63
- renderComponent = null;
64
- }
65
- else {
66
- var checkHref = (other === null || other === void 0 ? void 0 : other.disabled) ? "#" : href;
67
- renderComponent = ((0, jsx_runtime_1.jsx)(link_1.default, { href: checkHref, target: (other === null || other === void 0 ? void 0 : other.disabled) ? "_self" : target, children: (0, jsx_runtime_1.jsx)(Comp, tslib_1.__assign({}, ortakProps, { children: onlyIcon ? onlyIcon : children })) }));
68
- }
69
- }
70
- else {
71
- renderComponent = ((0, jsx_runtime_1.jsx)(Comp, tslib_1.__assign({ type: type }, ortakProps, { children: onlyIcon ? onlyIcon : children })));
72
- }
73
- if (title && renderComponent) {
74
- return ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: title, position: titlePosition, arrow: titleArrow, children: renderComponent }));
75
- }
76
- else {
77
- return renderComponent;
78
- }
79
- });
@@ -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,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Checkbox = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var react_1 = require("react");
7
- var Input_module_css_1 = tslib_1.__importDefault(require("./styles/Input.module.css"));
8
- var Checkbox = function (_a) {
9
- 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;
10
- var refMain = (0, react_1.useRef)(null);
11
- // checked değerini boolean hâline getiriyoruz
12
- var isChecked = checked === "1" || checked === true;
13
- var handleChange = function (newChecked) {
14
- if (disabled)
15
- return;
16
- onToogle === null || onToogle === void 0 ? void 0 : onToogle({
17
- target: {
18
- name: name,
19
- value: newChecked ? "1" : "0"
20
- }
21
- });
22
- };
23
- var toggleCheck = function () {
24
- handleChange(!isChecked);
25
- };
26
- return ((0, jsx_runtime_1.jsxs)("div", { ref: refMain, className: "".concat(Input_module_css_1.default.checkbox, " ").concat(className || ""), style: style, tabIndex: tabIndex, onClick: toggleCheck, children: [(0, jsx_runtime_1.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 && (0, jsx_runtime_1.jsx)("label", { style: styleLabel, children: label }), children && (0, jsx_runtime_1.jsx)("div", { children: children })] }));
27
- };
28
- exports.Checkbox = Checkbox;
@@ -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>;
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Dialog = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var box_1 = require("../box");
7
- var client_1 = require("react-dom/client");
8
- var modal_1 = require("../modal");
9
- var Button_1 = require("./Button");
10
- var Dialog = function (config) {
11
- return new Promise(function (resolve) {
12
- if (typeof window === 'undefined')
13
- return false;
14
- var mainDiv = document.getElementById('sdialog');
15
- if (!mainDiv) {
16
- var createDiv = document.createElement('div');
17
- createDiv.setAttribute('id', 'sdialog');
18
- document.body.appendChild(createDiv);
19
- mainDiv = createDiv;
20
- }
21
- var root = (0, client_1.createRoot)(mainDiv);
22
- var settings = tslib_1.__assign({ acceptButtonShow: true, cancelButtonShow: true, acceptButtonText: 'EVET', cancelButtonText: 'HAYIR', acceptButtonClass: 'danger', cancelButtonClass: 'secondary', vertialAlign: 'center', horizontalAlign: 'center', hideBackdrop: true, hideEsc: true, styleMessage: {
23
- fontSize: '1.1rem',
24
- padding: '10px 20px'
25
- }, styleBox: { padding: 0, margin: 0, minWidth: 250 }, styleBoxFooter: { padding: '8px 5px' }, autoFocus: 'accept' }, config);
26
- var close = function () {
27
- if (mainDiv) {
28
- root.unmount();
29
- mainDiv.remove();
30
- }
31
- };
32
- var onCancel = function () {
33
- resolve(false);
34
- close();
35
- };
36
- var onAccept = function () {
37
- resolve(true);
38
- close();
39
- };
40
- var Component = ((0, jsx_runtime_1.jsx)(modal_1.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: (0, jsx_runtime_1.jsxs)(box_1.Box, { style: settings.styleBox, children: [(0, jsx_runtime_1.jsx)("div", { className: "sbox_content", style: settings.styleMessage, dangerouslySetInnerHTML: { __html: settings.message } }), (settings.acceptButtonShow || settings.cancelButtonShow) && ((0, jsx_runtime_1.jsxs)(box_1.BoxFooter, { style: settings.styleBoxFooter, children: [settings.cancelButtonShow && ((0, jsx_runtime_1.jsx)(Button_1.Button, { autoFocus: settings.autoFocus === 'cancel', buttonClass: settings.cancelButtonClass, onClick: onCancel, children: settings.cancelButtonText })), settings.acceptButtonShow && ((0, jsx_runtime_1.jsx)(Button_1.Button, { autoFocus: settings.autoFocus === 'accept', buttonClass: settings.acceptButtonClass, onClick: onAccept, children: settings.acceptButtonText }))] }))] }) }));
41
- root.render(Component);
42
- });
43
- };
44
- exports.Dialog = Dialog;
@@ -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 {};
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Form = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var react_1 = require("react");
7
- exports.Form = (0, react_1.memo)(function FunctionMemo(_a) {
8
- 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 = tslib_1.__rest(_a, ["encType", "onSubmit", "style", "disableOnEnterSubmit"]);
9
- var onKeyDown = function (e) {
10
- if (e.key === "Enter" && disableOnEnterSubmit) {
11
- e.preventDefault();
12
- }
13
- };
14
- return (0, jsx_runtime_1.jsx)("form", tslib_1.__assign({ style: style, encType: encType, onSubmit: onSubmit, onKeyDown: onKeyDown }, other));
15
- });
@@ -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,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FormOlustur = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var react_1 = tslib_1.__importStar(require("react"));
7
- var grid_1 = require("../grid");
8
- var baseFunctions_1 = require("../_lib/baseFunctions");
9
- var Label_1 = require("./Label");
10
- exports.FormOlustur = (0, react_1.memo)(function FunctionMemo(props) {
11
- 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;
12
- (0, react_1.useEffect)(function () {
13
- if (formOgeler && onChange && form) {
14
- formOgeler.forEach(function (formOgeler) {
15
- var _a, _b, _c, _d;
16
- 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;
17
- if (formOgeler.noRender && fieldName && form[fieldName] && form[fieldName] != '') {
18
- baseFunctions_1.isDev && console.log('noRenderGuncelle');
19
- 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)) {
20
- onChange({
21
- target: {
22
- name: fieldName,
23
- value: ''
24
- }
25
- });
26
- }
27
- }
28
- });
29
- }
30
- }, [JSON.stringify(form), formOgeler]);
31
- var result = (0, react_1.useMemo)(function () {
32
- return formOgeler.map(function (_a, i) {
33
- 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;
34
- if (noRender) {
35
- return null;
36
- }
37
- if (fullComponent)
38
- return react_1.default.cloneElement(fullComponent, { key: i });
39
- var newProps = tslib_1.__assign({}, propsComponent);
40
- if (onChange && component && !component.props.onChange) {
41
- newProps = tslib_1.__assign(tslib_1.__assign({}, newProps), { onChange: onChange });
42
- }
43
- if (onChange && form && component.props.name && !component.props.value) {
44
- newProps = tslib_1.__assign(tslib_1.__assign({}, newProps), { value: form[component.props.name] && form[component.props.name].length > 0 ? String(form[component.props.name]) : '' });
45
- }
46
- if (formType === 'label')
47
- newProps = tslib_1.__assign(tslib_1.__assign({}, newProps), { label: '' });
48
- var detectLabel = label || component.props.label;
49
- gridLabel = tslib_1.__assign(tslib_1.__assign({}, sabitGrid.label), gridLabel);
50
- gridInput = tslib_1.__assign(tslib_1.__assign({}, sabitGrid.input), gridInput);
51
- return ((0, jsx_runtime_1.jsxs)(grid_1.Row, tslib_1.__assign({ justifyContent: justifyContent, rowSpacing: rowSpacing, colSpacing: colSpacing }, propsRow, { children: [formType === 'label' && detectLabel && ((0, jsx_runtime_1.jsx)(grid_1.Col, tslib_1.__assign({}, gridLabel, { children: (0, jsx_runtime_1.jsx)(Label_1.Label, tslib_1.__assign({ required: component.props.required }, propsLabel, { children: detectLabel })) }))), (0, jsx_runtime_1.jsx)(grid_1.Col, tslib_1.__assign({}, gridInput, { children: react_1.default.cloneElement(component, newProps) }))] }), i));
52
- });
53
- }, [form, formOgeler, onChange, formType, sabitGrid, justifyContent, rowSpacing, colSpacing]);
54
- return (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: result });
55
- });