@auronui/vue 1.0.9 → 1.0.11

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
@@ -1213,17 +1213,34 @@ disabled: boolean;
1213
1213
  isExternal: boolean;
1214
1214
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
1215
1215
 
1216
- declare const __VLS_component_22: DefineComponent<__VLS_Props_24, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1216
+ declare const __VLS_component_22: DefineComponent<__VLS_Props_24, {
1217
+ errors: Ref<Record<string, string>, Record<string, string>>;
1218
+ isSubmitting: Ref<boolean, boolean>;
1219
+ isSubmitted: Ref<boolean, boolean>;
1220
+ submitCount: Ref<number, number>;
1221
+ isValid: ComputedRef<boolean>;
1222
+ isDirty: ComputedRef<boolean>;
1223
+ isTouched: ComputedRef<boolean>;
1224
+ getValues: typeof getValues;
1225
+ setValue: typeof setValue;
1226
+ setErrors: typeof setErrors;
1227
+ setError: typeof setError;
1228
+ clearErrors: typeof clearErrors;
1229
+ trigger: typeof trigger;
1230
+ reset: typeof reset;
1231
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1217
1232
  submit: (payload: {
1218
1233
  values: Record<string, unknown>;
1219
1234
  setErrors: (e: Record<string, string>) => void;
1220
1235
  }) => any;
1236
+ reset: () => any;
1221
1237
  invalid: (errors: Record<string, string>) => any;
1222
1238
  }, string, PublicProps, Readonly<__VLS_Props_24> & Readonly<{
1223
1239
  onSubmit?: ((payload: {
1224
1240
  values: Record<string, unknown>;
1225
1241
  setErrors: (e: Record<string, string>) => void;
1226
1242
  }) => any) | undefined;
1243
+ onReset?: (() => any) | undefined;
1227
1244
  onInvalid?: ((errors: Record<string, string>) => any) | undefined;
1228
1245
  }>, {
1229
1246
  isDisabled: boolean;
@@ -2791,9 +2808,10 @@ declare type __VLS_Props_24 = {
2791
2808
 
2792
2809
  declare type __VLS_Props_25 = {
2793
2810
  name: string;
2811
+ defaultValue?: unknown;
2794
2812
  rules?: FieldRules;
2795
2813
  validate?: CustomValidator;
2796
- /** Override validation mode — used in standalone mode (outside <Form>) or to override the Form's mode for a single field. */
2814
+ /** Override validation mode for this field. */
2797
2815
  validationMode?: 'on-submit' | 'on-blur' | 'on-change';
2798
2816
  };
2799
2817
 
@@ -4605,8 +4623,20 @@ declare function __VLS_template_22(): {
4605
4623
  slots: {
4606
4624
  default?(_: {
4607
4625
  isSubmitting: boolean;
4626
+ isSubmitted: boolean;
4627
+ submitCount: number;
4608
4628
  isDisabled: boolean;
4629
+ isValid: boolean;
4630
+ isDirty: boolean;
4631
+ isTouched: boolean;
4609
4632
  errors: Record<string, string>;
4633
+ getValues: typeof getValues;
4634
+ setValue: typeof setValue;
4635
+ setErrors: typeof setErrors;
4636
+ setError: typeof setError;
4637
+ clearErrors: typeof clearErrors;
4638
+ trigger: typeof trigger;
4639
+ reset: typeof reset;
4610
4640
  }): any;
4611
4641
  };
4612
4642
  refs: {};
@@ -4626,6 +4656,10 @@ declare function __VLS_template_23(): {
4626
4656
  isDisabled: boolean;
4627
4657
  onBlur: typeof handleBlur;
4628
4658
  };
4659
+ touched: boolean;
4660
+ dirty: boolean;
4661
+ error: string | undefined;
4662
+ isInvalid: boolean;
4629
4663
  }): any;
4630
4664
  };
4631
4665
  refs: {};
@@ -7126,6 +7160,8 @@ export declare const Chip: __VLS_WithTemplateSlots_9<typeof __VLS_component_9, _
7126
7160
 
7127
7161
  export { ChipVariants }
7128
7162
 
