@dadehkav/ui 0.0.1

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 (97) hide show
  1. package/README.md +123 -0
  2. package/dist/App.d.ts +2 -0
  3. package/dist/components/Buttons/ClearableSubmitButton/index.d.ts +14 -0
  4. package/dist/components/Buttons/CollapseButton/index.d.ts +4 -0
  5. package/dist/components/Buttons/ConfirmButton/index.d.ts +11 -0
  6. package/dist/components/Buttons/SimpleButton/index.d.ts +17 -0
  7. package/dist/components/Buttons/StepperSubmitButton/index.d.ts +12 -0
  8. package/dist/components/Buttons/SubmitButton/index.d.ts +7 -0
  9. package/dist/components/Buttons/XButton/index.d.ts +8 -0
  10. package/dist/components/Card/index.d.ts +14 -0
  11. package/dist/components/Divider/LinearDivider/index.d.ts +11 -0
  12. package/dist/components/Divider/SectionDivider/index.d.ts +12 -0
  13. package/dist/components/FilePreview/index.d.ts +8 -0
  14. package/dist/components/Form/Checkbox/index.d.ts +9 -0
  15. package/dist/components/Form/DatePicker/index.d.ts +21 -0
  16. package/dist/components/Form/DropZone/index.d.ts +17 -0
  17. package/dist/components/Form/FieldArray/index.d.ts +19 -0
  18. package/dist/components/Form/FieldLabel/index.d.ts +11 -0
  19. package/dist/components/Form/FormField/index.d.ts +19 -0
  20. package/dist/components/Form/Formik/index.d.ts +14 -0
  21. package/dist/components/Form/SelectOption/BasicSelectOption/index.d.ts +23 -0
  22. package/dist/components/Form/SelectOption/MultiSelectOption/index.d.ts +26 -0
  23. package/dist/components/Form/TextArea/index.d.ts +22 -0
  24. package/dist/components/Form/TextInput/index.d.ts +28 -0
  25. package/dist/components/Form/Toggle/index.d.ts +5 -0
  26. package/dist/components/Icons/Components/ArrowLeft/index.d.ts +4 -0
  27. package/dist/components/Icons/Components/ArrowRight.tsx/index.d.ts +4 -0
  28. package/dist/components/Icons/Components/ChevronLeft/index.d.ts +4 -0
  29. package/dist/components/Icons/Components/ChevronRight/index.d.ts +4 -0
  30. package/dist/components/Icons/Components/Info/index.d.ts +4 -0
  31. package/dist/components/Icons/Components/Search/index.d.ts +4 -0
  32. package/dist/components/Icons/Components/X/index.d.ts +4 -0
  33. package/dist/components/Icons/index.d.ts +10 -0
  34. package/dist/components/InfoPopover/index.d.ts +9 -0
  35. package/dist/components/Layout/Grid/index.d.ts +14 -0
  36. package/dist/components/ListGridDetails/AdvanceListGridDetails/index.d.ts +12 -0
  37. package/dist/components/ListGridDetails/SimpleListGridDetails/index.d.ts +11 -0
  38. package/dist/components/Loading/DotLoader/index.d.ts +9 -0
  39. package/dist/components/Loading/Loader/index.d.ts +13 -0
  40. package/dist/components/Modal/index.d.ts +24 -0
  41. package/dist/components/NotFoundData/index.d.ts +12 -0
  42. package/dist/components/OverlayLoading/index.d.ts +8 -0
  43. package/dist/components/SimpleToggle/index.d.ts +17 -0
  44. package/dist/components/SweetAlert/index.d.ts +14 -0
  45. package/dist/components/Table/MergeTable/index.d.ts +28 -0
  46. package/dist/components/Table/SplitHeader/index.d.ts +19 -0
  47. package/dist/components/Table/Table/index.d.ts +23 -0
  48. package/dist/components/Timeline/index.d.ts +17 -0
  49. package/dist/components/ToggleWithContent/index.d.ts +15 -0
  50. package/dist/core/enums/Icon.enum.d.ts +9 -0
  51. package/dist/core/types/enum.model.d.ts +4 -0
  52. package/dist/core/types/icon.model.d.ts +6 -0
  53. package/dist/core/types/option.model.d.ts +4 -0
  54. package/dist/core/types/react-strap.model.d.ts +2 -0
  55. package/dist/core/types/table.model.d.ts +6 -0
  56. package/dist/core/utils/append-form-data.d.ts +10 -0
  57. package/dist/core/utils/calculate-sum-key-of-array.d.ts +12 -0
  58. package/dist/core/utils/convert-digits.d.ts +2 -0
  59. package/dist/core/utils/convert.d.ts +7 -0
  60. package/dist/core/utils/create-cell.d.ts +4 -0
  61. package/dist/core/utils/date-helper.d.ts +22 -0
  62. package/dist/core/utils/duplicate.d.ts +11 -0
  63. package/dist/core/utils/english-to-persian-number.d.ts +1 -0
  64. package/dist/core/utils/enum.d.ts +1 -0
  65. package/dist/core/utils/file.d.ts +4 -0
  66. package/dist/core/utils/filter-object.d.ts +3 -0
  67. package/dist/core/utils/find-by-key.d.ts +1 -0
  68. package/dist/core/utils/format-value.d.ts +2 -0
  69. package/dist/core/utils/generate-id.d.ts +4 -0
  70. package/dist/core/utils/generate-year-options.d.ts +2 -0
  71. package/dist/core/utils/get-file-postfix.d.ts +1 -0
  72. package/dist/core/utils/get-icon-component.d.ts +3 -0
  73. package/dist/core/utils/get-numeric-enum-values.d.ts +1 -0
  74. package/dist/core/utils/get-values-from-array.d.ts +18 -0
  75. package/dist/core/utils/join-with-separator.d.ts +1 -0
  76. package/dist/core/utils/lazy-with-retry.d.ts +7 -0
  77. package/dist/core/utils/money.d.ts +10 -0
  78. package/dist/core/utils/option.d.ts +19 -0
  79. package/dist/core/utils/regex.d.ts +13 -0
  80. package/dist/core/utils/scroll.d.ts +6 -0
  81. package/dist/core/utils/serve-file.d.ts +4 -0
  82. package/dist/core/utils/shift-map-indexes.d.ts +1 -0
  83. package/dist/core/utils/show-toast.d.ts +17 -0
  84. package/dist/core/utils/string-shorter.d.ts +1 -0
  85. package/dist/core/utils/to-query-string.d.ts +1 -0
  86. package/dist/core/utils/touch-all-fields-with-errors.d.ts +1 -0
  87. package/dist/core/utils/update-or-add-list.d.ts +3 -0
  88. package/dist/core/utils/url.d.ts +4 -0
  89. package/dist/core/utils/useSafeFormikContext.d.ts +6 -0
  90. package/dist/core/utils/validation.d.ts +3 -0
  91. package/dist/index.cjs +390 -0
  92. package/dist/index.d.ts +72 -0
  93. package/dist/index.es.js +39281 -0
  94. package/dist/main.d.ts +0 -0
  95. package/dist/ui.css +1 -0
  96. package/dist/vite.svg +1 -0
  97. package/package.json +74 -0
