@sydsoft/base 1.47.0 → 1.48.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 (43) hide show
  1. package/README.md +8 -1
  2. package/dist/esm/_lib/baseFunctions.js +25 -38
  3. package/dist/esm/_lib/inputMask.js +66 -69
  4. package/dist/esm/_lib/listFunctions.js +12 -13
  5. package/dist/esm/_lib/storage/cookies.js +20 -21
  6. package/dist/esm/_lib/storage/encData.js +18 -20
  7. package/dist/esm/_lib/storage/localStorage.js +10 -10
  8. package/dist/esm/_lib/storage/sessionStorage.js +10 -10
  9. package/dist/esm/_lib/useInterval.js +5 -5
  10. package/dist/esm/alert/index.js +28 -30
  11. package/dist/esm/box/Box.js +6 -7
  12. package/dist/esm/box/BoxContent.js +2 -4
  13. package/dist/esm/box/BoxFooter.js +6 -4
  14. package/dist/esm/box/BoxHeader.js +6 -5
  15. package/dist/esm/countDown/index.js +28 -33
  16. package/dist/esm/dateTime/index.js +25 -31
  17. package/dist/esm/form/Button.js +28 -22
  18. package/dist/esm/form/Checkbox.js +7 -8
  19. package/dist/esm/form/Dialog.js +47 -34
  20. package/dist/esm/form/Form.js +3 -5
  21. package/dist/esm/form/FormOlustur.js +15 -17
  22. package/dist/esm/form/Input.js +57 -56
  23. package/dist/esm/form/Label.js +2 -4
  24. package/dist/esm/form/SearchableInput.js +77 -89
  25. package/dist/esm/form/UploadBase.js +30 -32
  26. package/dist/esm/grid/index.js +40 -41
  27. package/dist/esm/icon/icons.js +1 -1
  28. package/dist/esm/icon/index.js +16 -8
  29. package/dist/esm/menu/index.js +14 -16
  30. package/dist/esm/modal/index.js +14 -16
  31. package/dist/esm/popover/index.js +100 -100
  32. package/dist/esm/tooltip/index.js +117 -34
  33. package/package.json +12 -6
  34. package/dist/esm/alert/index.module.css +0 -119
  35. package/dist/esm/grid/index.module.css +0 -805
  36. package/dist/esm/menu/index.module.css +0 -92
  37. package/dist/esm/modal/index.module.css +0 -77
  38. /package/dist/esm/{box/Box.module.css → Box.module.css} +0 -0
  39. /package/dist/esm/{popover/index.module.css → index.module.css} +0 -0
  40. /package/dist/esm/{form/styles → styles}/Button.module.css +0 -0
  41. /package/dist/esm/{form/styles → styles}/Input.module.css +0 -0
  42. /package/dist/esm/{form/styles → styles}/Label.module.css +0 -0
  43. /package/dist/esm/{form/styles → styles}/SearchableInput.module.css +0 -0
@@ -1,40 +1,53 @@
1
- import { __assign } from "tslib";
2
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import { Box, BoxFooter } from '../box';
4
3
  import { createRoot } from 'react-dom/client';
5
4
  import { Modal } from '../modal';
6
5
  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;
