@sava-info-systems/api-maker-with-extensions 1.13.0 → 1.15.0

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 (100) hide show
  1. package/.nvmrc +1 -1
  2. package/dist/1097.449af467da10a6f0.js +1 -0
  3. package/dist/3081.827b4ef503185325.js +1 -0
  4. package/dist/4211.26b06067756edec1.js +1 -0
  5. package/dist/4575.cb8bb3db7b7c0fe0.js +1 -0
  6. package/dist/{5249.js → 5249.6a454babc2d144b3.js} +1 -1
  7. package/dist/7368.ac46846616e465a8.js +1 -0
  8. package/dist/7987.541a0b67fd21c1f8.js +1 -0
  9. package/dist/885.70ca8f701657a321.js +1 -0
  10. package/dist/{9575.js → 9575.d8d77a5248e62530.js} +1 -1
  11. package/dist/assets/schema-types/InterfaceProps.ts +1 -0
  12. package/dist/assets/schema-types/types.ts +294 -21
  13. package/dist/index.html +2 -2
  14. package/dist/main.7af59190ebaf6c36.js +1 -0
  15. package/dist/runtime.bfd9b30f865686f0.js +1 -0
  16. package/dist/styles.b301d5c3703f519a.css +1 -0
  17. package/main.js +1 -1
  18. package/package.json +16 -14
  19. package/sandbox/assets/schema-types/types.js +36 -7
  20. package/sandbox/package.json +3 -3
  21. package/sandbox/sandbox.js +1 -1
  22. package/src/assets/schema-types/types.ts +294 -21
  23. package/src/public/dist-db-masters/browser/index.html +7 -3
  24. package/src/public/dist-db-masters/browser/main-TYGVEM3B.js +139 -0
  25. package/src/public/dist-db-masters/browser/main.js +1 -1
  26. package/src/public/dist-db-masters/browser/media/color-3LUHUBGQ.png +0 -0
  27. package/src/public/dist-db-masters/browser/media/hue-RMMBQOAC.png +0 -0
  28. package/src/public/dist-db-masters/browser/media/primeicons-4GST5W3O.woff2 +0 -0
  29. package/src/public/dist-db-masters/browser/media/primeicons-DHQU4SEP.svg +345 -0
  30. package/src/public/dist-db-masters/browser/media/primeicons-GEFHGEHP.ttf +0 -0
  31. package/src/public/dist-db-masters/browser/media/primeicons-P53SE5CV.woff +0 -0
  32. package/src/public/dist-db-masters/browser/media/primeicons-RSSEDYLY.eot +0 -0
  33. package/src/public/dist-db-masters/browser/polyfills-6EAL64PA.js +2 -0
  34. package/src/public/dist-db-masters/browser/styles-2H2JU2BI.css +1 -0
  35. package/src/tools/install_utils/SetEnvInFrontend.js +17 -2
  36. package/dist/1097.js +0 -1
  37. package/dist/3081.js +0 -1
  38. package/dist/4211.js +0 -1
  39. package/dist/4575.js +0 -1
  40. package/dist/7368.js +0 -1
  41. package/dist/7987.js +0 -1
  42. package/dist/885.js +0 -1
  43. package/dist/main.js +0 -1
  44. package/dist/runtime.js +0 -1
  45. package/dist/styles.css +0 -1
  46. /package/dist/{1025.js → 1025.aa53798f1b55461d.js} +0 -0
  47. /package/dist/{148.js → 148.ee8e99d678b8c025.js} +0 -0
  48. /package/dist/{1558.js → 1558.e0b57bdf7f56a8f0.js} +0 -0
  49. /package/dist/{1617.js → 1617.5e0016e4b9a7942e.js} +0 -0
  50. /package/dist/{1678.js → 1678.11aec0796eea5d87.js} +0 -0
  51. /package/dist/{1754.js → 1754.c8a592e8566b39cd.js} +0 -0
  52. /package/dist/{1928.js → 1928.970ea54226b2cd91.js} +0 -0
  53. /package/dist/{1957.js → 1957.ae3a282aaf017a6e.js} +0 -0
  54. /package/dist/{2140.js → 2140.6a93dae584183594.js} +0 -0
  55. /package/dist/{2295.js → 2295.2805c58221b89532.js} +0 -0
  56. /package/dist/{2473.js → 2473.7e8addd010a40342.js} +0 -0
  57. /package/dist/{2714.js → 2714.d2294502b2a67e9a.js} +0 -0
  58. /package/dist/{2735.js → 2735.8db087449ded306f.js} +0 -0
  59. /package/dist/{2908.js → 2908.afbb4bc0e7cd8877.js} +0 -0
  60. /package/dist/{3139.js → 3139.d0e02547c933c49b.js} +0 -0
  61. /package/dist/{3450.js → 3450.7258a816bd414e01.js} +0 -0
  62. /package/dist/{4110.js → 4110.864766464288eeb8.js} +0 -0
  63. /package/dist/{4181.js → 4181.30e4f1c8eada50e2.js} +0 -0
  64. /package/dist/{4186.js → 4186.dc909c8525a1e871.js} +0 -0
  65. /package/dist/{4842.js → 4842.0929ff5c931d6a5b.js} +0 -0
  66. /package/dist/{485.js → 485.0d081fb59c661f05.js} +0 -0
  67. /package/dist/{4895.js → 4895.4fcedd94060fad5d.js} +0 -0
  68. /package/dist/{5334.js → 5334.58277491cb57f6ee.js} +0 -0
  69. /package/dist/{5421.js → 5421.8e428cae376ebf8c.js} +0 -0
  70. /package/dist/{5679.js → 5679.3897b7371f5e32fe.js} +0 -0
  71. /package/dist/{5761.js → 5761.844e55e87fc6bcf8.js} +0 -0
  72. /package/dist/{5765.js → 5765.c2d8207418a5561f.js} +0 -0
  73. /package/dist/{6236.js → 6236.9d38a82ecca3aec6.js} +0 -0
  74. /package/dist/{6393.js → 6393.0b1c08d78f1af0d8.js} +0 -0
  75. /package/dist/{6401.js → 6401.e28156bcbab146e7.js} +0 -0
  76. /package/dist/{6925.js → 6925.2135c4ac170fd066.js} +0 -0
  77. /package/dist/{7436.js → 7436.8366a4a22515129b.js} +0 -0
  78. /package/dist/{7470.js → 7470.c9afc148f288ac63.js} +0 -0
  79. /package/dist/{7649.js → 7649.aa2999c02c9c54ae.js} +0 -0
  80. /package/dist/{7975.js → 7975.18f52f8018a65643.js} +0 -0
  81. /package/dist/{7977.js → 7977.21d1ce18dd90e683.js} +0 -0
  82. /package/dist/{8125.js → 8125.0705f11a3e3c285b.js} +0 -0
  83. /package/dist/{8266.js → 8266.7a4c37981b3a1460.js} +0 -0
  84. /package/dist/{8296.js → 8296.74d7cbb4de44faad.js} +0 -0
  85. /package/dist/{8374.js → 8374.fa20d95bc952f56d.js} +0 -0
  86. /package/dist/{8682.js → 8682.ac569b2306382d34.js} +0 -0
  87. /package/dist/{8841.js → 8841.f4d477b20e8324df.js} +0 -0
  88. /package/dist/{891.js → 891.519823bb28bd0543.js} +0 -0
  89. /package/dist/{913.js → 913.6e9b6732fb48fa5f.js} +0 -0
  90. /package/dist/{9243.js → 9243.a2982da73f489775.js} +0 -0
  91. /package/dist/{9939.js → 9939.164ded8f7ca5162f.js} +0 -0
  92. /package/dist/{color.png → color.dae87a04d07ca92b.png} +0 -0
  93. /package/dist/{common.js → common.7e62dd0fef3d35cc.js} +0 -0
  94. /package/dist/{hue.png → hue.8b1818380241e6ac.png} +0 -0
  95. /package/dist/{polyfills.js → polyfills.a6d93c3e94967b29.js} +0 -0
  96. /package/dist/{primeicons.svg → primeicons.19e14e488f5edc90.svg} +0 -0
  97. /package/dist/{primeicons.ttf → primeicons.310a7310efb91ab1.ttf} +0 -0
  98. /package/dist/{primeicons.woff → primeicons.7f7722745590608a.woff} +0 -0
  99. /package/dist/{primeicons.eot → primeicons.8ca441e178bfb872.eot} +0 -0
  100. /package/dist/{primeicons.woff2 → primeicons.e1a53edb6ea00325.woff2} +0 -0