@@ -0,0 +1,12 @@
1
+ import { FC, ReactNode } from 'react';
2
+ interface IProps {
3
+ color?: string;
4
+ message?: string;
5
+ icon?: ReactNode;
6
+ dismissible?: boolean;
7
+ className?: string;
8
+ children?: ReactNode;
9
+ style?: React.CSSProperties;
10
+ }
11
+ declare const NotFoundData: FC<IProps>;
12
+ export { NotFoundData };
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ interface IProps {
3
+ hasLogo?: boolean;
4
+ hasSpinner?: boolean;
5
+ loadingTxt?: string | null;
6
+ }
7
+ declare const OverlayLoading: FC<IProps>;
8
+ export { OverlayLoading };
@@ -0,0 +1,17 @@
1
+ import { ChangeEvent, FC } from 'react';
2
+ type Size = "sm" | "lg";
3
+ export interface ISimpleToggleProps {
4
+ id?: string;
5
+ name: string;
6
+ size?: Size;
7
+ labelText?: string;
8
+ disabled?: boolean;
9
+ className?: string;
10
+ novalidate?: boolean;
11
+ value: boolean;
12
+ defaultChecked?: boolean;
13
+ onChange: (e: ChangeEvent<HTMLInputElement>) => void;
14
+ direction?: "ltr" | "rtl";
15
+ }
16
+ declare const SimpleToggle: FC<ISimpleToggleProps>;
17
+ export { SimpleToggle };
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ import { SweetAlertIcon } from 'sweetalert2';
3
+ export interface ISweetAlertProps {
4
+ title: string;
5
+ show: boolean;
6
+ icon?: SweetAlertIcon;
7
+ loading?: boolean;
8
+ onConfirm: () => void;
9
+ onClose: () => void;
10
+ onCancel: () => void;
11
+ content: ReactNode;
12
+ }
13
+ declare const SweetAlert: ({ title, show, icon, onConfirm, onClose, onCancel, loading, content, }: ISweetAlertProps) => import("react/jsx-runtime").JSX.Element;
14
+ export { SweetAlert };
@@ -0,0 +1,28 @@
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+ import { CSSProperties } from 'react';
3
+ export type TProps<TData extends Record<string, any>, TMeta extends object = {}> = {
4
+ data: TData[];
5
+ columns: ColumnDef<TData, any>[];
6
+ mergeKeys?: (keyof TData)[];
7
+ meta?: TMeta;
8
+ showRowNumber?: boolean;
9
+ mergeRowNumberBy?: keyof TData;
10
+ mergeVirtualColumns?: {
11
+ [columnId: string]: (row: TData, rowIndex: number) => string | number;
12
+ };
13
+ primaryMergeKey?: keyof TData;
14
+ pageSize?: number;
15
+ pageCount?: number;
16
+ initialPage?: number;
17
+ onPageChange?: (page: number) => void;
18
+ enableRowSelection?: boolean;
19
+ rowKey?: keyof TData;
20
+ defaultSelectedRows?: TData[];
21
+ onSelectionChange?: (rows: TData[]) => void;
22
+ isRowSelectionDisabled?: (row: TData) => boolean;
23
+ isLoading?: boolean;
24
+ getRowStyle?: (row: TData) => CSSProperties;
25
+ getRowClassName?: (row: TData) => string;
26
+ hasGroupedColumn?: boolean;
27
+ };
28
+ export declare function MergeTable<TData extends Record<string, any>, TMeta extends object = {}>(props: TProps<TData, TMeta>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+ import { FC } from 'react';
3
+ interface IProps {
4
+ title: string;
5
+ subLabels: string[];
6
+ }
7
+ export declare const SplitHeader: FC<IProps>;
8
+ export declare function createGroupedColumn<T extends object>(config: {
9
+ id: string;
10
+ title: string;
11
+ subColumns: {
12
+ key: keyof T;
13
+ header?: string;
14
+ id?: string;
15
+ accessorFn?: (row: T) => any;
16
+ size?: number;
17
+ }[];
18
+ }): ColumnDef<T>;
19
+ export {};
@@ -0,0 +1,23 @@
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+ import { CSSProperties } from 'react';
3
+ type TProps<TData, TMeta extends object = {}> = {
4
+ data: TData[];
5
+ columns: ColumnDef<TData, any>[];
6
+ meta?: TMeta;
7
+ showRowNumber?: boolean;
8
+ pageSize?: number;
9
+ pageCount?: number;
10
+ initialPage?: number;
11
+ onPageChange?: (page: number) => void;
12
+ enableRowSelection?: boolean;
13
+ rowKey?: keyof TData;
14
+ defaultSelectedRows?: TData[];
15
+ onSelectionChange?: (rows: TData[]) => void;
16
+ isRowSelectionDisabled?: (row: TData) => boolean;
17
+ isLoading?: boolean;
18
+ getRowStyle?: (row: TData) => CSSProperties;
19
+ getRowClassName?: (row: TData) => string;
20
+ hasGroupedColumn?: boolean;
21
+ };
22
+ export declare function Table<TData, TMeta extends object = {}>(props: TProps<TData, TMeta>): import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1,17 @@
1
+ import { ElementType, FC, ReactNode } from 'react';
2
+ type TTimelineItem = {
3
+ tag?: ElementType;
4
+ title: string;
5
+ color?: string;
6
+ icon?: ReactNode;
7
+ meta?: string;
8
+ content?: string;
9
+ customContent?: ReactNode;
10
+ };
11
+ interface IProps {
12
+ data: TTimelineItem[];
13
+ className?: string;
14
+ tag?: ElementType;
15
+ }
16
+ declare const Timeline: FC<IProps>;
17
+ export { Timeline };
@@ -0,0 +1,15 @@
1
+ import { FC, JSX } from 'react';
2
+ import { ISimpleToggleProps } from '../SimpleToggle';
3
+ interface BaseProps extends ISimpleToggleProps {
4
+ component: JSX.Element;
5
+ noForm?: boolean;
6
+ }
7
+ type TProps = (Omit<BaseProps, "onChange"> & {
8
+ noForm?: false;
9
+ onChange?: ISimpleToggleProps["onChange"];
10
+ }) | (Omit<BaseProps, "onChange"> & {
11
+ noForm: true;
12
+ onChange: ISimpleToggleProps["onChange"];
13
+ });
14
+ declare const ToggleWithContent: FC<TProps>;
15
+ export { ToggleWithContent };
@@ -0,0 +1,9 @@
1
+ export declare enum IconEnum {
2
+ ArrowRight = "ArrowRight",
3
+ ArrowLeft = "ArrowLeft",
4
+ Info = "Info",
5
+ Search = "Search",
6
+ X = "X",
7
+ ChevronLeft = "ChevronLeft",
8
+ ChevronRight = "ChevronRight"
9
+ }
@@ -0,0 +1,4 @@
1
+ export interface EnumModel {
2
+ description: string;
3
+ }
4
+ export type EnumRecord<K extends string | number | symbol, T extends EnumModel> = Record<K, T>;
@@ -0,0 +1,6 @@
1
+ import { SVGProps } from 'react';
2
+ export interface IIconProps extends SVGProps<SVGSVGElement> {
3
+ stroke?: string;
4
+ className?: string;
5
+ size?: number | string;
6
+ }
@@ -0,0 +1,4 @@
1
+ export type TOption<ValueType = number | string, LabelType = number | string, Extra extends Record<string, unknown> = {}> = {
2
+ value: ValueType;
3
+ label: LabelType;
4
+ } & Extra;
@@ -0,0 +1,2 @@
1
+ export type TReactStrapColor = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link";
2
+ export type TextInputType = "text" | "number" | "email" | "password" | "url" | "tel" | "search";
@@ -0,0 +1,6 @@
1
+ import { CellContext } from '@tanstack/react-table';
2
+ export type TableCellProps<TData, TMeta> = {
3
+ ctx: CellContext<TData, unknown>;
4
+ meta: TMeta;
5
+ original: TData;
6
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Utility to append key-value pairs to FormData
3
+ * - Supports arrays of File
4
+ * - Supports primitive values (string, number, boolean)
5
+ * - Supports single File
6
+ */
7
+ type Primitive = string | number | boolean;
8
+ type FormDataValue = Primitive | File | Primitive[] | File[];
9
+ export declare function appendFormData<T extends Record<string, FormDataValue>>(data: T): FormData;
10
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * جمع زدن مقادیر یک کلید مشخص در آرایه‌ای از آبجکت‌ها
3
+ *
4
+ * @param arr - آرایه‌ای از آبجکت‌ها
5
+ * @param key - کلیدی که باید مقادیر آن جمع شود
6
+ * @returns مجموع مقادیر عددی کلید مشخص
7
+ *
8
+ * مثال:
9
+ * const data = [{value: 10}, {value: 20}, {value: 5}];
10
+ * calculateSumByKey(data, "value"); // خروجی: 35
11
+ */
12
+ export declare const calculateSumByKey: <T extends Record<string, any>>(arr: T[], key: keyof T) => number;
@@ -0,0 +1,2 @@
1
+ export declare const convertPersianDigitsToEnglish: (str: string) => string;
2
+ export declare const convertPersianDigitsInObject: <T extends Record<string, any>>(obj: T) => T;
@@ -0,0 +1,7 @@
1
+ export declare const convertToToman: (rial: number) => string;
2
+ export declare const toNumber: (value: unknown) => number;
3
+ export declare const toSelectField: (value?: number, label?: string) => {
4
+ value: number;
5
+ label: string;
6
+ } | null;
7
+ export declare const ShamsiToIsoString: (shamsi: string) => string;
@@ -0,0 +1,4 @@
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+ import { FC } from 'react';
3
+ import { TableCellProps } from '../types/table.model';
4
+ export declare function createCell<TData, TMeta>(Component: FC<TableCellProps<TData, TMeta>>): ColumnDef<TData>["cell"];
@@ -0,0 +1,22 @@
1
+ import { default as jalaali } from 'jalaali-js';
2
+ export interface IDateOBJ {
3
+ day: number;
4
+ year: number;
5
+ month: number;
6
+ }
7
+ export interface IDateOBJString {
8
+ day: string;
9
+ year: string;
10
+ month: string;
11
+ }
12
+ export declare const ConvertUtcToDate: (utc: string) => IDateOBJ;
13
+ export declare const getCustomDate: (utc: string) => string;
14
+ export declare const getCurrentJalaliDate: () => IDateOBJ;
15
+ export declare const toJalali: (date: Date) => jalaali.JalaaliDateObject;
16
+ export declare const ConvertObjToStringDate: (date: IDateOBJ) => string;
17
+ export declare const ConvertStringDateToObj: (date: string, hasMaxDate?: boolean) => IDateOBJ | null | undefined;
18
+ export declare const CheckMaximumDate: (date: string, nullable?: boolean, hasNoMax?: boolean) => boolean;
19
+ export declare const ReplaceWrongDate: (date: string, hasMaxDate?: boolean, minDate?: IDateOBJ) => string;
20
+ export declare const CheckGreaterDate: (date1: string, date2: string) => boolean;
21
+ export declare const GetLastYears: (number: number) => number[];
22
+ export declare const formatPersianDate: (jalaliStr: string) => string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * حذف آیتم‌های تکراری از آرایه براساس یک کلید مشخص.
3
+ * اگر چند آبجکت مقدار یکسانی برای کلید مورد نظر داشته باشند،
4
+ * فقط اولین occurrence در آرایه نهایی نگه داشته می‌شود.
5
+ *
6
+ * @param array - آرایه‌ای از آبجکت‌ها
7
+ * @param key - کلیدی که یکتایی براساس آن بررسی می‌شود
8
+ * @returns آرایه‌ای جدید بدون آیتم‌های تکراری
9
+ */
10
+ export declare function removeDuplicates(array: any[], key: any): any;
11
+ export declare const findDuplicates: (arry: any[]) => any[];
@@ -0,0 +1 @@
1
+ export declare const convertEnglishDigitsToPersian: (numb: string, comma?: ",") => string;
@@ -0,0 +1 @@
1
+ export declare const mapEnumToDescription: <TEnum extends string | number, TMap extends Record<TEnum, Record<string, string>>, TKey extends keyof TMap[TEnum] = "description">(item: TEnum, mapObject: TMap, key?: TKey) => string;
@@ -0,0 +1,4 @@
1
+ export type MutationObject = {
2
+ mutateAsync: (fileName: string) => Promise<any>;
3
+ };
4
+ export declare const getFilesFromServer: (fileNames: string[], mutation: MutationObject) => Promise<File[]>;
@@ -0,0 +1,3 @@
1
+ type FilterValue = string | number | null | undefined;
2
+ export declare const filterObject: <T extends Record<string, any>>(obj: T, valuesToFilterOut?: FilterValue[]) => Partial<T>;
3
+ export {};
@@ -0,0 +1 @@
1
+ export declare function findByKey<T, K extends keyof T>(data: T[], key: K, value: T[K]): T | undefined;
@@ -0,0 +1,2 @@
1
+ export declare const formatValue: (value: unknown) => string;
2
+ export declare function formatWeight(weight: unknown): string;
@@ -0,0 +1,4 @@
1
+ export declare const generateUniqueId: () => string;
2
+ export declare const generateUniqueIdInList: (list: {
3
+ id: number;
4
+ }[]) => number;
@@ -0,0 +1,2 @@
1
+ import { TOption } from '../types/option.model';
2
+ export declare const generateYearOptions: (currentYear: number | null, pastYears: number) => TOption[];
@@ -0,0 +1 @@
1
+ export declare function getFilePostfix(fileName: string): string | undefined;
@@ -0,0 +1,3 @@
1
+ import { FC, SVGProps } from 'react';
2
+ import { IconEnum } from '../enums/Icon.enum';
3
+ export declare const getIconComponent: (icon: IconEnum) => FC<SVGProps<SVGSVGElement>>;
@@ -0,0 +1 @@
1
+ export declare function getNumericEnumValues(enumObj: any): number[];
@@ -0,0 +1,18 @@
1
+ /**
2
+ * گرفتن مقادیر یک کلید مشخص از آرایه‌ای از آبجکت‌ها
3
+ *
4
+ * @param arr - آرایه‌ای از آبجکت‌ها
5
+ * @param key - کلیدی که می‌خواهیم مقادیرش را استخراج کنیم
6
+ * @returns آرایه‌ای شامل مقادیر کلید مشخص
7
+ *
8
+ * مثال:
9
+ * const data = [{id: 1, name: 'A'}, {id: 2, name: 'B'}];
10
+ * pluck(data, 'name'); // خروجی: ['A', 'B']
11
+ */
12
+ export declare const pluck: <T extends Record<string, any>, K extends keyof T>(arr: T[], key: K) => T[K][];
13
+ /**
14
+ * گرفتن مقدار یک مسیر تو در تو در آبجکت
15
+ * - پشتیبانی از اندیس آرایه با [index]
16
+ * - مقدار پیش‌فرض قابل تنظیم
17
+ */
18
+ export declare const getNestedValue: <T = any>(obj: Record<string, any>, path: string, defaultValue?: T | null) => T | null;
@@ -0,0 +1 @@
1
+ export declare const joinWithSeparator: (data: any[], char?: string) => string;
@@ -0,0 +1,7 @@
1
+ import { ComponentType } from 'react';
2
+ interface LazyWithRetryOptions {
3
+ retries?: number;
4
+ delay?: number;
5
+ }
6
+ declare const lazyWithRetry: <T extends ComponentType<any>>(importFn: () => Promise<any>, exportName?: string, options?: LazyWithRetryOptions) => import('react').LazyExoticComponent<T>;
7
+ export default lazyWithRetry;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * فرمت کردن عدد به شکل هزارگان با کاما
3
+ * مثال: 1234567.89 -> "1,234,567.89"
4
+ */
5
+ export declare function currencyMask(value: number | string): string;
6
+ /**
7
+ * حذف فرمت هزارگان (کاما) از عدد
8
+ * مثال: "1,234,567.89" -> "1234567.89"
9
+ */
10
+ export declare function removeCurrencyMask(value: number | string): string;
@@ -0,0 +1,19 @@
1
+ import { TOption } from '../types/option.model';
2
+ export type FullOption<T = {}> = {
3
+ label: string;
4
+ options: Array<TOption & T>;
5
+ };
6
+ export declare const FullOptionCreator: <T extends Record<string, any>>(options: T[], valueId: keyof T, labelId: keyof T) => FullOption<T>[];
7
+ export declare const fullOption: (id: any, options: any) => any;
8
+ export declare const simpleOption: (id: any, options: any) => any;
9
+ export declare const multiFullOption: (ids: any, options: any) => any;
10
+ export declare const multiSimpleOption: (ids: any, options: any) => any;
11
+ export declare const toOption: <T extends Record<string, any>, KId extends keyof T = "id", KLabel extends keyof T = "title">(entity?: T, idKey?: KId, labelKey?: KLabel) => TOption | null;
12
+ export declare function removeOptionalNullishFields<T extends object, K extends keyof T>(obj: T, requiredKeys: K[]): T;
13
+ export declare function getOptionValue<T extends string | number | boolean>(option: {
14
+ value?: T;
15
+ } | null | undefined, defaultValue: T): T;
16
+ /**
17
+ * حذف آیتم‌ها از FullOption بر اساس آرایه id
18
+ */
19
+ export declare const removeFullOption: (idArray: Array<string | number>, options: FullOption[]) => FullOption[];
@@ -0,0 +1,13 @@
1
+ export declare const isLimitedNumberRegex: (minLength: number, maxLength: number) => RegExp;
2
+ export declare const isLimitedNumberNullableRegex: (minLength: number, maxLength: number) => RegExp;
3
+ export declare const isNumberRegex: () => RegExp;
4
+ export declare const isNumberPointRegex: () => RegExp;
5
+ export declare const isPersian: () => RegExp;
6
+ export declare const isPersianAndNumber: () => RegExp;
7
+ export declare const isPersianNullable: () => RegExp;
8
+ export declare const isHomePhone: () => RegExp;
9
+ export declare const isHomePhoneNullable: () => RegExp;
10
+ export declare const isFax: () => RegExp;
11
+ export declare const isDecimalNumberRegex: () => RegExp;
12
+ export declare const isAtLeastMinimum: (value: any, minLimit: number) => boolean;
13
+ export declare const isLimitedNumberRegexWithValue: (value: any, minLimit: number, maxLimit: number) => boolean;
@@ -0,0 +1,6 @@
1
+ import { RefObject } from 'react';
2
+ export declare const ScrollTo: (id: string, offset?: number) => void;
3
+ export declare const scrollToTop: () => void;
4
+ export declare const scrollToBottom: () => void;
5
+ export declare const scrollToMap: () => void;
6
+ export declare const scrollToRef: (ref: RefObject<HTMLElement>, offset?: number) => void;
@@ -0,0 +1,4 @@
1
+ export declare const downloadBlobAsFile: (data: BlobPart, fileName: string) => void;
2
+ export declare const handleFileDownloadOnSettled: (value: any, context: {
3
+ fileName: string;
4
+ }) => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const shiftMapIndexes: <T extends Record<number, any>>(map: T, removedIndex: number) => T;
@@ -0,0 +1,17 @@
1
+ export declare enum ToastTypes {
2
+ warning = "warning",
3
+ info = "info",
4
+ success = "success",
5
+ error = "error"
6
+ }
7
+ export type ToastPosition = "top-center" | "top-right" | "top-left" | "bottom-right" | "bottom-center" | "bottom-left" | undefined;
8
+ interface ShowToastOptions {
9
+ position?: ToastPosition;
10
+ toastId?: string;
11
+ }
12
+ export declare const showToast: (messages: string[], type: ToastTypes, options?: ShowToastOptions) => void;
13
+ export declare const SuccessToast: (messages?: string[]) => void;
14
+ export declare const ErrorToast: (messages?: string[]) => void;
15
+ export declare const WarningToast: (messages?: string[]) => void;
16
+ export declare const InfoToast: (messages?: string[]) => void;
17
+ export {};
@@ -0,0 +1 @@
1
+ export declare const stringShorter: (text: string, size: number) => string;
@@ -0,0 +1 @@
1
+ export declare function toQueryString(params: Record<string, any>): string;
@@ -0,0 +1 @@
1
+ export declare const touchAllFieldsWithErrors: (errors: Record<string, any>, setTouched: (touched: Record<string, boolean>, shouldValidate?: boolean) => void, handleBlur: (e: any) => void) => void;
@@ -0,0 +1,3 @@
1
+ export declare function updateOrAdd<T extends {
2
+ id: number;
3
+ }>(list: T[], item: T): T[];
@@ -0,0 +1,4 @@
1
+ export declare const isSameUrl: (url1: string, url2: string) => boolean;
2
+ export declare const isValidNumericParam: (paramName: string, params: Record<string, any>) => boolean;
3
+ export declare const isUrlIncludes: (url1: string, url2: string) => boolean;
4
+ export declare const isSameString: (first: string, second: string) => boolean;
@@ -0,0 +1,6 @@
1
+ import { FormikContextType } from 'formik';
2
+ interface IOptions {
3
+ noForm?: boolean;
4
+ }
5
+ export declare function useSafeFormik<T = any>({ noForm, }?: IOptions): FormikContextType<T> | null;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const textRequired: (text: string) => string;
2
+ export declare const selectOptionRequired: (text: string) => string;
3
+ export declare const selectOptionDefault: (text: string) => string;