gd-ui-library 1.0.23 → 1.0.25
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.d.mts +128 -14
- package/dist/index.d.ts +128 -14
- package/dist/index.js +539 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +538 -94
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import { ClassValue } from 'clsx';
|
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { AxiosRequestConfig } from 'axios';
|
|
5
|
+
import { CountryCode } from 'libphonenumber-js';
|
|
5
6
|
|
|
6
7
|
declare function cn(...inputs: ClassValue[]): string;
|
|
7
8
|
|
|
@@ -933,23 +934,136 @@ interface ResourceService<T, ID = string | number> {
|
|
|
933
934
|
}
|
|
934
935
|
declare function createResourceService<T, ID = string | number>(baseUrl: string): ResourceService<T, ID>;
|
|
935
936
|
|
|
936
|
-
type ValidatorFunction = (value: any) => string | undefined
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
declare const validateLongDescription: ValidatorFunction;
|
|
937
|
+
type ValidatorFunction = (value: any) => string | undefined | Promise<string | undefined>;
|
|
938
|
+
interface BaseOptions {
|
|
939
|
+
required?: boolean;
|
|
940
|
+
fieldName?: string;
|
|
941
|
+
message?: string;
|
|
942
|
+
}
|
|
944
943
|
|
|
945
|
-
|
|
944
|
+
interface EmailOptions {
|
|
945
|
+
required?: boolean;
|
|
946
|
+
allowPlus?: boolean;
|
|
947
|
+
allowSubdomains?: boolean;
|
|
948
|
+
allowIp?: boolean;
|
|
949
|
+
maxLength?: number;
|
|
950
|
+
domain?: string;
|
|
951
|
+
disposableCheck?: boolean;
|
|
952
|
+
fieldName?: string;
|
|
953
|
+
}
|
|
954
|
+
declare const validateEmail: (options?: EmailOptions) => ValidatorFunction;
|
|
946
955
|
|
|
947
|
-
|
|
956
|
+
interface ImageOptions {
|
|
957
|
+
required?: boolean;
|
|
958
|
+
maxSize?: number;
|
|
959
|
+
minSize?: number;
|
|
960
|
+
allowedTypes?: string[];
|
|
961
|
+
allowedExtensions?: string[];
|
|
962
|
+
maxWidth?: number;
|
|
963
|
+
maxHeight?: number;
|
|
964
|
+
minWidth?: number;
|
|
965
|
+
minHeight?: number;
|
|
966
|
+
aspectRatio?: number;
|
|
967
|
+
fieldName?: string;
|
|
968
|
+
validateUrlStatus?: boolean;
|
|
969
|
+
}
|
|
970
|
+
declare const validateImage: (options?: ImageOptions) => ValidatorFunction;
|
|
971
|
+
|
|
972
|
+
interface LongDescriptionOptions {
|
|
973
|
+
required?: boolean;
|
|
974
|
+
minLength?: number;
|
|
975
|
+
maxLength?: number;
|
|
976
|
+
trim?: boolean;
|
|
977
|
+
allowHtml?: boolean;
|
|
978
|
+
allowLineBreaks?: boolean;
|
|
979
|
+
countWords?: boolean;
|
|
980
|
+
fieldName?: string;
|
|
981
|
+
}
|
|
982
|
+
declare const validateLongDescription: (options?: LongDescriptionOptions) => ValidatorFunction;
|
|
948
983
|
|
|
949
|
-
|
|
984
|
+
interface NameOptions {
|
|
985
|
+
required?: boolean;
|
|
986
|
+
minLength?: number;
|
|
987
|
+
maxLength?: number;
|
|
988
|
+
allowNumbers?: boolean;
|
|
989
|
+
allowDots?: boolean;
|
|
990
|
+
allowUnicode?: boolean;
|
|
991
|
+
allowMultipleSpaces?: boolean;
|
|
992
|
+
allowMultipleHyphens?: boolean;
|
|
993
|
+
trim?: boolean;
|
|
994
|
+
fieldName?: string;
|
|
995
|
+
capitalize?: 'none' | 'words' | 'first';
|
|
996
|
+
}
|
|
997
|
+
declare const validateName: (options?: NameOptions) => ValidatorFunction;
|
|
998
|
+
|
|
999
|
+
interface PasswordOptions {
|
|
1000
|
+
required?: boolean;
|
|
1001
|
+
minLength?: number;
|
|
1002
|
+
maxLength?: number;
|
|
1003
|
+
requireUppercase?: boolean;
|
|
1004
|
+
requireLowercase?: boolean;
|
|
1005
|
+
requireNumbers?: boolean;
|
|
1006
|
+
requireSpecial?: boolean;
|
|
1007
|
+
checkCommon?: boolean;
|
|
1008
|
+
checkBreached?: boolean;
|
|
1009
|
+
allowSpaces?: boolean;
|
|
1010
|
+
minStrength?: 0 | 1 | 2 | 3 | 4;
|
|
1011
|
+
fieldName?: string;
|
|
1012
|
+
}
|
|
1013
|
+
declare const validatePassword: (options?: PasswordOptions) => ValidatorFunction;
|
|
1014
|
+
|
|
1015
|
+
interface PhoneOptions {
|
|
1016
|
+
required?: boolean;
|
|
1017
|
+
defaultCountry?: CountryCode;
|
|
1018
|
+
fieldName?: string;
|
|
1019
|
+
strict?: boolean;
|
|
1020
|
+
}
|
|
1021
|
+
declare const validatePhone: (options?: PhoneOptions) => ValidatorFunction;
|
|
1022
|
+
|
|
1023
|
+
interface RequiredOptions {
|
|
1024
|
+
message?: string;
|
|
1025
|
+
trim?: boolean;
|
|
1026
|
+
allowEmptyString?: boolean;
|
|
1027
|
+
allowZero?: boolean;
|
|
1028
|
+
allowFalse?: boolean;
|
|
1029
|
+
allowEmptyArray?: boolean;
|
|
1030
|
+
allowEmptyObject?: boolean;
|
|
1031
|
+
minArrayLength?: number;
|
|
1032
|
+
minObjectKeys?: number;
|
|
1033
|
+
fieldName?: string;
|
|
1034
|
+
}
|
|
1035
|
+
declare const validateRequired: (options?: RequiredOptions) => ValidatorFunction;
|
|
1036
|
+
|
|
1037
|
+
interface ShortDescriptionOptions {
|
|
1038
|
+
required?: boolean;
|
|
1039
|
+
minLength?: number;
|
|
1040
|
+
maxLength?: number;
|
|
1041
|
+
trim?: boolean;
|
|
1042
|
+
allowHtml?: boolean;
|
|
1043
|
+
}
|
|
1044
|
+
declare const validateShortDescription: (options?: ShortDescriptionOptions) => ValidatorFunction;
|
|
950
1045
|
|
|
951
|
-
|
|
1046
|
+
interface SlugOptions {
|
|
1047
|
+
required?: boolean;
|
|
1048
|
+
minLength?: number;
|
|
1049
|
+
maxLength?: number;
|
|
1050
|
+
allowNumbers?: boolean;
|
|
1051
|
+
allowUnderscores?: boolean;
|
|
1052
|
+
allowDots?: boolean;
|
|
1053
|
+
separator?: string;
|
|
1054
|
+
fieldName?: string;
|
|
1055
|
+
}
|
|
1056
|
+
declare const validateSlug: (options?: SlugOptions) => ValidatorFunction;
|
|
952
1057
|
|
|
953
|
-
|
|
1058
|
+
interface UrlOptions {
|
|
1059
|
+
required?: boolean;
|
|
1060
|
+
protocols?: string[];
|
|
1061
|
+
allowLocalhost?: boolean;
|
|
1062
|
+
allowIp?: boolean;
|
|
1063
|
+
allowPrivateIp?: boolean;
|
|
1064
|
+
requireTld?: boolean;
|
|
1065
|
+
fieldName?: string;
|
|
1066
|
+
}
|
|
1067
|
+
declare const validateUrl: (options?: UrlOptions) => ValidatorFunction;
|
|
954
1068
|
|
|
955
|
-
export { Accordion, Alert, type ApiConfig, ApiService, type ApiState, AutoComplete, Avatar, Badge, Banner, Breadcrumb, Button, Calendar, type CalendarEvent, CalendarWithEvents, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CartItem, Chart, type ChartDataset, type ChartType, Checkbox, Chip, ClickAwayListener, CodeEditor, ColorPicker, Container, type CropArea, DatePicker, DebouncedInput, Dialog, Drawer, Dropdown, type DropdownItem, type DropdownProps, EmailComposer, EmptyState, type FileItem, FileManager, FileUpload, type FilterGroup, type FilterOption, Footer, FormBuilder, type FormField, type FormFieldType, GanttChart, type GanttTask, Grid, Hero, IconSelect, type IconSelectProps, ImageCrop, type ImageCropHandle, type ImageCropProps, InfiniteScroll, Input, InputGroup, Kanban, LazyLoad, List, ListItem, MasonryGrid, Navbar, OTPInput, Pagination, Popover, Portal, ProductFilter, ProgressBar, Radio, Rating, type ResourceService, RichTextEditor, Section, Select, ShoppingCart, Sidebar, type SidebarItem, type SidebarProps, Skeleton, Slider, Spinner, SplitPane, Stack, Statistic, StatusIndicator, Stepper, Table, Tabs, Textarea, TimePicker, Timeline, type ToastOptions, type ToastVariant, Toaster, Toggle, Tooltip, Transition, TreeView, type ValidatorFunction, VirtualScroll, api, clearCache, cn, createResourceService, queryCache, toast, useApi, useMutation, useQuery, validateEmail, validateImage, validateLongDescription, validateName, validatePassword, validateRequired, validateShortDescription, validateSlug, validateUrl };
|
|
1069
|
+
export { Accordion, Alert, type ApiConfig, ApiService, type ApiState, AutoComplete, Avatar, Badge, Banner, type BaseOptions, Breadcrumb, Button, Calendar, type CalendarEvent, CalendarWithEvents, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CartItem, Chart, type ChartDataset, type ChartType, Checkbox, Chip, ClickAwayListener, CodeEditor, ColorPicker, Container, type CropArea, DatePicker, DebouncedInput, Dialog, Drawer, Dropdown, type DropdownItem, type DropdownProps, EmailComposer, type EmailOptions, EmptyState, type FileItem, FileManager, FileUpload, type FilterGroup, type FilterOption, Footer, FormBuilder, type FormField, type FormFieldType, GanttChart, type GanttTask, Grid, Hero, IconSelect, type IconSelectProps, ImageCrop, type ImageCropHandle, type ImageCropProps, type ImageOptions, InfiniteScroll, Input, InputGroup, Kanban, LazyLoad, List, ListItem, type LongDescriptionOptions, MasonryGrid, type NameOptions, Navbar, OTPInput, Pagination, type PasswordOptions, type PhoneOptions, Popover, Portal, ProductFilter, ProgressBar, Radio, Rating, type RequiredOptions, type ResourceService, RichTextEditor, Section, Select, ShoppingCart, type ShortDescriptionOptions, Sidebar, type SidebarItem, type SidebarProps, Skeleton, Slider, type SlugOptions, Spinner, SplitPane, Stack, Statistic, StatusIndicator, Stepper, Table, Tabs, Textarea, TimePicker, Timeline, type ToastOptions, type ToastVariant, Toaster, Toggle, Tooltip, Transition, TreeView, type UrlOptions, type ValidatorFunction, VirtualScroll, api, clearCache, cn, createResourceService, queryCache, toast, useApi, useMutation, useQuery, validateEmail, validateImage, validateLongDescription, validateName, validatePassword, validatePhone, validateRequired, validateShortDescription, validateSlug, validateUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ClassValue } from 'clsx';
|
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { AxiosRequestConfig } from 'axios';
|
|
5
|
+
import { CountryCode } from 'libphonenumber-js';
|
|
5
6
|
|
|
6
7
|
declare function cn(...inputs: ClassValue[]): string;
|
|
7
8
|
|
|
@@ -933,23 +934,136 @@ interface ResourceService<T, ID = string | number> {
|
|
|
933
934
|
}
|
|
934
935
|
declare function createResourceService<T, ID = string | number>(baseUrl: string): ResourceService<T, ID>;
|
|
935
936
|
|
|
936
|
-
type ValidatorFunction = (value: any) => string | undefined
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
declare const validateLongDescription: ValidatorFunction;
|
|
937
|
+
type ValidatorFunction = (value: any) => string | undefined | Promise<string | undefined>;
|
|
938
|
+
interface BaseOptions {
|
|
939
|
+
required?: boolean;
|
|
940
|
+
fieldName?: string;
|
|
941
|
+
message?: string;
|
|
942
|
+
}
|
|
944
943
|
|
|
945
|
-
|
|
944
|
+
interface EmailOptions {
|
|
945
|
+
required?: boolean;
|
|
946
|
+
allowPlus?: boolean;
|
|
947
|
+
allowSubdomains?: boolean;
|
|
948
|
+
allowIp?: boolean;
|
|
949
|
+
maxLength?: number;
|
|
950
|
+
domain?: string;
|
|
951
|
+
disposableCheck?: boolean;
|
|
952
|
+
fieldName?: string;
|
|
953
|
+
}
|
|
954
|
+
declare const validateEmail: (options?: EmailOptions) => ValidatorFunction;
|
|
946
955
|
|
|
947
|
-
|
|
956
|
+
interface ImageOptions {
|
|
957
|
+
required?: boolean;
|
|
958
|
+
maxSize?: number;
|
|
959
|
+
minSize?: number;
|
|
960
|
+
allowedTypes?: string[];
|
|
961
|
+
allowedExtensions?: string[];
|
|
962
|
+
maxWidth?: number;
|
|
963
|
+
maxHeight?: number;
|
|
964
|
+
minWidth?: number;
|
|
965
|
+
minHeight?: number;
|
|
966
|
+
aspectRatio?: number;
|
|
967
|
+
fieldName?: string;
|
|
968
|
+
validateUrlStatus?: boolean;
|
|
969
|
+
}
|
|
970
|
+
declare const validateImage: (options?: ImageOptions) => ValidatorFunction;
|
|
971
|
+
|
|
972
|
+
interface LongDescriptionOptions {
|
|
973
|
+
required?: boolean;
|
|
974
|
+
minLength?: number;
|
|
975
|
+
maxLength?: number;
|
|
976
|
+
trim?: boolean;
|
|
977
|
+
allowHtml?: boolean;
|
|
978
|
+
allowLineBreaks?: boolean;
|
|
979
|
+
countWords?: boolean;
|
|
980
|
+
fieldName?: string;
|
|
981
|
+
}
|
|
982
|
+
declare const validateLongDescription: (options?: LongDescriptionOptions) => ValidatorFunction;
|
|
948
983
|
|
|
949
|
-
|
|
984
|
+
interface NameOptions {
|
|
985
|
+
required?: boolean;
|
|
986
|
+
minLength?: number;
|
|
987
|
+
maxLength?: number;
|
|
988
|
+
allowNumbers?: boolean;
|
|
989
|
+
allowDots?: boolean;
|
|
990
|
+
allowUnicode?: boolean;
|
|
991
|
+
allowMultipleSpaces?: boolean;
|
|
992
|
+
allowMultipleHyphens?: boolean;
|
|
993
|
+
trim?: boolean;
|
|
994
|
+
fieldName?: string;
|
|
995
|
+
capitalize?: 'none' | 'words' | 'first';
|
|
996
|
+
}
|
|
997
|
+
declare const validateName: (options?: NameOptions) => ValidatorFunction;
|
|
998
|
+
|
|
999
|
+
interface PasswordOptions {
|
|
1000
|
+
required?: boolean;
|
|
1001
|
+
minLength?: number;
|
|
1002
|
+
maxLength?: number;
|
|
1003
|
+
requireUppercase?: boolean;
|
|
1004
|
+
requireLowercase?: boolean;
|
|
1005
|
+
requireNumbers?: boolean;
|
|
1006
|
+
requireSpecial?: boolean;
|
|
1007
|
+
checkCommon?: boolean;
|
|
1008
|
+
checkBreached?: boolean;
|
|
1009
|
+
allowSpaces?: boolean;
|
|
1010
|
+
minStrength?: 0 | 1 | 2 | 3 | 4;
|
|
1011
|
+
fieldName?: string;
|
|
1012
|
+
}
|
|
1013
|
+
declare const validatePassword: (options?: PasswordOptions) => ValidatorFunction;
|
|
1014
|
+
|
|
1015
|
+
interface PhoneOptions {
|
|
1016
|
+
required?: boolean;
|
|
1017
|
+
defaultCountry?: CountryCode;
|
|
1018
|
+
fieldName?: string;
|
|
1019
|
+
strict?: boolean;
|
|
1020
|
+
}
|
|
1021
|
+
declare const validatePhone: (options?: PhoneOptions) => ValidatorFunction;
|
|
1022
|
+
|
|
1023
|
+
interface RequiredOptions {
|
|
1024
|
+
message?: string;
|
|
1025
|
+
trim?: boolean;
|
|
1026
|
+
allowEmptyString?: boolean;
|
|
1027
|
+
allowZero?: boolean;
|
|
1028
|
+
allowFalse?: boolean;
|
|
1029
|
+
allowEmptyArray?: boolean;
|
|
1030
|
+
allowEmptyObject?: boolean;
|
|
1031
|
+
minArrayLength?: number;
|
|
1032
|
+
minObjectKeys?: number;
|
|
1033
|
+
fieldName?: string;
|
|
1034
|
+
}
|
|
1035
|
+
declare const validateRequired: (options?: RequiredOptions) => ValidatorFunction;
|
|
1036
|
+
|
|
1037
|
+
interface ShortDescriptionOptions {
|
|
1038
|
+
required?: boolean;
|
|
1039
|
+
minLength?: number;
|
|
1040
|
+
maxLength?: number;
|
|
1041
|
+
trim?: boolean;
|
|
1042
|
+
allowHtml?: boolean;
|
|
1043
|
+
}
|
|
1044
|
+
declare const validateShortDescription: (options?: ShortDescriptionOptions) => ValidatorFunction;
|
|
950
1045
|
|
|
951
|
-
|
|
1046
|
+
interface SlugOptions {
|
|
1047
|
+
required?: boolean;
|
|
1048
|
+
minLength?: number;
|
|
1049
|
+
maxLength?: number;
|
|
1050
|
+
allowNumbers?: boolean;
|
|
1051
|
+
allowUnderscores?: boolean;
|
|
1052
|
+
allowDots?: boolean;
|
|
1053
|
+
separator?: string;
|
|
1054
|
+
fieldName?: string;
|
|
1055
|
+
}
|
|
1056
|
+
declare const validateSlug: (options?: SlugOptions) => ValidatorFunction;
|
|
952
1057
|
|
|
953
|
-
|
|
1058
|
+
interface UrlOptions {
|
|
1059
|
+
required?: boolean;
|
|
1060
|
+
protocols?: string[];
|
|
1061
|
+
allowLocalhost?: boolean;
|
|
1062
|
+
allowIp?: boolean;
|
|
1063
|
+
allowPrivateIp?: boolean;
|
|
1064
|
+
requireTld?: boolean;
|
|
1065
|
+
fieldName?: string;
|
|
1066
|
+
}
|
|
1067
|
+
declare const validateUrl: (options?: UrlOptions) => ValidatorFunction;
|
|
954
1068
|
|
|
955
|
-
export { Accordion, Alert, type ApiConfig, ApiService, type ApiState, AutoComplete, Avatar, Badge, Banner, Breadcrumb, Button, Calendar, type CalendarEvent, CalendarWithEvents, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CartItem, Chart, type ChartDataset, type ChartType, Checkbox, Chip, ClickAwayListener, CodeEditor, ColorPicker, Container, type CropArea, DatePicker, DebouncedInput, Dialog, Drawer, Dropdown, type DropdownItem, type DropdownProps, EmailComposer, EmptyState, type FileItem, FileManager, FileUpload, type FilterGroup, type FilterOption, Footer, FormBuilder, type FormField, type FormFieldType, GanttChart, type GanttTask, Grid, Hero, IconSelect, type IconSelectProps, ImageCrop, type ImageCropHandle, type ImageCropProps, InfiniteScroll, Input, InputGroup, Kanban, LazyLoad, List, ListItem, MasonryGrid, Navbar, OTPInput, Pagination, Popover, Portal, ProductFilter, ProgressBar, Radio, Rating, type ResourceService, RichTextEditor, Section, Select, ShoppingCart, Sidebar, type SidebarItem, type SidebarProps, Skeleton, Slider, Spinner, SplitPane, Stack, Statistic, StatusIndicator, Stepper, Table, Tabs, Textarea, TimePicker, Timeline, type ToastOptions, type ToastVariant, Toaster, Toggle, Tooltip, Transition, TreeView, type ValidatorFunction, VirtualScroll, api, clearCache, cn, createResourceService, queryCache, toast, useApi, useMutation, useQuery, validateEmail, validateImage, validateLongDescription, validateName, validatePassword, validateRequired, validateShortDescription, validateSlug, validateUrl };
|
|
1069
|
+
export { Accordion, Alert, type ApiConfig, ApiService, type ApiState, AutoComplete, Avatar, Badge, Banner, type BaseOptions, Breadcrumb, Button, Calendar, type CalendarEvent, CalendarWithEvents, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CartItem, Chart, type ChartDataset, type ChartType, Checkbox, Chip, ClickAwayListener, CodeEditor, ColorPicker, Container, type CropArea, DatePicker, DebouncedInput, Dialog, Drawer, Dropdown, type DropdownItem, type DropdownProps, EmailComposer, type EmailOptions, EmptyState, type FileItem, FileManager, FileUpload, type FilterGroup, type FilterOption, Footer, FormBuilder, type FormField, type FormFieldType, GanttChart, type GanttTask, Grid, Hero, IconSelect, type IconSelectProps, ImageCrop, type ImageCropHandle, type ImageCropProps, type ImageOptions, InfiniteScroll, Input, InputGroup, Kanban, LazyLoad, List, ListItem, type LongDescriptionOptions, MasonryGrid, type NameOptions, Navbar, OTPInput, Pagination, type PasswordOptions, type PhoneOptions, Popover, Portal, ProductFilter, ProgressBar, Radio, Rating, type RequiredOptions, type ResourceService, RichTextEditor, Section, Select, ShoppingCart, type ShortDescriptionOptions, Sidebar, type SidebarItem, type SidebarProps, Skeleton, Slider, type SlugOptions, Spinner, SplitPane, Stack, Statistic, StatusIndicator, Stepper, Table, Tabs, Textarea, TimePicker, Timeline, type ToastOptions, type ToastVariant, Toaster, Toggle, Tooltip, Transition, TreeView, type UrlOptions, type ValidatorFunction, VirtualScroll, api, clearCache, cn, createResourceService, queryCache, toast, useApi, useMutation, useQuery, validateEmail, validateImage, validateLongDescription, validateName, validatePassword, validatePhone, validateRequired, validateShortDescription, validateSlug, validateUrl };
|