Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/plugin/VStepperForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ import type {
Page,
PluginOptions,
Props,
Settings,
ValidateResult,
} from '@/plugin/types';
import type { PrivateFormContext } from 'vee-validate';
import PageContainer from './components/shared/PageContainer.vue';
Expand Down
1 change: 1 addition & 0 deletions src/plugin/components/fields/CommonField/CommonField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import { useField } from 'vee-validate';
import type { CommonFieldProps } from './index';
import type { FieldLabelProps } from '../../shared/FieldLabel.vue';
import type { Settings, ValidateAction } from '@/plugin/types';
import { useBindingSettings } from '../../../composables/bindings';
import { useOnActions } from '../../../composables/validation';
import FieldLabel from '../../shared/FieldLabel.vue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ import { useField } from 'vee-validate';
import { VMessages } from 'vuetify/components';
import type { Option, VSFButtonFieldProps } from './index';
import type { FieldLabelProps } from '../../shared/FieldLabel.vue';
import type { Settings, ValidateAction } from '@/plugin/types';
import type { VBtn } from 'vuetify/components';
import { useBindingSettings } from '../../../composables/bindings';
import { useOnActions } from '../../../composables/validation';
Expand Down
1 change: 1 addition & 0 deletions src/plugin/components/fields/VSFCheckbox/VSFCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import { useField } from 'vee-validate';
import { VMessages } from 'vuetify/components';
import type { VSFCheckboxProps } from './index';
import type { FieldLabelProps } from '../../shared/FieldLabel.vue';
import type { Settings, ValidateAction } from '@/plugin/types';
import type { VCheckbox } from 'vuetify/components';
import { useBindingSettings } from '../../../composables/bindings';
import { useOnActions } from '../../../composables/validation';
Expand Down
1 change: 1 addition & 0 deletions src/plugin/components/fields/VSFCustom/VSFCustom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<script lang="ts" setup>
import { useField } from 'vee-validate';
import type {VSFCustomProps} from './index';
import type { Settings, ValidateAction } from '@/plugin/types';
import { useBindingSettings } from '../../../composables/bindings';
import { useOnActions } from '../../../composables/validation';
import FieldLabel from '../../shared/FieldLabel.vue';
Expand Down
1 change: 1 addition & 0 deletions src/plugin/components/fields/VSFRadio/VSFRadio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import { useField } from 'vee-validate';
import type { VSFRadioProps } from './index';
import type { FieldLabelProps } from '../../shared/FieldLabel.vue';
import type { Settings, ValidateAction } from '@/plugin/types';
import type { VRadio } from 'vuetify/components';
import { useBindingSettings } from '../../../composables/bindings';
import { useOnActions } from '../../../composables/validation';
Expand Down
1 change: 1 addition & 0 deletions src/plugin/components/fields/VSFSwitch/VSFSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import { Field } from 'vee-validate';
import type { VSFSwitchProps } from './index';
import type { FieldLabelProps } from '../../shared/FieldLabel.vue';
import type { Settings, ValidateAction, ValidateFieldResult } from '@/plugin/types';
import type { VSwitch } from 'vuetify/components';
import { useBindingSettings } from '../../../composables/bindings';
import { useOnActions } from '../../../composables/validation';
Expand Down
1 change: 1 addition & 0 deletions src/plugin/components/shared/PageReviewContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import type {
Field,
Page,
ResponsiveColumns,
Settings,
} from '../../types/index';
import { useColumnClasses } from '../../composables/classes';
import {useGetFirstAndLastEditableFalse} from '../../composables/helpers';
Expand Down
2 changes: 2 additions & 0 deletions src/plugin/composables/__tests__/validation.spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
} from '../validation';
import type {
Field,
Settings,
ValidateAction,
} from '../../types';
import type { SinonStub } from 'cypress/types/sinon';

Expand Down
3 changes: 3 additions & 0 deletions src/plugin/composables/bindings.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import type { Settings } from '@/plugin/types';


const excludedSettings: string[] = [
'columns',
'options',
Expand Down
1 change: 1 addition & 0 deletions src/plugin/composables/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {
Settings,
UseBuildSettings,
UseColumnErrorCheck,
UseDeepMerge,
Expand Down
34 changes: 15 additions & 19 deletions src/plugin/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,22 @@ export type SelectItemKey<T = Record<string, any>> =
| readonly (string | number)[]
| ((item: T, fallback?: any) => any);

export interface KeyStringAny<T = any> {
[key: string]: T;
}

// -------------------------------------------------- Globals //
declare global {
interface KeyStringAny<T = any> {
[key: string]: T;
}

type ValidateAction =
'blur' |
'change' |
'click' |
'input' |
'page' |
'submit';
type ValidateFieldResult = FieldValidator<GenericObject>;
type ValidateResult = FormValidationResult<GenericObject, GenericObject>;
type FieldValidateResult = () => Promise<Partial<FieldValidator<GenericObject>>>;
}
// -------------------------------------------------- Validation //
export type ValidateAction =
'blur' |
'change' |
'click' |
'input' |
'page' |
'submit';
export type ValidateFieldResult = FieldValidator<GenericObject>;
export type ValidateResult = FormValidationResult<GenericObject, GenericObject>;
export type FieldValidateResult = () => Promise<Partial<FieldValidator<GenericObject>>>;

/* Good for:
* VAutocomplete
Expand Down Expand Up @@ -214,9 +212,7 @@ export interface Props extends VStepperWindowItemProps {

export interface PluginOptions extends Partial<Omit<Props, 'pages' | 'validationSchema'>> { }

declare global {
export interface Settings extends PluginOptions { }
}
export interface Settings extends PluginOptions { }

type FieldTypes =
'autocomplete' |
Expand Down
Loading