fix: prevent asset conflicts between React and Grid.js versions

Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
dwindown
2026-04-18 17:02:14 +07:00
parent bd9cdac02e
commit e8fbfb14c1
74973 changed files with 6658406 additions and 71 deletions

17
node_modules/reakit/ts/Form/Form.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import * as React from "react";
import { RoleOptions, RoleHTMLProps } from "../Role/Role";
import { unstable_FormStateReturn } from "./FormState";
export declare type unstable_FormOptions = RoleOptions & Pick<unstable_FormStateReturn<any>, "submit">;
export declare type unstable_FormHTMLProps = RoleHTMLProps & React.FormHTMLAttributes<any>;
export declare type unstable_FormProps = unstable_FormOptions & unstable_FormHTMLProps;
export declare const unstable_useForm: {
(options?: unstable_FormOptions | undefined, htmlProps?: unstable_FormHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): unstable_FormHTMLProps;
unstable_propsAreEqual: (prev: RoleOptions & Pick<unstable_FormStateReturn<any>, "submit"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & React.FormHTMLAttributes<any>, next: RoleOptions & Pick<unstable_FormStateReturn<any>, "submit"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & React.FormHTMLAttributes<any>) => boolean;
__keys: readonly any[];
__useOptions: (options: unstable_FormOptions, htmlProps: unstable_FormHTMLProps) => unstable_FormOptions;
};
export declare const unstable_Form: import("reakit-system/ts/createComponent").Component<"form", unstable_FormOptions>;

21
node_modules/reakit/ts/Form/FormCheckbox.d.ts generated vendored Normal file
View File

@@ -0,0 +1,21 @@
import * as React from "react";
import { PropsWithAs, ArrayValue } from "reakit-utils/types";
import { CheckboxOptions, CheckboxHTMLProps } from "../Checkbox/Checkbox";
import { DeepPath, DeepPathValue } from "./__utils/types";
import { unstable_FormStateReturn } from "./FormState";
export declare type unstable_FormCheckboxOptions<V, P extends DeepPath<V, P>> = Omit<CheckboxOptions, "value" | "state" | "setState"> & Pick<unstable_FormStateReturn<V>, "baseId" | "values" | "update" | "blur" | "touched" | "errors"> & {
/**
* Checkbox's name as in form values.
*/
name: P;
/**
* Checkbox's value is going to be used when multiple checkboxes share the
* same state. Checking a checkbox with value will add it to the state
* array.
*/
value?: ArrayValue<DeepPathValue<V, P>>;
};
export declare type unstable_FormCheckboxHTMLProps = CheckboxHTMLProps & React.InputHTMLAttributes<any>;
export declare type unstable_FormCheckboxProps<V, P extends DeepPath<V, P>> = unstable_FormCheckboxOptions<V, P> & unstable_FormCheckboxHTMLProps;
export declare const unstable_useFormCheckbox: <V, P extends DeepPath<V, P>>(options: unstable_FormCheckboxOptions<V, P>, htmlProps?: CheckboxHTMLProps | undefined) => unstable_FormCheckboxHTMLProps;
export declare const unstable_FormCheckbox: <V, P extends DeepPath<V, P>, T extends React.ElementType<any> = "input">(props: PropsWithAs<unstable_FormCheckboxOptions<V, P>, T>) => JSX.Element;

15
node_modules/reakit/ts/Form/FormGroup.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import * as React from "react";
import { PropsWithAs } from "reakit-utils/types";
import { GroupOptions, GroupHTMLProps } from "../Group/Group";
import { DeepPath } from "./__utils/types";
import { unstable_FormStateReturn } from "./FormState";
export declare type unstable_FormGroupOptions<V, P extends DeepPath<V, P>> = GroupOptions & Pick<unstable_FormStateReturn<V>, "baseId" | "touched" | "errors"> & {
/**
* FormGroup's name as in form values.
*/
name: P;
};
export declare type unstable_FormGroupHTMLProps = GroupHTMLProps & React.FieldsetHTMLAttributes<any>;
export declare type unstable_FormGroupProps<V, P extends DeepPath<V, P>> = unstable_FormGroupOptions<V, P> & unstable_FormGroupHTMLProps;
export declare const unstable_useFormGroup: <V, P extends DeepPath<V, P>>(options: unstable_FormGroupOptions<V, P>, htmlProps?: unstable_FormGroupHTMLProps | undefined) => unstable_FormGroupHTMLProps;
export declare const unstable_FormGroup: <V, P extends DeepPath<V, P>, T extends React.ElementType<any> = "fieldset">(props: PropsWithAs<unstable_FormGroupOptions<V, P>, T>) => JSX.Element;