6
+ export const Dialog = (config) => new Promise((resolve) => {
7
+ if (typeof window === 'undefined')
8
+ return false;
9
+ let mainDiv = document.getElementById('sdialog');
10
+ if (!mainDiv) {
11
+ const createDiv = document.createElement('div');
12
+ createDiv.setAttribute('id', 'sdialog');
13
+ document.body.appendChild(createDiv);
14
+ mainDiv = createDiv;
15
+ }
16
+ const root = createRoot(mainDiv);
17
+ const settings = {
18
+ acceptButtonShow: true,
19
+ cancelButtonShow: true,
20
+ acceptButtonText: 'EVET',
21
+ cancelButtonText: 'HAYIR',
22
+ acceptButtonClass: 'danger',
23
+ cancelButtonClass: 'secondary',
24
+ vertialAlign: 'center',
25
+ horizontalAlign: 'center',
26
+ hideBackdrop: true,
27
+ hideEsc: true,
28
+ styleMessage: {
29
+ fontSize: '1.1rem',
30
+ padding: '10px 20px'
31
+ },
32
+ styleBox: { padding: 0, margin: 0, minWidth: 250 },
33
+ styleBoxFooter: { padding: '8px 5px' },
34
+ autoFocus: 'accept',
35
+ ...config
36
+ };
37
+ const close = () => {
38
+ if (mainDiv) {
39
+ root.unmount();
40
+ mainDiv.remove();
17
41
  }
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
- };
42
+ };
43
+ const onCancel = () => {
44
+ resolve(false);
45
+ close();
46
+ };
47
+ const onAccept = () => {
48
+ resolve(true);
49
+ close();
50
+ };
51
+ const 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 }))] }))] }) }));
52
+ root.render(Component);
53
+ });
@@ -1,12 +1,10 @@
1
- import { __assign, __rest } from "tslib";
2
1
  import { jsx as _jsx } from "react/jsx-runtime";
3
2
  import { memo } from "react";
