form-builder-pro 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +8 -0
- package/dist/index.d.mts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +408 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +408 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1435,6 +1435,9 @@ body {
|
|
|
1435
1435
|
.lowercase {
|
|
1436
1436
|
text-transform: lowercase;
|
|
1437
1437
|
}
|
|
1438
|
+
.italic {
|
|
1439
|
+
font-style: italic;
|
|
1440
|
+
}
|
|
1438
1441
|
.leading-none {
|
|
1439
1442
|
line-height: 1;
|
|
1440
1443
|
}
|
|
@@ -2006,6 +2009,11 @@ input[type="radio"]:checked::after {
|
|
|
2006
2009
|
color: rgb(156 163 175 / var(--tw-text-opacity, 1));
|
|
2007
2010
|
}
|
|
2008
2011
|
|
|
2012
|
+
.dark\:text-gray-500:is(.dark *) {
|
|
2013
|
+
--tw-text-opacity: 1;
|
|
2014
|
+
color: rgb(107 114 128 / var(--tw-text-opacity, 1));
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2009
2017
|
.dark\:text-green-400:is(.dark *) {
|
|
2010
2018
|
--tw-text-opacity: 1;
|
|
2011
2019
|
color: rgb(74 222 128 / var(--tw-text-opacity, 1));
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as zustand_vanilla from 'zustand/vanilla';
|
|
3
3
|
|
|
4
|
-
type FieldType = 'text' | 'textarea' | 'number' | 'date' | 'select' | 'checkbox' | 'radio' | 'toggle' | 'binary_choice' | 'repeater' | 'file' | 'image' | 'email' | 'phone';
|
|
4
|
+
type FieldType = 'text' | 'textarea' | 'number' | 'date' | 'datetime' | 'select' | 'checkbox' | 'radio' | 'toggle' | 'binary_choice' | 'repeater' | 'file' | 'image' | 'email' | 'phone';
|
|
5
5
|
type FieldWidth = '25%' | '33%' | '50%' | '66%' | '75%' | '100%' | number;
|
|
6
6
|
declare function parseWidth(width: FieldWidth): number;
|
|
7
7
|
declare function getColSpanFromWidth(width: FieldWidth): string;
|
|
8
8
|
interface ValidationRule {
|
|
9
|
-
type: 'required' | 'min' | 'max' | 'minLength' | 'maxLength' | 'pattern' | 'email' | 'minDate' | 'maxDate' | 'minSelected' | 'maxSelected';
|
|
9
|
+
type: 'required' | 'min' | 'max' | 'minLength' | 'maxLength' | 'pattern' | 'email' | 'minDate' | 'maxDate' | 'minDateTime' | 'maxDateTime' | 'minSelected' | 'maxSelected';
|
|
10
10
|
value?: string | number | boolean;
|
|
11
11
|
message?: string;
|
|
12
12
|
regex?: string;
|
|
@@ -23,6 +23,8 @@ interface ValidationObject {
|
|
|
23
23
|
maxSelected?: number;
|
|
24
24
|
minDate?: string;
|
|
25
25
|
maxDate?: string;
|
|
26
|
+
minDateTime?: string;
|
|
27
|
+
maxDateTime?: string;
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
30
|
* Comprehensive validation configuration for form fields.
|
|
@@ -51,6 +53,8 @@ interface FieldValidations {
|
|
|
51
53
|
maxSelected?: number;
|
|
52
54
|
minDate?: string;
|
|
53
55
|
maxDate?: string;
|
|
56
|
+
minDateTime?: string;
|
|
57
|
+
maxDateTime?: string;
|
|
54
58
|
}
|
|
55
59
|
interface AsyncOptionSource {
|
|
56
60
|
api: string;
|
|
@@ -118,6 +122,17 @@ interface FormField {
|
|
|
118
122
|
showWhenValueOffFields?: string[];
|
|
119
123
|
repeatItemLabel?: string;
|
|
120
124
|
repeatIncrementEnabled?: boolean;
|
|
125
|
+
dateConstraints?: DateConstraint;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Conditional date constraint — evaluated at runtime against the current date or another field's value.
|
|
129
|
+
* Operators: LESS_THAN (<), LESS_THAN_EQUAL (<=), GREATER_THAN (>), GREATER_THAN_EQUAL (>=)
|
|
130
|
+
* compareWith: CURRENT_DATE uses system time; FIELD references another date/datetime field by fieldName or id.
|
|
131
|
+
*/
|
|
132
|
+
interface DateConstraint {
|
|
133
|
+
operator: 'LESS_THAN' | 'LESS_THAN_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_EQUAL';
|
|
134
|
+
compareWith: 'CURRENT_DATE' | 'FIELD';
|
|
135
|
+
fieldName?: string;
|
|
121
136
|
}
|
|
122
137
|
/**
|
|
123
138
|
* ISD (International Subscriber Dialing) configuration for phone fields
|
|
@@ -443,4 +458,4 @@ declare const initFormBuilder: (options: FormBuilderOptions & {
|
|
|
443
458
|
containerId: string;
|
|
444
459
|
}) => FormBuilder;
|
|
445
460
|
|
|
446
|
-
export { AsyncOptionSource, FieldType, FieldValidations, FieldWidth, FormBuilder, FormBuilderOptions, FormField, FormRenderer, FormSchema, FormSchemaValidation, FormSection, ISDConfig, MasterType, ValidationObject, ValidationRule, builderToPlatform, cleanFormSchema, convertValidationObjectToArray, detectCircularDependency, evaluateFormula, formStore, getColSpanFromWidth, getNumericFieldsForFormula, getValidationConfigForAngular, initFormBuilder, parseFormulaDependencies, parseWidth, platformToBuilder, validateFormula };
|
|
461
|
+
export { AsyncOptionSource, DateConstraint, FieldType, FieldValidations, FieldWidth, FormBuilder, FormBuilderOptions, FormField, FormRenderer, FormSchema, FormSchemaValidation, FormSection, ISDConfig, MasterType, ValidationObject, ValidationRule, builderToPlatform, cleanFormSchema, convertValidationObjectToArray, detectCircularDependency, evaluateFormula, formStore, getColSpanFromWidth, getNumericFieldsForFormula, getValidationConfigForAngular, initFormBuilder, parseFormulaDependencies, parseWidth, platformToBuilder, validateFormula };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as zustand_vanilla from 'zustand/vanilla';
|
|
3
3
|
|
|
4
|
-
type FieldType = 'text' | 'textarea' | 'number' | 'date' | 'select' | 'checkbox' | 'radio' | 'toggle' | 'binary_choice' | 'repeater' | 'file' | 'image' | 'email' | 'phone';
|
|
4
|
+
type FieldType = 'text' | 'textarea' | 'number' | 'date' | 'datetime' | 'select' | 'checkbox' | 'radio' | 'toggle' | 'binary_choice' | 'repeater' | 'file' | 'image' | 'email' | 'phone';
|
|
5
5
|
type FieldWidth = '25%' | '33%' | '50%' | '66%' | '75%' | '100%' | number;
|
|
6
6
|
declare function parseWidth(width: FieldWidth): number;
|
|
7
7
|
declare function getColSpanFromWidth(width: FieldWidth): string;
|
|
8
8
|
interface ValidationRule {
|
|
9
|
-
type: 'required' | 'min' | 'max' | 'minLength' | 'maxLength' | 'pattern' | 'email' | 'minDate' | 'maxDate' | 'minSelected' | 'maxSelected';
|
|
9
|
+
type: 'required' | 'min' | 'max' | 'minLength' | 'maxLength' | 'pattern' | 'email' | 'minDate' | 'maxDate' | 'minDateTime' | 'maxDateTime' | 'minSelected' | 'maxSelected';
|
|
10
10
|
value?: string | number | boolean;
|
|
11
11
|
message?: string;
|
|
12
12
|
regex?: string;
|
|
@@ -23,6 +23,8 @@ interface ValidationObject {
|
|
|
23
23
|
maxSelected?: number;
|
|
24
24
|
minDate?: string;
|
|
25
25
|
maxDate?: string;
|
|
26
|
+
minDateTime?: string;
|
|
27
|
+
maxDateTime?: string;
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
30
|
* Comprehensive validation configuration for form fields.
|
|
@@ -51,6 +53,8 @@ interface FieldValidations {
|
|
|
51
53
|
maxSelected?: number;
|
|
52
54
|
minDate?: string;
|
|
53
55
|
maxDate?: string;
|
|
56
|
+
minDateTime?: string;
|
|
57
|
+
maxDateTime?: string;
|
|
54
58
|
}
|
|
55
59
|
interface AsyncOptionSource {
|
|
56
60
|
api: string;
|
|
@@ -118,6 +122,17 @@ interface FormField {
|
|
|
118
122
|
showWhenValueOffFields?: string[];
|
|
119
123
|
repeatItemLabel?: string;
|
|
120
124
|
repeatIncrementEnabled?: boolean;
|
|
125
|
+
dateConstraints?: DateConstraint;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Conditional date constraint — evaluated at runtime against the current date or another field's value.
|
|
129
|
+
* Operators: LESS_THAN (<), LESS_THAN_EQUAL (<=), GREATER_THAN (>), GREATER_THAN_EQUAL (>=)
|
|
130
|
+
* compareWith: CURRENT_DATE uses system time; FIELD references another date/datetime field by fieldName or id.
|
|
131
|
+
*/
|
|
132
|
+
interface DateConstraint {
|
|
133
|
+
operator: 'LESS_THAN' | 'LESS_THAN_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_EQUAL';
|
|
134
|
+
compareWith: 'CURRENT_DATE' | 'FIELD';
|
|
135
|
+
fieldName?: string;
|
|
121
136
|
}
|
|
122
137
|
/**
|
|
123
138
|
* ISD (International Subscriber Dialing) configuration for phone fields
|
|
@@ -443,4 +458,4 @@ declare const initFormBuilder: (options: FormBuilderOptions & {
|
|
|
443
458
|
containerId: string;
|
|
444
459
|
}) => FormBuilder;
|
|
445
460
|
|
|
446
|
-
export { AsyncOptionSource, FieldType, FieldValidations, FieldWidth, FormBuilder, FormBuilderOptions, FormField, FormRenderer, FormSchema, FormSchemaValidation, FormSection, ISDConfig, MasterType, ValidationObject, ValidationRule, builderToPlatform, cleanFormSchema, convertValidationObjectToArray, detectCircularDependency, evaluateFormula, formStore, getColSpanFromWidth, getNumericFieldsForFormula, getValidationConfigForAngular, initFormBuilder, parseFormulaDependencies, parseWidth, platformToBuilder, validateFormula };
|
|
461
|
+
export { AsyncOptionSource, DateConstraint, FieldType, FieldValidations, FieldWidth, FormBuilder, FormBuilderOptions, FormField, FormRenderer, FormSchema, FormSchemaValidation, FormSection, ISDConfig, MasterType, ValidationObject, ValidationRule, builderToPlatform, cleanFormSchema, convertValidationObjectToArray, detectCircularDependency, evaluateFormula, formStore, getColSpanFromWidth, getNumericFieldsForFormula, getValidationConfigForAngular, initFormBuilder, parseFormulaDependencies, parseWidth, platformToBuilder, validateFormula };
|