15
node_modules/reakit/ts/Form/FormInput.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import * as React from "react";
import { PropsWithAs } from "reakit-utils/types";
import { InputOptions, InputHTMLProps } from "../Input/Input";
import { DeepPath } from "./__utils/types";
import { unstable_FormStateReturn } from "./FormState";
export declare type unstable_FormInputOptions<V, P extends DeepPath<V, P>> = InputOptions & Pick<unstable_FormStateReturn<V>, "baseId" | "values" | "touched" | "errors" | "update" | "blur"> & {
/**
* FormInput's name as in form values.
*/
name: P;
};
export declare type unstable_FormInputHTMLProps = InputHTMLProps & React.InputHTMLAttributes<any>;
export declare type unstable_FormInputProps<V, P extends DeepPath<V, P>> = unstable_FormInputOptions<V, P> & unstable_FormInputHTMLProps;
export declare const unstable_useFormInput: <V, P extends DeepPath<V, P>>(options: unstable_FormInputOptions<V, P>, htmlProps?: import("..").unstable_ComboboxHTMLProps | undefined) => unstable_FormInputHTMLProps;
export declare const unstable_FormInput: <V, P extends DeepPath<V, P>, T extends React.ElementType<any> = "input">(props: PropsWithAs<unstable_FormInputOptions<V, P>, T>) => JSX.Element;

19
node_modules/reakit/ts/Form/FormLabel.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import * as React from "react";
import { PropsWithAs } from "reakit-utils/types";
import { RoleOptions, RoleHTMLProps } from "../Role/Role";
import { DeepPath } from "./__utils/types";
import { unstable_FormStateReturn } from "./FormState";
export declare type unstable_FormLabelOptions<V, P extends DeepPath<V, P>> = RoleOptions & Pick<unstable_FormStateReturn<V>, "baseId" | "values"> & {
/**
* FormInput's name as in form values.
*/
name: P;
/**
* Label can be passed as the `label` prop or `children`.
*/
label?: any;
};
export declare type unstable_FormLabelHTMLProps = RoleHTMLProps & React.LabelHTMLAttributes<any>;
export declare type unstable_FormLabelProps<V, P extends DeepPath<V, P>> = unstable_FormLabelOptions<V, P> & unstable_FormLabelHTMLProps;
export declare const unstable_useFormLabel: <V, P extends DeepPath<V, P>>(options: unstable_FormLabelOptions<V, P>, htmlProps?: unstable_FormLabelHTMLProps | undefined) => unstable_FormLabelHTMLProps;
export declare const unstable_FormLabel: <V, P extends DeepPath<V, P>, T extends React.ElementType<any> = "label">(props: PropsWithAs<unstable_FormLabelOptions<V, P>, T>) => JSX.Element;

15
node_modules/reakit/ts/Form/FormMessage.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
/// <reference types="react" />
import { PropsWithAs } from "reakit-utils/types";
import { RoleOptions, RoleHTMLProps } from "../Role/Role";
import { unstable_FormStateReturn } from "./FormState";
import { DeepPath } from "./__utils/types";
export declare type unstable_FormMessageOptions<V, P extends DeepPath<V, P>> = RoleOptions & Pick<unstable_FormStateReturn<V>, "baseId" | "touched" | "errors" | "messages"> & {
/**
* FormInput's name as in form values.
*/
name: P;
};
export declare type unstable_FormMessageHTMLProps = RoleHTMLProps;
export declare type unstable_FormMessageProps<V, P extends DeepPath<V, P>> = unstable_FormMessageOptions<V, P> & unstable_FormMessageHTMLProps;
export declare const unstable_useFormMessage: <V, P extends DeepPath<V, P>>(options: unstable_FormMessageOptions<V, P>, htmlProps?: RoleHTMLProps | undefined) => unstable_FormMessageHTMLProps;
export declare const unstable_FormMessage: <V, P extends DeepPath<V, P>, T extends import("react").ElementType<any> = "div">(props: PropsWithAs<unstable_FormMessageOptions<V, P>, T>) => JSX.Element;

