forms-angular 0.12.0-beta.217 → 0.12.0-beta.218

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.
@@ -22,10 +22,10 @@ declare module fng {
22
22
  // disabled ancestor checks.
23
23
  skipDisabledAncestorSecurityFuncName?: string;
24
24
  // how the function identified by elemSecurityFuncName should be bound. "instant" means that it will be called
25
- // as the markup is being constructed, with 'hidden' elements not included in the markup at all, and disable elements
25
+ // as the markup is being constructed, with 'hidden' elements not included in the markup at all, and disabled elements
26
26
  // given a simple DISABLED attribute. this is the most efficient approach. "one-time" will add ng-hide and
27
27
  // ng-disabled directives to the relevant elements, with one-time binding to the security function. this is
28
- // also reasonably efficient (but not as efficient as "instant" due to the need for watches). "normal" will not use
28
+ // also reasonably efficient (but not as efficient as "instant", due to the need for watches). "normal" will not use
29
29
  // one-time binding, which has the potential to be highly resource-intensive on large forms. which
30
30
  // option is chosen will depend upon when the function identified by elemSecurityFuncName will be ready to
31
31
  // make the necessary determination.
@@ -306,7 +306,7 @@ declare module fng {
306
306
  master: any;
307
307
  allowLocationChange: boolean; // Do we allow location change or prompt for permission
308
308
  }
309
- export interface IRecordHandler {
309
+ export interface IRecordHandlerService {
310
310
  convertToMongoModel(schema: IControlledFormSchema, anObject: any, prefixLength: number, scope: IFormScope): any;
311
311
  createNew(dataToSave: any, options: any, scope: IFormScope, ctrlState: IFngCtrlState): void;
312
312
  deleteRecord(id: string, scope: IFormScope, ctrlState: IFngCtrlState): void;
@@ -327,7 +327,7 @@ declare module fng {
327
327
  handleInternalLookup($scope: IFormScope, formInstructions, ref): void;
328
328
  preservePristine(element, fn): void;
329
329
  convertIdToListValue(id, idsArray, valuesArray, fname);
330
- decorateScope($scope: IFormScope, $uibModal, recordHandlerInstance: IRecordHandler, ctrlState);
330
+ decorateScope($scope: IFormScope, $uibModal, recordHandlerInstance: IRecordHandlerService, ctrlState);
331
331
  fillFormFromBackendCustomSchema(
332
332
  schema,
333
333
  $scope: IFormScope,
@@ -339,7 +339,7 @@ declare module fng {
339
339
  handleError($scope: IFormScope);
340
340
  }
341
341
 
342
- export interface IFormGenerator {
342
+ export interface IFormGeneratorService {
343
343
  generateEditUrl(obj, $scope: IFormScope): string;
344
344
  generateViewUrl(obj, $scope: IFormScope): string;
345
345
  generateNewUrl($scope: IFormScope): string;
@@ -359,7 +359,7 @@ declare module fng {
359
359
  unshift(fieldName: string, $event, $scope: IFormScope, modelOverride?: any);
360
360
  remove(fieldName: string, value, $event, $scope: IFormScope, modelOverride?: any);
361
361
  hasError(formName, name, index, $scope: IFormScope);
362
- decorateScope($scope: IFormScope, formGeneratorInstance, recordHandlerInstance: IRecordHandler, sharedStuff, pseudoUrl?: string);
362
+ decorateScope($scope: IFormScope, formGeneratorInstance: IFormGeneratorService, recordHandlerInstance: IRecordHandlerService, sharedStuff, pseudoUrl?: string);
363
363
  }
364
364
 
365
365
  export interface IFngSingleLookupHandler {
@@ -469,7 +469,7 @@ declare module fng {
469
469
  clearTimeout: () => void;
470
470
  handleHttpError: (response: any) => void;
471
471
  dropConversionWatcher: () => void;
472
- readingRecord?: Promise<any>;
472
+ readingRecord?: angular.IPromise<any>;
473
473
  onSchemaFetch?: (description: string, source: IFieldViewInfo[]) => void;
474
474
  onSchemaProcessed?: (description: string, formSchema: IFormInstruction[]) => void;
475
475
  updateQueryForTab?: (tab: string) => void;
@@ -506,6 +506,10 @@ declare module fng {
506
506
  editing: boolean;
507
507
  }
508
508
 
509
+ export interface IModelCtrlService {
510
+ loadControllerAndMenu: (sharedData: any, titleCaseModelName: string, level: number, needDivider: boolean, scope: angular.IScope) => void;
511
+ }
512
+
509
513
  export interface IModelController extends IFormScope {
510
514
  onBaseCtrlReady?: (baseScope: IFormScope) => void; // Optional callback after form is instantiated
511
515
  onAllReady?: (baseScope: IFormScope) => void; // Optional callback after form is instantiated and populated
@@ -561,13 +565,18 @@ declare module fng {
561
565
 
562
566
  export interface IBuiltInRoute {
563
567
  route: string;
564
- state: string;
565
- templateUrl: string;
566
- options?: any;
568
+ state?: string;
569
+ templateUrl?: string;
570
+ options?: {
571
+ authenticate?: boolean;
572
+ templateUrl?: string | (() => void);
573
+ template?: string;
574
+ controller?: string;
575
+ }
567
576
  }
568
577
 
569
578
  export interface IRoutingConfig {
570
- hashPrefix: string;
579
+ hashPrefix?: string;
571
580
  html5Mode: boolean;
572
581
  routing: string; // What sort of routing do we want? ngroute or uirouter.
573
582
  // TODO Should be enum
@@ -618,7 +627,7 @@ declare module fng {
618
627
  }
619
628
 
620
629
 
621
- interface IPluginHelper {
630
+ interface IPluginHelperService {
622
631
  extractFromAttr: (
623
632
  attr: any,
624
633
  directiveName: string
@@ -690,6 +699,108 @@ declare module fng {
690
699
  getDisableableAncestorAttrs: (id: string) => string;
691
700
  generateDisabledAttr: (id: string, scope: fng.ISecurableScope, params?: IGenerateDisableAttrParams) => string;
692
701
  }
702
+
703
+ interface IListQueryOptions {
704
+ limit?: number;
705
+ find?: any; // e.g., { "careWorker.isCareWorker": true }
706
+ aggregate?: any;
707
+ projection?: any;
708
+ order?: any; // e.g., { familyName: -1, givenName: -1 }
709
+ skip?: number;
710
+ concatenate?: boolean; // whether the list fields should be concatenated into a single .text property
711
+ }
712
+
713
+ interface ISubmissionsService {
714
+ // return all of the list attributes of the record from db.<modelName>.<id>
715
+ // where returnRaw is true, the document (albeit with only its list attributes present) will be returned without transformation
716
+ // otherwise, the list fields will be concatenated (space-seperated) and returned as the list property of a record { list: string }
717
+ // e.g., "John Doe", in the case of a person
718
+ getListAttributes: (
719
+ modelName: string,
720
+ id: string,
721
+ returnRaw?: boolean
722
+ ) => angular.IHttpPromise<{ list: string } | any>;
723
+ readRecord: (modelName: string, id: string, formName?: string) => angular.IHttpPromise<any>;
724
+ getAll: (modelName: string, _options: any) => angular.IHttpPromise<any[]>;
725
+ getAllListAttributes: (ref: string) => angular.IHttpPromise<ILookupItem[]>;
726
+ getPagedAndFilteredList: (
727
+ modelName: string,
728
+ options: IListQueryOptions
729
+ ) => angular.IHttpPromise<any[]>;
730
+ getPagedAndFilteredListFull: (
731
+ modelName: string,
732
+ options: IListQueryOptions
733
+ ) => angular.IHttpPromise<any[]>;
734
+ deleteRecord: (model: string, id: string, formName: string) => angular.IHttpPromise<void>;
735
+ updateRecord: (modelName: string, id: string, dataToSave: any, formName?: string) => angular.IHttpPromise<any>;
736
+ createRecord: (modelName: string, dataToSave: any, formName?: string) => angular.IHttpPromise<any>;
737
+ useCache: (val: boolean) => void;
738
+ clearCache: () => void;
739
+ getCache: () => boolean;
740
+ }
741
+
742
+ interface IRoutingServiceProvider {
743
+ start: (options: IRoutingConfig) => void;
744
+ addRoutes: (fixedRoutes: Array<IBuiltInRoute>, fngRoutes:Array<IBuiltInRoute>) => void;
745
+ registerAction: (action: string) => void;
746
+ $get: () => IRoutingService;
747
+ }
748
+
749
+ interface IRoutingService {
750
+ router: () => string;
751
+ prefix: () => string;
752
+ parsePathFunc: () => (location: string) => void;
753
+ html5hash: () => string;
754
+ buildUrl: (path: string) => string;
755
+ buildOperationUrl: (
756
+ prefix: string,
757
+ operation: string,
758
+ modelName: string,
759
+ formName: string,
760
+ id: string,
761
+ tabName?: string
762
+ ) => string;
763
+ redirectTo: () => (operation: string, scope: IFormScope, LocationService: angular.ILocationService, id?: string, tab?: string) => void;
764
+ }
765
+
766
+ interface ICssFrameworkServiceProvider {
767
+ setOptions: (options: { framework: string }) => void;
768
+ $get: () => ICssFrameworkService;
769
+ }
770
+
771
+ interface ICssFrameworkService {
772
+ framework: () => string;
773
+ span: (cols: number) => string;
774
+ offset: (cols: number) => string;
775
+ rowFluid: () => string;
776
+ }
777
+
778
+ interface IFngUiSelectHelperService {
779
+ windowChanged: (width: number, height: number) => boolean;
780
+ addClientLookup: (lkpName: string, lkpData: any) => void;
781
+ clearCache: () => void;
782
+ lookupFunc: (value: string, formSchema: IFormInstruction, cb: (formSchema: IFormInstruction, value: ILookupItem ) => void) => void;
783
+ doOwnConversion: (scope: IFormScope, processedAttrs: any, ref: string) => void;
784
+ }
785
+
786
+ interface IFormMarkupHelperService {
787
+ isHorizontalStyle: (formStyle: string, includeStacked: boolean) => boolean;
788
+ isArrayElement: (scope: angular.IScope, info: fng.IFormInstruction, options: fng.IFormOptions) => boolean;
789
+ fieldChrome: (scope: fng.IFormScope, info: fng.IFormInstruction, options: fng.IFormOptions) => { omit?: boolean, template?: string, closeTag?: string };
790
+ label: (scope: fng.IFormScope, fieldInfo: fng.IFormInstruction, addButtonMarkup: boolean, options: fng.IFormOptions) => string;
791
+ glyphClass: () => string;
792
+ allInputsVars: (scope: angular.IScope, fieldInfo: fng.IFormInstruction, options: fng.IFormOptions, modelString: string, idString: string, nameString: string) => Partial<fng.IBuildingBlocks>;
793
+ inputChrome: (value: string, fieldInfo: fng.IFormInstruction, options: fng.IFormOptions, markupVars) => string;
794
+ generateSimpleInput: (common: string, fieldInfo: fng.IFormInstruction, options: fng.IFormOptions) => string;
795
+ controlDivClasses: (options: fng.IFormOptions) => string[];
796
+ handleInputAndControlDiv: (inputMarkup: string, controlDivClasses: string[]) => string;
797
+ handleArrayInputAndControlDiv: (inputMarkup: string, controlDivClasses: string[], scope: fng.IFormScope, info: fng.IFormInstruction, options: fng.IFormOptions) => string;
798
+ addTextInputMarkup: (allInputsVars: Partial<fng.IBuildingBlocks>, fieldInfo: fng.IFormInstruction, requiredStr: string) => string;
799
+ handleReadOnlyDisabled: (partialFieldInfo: { name: string, id?: string, nonUniqueId?: string, readonly?: boolean | string }, scope: fng.IFormScope) => string[];
800
+ generateArrayElementIdString: (idString: string, info: fng.IFormInstruction, options: fng.IFormOptions) => string;
801
+ genDisableableAncestorStr: (id: string) => string;
802
+ generateNgShow(showWhen: IFngShowWhen, model: string): string;
803
+ }
693
804
  }
694
805
 
695
806
  declare var formsAngular: fng.IFng;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Mark Chapman <support@forms-angular.org>",
4
4
  "description": "A form builder that sits on top of Angular.js, Twitter Bootstrap, jQuery UI, Angular-UI, Express and Mongoose. Opinionated or what?",
5
5
  "homepage": "http://forms-angular.org",
6
- "version": "0.12.0-beta.217",
6
+ "version": "0.12.0-beta.218",
7
7
  "engines": {
8
8
  "node": ">=8.x",
9
9
  "npm": ">=5.x"
@@ -87,7 +87,7 @@
87
87
  "karma-ng-html2js-preprocessor": "1.0.0",
88
88
  "matchdep": "2.0.0",
89
89
  "mocha": "^10.2.0",
90
- "mongoose": "^7.1.1",
90
+ "mongoose": "^7.3.1",
91
91
  "prettier": "2.8.1",
92
92
  "pump": "3.0.0",
93
93
  "typescript": "4.6.3"