7163
+ declare function clearErrors(name?: string): void;
7164
+
7129
7165
  export declare const CloseButton: DefineComponent<__VLS_Props_20, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_20> & Readonly<{}>, {
7130
7166
  size: "md" | "sm" | "lg" | "xs" | "xl";
7131
7167
  isLoading: boolean;
@@ -7301,7 +7337,7 @@ export declare function composeSlotClassName<V extends Record<string, unknown>>(
7301
7337
 
7302
7338
  export declare function createPaginationContext(context: PaginationContext): PaginationContext;
7303
7339
 
7304
- export declare type CustomValidator = (value: unknown) => string | undefined | Promise<string | undefined>;
7340
+ export declare type CustomValidator = (value: unknown, context?: ValidationContext) => string | undefined | Promise<string | undefined>;
7305
7341
 
7306
7342
  export { cx }
7307
7343
 
@@ -7464,9 +7500,14 @@ export declare function composeSlotClassName<V extends Record<string, unknown>>(
7464
7500
 
7465
7501
  export declare const EmptyStateContent: __VLS_WithTemplateSlots_16<typeof __VLS_component_16, __VLS_TemplateResult_16["slots"]>;
7466
7502
 
7467
- declare interface FieldRegistration {
7503
+ export declare interface FieldRegistration {
7468
7504
  name: string;
7469
7505
  getValue: () => unknown;
7506
+ getDefaultValue: () => unknown;
7507
+ setValue: (value: unknown) => void;
7508
+ reset: () => void;
7509
+ touched: Ref<boolean>;
7510
+ dirty: Ref<boolean>;
7470
7511
  rules?: FieldRules;
7471
7512
  validate?: CustomValidator;
7472
7513
  }
@@ -7474,11 +7515,15 @@ export declare function composeSlotClassName<V extends Record<string, unknown>>(
7474
7515
  export declare interface FieldRules {
7475
7516
  required?: boolean | string;
7476
7517
  email?: boolean | string;
7518
+ url?: boolean | string;
7519
+ integer?: boolean | string;
7477
7520
  pattern?: RuleWithMessage<RegExp>;
7478
7521
  minLength?: RuleWithMessage<number>;
7479
7522
  maxLength?: RuleWithMessage<number>;
7480
7523
  min?: RuleWithMessage<number>;
7481
7524
  max?: RuleWithMessage<number>;
7525
+ /** Match the value of another field by name (e.g. confirm password). */
7526
+ matches?: RuleWithMessage<string>;
7482
7527
  }
7483
7528
 
7484
7529
  export declare const Fieldset: __VLS_WithTemplateSlots_26<typeof __VLS_component_26, __VLS_TemplateResult_26["slots"]>;
@@ -7488,16 +7533,29 @@ export declare function composeSlotClassName<V extends Record<string, unknown>>(
7488
7533
  export declare interface FormContext {
7489
7534
  errors: Ref<Record<string, string>>;
7490
7535
  isSubmitting: Ref<boolean>;
7536
+ isSubmitted: Ref<boolean>;
7537
+ submitCount: Ref<number>;
7491
7538
  isDisabled: ComputedRef<boolean>;
7539
+ isValid: ComputedRef<boolean>;
7540
+ isDirty: ComputedRef<boolean>;
7541
+ isTouched: ComputedRef<boolean>;
7492
7542
  validationMode: ComputedRef<ValidationMode>;
7493
7543
  registerField(reg: FieldRegistration): void;
7494
7544
  unregisterField(name: string): void;
7495
7545
  triggerFieldValidation(name: string): Promise<void>;
7496
7546
  setErrors(newErrors: Record<string, string>): void;
7547
+ setError(name: string, message: string): void;
7548
+ clearErrors(name?: string): void;
7549
+ getValues(): Record<string, unknown>;
7550
+ setValue(name: string, value: unknown): void;
7551
+ trigger(name?: string): Promise<boolean>;
7552
+ reset(): void;
7497
7553
  }
7498
7554
 
7499
7555
  export declare const FormField: __VLS_WithTemplateSlots_23<typeof __VLS_component_23, __VLS_TemplateResult_23["slots"]>;
7500
7556
 
7557
+ declare function getValues(): Record<string, unknown>;
7558
+
7501
7559
  declare function handleBlur(): Promise<void>;
7502
7560
 
7503
7561
  declare function handleRowClick(rowIndex: number, event: MouseEvent): void;
@@ -8201,6 +8259,8 @@ export declare function composeSlotClassName<V extends Record<string, unknown>>(
8201
8259
  allowNonContiguousRanges: boolean;
8202
8260
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
8203
8261
 
8262
+ declare function reset(): void;
8263
+
8204
8264
  declare type RuleWithMessage<T> = T | {
8205
8265
  value: T;
8206
8266
  message: string;
@@ -8253,6 +8313,12 @@ export declare function composeSlotClassName<V extends Record<string, unknown>>(
8253
8313
 
8254
8314
  export { SeparatorVariants }
8255
8315
 
8316
+ declare function setError(name: string, message: string): void;
8317
+
8318
+ declare function setErrors(newErrors: Record<string, string>): void;
8319
+
8320
+ declare function setValue(name: string, value: unknown): void;
8321
+
8256
8322
  declare type Single = string;
8257
8323
 
8258
8324
  declare type SingleValue = string;
@@ -8677,6 +8743,8 @@ export declare function composeSlotClassName<V extends Record<string, unknown>>(
8677
8743
 
8678
8744
  export { TreeVariants }
8679
8745
 
8746
+ declare function trigger(name?: string): Promise<boolean>;
8747
+
8680
8748
  export declare const useAutocompleteInject: (fallback?: AutocompleteContext | undefined) => AutocompleteContext;
8681
8749
 
8682
8750
  export declare const useAutocompleteProvide: (value: AutocompleteContext) => AutocompleteContext;
@@ -8967,6 +9035,11 @@ export declare function composeSlotClassName<V extends Record<string, unknown>>(
8967
9035
  remove: (id: string) => void;
8968
9036
  };
8969
9037
 
9038
+ export declare interface ValidationContext {
9039
+ /** All current form field values — available for cross-field rules and custom validators. */
9040
+ values: Record<string, unknown>;
9041
+ }
9042
+
8970
9043
  export declare type ValidationMode = 'on-submit' | 'on-blur' | 'on-change';
8971
9044
 
8972
9045
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auronui/vue",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Vue 3 85 components with full visual and functional parity",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -69,7 +69,7 @@
69
69
  "tailwind-merge": "3.5.0",
70
70
  "tailwind-variants": "3.2.2",
71
71
  "vee-validate": "^4.15.1",
72
- "@auronui/styles": "1.0.9"
72
+ "@auronui/styles": "1.0.11"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@chialab/vitest-axe": "0.19.1",
@@ -88,8 +88,8 @@
88
88
  "vitest": "4.1.4",
89
89
  "vue": "^3.5.32",
90
90
  "vue-tsc": "^3.2.6",
91
- "@auronui/standard": "0.0.0",
92
- "@auronui/vitest": "0.0.0"
91
+ "@auronui/vitest": "0.0.0",
92
+ "@auronui/standard": "0.0.0"
93
93
  },
94
94
  "scripts": {
95
95
  "build": "vite build",