19
node_modules/reakit/ts/Form/FormPushButton.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import * as React from "react";
import { ArrayValue, PropsWithAs } from "reakit-utils/types";
import { ButtonOptions, ButtonHTMLProps } from "../Button/Button";
import { unstable_FormStateReturn } from "./FormState";
import { DeepPath, DeepPathValue } from "./__utils/types";
export declare type unstable_FormPushButtonOptions<V, P extends DeepPath<V, P>> = ButtonOptions & Pick<unstable_FormStateReturn<V>, "baseId" | "values" | "push"> & {
/**
* FormInput's name as in form values. This should point to array value.
*/
name: P;
/**
* The value that is going to be pushed to `form.values[name]`.
*/
value: ArrayValue<DeepPathValue<V, P>>;
};
export declare type unstable_FormPushButtonHTMLProps = ButtonHTMLProps;
export declare type unstable_FormPushButtonProps<V, P extends DeepPath<V, P>> = unstable_FormPushButtonOptions<V, P> & unstable_FormPushButtonHTMLProps;
export declare const unstable_useFormPushButton: <V, P extends DeepPath<V, P>>(options: unstable_FormPushButtonOptions<V, P>, htmlProps?: ButtonHTMLProps | undefined) => unstable_FormPushButtonHTMLProps;
export declare const unstable_FormPushButton: <V, P extends DeepPath<V, P>, T extends React.ElementType<any> = "button">(props: PropsWithAs<unstable_FormPushButtonOptions<V, P>, T>) => JSX.Element;

20
node_modules/reakit/ts/Form/FormRadio.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import * as React from "react";
import { PropsWithAs } from "reakit-utils/types";
import { RadioHTMLProps } from "../Radio/Radio";
import { RoleOptions } from "../Role";
import { unstable_FormStateReturn } from "./FormState";
import { DeepPath, DeepPathValue } from "./__utils/types";
export declare type unstable_FormRadioOptions<V, P extends DeepPath<V, P>> = RoleOptions & Pick<unstable_FormStateReturn<V>, "values" | "update" | "blur"> & {
/**
* FormRadio's name as in form values.
*/
name: P;
/**
* FormRadio's value.
*/
value: DeepPathValue<V, P>;
};
export declare type unstable_FormRadioHTMLProps = RadioHTMLProps;
export declare type unstable_FormRadioProps<V, P extends DeepPath<V, P>> = unstable_FormRadioOptions<V, P> & unstable_FormRadioHTMLProps;
export declare const unstable_useFormRadio: <V, P extends DeepPath<V, P>>(options: unstable_FormRadioOptions<V, P>, htmlProps?: import("..").unstable_ComboboxHTMLProps | undefined) => unstable_FormRadioHTMLProps;
export declare const unstable_FormRadio: <V, P extends DeepPath<V, P>, T extends React.ElementType<any> = "input">(props: PropsWithAs<unstable_FormRadioOptions<V, P>, T>) => JSX.Element;

16
node_modules/reakit/ts/Form/FormRadioGroup.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import * as React from "react";
import { PropsWithAs } from "reakit-utils/types";
import { CompositeStateReturn } from "../Composite/CompositeState";
import { unstable_FormGroupOptions, unstable_FormGroupHTMLProps } from "./FormGroup";
import { DeepPath } from "./__utils/types";
export declare type unstable_FormRadioGroupOptions<V, P extends DeepPath<V, P>> = unstable_FormGroupOptions<V, P> & {
/**
* FormRadioGroup's name as in form values.
*/
name: P;
};
export declare type unstable_FormRadioGroupHTMLProps = unstable_FormGroupHTMLProps & React.FieldsetHTMLAttributes<any>;
export declare type unstable_FormRadioGroupProps<V, P extends DeepPath<V, P>> = unstable_FormRadioGroupOptions<V, P> & unstable_FormRadioGroupHTMLProps;
export declare const FormRadioGroupContext: React.Context<CompositeStateReturn | null>;
export declare const unstable_useFormRadioGroup: <V, P extends DeepPath<V, P>>(options: unstable_FormRadioGroupOptions<V, P>, htmlProps?: unstable_FormGroupHTMLProps | undefined) => unstable_FormRadioGroupHTMLProps;
export declare const unstable_FormRadioGroup: <V, P extends DeepPath<V, P>, T extends React.ElementType<any> = "fieldset">(props: PropsWithAs<unstable_FormRadioGroupOptions<V, P>, T>) => JSX.Element;

