@sydsoft/base 1.58.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/esm/_lib/baseFunctions.d.ts +16 -0
  2. package/dist/esm/_lib/baseFunctions.js +102 -0
  3. package/dist/esm/_lib/inputMask.d.ts +12 -0
  4. package/dist/esm/_lib/inputMask.js +234 -0
  5. package/dist/esm/_lib/listFunctions.d.ts +7 -0
  6. package/dist/esm/_lib/listFunctions.js +119 -0
  7. package/dist/esm/_lib/storage/cookies.d.ts +9 -0
  8. package/dist/esm/_lib/storage/cookies.js +39 -0
  9. package/dist/esm/_lib/storage/encData.d.ts +7 -0
  10. package/dist/esm/_lib/storage/encData.js +48 -0
  11. package/dist/esm/_lib/storage/localStorage.d.ts +11 -0
  12. package/dist/esm/_lib/storage/localStorage.js +74 -0
  13. package/dist/esm/_lib/storage/sessionStorage.d.ts +11 -0
  14. package/dist/esm/_lib/storage/sessionStorage.js +74 -0
  15. package/dist/esm/_lib/useInterval.d.ts +6 -0
  16. package/dist/esm/_lib/useInterval.js +24 -0
  17. package/dist/esm/alert/index.d.ts +23 -0
  18. package/dist/esm/alert/index.js +112 -0
  19. package/dist/esm/alert/index.module.css +125 -0
  20. package/dist/esm/box/Box.d.ts +14 -0
  21. package/dist/esm/box/Box.js +20 -0
  22. package/dist/esm/box/Box.module.css +159 -0
  23. package/dist/esm/box/BoxContent.d.ts +14 -0
  24. package/dist/esm/box/BoxContent.js +7 -0
  25. package/dist/esm/box/BoxFooter.d.ts +15 -0
  26. package/dist/esm/box/BoxFooter.js +13 -0
  27. package/dist/esm/box/BoxHeader.d.ts +21 -0
  28. package/dist/esm/box/BoxHeader.js +14 -0
  29. package/dist/esm/box/index.d.ts +9 -0
  30. package/dist/esm/box/index.js +9 -0
  31. package/dist/esm/countDown/index.d.ts +27 -0
  32. package/dist/esm/countDown/index.js +102 -0
  33. package/dist/esm/dateTime/index.d.ts +17 -0
  34. package/dist/esm/dateTime/index.js +81 -0
  35. package/dist/esm/form/Button.d.ts +32 -0
  36. package/dist/esm/form/Button.js +81 -0
  37. package/dist/esm/form/Checkbox.d.ts +28 -0
  38. package/dist/esm/form/Checkbox.js +28 -0
  39. package/dist/esm/form/Dialog.d.ts +25 -0
  40. package/dist/esm/form/Dialog.js +40 -0
  41. package/dist/esm/form/Form.d.ts +15 -0
  42. package/dist/esm/form/Form.js +17 -0
  43. package/dist/esm/form/FormOlustur.d.ts +44 -0
  44. package/dist/esm/form/FormOlustur.js +57 -0
  45. package/dist/esm/form/Input.d.ts +66 -0
  46. package/dist/esm/form/Input.js +196 -0
  47. package/dist/esm/form/Label.d.ts +12 -0
  48. package/dist/esm/form/Label.js +14 -0
  49. package/dist/esm/form/SearchableInput.d.ts +42 -0
  50. package/dist/esm/form/SearchableInput.js +277 -0
  51. package/dist/esm/form/UploadBase.d.ts +25 -0
  52. package/dist/esm/form/UploadBase.js +86 -0
  53. package/dist/esm/form/index.d.ts +14 -0
  54. package/dist/esm/form/index.js +14 -0
  55. package/dist/esm/form/styles/Button.module.css +151 -0
  56. package/dist/esm/form/styles/Input.module.css +227 -0
  57. package/dist/esm/form/styles/Label.module.css +37 -0
  58. package/dist/esm/form/styles/SearchableInput.module.css +86 -0
  59. package/dist/esm/grid/index.d.ts +43 -0
  60. package/dist/esm/grid/index.js +102 -0
  61. package/dist/esm/grid/index.module.css +812 -0
  62. package/dist/esm/icon/icons.d.ts +27 -0
  63. package/dist/esm/icon/icons.js +28 -0
  64. package/dist/esm/icon/index.d.ts +38 -0
  65. package/dist/esm/icon/index.js +25 -0
  66. package/dist/esm/icon/mui.d.ts +6 -0
  67. package/dist/esm/icon/mui.js +6 -0
  68. package/dist/esm/index.d.ts +24 -0
  69. package/dist/esm/index.js +24 -0
  70. package/dist/esm/menu/index.d.ts +75 -0
  71. package/dist/esm/menu/index.js +59 -0
  72. package/dist/esm/menu/index.module.css +106 -0
  73. package/dist/esm/modal/index.d.ts +23 -0
  74. package/dist/esm/modal/index.js +66 -0
  75. package/dist/esm/modal/index.module.css +83 -0
  76. package/dist/esm/popover/index.d.ts +26 -0
  77. package/dist/esm/popover/index.js +343 -0
  78. package/dist/esm/popover/index.module.css +95 -0
  79. package/dist/esm/tooltip/index.d.ts +16 -0
  80. package/dist/esm/tooltip/index.js +124 -0
  81. package/package.json +12 -8
