@sydsoft/base 1.52.0 → 1.53.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 (101) hide show
  1. package/_dist/{esm/_lib → _lib}/baseFunctions.js +24 -11
  2. package/_dist/{esm/_lib → _lib}/inputMask.js +7 -3
  3. package/_dist/{esm/_lib → _lib}/listFunctions.js +7 -2
  4. package/_dist/_lib/storage/cookies.js +41 -0
  5. package/_dist/{esm/_lib → _lib}/storage/encData.js +10 -5
  6. package/_dist/_lib/storage/localStorage.js +78 -0
  7. package/_dist/_lib/storage/sessionStorage.js +78 -0
  8. package/_dist/{esm/_lib → _lib}/useInterval.js +8 -5
  9. package/_dist/{esm/alert → alert}/index.js +22 -13
  10. package/_dist/box/Box.js +19 -0
  11. package/_dist/box/BoxContent.js +11 -0
  12. package/_dist/box/BoxFooter.js +11 -0
  13. package/_dist/box/BoxHeader.js +12 -0
  14. package/_dist/box/index.js +12 -0
  15. package/_dist/{esm/countDown → countDown}/index.js +17 -12
  16. package/_dist/{esm/dateTime → dateTime}/index.js +3 -1
  17. package/_dist/form/Button.js +79 -0
  18. package/_dist/form/Checkbox.js +28 -0
  19. package/_dist/form/Dialog.js +44 -0
  20. package/_dist/form/Form.js +15 -0
  21. package/_dist/{esm/form → form}/FormOlustur.js +22 -19
  22. package/_dist/{esm/form → form}/Input.js +49 -45
  23. package/_dist/form/Label.js +12 -0
  24. package/_dist/{esm/form → form}/SearchableInput.js +48 -45
  25. package/_dist/{esm/form → form}/UploadBase.js +21 -16
  26. package/_dist/form/index.js +12 -0
  27. package/_dist/grid/index.js +104 -0
  28. package/_dist/icon/icons.js +26 -0
  29. package/_dist/icon/index.js +30 -0
  30. package/_dist/icon/mui.js +2 -0
  31. package/_dist/index.js +22 -0
  32. package/_dist/menu/index.js +55 -0
  33. package/_dist/{esm/modal → modal}/index.js +16 -13
  34. package/_dist/{esm/popover → popover}/index.js +39 -36
  35. package/_dist/{esm/tooltip → tooltip}/index.js +9 -6
  36. package/package.json +6 -7
  37. package/_dist/esm/_lib/storage/cookies.js +0 -34
  38. package/_dist/esm/_lib/storage/localStorage.js +0 -69
  39. package/_dist/esm/_lib/storage/sessionStorage.js +0 -69
  40. package/_dist/esm/box/Box.js +0 -15
  41. package/_dist/esm/box/BoxContent.js +0 -7
  42. package/_dist/esm/box/BoxFooter.js +0 -8
  43. package/_dist/esm/box/BoxHeader.js +0 -9
  44. package/_dist/esm/box/index.js +0 -9
  45. package/_dist/esm/form/Button.js +0 -76
  46. package/_dist/esm/form/Checkbox.js +0 -23
  47. package/_dist/esm/form/Dialog.js +0 -40
  48. package/_dist/esm/form/Form.js +0 -12
  49. package/_dist/esm/form/Label.js +0 -9
  50. package/_dist/esm/form/index.js +0 -9
  51. package/_dist/esm/grid/index.js +0 -97
  52. package/_dist/esm/icon/icons.js +0 -23
  53. package/_dist/esm/icon/index.js +0 -26
  54. package/_dist/esm/icon/mui.js +0 -1
  55. package/_dist/esm/index.js +0 -19
  56. package/_dist/esm/menu/index.js +0 -52
  57. /package/_dist/{esm/_lib → _lib}/baseFunctions.d.ts +0 -0
  58. /package/_dist/{esm/_lib → _lib}/inputMask.d.ts +0 -0
  59. /package/_dist/{esm/_lib → _lib}/listFunctions.d.ts +0 -0
  60. /package/_dist/{esm/_lib → _lib}/storage/cookies.d.ts +0 -0
  61. /package/_dist/{esm/_lib → _lib}/storage/encData.d.ts +0 -0
  62. /package/_dist/{esm/_lib → _lib}/storage/localStorage.d.ts +0 -0
  63. /package/_dist/{esm/_lib → _lib}/storage/sessionStorage.d.ts +0 -0
  64. /package/_dist/{esm/_lib → _lib}/useInterval.d.ts +0 -0
  65. /package/_dist/{esm/alert → alert}/index.d.ts +0 -0
  66. /package/_dist/{esm/alert → alert}/index.module.css +0 -0
  67. /package/_dist/{esm/box → box}/Box.d.ts +0 -0
  68. /package/_dist/{esm/box → box}/Box.module.css +0 -0
  69. /package/_dist/{esm/box → box}/BoxContent.d.ts +0 -0
  70. /package/_dist/{esm/box → box}/BoxFooter.d.ts +0 -0
  71. /package/_dist/{esm/box → box}/BoxHeader.d.ts +0 -0
  72. /package/_dist/{esm/box → box}/index.d.ts +0 -0
  73. /package/_dist/{esm/countDown → countDown}/index.d.ts +0 -0
  74. /package/_dist/{esm/dateTime → dateTime}/index.d.ts +0 -0
  75. /package/_dist/{esm/form → form}/Button.d.ts +0 -0
  76. /package/_dist/{esm/form → form}/Checkbox.d.ts +0 -0
  77. /package/_dist/{esm/form → form}/Dialog.d.ts +0 -0
  78. /package/_dist/{esm/form → form}/Form.d.ts +0 -0
  79. /package/_dist/{esm/form → form}/FormOlustur.d.ts +0 -0
  80. /package/_dist/{esm/form → form}/Input.d.ts +0 -0
  81. /package/_dist/{esm/form → form}/Label.d.ts +0 -0
  82. /package/_dist/{esm/form → form}/SearchableInput.d.ts +0 -0
  83. /package/_dist/{esm/form → form}/UploadBase.d.ts +0 -0
  84. /package/_dist/{esm/form → form}/index.d.ts +0 -0
  85. /package/_dist/{esm/form → form}/styles/Button.module.css +0 -0
  86. /package/_dist/{esm/form → form}/styles/Input.module.css +0 -0
  87. /package/_dist/{esm/form → form}/styles/Label.module.css +0 -0
  88. /package/_dist/{esm/form → form}/styles/SearchableInput.module.css +0 -0
  89. /package/_dist/{esm/grid → grid}/index.d.ts +0 -0
  90. /package/_dist/{esm/grid → grid}/index.module.css +0 -0
  91. /package/_dist/{esm/icon → icon}/icons.d.ts +0 -0
  92. /package/_dist/{esm/icon → icon}/index.d.ts +0 -0
  93. /package/_dist/{esm/icon → icon}/mui.d.ts +0 -0
  94. /package/_dist/{esm/index.d.ts → index.d.ts} +0 -0
  95. /package/_dist/{esm/menu → menu}/index.d.ts +0 -0
  96. /package/_dist/{esm/menu → menu}/index.module.css +0 -0
  97. /package/_dist/{esm/modal → modal}/index.d.ts +0 -0
  98. /package/_dist/{esm/modal → modal}/index.module.css +0 -0
  99. /package/_dist/{esm/popover → popover}/index.d.ts +0 -0
  100. /package/_dist/{esm/popover → popover}/index.module.css +0 -0
  101. /package/_dist/{esm/tooltip → tooltip}/index.d.ts +0 -0
