ptechcore_ui 1.0.23 → 1.0.24
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.
- package/dist/index.cjs +1121 -3
- package/dist/index.d.cts +110 -1
- package/dist/index.d.ts +110 -1
- package/dist/index.js +1127 -3
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
4
|
|
|
4
5
|
interface PrimaryButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
6
|
variant?: 'full' | 'outline' | 'text';
|
|
@@ -756,4 +757,112 @@ declare const TaxSelector: React$1.FC<TaxSelectProps>;
|
|
|
756
757
|
declare const LegalFormSelector: React$1.FC<ChoiceSelectProps>;
|
|
757
758
|
declare const CountrySelector: React$1.FC<ChoiceSelectProps>;
|
|
758
759
|
|
|
759
|
-
|
|
760
|
+
interface FileItem {
|
|
761
|
+
id: string;
|
|
762
|
+
name: string;
|
|
763
|
+
type: 'file' | 'folder';
|
|
764
|
+
mimeType?: string;
|
|
765
|
+
size?: number;
|
|
766
|
+
path: string;
|
|
767
|
+
parentId?: string | null;
|
|
768
|
+
children?: FileItem[];
|
|
769
|
+
createdAt?: Date | string;
|
|
770
|
+
updatedAt?: Date | string;
|
|
771
|
+
createdBy?: string;
|
|
772
|
+
updatedBy?: string;
|
|
773
|
+
url?: string;
|
|
774
|
+
metadata?: Record<string, unknown>;
|
|
775
|
+
}
|
|
776
|
+
type ViewMode = 'grid' | 'list';
|
|
777
|
+
interface FileManagerProps {
|
|
778
|
+
data: FileItem[];
|
|
779
|
+
rootName?: string;
|
|
780
|
+
onCreateFolder?: (name: string, parentId: string) => Promise<FileItem | void>;
|
|
781
|
+
onUploadFiles?: (files: File[], parentId: string) => Promise<FileItem[] | void>;
|
|
782
|
+
onRename?: (item: FileItem, newName: string) => Promise<void>;
|
|
783
|
+
onDelete?: (item: FileItem) => Promise<void>;
|
|
784
|
+
onDownload?: (item: FileItem) => void;
|
|
785
|
+
onSelect?: (items: FileItem[]) => void;
|
|
786
|
+
onOpen?: (item: FileItem) => void;
|
|
787
|
+
viewMode?: ViewMode;
|
|
788
|
+
allowMultiSelect?: boolean;
|
|
789
|
+
allowUpload?: boolean;
|
|
790
|
+
allowCreateFolder?: boolean;
|
|
791
|
+
allowRename?: boolean;
|
|
792
|
+
allowDelete?: boolean;
|
|
793
|
+
allowDownload?: boolean;
|
|
794
|
+
acceptedFileTypes?: string[];
|
|
795
|
+
maxFileSize?: number;
|
|
796
|
+
className?: string;
|
|
797
|
+
texts?: FileManagerTexts;
|
|
798
|
+
}
|
|
799
|
+
interface FileManagerTexts {
|
|
800
|
+
createFolder?: string;
|
|
801
|
+
uploadFiles?: string;
|
|
802
|
+
rename?: string;
|
|
803
|
+
delete?: string;
|
|
804
|
+
download?: string;
|
|
805
|
+
open?: string;
|
|
806
|
+
deselectAll?: string;
|
|
807
|
+
newFolderName?: string;
|
|
808
|
+
confirmDelete?: string;
|
|
809
|
+
noFiles?: string;
|
|
810
|
+
dropFilesHere?: string;
|
|
811
|
+
cancel?: string;
|
|
812
|
+
confirm?: string;
|
|
813
|
+
}
|
|
814
|
+
interface ContextMenuPosition {
|
|
815
|
+
x: number;
|
|
816
|
+
y: number;
|
|
817
|
+
}
|
|
818
|
+
interface FileManagerContextValue {
|
|
819
|
+
data: FileItem[];
|
|
820
|
+
currentFolder: FileItem | null;
|
|
821
|
+
currentFolderContents: FileItem[];
|
|
822
|
+
pathHistory: FileItem[];
|
|
823
|
+
selectedItems: FileItem[];
|
|
824
|
+
viewMode: ViewMode;
|
|
825
|
+
contextMenu: {
|
|
826
|
+
visible: boolean;
|
|
827
|
+
position: ContextMenuPosition;
|
|
828
|
+
item: FileItem | null;
|
|
829
|
+
};
|
|
830
|
+
renamingItem: FileItem | null;
|
|
831
|
+
navigateToFolder: (folder: FileItem | null) => void;
|
|
832
|
+
navigateBack: () => void;
|
|
833
|
+
navigateToPath: (index: number) => void;
|
|
834
|
+
selectItem: (item: FileItem, multiSelect?: boolean) => void;
|
|
835
|
+
deselectAll: () => void;
|
|
836
|
+
setViewMode: (mode: ViewMode) => void;
|
|
837
|
+
showContextMenu: (item: FileItem, position: ContextMenuPosition) => void;
|
|
838
|
+
hideContextMenu: () => void;
|
|
839
|
+
startRenaming: (item: FileItem) => void;
|
|
840
|
+
stopRenaming: () => void;
|
|
841
|
+
onCreateFolder?: (name: string, parentId: string) => Promise<FileItem | void>;
|
|
842
|
+
onUploadFiles?: (files: File[], parentId: string) => Promise<FileItem[] | void>;
|
|
843
|
+
onRename?: (item: FileItem, newName: string) => Promise<void>;
|
|
844
|
+
onDelete?: (item: FileItem) => Promise<void>;
|
|
845
|
+
onDownload?: (item: FileItem) => void;
|
|
846
|
+
onOpen?: (item: FileItem) => void;
|
|
847
|
+
allowUpload: boolean;
|
|
848
|
+
allowCreateFolder: boolean;
|
|
849
|
+
allowRename: boolean;
|
|
850
|
+
allowDelete: boolean;
|
|
851
|
+
allowDownload: boolean;
|
|
852
|
+
allowMultiSelect: boolean;
|
|
853
|
+
texts: Required<FileManagerTexts>;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
declare const FileManager: React$1.FC<FileManagerProps>;
|
|
857
|
+
|
|
858
|
+
declare const useFileManager: () => FileManagerContextValue;
|
|
859
|
+
interface FileManagerProviderProps extends FileManagerProps {
|
|
860
|
+
children: React$1.ReactNode;
|
|
861
|
+
}
|
|
862
|
+
declare const FileManagerProvider: React$1.FC<FileManagerProviderProps>;
|
|
863
|
+
|
|
864
|
+
declare const getFileIcon: (mimeType?: string, isFolder?: boolean, isOpen?: boolean) => LucideIcon;
|
|
865
|
+
declare const formatFileSize: (bytes?: number) => string;
|
|
866
|
+
declare const formatDate: (date?: Date | string) => string;
|
|
867
|
+
|
|
868
|
+
export { Alert, AlertProvider, ApprovalAnswerModal, ApprovalAnswerPage, ApprovalPreviewAnswer, ApprovalServices, ApprovalWorkflow, AuthServices, CHOICES, type ConfirmOptions, CountrySelector, DateInput, FDrawer, FetchApi, FileInput, type FileItem, FileManager, type FileManagerProps, FileManagerProvider, type FileManagerTexts, ForeignCurrencySelector, InputField, InvoiceTypeSelector, LegalFormSelector, type MenuItem, Modal, NumberInput, Pages, PaymentMethodSelector, PrimaryButton, RewiseLayout, SecondaryButton, SelectCostCenter, SelectDepartment, SelectInput, SelectUser, SelectVendor, SessionProvider, TaxSelector, TemplateFNESelector, TextInput, ThemeProvider, ToastContainer, ToastProvider, type User, UserServices, type ViewMode, formatDate, formatFileSize, getFileIcon, useAlert, useFileManager, useSession, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
4
|
|
|
4
5
|
interface PrimaryButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
6
|
variant?: 'full' | 'outline' | 'text';
|
|
@@ -756,4 +757,112 @@ declare const TaxSelector: React$1.FC<TaxSelectProps>;
|
|
|
756
757
|
declare const LegalFormSelector: React$1.FC<ChoiceSelectProps>;
|
|
757
758
|
declare const CountrySelector: React$1.FC<ChoiceSelectProps>;
|
|
758
759
|
|
|
759
|
-
|
|
760
|
+
interface FileItem {
|
|
761
|
+
id: string;
|
|
762
|
+
name: string;
|
|
763
|
+
type: 'file' | 'folder';
|
|
764
|
+
mimeType?: string;
|
|
765
|
+
size?: number;
|
|
766
|
+
path: string;
|
|
767
|
+
parentId?: string | null;
|
|
768
|
+
children?: FileItem[];
|
|
769
|
+
createdAt?: Date | string;
|
|
770
|
+
updatedAt?: Date | string;
|
|
771
|
+
createdBy?: string;
|
|
772
|
+
updatedBy?: string;
|
|
773
|
+
url?: string;
|
|
774
|
+
metadata?: Record<string, unknown>;
|
|
775
|
+
}
|
|
776
|
+
type ViewMode = 'grid' | 'list';
|
|
777
|
+
interface FileManagerProps {
|
|
778
|
+
data: FileItem[];
|
|
779
|
+
rootName?: string;
|
|
780
|
+
onCreateFolder?: (name: string, parentId: string) => Promise<FileItem | void>;
|
|
781
|
+
onUploadFiles?: (files: File[], parentId: string) => Promise<FileItem[] | void>;
|
|
782
|
+
onRename?: (item: FileItem, newName: string) => Promise<void>;
|
|
783
|
+
onDelete?: (item: FileItem) => Promise<void>;
|
|
784
|
+
onDownload?: (item: FileItem) => void;
|
|
785
|
+
onSelect?: (items: FileItem[]) => void;
|
|
786
|
+
onOpen?: (item: FileItem) => void;
|
|
787
|
+
viewMode?: ViewMode;
|
|
788
|
+
allowMultiSelect?: boolean;
|
|
789
|
+
allowUpload?: boolean;
|
|
790
|
+
allowCreateFolder?: boolean;
|
|
791
|
+
allowRename?: boolean;
|
|
792
|
+
allowDelete?: boolean;
|
|
793
|
+
allowDownload?: boolean;
|
|
794
|
+
acceptedFileTypes?: string[];
|
|
795
|
+
maxFileSize?: number;
|
|
796
|
+
className?: string;
|
|
797
|
+
texts?: FileManagerTexts;
|
|
798
|
+
}
|
|
799
|
+
interface FileManagerTexts {
|
|
800
|
+
createFolder?: string;
|
|
801
|
+
uploadFiles?: string;
|
|
802
|
+
rename?: string;
|
|
803
|
+
delete?: string;
|
|
804
|
+
download?: string;
|
|
805
|
+
open?: string;
|
|
806
|
+
deselectAll?: string;
|
|
807
|
+
newFolderName?: string;
|
|
808
|
+
confirmDelete?: string;
|
|
809
|
+
noFiles?: string;
|
|
810
|
+
dropFilesHere?: string;
|
|
811
|
+
cancel?: string;
|
|
812
|
+
confirm?: string;
|
|
813
|
+
}
|
|
814
|
+
interface ContextMenuPosition {
|
|
815
|
+
x: number;
|
|
816
|
+
y: number;
|
|
817
|
+
}
|
|
818
|
+
interface FileManagerContextValue {
|
|
819
|
+
data: FileItem[];
|
|
820
|
+
currentFolder: FileItem | null;
|
|
821
|
+
currentFolderContents: FileItem[];
|
|
822
|
+
pathHistory: FileItem[];
|
|
823
|
+
selectedItems: FileItem[];
|
|
824
|
+
viewMode: ViewMode;
|
|
825
|
+
contextMenu: {
|
|
826
|
+
visible: boolean;
|
|
827
|
+
position: ContextMenuPosition;
|
|
828
|
+
item: FileItem | null;
|
|
829
|
+
};
|
|
830
|
+
renamingItem: FileItem | null;
|
|
831
|
+
navigateToFolder: (folder: FileItem | null) => void;
|
|
832
|
+
navigateBack: () => void;
|
|
833
|
+
navigateToPath: (index: number) => void;
|
|
834
|
+
selectItem: (item: FileItem, multiSelect?: boolean) => void;
|
|
835
|
+
deselectAll: () => void;
|
|
836
|
+
setViewMode: (mode: ViewMode) => void;
|
|
837
|
+
showContextMenu: (item: FileItem, position: ContextMenuPosition) => void;
|
|
838
|
+
hideContextMenu: () => void;
|
|
839
|
+
startRenaming: (item: FileItem) => void;
|
|
840
|
+
stopRenaming: () => void;
|
|
841
|
+
onCreateFolder?: (name: string, parentId: string) => Promise<FileItem | void>;
|
|
842
|
+
onUploadFiles?: (files: File[], parentId: string) => Promise<FileItem[] | void>;
|
|
843
|
+
onRename?: (item: FileItem, newName: string) => Promise<void>;
|
|
844
|
+
onDelete?: (item: FileItem) => Promise<void>;
|
|
845
|
+
onDownload?: (item: FileItem) => void;
|
|
846
|
+
onOpen?: (item: FileItem) => void;
|
|
847
|
+
allowUpload: boolean;
|
|
848
|
+
allowCreateFolder: boolean;
|
|
849
|
+
allowRename: boolean;
|
|
850
|
+
allowDelete: boolean;
|
|
851
|
+
allowDownload: boolean;
|
|
852
|
+
allowMultiSelect: boolean;
|
|
853
|
+
texts: Required<FileManagerTexts>;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
declare const FileManager: React$1.FC<FileManagerProps>;
|
|
857
|
+
|
|
858
|
+
declare const useFileManager: () => FileManagerContextValue;
|
|
859
|
+
interface FileManagerProviderProps extends FileManagerProps {
|
|
860
|
+
children: React$1.ReactNode;
|
|
861
|
+
}
|
|
862
|
+
declare const FileManagerProvider: React$1.FC<FileManagerProviderProps>;
|
|
863
|
+
|
|
864
|
+
declare const getFileIcon: (mimeType?: string, isFolder?: boolean, isOpen?: boolean) => LucideIcon;
|
|
865
|
+
declare const formatFileSize: (bytes?: number) => string;
|
|
866
|
+
declare const formatDate: (date?: Date | string) => string;
|
|
867
|
+
|
|
868
|
+
export { Alert, AlertProvider, ApprovalAnswerModal, ApprovalAnswerPage, ApprovalPreviewAnswer, ApprovalServices, ApprovalWorkflow, AuthServices, CHOICES, type ConfirmOptions, CountrySelector, DateInput, FDrawer, FetchApi, FileInput, type FileItem, FileManager, type FileManagerProps, FileManagerProvider, type FileManagerTexts, ForeignCurrencySelector, InputField, InvoiceTypeSelector, LegalFormSelector, type MenuItem, Modal, NumberInput, Pages, PaymentMethodSelector, PrimaryButton, RewiseLayout, SecondaryButton, SelectCostCenter, SelectDepartment, SelectInput, SelectUser, SelectVendor, SessionProvider, TaxSelector, TemplateFNESelector, TextInput, ThemeProvider, ToastContainer, ToastProvider, type User, UserServices, type ViewMode, formatDate, formatFileSize, getFileIcon, useAlert, useFileManager, useSession, useToast };
|