19
node_modules/reakit/ts/Form/FormRemoveButton.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import * as React from "react";
import { PropsWithAs } from "reakit-utils/types";
import { ButtonOptions, ButtonHTMLProps } from "../Button/Button";
import { unstable_FormStateReturn } from "./FormState";
import { DeepPath } from "./__utils/types";
export declare type unstable_FormRemoveButtonOptions<V, P extends DeepPath<V, P>> = ButtonOptions & Pick<unstable_FormStateReturn<V>, "baseId" | "values" | "remove"> & {
/**
* FormInput's name as in form values. This should point to array value.
*/
name: P;
/**
* The index in `form.values[name]` that will be removed.
*/
index: number;
};
export declare type unstable_FormRemoveButtonHTMLProps = ButtonHTMLProps;
export declare type unstable_FormRemoveButtonProps<V, P extends DeepPath<V, P>> = unstable_FormRemoveButtonOptions<V, P> & unstable_FormRemoveButtonHTMLProps;
export declare const unstable_useFormRemoveButton: <V, P extends DeepPath<V, P>>(options: unstable_FormRemoveButtonOptions<V, P>, htmlProps?: ButtonHTMLProps | undefined) => unstable_FormRemoveButtonHTMLProps;
export declare const unstable_FormRemoveButton: <V, P extends DeepPath<V, P>, T extends React.ElementType<any> = "button">(props: PropsWithAs<unstable_FormRemoveButtonOptions<V, P>, T>) => JSX.Element;

122
node_modules/reakit/ts/Form/FormState.d.ts generated vendored Normal file
View File

