form-builder-pro 1.3.6 → 1.3.7

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 CHANGED
@@ -105,7 +105,7 @@
105
105
  --tw-contain-paint: ;
106
106
  --tw-contain-style: ;
107
107
  }/*
108
- ! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com
108
+ ! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
109
109
  *//*
110
110
  1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
111
111
  2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
package/dist/index.d.mts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import * as zustand_vanilla from 'zustand/vanilla';
3
3
 
4
- type FieldType = 'text' | 'textarea' | 'number' | 'date' | 'datetime' | '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' | 'name_generator';
5
+ /** Name generator format options for name_generator field type */
6
+ type NameGeneratorFormat = 'TEXT_HYPHEN_ID' | 'TEXT_UNDERSCORE_ID' | 'TEXT_SLASH_ID' | 'TEXT_ID' | 'ID_HYPHEN_TEXT' | 'ID_UNDERSCORE_TEXT' | 'TEXT_YEAR_ID' | 'TEXT_MONTH_ID' | 'TEXT_YEAR_MONTH_ID' | 'TEXT_ACCOUNT_CODE_ID' | 'TEXT_BRANCH_ID' | 'PREFIX_TEXT_ID' | 'TEXT_ID_SUFFIX' | 'TEXT_RANDOM_4' | 'TEXT_YEAR_MONTH_DAY_ID' | 'TEXT_HYPHEN_USER_INPUT' | 'TEXT_UNDERSCORE_USER_INPUT' | 'TEXT_SLASH_USER_INPUT' | 'USER_INPUT_HYPHEN_TEXT' | 'USER_INPUT_UNDERSCORE_TEXT';
5
7
  type FieldWidth = '25%' | '33%' | '50%' | '66%' | '75%' | '100%' | number;
6
8
  declare function parseWidth(width: FieldWidth): number;
7
9
  declare function getColSpanFromWidth(width: FieldWidth): string;
@@ -109,6 +111,7 @@ interface FormField {
109
111
  lookupSource?: string;
110
112
  lookupValueField?: string;
111
113
  lookupLabelField?: string;
114
+ lookupParentFieldName?: string | null;
112
115
  isd?: ISDConfig;
113
116
  imageUrl?: string;
114
117
  valueSource?: 'manual' | 'formula';
@@ -123,6 +126,11 @@ interface FormField {
123
126
  repeatItemLabel?: string;
124
127
  repeatIncrementEnabled?: boolean;
125
128
  dateConstraints?: DateConstraint;
129
+ nameGeneratorFormat?: NameGeneratorFormat;
130
+ nameGeneratorText?: string;
131
+ nameGeneratorPrefix?: string;
132
+ nameGeneratorSuffix?: string;
133
+ nameGeneratorIdPadding?: number;
126
134
  }
127
135
  /**
128
136
  * Conditional date constraint — evaluated at runtime against the current date or another field's value.
@@ -454,8 +462,17 @@ declare function getNumericFieldsForFormula(schema: FormSchema, excludeFieldId?:
454
462
  label: string;
455
463
  }[];
456
464
 
465
+ /** Reset counter (for testing or new form load) */
466
+ declare function resetNameGeneratorCounter(): void;
467
+ /**
468
+ * Generate a name based on field configuration.
469
+ * Uses format, prefix, suffix, static text, and padded ID.
470
+ * For USER_INPUT formats, uses empty string as placeholder (caller should pass userInput).
471
+ */
472
+ declare function generateName(fieldConfig: Pick<FormField, 'nameGeneratorFormat' | 'nameGeneratorText' | 'nameGeneratorPrefix' | 'nameGeneratorSuffix' | 'nameGeneratorIdPadding'>, userInput?: string): string;
473
+
457
474
  declare const initFormBuilder: (options: FormBuilderOptions & {
458
475
  containerId: string;
459
476
  }) => FormBuilder;
460
477
 
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 };
478
+ export { type AsyncOptionSource, type DateConstraint, type FieldType, type FieldValidations, type FieldWidth, FormBuilder, type FormBuilderOptions, type FormField, FormRenderer, type FormSchema, FormSchemaValidation, type FormSection, type ISDConfig, type MasterType, type NameGeneratorFormat, type ValidationObject, type ValidationRule, builderToPlatform, cleanFormSchema, convertValidationObjectToArray, detectCircularDependency, evaluateFormula, formStore, generateName, getColSpanFromWidth, getNumericFieldsForFormula, getValidationConfigForAngular, initFormBuilder, parseFormulaDependencies, parseWidth, platformToBuilder, resetNameGeneratorCounter, validateFormula };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import * as zustand_vanilla from 'zustand/vanilla';
3
3
 