@@ -0,0 +1,277 @@
1
+ import { __assign, __rest, __spreadArray } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * @author : izzetseydaoglu
5
+ * @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
6
+ * @version : 2026-02-10 20:23:07
7
+ */
8
+ import { Button, Input } from './index';
9
+ import { convertForSearch, convertLowerCase } from '../_lib/baseFunctions';
10
+ import { forwardRef, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
11
+ import { onKeyboardSelection, setScrollListPosition } from '../_lib/listFunctions';
12
+ import { Icon } from '../icon';
13
+ import styles from './styles/SearchableInput.module.css';
14
+ export var SearchableInput = forwardRef(function (_a, ref) {
15
+ var _b = _a.autoCompleteList, autoCompleteList = _b === void 0 ? [] : _b, isDataFromApi = _a.isDataFromApi, name = _a.name, value = _a.value, parentInputValue = _a.parentInputValue, disabled = _a.disabled, itemComponent = _a.itemComponent, _c = _a.valueKey, valueKey = _c === void 0 ? 'value' : _c, _d = _a.labelKey, labelKey = _d === void 0 ? 'label' : _d, onSelect = _a.onSelect, onChange = _a.onChange, onText = _a.onText, onLoad = _a.onLoad, style = _a.style, _e = _a.listPositionRelative, listPositionRelative = _e === void 0 ? false : _e, _f = _a.loadingMessage, loadingMessage = _f === void 0 ? 'Lütfen bekleyiniz...' : _f, _g = _a.notFoundMessage, notFoundMessage = _g === void 0 ? 'Kayıt bulunamadı...' : _g, placeholder = _a.placeholder, endAdornment = _a.endAdornment, _h = _a.ilkSec, ilkSec = _h === void 0 ? false : _h, _j = _a.newCreate, newCreate = _j === void 0 ? false : _j, inputRef = _a.inputRef, other = __rest(_a, ["autoCompleteList", "isDataFromApi", "name", "value", "parentInputValue", "disabled", "itemComponent", "valueKey", "labelKey", "onSelect", "onChange", "onText", "onLoad", "style", "listPositionRelative", "loadingMessage", "notFoundMessage", "placeholder", "endAdornment", "ilkSec", "newCreate", "inputRef"]);
16
+ var refMain = useRef(null);
17
+ var refInput = useRef(null);
18
+ var refList = useRef(null);
19
+ var _k = useState(autoCompleteList !== null && autoCompleteList !== void 0 ? autoCompleteList : []), data = _k[0], setData = _k[1];
20
+ var _l = useState(value !== null && value !== void 0 ? value : undefined), selectedValue = _l[0], setSelectedValue = _l[1];
21
+ var _m = useState(parentInputValue !== null && parentInputValue !== void 0 ? parentInputValue : undefined), parentValue = _m[0], setParentValue = _m[1];
22
+ var _o = useState(''), text = _o[0], setText = _o[1]; //Inputta görünen
23
+ var _p = useState(''), filter = _p[0], setFilter = _p[1]; // Filtrelemeye tabi tutulan
24
+ var _q = useState({ created: false }), newItemCreate = _q[0], setNewItemCreate = _q[1];
25
+ var _r = useState(false), open = _r[0], setOpen = _r[1];
26
+ var _s = useState(isDataFromApi && (!autoCompleteList || (autoCompleteList === null || autoCompleteList === void 0 ? void 0 : autoCompleteList.length) == 0)), loading = _s[0], setLoading = _s[1];
27
+ useImperativeHandle(ref, function () { return ({
28
+ setAutoCompleteList: function (list, value, callback) {
29
+ if (value === void 0) { value = undefined; }
30
+ if (autoCompleteList && (autoCompleteList === null || autoCompleteList === void 0 ? void 0 : autoCompleteList.length) > 0) {
31
+ alert('AutoCompleteList zaten tanımlı olduğundan dışardan data seti değiştirilemez.');
32
+ return;
33
+ }
34
+ setData(list);
35
+ value && sendChange(value);
36
+ setLoading(false);
37
+ if (!Array.isArray(list) || list.length == 0) {
38
+ clear(false);
39
+ }
40
+ callback && callback();
41
+ // isDev && console.log("setAutoCompleteList =>", name, value, list);
42
+ },
43
+ clear: function (openList, focusInput) {
44
+ if (openList === void 0) { openList = false; }
45
+ if (focusInput === void 0) { focusInput = false; }
46
+ return clear(openList, focusInput);
47
+ },
48
+ open: function () {
49
+ setOpen(true);
50
+ refInput.current && refInput.current.focus();
51
+ },
52
+ close: function () { return setOpen(false); },
53
+ checkByValue: function (value, openList) {
54
+ if (openList === void 0) { openList = false; }
55
+ return checkByValue(value, openList);
56
+ },
57
+ setLoading: function (value) { return setLoading(value); }
58
+ }); }, [autoCompleteList, data, value]);
59
+ useEffect(function () {
60
+ if (inputRef)
61
+ inputRef.current = refInput.current;
62
+ }, [refInput.current]);
63
+ useEffect(function () { return onLoad && onLoad(value); }, []);
64
+ useEffect(function () {
65
+ if (autoCompleteList && Array.isArray(autoCompleteList)) {
66
+ if (autoCompleteList.length > 0) {
67
+ // Sadece gerçekten farklıysa set et
68
+ if (JSON.stringify(autoCompleteList) !== JSON.stringify(data)) {
69
+ setData(autoCompleteList);
70
+ // isDev && console.log("autoCompleteList dolu =>", name, autoCompleteList);
71
+ }
72
+ }
73
+ else {
74
+ // Boş array geldi VE data zaten boş değilse
75
+ if (data.length > 0) {
76
+ setData([]);
77
+ // isDev && console.log("autoCompleteList boşaltıldı =>", name);
78
+ }
79
+ }
80
+ }
81
+ }, [autoCompleteList]);
82
+ useEffect(function () {
83
+ // isDev && console.log('data =>', name, data, 'selectedValue =>', selectedValue, 'value =>', value);
84
+ if (!Array.isArray(data)) {
85
+ setData([]);
86
+ }
87
+ if (data.length > 0) {
88
+ setLoading(false);
89
+ checkByValue(selectedValue, open);
90
+ if (!value && ilkSec) {
91
+ checkByValue(data[0][valueKey], false);
92
+ }
93
+ }
94
+ else {
95
+ !isDataFromApi && clear(false);
96
+ }
97
+ }, [data]);
98
+ // Seçim değişikliğinde parent'ı bilgilendir
99
+ useEffect(function () {
100
+ // isDev && console.log('selectedValue =>', name, selectedValue, 'value =>', value);
101
+ if ((value === null || value === void 0 ? void 0 : value.toString()) != (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.toString())) {
102
+ checkByValue(value, open);
103
+ // isDev && console.log('value Kontrol ediliyor', value, selectedValue);
104
+ }
105
+ }, [value]);
106
+ useEffect(function () {
107
+ if (parentInputValue !== parentValue) {
108
+ setParentValue(parentInputValue);
109
+ clear(false);
110
+ // isDev && console.log(name, "parentInputValueDeğişti =>", parentInputValue);
111
+ }
112
+ }, [parentInputValue]);
113
+ useEffect(function () {
114
+ var checkHideBackDrop = function (e) {
115
+ if (open && refMain.current && !refMain.current.contains(e.target)) {
116
+ checkByInput();
117
+ }
118
+ };
119
+ var checkESC = function (e) {
120
+ if (e.keyCode === 27 || e.key === 'Escape' || e.code === 'Escape')
121
+ checkByInput();
122
+ };
123
+ window.addEventListener('mousedown', checkHideBackDrop);
124
+ if (refMain.current)
125
+ refMain.current.addEventListener('keydown', checkESC);
126
+ if (open) {
127
+ setScrollListPosition(refList);
128
+ if (!listPositionRelative) {
129
+ window.addEventListener('scroll', handleUpdatePosition, true);
130
+ window.addEventListener('resize', handleUpdatePosition);
131
+ }
132
+ }
133
+ return function () {
134
+ window.removeEventListener('mousedown', checkHideBackDrop);
135
+ if (refMain.current)
136
+ refMain.current.removeEventListener('keydown', checkESC);
137
+ window.removeEventListener('scroll', handleUpdatePosition, true);
138
+ window.removeEventListener('resize', handleUpdatePosition);
139
+ };
140
+ }, [open]);
141
+ useLayoutEffect(function () { return handleUpdatePosition(); }, [open]);
142
+ var setValue = useCallback(function (item, openList) {
143
+ var _a, _b;
144
+ var newValue = (_a = item === null || item === void 0 ? void 0 : item[valueKey]) !== null && _a !== void 0 ? _a : '';
145
+ var newLabel = (_b = item === null || item === void 0 ? void 0 : item[labelKey]) !== null && _b !== void 0 ? _b : '';
146
+ setOpen(openList);
147
+ setText(newLabel);
148
+ // isDev && console.log(name, "setValue", newValue, "item", item, "value", value);
149
+ if (newValue === selectedValue)
150
+ return;
151
+ setFilter('');
152
+ setSelectedValue(newValue);
153
+ onChange && sendChange(newValue);
154
+ onSelect && onSelect(item);
155
+ }, [onChange, onSelect, name, selectedValue, valueKey, labelKey]);
156
+ var textInputOnChange = useCallback(function (e) {
157
+ setSelectedValue(undefined);
158
+ setText(e.target.value);
159
+ setFilter(e.target.value.trim());
160
+ setOpen(true);
161
+ onText && onText(e.target.value);
162
+ }, [setValue, onText]);
163
+ var checkByValue = useCallback(function (value, openList, list) {
164
+ if (openList === void 0) { openList = false; }
165
+ if (list === void 0) { list = []; }
166
+ var targetList = list.length > 0 ? list : data;
167
+ var find = Object.values(targetList).find(function (item) { return convertLowerCase(item[valueKey]) === convertLowerCase(value); });
168
+ if (!find && newCreate && newItemCreate.create) {
169
+ find = newItemCreate;
170
+ }
171
+ // isDev && console.log('find', find, 'value', value, data);
172
+ setValue(find, openList);
173
+ }, [data, valueKey, newCreate, newItemCreate, setValue]);
174
+ var checkByInput = useCallback(function () {
175
+ var findByLabel = data.find(function (item) { var _a; return convertLowerCase(item[labelKey]) === convertLowerCase((_a = refInput.current) === null || _a === void 0 ? void 0 : _a.value); });
176
+ if (findByLabel && value == findByLabel[valueKey]) {
177
+ setOpen(false);
178
+ return;
179
+ }
180
+ setValue(findByLabel, false);
181
+ if (!findByLabel)
182
+ setText('');
183
+ if (isDataFromApi && !findByLabel && data.length === 0) {
184
+ if (onText)
185
+ onText('');
186
+ }
187
+ }, [data, labelKey, value, valueKey, isDataFromApi, onText, setValue, refInput.current]);
188
+ var clear = useCallback(function (openList, focusInput) {
189
+ var _a;
190
+ if (openList === void 0) { openList = true; }
191
+ if (focusInput === void 0) { focusInput = false; }
192
+ setFilter('');
193
+ setText('');
194
+ setValue(undefined, openList);
195
+ onText && onText('');
196
+ focusInput && ((_a = refInput === null || refInput === void 0 ? void 0 : refInput.current) === null || _a === void 0 ? void 0 : _a.focus());
197
+ }, [setValue, onText]);
198
+ var sendChange = useCallback(function (value) {
199
+ // isDev && console.log(name, "sendChange", value, "selectedValue", selectedValue);
200
+ if (onChange && value !== selectedValue) {
201
+ onChange({ target: { name: name, value: value } });
202
+ }
203
+ }, [onChange, name]);
204
+ var filteredData = useMemo(function () {
205
+ var _a;
206
+ var list;
207
+ if (filter.length > 0) {
208
+ list = data.filter(function (item) { return convertForSearch(item[labelKey]).includes(convertForSearch(filter)) || item[labelKey] == filter; });
209
+ }
210
+ else {
211
+ list = data;
212
+ }
213
+ if (newCreate && text.length > 0) {
214
+ var filterText = data.find(function (item) { return item[labelKey].toString().toLowerCase() === text.toString().toLowerCase(); });
215
+ if (!filterText) {
216
+ var newItem = (_a = {}, _a[labelKey] = text, _a[valueKey] = text, _a.create = true, _a);
217
+ list = __spreadArray([newItem], list, true);
218
+ setNewItemCreate(newItem);
219
+ }
220
+ else {
221
+ if (newItemCreate.create)
222
+ setNewItemCreate({ create: false });
223
+ }
224
+ }
225
+ return list;
226
+ }, [data, filter, newCreate, text, valueKey, labelKey]);
227
+ var handleUpdatePosition = function () {
228
+ if (open && !listPositionRelative && refMain) {
229
+ setFixedPosition(refMain);
230
+ }
231
+ };
232
+ var onKeyDown = function (e) {
233
+ if (!open || !refList.current)
234
+ return null;
235
+ onKeyboardSelection({
236
+ e: e,
237
+ targetElement: refList,
238
+ checkByInput: checkByInput,
239
+ checkByValue: checkByValue,
240
+ clear: clear,
241
+ itemClass: 'li.item',
242
+ selectedClass: 'selected'
243
+ });
244
+ };
245
+ return (_jsxs("div", { ref: refMain, className: styles.searchableInputComponent, onKeyDown: onKeyDown, style: style, children: [_jsx(Input, __assign({}, other, { inputRef: refInput, name: name, value: text, onFocus: function () { return !disabled && setOpen(true); }, onChange: textInputOnChange, endAdornment: !disabled && (_jsxs("div", { style: { marginRight: 5 }, tabIndex: -1, children: [_jsx(Button, { title: 'Temizle', tabIndex: -1, hidden: !(text && text.length > 0), onClick: function () { return clear(true, true); }, onlyIcon: _jsx(Icon, { name: 'close', style: { color: '#444' } }) }), endAdornment, _jsx(Button, { tabIndex: -1, hidden: !data || !(data.length > 0), onClick: function () { return !disabled && setOpen(!open); }, onlyIcon: _jsx(Icon, { name: open ? 'keyboard_arrow_up' : 'keyboard_arrow_down', style: { color: '#444' } }) })] })), placeholder: loading ? 'Lütfen bekleyiniz...' : placeholder, loading: loading, disabled: disabled, propsInput: __assign(__assign({}, other === null || other === void 0 ? void 0 : other.propsInput), { autoComplete: 'off' }) })), open && (_jsx("div", { className: 'listDiv', "data-relative": listPositionRelative, children: _jsxs("ul", { ref: refList, className: "list ".concat(open ? 'open' : ''), children: [(filteredData.length === 0 || loading) && _jsx("div", { className: "message ".concat(loading ? 'loading' : ''), children: loading ? loadingMessage : notFoundMessage }), filteredData.map(function (item, key) {
246
+ var itemValue = item[valueKey];
247
+ var itemLabel = item[labelKey];
248
+ return (_jsxs("li", { className: "item ".concat(itemValue === selectedValue ? 'active' : ''), "data-value": itemValue, "data-label": itemLabel, onClick: function () { return setValue(item, false); }, children: [item.create && _jsx("span", { className: 'newCreate', children: "Yeni Olu\u015Ftur: " }), itemComponent ? itemComponent(item) : itemLabel] }, key));
249
+ })] }) }))] }));
250
+ });
251
+ var setFixedPosition = function (refMain) {
252
+ if (!refMain.current)
253
+ return;
254
+ var target = refMain.current;
255
+ var targetPosition = target.getBoundingClientRect();
256
+ var listDiv = target.querySelector('.listDiv');
257
+ if (listDiv) {
258
+ var listDivUL = target.querySelector('ul');
259
+ if (!listDiv)
260
+ return;
261
+ var listHeight = listDivUL.getBoundingClientRect().height;
262
+ var style = [];
263
+ style.push("position:fixed");
264
+ style.push("z-index:111111111111 !important");
265
+ style.push("width:".concat(targetPosition.width, "px"));
266
+ var spaceBelow = window.innerHeight - (targetPosition.top + targetPosition.height);
267
+ var spaceAbove = targetPosition.top;
268
+ if (spaceBelow < listHeight && spaceAbove > listHeight) {
269
+ style.push("top:".concat(targetPosition.top - listHeight, "px"));
270
+ style.push("margin-top:-1px");
271
+ }
272
+ else {
273
+ style.push("top:".concat(targetPosition.top + targetPosition.height, "px"));
274
+ }
275
+ listDiv.setAttribute('style', style.join(';'));
276
+ }
277
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2024
3
+ * @author: izzetseydaoglu
4
+ * @last-modified: 11.06.2024 02:39
5
+ */
6
+ import React from "react";
7
+ interface Props {
8
+ children?: React.ReactNode;
9
+ refUploadInput?: any;
10
+ className?: string;
11
+ required?: boolean;
12
+ multiple?: boolean;
13
+ ext_ok?: string[];
14
+ maxSize?: number;
15
+ maxFile?: number;
16
+ style?: React.CSSProperties;
17
+ onChange?: Function;
18
+ targetForm?: Function;
19
+ name?: string;
20
+ label?: string;
21
+ component?: any;
22
+ }
23
+ export declare const UploadBase: ({ component, children, targetForm, onChange, name, required, multiple, maxSize, maxFile, ext_ok, style, className, refUploadInput, label }: Props) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const uploadBase_CreateForm: (formData: any) => any;
25
+ export {};
@@ -0,0 +1,86 @@
1
+ import { __assign } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Copyright (c) 2024
5
+ * @author: izzetseydaoglu
6
+ * @last-modified: 11.06.2024 02:39
7
+ */
8
+ import { useEffect, useRef } from "react";
9
+ import { alert_add } from "../alert";
10
+ var upload_ext_ok = ["pdf", "doc", "docx", "xls", "xlsx", "jpg", "jpeg", "png", "bmp", "tiff", "tif", "udf", "txt", "rtf", "csv", "xml", "zip", "rar"];
11
+ var upload_maxsize = 30;
12
+ var upload_maxfile = 50;
13
+ export var UploadBase = function (_a) {
14
+ var _b = _a.component, component = _b === void 0 ? "div" : _b, children = _a.children, targetForm = _a.targetForm, onChange = _a.onChange, _c = _a.name, name = _c === void 0 ? "file__" : _c, _d = _a.required, required = _d === void 0 ? true : _d, _e = _a.multiple, multiple = _e === void 0 ? false : _e, _f = _a.maxSize, maxSize = _f === void 0 ? upload_maxsize : _f, _g = _a.maxFile, maxFile = _g === void 0 ? upload_maxfile : _g, _h = _a.ext_ok, ext_ok = _h === void 0 ? upload_ext_ok : _h, style = _a.style, className = _a.className, _j = _a.refUploadInput, refUploadInput = _j === void 0 ? null : _j, label = _a.label;
15
+ var ref = useRef(null);
16
+ useEffect(function () {
17
+ if (refUploadInput)
18
+ refUploadInput.current = ref.current;
19
+ }, [ref.current]);
20
+ var fileSelected = function (e) {
21
+ if (!(e.target.files.length > 0)) {
22
+ e.target.value = null;
23
+ return null;
24
+ }
25
+ if (e.target.files.length > maxFile) {
26
+ alert_add({ type: "error", message: "En fazla " + maxFile + " dosya seçebilirsiniz." });
27
+ e.target.value = null;
28
+ return null;
29
+ }
30
+ var fileList = [];
31
+ Object.values(e.target.files).map(function (file) {
32
+ var size = file.size;
33
+ var ext = file.name.replace(/^.*\./, "").toLowerCase();
34
+ if (ext_ok.indexOf(ext) === -1) {
35
+ alert_add({ type: "error", message: "Yüklemeye çalıştığınız dosya türü desteklenmiyor. Desteklenen dosya türleri: " + ext_ok.join(", ") });
36
+ }
37
+ else if (size > maxSize * 1000000) {
38
+ alert_add({ type: "error", message: "En fazla " + maxSize + "MB büyüklüğündeki dosyaları seçebilirsiniz." });
39
+ }
40
+ else {
41
+ fileList.push(file);
42
+ }
43
+ });
44
+ if (onChange)
45
+ onChange(fileList);
46
+ if (targetForm) {
47
+ var nameList_1 = [];
48
+ var newform_1 = {};
49
+ var uniqueID_1 = new Date().getTime();
50
+ fileList.map(function (file) {
51
+ var _a;
52
+ uniqueID_1 = uniqueID_1 + 1;
53
+ newform_1 = __assign(__assign({}, newform_1), (_a = {}, _a[name + uniqueID_1] = file, _a));
54
+ nameList_1.push(file.name);
55
+ });
56
+ targetForm(function (prev) { return (__assign(__assign({}, prev), { uploadBaseList: __assign({}, newform_1), uploadBaseListName: nameList_1.join(", ") })); });
57
+ }
58
+ };
59
+ var defaultStyle = {
60
+ position: "relative",
61
+ cursor: "pointer"
62
+ };
63
+ var Component = component.toLowerCase();
64
+ return (_jsxs(Component, { className: className, style: __assign(__assign({}, defaultStyle), style), "data-label": label !== null && label !== void 0 ? label : "", children: [children, _jsx("input", { ref: ref, type: "file", required: required, onChange: fileSelected, multiple: multiple, accept: ext_ok.map(function (i) { return "." + i; }).join(","), style: {
65
+ position: "absolute",
66
+ top: 0,
67
+ left: 0,
68
+ opacity: 0,
69
+ width: "100%",
70
+ height: "100%",
71
+ cursor: "pointer",
72
+ zIndex: 1
73
+ } })] }));
74
+ };
75
+ export var uploadBase_CreateForm = function (formData) {
76
+ var _a;
77
+ var newform = __assign({}, formData);
78
+ var list = (_a = formData["uploadBaseList"]) !== null && _a !== void 0 ? _a : {};
79
+ Object.keys(list).map(function (fileKey) {
80
+ var _a;
81
+ return (newform = __assign(__assign({}, newform), (_a = {}, _a[fileKey] = list[fileKey], _a)));
82
+ });
83
+ delete newform["uploadBaseList"];
84
+ delete newform["uploadBaseListName"];
85
+ return newform;
86
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @author : izzetseydaoglu
3
+ * @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
4
+ * @version : 2026-02-10 20:23:07
5
+ */
6
+ export * from "./Button";
7
+ export * from "./Checkbox";
8
+ export * from "./Dialog";
9
+ export * from "./Form";
10
+ export * from "./FormOlustur";
11
+ export * from "./Input";
12
+ export * from "./Label";
13
+ export * from "./SearchableInput";
14
+ export * from "./UploadBase";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @author : izzetseydaoglu
3
+ * @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
4
+ * @version : 2026-02-10 20:23:07
5
+ */
6
+ export * from "./Button";
7
+ export * from "./Checkbox";
8
+ export * from "./Dialog";
9
+ export * from "./Form";
10
+ export * from "./FormOlustur";
11
+ export * from "./Input";
12
+ export * from "./Label";
13
+ export * from "./SearchableInput";
14
+ export * from "./UploadBase";
@@ -0,0 +1,151 @@
1
+ /**
2
+ * @author : izzetseydaoglu
3
+ * @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
4
+ * @version : 2026-02-10 20:25:31
5
+ */
6
+
7
+ .button {
8
+ position: relative;
9
+ display: inline-flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ appearance: none;
13
+ user-select: none;
14
+ box-sizing: border-box;
15
+ overflow: hidden;
16
+ text-decoration: none;
17
+ letter-spacing: 0.03em;
18
+ text-transform: none;
19
+ border-radius: 6px;
20
+ color: rgba(0, 0, 0, 0.87);
21
+ font-family: inherit;
22
+ font-size: inherit;
23
+ font-weight: 500;
24
+ line-height: inherit;
25
+ box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%);
26
+ background-color: #e0e0e0;
27
+ padding: 4px 10px;
28
+ outline: 0;
29
+ border: 0;
30
+ cursor: pointer;
31
+ white-space: nowrap;
32
+ }
33
+ .button.fullwidth {
34
+ width: 100%;
35
+ }
36
+ .button[data-button-size="small"] {
37
+ font-size: 0.875rem;
38
+ padding: 4px 10px;
39
+ min-width: 64px;
40
+ height: 32px;
41
+ }
42
+
43
+ .button[data-button-size="medium"] {
44
+ font-size: 1rem;
45
+ padding: 6px 12px;
46
+ min-width: 72px;
47
+ height: 36px;
48
+ }
49
+
50
+ .button[data-button-size="large"] {
51
+ font-size: 1.2rem;
52
+ padding: 8px 16px;
53
+ min-width: 80px;
54
+ height: 40px;
55
+ }
56
+
57
+ .button[hidden] {
58
+ display: none;
59
+ }
60
+
61
+ .button[disabled] {
62
+ opacity: 0.7;
63
+ box-shadow: inset 0 0 20px #000000ad;
64
+ cursor: not-allowed;
65
+ }
66
+ .button:focus,
67
+ .button:hover {
68
+ opacity: 0.9;
69
+ }
70
+
71
+ .button.primary {
72
+ color: #fff;
73
+ background-color: #3772c4;
74
+ border-color: #1877f2;
75
+ }
76
+
77
+ .button.secondary {
78
+ color: #fff;
79
+ background-color: #6c7573;
80
+ border-color: #6c757d;
81
+ }
82
+
83
+ .button.success {
84
+ color: #fff;
85
+ background-color: #198754;
86
+ border-color: #198754;
87
+ }
88
+
89
+ .button.danger {
90
+ color: #fff;
91
+ background-color: #dc3545;
92
+ border-color: #dc3545;
93
+ }
94
+
95
+ .button.warning {
96
+ color: #000;
97
+ background-color: #ffc107;
98
+ border-color: #ffc107;
99
+ }
100
+
101
+ .button.info {
102
+ color: #000;
103
+ background-color: #0dcaf0;
104
+ border-color: #0dcaf0;
105
+ }
106
+
107
+ .button.light {
108
+ color: #000;
109
+ background-color: #f8f9fa;
110
+ border-color: #f8f9fa;
111
+ }
112
+
113
+ .button.dark {
114
+ color: #fff;
115
+ background-color: #212529;
116
+ border-color: #212529;
117
+ }
118
+
119
+ .button.link {
120
+ box-shadow: none;
121
+ background-color: transparent;
122
+ color: inherit;
123
+ }
124
+
125
+ .iconbutton {
126
+ padding: 8px;
127
+ border-radius: 50%;
128
+ background-color: transparent;
129
+ box-shadow: none;
130
+ color: #707274;
131
+ /* overflow: unset; */
132
+ }
133
+ .iconbutton:focus,
134
+ .iconbutton:hover {
135
+ background-color: rgba(0, 0, 0, 0.04);
136
+ }
137
+
138
+ .ripple {
139
+ content: "";
140
+ position: absolute;
141
+ border-radius: 50%;
142
+ transform: scale(0);
143
+ animation: ripple 900ms linear;
144
+ background-color: rgba(255, 255, 255, 0.7);
145
+ }
146
+ @keyframes ripple {
147
+ to {
148
+ transform: scale(4);
149
+ opacity: 0;
150
+ }
151
+ }