@@ -0,0 +1,122 @@
import { ArrayValue } from "reakit-utils/types";
import { SealedInitialState } from "reakit-utils/useSealedState";
import { unstable_IdState, unstable_IdActions, unstable_IdInitialState } from "../Id/IdState";
import { DeepPartial, DeepMap, DeepPath, DeepPathValue } from "./__utils/types";
declare type Messages<V> = DeepPartial<DeepMap<V, string | null | void>>;
declare type ValidateOutput<V> = Messages<V> | null | void;
declare type ValidateReturn<V> = Promise<ValidateOutput<V>> | ValidateOutput<V>;
interface Update<V> {
<P extends DeepPath<V, P>>(name: P, value: DeepPathValue<V, P>): void;
<P extends DeepPath<V, P>>(name: P, value: (value: DeepPathValue<V, P>) => DeepPathValue<V, P>): void;
}
export declare type unstable_FormState<V> = unstable_IdState & {
/**
* Form values.
*/
values: V;
/**
* An object with the same shape as `form.values` with `boolean` values.
* This keeps the touched state of each field. That is, whether a field has
* been blurred.
*/
touched: DeepPartial<DeepMap<V, boolean>>;
/**
* An object with the same shape as `form.values` with string messages.
* This stores the messages returned by `onValidate` and `onSubmit`.
*/
messages: Messages<V>;
/**
* An object with the same shape as `form.values` with string error messages.
* This stores the error messages throwed by `onValidate` and `onSubmit`.
*/
errors: Messages<V>;
/**
* Whether form is validating or not.
*/
validating: boolean;
/**
* Whether `form.errors` is empty or not.
*/
valid: boolean;
/**
* Whether form is submitting or not.
*/
submitting: boolean;
/**
* Stores the number of times that the form has been successfully submitted.
*/
submitSucceed: number;
/**
* Stores the number of times that the form submission has failed.
*/
submitFailed: number;
};
export declare type unstable_FormActions<V> = unstable_IdActions & {
/**
* Resets the form state.
*/
reset: () => void;
/**
* Triggers form validation (calling `onValidate` underneath).
* Optionally, new `values` can be passed in.
*/
validate: (values?: V) => ValidateReturn<V>;
/**
* Triggers form submission (calling `onValidate` and `onSubmit` underneath).
*/
submit: () => void;
/**
* Updates a form value.
*/
update: Update<V>;
/**
* Sets field's touched state to `true`.
*/
blur: <P extends DeepPath<V, P>>(name: P) => void;
/**
* Pushes a new item into `form.values[name]`, which should be an array.
*/
push: <P extends DeepPath<V, P>>(name: P, value?: ArrayValue<DeepPathValue<V, P>>) => void;
/**
* Removes `form.values[name][index]`.
*/
remove: <P extends DeepPath<V, P>>(name: P, index: number) => void;
};
export declare type unstable_FormInitialState<V> = unstable_IdInitialState & Partial<Pick<unstable_FormState<V>, "values">> & {
/**
* Whether the form should trigger `onValidate` on blur.
*/
validateOnBlur?: boolean;
/**
* Whether the form should trigger `onValidate` on change.
*/
validateOnChange?: boolean;
/**
* Whether the form should reset when it has been successfully submitted.
*/
resetOnSubmitSucceed?: boolean;
/**
* Whether the form should reset when the component (which called
* `useFormState`) has been unmounted.
*/
resetOnUnmount?: boolean;
/**
* A function that receives `form.values` and return or throw messages.
* If it returns, messages will be interpreted as successful messages.
* If it throws, they will be interpreted as errors.
* It can also return a promise for asynchronous validation.
*/
onValidate?: (values: V) => ValidateReturn<V>;
/**
* A function that receives `form.values` and performs form submission.
* If it's triggered by `form.submit()`, `onValidate` will be called before.
* If `onValidate` throws, `onSubmit` will not be called.
* `onSubmit` can also return promises, messages and throw error messages
* just like `onValidate`. The only difference is that this validation will
* only occur on submit.
*/
onSubmit?: (values: V) => ValidateReturn<V>;
};
export declare type unstable_FormStateReturn<V> = unstable_FormState<V> & unstable_FormActions<V>;
export declare function unstable_useFormState<V = Record<any, any>>(initialState?: SealedInitialState<unstable_FormInitialState<V>>): unstable_FormStateReturn<V>;
export {};

33
node_modules/reakit/ts/Form/FormSubmitButton.d.ts generated vendored Normal file
View File

@@ -0,0 +1,33 @@
import * as React from "react";
import { ButtonOptions, ButtonHTMLProps } from "../Button/Button";
import { unstable_FormStateReturn } from "./FormState";
export declare type unstable_FormSubmitButtonOptions = ButtonOptions & Pick<Partial<unstable_FormStateReturn<any>>, "submitting"> & Pick<unstable_FormStateReturn<any>, "baseId" | "submit">;
export declare type unstable_FormSubmitButtonHTMLProps = ButtonHTMLProps;
export declare type unstable_FormSubmitButtonProps = unstable_FormSubmitButtonOptions & unstable_FormSubmitButtonHTMLProps;
export declare const unstable_useFormSubmitButton: {
(options?: unstable_FormSubmitButtonOptions | undefined, htmlProps?: ButtonHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): ButtonHTMLProps;
unstable_propsAreEqual: (prev: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<unstable_FormStateReturn<any>>, "submitting"> & Pick<unstable_FormStateReturn<any>, "submit" | "baseId"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & React.ButtonHTMLAttributes<any>, next: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<unstable_FormStateReturn<any>>, "submitting"> & Pick<unstable_FormStateReturn<any>, "submit" | "baseId"> & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & React.ButtonHTMLAttributes<any>) => boolean;
__keys: readonly any[];
__useOptions: (options: unstable_FormSubmitButtonOptions, htmlProps: ButtonHTMLProps) => unstable_FormSubmitButtonOptions;
};
export declare const unstable_FormSubmitButton: import("reakit-system/ts/createComponent").Component<"button", unstable_FormSubmitButtonOptions>;

