voiptime-components 1.9.23 → 1.10.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.
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { App } from 'vue';
2
2
  import { Component } from 'vue';
3
3
  import { ComponentOptionsMixin } from 'vue';
4
4
  import { ComponentProvideOptions } from 'vue';
5
+ import { ComputedRef } from 'vue';
5
6
  import { CreateComponentPublicInstanceWithMixins } from 'vue';
6
7
  import { DefineComponent } from 'vue';
7
8
  import { GlobalComponents } from 'vue';
@@ -721,6 +722,8 @@ declare type __VLS_WithTemplateSlots_9<T, S> = T & {
721
722
  };
722
723
  };
723
724
 
725
+ declare type AnyObject = Record<string, any>;
726
+
724
727
  export declare interface CollapseContext {
725
728
  readonly activeNames: string[];
726
729
  readonly accordion: boolean;
@@ -831,6 +834,27 @@ export declare interface DropdownProps {
831
834
 
832
835
  export declare type DropdownTriggerType = 'click' | 'hover';
833
836
 
837
+ export declare const email: ValidatorFn;
838
+
839
+ export declare interface FieldValidation {
840
+ $model: any;
841
+ $dirty: boolean;
842
+ $touched: boolean;
843
+ $error: boolean;
844
+ $invalid: boolean;
845
+ $errors: Array<{
846
+ $message: string;
847
+ $validator: string;
848
+ $params?: any;
849
+ $pending?: boolean;
850
+ }>;
851
+ $pending: boolean;
852
+ $params?: Record<string, any>;
853
+ $touch(): void;
854
+ $reset(): void;
855
+ $validate(): Promise<boolean>;
856
+ }
857
+
834
858
  export declare const FORMAT_TOKENS: Record<string, FormatToken>;
835
859
 
836
860
  export declare const formatTime: (hour: number, minute: number, second?: number, format?: string, use12Hours?: boolean) => string;
@@ -962,14 +986,27 @@ export declare const isValidTimeString: (timeStr: string) => boolean;
962
986
 
963
987
  export declare const loaderDirective: ObjectDirective;
964
988
 
989
+ export declare const maxLength: (max: number) => ValidatorFn;
990
+
965
991
  export declare const messageManager: VMessageManager;
966
992
 
993
+ export declare const minLength: (min: number) => ValidatorFn;
994
+
995
+ export declare function mk<V extends ValidatorFn>(opts: {
996
+ name?: string;
997
+ params?: Record<string, any>;
998
+ message?: string | ((params?: any) => string);
999
+ async?: boolean;
1000
+ }, validator: V): WrappedValidator;
1001
+
967
1002
  export declare const modalManager: VModalManager;
968
1003
 
969
1004
  export declare const MONTH_NAMES: string[];
970
1005
 
971
1006
  export declare const MONTH_NAMES_SHORT: string[];
972
1007
 
1008
+ export declare const numeric: ValidatorFn;
1009
+
973
1010
  export declare interface PaginationCalculations {
974
1011
  /** Обчислює загальну кількість сторінок */
975
1012
  getTotalPages(totalItems: number, pageSize: number): number;
@@ -1034,12 +1071,20 @@ declare interface Props {
1034
1071
  color?: string;
1035
1072
  }
1036
1073
 
1074
+ export declare const required: ValidatorFn;
1075
+
1037
1076
  export declare interface ResizeState {
1038
1077
  resizingCol: VTableColumnProps | null;
1039
1078
  startX: number;
1040
1079
  startWidth: number;
1041
1080
  }
1042
1081
 
1082
+ export declare type RulesObject = {
1083
+ [key: string]: ValidatorFn[] | ValidatorFn | RulesObject | (() => ValidatorFn[] | RulesObject);
1084
+ };
1085
+
1086
+ export declare const sameAs: (compare: () => any, msg?: string) => ValidatorFn;
1087
+
1043
1088
  export declare interface SelectionChangeEventData {
1044
1089
  selection: Record<string, any>[];
1045
1090
  row?: Record<string, any>;
@@ -1089,10 +1134,41 @@ export declare const tooltipDirective: ObjectDirective;
1089
1134
 
1090
1135
  export declare type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
1091
1136
 
1137
+ export declare const uniqueAsync: (checkFn: (val: any) => Promise<boolean>, message?: string) => ValidatorFn;
1138
+
1139
+ /**
1140
+ * Build validation tree recursively
1141
+ */
1142
+ export declare function useValidate(rulesOrFactory: RulesObject | (() => RulesObject), state: AnyObject, globalOpts?: {
1143
+ silentErrors?: boolean;
1144
+ }): ValidationGroup;
1145
+
1092
1146
  export declare const validateDateValue: (value: DatePickerValue | null | undefined, type: DatePickerType, required?: boolean) => DateValidationResult;
1093
1147
 
1094
1148
  export declare const validateTimeValue: (value: TimePickerValue, type: TimePickerType, required?: boolean) => TimeValidationResult;
1095
1149
 
1150
+ export declare type ValidationGroup = {
1151
+ [key: string]: ValidationNode;
1152
+ } & {
1153
+ $validate(): Promise<boolean>;
1154
+ $touch(): void;
1155
+ $reset(): void;
1156
+ $anyDirty: ComputedRef<boolean>;
1157
+ $anyInvalid: ComputedRef<boolean>;
1158
+ $anyError: ComputedRef<boolean>;
1159
+ $pending: ComputedRef<boolean>;
1160
+ $silentErrors?: boolean;
1161
+ $externalResults?: Array<any>;
1162
+ $addExternalResults?(res: any): void;
1163
+ $clearExternalResults?(): void;
1164
+ };
1165
+
1166
+ export declare type ValidationNode = FieldValidation | ValidationGroup;
1167
+
1168
+ export declare type ValidatorFn = (value: any, vm?: any, sibling?: any) => ValidatorResult;
1169
+
1170
+ export declare type ValidatorResult = boolean | string | Promise<boolean | string>;
1171
+
1096
1172
  export declare const VButton: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
1097
1173
 
1098
1174
  export declare interface VButtonEmits {
@@ -2021,6 +2097,21 @@ export declare const WEEKDAY_NAMES: string[];
2021
2097
 
2022
2098
  export declare const WEEKDAY_NAMES_SHORT: string[];
2023
2099
 
2100
+ export declare function withAsync(validator: ValidatorFn): WrappedValidator;
2101
+
2102
+ export declare function withMessage(message: string | ((params?: any) => string), validator: ValidatorFn): WrappedValidator;
2103
+
2104
+ export declare function withName(name: string, validator: ValidatorFn): WrappedValidator;
2105
+
2106
+ export declare function withParams(params: Record<string, any>, validator: ValidatorFn): WrappedValidator;
2107
+
2108
+ export declare interface WrappedValidator extends ValidatorFn {
2109
+ $validatorName?: string;
2110
+ $params?: Record<string, any>;
2111
+ $message?: string | ((params?: any) => string);
2112
+ $async?: boolean;
2113
+ }
2114
+
2024
2115
  export { }
2025
2116
 
2026
2117