@@ -0,0 +1,79 @@
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
+ });
@@ -0,0 +1,28 @@
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;
@@ -0,0 +1,44 @@
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;
@@ -0,0 +1,15 @@
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,18 +1,21 @@
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) {
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) {
8
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;
9
- useEffect(function () {
12
+ (0, react_1.useEffect)(function () {
10
13
  if (formOgeler && onChange && form) {
11
14
  formOgeler.forEach(function (formOgeler) {
12
15
  var _a, _b, _c, _d;
13
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;
14
17
  if (formOgeler.noRender && fieldName && form[fieldName] && form[fieldName] != '') {
15
- isDev && console.log('noRenderGuncelle');
18
+ baseFunctions_1.isDev && console.log('noRenderGuncelle');
16
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)) {
17
20
  onChange({
18
21
  target: {
@@ -25,28 +28,28 @@ export var FormOlustur = memo(function FunctionMemo(props) {
25
28
  });
26
29
  }
27
30
  }, [JSON.stringify(form), formOgeler]);
28
- var result = useMemo(function () {
31
+ var result = (0, react_1.useMemo)(function () {
29
32
  return formOgeler.map(function (_a, i) {
30
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;
31
34
  if (noRender) {
32
35
  return null;
33
36
  }
34
37
  if (fullComponent)
35
- return React.cloneElement(fullComponent, { key: i });
36
- var newProps = __assign({}, propsComponent);
38
+ return react_1.default.cloneElement(fullComponent, { key: i });
39
+ var newProps = tslib_1.__assign({}, propsComponent);
37
40
  if (onChange && component && !component.props.onChange) {
38
- newProps = __assign(__assign({}, newProps), { onChange: onChange });
41
+ newProps = tslib_1.__assign(tslib_1.__assign({}, newProps), { onChange: onChange });
39
42
  }
40
43
  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]) : '' });
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]) : '' });
42
45
  }
43
46
  if (formType === 'label')
44
- newProps = __assign(__assign({}, newProps), { label: '' });
47
+ newProps = tslib_1.__assign(tslib_1.__assign({}, newProps), { label: '' });
45
48
  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
+ 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));
49
52
  });
50
53
  }, [form, formOgeler, onChange, formType, sabitGrid, justifyContent, rowSpacing, colSpacing]);