11
node_modules/reakit/ts/Form/__keys.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
export declare const FORM_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove"];
export declare const FORM_CHECKBOX_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name", "value"];
export declare const FORM_GROUP_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name"];
export declare const FORM_INPUT_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name"];
export declare const FORM_LABEL_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name", "label"];
export declare const FORM_MESSAGE_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name"];
export declare const FORM_PUSH_BUTTON_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name", "baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name", "value"];
export declare const FORM_RADIO_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name", "baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name", "value"];
export declare const FORM_RADIO_GROUP_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name"];
export declare const FORM_REMOVE_BUTTON_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove", "name", "index"];
export declare const FORM_SUBMIT_BUTTON_KEYS: readonly ["baseId", "unstable_idCountRef", "values", "touched", "messages", "errors", "validating", "valid", "submitting", "submitSucceed", "submitFailed", "setBaseId", "reset", "validate", "submit", "update", "blur", "push", "remove"];

View File

@@ -0,0 +1 @@
export declare function filterAllEmpty<T extends Record<any, any> | Array<any>>(object: T): T;

View File

@@ -0,0 +1 @@
export declare function formatInputName(name: any, separator?: string): any;

View File

@@ -0,0 +1 @@
export declare function getFirstInvalidInput(baseId: string, target?: Element | null): HTMLFieldSetElement | HTMLInputElement | null;

1
node_modules/reakit/ts/Form/__utils/getInputId.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function getInputId(name: any, baseId: string | undefined, suffix?: string): string | undefined;

1
node_modules/reakit/ts/Form/__utils/getLabelId.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function getLabelId(name: any, baseId: string | undefined): string | undefined;

View File

@@ -0,0 +1 @@
export declare function getMessageId(name: any, baseId: string | undefined): string | undefined;

View File

@@ -0,0 +1 @@
export declare function getPushButtonId(name: any, baseId: string | undefined): string | undefined;

1
node_modules/reakit/ts/Form/__utils/hasMessages.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function hasMessages(errors: any): boolean;

View File

@@ -0,0 +1,2 @@
import { unstable_FormState } from "../FormState";
export declare function shouldShowError<V>({ touched, errors }: Pick<unstable_FormState<V>, "touched" | "errors">, name: any): boolean;

View File

@@ -0,0 +1,2 @@
import { unstable_FormState } from "../FormState";
export declare function shouldShowMessage<V>({ touched, messages }: Pick<unstable_FormState<V>, "touched" | "messages">, name: any): boolean;

