albinasoft-ui-package 1.1.25 → 1.1.27

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.
@@ -0,0 +1,38 @@
1
+ .progress-bar-container {
2
+ margin-bottom: 30px;
3
+ padding: 10px;
4
+ width: 100%;
5
+ }
6
+
7
+ .step-item {
8
+ cursor: pointer;
9
+ display: flex;
10
+ align-items: center;
11
+ flex-direction: column;
12
+ position: relative;
13
+ z-index: 1;
14
+ }
15
+
16
+ .step-circle {
17
+ width: 30px;
18
+ height: 30px;
19
+ border-radius: 50%;
20
+ color: #fff;
21
+ display: flex;
22
+ justify-content: center;
23
+ align-items: center;
24
+ font-weight: bold;
25
+ margin-bottom: 10px;
26
+ }
27
+
28
+ .step-label {
29
+ font-size: 14px;
30
+ font-weight: bold;
31
+ }
32
+
33
+ .step-line {
34
+ flex: 1;
35
+ height: 4px;
36
+ margin: 0 10px;
37
+ }
38
+
@@ -51,6 +51,7 @@ export interface CustomFileUploaderProps {
51
51
  * Opsiyonel: Çoklu dil desteği için kullanılan çeviri metinleri.
52
52
  */
53
53
  translations?: FileUploaderTranslations;
54
+ resetTrigger?: boolean;
54
55
  }
55
56
  declare const CustomFileUploader: React.FC<CustomFileUploaderProps>;
56
57
  export default CustomFileUploader;
@@ -112,7 +112,7 @@ exports.defaultTranslations = {
112
112
  uploadWarningExceed: "Seçilen dosya sayısı limiti aştı. Eklenebilecek dosya sayısı: ",
113
113
  fileSizeError: "isimli dosya, boyut limitini aşıyor.",
114
114
  fileTypeError: "isimli dosya, seçilen dosya türüne uygun değil.",
115
- noFileSelectedWarning: "Önce en az bir dosya seçiniz."
115
+ noFileSelectedWarning: "Önce en az bir dosya seçiniz.",
116
116
  };
117
117
  // ====================
118
118
  // Stil Ayarları
@@ -174,9 +174,30 @@ var fileTypeIcons = {
174
174
  };
175
175
  var defaultFileIcon = react_1.default.createElement(fa_1.FaFile, null);
176
176
  // İzin verilen dosya uzantıları
177
- var allowedFileExtensions = [".pdf", ".doc", ".docx", ".xls", ".xlsx", ".txt"];
178
- var allowedImageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp"];
179
- var allowedVideoExtensions = [".mp4", ".avi", ".mov", ".mkv", ".webm", ".flv"];
177
+ var allowedFileExtensions = [
178
+ ".pdf",
179
+ ".doc",
180
+ ".docx",
181
+ ".xls",
182
+ ".xlsx",
183
+ ".txt",
184
+ ];
185
+ var allowedImageExtensions = [
186
+ ".jpg",
187
+ ".jpeg",
188
+ ".png",
189
+ ".gif",
190
+ ".bmp",
191
+ ".webp",
192
+ ];
193
+ var allowedVideoExtensions = [
194
+ ".mp4",
195
+ ".avi",
196
+ ".mov",
197
+ ".mkv",
198
+ ".webm",
199
+ ".flv",
200
+ ];
180
201
  // ====================
181
202
  // Yardımcı Fonksiyonlar
182
203
  // ====================
@@ -201,7 +222,8 @@ var isAllowedFileType = function (file, allowedType) {
201
222
  case AllowedTypes.VIDEO:
202
223
  return allowedVideoExtensions.includes(ext);
203
224
  case AllowedTypes.VISUAL:
204
- return allowedImageExtensions.includes(ext) || allowedVideoExtensions.includes(ext);
225
+ return (allowedImageExtensions.includes(ext) ||
226
+ allowedVideoExtensions.includes(ext));
205
227
  default:
206
228
  return false;
207
229
  }
