form-builder-pro 1.3.7 → 1.3.9

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
@@ -744,11 +744,6 @@ body {
744
744
  /* Slider thumb (Firefox) */
745
745
  /* Slider track (Firefox) */
746
746
  /* Width value badge animation */
747
- .width-value-badge {
748
- min-width: 40px;
749
- text-align: center;
750
- transition: transform 0.1s ease, background-color 0.15s ease;
751
- }
752
747
  /* Preset buttons */
753
748
  /* Breakpoint markers */
754
749
  /* ===== PHONE ISD SELECTOR STYLES ===== */
@@ -942,6 +937,9 @@ body {
942
937
  .mt-2 {
943
938
  margin-top: 0.5rem;
944
939
  }
940
+ .mt-3 {
941
+ margin-top: 0.75rem;
942
+ }
945
943
  .mt-4 {
946
944
  margin-top: 1rem;
947
945
  }
@@ -1041,6 +1039,9 @@ body {
1041
1039
  .w-full {
1042
1040
  width: 100%;
1043
1041
  }
1042
+ .min-w-0 {
1043
+ min-width: 0px;
1044
+ }
1044
1045
  .max-w-2xl {
1045
1046
  max-width: 42rem;
1046
1047
  }
@@ -1141,6 +1142,11 @@ body {
1141
1142
  margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));
1142
1143
  margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));
1143
1144
  }
1145
+ .space-y-4 > :not([hidden]) ~ :not([hidden]) {
1146
+ --tw-space-y-reverse: 0;
1147
+ margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
1148
+ margin-bottom: calc(1rem * var(--tw-space-y-reverse));
1149
+ }
1144
1150
  .space-y-6 > :not([hidden]) ~ :not([hidden]) {
1145
1151
  --tw-space-y-reverse: 0;
1146
1152
  margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));
@@ -1184,6 +1190,9 @@ body {
1184
1190
  border-top-left-radius: var(--radius);
1185
1191
  border-top-right-radius: var(--radius);
1186
1192
  }
1193
+ .rounded-bl-md {
1194
+ border-bottom-left-radius: calc(var(--radius) - 2px);
1195
+ }
1187
1196
  .border {
1188
1197
  border-width: 1px;
1189
1198
  }