71
node_modules/reakit/ts/Form/__utils/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,71 @@
/**
* Creates an array like object with specified length
* @template N Length
*/
export declare type ArrayWithLength<N extends number> = {
[K in N]: any;
};
/**
* ["foo", "bar", 0, "baz"]
* @template T Object with keys { foo: { bar: [{ baz }] } }
* @template P Path ["foo", "bar", 0, "baz"]
*/
export interface DeepPathArray<T, P> extends ReadonlyArray<any> {
["0"]?: keyof T;
["1"]?: P extends {
["0"]: infer K0;
} ? K0 extends keyof T ? keyof T[K0] : never : never;
["2"]?: P extends {
["0"]: infer K0;
["1"]: infer K1;
} ? K0 extends keyof T ? K1 extends keyof T[K0] ? keyof T[K0][K1] : never : never : never;
["3"]?: P extends {
["0"]: infer K0;
["1"]: infer K1;
["2"]: infer K2;
} ? K0 extends keyof T ? K1 extends keyof T[K0] ? K2 extends keyof T[K0][K1] ? keyof T[K0][K1][K2] : never : never : never : never;
["4"]?: P extends {
["0"]: infer K0;
["1"]: infer K1;
["2"]: infer K2;
["3"]: infer K3;
} ? K0 extends keyof T ? K1 extends keyof T[K0] ? K2 extends keyof T[K0][K1] ? K3 extends keyof T[K0][K1][K2] ? keyof T[K0][K1][K2][K3] : never : never : never : never : never;
["5"]?: P extends {
["0"]: infer K0;
["1"]: infer K1;
["2"]: infer K2;
["3"]: infer K3;
["4"]: infer K4;
} ? K0 extends keyof T ? K1 extends keyof T[K0] ? K2 extends keyof T[K0][K1] ? K3 extends keyof T[K0][K1][K2] ? K4 extends keyof T[K0][K1][K2][K3] ? keyof T[K0][K1][K2][K3][K4] : never : never : never : never : never : never;
}
/**
* Returns the value within T object based on given array path
* @template T Object with keys { foo: { bar: [{ baz }] } }
* @template P Path ["foo", "bar", 0, "baz"]
*/
export declare type DeepPathArrayValue<T, P extends DeepPathArray<T, P>> = P extends ArrayWithLength<0 | 1 | 2 | 3 | 4 | 5 | 6> ? any : P extends ArrayWithLength<0 | 1 | 2 | 3 | 4 | 5> ? T[P[0]][P[1]][P[2]][P[3]][P[4]][P[5]] : P extends ArrayWithLength<0 | 1 | 2 | 3 | 4> ? T[P[0]][P[1]][P[2]][P[3]][P[4]] : P extends ArrayWithLength<0 | 1 | 2 | 3> ? T[P[0]][P[1]][P[2]][P[3]] : P extends ArrayWithLength<0 | 1 | 2> ? T[P[0]][P[1]][P[2]] : P extends ArrayWithLength<0 | 1> ? T[P[0]][P[1]] : P extends ArrayWithLength<0> ? T[P[0]] : never;
/**
* DeepPath argument
* @template T Object with keys { foo: { bar: [{ baz }] } }
* @template P ["foo", "bar", 0, "baz"] or "foo"
*/
export declare type DeepPath<T, P> = DeepPathArray<T, P> | keyof T;
/**
* DeepPath return
* @template T Object with keys { foo: { bar: [{ baz }] } }
* @template P ["foo", "bar", 0, "baz"] or "foo"
*/
export declare type DeepPathValue<T, P extends DeepPath<T, P>> = P extends DeepPathArray<T, P> ? DeepPathArrayValue<T, P> : P extends keyof T ? T[P] : any;
/**
* @template T Object
* @template V Value
*/
export declare type DeepMap<T, V> = {
[K in keyof T]: T[K] extends Array<infer U> | undefined ? U extends object ? Array<DeepMap<U, V>> : object extends U ? Array<DeepMap<U, V>> : Array<V> : T[K] extends object ? DeepMap<T[K], V> : object extends T[K] ? DeepMap<T[K], V> : V;
};
/**
* @template T Object
*/
export declare type DeepPartial<T> = {
[P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : DeepPartial<T[P]>;
};

12
node_modules/reakit/ts/Form/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
export * from "./Form";
export * from "./FormCheckbox";
export * from "./FormGroup";
export * from "./FormInput";
export * from "./FormLabel";
export * from "./FormMessage";
export * from "./FormPushButton";
export * from "./FormRadio";
export * from "./FormRadioGroup";
export * from "./FormRemoveButton";
export * from "./FormState";
export * from "./FormSubmitButton";

3
node_modules/reakit/ts/Form/utils/getIn.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import { DeepPath, DeepPathValue } from "../__utils/types";
export declare function unstable_getIn<T extends Record<any, any>, P extends DeepPath<T, P>, D>(object: T, path: P, defaultValue: D): D;
export declare function unstable_getIn<T extends Record<any, any>, P extends DeepPath<T, P>>(object: T, path: P, defaultValue?: any): DeepPathValue<T, P> | undefined;

3
node_modules/reakit/ts/Form/utils/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export * from "./getIn";
export * from "./setAllIn";
export * from "./setIn";

2
node_modules/reakit/ts/Form/utils/setAllIn.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import { DeepMap } from "../__utils/types";
export declare function unstable_setAllIn<T, V>(object: T, value: V): DeepMap<T, V>;

2
node_modules/reakit/ts/Form/utils/setIn.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import { DeepPath } from "../__utils/types";
export declare function unstable_setIn<T extends Record<any, any> | Array<any>, P extends DeepPath<T, P>>(object: T, path: P, value: any): T;