51
- return _jsx(React.Fragment, { children: result });
54
+ return (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: result });
52
55
  });
@@ -1,43 +1,46 @@
1
- import { __assign } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Input = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
3
6
  /**
4
7
  * @author : izzetseydaoglu
5
8
  * @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
6
9
  * @version : 2026-01-21 21:35:48
7
10
  */
8
- import { useCallback, useEffect, useRef, useState } from 'react';
9
- import { convertForSEO, inputTumuBuyukCevir, inputTumuKucukCevir } from '../_lib/baseFunctions';
10
- import { applyInputMask } from '../_lib/inputMask';
11
- import { alert_add } from '../alert';
12
- import { Dialog } from './Dialog';
13
- import styles from './styles/Input.module.css';
14
- export var Input = function (_a) {
11
+ var react_1 = require("react");
12
+ var baseFunctions_1 = require("../_lib/baseFunctions");
13
+ var inputMask_1 = require("../_lib/inputMask");
14
+ var alert_1 = require("../alert");
15
+ var Dialog_1 = require("./Dialog");
16
+ var Input_module_css_1 = tslib_1.__importDefault(require("./styles/Input.module.css"));
17
+ var Input = function (_a) {
15
18
  var componentRef = _a.componentRef, inputRef = _a.inputRef, className = _a.className, propsComponent = _a.propsComponent, propsInput = _a.propsInput, id = _a.id, name = _a.name, _b = _a.value, value = _b === void 0 ? '' : _b, type = _a.type, label = _a.label, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, placeholder = _a.placeholder, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, onClick = _a.onClick, onKeyPress = _a.onKeyPress, onKeyUp = _a.onKeyUp, onKeyDown = _a.onKeyDown, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.required, required = _d === void 0 ? false : _d, _e = _a.loading, loading = _e === void 0 ? false : _e, _f = _a.autoFocus, autoFocus = _f === void 0 ? false : _f, select = _a.select, _g = _a.valueKey, valueKey = _g === void 0 ? 'value' : _g, _h = _a.labelKey, labelKey = _h === void 0 ? 'label' : _h, _j = _a.ilkSec, ilkSec = _j === void 0 ? false : _j, _k = _a.multiline, multiline = _k === void 0 ? false : _k, _l = _a.rows, rows = _l === void 0 ? 2 : _l, sadeceYazi = _a.sadeceYazi, sadeceSayi = _a.sadeceSayi, tumuBuyuk = _a.tumuBuyuk, tumuKucuk = _a.tumuKucuk, seoCevir = _a.seoCevir, dosyaNoGiris = _a.dosyaNoGiris, fileNameGiris = _a.fileNameGiris, dateGecmisKontrol = _a.dateGecmisKontrol, autoSelectText = _a.autoSelectText, _m = _a.mask, mask = _m === void 0 ? '' : _m, _o = _a.maskSettings, maskSettings = _o === void 0 ? {
16
19
  clearIfNotMatch: true,
17
20
  reverse: false, //Tersten doldurmaya başla, fiyatlar için geçerli
18
21
  selectOnFocus: false
19
22
  } : _o;
20
- var refMain = useRef(null);
21
- var refInput = useRef(null);
22
- var refLabel = useRef(null);
23
- var _p = useState(value && value.toString().length > 0), inputFilled = _p[0], setInputFilled = _p[1];
24
- var _q = useState(false), focus = _q[0], setFocus = _q[1];
25
- useEffect(function () {
23
+ var refMain = (0, react_1.useRef)(null);
24
+ var refInput = (0, react_1.useRef)(null);
25
+ var refLabel = (0, react_1.useRef)(null);
26
+ var _p = (0, react_1.useState)(value && value.toString().length > 0), inputFilled = _p[0], setInputFilled = _p[1];
27
+ var _q = (0, react_1.useState)(false), focus = _q[0], setFocus = _q[1];
28
+ (0, react_1.useEffect)(function () {
26
29
  if (inputRef)
27
30
  inputRef.current = refInput.current;
28
31
  if (componentRef)
29
32
  componentRef.current = refMain.current;
30
33
  }, [componentRef, inputRef]);
31
- useEffect(function () {
34
+ (0, react_1.useEffect)(function () {
32
35
  autoSelectText && !select && (refInput === null || refInput === void 0 ? void 0 : refInput.current) && refInput.current.select();
33
36
  }, [autoSelectText, select]);
34
- useEffect(function () {
37
+ (0, react_1.useEffect)(function () {
35
38
  var _a, _b;
36
39
  var filled = String(value) && value.toString().length > 0 ? true : false;
37
40
  setInputFilled(filled);
38
- filled && ((_b = (_a = refMain === null || refMain === void 0 ? void 0 : refMain.current) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.remove(styles.error));
41
+ filled && ((_b = (_a = refMain === null || refMain === void 0 ? void 0 : refMain.current) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.remove(Input_module_css_1.default.error));
39
42
  }, [value]);
40
- useEffect(function () {
43
+ (0, react_1.useEffect)(function () {
41
44
  // if (type === "number") sadeceSayi = true; //TODO: sadeceSayi burada değiştirelemez ki!!!
42
45
  if (select && ilkSec && (value === '' || value === null || value === undefined)) {
43
46
  if (select.length) {
@@ -46,13 +49,13 @@ export var Input = function (_a) {
46
49
  }
47
50
  }
48
51
  }, [select]);
49
- useEffect(function () {
52
+ (0, react_1.useEffect)(function () {
50
53
  var _a;
51
54
  if (typeof window !== 'undefined' && (mask === null || mask === void 0 ? void 0 : mask.length) > 0 && (refInput === null || refInput === void 0 ? void 0 : refInput.current)) {
52
55
  (_a = refInput.current) === null || _a === void 0 ? void 0 : _a.setAttribute('autocomplete', 'off');
53
56
  }
54
57
  if ((mask === null || mask === void 0 ? void 0 : mask.length) > 0 && (refInput === null || refInput === void 0 ? void 0 : refInput.current)) {
55
- var maskInstance_1 = applyInputMask(refInput.current, mask, __assign(__assign({}, maskSettings), { onChange: function (masked, clean, e) {
58
+ var maskInstance_1 = (0, inputMask_1.applyInputMask)(refInput.current, mask, tslib_1.__assign(tslib_1.__assign({}, maskSettings), { onChange: function (masked, clean, e) {
56
59
  if (onChange) {
57
60
  onChange({ target: { name: name, value: masked } });
58
61
  }
@@ -64,40 +67,40 @@ export var Input = function (_a) {
64
67
  return function () { return maskInstance_1 === null || maskInstance_1 === void 0 ? void 0 : maskInstance_1.destroy(); };
65
68
  }
66
69
  }, [mask]);
67
- var Change = useCallback(function (e) {
70
+ var Change = (0, react_1.useCallback)(function (e) {
68
71
  if (tumuBuyuk)
69
- inputTumuBuyukCevir(e);
72
+ (0, baseFunctions_1.inputTumuBuyukCevir)(e);
70
73
  if (tumuKucuk)
71
- inputTumuKucukCevir(e);
74
+ (0, baseFunctions_1.inputTumuKucukCevir)(e);
72
75
  if (seoCevir)
73
- convertForSEO(e);
76
+ (0, baseFunctions_1.convertForSEO)(e);
74
77
  setInputFilled(e.target.value.length > 0);
75
78
  onChange ? onChange(e) : null;
76
79
  }, [onChange, seoCevir, tumuBuyuk, tumuKucuk]);
77
- var Focus = useCallback(function (e) {
80
+ var Focus = (0, react_1.useCallback)(function (e) {
78
81
  var _a, _b;
79
82
  onFocus ? onFocus(e) : null;
80
83
  setFocus(true);
81
- (_b = (_a = refMain === null || refMain === void 0 ? void 0 : refMain.current) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.remove(styles.error);
84
+ (_b = (_a = refMain === null || refMain === void 0 ? void 0 : refMain.current) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.remove(Input_module_css_1.default.error);
82
85
  }, [onFocus]);
83
- var Blur = useCallback(function (e) {
86
+ var Blur = (0, react_1.useCallback)(function (e) {
84
87
  var _a, _b, _c, _d;
85
88
  if (fileNameGiris && e.target.value !== '' && /[/\\?%*:|"'<>]/g.test(e.target.value)) {
86
89
  e.target.value = e.target.value.replace(/[/\\?%*:|"'<>]/g, '-');
87
90
  if (onChange)
88
91
  onChange(e);
89
- alert_add({ type: 'warning', message: 'Lütfen dosya adındaki özel karakter değiştirildi.' });
92
+ (0, alert_1.alert_add)({ type: 'warning', message: 'Lütfen dosya adındaki özel karakter değiştirildi.' });
90
93
  }
91
94
  if (dosyaNoGiris && e.target.value !== '' && !/^[1-2]\d{3}\/\d/.test(e.target.value)) {
92
95
  e.target.value = '';
93
96
  if (onChange)
94
97
  onChange(e);
95
- alert_add({ type: 'error', message: 'Lütfen doğru bir dosya numarası giriniz. Örn: 2022/123' });
98
+ (0, alert_1.alert_add)({ type: 'error', message: 'Lütfen doğru bir dosya numarası giriniz. Örn: 2022/123' });
96
99
  }
97
100
  if (dateGecmisKontrol && e.target.value !== '') {
98
101
  var today = new Date().toISOString().slice(0, 10);
99
102
  if (e.target.value < today) {
100
- Dialog({
103
+ (0, Dialog_1.Dialog)({
101
104
  message: 'Geçmiş bir tarihi seçtiniz. Devam etmek istiyor musunuz?'
102
105
  }).then(function (r) {
103
106
  if (!r) {
@@ -111,10 +114,10 @@ export var Input = function (_a) {
111
114
  }
112
115
  if (required) {
113
116
  if (e.target.value === '') {
114
- (_b = (_a = refMain === null || refMain === void 0 ? void 0 : refMain.current) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.add(styles.error);
117
+ (_b = (_a = refMain === null || refMain === void 0 ? void 0 : refMain.current) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.add(Input_module_css_1.default.error);
115
118
  }
116
119
  else {
117
- (_d = (_c = refMain === null || refMain === void 0 ? void 0 : refMain.current) === null || _c === void 0 ? void 0 : _c.classList) === null || _d === void 0 ? void 0 : _d.remove(styles.error);
120
+ (_d = (_c = refMain === null || refMain === void 0 ? void 0 : refMain.current) === null || _c === void 0 ? void 0 : _c.classList) === null || _d === void 0 ? void 0 : _d.remove(Input_module_css_1.default.error);
118
121
  }
119
122
  }
120
123
  if (value !== e.target.value) {
@@ -123,8 +126,8 @@ export var Input = function (_a) {
123
126
  onBlur ? onBlur(e) : null;
124
127
  setFocus(false);
125
128
  }, [fileNameGiris, dosyaNoGiris, dateGecmisKontrol, required, value, onBlur, onChange, name]);
126
- var Click = useCallback(function (e) { return (onClick ? onClick(e) : null); }, [onClick]);
127
- var KeyPress = useCallback(function (e) {
129
+ var Click = (0, react_1.useCallback)(function (e) { return (onClick ? onClick(e) : null); }, [onClick]);
130
+ var KeyPress = (0, react_1.useCallback)(function (e) {
128
131
  if (sadeceYazi) {
129
132
  var turkishLetters = /[ğüşıöçĞÜŞİÖÇ]/;
130
133
  if (!(/[A-Za-z\s.]/.test(e.key) || turkishLetters.test(e.key))) {
@@ -139,8 +142,8 @@ export var Input = function (_a) {
139
142
  }
140
143
  onKeyPress ? onKeyPress(e) : null;
141
144
  }, [sadeceYazi, sadeceSayi, dosyaNoGiris, onKeyPress]);
142
- var KeyUp = useCallback(function (e) { return (onKeyUp ? onKeyUp(e) : null); }, [onKeyUp]);
143
- var KeyDown = useCallback(function (e) {
145
+ var KeyUp = (0, react_1.useCallback)(function (e) { return (onKeyUp ? onKeyUp(e) : null); }, [onKeyUp]);
146
+ var KeyDown = (0, react_1.useCallback)(function (e) {
144
147
  onKeyDown ? onKeyDown(e) : null;
145
148
  }, [onKeyDown]);
146
149
  var ortakProps = {
@@ -162,29 +165,29 @@ export var Input = function (_a) {
162
165
  };
163
166
  var component;
164
167
  if (select) {
165
- component = (_jsxs("select", __assign({ className: "".concat(styles.input, " ").concat(styles.select) }, ortakProps, propsInput, { children: [ilkSec === false && _jsx("option", { value: '' }), select.map(function (item) {
168
+ component = ((0, jsx_runtime_1.jsxs)("select", tslib_1.__assign({ className: "".concat(Input_module_css_1.default.input, " ").concat(Input_module_css_1.default.select) }, ortakProps, propsInput, { children: [ilkSec === false && (0, jsx_runtime_1.jsx)("option", { value: '' }), select.map(function (item) {
166
169
  var value = item[valueKey];
167
170
  var label = item[labelKey];
168
- return (_jsx("option", { value: value, children: label ? label : value }, value));
171
+ return ((0, jsx_runtime_1.jsx)("option", { value: value, children: label ? label : value }, value));
169
172
  })] })));
170
173
  }
171
174
  else if (multiline) {
172
- component = _jsx("textarea", __assign({ className: "".concat(styles.input, " ").concat(styles.textarea), rows: rows }, ortakProps, propsInput));
175
+ component = (0, jsx_runtime_1.jsx)("textarea", tslib_1.__assign({ className: "".concat(Input_module_css_1.default.input, " ").concat(Input_module_css_1.default.textarea), rows: rows }, ortakProps, propsInput));
173
176
  }
174
177
  else {
175
- component = _jsx("input", __assign({ className: "".concat(styles.input), type: type }, ortakProps, propsInput));
178
+ component = (0, jsx_runtime_1.jsx)("input", tslib_1.__assign({ className: "".concat(Input_module_css_1.default.input), type: type }, ortakProps, propsInput));
176
179
  }
177
180
  var classList = function () {
178
- var list = ['sInputComponent', styles.component];
181
+ var list = ['sInputComponent', Input_module_css_1.default.component];
179
182
  if (className)
180
183
  list.push(className);
181
184
  if (label) {
182
- list.push(styles.hidePlaceHolder);
185
+ list.push(Input_module_css_1.default.hidePlaceHolder);
183
186
  }
184
187
  // if (props.required && (value.length === 0 || !value)) list.push("error");
185
188
  return list.join(' ');
186
189
  };
187
- useEffect(function () {
190
+ (0, react_1.useEffect)(function () {
188
191
  if (propsComponent && propsComponent.hasOwnProperty('style')) {
189
192
  var background = propsComponent.style.background ? propsComponent.style.background : propsComponent.style.backgroundColor ? propsComponent.style.backgroundColor : null;
190
193
  if (background && refLabel.current) {
@@ -192,5 +195,6 @@ export var Input = function (_a) {
192
195
  }
193
196
  }
194
197
  }, [propsComponent]);
195
- return (_jsxs("div", __assign({ ref: refMain, className: classList(), "data-disabled": disabled }, propsComponent, { children: [startAdornment && _jsx("div", { className: "adornment_start ".concat(styles.adornment, " ").concat(styles.start), children: startAdornment }), _jsxs("div", { className: "".concat(styles.inputBase, " ").concat(inputFilled || focus || type == 'date' ? styles.open : ''), children: [component, label && (_jsxs("div", { ref: refLabel, className: "label ".concat(styles.label), children: [label, required && _jsx("span", { className: styles.required, children: "*" })] }))] }), (endAdornment || loading) && (_jsxs("div", { className: "adornment_end ".concat(styles.adornment, " ").concat(styles.end), children: [endAdornment, loading && _jsx("div", { className: styles.loading })] }))] })));
198
+ return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ ref: refMain, className: classList(), "data-disabled": disabled }, propsComponent, { children: [startAdornment && (0, jsx_runtime_1.jsx)("div", { className: "adornment_start ".concat(Input_module_css_1.default.adornment, " ").concat(Input_module_css_1.default.start), children: startAdornment }), (0, jsx_runtime_1.jsxs)("div", { className: "".concat(Input_module_css_1.default.inputBase, " ").concat(inputFilled || focus || type == 'date' ? Input_module_css_1.default.open : ''), children: [component, label && ((0, jsx_runtime_1.jsxs)("div", { ref: refLabel, className: "label ".concat(Input_module_css_1.default.label), children: [label, required && (0, jsx_runtime_1.jsx)("span", { className: Input_module_css_1.default.required, children: "*" })] }))] }), (endAdornment || loading) && ((0, jsx_runtime_1.jsxs)("div", { className: "adornment_end ".concat(Input_module_css_1.default.adornment, " ").concat(Input_module_css_1.default.end), children: [endAdornment, loading && (0, jsx_runtime_1.jsx)("div", { className: Input_module_css_1.default.loading })] }))] })));
196
199
  };
200
+ exports.Input = Input;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Label = 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 tooltip_1 = require("../tooltip");
8
+ var Label_module_css_1 = tslib_1.__importDefault(require("./styles/Label.module.css"));
9
+ exports.Label = (0, react_1.memo)(function FMemo(_a) {
10
+ var _b = _a.required, required = _b === void 0 ? false : _b, children = _a.children, other = tslib_1.__rest(_a, ["required", "children"]);
11
+ return ((0, jsx_runtime_1.jsxs)("label", tslib_1.__assign({ className: Label_module_css_1.default.label }, other, { children: [children, (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: 'Zorunlu Alan', children: (0, jsx_runtime_1.jsx)("span", { className: Label_module_css_1.default.required, children: required && '*' }) })] })));
12
+ });