4
- type FieldType = 'text' | 'textarea' | 'number' | 'date' | 'datetime' | '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' | 'name_generator';
5
+ /** Name generator format options for name_generator field type */
6
+ type NameGeneratorFormat = 'TEXT_HYPHEN_ID' | 'TEXT_UNDERSCORE_ID' | 'TEXT_SLASH_ID' | 'TEXT_ID' | 'ID_HYPHEN_TEXT' | 'ID_UNDERSCORE_TEXT' | 'TEXT_YEAR_ID' | 'TEXT_MONTH_ID' | 'TEXT_YEAR_MONTH_ID' | 'TEXT_ACCOUNT_CODE_ID' | 'TEXT_BRANCH_ID' | 'PREFIX_TEXT_ID' | 'TEXT_ID_SUFFIX' | 'TEXT_RANDOM_4' | 'TEXT_YEAR_MONTH_DAY_ID' | 'TEXT_HYPHEN_USER_INPUT' | 'TEXT_UNDERSCORE_USER_INPUT' | 'TEXT_SLASH_USER_INPUT' | 'USER_INPUT_HYPHEN_TEXT' | 'USER_INPUT_UNDERSCORE_TEXT';
5
7
  type FieldWidth = '25%' | '33%' | '50%' | '66%' | '75%' | '100%' | number;
6
8
  declare function parseWidth(width: FieldWidth): number;
7
9
  declare function getColSpanFromWidth(width: FieldWidth): string;
@@ -109,6 +111,7 @@ interface FormField {
109
111
  lookupSource?: string;
110
112
  lookupValueField?: string;
111
113
  lookupLabelField?: string;
114
+ lookupParentFieldName?: string | null;
112
115
  isd?: ISDConfig;
113
116
  imageUrl?: string;
114
117
  valueSource?: 'manual' | 'formula';
@@ -123,6 +126,11 @@ interface FormField {
123
126
  repeatItemLabel?: string;
124
127
  repeatIncrementEnabled?: boolean;
125
128
  dateConstraints?: DateConstraint;
129
+ nameGeneratorFormat?: NameGeneratorFormat;
130
+ nameGeneratorText?: string;
131
+ nameGeneratorPrefix?: string;
132
+ nameGeneratorSuffix?: string;
133
+ nameGeneratorIdPadding?: number;
126
134
  }
127
135
  /**
128
136
  * Conditional date constraint — evaluated at runtime against the current date or another field's value.
@@ -454,8 +462,17 @@ declare function getNumericFieldsForFormula(schema: FormSchema, excludeFieldId?:
454
462
  label: string;
455
463
  }[];
456
464
 
465
+ /** Reset counter (for testing or new form load) */
466
+ declare function resetNameGeneratorCounter(): void;
467
+ /**
468
+ * Generate a name based on field configuration.
469
+ * Uses format, prefix, suffix, static text, and padded ID.
470
+ * For USER_INPUT formats, uses empty string as placeholder (caller should pass userInput).
471
+ */
472
+ declare function generateName(fieldConfig: Pick<FormField, 'nameGeneratorFormat' | 'nameGeneratorText' | 'nameGeneratorPrefix' | 'nameGeneratorSuffix' | 'nameGeneratorIdPadding'>, userInput?: string): string;
473
+
457
474
  declare const initFormBuilder: (options: FormBuilderOptions & {
458
475
  containerId: string;
459
476
  }) => FormBuilder;
460
477
 
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 };
478
+ export { type AsyncOptionSource, type DateConstraint, type FieldType, type FieldValidations, type FieldWidth, FormBuilder, type FormBuilderOptions, type FormField, FormRenderer, type FormSchema, FormSchemaValidation, type FormSection, type ISDConfig, type MasterType, type NameGeneratorFormat, type ValidationObject, type ValidationRule, builderToPlatform, cleanFormSchema, convertValidationObjectToArray, detectCircularDependency, evaluateFormula, formStore, generateName, getColSpanFromWidth, getNumericFieldsForFormula, getValidationConfigForAngular, initFormBuilder, parseFormulaDependencies, parseWidth, platformToBuilder, resetNameGeneratorCounter, validateFormula };