@@ -1196,6 +1205,9 @@ body {
1196
1205
  .border-l {
1197
1206
  border-left-width: 1px;
1198
1207
  }
1208
+ .border-l-2 {
1209
+ border-left-width: 2px;
1210
+ }
1199
1211
  .border-r {
1200
1212
  border-right-width: 1px;
1201
1213
  }
@@ -1208,6 +1220,9 @@ body {
1208
1220
  .border-dashed {
1209
1221
  border-style: dashed;
1210
1222
  }
1223
+ .border-\[\#635bff\]\/35 {
1224
+ border-color: rgb(99 91 255 / 0.35);
1225
+ }
1211
1226
  .border-\[\#e7e7ff\] {
1212
1227
  --tw-border-opacity: 1;
1213
1228
  border-color: rgb(231 231 255 / var(--tw-border-opacity, 1));
@@ -1381,12 +1396,24 @@ body {
1381
1396
  .pb-20 {
1382
1397
  padding-bottom: 5rem;
1383
1398
  }
1399
+ .pb-4 {
1400
+ padding-bottom: 1rem;
1401
+ }
1402
+ .pl-3 {
1403
+ padding-left: 0.75rem;
1404
+ }
1384
1405
  .pl-\[95px\] {
1385
1406
  padding-left: 95px;
1386
1407
  }
1408
+ .pt-0 {
1409
+ padding-top: 0px;
1410
+ }
1387
1411
  .pt-2 {
1388
1412
  padding-top: 0.5rem;
1389
1413
  }
1414
+ .pt-3 {
1415
+ padding-top: 0.75rem;
1416
+ }
1390
1417
  .text-center {
1391
1418
  text-align: center;
1392
1419
  }
@@ -1516,6 +1543,11 @@ body {
1516
1543
  .opacity-50 {
1517
1544
  opacity: 0.5;
1518
1545
  }
1546
+ .shadow-inner {
1547
+ --tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
1548
+ --tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);
1549
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1550
+ }
1519
1551
  .shadow-none {
1520
1552
  --tw-shadow: 0 0 #0000;
1521
1553
  --tw-shadow-colored: 0 0 #0000;
@@ -1536,13 +1568,13 @@ body {
1536
1568
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1537
1569
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
1538
1570
  }
1571
+ .ring-\[\#635bff\] {
1572
+ --tw-ring-opacity: 1;
1573
+ --tw-ring-color: rgb(99 91 255 / var(--tw-ring-opacity, 1));
1574
+ }
1539
1575
  .ring-offset-background {
1540
1576
  --tw-ring-offset-color: hsl(var(--background));
1541
1577
  }
1542
- .blur {
1543
- --tw-blur: blur(8px);
1544
- filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
1545
- }
1546
1578
  .filter {
1547
1579
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
1548
1580
  }
@@ -1936,6 +1968,10 @@ input[type="radio"]:checked::after {
1936
1968
  opacity: 0.7;
1937
1969
  }
1938
1970
 
1971
+ .dark\:border-\[\#635bff\]\/50:is(.dark *) {
1972
+ border-color: rgb(99 91 255 / 0.5);
1973
+ }
1974
+
1939
1975
  .dark\:border-gray-600:is(.dark *) {
1940
1976
  --tw-border-opacity: 1;
1941
1977
  border-color: rgb(75 85 99 / var(--tw-border-opacity, 1));
@@ -1970,6 +2006,10 @@ input[type="radio"]:checked::after {
1970
2006
  background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));
1971
2007
  }
1972
2008
 
2009
+ .dark\:bg-gray-800\/40:is(.dark *) {
2010
+ background-color: rgb(31 41 55 / 0.4);
2011
+ }
2012
+
1973
2013
  .dark\:bg-gray-800\/50:is(.dark *) {
1974
2014
  background-color: rgb(31 41 55 / 0.5);
1975
2015
  }
package/dist/index.d.mts CHANGED
@@ -64,6 +64,8 @@ interface AsyncOptionSource {
64
64
  labelKey: string;
65
65
  valueKey: string;
66
66
  }
67
+ /** Lookup (Entity Fields) — source category for optionSource LOOKUP */
68
+ type LookupSourceType = 'MODULE' | 'MASTER_TYPE' | 'SETTINGS';
67
69
  interface FormField {
68
70
  id: string;
69
71
  type: FieldType;
@@ -98,6 +100,8 @@ interface FormField {
98
100
  masterTypeName?: string;
99
101
  enabled?: boolean;
100
102
  visible?: boolean;
103
+ /** When true, host/backend may enforce uniqueness for this field’s value */
104
+ isUnique?: boolean;
101
105
  order?: number;
102
106
  css?: {
103
107
  class?: string;
@@ -107,7 +111,7 @@ interface FormField {
107
111
  multiselect?: boolean;
108
112
  multiSelect?: boolean;
109
113
  optionSource?: 'STATIC' | 'MASTER' | 'LOOKUP';
110
- lookupSourceType?: 'MODULE' | 'MASTER_TYPE';
114
+ lookupSourceType?: LookupSourceType;
111
115
  lookupSource?: string;
112
116
  lookupValueField?: string;
113
117
  lookupLabelField?: string;
@@ -152,6 +156,14 @@ interface ISDConfig {
152
156
  showCountryName: boolean;
153
157
  allowCustomCode: boolean;
154
158
  }
159
+ /** Group / section position on the form canvas (payload: groups[].position) */
160
+ interface GroupPosition {
161
+ row: number;
162
+ column: number;
163
+ /** Grid span 1–12 (group width on parent grid) */
164
+ width: number;
165
+ order: number;
166
+ }
155
167
  interface FormSection {
156
168
  id: string;
157
169
  title: string;
@@ -168,6 +180,20 @@ interface FormSection {
168
180
  class?: string;
169
181
  style?: Record<string, string>;
170
182
  };
183
+ /** API group name (payload groups[].name); mirrors title when set */
184
+ name?: string;
185
+ description?: string | null;
186
+ position?: GroupPosition;
187
+ /** Payload expanded (preferred); isExpanded kept for legacy */
188
+ expanded?: boolean;
189
+ visible?: boolean;
190
+ collapsible?: boolean;
191
+ parentGroupId?: string | null;
192
+ repeatable?: boolean;
193
+ dataKey?: string | null;
194
+ addButtonLabel?: string | null;
195
+ minInstances?: number | null;
196
+ maxInstances?: number | null;
171
197
  }
172
198
  interface FormSchema {
173
199
  id: string;
@@ -217,6 +243,12 @@ declare const FormSchemaValidation: z.ZodObject<{
217
243
  }[];
218
244
  }>;
219
245
 
246
+ /** Labels for Lookup Source Type (Entity Fields) — values are the API `sourceType` strings */
247
+ declare const LOOKUP_SOURCE_TYPE_OPTIONS: {
248
+ value: LookupSourceType;
249
+ label: string;
250
+ }[];
251
+
220
252
  interface MasterType {
221
253
  id: string;
222
254
  name: string;
@@ -228,6 +260,7 @@ interface MasterType {
228
260
  interface FormState {
229
261
  schema: FormSchema;
230
262
  selectedFieldId: string | null;
263
+ selectedSectionId: string | null;
231
264
  history: FormSchema[];
232
265
  historyIndex: number;
233
266
  isPreviewMode: boolean;
@@ -270,6 +303,7 @@ interface FormActions {
270
303
  removeField: (fieldId: string) => void;
271
304
  updateField: (fieldId: string, updates: Partial<FormField>) => void;
272
305
  selectField: (fieldId: string | null) => void;
306
+ selectSection: (sectionId: string | null) => void;
273
307
  moveField: (fieldId: string, targetSectionId: string | null, newIndex: number) => void;
274
308
  undo: () => void;
275
309
  redo: () => void;
@@ -304,6 +338,11 @@ interface FormBuilderOptions {
304
338
  }[];
305
339
  };
306
340
  moduleList?: string[];
341
+ /** Settings entity registry (sourceKey + display label) — same list the host uses for Legal Entities, Operating Units, User Groups, etc. */
342
+ settingsEntities?: {
343
+ label: string;
344
+ value: string;
345
+ }[];
307
346
  lookupFieldOptionsMap?: {
308
347
  [lookupSource: string]: string[];
309
348
  };
@@ -317,7 +356,7 @@ interface FormBuilderOptions {
317
356
  }) => void;
318
357
  onLookupSourceChange?: (event: {
319
358
  fieldId: string;
320
- lookupSourceType: 'MODULE' | 'MASTER_TYPE';
359
+ lookupSourceType: LookupSourceType;
321
360
  lookupSource: string;
322
361
  }) => void;
323
362
  onProfileClick?: () => void;
@@ -361,6 +400,15 @@ declare class FormBuilder {
361
400
  private renderImportList;
362
401
  private renderCanvas;
363
402
  private createCheckboxField;
403
+ /**
404
+ * Shared 1–12 grid span control (Field Settings + Group Settings).
405
+ */
406
+ private createGridSpanSelector;
407
+ /**
408
+ * Shared Styling block (Padding, Background, Alignment, CSS class, Advanced CSS) — same as Field Settings.
409
+ */
410
+ private appendSharedStylingSection;
411
+ private renderGroupSettingsPanel;
364
412
  private renderConfigPanel;
365
413
  private initSidebarSortables;
366
414
  }
@@ -400,7 +448,7 @@ declare const cleanFormSchema: (schema: any) => FormSchema;
400
448
  /**
401
449
  * Transforms Form Builder JSON to Platform JSON (standardized payload format)
402
450
  * @param builderSchema
403
- * @returns Standardized payload format
451
+ * @returns Standardized payload format (root `fields` + `groups` with fieldIds)
404
452
  */
405
453
  declare const builderToPlatform: (builderSchema: FormSchema) => any;
406
454
  /**
@@ -475,4 +523,4 @@ declare const initFormBuilder: (options: FormBuilderOptions & {
475
523
  containerId: string;
476
524
  }) => FormBuilder;
477
525
 
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 };
526
+ export { type AsyncOptionSource, type DateConstraint, type FieldType, type FieldValidations, type FieldWidth, FormBuilder, type FormBuilderOptions, type FormField, FormRenderer, type FormSchema, FormSchemaValidation, type FormSection, type GroupPosition, type ISDConfig, LOOKUP_SOURCE_TYPE_OPTIONS, type LookupSourceType, 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
@@ -64,6 +64,8 @@ interface AsyncOptionSource {
64
64
  labelKey: string;
65
65
  valueKey: string;
66
66
  }
67
+ /** Lookup (Entity Fields) — source category for optionSource LOOKUP */
68
+ type LookupSourceType = 'MODULE' | 'MASTER_TYPE' | 'SETTINGS';
67
69
  interface FormField {
68
70
  id: string;
69
71
  type: FieldType;
@@ -98,6 +100,8 @@ interface FormField {
98
100
  masterTypeName?: string;
99
101
  enabled?: boolean;
100
102
  visible?: boolean;
103
+ /** When true, host/backend may enforce uniqueness for this field’s value */
104
+ isUnique?: boolean;
101
105
  order?: number;
102
106
  css?: {
103
107
  class?: string;
@@ -107,7 +111,7 @@ interface FormField {
107
111
  multiselect?: boolean;
108
112
  multiSelect?: boolean;
109
113
  optionSource?: 'STATIC' | 'MASTER' | 'LOOKUP';
110
- lookupSourceType?: 'MODULE' | 'MASTER_TYPE';
114
+ lookupSourceType?: LookupSourceType;
111
115
  lookupSource?: string;
112
116
  lookupValueField?: string;
113
117
  lookupLabelField?: string;
@@ -152,6 +156,14 @@ interface ISDConfig {
152
156
  showCountryName: boolean;
153
157
  allowCustomCode: boolean;
154
158
  }
159
+ /** Group / section position on the form canvas (payload: groups[].position) */
160
+ interface GroupPosition {
161
+ row: number;
162
+ column: number;
163
+ /** Grid span 1–12 (group width on parent grid) */
164
+ width: number;
165
+ order: number;
166
+ }
155
167
  interface FormSection {
156
168
  id: string;
157
169
  title: string;
@@ -168,6 +180,20 @@ interface FormSection {
168
180
  class?: string;
169
181
  style?: Record<string, string>;
170
182
  };
183
+ /** API group name (payload groups[].name); mirrors title when set */
184
+ name?: string;
185
+ description?: string | null;
186
+ position?: GroupPosition;
187
+ /** Payload expanded (preferred); isExpanded kept for legacy */
188
+ expanded?: boolean;
189
+ visible?: boolean;
190
+ collapsible?: boolean;
191
+ parentGroupId?: string | null;
192
+ repeatable?: boolean;
193
+ dataKey?: string | null;
194
+ addButtonLabel?: string | null;
195
+ minInstances?: number | null;
196
+ maxInstances?: number | null;
171
197
  }
172
198
  interface FormSchema {
173
199
  id: string;
@@ -217,6 +243,12 @@ declare const FormSchemaValidation: z.ZodObject<{
217
243
  }[];
218
244
  }>;
219
245
 
246
+ /** Labels for Lookup Source Type (Entity Fields) — values are the API `sourceType` strings */
247
+ declare const LOOKUP_SOURCE_TYPE_OPTIONS: {
248
+ value: LookupSourceType;
249
+ label: string;
250
+ }[];
251
+
220
252
  interface MasterType {
221
253
  id: string;
222
254
  name: string;
@@ -228,6 +260,7 @@ interface MasterType {
228
260
  interface FormState {
229
261
  schema: FormSchema;
230
262
  selectedFieldId: string | null;
263
+ selectedSectionId: string | null;
231
264
  history: FormSchema[];
232
265
  historyIndex: number;
233
266
  isPreviewMode: boolean;
@@ -270,6 +303,7 @@ interface FormActions {
270
303
  removeField: (fieldId: string) => void;
271
304
  updateField: (fieldId: string, updates: Partial<FormField>) => void;
272
305
  selectField: (fieldId: string | null) => void;
306
+ selectSection: (sectionId: string | null) => void;
273
307
  moveField: (fieldId: string, targetSectionId: string | null, newIndex: number) => void;
274
308
  undo: () => void;
275
309
  redo: () => void;
@@ -304,6 +338,11 @@ interface FormBuilderOptions {
304
338
  }[];
305
339
  };
306
340
  moduleList?: string[];
341
+ /** Settings entity registry (sourceKey + display label) — same list the host uses for Legal Entities, Operating Units, User Groups, etc. */
342
+ settingsEntities?: {
343
+ label: string;
344
+ value: string;
345
+ }[];
307
346
  lookupFieldOptionsMap?: {
308
347
  [lookupSource: string]: string[];
309
348
  };
@@ -317,7 +356,7 @@ interface FormBuilderOptions {
317
356
  }) => void;
318
357
  onLookupSourceChange?: (event: {
319
358
  fieldId: string;
320
- lookupSourceType: 'MODULE' | 'MASTER_TYPE';
359
+ lookupSourceType: LookupSourceType;
321
360
  lookupSource: string;
322
361
  }) => void;
323
362
  onProfileClick?: () => void;
@@ -361,6 +400,15 @@ declare class FormBuilder {
361
400
  private renderImportList;
362
401
  private renderCanvas;
363
402
  private createCheckboxField;
403
+ /**
404
+ * Shared 1–12 grid span control (Field Settings + Group Settings).
405
+ */
406
+ private createGridSpanSelector;
407
+ /**
408
+ * Shared Styling block (Padding, Background, Alignment, CSS class, Advanced CSS) — same as Field Settings.
409
+ */
410
+ private appendSharedStylingSection;
411
+ private renderGroupSettingsPanel;
364
412
  private renderConfigPanel;
365
413
  private initSidebarSortables;
366
414
  }
@@ -400,7 +448,7 @@ declare const cleanFormSchema: (schema: any) => FormSchema;
400
448
  /**
401
449
  * Transforms Form Builder JSON to Platform JSON (standardized payload format)
402
450
  * @param builderSchema
403
- * @returns Standardized payload format
451
+ * @returns Standardized payload format (root `fields` + `groups` with fieldIds)
404
452
  */
405
453
  declare const builderToPlatform: (builderSchema: FormSchema) => any;
406
454
  /**
@@ -475,4 +523,4 @@ declare const initFormBuilder: (options: FormBuilderOptions & {
475
523
  containerId: string;
476
524
  }) => FormBuilder;
477
525
 
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 };
526
+ export { type AsyncOptionSource, type DateConstraint, type FieldType, type FieldValidations, type FieldWidth, FormBuilder, type FormBuilderOptions, type FormField, FormRenderer, type FormSchema, FormSchemaValidation, type FormSection, type GroupPosition, type ISDConfig, LOOKUP_SOURCE_TYPE_OPTIONS, type LookupSourceType, type MasterType, type NameGeneratorFormat, type ValidationObject, type ValidationRule, builderToPlatform, cleanFormSchema, convertValidationObjectToArray, detectCircularDependency, evaluateFormula, formStore, generateName, getColSpanFromWidth, getNumericFieldsForFormula, getValidationConfigForAngular, initFormBuilder, parseFormulaDependencies, parseWidth, platformToBuilder, resetNameGeneratorCounter, validateFormula };