@@ -256,6 +256,7 @@ export enum EErrorType {
256
256
  schemaNotFound = 'schemaNotFound',
257
257
  emailNotValid = 'emailNotValid',
258
258
  enumValidation = 'enumValidation',
259
+ virtualFieldUsedInFind = 'virtualFieldUsedInFind',
259
260
  }
260
261
 
261
262
  // Main interfaces
@@ -270,21 +271,57 @@ export interface ISchemaProperty { // Add new schema property in ValidateDBSchem
270
271
  conversions?: IPropertyConversion;
271
272
  validations?: IPropertyValidation;
272
273
 
274
+ /**
275
+ * These settings are only available only for UI Maker extension. It will have no impact when UI Maker is not installed in your installation.<br/><br/>
276
+ * When we try to generate default JSON for collection from UI Maker, these settings will be merged with default JSON generation.<br/>
277
+ * These settings are only used to generate UI Maker code, it has no runtime effect.<br/>
278
+ *
279
+ * After generating default code for UI Maker page, system will use these settings and override those configurations.
280
+ * */
281
+ uim?: IDBMasterConfigFormField;
282
+
273
283
  instance?: string; // used as strings in _.get
274
284
  database?: string; // used as strings in _.get
275
285
  collection?: string; // used as strings in _.get
276
286
  table?: string;
277
287
 
278
- // this column value will be return after nested save.
279
- column?: string; // user can define column of target collection here. so no need to define t_key in deep property. Used in getDataForDeep // used as strings in _.get
288
+ /**
289
+ * user can define column of target collection here. so no need to define t_key in deep property.
290
+ * this column value will be return after nested save.
291
+ * */
292
+ column?: string;
293
+
294
+ /**
295
+ * Used in virtual field deep populate.<br/>
296
+ * Current table's which column is used to generate this virtual field.
297
+ * */
298
+ s_columnVirtualLinker?: string;
299
+
300
+ /**
301
+ * Used for columns where isVirtualField is true.
302
+ * Need to place column name of target table which holds primary key value of this table.
303
+ * It is optional when target table has only one column, in which `collection/table` value is this collection/table name.
304
+ * */
305
+ t_columnVirtualLinker?: string;
306
+
280
307
  isPrimaryKey?: boolean;
281
308
 
282
309
  /** Database will take care of assigning incremental value for this field. */
283
310
  isAutoIncrementByDB?: boolean;
284
311
 
285
- /** API Maker will take care of assigning incremental value for this field. */
312
+ /**
313
+ * API Maker will take care of assigning incremental value for this field.<br/>
314
+ * if isAutoIncrementByDB is true then isAutoIncrementByAM & isAutoGenerateByAM will have no effect.
315
+ * */
286
316
  isAutoIncrementByAM?: boolean | IIsAutoIncrementByAM;
287
317
 
318
+ /**
319
+ * API Maker will generate random values for this field based on configuration. When value is provided then it will not generate.<br/>
320
+ * isAutoGenerateByAM has higher priority over isAutoIncrementByAM.<br/>
321
+ * if isAutoIncrementByDB is true then isAutoIncrementByAM & isAutoGenerateByAM will have no effect.
322
+ * */
323
+ isAutoGenerateByAM?: IIsAutoGenerateByAM;
324
+
288
325
  /**
289
326
  * if true, system will fail update/replace operation when value of this field in request payload, and value of database is not same.<br/>
290
327
  * Sending this field in update request is mandatory.<br/>
@@ -293,6 +330,12 @@ export interface ISchemaProperty { // Add new schema property in ValidateDBSchem
293
330
  * By using optimistic concurrency control, you can ensure that updates are not overwritten by concurrent modifications, maintaining data integrity.<br/>
294
331
  * */
295
332
  isConcurrencyControlField?: boolean;
333
+
334
+ /**
335
+ * If true, means it is not actual field in database and just field in schema.
336
+ * Means we want it to use in deep populate and master save to get & store data in one API call.
337
+ * */
338
+ isVirtualField?: boolean;
296
339
  }
