Skip to content

Commit

Permalink
refactor: move form folder to useform
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Aug 13, 2024
1 parent 8f4697b commit f4a70f2
Show file tree
Hide file tree
Showing 18 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export * from './useNumberField';
export * from './useSpinButton';
export * from './types';
export * from './config';
export * from './form';
export * from './useForm';
export * from './useFormGroup';
export * from './validation';
export { normalizePath } from './utils/path';
2 changes: 1 addition & 1 deletion packages/core/src/useCheckbox/useCheckboxGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useUniqId, createDescribedByProps, normalizeProps, isEqual } from '../u
import { useLocale } from '../i18n/useLocale';
import { useFormField } from '../useFormField';
import { FieldTypePrefixes } from '../constants';
import { useErrorDisplay } from '../form/useErrorDisplay';
import { useErrorDisplay } from '../useFormField/useErrorDisplay';

export type CheckboxGroupValue<TCheckbox> = TCheckbox[];

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { renderSetup } from '@test-utils/index';
import { useErrorDisplay } from './useErrorDisplay';
import { useFormField } from '../useFormField';
import { useFormField } from './useFormField';

test('displays field errors only if they are touched', async () => {
const { setErrors, isValid, errorMessage, displayError, setTouched } = await renderSetup(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FormField } from '../useFormField';
import { FormField } from './useFormField';

export function useErrorDisplay(field: FormField<any>) {
function displayError(msg?: string) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/useFormField/useFormField.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { renderSetup } from '@test-utils/index';
import { useFormField } from './useFormField';
import { useForm } from '../form/useForm';
import { useForm } from '../useForm/useForm';

test('it initializes the field value', async () => {
const { fieldValue } = await renderSetup(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/useFormField/useFormField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
toValue,
watch,
} from 'vue';
import { FormContext, FormKey } from '../form/useForm';
import { FormContext, FormKey } from '../useForm/useForm';
import { Arrayable, Getter } from '../types';
import { useSyncModel } from '../reactivity/useModelSync';
import { cloneDeep, isEqual, normalizeArrayable } from '../utils/common';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/useNumberField/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { useSpinButton } from '../useSpinButton';
import { useLocale } from '../i18n/useLocale';
import { useFormField } from '../useFormField';
import { FieldTypePrefixes } from '../constants';
import { useErrorDisplay } from '../form/useErrorDisplay';
import { useErrorDisplay } from '../useFormField/useErrorDisplay';

export interface NumberInputDOMAttributes {
name?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/useRadio/useRadioGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useUniqId, createDescribedByProps, getNextCycleArrIdx, normalizeProps,
import { useLocale } from '../i18n/useLocale';
import { useFormField } from '../useFormField';
import { FieldTypePrefixes } from '../constants';
import { useErrorDisplay } from '../form/useErrorDisplay';
import { useErrorDisplay } from '../useFormField/useErrorDisplay';

export interface RadioGroupContext<TValue> {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/useSearchField/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useInputValidity } from '../validation/useInputValidity';
import { useLabel } from '../a11y/useLabel';
import { useFormField } from '../useFormField';
import { FieldTypePrefixes } from '../constants';
import { useErrorDisplay } from '../form/useErrorDisplay';
import { useErrorDisplay } from '../useFormField/useErrorDisplay';

export interface SearchInputDOMAttributes extends TextInputBaseAttributes {
type?: 'search';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/useTextField/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useInputValidity } from '../validation/useInputValidity';
import { useLabel } from '../a11y/useLabel';
import { useFormField } from '../useFormField';
import { FieldTypePrefixes } from '../constants';
import { useErrorDisplay } from '../form/useErrorDisplay';
import { useErrorDisplay } from '../useFormField/useErrorDisplay';

export type TextInputDOMType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/validation/useInputValidity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Ref, inject, nextTick, onMounted, shallowRef, watch } from 'vue';
import { useEventListener } from '../helpers/useEventListener';
import { FormKey } from '../form';
import { FormKey } from '../useForm';
import { Maybe } from '../types';
import { FormField } from '../useFormField';

Expand Down

0 comments on commit f4a70f2

Please sign in to comment.