@formkit/inputs
Advanced tools
Comparing version 1.5.0-54a1993 to 1.5.0-5d72fc3
@@ -19,8 +19,8 @@ /** | ||
import { FormKitPlugin } from '@formkit/core'; | ||
import { FormKitSchemaAttributes as FormKitSchemaAttributes_2 } from '@formkit/core'; | ||
import { FormKitSchemaComponent as FormKitSchemaComponent_2 } from '@formkit/core'; | ||
import { FormKitSchemaCondition as FormKitSchemaCondition_2 } from '@formkit/core'; | ||
import { FormKitSchemaAttributes } from '@formkit/core'; | ||
import { FormKitSchemaComponent } from '@formkit/core'; | ||
import { FormKitSchemaCondition } from '@formkit/core'; | ||
import { FormKitSchemaDefinition } from '@formkit/core'; | ||
import { FormKitSchemaDOMNode as FormKitSchemaDOMNode_2 } from '@formkit/core'; | ||
import { FormKitSchemaFormKit as FormKitSchemaFormKit_2 } from '@formkit/core'; | ||
import { FormKitSchemaDOMNode } from '@formkit/core'; | ||
import { FormKitSchemaFormKit } from '@formkit/core'; | ||
import { FormKitSchemaNode } from '@formkit/core'; | ||
@@ -42,3 +42,3 @@ import { FormKitSectionsSchema } from '@formkit/core'; | ||
*/ | ||
export declare function $attrs(attrs: FormKitSchemaAttributes_2 | (() => FormKitSchemaAttributes_2), section: FormKitSchemaExtendableSection): FormKitSchemaExtendableSection; | ||
export declare function $attrs(attrs: FormKitSchemaAttributes | (() => FormKitSchemaAttributes), section: FormKitSchemaExtendableSection): FormKitSchemaExtendableSection; | ||
@@ -279,3 +279,3 @@ /** | ||
* Runs a callback over every section in a schema. if stopOnCallbackReturn is true | ||
* and the callback returns a value, the loop will stop and return that value. | ||
* and the callback returns a value, the iteration will stop and return that value. | ||
* | ||
@@ -291,3 +291,3 @@ * @param schema - A {@link @formkit/core#FormKitSchemaNode | FormKitSchemaNode} array. | ||
*/ | ||
export declare function eachSection<T>(schema: FormKitSchemaDefinition, callback: (section: FormKitSchemaComponent_2 | FormKitSchemaDOMNode_2, schemaParent: FormKitSchemaNode[], schema: FormKitSchemaCondition_2) => T, stopOnCallbackReturn?: boolean, schemaParent?: FormKitSchemaNode[]): T | void; | ||
export declare function eachSection<T>(schema: FormKitSchemaNode[] | FormKitSchemaNode, callback: (section: FormKitSchemaComponent | FormKitSchemaDOMNode, sectionConditional: FormKitSchemaCondition, sectionParent: FormKitSchemaNode[] | FormKitSchemaCondition | undefined) => T, stopOnCallbackReturn?: boolean, schemaParent?: FormKitSchemaNode[] | FormKitSchemaCondition): T | void; | ||
@@ -365,3 +365,3 @@ /** | ||
/** | ||
* Finds a seciton by name in a schema. | ||
* Finds a section by name in a schema. | ||
* | ||
@@ -375,3 +375,6 @@ * @param schema - A {@link @formkit/core#FormKitSchemaDefinition | FormKitSchemaDefinition} array. | ||
*/ | ||
export declare function findSection(schema: FormKitSchemaDefinition, target: string): [false, false] | [FormKitSchemaNode[] | false, FormKitSchemaCondition_2]; | ||
export declare function findSection(schema: FormKitSchemaDefinition, target: string): [false, false] | [ | ||
FormKitSchemaNode[] | FormKitSchemaCondition | false | undefined, | ||
FormKitSchemaCondition | ||
]; | ||
@@ -392,15 +395,2 @@ /** | ||
/** | ||
* The possible value types of attributes (in the schema). | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitAttributeValue = | ||
| string | ||
| number | ||
| boolean | ||
| undefined | ||
| FormKitSchemaAttributes | ||
| FormKitSchemaAttributesCondition | ||
/** | ||
* General input events available to all FormKit inputs. | ||
@@ -858,24 +848,6 @@ * @public | ||
/** | ||
* A full loop statement in tuple syntax. Can be read like "foreach value, key? in list". | ||
* Option groups should always be formatted as an array of objects with group and nested options | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitListStatement = | ||
| [value: any, key: number | string, list: FormKitListValue] | ||
| [value: any, list: FormKitListValue] | ||
/** | ||
* The value being listed out. Can be an array, an object, or a number. | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitListValue = | ||
| string | ||
| Record<string, any> | ||
| Array<string | number | Record<string, any>> | ||
| number | ||
/** | ||
* Option groups should always be formatted as an array of objects with group and nested options | ||
*/ | ||
export declare interface FormKitOptionsGroupItem { | ||
@@ -889,2 +861,4 @@ group: string; | ||
* Option groups should always be formatted as an array of objects with group and nested options | ||
* | ||
* @public | ||
*/ | ||
@@ -930,2 +904,4 @@ export declare interface FormKitOptionsGroupItemProp { | ||
* groups can be any valid FormKitOptionsProp type. | ||
* | ||
* @public | ||
*/ | ||
@@ -1059,56 +1035,2 @@ export declare type FormKitOptionsListWithGroupsProp = Array<FormKitOptionsItem | FormKitOptionsGroupItemProp>; | ||
/** | ||
* DOM attributes are simple string dictionaries. | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitSchemaAttributes = | ||
| { | ||
[index: string]: FormKitAttributeValue | ||
} | ||
| null | ||
| FormKitSchemaAttributesCondition | ||
/** | ||
* Conditions nested inside attribute declarations. | ||
* | ||
* @public | ||
*/ | ||
declare interface FormKitSchemaAttributesCondition { | ||
if: string | ||
then: FormKitAttributeValue | ||
else?: FormKitAttributeValue | ||
} | ||
/** | ||
* Properties available when defining a generic non-FormKit component. | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitSchemaComponent = { | ||
$cmp: string | ||
props?: Record<string, any> | ||
} & FormKitSchemaProps | ||
/** | ||
* A schema node that determines _which_ content to render. | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitSchemaCondition = { | ||
if: string | ||
then: FormKitSchemaNode_2 | FormKitSchemaNode_2[] | ||
else?: FormKitSchemaNode_2 | FormKitSchemaNode_2[] | ||
} | ||
/** | ||
* Properties available when using a DOM node. | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitSchemaDOMNode = { | ||
$el: string | null | ||
attrs?: FormKitSchemaAttributes | ||
} & FormKitSchemaProps | ||
/** | ||
* A function that is called with an extensions argument and returns a valid | ||
@@ -1125,62 +1047,28 @@ * schema node. | ||
/** | ||
* Syntactic sugar for a FormKitSchemaComponent node that uses FormKit. | ||
* A type narrowed type that represents a formkit schema "section". These are | ||
* always in the shape: | ||
* ```js | ||
* { | ||
* if: string, | ||
* then: '$slots.sectionName', | ||
* else: { | ||
* meta: { | ||
* section: 'sectionName' | ||
* }, | ||
* $el: 'div' // or $cmp... | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitSchemaFormKit = { | ||
$formkit: string | ||
} & Record<string, any> & | ||
FormKitSchemaProps | ||
export declare type FormKitSchemaSection = FormKitSchemaCondition & { | ||
else: FormKitSchemaDOMNode | (FormKitSchemaComponent & { | ||
meta: { | ||
section: string; | ||
}; | ||
}); | ||
}; | ||
/** | ||
* Meta attributes are not used when parsing the schema, but can be used to | ||
* create tooling. | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitSchemaMeta = { | ||
[key: string]: | ||
| string | ||
| number | ||
| boolean | ||
| undefined | ||
| null | ||
| CallableFunction | ||
| FormKitSchemaMeta | ||
} | ||
/** | ||
* Properties available then defining a schema node. | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitSchemaNode_2 = | ||
| FormKitSchemaDOMNode | ||
| FormKitSchemaComponent | ||
| FormKitSchemaTextNode | ||
| FormKitSchemaCondition | ||
| FormKitSchemaFormKit | ||
/** | ||
* Properties available in all schema nodes. | ||
* | ||
* @public | ||
*/ | ||
declare interface FormKitSchemaProps { | ||
children?: string | FormKitSchemaNode_2[] | FormKitSchemaCondition | ||
key?: string | ||
if?: string | ||
for?: FormKitListStatement | ||
bind?: string | ||
meta?: FormKitSchemaMeta | ||
} | ||
/** | ||
* A simple text node. | ||
* | ||
* @public | ||
*/ | ||
declare type FormKitSchemaTextNode = string | ||
/** | ||
* A function that when called, returns a function that can in turn be called | ||
@@ -1330,2 +1218,4 @@ * with an extension parameter. | ||
* @param option - An option | ||
* | ||
* @public | ||
*/ | ||
@@ -1344,3 +1234,3 @@ export declare function isGroupOption(option: FormKitOptionsItem | FormKitOptionsGroupItem | FormKitOptionsGroupItemProp): option is FormKitOptionsGroupItem; | ||
*/ | ||
export declare function isSchemaObject(schema: Partial<FormKitSchemaNode> | null): schema is FormKitSchemaDOMNode_2 | FormKitSchemaComponent_2 | FormKitSchemaFormKit_2; | ||
export declare function isSchemaObject(schema: Partial<FormKitSchemaNode> | null): schema is FormKitSchemaDOMNode | FormKitSchemaComponent | FormKitSchemaFormKit; | ||
@@ -1556,2 +1446,4 @@ /** | ||
* @returns | ||
* | ||
* @public | ||
*/ | ||
@@ -1558,0 +1450,0 @@ export declare function renamesRadios(node: FormKitNode): void; |
{ | ||
"name": "@formkit/inputs", | ||
"type": "module", | ||
"version": "1.5.0-54a1993", | ||
"version": "1.5.0-5d72fc3", | ||
"description": "Commonly shared types for FormKit", | ||
@@ -34,4 +34,4 @@ "main": "dist/index.cjs", | ||
"dependencies": { | ||
"@formkit/core": "1.5.0-54a1993", | ||
"@formkit/utils": "1.5.0-54a1993" | ||
"@formkit/core": "1.5.0-5d72fc3", | ||
"@formkit/utils": "1.5.0-5d72fc3" | ||
}, | ||
@@ -38,0 +38,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
253323
8769
+ Added@formkit/core@1.5.0-5d72fc3(transitive)
+ Added@formkit/utils@1.5.0-5d72fc3(transitive)
- Removed@formkit/core@1.5.0-54a1993(transitive)
- Removed@formkit/utils@1.5.0-54a1993(transitive)
Updated@formkit/core@1.5.0-5d72fc3
Updated@formkit/utils@1.5.0-5d72fc3