297
340
 
298
341
  export interface IIsAutoIncrementByAM {
@@ -300,6 +343,17 @@ export interface IIsAutoIncrementByAM {
300
343
  step?: number; // default value will be 1
301
344
  }
302
345
 
346
+ export interface IIsAutoGenerateByAM {
347
+ valueGeneratorType: EValueGeneratorType;
348
+ }
349
+
350
+ export enum EValueGeneratorType {
351
+ GUID_UUID = 'GUID_UUID',
352
+ ObjectID = 'ObjectID',
353
+ ULID = 'ULID',
354
+ ShortUUID = 'ShortUUID',
355
+ }
356
+
303
357
  export interface IPropertyConversion {
304
358
  trimStart?: boolean;
305
359
  trimEnd?: boolean;
@@ -313,7 +367,7 @@ export interface IPropertyConversion {
313
367
  * This default value will be converted to that type and applied.<br/>
314
368
  * Empty string and null values will be treated based on configuration.
315
369
  * */
316
- defaults?: IPropertyConversionDefaults
370
+ defaults?: IPropertyConversionDefaults;
317
371
 
318
372
  /** enable encryption for this property */
319
373
  encryption?: boolean | IEncryptionDescription;
@@ -560,11 +614,20 @@ export interface IQueryFormat {
560
614
 
561
615
  export interface IApiParamsDeepFormat {
562
616
  s_key: string;
617
+ /**
618
+ * Used in virtual field deep populate.<br/>
619
+ * Value of which key is used to compare with value of t_keyColumnVirtualLinker in target collection(t_col).
620
+ * */
621
+ s_keyColumnVirtualLinker?: string;
622
+
563
623
  // t_apiPath?: string;
564
624
  t_instance?: string;
565
625
  t_db?: string;
566
626
  t_col?: string;
627
+ /** Primary key of target collection/table */
567
628
  t_key?: string;
629
+ /** Column of target table which holds data to link to current table */
630
+ t_keyColumnVirtualLinker?: string;
568
631
  deep?: IApiParamsDeepFormat[] | string[] | string;
569
632
  select?: any;
570
633
 
@@ -577,6 +640,21 @@ export interface IApiParamsDeepFormat {
577
640
  // We process skip & limit while setting multiple data.
578
641
  skip?: number;
579
642
  limit?: number;
643
+
644
+ /**
645
+ * Can be used for fields having `isVirtualField: true` in schema.
646
+ * chunk = System will get data in chunks from database. It is default method with chunk size = 1000. <br/>
647
+ * one_by_one = System will get nested data one by one for each object. It should be used when we are using limit & skip for target table and it has large amount of data.<br/>
648
+ * */
649
+ fetchingTechnique?: 'chunk' | 'one_by_one';
650
+
651
+ /**
652
+ * Can be used for fields having `isVirtualField: true` in schema.
653
+ * */
654
+ fetchingTechniqueSettings?: {
655
+ /** Default : 1000 */
656
+ chunkSize?: number;
657
+ }
580
658
  }
581
659
 
582
660
  export interface IDeepFormat extends IApiParamsDeepFormat {
@@ -659,7 +737,7 @@ export interface IArrayOperationBody {
659
737
  export interface IArrayOperation {
660
738
  operation?: EArrayOperation;
661
739
  path?: string;
662
- dataToPush?: any[]; // $push, used for push operation. Array/Object of data to pushe in array.
740
+ dataToPush?: any[]; // $push, used for push operation. Array/Object of data to push in array.
663
741
  queryToRemove?: any; // $pull, query to remove docs from array.
664
742
  dataToPull?: any[]; // $pullAll, array of items which will be removed from array.
665
743
  direction?: -1 | 1; // $pop, -1 remove first, 1 remove last.
@@ -710,20 +788,55 @@ export interface ICustomApiSettingsTypes extends IAuthTokenInfoCommon {
710
788
  reqQueryParametersSchema?: ISchemaType;
711
789
 
712
790
  /**
713
- * 👉 If true, code will execute on original Node.js process and not in sandbox.<br/>
714
- * 👉 It makes code execution fast, Do not use it if you don't know what you are doing.<br/>
715
- * 👉 Bad code can make entire server freeze and give weird behaviour.<br/>
716
- * 👉 So, it can not use sandbox packages.<br/>
717
- * 👉 It can use Node.js inbuilt packages.<br/>
718
- * 👉 It can use packages from package.json of api_maker_be.<br/>
719
- * 👉 You can use all features of global variable 'g'.<br/>
791
+ * - If true, code will execute on original Node.js process and not in sandbox.<br/>
792
+ * - It makes code execution fast, Do not use it if you don't know what you are doing.<br/>
793
+ * - Bad code can make entire server freeze and give weird behaviour.<br/>
794
+ * - So, it can not use sandbox packages.<br/>
795
+ * - It can use Node.js inbuilt packages.<br/>
796
+ * - It can use packages from package.json of api_maker_be.<br/>
797
+ * - You can use all features of global variable 'g'.<br/>
720
798
  */
721
799
  runOnNativeProcess?: boolean;
722
800
 
723
- // calculated property
724
- errorList: string[]; // list of all errors thrown by this API.
725
- pathAndRequestMethod?: string;
801
+ /** list of all errors thrown by this API. */
802
+ errorList: string[];
726
803
  swaggerDocs?: ISwaggerDocsObj;
804
+
805
+ /** if runOnNativeProcess is true, these settings will have no effect. "Automatic Sandbox Restart In Seconds" will have no effect when this setting is provided. */
806
+ separateSandboxSettings?: ISeparateSandboxSettings;
807
+ }
808
+
809
+ export interface ISeparateSandboxSettings {
810
+ /**
811
+ * ex: Sandbox_Group_1, system will create separate sandbox for this particular entity and "Automatic Sandbox Restart In Seconds" will have no effect on this sandbox.
812
+ * All the packages of custom APIs having value "Sandbox_Group_1" will be available during execution.
813
+ * */
814
+ enableSeparateSandboxForThis?: string;
815
+
816
+ /**
817
+ * If any "separateSandboxSettings" has value in this, it will be used instead of "Sandbox Settings" DockerFile
818
+ * */
819
+ dockerFileOfSandbox?: string;
820
+
821
+ /** It works when we have enableSeparateSandboxForThis as true. */
822
+ packages?: {
823
+ /** If true, this sandbox will have all the packages of admin. */
824
+ allowAllPackagesOfAdmin?: boolean;
825
+
826
+ /** If allowAllPackagesOfAdmin == false, then this settings will be applicable and these packages will be installed on this particular sandbox. */
827
+ sandboxPackages?: {
828
+ name: string;
829
+ version: string;
830
+ }[];
831
+ }
832
+
833
+ /** Sandbox will be restarted automatically based on these settings without failing any request. */
834
+ autoRestart?: {
835
+ /**
836
+ * - It will work when enableSeparateSandboxForThis is true. <br/>
837
+ * - Sandbox will be restarted after it passes these much of time, after its creation. */
838
+ afterTheseMuchSeconds?: number;
839
+ }
727
840
  }
728
841
 
729
842
  export interface ISwaggerDocsObj {
@@ -746,7 +859,7 @@ export interface ISwaggerParametersEntity {
746
859
  example?: any,
747
860
  default?: any;
748
861
  enum?: any[];
749
- }
862
+ };
750
863
  }
751
864
 
752
865
  export enum ESwaggerParamInType {
@@ -1240,6 +1353,8 @@ export interface ICodeRunByResponse {
1240
1353
  workerId: string;
1241
1354
  port: number;
1242
1355
  publishToRedis?: boolean; // true = if request received by redis.
1356
+ enableSeparateSandboxForThis: string;
1357
+ allowAllPackagesOfAdmin: boolean;
1243
1358
  }
1244
1359
 
1245
1360
  export interface IAPIAccessGroupMeta {
@@ -1382,6 +1497,29 @@ export type ITestCaseSandboxCode_P = Partial<ITestCaseSandboxCode>;
1382
1497
 
1383
1498
  // ==== DB Master configurations Start ====
1384
1499
 
1500
+ export interface IUIMakerURLQueryParams {
1501
+ /** If you provide id in URL, it will open that Id in edit mode. */
1502
+ id?: any;
1503
+
1504
+ /** Default edit, It will open form in edit or view mode based on passed value. */
1505
+ 'form-open-mode'?: EDBMasterGridOperationsOrder | null;
1506
+
1507
+ /** name of ui page */
1508
+ 'db-master-name'?: string;
1509
+
1510
+ /** admin user path */
1511
+ 'admin-path'?: string;
1512
+
1513
+ /** true | false // If passed, master will wait until parent is done with setting its data. */
1514
+ 'wait-for-parent-ready'?: string;
1515
+
1516
+ /** Default: false, If true, it will print debugging logs in console */
1517
+ 'show-logs'?: string;
1518
+
1519
+ /** You can pass theme in URL also */
1520
+ theme?: any;
1521
+ }
1522
+
1385
1523
  export enum EDBMasterTheme {
1386
1524
  BOOTSTRAP4_LIGHT_BLUE = 'bootstrap4-light-blue',
1387
1525
  BOOTSTRAP4_LIGHT_PURPLE = 'bootstrap4-light-purple',
@@ -1629,7 +1767,7 @@ export interface IDBMasterConfig {
1629
1767
  * oncePageLoadWithContext = Code will be run only once on page load with context of data. (config, globalData: any, utils: any, queryParams: any) <br/>
1630
1768
  * gridRender = Gets executed everytime grid gets data. (gridEvent, gridData, globalData: any, utils: any, queryParams: any) <br/>
1631
1769
  * modifyGridRequest = You can modify api call request. (gridEvent, reqBody: IQueryFormat, globalData: any, utils: any, queryParams: any) <br/>
1632
- * preSaveAndEdit = Change data before saving/update/import. (reqBody: any | any[], globalData: any, utils: any, queryParams: any, mode: 'save' | 'edit' | 'import') <br/>
1770
+ * preSaveAndEdit = run code before save & edit operation of form. Change data before saving/update/import. (reqBody: any | any[], globalData: any, utils: any, queryParams: any, mode: 'save' | 'edit' | 'import') <br/>
1633
1771
  * beforeSaveModalOpen = Change data before save modal open. (formData: any , globalData: any, utils: any, queryParams: any) <br/>
1634
1772
  * beforeEditModalOpen = Change data before edit modal open. (formData: any , globalData: any, utils: any, queryParams: any) <br/>
1635
1773
  *
@@ -1804,6 +1942,9 @@ export interface IDBMasterConfig {
1804
1942
  /** only applicable for top level form modal. */
1805
1943
  draggable?: boolean;
1806
1944
 
1945
+ /** default: true, Whether the dialog can be displayed full screen. */
1946
+ maximizable?: boolean;
1947
+
1807
1948
  /** Ex : 90vw */
1808
1949
  width?: string;
1809
1950
 
@@ -1988,7 +2129,7 @@ export interface IDBMasterConfigOperation {
1988
2129
  /** default : true */
1989
2130
  raised?: boolean;
1990
2131
 
1991
- /** Applicable for add button only. */
2132
+ /** Gives label to Add button which is visible on top of the grid. Applicable for add button only. */
1992
2133
  label?: string;
1993
2134
 
1994
2135
  /** Applicable for add button only. */
@@ -2134,6 +2275,9 @@ export interface IDBMasterConfigGridFieldExport extends IDBMasterConfigGridField
2134
2275
 
2135
2276
  /** Calculated property based on schema. Used to give type to <p-columnFilter>. */
2136
2277
  filterType?: EDBMasterConfigFilterType;
2278
+
2279
+ /** Sets default match mode to column filter */
2280
+ matchModeForFilterInColumn?: EDBMasterMatchMode;
2137
2281
  }
2138
2282
 
2139
2283
  export enum EDBMasterConfigFilterType {
@@ -2184,7 +2328,12 @@ export interface IDBMasterConfigFormField {
2184
2328
  /** Generates UI controls. */
2185
2329
  fields?: IDBMasterConfigFormField[][];
2186
2330
 
2187
- validations?: Pick<IPropertyValidation, 'required'>;
2331
+ validations?: Pick<IPropertyValidation, 'required'> & {
2332
+ /** If requiredFun is present, that code will be executed when form data is getting changed and it sets value in required.<br/>
2333
+ * Value of required will be ignored when requiredFun is present because system will evaluate "requiredFun" and it's output will be value of "required"
2334
+ * */
2335
+ requiredFun?: string;
2336
+ };
2188
2337
  validationErrors?: {
2189
2338
  required?: string;
2190
2339
  };
@@ -2248,6 +2397,63 @@ export interface IDBMasterConfigFormField {
2248
2397
  };
2249
2398
  // textAreaSettings : end
2250
2399
 
2400
+ // editorSettings : start
2401
+ editorSettings?: {
2402
+ /** Give style object in angular style. */
2403
+ style?: any;
2404
+
2405
+ placeholder?: string;
2406
+
2407
+ /** Maximum number of character allows in the input field. */
2408
+ maxLength?: number;
2409
+
2410
+ /** Advisory information to display in a tooltip on hover. */
2411
+ tooltip?: string;
2412
+
2413
+ /** Type of CSS position. */
2414
+ tooltipPosition?: 'left' | 'top' | 'bottom' | 'right';
2415
+ tooltipStyleClass?: string;
2416
+
2417
+ /** Only those controls and formats will be allowed
2418
+ * ex: ['background', 'bold', 'color', 'font', 'code', 'italic', 'link', 'size', 'strike', 'script', 'underline', 'blockquote', 'header', 'indent', 'list', 'align', 'direction', 'code-block', 'image', 'video', 'clean']
2419
+ * */
2420
+ formats?: string[];
2421
+
2422
+ jsCode?: {
2423
+ /**
2424
+ * Available variables:<br/>
2425
+ * formData: any = Entire form object<br/>
2426
+ * column: IDBMasterConfigFormField = Configuration of that form column. column.dropdownSettings?.dbData?.find will be query to get data. <br/>
2427
+ * allDropdownDataMap: {[path: string]: any[]} = Map of all dropdown data<br/>
2428
+ * globalData: any = User will send it using SET_GLOBAL_DATA_TO_USE_IN_ANY_SCRIPT event from parent. <br/>
2429
+ * utils: any = Common utility functions for user to use. <br/>
2430
+ * queryParams: any = Query params received from URL. <br/>
2431
+ * config: IDBMasterConfigFormField <br/>
2432
+ * event: any <br/>
2433
+ */
2434
+ appendTo: EDBMasterEditorAppendTo,
2435
+ /**
2436
+ * // dropdownData is available to use.
2437
+ *
2438
+ * // Return promise for long awaiting tasks.
2439
+ * new Promise(async (resolve, reject) => {
2440
+ * await new Promise(r => setTimeout(r, 3000));
2441
+ * dropdownData[0].name = 'Sample data';
2442
+ * resolve();
2443
+ * });
2444
+ *
2445
+ * // Directly modify data of grid
2446
+ * dropdownData[0].name = 'Sample data';
2447
+ *
2448
+ * // Return function
2449
+ * (function setData() { dropdownData[0].name = 'Sample data'; } );
2450
+ *
2451
+ */
2452
+ code: string,
2453
+ }[],
2454
+ };
2455
+ // editorSettings : end
2456
+
2251
2457
  // inputTextSettings : start
2252
2458
  inputTextSettings?: {
2253
2459
  /** Give style object in angular style. */
@@ -2607,7 +2813,7 @@ export interface IDBMasterConfigFormField {
2607
2813
  tooltipPosition?: 'left' | 'top' | 'bottom' | 'right';
2608
2814
  tooltipStyleClass?: string;
2609
2815
 
2610
- /** When specified a cancel icon is displayed to allow removing the value. */
2816
+ /** Default : true, When specified a cancel icon is displayed to allow removing the value. */
2611
2817
  cancel?: boolean;
2612
2818
 
2613
2819
  /** Style class of the on icon. */
@@ -3833,6 +4039,22 @@ export enum EDBMasterTextAreaAppendTo {
3833
4039
 
3834
4040
  // textAreaSettings : end
3835
4041
 
4042
+ // editorSettings : start
4043
+ export enum EDBMasterEditorAppendTo {
4044
+ visible = 'visible',
4045
+ disabled = 'disabled',
4046
+ ngModelChange = 'ngModelChange',
4047
+ onTextChange = 'onTextChange',
4048
+ onInit = 'onInit',
4049
+ onSelectionChange = 'onSelectionChange',
4050
+ focus = 'focus',
4051
+ blur = 'blur',
4052
+ keyUp = 'keyUp',
4053
+ keyDown = 'keyDown',
4054
+ }
4055
+
4056
+ // editorSettings : end
4057
+
3836
4058
  // checkboxSettings : start
3837
4059
  export enum EDBMasterCheckboxAppendTo {
3838
4060
  visible = 'visible',
@@ -3910,14 +4132,28 @@ export enum EDBMasterGridAppendTo {
3910
4132
  // gridSettings : end
3911
4133
 
3912
4134
  export enum EDBMasterConfigAppendTo {
4135
+ /** Code will be run only once on page load. config and global data are not available. It will append script to page script tag. */
3913
4136
  oncePageLoad = 'oncePageLoad',
4137
+
4138
+ /** Code will be run only once on page load with context of data. (config, globalData: any, utils: any, queryParams: any) */
3914
4139
  oncePageLoadWithContext = 'oncePageLoadWithContext',
4140
+
4141
+ /** Gets executed everytime grid gets data. (gridEvent, gridData, globalData: any, utils: any, queryParams: any) */
3915
4142
  gridRender = 'gridRender',
4143
+
4144
+ /** You can modify api call request. (gridEvent, reqBody: IQueryFormat, globalData: any, utils: any, queryParams: any) */
3916
4145
  modifyGridRequest = 'modifyGridRequest',
3917
4146
 
3918
- /** run code before save & edit operation of form */
4147
+ /** Executed once grid data loaded. */
4148
+ onceGridDataLoaded = 'onceGridDataLoaded',
4149
+
4150
+ /** run code before save & edit operation of form. Change data before saving/update/import. (reqBody: any | any[], globalData: any, utils: any, queryParams: any, mode: 'save' | 'edit' | 'import') */
3919
4151
  preSaveAndEdit = 'preSaveAndEdit',
4152
+
4153
+ /** Change data before save modal open. (formData: any , globalData: any, utils: any, queryParams: any) */
3920
4154
  beforeSaveModalOpen = 'beforeSaveModalOpen',
4155
+
4156
+ /** Change data before edit modal open. (formData: any , globalData: any, utils: any, queryParams: any) */
3921
4157
  beforeEditModalOpen = 'beforeEditModalOpen',
3922
4158
  beforeViewModalOpen = 'beforeViewModalOpen',
3923
4159
  columnSelectionChanged = 'columnSelectionChanged',
@@ -3932,6 +4168,7 @@ export enum EDBMasterFormControl {
3932
4168
  password = 'password',
3933
4169
  date_picker = 'date_picker',
3934
4170
  textarea = 'textarea',
4171
+ editor = 'editor',
3935
4172
  checkbox = 'checkbox',
3936
4173
  radio = 'radio',
3937
4174
  color_picker = 'color_picker',
@@ -4027,6 +4264,24 @@ export interface IDBMasterUIPageUtilsScope {
4027
4264
  showWarningToast(msg: string, otherProps?: any): void;
4028
4265
  }
4029
4266
 
4267
+ /** Add | Edit | Delete | View | Refresh Grid operations */
4268
+ operations: {
4269
+ /** Reload grid data. */
4270
+ refreshGrid(): Promise<void>;
4271
+
4272
+ /** Opens form in add mode. */
4273
+ openFormInAddMode(): Promise<void>;
4274
+
4275
+ /** Opens modal in edit mode with data filled in it. */
4276
+ openFormInEditMode(id: any): Promise<void>;
4277
+
4278
+ /** Opens modal in view mode with data filled in it. */
4279
+ openFormInViewMode(id: any): Promise<void>;
4280
+
4281
+ /** Without any confirmation it will directly perform delete operation of given id. */
4282
+ deleteRecord(id: any): Promise<void>;
4283
+ }
4284
+
4030
4285
  /**
4031
4286
  * form fields are in nested form, it returns simple array of form fields.
4032
4287
  * It will not include fields from grid control as they are having different form and grid control itself is a form.
@@ -4076,6 +4331,24 @@ export interface IDBMasterUIPageUtilsScope {
4076
4331
  * fileType ex. = text/csv
4077
4332
  * */
4078
4333
  download(fileContent: string, filename: string, fileType: string): void;
4334
+
4335
+ /**
4336
+ * Useful to clear all properties of object and assign all properties of new object without changing object reference.
4337
+ * Use this function to set new value to $scope.<br/>
4338
+ * ex:<br/>
4339
+ * const someNewApiResponse = $scope.apiResponse;<br/>
4340
+ * $scope.utils.setDataInObject($scope.apiResponse, someNewApiResponse);<br/>
4341
+ * */
4342
+ setDataInObject(oldObject: any, newObject: any): void;
4343
+
4344
+ /**
4345
+ * Useful to remove all objects of array and put new objects from new array without changing object reference.
4346
+ * Use this function to set new value to $scope.<br/>
4347
+ * ex:<br/>
4348
+ * const someNewApiResponse = $scope.apiResponse;<br/>
4349
+ * $scope.utils.setDataInArray($scope.apiResponse, someNewApiResponse);<br/>
4350
+ * */
4351
+ setDataInArray(oldArray: any[], newArray: any[]): void;
4079
4352
  };
4080
4353
  queryParams: any;
4081
4354
  userUtils: { [utilName: string]: any };
package/dist/index.html CHANGED
@@ -96,7 +96,7 @@
96
96
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.20.0/components/prism-core.min.js" type="text/javascript"></script>
97
97
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.20.0/plugins/autoloader/prism-autoloader.min.js" type="text/javascript"></script>
98
98
 
99
- <style>@layer primeng{}:root{--surface-a:#3b3b3b;--surface-b:#303030;--surface-c:#610000;--surface-d:#4f4f4f;--surface-e:#3b3b3b;--surface-f:#3b3b3b;--text-color:#b0b0b0;--text-color-secondary:#7a7a7a;--primary-color:#790109;--primary-color-text:#ebebeb;--font-family:-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;--surface-0:#20262e;--surface-50:#363c43;--surface-100:#4d5158;--surface-200:#63676d;--surface-300:#797d82;--surface-400:#909397;--surface-500:#a6a8ab;--surface-600:#bcbec0;--surface-700:#d2d4d5;--surface-800:#e9e9ea;--surface-900:#ffffff;--gray-50:#e9e9ea;--gray-100:#d2d4d5;--gray-200:#bcbec0;--gray-300:#a6a8ab;--gray-400:#909397;--gray-500:#797d82;--gray-600:#63676d;--gray-700:#4d5158;--gray-800:#363c43;--gray-900:#20262e;--content-padding:1.25rem;--inline-spacing:.5rem;--border-radius:4px;--surface-ground:#20262e;--surface-section:#20262e;--surface-card:#2a323d;--surface-overlay:#2a323d;--surface-border:#3f4b5b;--surface-hover:rgba(255,255,255,.04);--maskbg:rgba(0, 0, 0, .4);--focus-ring:0 0 0 1px #8a0000;--highlight-bg:#750008;--highlight-text-color:#dedede;color-scheme:dark}*{box-sizing:border-box}:root{--blue-50:#f3f8ff;--blue-100:#c5dcff;--blue-200:#97c1fe;--blue-300:#69a5fe;--blue-400:#3b8afd;--blue-500:#0d6efd;--blue-600:#0b5ed7;--blue-700:#094db1;--blue-800:#073d8b;--blue-900:#052c65;--green-50:#f4f9f6;--green-100:#c8e2d6;--green-200:#9ccbb5;--green-300:#70b595;--green-400:#459e74;--green-500:#198754;--green-600:#157347;--green-700:#125f3b;--green-800:#0e4a2e;--green-900:#0a3622;--yellow-50:#fffcf3;--yellow-100:#fff0c3;--yellow-200:#ffe494;--yellow-300:#ffd965;--yellow-400:#ffcd36;--yellow-500:#ffc107;--yellow-600:#d9a406;--yellow-700:#b38705;--yellow-800:#8c6a04;--yellow-900:#664d03;--cyan-50:#f3fcfe;--cyan-100:#c5f2fb;--cyan-200:#97e8f9;--cyan-300:#69def6;--cyan-400:#3bd4f3;--cyan-500:#0dcaf0;--cyan-600:#0baccc;--cyan-700:#098da8;--cyan-800:#076f84;--cyan-900:#055160;--pink-50:#fdf5f9;--pink-100:#f5cee1;--pink-200:#eda7ca;--pink-300:#e681b3;--pink-400:#de5a9b;--pink-500:#d63384;--pink-600:#b62b70;--pink-700:#96245c;--pink-800:#761c49;--pink-900:#561435;--indigo-50:#f7f3fe;--indigo-100:#dac6fc;--indigo-200:#bd98f9;--indigo-300:#a06bf7;--indigo-400:#833df4;--indigo-500:#6610f2;--indigo-600:#570ece;--indigo-700:#470ba9;--indigo-800:#380985;--indigo-900:#290661;--teal-50:#f4fcfa;--teal-100:#c9f2e6;--teal-200:#9fe8d2;--teal-300:#75debf;--teal-400:#4ad3ab;--teal-500:#20c997;--teal-600:#1bab80;--teal-700:#168d6a;--teal-800:#126f53;--teal-900:#0d503c;--orange-50:#fff9f3;--orange-100:#ffe0c7;--orange-200:#fec89a;--orange-300:#feaf6d;--orange-400:#fd9741;--orange-500:#fd7e14;--orange-600:#d76b11;--orange-700:#b1580e;--orange-800:#8b450b;--orange-900:#653208;--bluegray-50:#f8f9fb;--bluegray-100:#e0e4ea;--bluegray-200:#c7ced9;--bluegray-300:#aeb9c8;--bluegray-400:#95a3b8;--bluegray-500:#7c8ea7;--bluegray-600:#69798e;--bluegray-700:#576375;--bluegray-800:#444e5c;--bluegray-900:#323943;--purple-50:#f8f6fc;--purple-100:#dcd2f0;--purple-200:#c1aee4;--purple-300:#a68ad9;--purple-400:#8a66cd;--purple-500:#6f42c1;--purple-600:#5e38a4;--purple-700:#4e2e87;--purple-800:#3d246a;--purple-900:#2c1a4d;--red-50:#fdf5f6;--red-100:#f7cfd2;--red-200:#f0a8af;--red-300:#e9828c;--red-400:#e35b68;--red-500:#dc3545;--red-600:#bb2d3b;--red-700:#9a2530;--red-800:#791d26;--red-900:#58151c;--primary-50:#f8f2f3;--primary-100:#dfc2c4;--primary-200:#c59295;--primary-300:#ac6266;--primary-400:#923138;--primary-500:#790109;--primary-600:#670108;--primary-700:#550106;--primary-800:#430105;--primary-900:#300004}</style><link rel="stylesheet" href="styles.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.css"></noscript></head>
99
+ <style>@layer primeng{}:root{--surface-a:#3b3b3b;--surface-b:#303030;--surface-c:#610000;--surface-d:#4f4f4f;--surface-e:#3b3b3b;--surface-f:#3b3b3b;--text-color:#b0b0b0;--text-color-secondary:#7a7a7a;--primary-color:#790109;--primary-color-text:#ebebeb;--font-family:-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;--surface-0:#20262e;--surface-50:#363c43;--surface-100:#4d5158;--surface-200:#63676d;--surface-300:#797d82;--surface-400:#909397;--surface-500:#a6a8ab;--surface-600:#bcbec0;--surface-700:#d2d4d5;--surface-800:#e9e9ea;--surface-900:#ffffff;--gray-50:#e9e9ea;--gray-100:#d2d4d5;--gray-200:#bcbec0;--gray-300:#a6a8ab;--gray-400:#909397;--gray-500:#797d82;--gray-600:#63676d;--gray-700:#4d5158;--gray-800:#363c43;--gray-900:#20262e;--content-padding:1.25rem;--inline-spacing:.5rem;--border-radius:4px;--surface-ground:#20262e;--surface-section:#20262e;--surface-card:#2a323d;--surface-overlay:#2a323d;--surface-border:#3f4b5b;--surface-hover:rgba(255,255,255,.04);--maskbg:rgba(0, 0, 0, .4);--focus-ring:0 0 0 1px #8a0000;--highlight-bg:#750008;--highlight-text-color:#dedede;color-scheme:dark}*{box-sizing:border-box}:root{--blue-50:#f3f8ff;--blue-100:#c5dcff;--blue-200:#97c1fe;--blue-300:#69a5fe;--blue-400:#3b8afd;--blue-500:#0d6efd;--blue-600:#0b5ed7;--blue-700:#094db1;--blue-800:#073d8b;--blue-900:#052c65;--green-50:#f4f9f6;--green-100:#c8e2d6;--green-200:#9ccbb5;--green-300:#70b595;--green-400:#459e74;--green-500:#198754;--green-600:#157347;--green-700:#125f3b;--green-800:#0e4a2e;--green-900:#0a3622;--yellow-50:#fffcf3;--yellow-100:#fff0c3;--yellow-200:#ffe494;--yellow-300:#ffd965;--yellow-400:#ffcd36;--yellow-500:#ffc107;--yellow-600:#d9a406;--yellow-700:#b38705;--yellow-800:#8c6a04;--yellow-900:#664d03;--cyan-50:#f3fcfe;--cyan-100:#c5f2fb;--cyan-200:#97e8f9;--cyan-300:#69def6;--cyan-400:#3bd4f3;--cyan-500:#0dcaf0;--cyan-600:#0baccc;--cyan-700:#098da8;--cyan-800:#076f84;--cyan-900:#055160;--pink-50:#fdf5f9;--pink-100:#f5cee1;--pink-200:#eda7ca;--pink-300:#e681b3;--pink-400:#de5a9b;--pink-500:#d63384;--pink-600:#b62b70;--pink-700:#96245c;--pink-800:#761c49;--pink-900:#561435;--indigo-50:#f7f3fe;--indigo-100:#dac6fc;--indigo-200:#bd98f9;--indigo-300:#a06bf7;--indigo-400:#833df4;--indigo-500:#6610f2;--indigo-600:#570ece;--indigo-700:#470ba9;--indigo-800:#380985;--indigo-900:#290661;--teal-50:#f4fcfa;--teal-100:#c9f2e6;--teal-200:#9fe8d2;--teal-300:#75debf;--teal-400:#4ad3ab;--teal-500:#20c997;--teal-600:#1bab80;--teal-700:#168d6a;--teal-800:#126f53;--teal-900:#0d503c;--orange-50:#fff9f3;--orange-100:#ffe0c7;--orange-200:#fec89a;--orange-300:#feaf6d;--orange-400:#fd9741;--orange-500:#fd7e14;--orange-600:#d76b11;--orange-700:#b1580e;--orange-800:#8b450b;--orange-900:#653208;--bluegray-50:#f8f9fb;--bluegray-100:#e0e4ea;--bluegray-200:#c7ced9;--bluegray-300:#aeb9c8;--bluegray-400:#95a3b8;--bluegray-500:#7c8ea7;--bluegray-600:#69798e;--bluegray-700:#576375;--bluegray-800:#444e5c;--bluegray-900:#323943;--purple-50:#f8f6fc;--purple-100:#dcd2f0;--purple-200:#c1aee4;--purple-300:#a68ad9;--purple-400:#8a66cd;--purple-500:#6f42c1;--purple-600:#5e38a4;--purple-700:#4e2e87;--purple-800:#3d246a;--purple-900:#2c1a4d;--red-50:#fdf5f6;--red-100:#f7cfd2;--red-200:#f0a8af;--red-300:#e9828c;--red-400:#e35b68;--red-500:#dc3545;--red-600:#bb2d3b;--red-700:#9a2530;--red-800:#791d26;--red-900:#58151c;--primary-50:#f8f2f3;--primary-100:#dfc2c4;--primary-200:#c59295;--primary-300:#ac6266;--primary-400:#923138;--primary-500:#790109;--primary-600:#670108;--primary-700:#550106;--primary-800:#430105;--primary-900:#300004}</style><link rel="stylesheet" href="styles.b301d5c3703f519a.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.b301d5c3703f519a.css"></noscript></head>
100
100
  <body>
101
101
  <app-root></app-root>
102
102
 
@@ -146,5 +146,5 @@
146
146
  </style>
147
147
  </noscript>
148
148
 
149
- <script src="runtime.js" type="module"></script><script src="polyfills.js" type="module"></script><script src="main.js" type="module"></script></body>
149
+ <script src="runtime.bfd9b30f865686f0.js" type="module"></script><script src="polyfills.a6d93c3e94967b29.js" type="module"></script><script src="main.7af59190ebaf6c36.js" type="module"></script></body>
150
150
  </html>