@@ -210,11 +232,17 @@ var isAllowedFileType = function (file, allowedType) {
210
232
  // CustomFileUploader Bileşeni
211
233
  // ====================
212
234
  var CustomFileUploader = function (props) {
213
- var url = props.url, multi = props.multi, allowedTypes = props.allowedTypes, maxFile = props.maxFile, maxSize = props.maxSize, onUploadComplete = props.onUploadComplete, onRemoveUploaded = props.onRemoveUploaded, label = props.label, onPendingChange = props.onPendingChange, translations = props.translations;
235
+ var url = props.url, multi = props.multi, allowedTypes = props.allowedTypes, maxFile = props.maxFile, maxSize = props.maxSize, onUploadComplete = props.onUploadComplete, onRemoveUploaded = props.onRemoveUploaded, label = props.label, onPendingChange = props.onPendingChange, translations = props.translations, resetTrigger = props.resetTrigger;
214
236
  // Varsayılan çeviri metinlerini, gelen prop ile birleştiriyoruz.
215
237
  var finalTranslations = __assign(__assign({}, exports.defaultTranslations), translations);
216
238
  var _a = (0, react_1.useState)([]), previews = _a[0], setPreviews = _a[1];
217
239
  var fileInputRef = (0, react_1.useRef)(null);
240
+ (0, react_1.useEffect)(function () {
241
+ if (props.resetTrigger) {
242
+ setPreviews([]);
243
+ updatePendingStatus([]);
244
+ }
245
+ }, [props.resetTrigger]);
218
246
  // Pending dosya sayısını parent'a iletecek yardımcı fonksiyon
219
247
  var updatePendingStatus = function (previewsArray) {
220
248
  if (onPendingChange) {
@@ -225,8 +253,12 @@ var CustomFileUploader = function (props) {
225
253
  // Dosyaları ekleme işlemi
226
254
  var handleFiles = function (files) {
227
255
  var filesArray = Array.from(files);
228
- var currentCount = multi ? previews.length : (previews.length > 0 ? 1 : 0);
229
- var availableSlots = multi ? maxFile - currentCount : (currentCount === 0 ? 1 : 0);
256
+ var currentCount = multi ? previews.length : previews.length > 0 ? 1 : 0;
257
+ var availableSlots = multi
258
+ ? maxFile - currentCount
259
+ : currentCount === 0
260
+ ? 1
261
+ : 0;
230
262
  if (availableSlots <= 0) {
231
263
  react_toastify_1.toast.warning(finalTranslations.uploadWarningLimit);
232
264
  return;
@@ -246,7 +278,8 @@ var CustomFileUploader = function (props) {
246
278
  react_toastify_1.toast.error(file.name + " " + finalTranslations.fileTypeError);
247
279
  return;
248
280
  }
249
- var isImg = allowedTypes === AllowedTypes.IMAGE || (allowedTypes === AllowedTypes.VISUAL && isImageFile(file));
281
+ var isImg = allowedTypes === AllowedTypes.IMAGE ||
282
+ (allowedTypes === AllowedTypes.VISUAL && isImageFile(file));
250
283
  var previewContent = isImg && isImageFile(file)
251
284
  ? URL.createObjectURL(file)
252
285
  : fileTypeIcons[getFileExtension(file)] || defaultFileIcon;
@@ -292,7 +325,10 @@ var CustomFileUploader = function (props) {
292
325
  setPreviews(updatedPreviews);
293
326
  updatePendingStatus(updatedPreviews);
294
327
  var itemToRemove = previews.find(function (item) { return item.id === previewId; });
295
- if (itemToRemove && itemToRemove.uploaded && itemToRemove.serverFileName && onRemoveUploaded) {
328
+ if (itemToRemove &&
329
+ itemToRemove.uploaded &&
330
+ itemToRemove.serverFileName &&
331
+ onRemoveUploaded) {
296
332
  onRemoveUploaded(itemToRemove.serverFileName);
297
333
  }
298
334
  };
@@ -302,7 +338,9 @@ var CustomFileUploader = function (props) {
302
338
  return __generator(this, function (_a) {
303
339
  switch (_a.label) {
304
340
  case 0:
305
- filesToUpload = previews.filter(function (item) { return !item.uploaded; }).map(function (item) { return item.file; });
341
+ filesToUpload = previews
342
+ .filter(function (item) { return !item.uploaded; })
343
+ .map(function (item) { return item.file; });
306
344
  if (filesToUpload.length === 0) {
307
345
  react_toastify_1.toast.warning(finalTranslations.noFileSelectedWarning);
308
346
  return [2 /*return*/];
@@ -366,12 +404,23 @@ var CustomFileUploader = function (props) {
366
404
  }); };
367
405
  // Dosya seçme alanı için drop area metni: dropAreaText + dosya limiti bilgisi
368
406
  var dropAreaText = multi
369
- ? finalTranslations.dropAreaText + " (" + finalTranslations.fileLimitMultiText + ": " + maxFile + ") "
370
- : finalTranslations.dropAreaText + " " + (finalTranslations.fileLimitSingleText);
407
+ ? finalTranslations.dropAreaText +
408
+ " (" +
409
+ finalTranslations.fileLimitMultiText +
410
+ ": " +
411
+ maxFile +
412
+ ") "
413
+ : finalTranslations.dropAreaText +
414
+ " " +
415
+ finalTranslations.fileLimitSingleText;
371
416
  return (react_1.default.createElement("div", { style: { width: "100%", height: "100%" } },
372
417
  label && (react_1.default.createElement("div", { style: { marginBottom: "10px" } },
373
418
  react_1.default.createElement("label", { style: { fontWeight: "bold" } }, label))),
374
- react_1.default.createElement("div", { style: dropAreaStyle, onDrop: handleDrop, onDragOver: handleDragOver, onClick: handleAreaClick }, previews.length === 0 ? (react_1.default.createElement("div", null, dropAreaText)) : (react_1.default.createElement("div", { style: previewContainerStyle }, previews.map(function (item) { return (react_1.default.createElement("div", { key: item.id, style: { display: "flex", flexDirection: "column", alignItems: "center" } },
419
+ react_1.default.createElement("div", { style: dropAreaStyle, onDrop: handleDrop, onDragOver: handleDragOver, onClick: handleAreaClick }, previews.length === 0 ? (react_1.default.createElement("div", null, dropAreaText)) : (react_1.default.createElement("div", { style: previewContainerStyle }, previews.map(function (item) { return (react_1.default.createElement("div", { key: item.id, style: {
420
+ display: "flex",
421
+ flexDirection: "column",
422
+ alignItems: "center",
423
+ } },
375
424
  react_1.default.createElement("div", { style: previewItemStyle },
376
425
  item.isImage ? (react_1.default.createElement("img", { src: item.previewContent, alt: "\u00D6nizleme ".concat(item.id), style: {
377
426
  width: "100%",
package/dist/index.d.ts CHANGED
@@ -19,4 +19,3 @@ import CustomProgressBar from './components/CustomProgressBar';
19
19
  import CustomTimeline from './components/CustomTimeline';
20
20
  import CustomDatatable from './components/CustomDatatable';
21
21
  export { AlbinaForm, CustomButton, CustomCheckbox, CustomDateTimePicker, CustomDivider, CustomForm, CustomInput, CustomModal, CustomPhoneInput, CustomRadioButton, CustomRichTextbox, CustomSelect, CustomTab, CustomText, CustomTextarea, CustomTreeView, CustomAutocompleteInput, CustomProgressBar, CustomTimeline, CustomDatatable, };
22
- export type { ColDef } from "./components/CustomDatatable";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "albinasoft-ui-package",
3
- "version": "1.1.25",
3
+ "version": "1.1.27",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {