Socket
Socket
Sign inDemoInstall

@formkit/core

Package Overview
Dependencies
Maintainers
2
Versions
465
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formkit/core - npm Package Compare versions

Comparing version 1.0.0-beta.2 to 1.0.0-beta.4

dist/index.cjs

144

dist/index.d.ts

@@ -96,2 +96,8 @@ /**

/**
* Error messages.
* @internal
*/
declare type ErrorMessages = string | string[] | Record<string, string | string[]>;
/**
* Describes the path to a particular node from the top of the tree.

@@ -268,2 +274,16 @@ * @public

/**
* The counter object used to perform instance counting within
* a tree.
* @public
*/
export declare interface FormKitCounter {
condition: FormKitCounterCondition;
count: number;
name: string;
node: FormKitNode;
promise: Promise<void>;
resolve: () => void;
}
/**
* Ledger counters require a condition function that determines if a given

@@ -273,3 +293,3 @@ * message applies to it or not.

*/
declare interface FormKitCounterCondition {
export declare interface FormKitCounterCondition {
(message: FormKitMessage): boolean;

@@ -335,5 +355,18 @@ }

[index: string]: unknown;
/**
* The current "live" value of the input. Not debounced.
*/
_value: any;
/**
* An object of attributes that (generally) should be applied to the root
* <input> element.
*/
attrs: Record<string, any>;
/**
* Classes to apply on the various sections.
*/
classes: Record<string, string>;
/**
* Event handlers.
*/
handlers: {

@@ -344,8 +377,34 @@ blur: () => void;

} & Record<string, (...args: any[]) => void>;
/**
* Utility functions, generally for use in the input’s schema.
*/
fns: Record<string, (...args: any[]) => any>;
/**
* The help text of the input.
*/
help?: string;
/**
* The unique id of the input. Should also be applied as the id attribute.
* This is generally required for accessibility reasons.
*/
id: string;
/**
* The label of the input.
*/
label?: string;
/**
* A list of messages to be displayed on the input. Often these are validation
* messages and error messages, but other `visible` core node messages do also
* apply here. This object is only populated when the validation should be
* actually displayed.
*/
messages: Record<string, FormKitMessage>;
/**
* The core node of this input.
*/
node: FormKitNode;
/**
* If this input type accepts options (like select lists and checkboxes) then
* this will be populated with a properly structured list of options.
*/
options?: Array<Record<string, any> & {

@@ -355,9 +414,66 @@ label: string;

}>;
/**
* A collection of state trackers/details about the input.
*/
state: Record<string, boolean | undefined> & {
/**
* If the input has been blurred.
*/
blurred: boolean;
/**
* True when these conditions are met:
*
* Either:
* - The input has validation rules
* - The validation rules are all passing
* - There are no errors on the input
* Or:
* - The input has no validation rules
* - The input has no errors
* - The input is dirty and has a value
*
* This is not intended to be used on forms/groups/lists but instead on
* individual inputs. Imagine placing a green checkbox next to each input
* when the user filled it out correctly — thats what these are for.
*/
complete: boolean;
/**
* If the input has had a value typed into it or a change made to it.
*/
dirty: boolean;
/**
* If the input has explicit errors placed on it, or in the case of a group,
* list, or form, this is true if any children have errors on them.
*/
errors: boolean;
/**
* True when the input has validation rules. Has nothing to do with the
* state of those validation rules.
*/
rules: boolean;
/**
* If the form has been submitted.
*/
submitted: boolean;
/**
* If the input (or group/form/list) is passing all validation rules. In
* the case of groups, forms, and lists this includes the validation state
* of all its children.
*/
valid: boolean;
/**
* If the validation-visibility has been satisfied and any validation
* messages should be displayed.
*/
validationVisible: boolean;
};
/**
* The type of input "text" or "select" (retrieved from node.props.type). This
* is not the core node type (input, group, or list).
*/
type: string;
/**
* The current committed value of the input. This is the value that should be
* used for most use cases.
*/
value: any;

@@ -649,2 +765,6 @@ }

/**
* Sets errors on the input, and optionally, and child inputs.
*/
setErrors: (localErrors: ErrorMessages, childErrors?: ErrorMessages) => void;
/**
* A promise that resolves when a node and its entire subtree is settled.

@@ -655,2 +775,6 @@ * In other words — all the inputs are done committing their values.

/**
* Triggers a submit event on the nearest form.
*/
submit: () => void;
/**
* A text or translation function that exposes a given string to the "text"

@@ -816,3 +940,3 @@ * hook — all text shown to users should be passed through this function

*/
declare interface FormKitSchemaProps {
export declare interface FormKitSchemaProps {
children?: string | FormKitSchemaNode[] | FormKitSchemaCondition;

@@ -1024,2 +1148,18 @@ key?: string;

/**
* Sets errors on a form, group, or input.
* @param formId - The id of a form
* @param localErrors - The errors to set on the form or the form’s inputs
* @param childErrors - (optional) The errors to set on the form or the form’s inputs
* @public
*/
export declare function setErrors(id: string, localErrors: ErrorMessages, childErrors?: ErrorMessages): void;
/**
* Submits a FormKit form programmatically.
* @param id - The id of the form
* @public
*/
export declare function submitForm(id: string): void;
/**
* Converts syntactic sugar nodes to standard nodes.

@@ -1026,0 +1166,0 @@ * @param node - A node to covert

30

package.json
{
"name": "@formkit/core",
"repository": "https://github.com/formkit/formkit",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.4",
"type": "module",
"description": "The framework agnostic core of FormKit",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"./*": "./dist/*"
},
"keywords": [
"vue",
"forms",
"inputs",
"validation"
],
"repository": {
"type": "git",
"url": "https://github.com/formkit/formkit.git",
"directory": "packages/core"
},
"types": "dist/index.d.ts",

@@ -16,7 +35,6 @@ "contributors": [

},
"type": "module",
"dependencies": {
"@formkit/utils": "1.0.0-beta.2"
"@formkit/utils": "1.0.0-beta.4"
},
"devDependencies": {}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc