cft-builder 0.2.11 → 0.2.12

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.
Files changed (2) hide show
  1. package/dist/types/index.d.ts +15 -603
  2. package/package.json +1 -1
@@ -1,607 +1,19 @@
1
- /// <reference types="vite/client" />
2
- /// <reference types="vite-plugin-svgr/client" />
3
-
4
- import { FC, SVGProps } from "react";
5
-
6
- declare module "*.css" {}
7
- declare module "*.scss" {}
8
- declare module "*.sass" {}
9
- declare module "*.less" {}
10
- declare module "*.styl" {}
11
- declare module "*.stylus" {}
12
- declare module "*.pcss" {}
13
- declare module "*.sss" {}
14
- declare namespace NodeJS {
15
- interface ProcessEnv {
16
- readonly NODE_ENV: "development" | "production" | "test";
17
- readonly PUBLIC_URL: string;
1
+ declare module "cft-builder" {
2
+ import { ReactNode } from "react";
3
+
4
+ // Define types for CFTRenderProvider and RenderBuilder
5
+ export interface CFTRenderProviderProps {
6
+ children: ReactNode;
7
+ config: Record<string, any>;
8
+ // Add any other props that CFTRenderProvider takes
18
9
  }
19
- }
20
- declare module "*.png";
21
-
22
- declare module "*.avif" {
23
- const src: string;
24
- export default src;
25
- }
26
-
27
- declare module "*.bmp" {
28
- const src: string;
29
- export default src;
30
- }
31
-
32
- declare module "*.gif" {
33
- const src: string;
34
- export default src;
35
- }
36
-
37
- declare module "*.jpg" {
38
- const src: string;
39
- export default src;
40
- }
41
-
42
- declare module "*.jpeg" {
43
- const src: string;
44
- export default src;
45
- }
46
-
47
- declare module "*.png" {
48
- const src: string;
49
- export default src;
50
- }
51
-
52
- declare module "*.webp" {
53
- const src: string;
54
- export default src;
55
- }
56
-
57
- declare module "*.svg" {
58
- import * as React from "react";
59
-
60
- export const ReactComponent: React.FunctionComponent<
61
- React.SVGProps<SVGSVGElement> & { title?: string }
62
- >;
63
-
64
- const src: string;
65
- export default src;
66
- }
67
-
68
- declare module "*.module.css" {
69
- const classes: { readonly [key: string]: string };
70
- export default classes;
71
- }
72
-
73
- declare module "*.module.scss" {
74
- const classes: { readonly [key: string]: string };
75
- export default classes;
76
- }
77
-
78
- declare module "*.module.sass" {
79
- const classes: { readonly [key: string]: string };
80
- export default classes;
81
- }
82
-
83
- declare module "*.png";
84
- declare module "*.jpeg";
85
- declare module "*.jpg";
86
- declare module "*.svg" {
87
- const content: FC<SVGProps<SVGElement>>;
88
- export default content;
89
- }
90
-
91
- type FormData = {
92
- name: string;
93
- email: string;
94
- password?: string;
95
- date?: Date;
96
- country?: string;
97
- accept?: boolean;
98
- };
99
- interface UserState {
100
- userName: string;
101
- jwtToken: string;
102
- isLoggedIn: boolean;
103
- metaData?: object;
104
- displayName?: string;
105
- email: string;
106
- phoneNumber?: string;
107
- photoURL?: string;
108
- providerId?: string;
109
- userId: string;
110
- uid?: string;
111
- loading?: boolean;
112
- error?: string | null;
113
- accessToken?: string | null;
114
- success?: boolean | string;
115
- profile_img_url?: string;
116
- userDetails?: object;
117
- }
118
10
 
119
- type UserAction = {
120
- type: string;
121
- userInfo: UserState;
122
- };
123
- type UserLogOut = {
124
- type: string;
125
- };
126
- interface FormCompProps {
127
- onSubmit?: () => void;
128
- btnLabel?: string;
129
- children?: any;
130
- classes?: string;
131
- btnDisable?: boolean;
132
- isLoading?: boolean;
133
- formTitle?: string;
134
- }
135
- interface InputCompProps {
136
- label?: string;
137
- type?: string;
138
- placeholder?: string;
139
- inputName?: string;
140
- required?: boolean;
141
- error?: boolean;
142
- className?: string;
143
- value?: string;
144
- defaultValue?: string;
145
- accept?: string;
146
- disabled?: boolean;
147
- pattern?: string;
148
- title?: string;
149
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
150
- }
151
- interface RouteData {
152
- path: string;
153
- label: string | boolean;
154
- component: FC;
155
- isPrivate?: boolean;
156
- exact?: boolean;
157
- routes?: AllRoutes;
158
- hasAccess?: boolean;
159
- }
160
- type AllRoutes = RouteData[];
11
+ export const CFTRenderProvider: React.FC<CFTRenderProviderProps>;
161
12
 
162
- type DispatchType = (args: any) => void;
163
- interface IndexType {
164
- productIndex?: number;
165
- versionIndex?: number;
166
- sequenceIndex?: number;
167
- }
168
-
169
- // styles
170
- interface ContainerType {
171
- mAuto?: string;
172
- }
173
- type EffectCallback = () => void | (() => void | undefined);
174
-
175
- type Header = { headerKey: string; headerValue: string };
176
- interface Params {
177
- isVersion?: boolean;
178
- data?: any;
179
- cb?: () => void;
180
- }
181
-
182
- type UserHolidayApprovalViewProp = {
183
- userHolidayId: number;
184
- showApprovalSidebar: (status: boolean) => void;
185
- taskId?: number;
186
- };
187
-
188
- export type ElementsBasedOnFormTypes = {
189
- key?: string | null;
190
- };
191
- export interface BuilderItemsProps {
192
- elementsBasedOnFormTypes?: ElementsBasedOnFormTypes;
193
- }
194
- interface MultiLanguageInterface {
195
- [language: string]: string ;
196
-
197
- }
198
- interface Language {
199
- key: number;
200
- language: string;
201
- type: any;
202
- english?:string
203
-
204
- }
205
-
206
- interface Option {
207
- uuid: string;
208
- optionText?: MultiLanguageInterface; // Temporary solution to fix linters. Need to ask meer
209
- value?: any;
210
- score?: number;
211
- hyperlinkText?: string;
212
- abbreviationText?: Language;
213
- custom_values?: Language | any;
214
- className?: string;
215
- titleClassName?: string;
216
- togglerClassName?: string;
217
- label?:anystring;
218
- enableConditionalField?:any;
219
- children?: [];
220
-
221
- }
222
- type Options = Option[];
223
- interface AnswerOption {
224
- [key: string]: MultiLanguageInterface;
225
- uuid?: string;
226
- answersText: MultiLanguageInterface;
227
- answersTextImage?: MultiLanguageInterface;
228
- isCorrect?: boolean;
229
- isCorrectAnswer?:boolean;
230
- }
231
-
232
- interface Field {
233
- uuid?: string;
234
- rowId?: string;
235
- value?: string;
236
- isCorrect?: boolean;
237
- dataKey?: string;
238
- inlineConditionalRules?: any;
239
- isPostField?: boolean;
240
- conditionalTabRules?: any;
241
- conditionalSectionRules?: any;
242
- reviewerChecklist?: any;
243
- componentType?: string;
244
- label: MultiLanguageInterface; // Temporary solution to fix linters. Need to ask meer
245
- description?: MultiLanguageInterface;
246
- helperText?: MultiLanguageInterface;
247
- footerText?: MultiLanguageInterface;
248
- abbreviationLabel?: MultiLanguageInterface;
249
- textForTable?: string;
250
- isHidden?: number | null | boolean;
251
- showHeaderText?: boolean;
252
- headerText?: MultiLanguageInterface;
253
- showLabel?: boolean;
254
- attributes?: any;
255
- showToolTip?: boolean;
256
- toolTip?: MultiLanguageInterface;
257
- options: Option[] ;
258
- showHelperText?: boolean;
259
- showAlphabetList?: boolean;
260
- isFluid?: boolean;
261
- children?: any;
262
- isValid?: number;
263
- customColumnsForOptions?: any; // need to ask type
264
- type?: string;
265
- children?: Record<string, any>[]; // Adjust based on actual structure
266
- [key: string]: any; // Adjust or remove if specific fields are known
267
- placeholder?: MultiLanguageInterface;
268
- customColumns?: any;
269
- rows?: any;
270
- validationMesssage?: MultiLanguageInterface; // Temporary solution to fix linters. Need to ask meer
271
- showLabel?: boolean;
272
- rowIsRepeatable?: boolean;
273
- fontSize?:number;
274
- addresslineFirstLabel?: MultiLanguageInterface;
275
- addresslineSecondLabel?: MultiLanguageInterface;
276
- postalcodeLabel?: MultiLanguageInterface;
277
- billingLabel?: MultiLanguageInterface;
278
- showBillingAddress?: boolean;
279
- showButtonLayout?: boolean;
280
- documents?: any;
281
- countries?: string[];
282
- dataSourceType?: string;
283
- optionValue?: string;
284
- optionLabel?: boolean;
285
- dataSource?: {
286
- api?: string;
287
- availableId?: any[];
288
- };
289
- fieldType?: {
290
- type: string;
291
- };
292
- showIcon?: boolean;
293
- iconAlignment?: string;
294
- icon?: {
295
- properties: {
296
- name: string;
297
- };
298
- };
299
- answerInputType?: string;
300
- answerOptions?: AnswerOption[];
301
- questionText?: MultiLanguageInterface;
302
- questionTextImage?: MultiLanguageInterface;
303
- text?: MultiLanguageInterface;
304
- hrefLink?: MultiLanguageInterface;
305
- headingType?: string;
306
- showSectionHeader?: boolean;
307
- subHeadingText?: MultiLanguageInterface;
308
- heading?: MultiLanguageInterface;
309
- defaultValue?: MultiLanguageInterface;
310
- media_file_id?: number;
311
- isExternalSource?: boolean;
312
- media_url?: MultiLanguageInterface;
313
- media?: any;
314
- title?: MultiLanguageInterface;
315
- quizSchema?: {
316
- assessment_title?: string;
317
- };
318
- backgroundColor?: any; // need to ask type
319
- // {
320
- // r?: string;
321
- // g?: string;
322
- // b?: string;
323
- // }
324
- color?: string;
325
- underLined: boolean;
326
- penColor?: string;
327
- fontSize?: number;
328
- canvasWidth?: string;
329
- canvasHeight?: string;
330
- clearSignatureButtonLabel?: MultiLanguageInterface;
331
- textareaRows?: number;
332
- textareaCols?: number;
333
-
334
- resizable?: boolean;
335
- fontOption?: boolean;
336
- boldOption?: boolean;
337
- italicOption?: boolean;
338
- underlineOption?: boolean;
339
- listOption?: boolean;
340
- alignOption?: boolean;
341
- colorOption?: boolean;
342
- sizeOption?: boolean;
343
- fontStyle?: {
344
- font: string;
345
- };
346
- videoDuration?: string;
347
- length?: number;
348
- noOfMultpleAnswer?: any; // somewhere it is used as string and somewhere used as number also
349
- isAllowMultipleAnswer: boolean;
350
- isHierarchalCondionalTabEnabled?: boolean;
351
- data?: any;
352
- noOfMonths?: number;
353
- isIcon?: boolean;
354
- isTodayBtn?: boolean;
355
- dateFormat?: string;
356
- dateRange?: string;
357
- calenderView?: string;
358
- isLayoutTabEnabled?: boolean;
359
- isValidationTabEnabled?: boolean;
360
- isDynamicListingTabEnabled?: boolean;
361
- resizableColumns: boolean;
362
- isFilterable?: boolean;
363
- freezeColumn?: boolean;
364
- colToggle?: boolean;
365
- isFieldAnFilterOption?: boolean;
366
- isSortable?: boolean;
367
- reorderableColumns: boolean;
368
- countryLabel?: MultiLanguageInterface;
369
- cityLabel?: MultiLanguageInterface;
370
- startingMessage?: MultiLanguageInterface;
371
- stateLabel?: MultiLanguageInterface;
372
- endingMessage?: MultiLanguageInterface;
373
- abbreviationLabelPlaceHolder?: MultiLanguageInterface;
374
- textTable?: MultiLanguageInterface;
375
- textTablePlaceHolder?: MultiLanguageInterface;
376
- toolTipPlaceHolder?: MultiLanguageInterface;
377
- placeholderPlaceHolder?: MultiLanguageInterface;
378
- helperTextPlaceHolder?: MultiLanguageInterface;
379
- headerTextPlaceHolder?: MultiLanguageInterface;
380
- guidelines?: MultiLanguageInterface;
381
- guidelinesPlaceHolder?: MultiLanguageInterface;
382
- correctAnswerComment?: MultiLanguageInterface;
383
-
384
- enableCurrency?: boolean;
385
- minDate?: any; // need to ask type
386
- maxDate?: any; // need to ask type
387
- timeLimit: number;
388
- score: number;
389
- subject_id: number;
390
- course_category_id: number;
391
- TextEditorProps: boolean;
392
- attributes: {
393
- required: boolean;
394
- };
395
- children: {
396
- uuid: string;
397
- type: string;
398
- label: string;
399
- value: string;
400
- required: boolean;
401
- };
402
- fieldData?: Field;
403
- // heading?: { [key: string]: string };
404
- // icon?: string;
405
- // noOfMonths?: number;
406
- }
407
-
408
- interface IRowInterface {
409
- uuid: string;
410
- type: string;
411
- bgType?: string;
412
- bgColor?: string;
413
- bgImage?: string;
414
- isCollapsed: boolean;
415
- isHidden: boolean;
416
- isMinimumEntries: boolean;
417
- isRequired: boolean;
418
- isValid: boolean;
419
- showRowSubTitle: boolean;
420
- showRowTitle: boolean;
421
- rowIsRepeatable: boolean;
422
- children: IColumnInterface[];
423
- heading: MultiLanguageInterface;
424
- subHeadingText: MultiLanguageInterface;
425
- addToListButtonLabel: MultiLanguageInterface;
426
- repeatableFields: Field[];
427
- isManualEnumerationEnabled?: boolean;
428
- minimumEntries: number;
429
- repeatableFieldsData: any[];
430
- reviewerChecklist: any[];
431
- margin: {
432
- left?: number;
433
- right?: number;
434
- top?: number;
435
- bottom?: number;
436
- type: string;
437
- };
438
- rowIndex: number;
439
- row:string
440
- }
441
-
442
- interface ISectionInterface {
443
- uuid: string;
444
- type: string;
445
- showSectionHeader: boolean;
446
- isVisible: boolean;
447
- isHidden: boolean | number;
448
- isCollapsed: boolean;
449
- isValid: boolean;
450
- showSectionSubTitle: boolean;
451
- showSectionTitle: boolean;
452
- heading: MultiLanguageInterface;
453
- subHeadingText: MultiLanguageInterface;
454
- children: IRowInterface[];
455
- minimumEntries?: number;
456
- }
457
-
458
- interface IPageInterface {
459
- uuid: string;
460
- bgType?: string;
461
- type: string;
462
- isCoverPage: boolean;
463
- isHidden: boolean;
464
- isValid: boolean;
465
- isVisible: boolean;
466
- margin: {
467
- left: number;
468
- right: number;
469
- top: number;
470
- bottom: number;
471
- };
472
- title: MultiLanguageInterface;
473
- children: ISectionInterface[];
474
- displayRules: any[];
475
- bgColor?: string;
476
- bgImage?: string;
477
- }
478
-
479
- interface IChildrenInterface {
480
- abbreviationLabel: Language;
481
- abbreviationLabelPlaceHolder: Language;
482
- attributes: {
483
- className: string;
484
- disabled: boolean;
485
- enumeration: string;
486
- hidden: boolean;
487
- id: string;
488
- name: string;
489
- pattern: string;
490
- readOnly: boolean;
491
- required: boolean;
492
- style: string;
493
- title: string;
494
- };
495
- colToggle: boolean;
496
- columnResizeMode: string;
497
- componentType: string;
498
- customColumns: {
499
- customKey: string;
500
- options: any[];
501
- uuid: string;
502
- }[];
503
- data: {
504
- uuid: string;
505
- dataKey: string;
506
- value: string;
507
- }[];
508
- fieldType: {
509
- element: string;
510
- type: string;
511
- };
512
- freezeColumn: boolean;
513
- guidelines: Language;
514
- guidelinesPlaceHolder: Language;
515
- headerText: Language;
516
- headerTextPlaceHolder: Language;
517
- helperText: Language;
518
- helperTextPlaceHolder: Language;
519
- isConditionalTabEnabled: boolean;
520
- isDynamicListingTabEnabled: boolean;
521
- isValid: number;
522
- isFilterable: boolean;
523
- isFluid: boolean;
524
- isHierarchalCondionalTabEnabled: boolean;
525
- isLayoutTabEnabled: boolean;
526
- isPostField: boolean;
527
- isSortable: boolean;
528
- label: Language;
529
- options: {
530
- abbreviationText: {
531
- english: string;
532
- };
533
- custom_values: any; // need to ask type
534
- hyperlinkText: {
535
- english: string;
536
- };
537
- optionText: {
538
- english: string;
539
- };
540
- uuid: string;
541
- value: string;
542
- }[];
543
- placeholder: Language;
544
- placeholderPlaceHolder: Language;
545
- reorderableColumns: boolean;
546
- resizableColumns: boolean;
547
- reviewerChecklist: any[];
548
- rows: {
549
- optionValue: string;
550
- rowHeading: string;
551
- uuid: string;
552
- custom_values?: any; // need to ask type
553
- }[];
554
- showHeaderText: boolean;
555
- showHelperText: boolean;
556
- showLabel: boolean;
557
- showToolTip: boolean;
558
- textTable: Language;
559
- textTablePlaceHolder: Language;
560
- toolTip: Language;
561
- toolTipPlaceHolder: Language;
562
- type: string;
563
- uuid: string;
564
- validationMesssage: Language;
565
- validationMesssagePlaceHolder: Language;
566
- isCollapsed: boolean;
567
- }
568
- interface IColumnInterface {
569
- uuid: string;
570
- type: string;
571
- isCollapsed: boolean;
572
- children: Field[];
573
- columnName:string;
574
- columnType:string
575
- }
576
-
577
- interface ITooltipInterface {
578
- label: string;
579
- element: string;
580
- }
581
-
582
- interface DispatchActionType {
583
- type: string;
584
- payLoad: any;
585
- }
586
-
587
- interface IColumnHeaderOptions{
588
- uuid?: string;
589
- [key: string]: string
590
- }
13
+ export interface RenderBuilder {
14
+ render: (config: Record<string, any>) => ReactNode;
15
+ // Add other methods or properties for RenderBuilder
16
+ }
591
17
 
592
- // interface ILayoutInterface = IPageInterface[]
593
- interface IStateInterface{
594
- builderTemplateName: string;
595
- isChangesSaved: boolean;
596
- editing_by: string;
597
- version_name: string;
598
- loading: boolean;
599
- published_status: string;
600
- formBuilderFormSchema: StateType;
601
- saveFormTemplateNewVersion: StateType;
602
- renderType: string;
603
- userSelectedLanguage: Language ;
604
- languages: Language[] ;
605
- layout: IPageInterface[];
606
- }
607
- interface BuilderContextInterface {taskOptions: any; state: IStateInterface, dispatch: DispatchType}
18
+ export const RenderBuilder: RenderBuilder;
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cft-builder",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"