4
- export var Form = memo(function FunctionMemo(_a) {
5
- var _b = _a.encType, encType = _b === void 0 ? "multipart/form-data" : _b, onSubmit = _a.onSubmit, style = _a.style, _c = _a.disableOnEnterSubmit, disableOnEnterSubmit = _c === void 0 ? false : _c, other = __rest(_a, ["encType", "onSubmit", "style", "disableOnEnterSubmit"]);
6
- var onKeyDown = function (e) {
3
+ export const Form = memo(function FunctionMemo({ encType = "multipart/form-data", onSubmit, style, disableOnEnterSubmit = false, ...other }) {
4
+ const onKeyDown = (e) => {
7
5
  if (e.key === "Enter" && disableOnEnterSubmit) {
8
6
  e.preventDefault();
9
7
  }
10
8
  };
11
- return _jsx("form", __assign({ style: style, encType: encType, onSubmit: onSubmit, onKeyDown: onKeyDown }, other));
9
+ return _jsx("form", { style: style, encType: encType, onSubmit: onSubmit, onKeyDown: onKeyDown, ...other });
12
10
  });
@@ -1,16 +1,15 @@
1
- import { __assign } from "tslib";
2
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import React, { memo, useEffect, useMemo } from 'react';
4
3
  import { Col, Row } from '../grid';
5
4
  import { isDev } from '../_lib/baseFunctions';
6
5
  import { Label } from './Label';
7
- export var FormOlustur = memo(function FunctionMemo(props) {
8
- var form = props.form, formOgeler = props.formOgeler, onChange = props.onChange, formType = props.formType, sabitGrid = props.sabitGrid, justifyContent = props.justifyContent, rowSpacing = props.rowSpacing, colSpacing = props.colSpacing;
9
- useEffect(function () {
6
+ export const FormOlustur = memo(function FunctionMemo(props) {
7
+ const { form, formOgeler, onChange, formType, sabitGrid, justifyContent, rowSpacing, colSpacing } = props;
8
+ useEffect(() => {
10
9
  if (formOgeler && onChange && form) {
11
- formOgeler.forEach(function (formOgeler) {
10
+ formOgeler.forEach((formOgeler) => {
12
11
  var _a, _b, _c, _d;
13
- var fieldName = (_b = (_a = formOgeler === null || formOgeler === void 0 ? void 0 : formOgeler.component) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.name;
12
+ const 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
13
  if (formOgeler.noRender && fieldName && form[fieldName] && form[fieldName] != '') {
15
14
  isDev && console.log('noRenderGuncelle');
16
15
  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)) {
@@ -25,27 +24,26 @@ export var FormOlustur = memo(function FunctionMemo(props) {
25
24
  });
26
25
  }
27
26
  }, [JSON.stringify(form), formOgeler]);
28
- var result = useMemo(function () {
29
- return formOgeler.map(function (_a, i) {
30
- var noRender = _a.noRender, fullComponent = _a.fullComponent, component = _a.component, propsComponent = _a.propsComponent, propsRow = _a.propsRow, label = _a.label, propsLabel = _a.propsLabel, gridLabel = _a.gridLabel, gridInput = _a.gridInput;
27
+ const result = useMemo(() => {
28
+ return formOgeler.map(({ noRender, fullComponent, component, propsComponent, propsRow, label, propsLabel, gridLabel, gridInput }, i) => {
31
29
  if (noRender) {
32
30
  return null;
33
31
  }
34
32
  if (fullComponent)
35
33
  return React.cloneElement(fullComponent, { key: i });
36
- var newProps = __assign({}, propsComponent);
34
+ let newProps = { ...propsComponent };
37
35
  if (onChange && component && !component.props.onChange) {
38
- newProps = __assign(__assign({}, newProps), { onChange: onChange });
36
+ newProps = { ...newProps, onChange };
39
37
  }
40
38
  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]) : '' });
39
+ newProps = { ...newProps, value: form[component.props.name] && form[component.props.name].length > 0 ? String(form[component.props.name]) : '' };
42
40
  }
43
41
  if (formType === 'label')
44
- newProps = __assign(__assign({}, newProps), { label: '' });
45
- var detectLabel = label || component.props.label;
46
- gridLabel = __assign(__assign({}, sabitGrid.label), gridLabel);
47
- gridInput = __assign(__assign({}, sabitGrid.input), gridInput);
48
- return (_jsxs(Row, __assign({ justifyContent: justifyContent, rowSpacing: rowSpacing, colSpacing: colSpacing }, propsRow, { children: [formType === 'label' && detectLabel && (_jsx(Col, __assign({}, gridLabel, { children: _jsx(Label, __assign({ required: component.props.required }, propsLabel, { children: detectLabel })) }))), _jsx(Col, __assign({}, gridInput, { children: React.cloneElement(component, newProps) }))] }), i));
42
+ newProps = { ...newProps, label: '' };
43
+ const detectLabel = label || component.props.label;
44
+ gridLabel = { ...sabitGrid.label, ...gridLabel };
45
+ gridInput = { ...sabitGrid.input, ...gridInput };
46
+ return (_jsxs(Row, { justifyContent: justifyContent, rowSpacing: rowSpacing, colSpacing: colSpacing, ...propsRow, children: [formType === 'label' && detectLabel && (_jsx(Col, { ...gridLabel, children: _jsx(Label, { required: component.props.required, ...propsLabel, children: detectLabel }) })), _jsx(Col, { ...gridInput, children: React.cloneElement(component, newProps) })] }, i));
49
47
  });
50
48
  }, [form, formOgeler, onChange, formType, sabitGrid, justifyContent, rowSpacing, colSpacing]);
51
49
  return _jsx(React.Fragment, { children: result });
@@ -1,4 +1,3 @@
1
- import { __assign } from "tslib";
2
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  /**
4
3
  * @author : izzetseydaoglu
@@ -11,60 +10,62 @@ import { applyInputMask } from '../_lib/inputMask';
11
10
  import { alert_add } from '../alert';
12
11
  import { Dialog } from './Dialog';
13
12
  import styles from './styles/Input.module.css';
14
- export var Input = function (_a) {
15
- 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
- clearIfNotMatch: true,
17
- reverse: false, //Tersten doldurmaya başla, fiyatlar için geçerli
18
- selectOnFocus: false
19
- } : _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 () {
13
+ export const Input = ({ componentRef, inputRef, className, propsComponent, propsInput, id, name, value = '', type, label, startAdornment, endAdornment, placeholder, onChange, onFocus, onBlur, onClick, onKeyPress, onKeyUp, onKeyDown, disabled = false, required = false, loading = false, autoFocus = false, select, valueKey = 'value', labelKey = 'label', ilkSec = false, multiline = false, rows = 2, sadeceYazi, sadeceSayi, tumuBuyuk, tumuKucuk, seoCevir, dosyaNoGiris, fileNameGiris, dateGecmisKontrol, autoSelectText, mask = '', maskSettings = {
14
+ clearIfNotMatch: true,
15
+ reverse: false, //Tersten doldurmaya başla, fiyatlar için geçerli
16
+ selectOnFocus: false
17
+ } }) => {
18
+ const refMain = useRef(null);
19
+ const refInput = useRef(null);
20
+ const refLabel = useRef(null);
21
+ const [inputFilled, setInputFilled] = useState(value && value.toString().length > 0);
22
+ const [focus, setFocus] = useState(false);
23
+ useEffect(() => {
26
24
  if (inputRef)
27
25
  inputRef.current = refInput.current;
28
26
  if (componentRef)
29
27
  componentRef.current = refMain.current;
30
28
  }, [componentRef, inputRef]);
31
- useEffect(function () {
29
+ useEffect(() => {
32
30
  autoSelectText && !select && (refInput === null || refInput === void 0 ? void 0 : refInput.current) && refInput.current.select();
33
31
  }, [autoSelectText, select]);
34
- useEffect(function () {
32
+ useEffect(() => {
35
33
  var _a, _b;
36
- var filled = String(value) && value.toString().length > 0 ? true : false;
34
+ const filled = String(value) && value.toString().length > 0 ? true : false;
37
35
  setInputFilled(filled);
38
36
  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));
39
37
  }, [value]);
40
- useEffect(function () {
38
+ useEffect(() => {
41
39
  // if (type === "number") sadeceSayi = true; //TODO: sadeceSayi burada değiştirelemez ki!!!
42
40
  if (select && ilkSec && (value === '' || value === null || value === undefined)) {
43
41
  if (select.length) {
44
- var ilkItem = select[0][valueKey] ? select[0][valueKey] : '';
45
- onChange && onChange({ target: { name: name, value: ilkItem } });
42
+ const ilkItem = select[0][valueKey] ? select[0][valueKey] : '';
43
+ onChange && onChange({ target: { name, value: ilkItem } });
46
44
  }
47
45
  }
48
46
  }, [select]);
49
- useEffect(function () {
47
+ useEffect(() => {
50
48
  var _a;
51
49
  if (typeof window !== 'undefined' && (mask === null || mask === void 0 ? void 0 : mask.length) > 0 && (refInput === null || refInput === void 0 ? void 0 : refInput.current)) {
52
50
  (_a = refInput.current) === null || _a === void 0 ? void 0 : _a.setAttribute('autocomplete', 'off');
53
51
  }
54
52
  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) {
53
+ const maskInstance = applyInputMask(refInput.current, mask, {
54
+ ...maskSettings,
55
+ onChange: (masked, clean, e) => {
56
56
  if (onChange) {
57
- onChange({ target: { name: name, value: masked } });
57
+ onChange({ target: { name, value: masked } });
58
58
  }
59
59
  if (maskSettings && maskSettings.onChange) {
60
60
  maskSettings.onChange(masked, clean, e);
61
61
  }
62
- } }));
63
- maskInstance_1 === null || maskInstance_1 === void 0 ? void 0 : maskInstance_1.setValue(value ? value : null);
64
- return function () { return maskInstance_1 === null || maskInstance_1 === void 0 ? void 0 : maskInstance_1.destroy(); };
62
+ }
63
+ });
64
+ maskInstance === null || maskInstance === void 0 ? void 0 : maskInstance.setValue(value ? value : null);
65
+ return () => maskInstance === null || maskInstance === void 0 ? void 0 : maskInstance.destroy();
65
66
  }
66
67
  }, [mask]);
67
- var Change = useCallback(function (e) {
68
+ const Change = useCallback((e) => {
68
69
  if (tumuBuyuk)
69
70
  inputTumuBuyukCevir(e);
70
71
  if (tumuKucuk)
@@ -74,13 +75,13 @@ export var Input = function (_a) {
74
75
  setInputFilled(e.target.value.length > 0);
75
76
  onChange ? onChange(e) : null;
76
77
  }, [onChange, seoCevir, tumuBuyuk, tumuKucuk]);
77
- var Focus = useCallback(function (e) {
78
+ const Focus = useCallback((e) => {
78
79
  var _a, _b;
79
80
  onFocus ? onFocus(e) : null;
80
81
  setFocus(true);
81
82
  (_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);
82
83
  }, [onFocus]);
83
- var Blur = useCallback(function (e) {
84
+ const Blur = useCallback((e) => {
84
85
  var _a, _b, _c, _d;
85
86
  if (fileNameGiris && e.target.value !== '' && /[/\\?%*:|"'<>]/g.test(e.target.value)) {
86
87
  e.target.value = e.target.value.replace(/[/\\?%*:|"'<>]/g, '-');
@@ -95,11 +96,11 @@ export var Input = function (_a) {
95
96
  alert_add({ type: 'error', message: 'Lütfen doğru bir dosya numarası giriniz. Örn: 2022/123' });
96
97
  }
97
98
  if (dateGecmisKontrol && e.target.value !== '') {
98
- var today = new Date().toISOString().slice(0, 10);
99
+ const today = new Date().toISOString().slice(0, 10);
99
100
  if (e.target.value < today) {
100
101
  Dialog({
101
102
  message: 'Geçmiş bir tarihi seçtiniz. Devam etmek istiyor musunuz?'
102
- }).then(function (r) {
103
+ }).then((r) => {
103
104
  if (!r) {
104
105
  e.target.value = '';
105
106
  if (onChange)
@@ -118,15 +119,15 @@ export var Input = function (_a) {
118
119
  }
119
120
  }
120
121
  if (value !== e.target.value) {
121
- onChange && onChange({ target: { name: name, value: e.target.value } });
122
+ onChange && onChange({ target: { name, value: e.target.value } });
122
123
  }
123
124
  onBlur ? onBlur(e) : null;
124
125
  setFocus(false);
125
126
  }, [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) {
127
+ const Click = useCallback((e) => (onClick ? onClick(e) : null), [onClick]);
128
+ const KeyPress = useCallback((e) => {
128
129
  if (sadeceYazi) {
129
- var turkishLetters = /[ğüşıöçĞÜŞİÖÇ]/;
130
+ const turkishLetters = /[ğüşıöçĞÜŞİÖÇ]/;
130
131
  if (!(/[A-Za-z\s.]/.test(e.key) || turkishLetters.test(e.key))) {
131
132
  e.preventDefault();
132
133
  return;
@@ -139,19 +140,19 @@ export var Input = function (_a) {
139
140
  }
140
141
  onKeyPress ? onKeyPress(e) : null;
141
142
  }, [sadeceYazi, sadeceSayi, dosyaNoGiris, onKeyPress]);
142
- var KeyUp = useCallback(function (e) { return (onKeyUp ? onKeyUp(e) : null); }, [onKeyUp]);
143
- var KeyDown = useCallback(function (e) {
143
+ const KeyUp = useCallback((e) => (onKeyUp ? onKeyUp(e) : null), [onKeyUp]);
144
+ const KeyDown = useCallback((e) => {
144
145
  onKeyDown ? onKeyDown(e) : null;
145
146
  }, [onKeyDown]);
146
- var ortakProps = {
147
+ const ortakProps = {
147
148
  ref: refInput,
148
- id: id,
149
- name: name,
150
- value: value,
151
- autoFocus: autoFocus,
152
- disabled: disabled,
153
- required: required,
154
- placeholder: placeholder,
149
+ id,
150
+ name,
151
+ value,
152
+ autoFocus,
153
+ disabled,
154
+ required,
155
+ placeholder,
155
156
  onChange: Change,
156
157
  onFocus: Focus,
157
158
  onBlur: Blur,
@@ -160,22 +161,22 @@ export var Input = function (_a) {
160
161
  onKeyUp: KeyUp,
161
162
  onKeyDown: KeyDown
162
163
  };
163
- var component;
164
+ let component;
164
165
  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) {
166
- var value = item[valueKey];
167
- var label = item[labelKey];
166
+ component = (_jsxs("select", { className: `${styles.input} ${styles.select}`, ...ortakProps, ...propsInput, children: [ilkSec === false && _jsx("option", { value: '' }), select.map((item) => {
167
+ const value = item[valueKey];
168
+ const label = item[labelKey];
168
169
  return (_jsx("option", { value: value, children: label ? label : value }, value));
169
- })] })));
170
+ })] }));
170
171
  }
171
172
  else if (multiline) {
172
- component = _jsx("textarea", __assign({ className: "".concat(styles.input, " ").concat(styles.textarea), rows: rows }, ortakProps, propsInput));
173
+ component = _jsx("textarea", { className: `${styles.input} ${styles.textarea}`, rows: rows, ...ortakProps, ...propsInput });
173
174
  }
174
175
  else {
175
- component = _jsx("input", __assign({ className: "".concat(styles.input), type: type }, ortakProps, propsInput));
176
+ component = _jsx("input", { className: `${styles.input}`, type: type, ...ortakProps, ...propsInput });
176
177
  }
177
- var classList = function () {
178
- var list = ['sInputComponent', styles.component];
178
+ const classList = () => {
179
+ const list = ['sInputComponent', styles.component];
179
180
  if (className)
180
181
  list.push(className);
181
182
  if (label) {
@@ -184,13 +185,13 @@ export var Input = function (_a) {
184
185
  // if (props.required && (value.length === 0 || !value)) list.push("error");
185
186
  return list.join(' ');
186
187
  };
187
- useEffect(function () {
188
+ useEffect(() => {
188
189
  if (propsComponent && propsComponent.hasOwnProperty('style')) {
189
- var background = propsComponent.style.background ? propsComponent.style.background : propsComponent.style.backgroundColor ? propsComponent.style.backgroundColor : null;
190
+ const background = propsComponent.style.background ? propsComponent.style.background : propsComponent.style.backgroundColor ? propsComponent.style.backgroundColor : null;
190
191
  if (background && refLabel.current) {
191
192
  refLabel.current.style.setProperty('--label-bg', background);
192
193
  }
193
194
  }
194
195
  }, [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 })] }))] })));
196
+ return (_jsxs("div", { ref: refMain, className: classList(), "data-disabled": disabled, ...propsComponent, children: [startAdornment && _jsx("div", { className: `adornment_start ${styles.adornment} ${styles.start}`, children: startAdornment }), _jsxs("div", { className: `${styles.inputBase} ${inputFilled || focus || type == 'date' ? styles.open : ''}`, children: [component, label && (_jsxs("div", { ref: refLabel, className: `label ${styles.label}`, children: [label, required && _jsx("span", { className: styles.required, children: "*" })] }))] }), (endAdornment || loading) && (_jsxs("div", { className: `adornment_end ${styles.adornment} ${styles.end}`, children: [endAdornment, loading && _jsx("div", { className: styles.loading })] }))] }));
196
197
  };
@@ -1,9 +1,7 @@
1
- import { __assign, __rest } from "tslib";
2
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import { memo } from 'react';
4
3
  import { Tooltip } from '../tooltip';
5
4
  import styles from './styles/Label.module.css';
6
- export var Label = memo(function FMemo(_a) {
7
- var _b = _a.required, required = _b === void 0 ? false : _b, children = _a.children, other = __rest(_a, ["required", "children"]);
8
- return (_jsxs("label", __assign({ className: styles.label }, other, { children: [children, _jsx(Tooltip, { title: 'Zorunlu Alan', children: _jsx("span", { className: styles.required, children: required && '*' }) })] })));
5
+ export const Label = memo(function FMemo({ required = false, children, ...other }) {
6
+ return (_jsxs("label", { className: styles.label, ...other, children: [children, _jsx(Tooltip, { title: 'Zorunlu Alan', children: _jsx("span", { className: styles.required, children: required && '*' }) })] }));
9
7
  });