forms-angular 0.12.0-beta.28 → 0.12.0-beta.280
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/client/forms-angular-bs-common.less +185 -2
- package/dist/client/forms-angular-bs2-specific.less +1 -1
- package/dist/client/forms-angular-bs3-specific.less +1 -1
- package/dist/client/forms-angular-with-bs2.css +2 -2
- package/dist/client/forms-angular-with-bs3.css +1 -1
- package/dist/client/forms-angular.js +2774 -982
- package/dist/client/forms-angular.min.js +1 -1
- package/dist/client/index.d.ts +519 -116
- package/dist/server/data_form.js +1799 -924
- package/dist/server/index.d.ts +134 -0
- package/package.json +40 -42
- package/CHANGELOG.md +0 -256
package/dist/client/index.d.ts
CHANGED
|
@@ -1,10 +1,65 @@
|
|
|
1
1
|
declare module fng {
|
|
2
|
-
|
|
2
|
+
export interface IFng extends angular.IModule {
|
|
3
|
+
beforeProcess?: (scope: IFormScope, cb: (err?: Error) => void) => void;
|
|
4
|
+
beforeHandleIncomingDataPromises?: () => angular.IPromise<any>[];
|
|
5
|
+
pseudo?: (token: string, upperFirst: boolean) => string;
|
|
6
|
+
title?: { prefix?: string; suffix?: string };
|
|
7
|
+
// when provided, the named function (assumed to be present on $rootscope) will be used to determine the visibility
|
|
8
|
+
// of menu items and control groups
|
|
9
|
+
hiddenSecurityFuncName?: string;
|
|
10
|
+
// when provided, the named function (assumed to be present on $rootscope) will be used to determine the disabled
|
|
11
|
+
// state of menu items and individual form input controls
|
|
12
|
+
disabledSecurityFuncName?: string;
|
|
13
|
+
// when provided, the named function (assumed to be present on $rootscope) will be called each time a new page
|
|
14
|
+
// or popup is accessed, providing the host app with the opportunity to confirm whether there are ANY hidden elements
|
|
15
|
+
// at all on that page. where there are not, we can optimise by skipping logic relating to DOM element visibility.
|
|
16
|
+
skipHiddenSecurityFuncName?: string;
|
|
17
|
+
// when provided, the named function (assumed to be present on $rootscope) will be called each time a new page
|
|
18
|
+
// or popup is accessed, providing the host app with the opportunity to confirm whether there are ANY disabled elements
|
|
19
|
+
// at all on that page. where there are not, we can optimise by skipping logic relating to disabling DOM elements.
|
|
20
|
+
skipDisabledSecurityFuncName?: string;
|
|
21
|
+
// when provided, the named function (assumed to be present on $rootscope) will be called each time a new page
|
|
22
|
+
// or popup is accessed, providing the host app with the opportunity to confirm whether there are ANY elements on that
|
|
23
|
+
// page that require their child elements to be disabled. where there are not, we can optimise by skipping
|
|
24
|
+
// disabled ancestor checks.
|
|
25
|
+
skipDisabledAncestorSecurityFuncName?: string;
|
|
26
|
+
// how the function identified by elemSecurityFuncName should be bound. "instant" means that it will be called
|
|
27
|
+
// as the markup is being constructed, with 'hidden' elements not included in the markup at all, and disabled elements
|
|
28
|
+
// given a simple DISABLED attribute. this is the most efficient approach. "one-time" will add ng-hide and
|
|
29
|
+
// ng-disabled directives to the relevant elements, with one-time binding to the security function. this is
|
|
30
|
+
// also reasonably efficient (but not as efficient as "instant", due to the need for watches). "normal" will not use
|
|
31
|
+
// one-time binding, which has the potential to be highly resource-intensive on large forms. which
|
|
32
|
+
// option is chosen will depend upon when the function identified by elemSecurityFuncName will be ready to
|
|
33
|
+
// make the necessary determination.
|
|
34
|
+
elemSecurityFuncBinding?: "instant" | "one-time" | "normal";
|
|
35
|
+
hideableAttr?: string; // an attribute to mark all elements that can be hidden using security
|
|
36
|
+
disableableAttr?: string; // an attribute to mark all elements that can be disabled using security
|
|
37
|
+
disableableAncestorAttr?: string; // an attribute to mark all elements whose children can all be disabled using "disabled + children" security
|
|
38
|
+
// if an element's id is a partial match on any of this array's contents, it will never be marked with hideableAttr/disableableAttr
|
|
39
|
+
ignoreIdsForHideableOrDisableableAttrs?: string[];
|
|
40
|
+
keyboardShortCuts? : {
|
|
41
|
+
letter: string;
|
|
42
|
+
keycode: number;
|
|
43
|
+
id: string;
|
|
44
|
+
desc: string;
|
|
45
|
+
} [];
|
|
46
|
+
}
|
|
47
|
+
var formsAngular: IFng;
|
|
3
48
|
|
|
4
49
|
/*
|
|
5
50
|
Type definitions for types that are used on both the client and the server
|
|
6
51
|
*/
|
|
52
|
+
type formStyle = "inline" | "vertical" | "horizontal" | "horizontalCompact" | "stacked";
|
|
53
|
+
|
|
54
|
+
export interface IBaseArrayLookupReference {
|
|
55
|
+
property: string;
|
|
56
|
+
value: string;
|
|
57
|
+
}
|
|
7
58
|
|
|
59
|
+
interface ILookupItem {
|
|
60
|
+
id: string;
|
|
61
|
+
text: string;
|
|
62
|
+
}
|
|
8
63
|
/*
|
|
9
64
|
IInternalLookupreference makes it possible to look up from a list (of key / value pairs) in the current record. For example
|
|
10
65
|
|
|
@@ -18,9 +73,8 @@ declare module fng {
|
|
|
18
73
|
favouriteShelf: {type: Schema.Types.ObjectId, internalRef: {property: 'shelves', value:'location'};
|
|
19
74
|
});
|
|
20
75
|
*/
|
|
21
|
-
export interface IFngInternalLookupReference {
|
|
22
|
-
|
|
23
|
-
value: string;
|
|
76
|
+
export interface IFngInternalLookupReference extends IBaseArrayLookupReference {
|
|
77
|
+
noConvert?: boolean; // can be used by a tricksy hack to get around nesting limitations
|
|
24
78
|
}
|
|
25
79
|
|
|
26
80
|
/*
|
|
@@ -33,14 +87,12 @@ declare module fng {
|
|
|
33
87
|
shelf: {type: Schema.Types.ObjectId, lookupListRef: {collection:'k_referencing_self_collection', id:'$warehouse', property: 'shelves', value:'location'}},
|
|
34
88
|
};
|
|
35
89
|
*/
|
|
36
|
-
export interface IFngLookupListReference {
|
|
37
|
-
collection: string;
|
|
90
|
+
export interface IFngLookupListReference extends IBaseArrayLookupReference {
|
|
91
|
+
collection: string; // collection that contains the list
|
|
38
92
|
/*
|
|
39
93
|
Some means of calculating _id in collection. If it starts with $ then it is property in record
|
|
40
94
|
*/
|
|
41
95
|
id: string;
|
|
42
|
-
property: string;
|
|
43
|
-
value: string;
|
|
44
96
|
}
|
|
45
97
|
|
|
46
98
|
/*
|
|
@@ -59,7 +111,7 @@ declare module fng {
|
|
|
59
111
|
*/
|
|
60
112
|
export interface IFngShowWhen {
|
|
61
113
|
lhs: any;
|
|
62
|
-
comp:
|
|
114
|
+
comp: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
63
115
|
rhs: any;
|
|
64
116
|
}
|
|
65
117
|
|
|
@@ -67,11 +119,15 @@ declare module fng {
|
|
|
67
119
|
link allows the setting up of hyperlinks for lookup reference fields
|
|
68
120
|
*/
|
|
69
121
|
export interface IFngLinkSetup {
|
|
70
|
-
linkOnly?: boolean;
|
|
71
|
-
|
|
72
|
-
|
|
122
|
+
linkOnly?: boolean; // if true then the input element is not generated (this overrides label)
|
|
123
|
+
label?: boolean; // Make a link out of the label (causes text to be overridden) (this overrides text)
|
|
124
|
+
form?: string; // can be used to generate a link to a custom schema
|
|
125
|
+
linktab?: string; // can be used to generate a link to a tab on a form
|
|
126
|
+
text?: string; // the literal value used for the link. If this property is omitted then text is generated from the field values of the document referred to by the link.
|
|
73
127
|
}
|
|
74
128
|
|
|
129
|
+
export type FieldSizeString = "mini" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "block-level"; // sets control width. Default is 'medium''
|
|
130
|
+
|
|
75
131
|
export interface IFngSchemaTypeFormOpts {
|
|
76
132
|
/*
|
|
77
133
|
The input type to be generated - which must be compatible with the Mongoose type.
|
|
@@ -90,34 +146,36 @@ declare module fng {
|
|
|
90
146
|
*/
|
|
91
147
|
type?: string;
|
|
92
148
|
|
|
93
|
-
hidden?: boolean;
|
|
94
|
-
label?: string | null;
|
|
95
|
-
ref?: string;
|
|
96
|
-
internalRef
|
|
149
|
+
hidden?: boolean; // inhibits this schema key from appearing on the generated form.
|
|
150
|
+
label?: string | null; // overrides the default input label. label:null suppresses the label altogether.
|
|
151
|
+
ref?: string; // reference to another collection
|
|
152
|
+
internalRef?: IFngInternalLookupReference;
|
|
97
153
|
lookupListRef?: IFngLookupListReference;
|
|
98
154
|
id?: string; // specifies the id of the input field (which defaults to f_name)
|
|
99
155
|
|
|
100
|
-
placeHolder?: string // adds placeholder text to the input (depending on data type).
|
|
101
|
-
help?: string;
|
|
102
|
-
helpInline?: string;
|
|
103
|
-
popup?: string;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
156
|
+
placeHolder?: string; // adds placeholder text to the input (depending on data type).
|
|
157
|
+
help?: string; // adds help text under the input.
|
|
158
|
+
helpInline?: string; // adds help to the right of the input.
|
|
159
|
+
popup?: string; // adds title (popup help) as specified.
|
|
160
|
+
ariaLabel?: string; // adds aria-label as specified.
|
|
161
|
+
order?: number; // allows user to specify the order / tab order of this field in the form. This overrides the position in the Mongoose schema.
|
|
162
|
+
size?: FieldSizeString;
|
|
163
|
+
readonly?: boolean | string; // adds the readonly or ng-readonly attribute to the generated input (currently doesn't work with date - and perhaps other types).
|
|
164
|
+
rows?: number | "auto"; // sets the number of rows in inputs (such as textarea) that support this. Setting rows to "auto" makes the textarea expand to fit the content, rather than create a scrollbar.
|
|
165
|
+
tab?: string; // Used to divide a large form up into a tabset with multiple tabs
|
|
166
|
+
showWhen?: IFngShowWhen | string; // allows conditional display of fields based on values elsewhere. string must be an abular expression.
|
|
110
167
|
|
|
111
168
|
/*
|
|
112
169
|
add: 'class="myClass"' allows custom styling of a specific input
|
|
113
170
|
Angular model options can be used - for example add: 'ng-model-options="{updateOn: \'default blur\', debounce: { \'default\': 500, \'blur\': 0 }}" '
|
|
114
171
|
custom validation directives, such as the timezone validation in this schema
|
|
115
172
|
*/
|
|
116
|
-
add?: string;
|
|
173
|
+
add?: string; // allows arbitrary attributes to be added to the input tag.
|
|
117
174
|
|
|
118
|
-
class?: string;
|
|
119
|
-
inlineRadio?: boolean;
|
|
175
|
+
class?: string; // allows arbitrary classes to be added to the input tag.
|
|
176
|
+
inlineRadio?: boolean; // (only valid when type is radio) should be set to true to present all radio button options in a single line
|
|
120
177
|
link?: IFngLinkSetup; // handles displaying links for ref lookups
|
|
178
|
+
asText?: boolean; // (only valid when type is ObjectId) should be set to true to force a simple text input rather than a select. presumed for advanced cases where the objectid is going to be pasted in.
|
|
121
179
|
|
|
122
180
|
/*
|
|
123
181
|
With a select / radio type you can specify the options.
|
|
@@ -140,17 +198,35 @@ declare module fng {
|
|
|
140
198
|
/*
|
|
141
199
|
The next few options relate to the handling and display of arrays (including arrays of subdocuments)
|
|
142
200
|
*/
|
|
143
|
-
noAdd?: boolean; // inhibits an Add button being generated for arrays.
|
|
201
|
+
noAdd?: boolean | string; // inhibits an Add button being generated for arrays.
|
|
202
|
+
noneIndicator?: boolean; // show "None" where there's no add button and no array items
|
|
144
203
|
unshift?: boolean; // (for arrays of sub documents) puts an add button in the sub schema header which allows insertion of new sub documents at the beginning of the array.
|
|
145
|
-
noRemove?: boolean;
|
|
146
|
-
formstyle?:
|
|
147
|
-
sortable
|
|
204
|
+
noRemove?: boolean | string; // inhibits a Remove button being generated for array elements.
|
|
205
|
+
formstyle?: formStyle; // (only valid on a sub schema) sets style of sub form.
|
|
206
|
+
sortable?: boolean | string; // Allows drag and drop sorting of arrays - requires angular-ui-sortable
|
|
207
|
+
ngClass?: string; // Allows for conditional per-item styling through the addition of an ng-class expression to the class list of li elements created for each item in the array
|
|
208
|
+
filterable?: boolean; // Add a data-ng-hide to all array elements, referring to subDoc._hidden. Does not actually (yet) provide a UI for managing this property, however (which needs to be done via an external directive)
|
|
209
|
+
subDocContainerType?:
|
|
210
|
+
| "fieldset"
|
|
211
|
+
| "well"
|
|
212
|
+
| "well-large"
|
|
213
|
+
| "well-small"
|
|
214
|
+
| string
|
|
215
|
+
| ((info) => { before: ""; after: "" }); // allows each element in the array to be nested in a container
|
|
216
|
+
subDocContainerProps?: any; // the parameters that will be passed if subDocContainerType is a function
|
|
148
217
|
|
|
149
218
|
/*
|
|
150
219
|
The next section relates to the display of sub documents
|
|
151
220
|
*/
|
|
152
221
|
customSubDoc?: string; // Allows you to specify custom HTML (which may include directives) for the sub doc
|
|
222
|
+
customHeader?: string; // Allows you to specify custom HTML (which may include directives) for the header of a group of sub docs
|
|
153
223
|
customFooter?: string; // Allows you to specify custom HTML (which may include directives) for the footer of a group of sub docs
|
|
224
|
+
|
|
225
|
+
/*
|
|
226
|
+
Suppresses warnings about attenpting deep nesting which would be logged to console in some circumstances when a
|
|
227
|
+
directive fakes deep nesting
|
|
228
|
+
*/
|
|
229
|
+
suppressNestingWarning?: boolean;
|
|
154
230
|
}
|
|
155
231
|
|
|
156
232
|
// Schema passed from server - derived from Mongoose schema
|
|
@@ -158,30 +234,56 @@ declare module fng {
|
|
|
158
234
|
name: string;
|
|
159
235
|
schema?: Array<IFieldViewInfo>;
|
|
160
236
|
array?: boolean;
|
|
161
|
-
showIf
|
|
237
|
+
showIf?: any;
|
|
162
238
|
required?: boolean;
|
|
163
|
-
step
|
|
239
|
+
step?: number;
|
|
164
240
|
}
|
|
165
241
|
|
|
242
|
+
export type fieldType =
|
|
243
|
+
| "string"
|
|
244
|
+
| "text"
|
|
245
|
+
| "textarea"
|
|
246
|
+
| "number"
|
|
247
|
+
| "select"
|
|
248
|
+
| "link"
|
|
249
|
+
| "date"
|
|
250
|
+
| "checkbox"
|
|
251
|
+
| "password"
|
|
252
|
+
| "radio";
|
|
253
|
+
|
|
166
254
|
// Schema used internally on client - often derived from IFieldViewInfo passed from server
|
|
167
255
|
export interface IFormInstruction extends IFieldViewInfo {
|
|
168
|
-
id
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
256
|
+
id?: string; // id of generated DOM element
|
|
257
|
+
nonUniqueId?: string; // where this field is part of a sub-sub-schema, id is likely to include $index from the sub-schema, to ensure uniqueness. provide it here without reference to $parent.$index for use in security evaluations.
|
|
258
|
+
type?: fieldType;
|
|
259
|
+
defaultValue?: any;
|
|
260
|
+
rows?: number;
|
|
261
|
+
label?: string;
|
|
172
262
|
options?: any;
|
|
173
263
|
ids?: any;
|
|
174
264
|
hidden?: boolean;
|
|
175
265
|
tab?: string;
|
|
176
|
-
add
|
|
177
|
-
ref
|
|
178
|
-
link
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
266
|
+
add?: string;
|
|
267
|
+
ref?: any;
|
|
268
|
+
link?: any;
|
|
269
|
+
linktext?: string;
|
|
270
|
+
linklabel?: boolean;
|
|
271
|
+
form?: string; // the form that is linked to
|
|
272
|
+
select2?: any; // deprecated
|
|
273
|
+
schema?: IFormInstruction[]; // If the field is an array of fields
|
|
274
|
+
intType?: "date";
|
|
275
|
+
coloffset?: number;
|
|
276
|
+
[directiveOptions: string]: any;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
interface IContainerInstructions {
|
|
280
|
+
before?: string;
|
|
281
|
+
after?: string;
|
|
282
|
+
omit?: boolean;
|
|
183
283
|
}
|
|
184
284
|
|
|
285
|
+
export type HiddenTabReintroductionMethod = "none" | "tab";
|
|
286
|
+
|
|
185
287
|
export interface IContainer {
|
|
186
288
|
/*
|
|
187
289
|
Type of container, which determines markup. This is currently only available when the schema is generated by
|
|
@@ -189,14 +291,25 @@ declare module fng {
|
|
|
189
291
|
In the case of a string which does not match one of the predefined options
|
|
190
292
|
the generated container div is given the class of the name
|
|
191
293
|
*/
|
|
192
|
-
containerType:
|
|
294
|
+
containerType: "fieldset" | "well" | "tabset" | "tab" | "+tab" | "well-large" | "well-small" | string | ((info: IContainer) => IContainerInstructions);
|
|
193
295
|
title?: string;
|
|
296
|
+
/*
|
|
297
|
+
Applies only to tabs - causing them to be rendered with a x for closing ('hiding') the tab in question.
|
|
298
|
+
Where hideable is true, hiddenTabArrayProp can be used to specify a property name (which can include ".", and which
|
|
299
|
+
will be assumed to identiy an array) that should be used to store the ids of closed ('hidden') tabs.
|
|
300
|
+
Where this is not specified, record.hiddenTabs will be used.
|
|
301
|
+
If hiddenTabReintroductionMethod is set to "tab", an additional tab will be added to the end of the tabset
|
|
302
|
+
with a + heading, and clicking on this will provide a UI for re-introducing hidden tabs.
|
|
303
|
+
*/
|
|
304
|
+
hideable?: boolean;
|
|
305
|
+
hiddenTabArrayProp?: string;
|
|
306
|
+
hiddenTabReintroductionMethod?: HiddenTabReintroductionMethod;
|
|
194
307
|
/*
|
|
195
308
|
h1...h6 will use a header style
|
|
196
309
|
anything else will be used as a paragraph stype
|
|
197
310
|
*/
|
|
198
|
-
titleTagOrClass
|
|
199
|
-
content:
|
|
311
|
+
titleTagOrClass?: string;
|
|
312
|
+
content: IFormSchemaElement[];
|
|
200
313
|
}
|
|
201
314
|
|
|
202
315
|
export type IFormSchemaElement = IFormInstruction | IContainer;
|
|
@@ -207,57 +320,83 @@ declare module fng {
|
|
|
207
320
|
export interface IEnumInstruction {
|
|
208
321
|
repeat: string;
|
|
209
322
|
value: string;
|
|
210
|
-
label
|
|
323
|
+
label?: string;
|
|
211
324
|
}
|
|
212
325
|
|
|
213
326
|
export interface IFngCtrlState {
|
|
214
327
|
master: any;
|
|
215
|
-
allowLocationChange: boolean;
|
|
328
|
+
allowLocationChange: boolean; // Do we allow location change or prompt for permission
|
|
216
329
|
}
|
|
217
|
-
export interface
|
|
330
|
+
export interface IRecordHandlerService {
|
|
218
331
|
convertToMongoModel(schema: IControlledFormSchema, anObject: any, prefixLength: number, scope: IFormScope): any;
|
|
219
332
|
createNew(dataToSave: any, options: any, scope: IFormScope, ctrlState: IFngCtrlState): void;
|
|
220
|
-
deleteRecord(
|
|
221
|
-
updateDocument(dataToSave
|
|
222
|
-
|
|
333
|
+
deleteRecord(id: string, scope: IFormScope, ctrlState: IFngCtrlState): void;
|
|
334
|
+
updateDocument(dataToSave: any, options: any, scope: IFormScope, ctrlState: IFngCtrlState): void;
|
|
335
|
+
beginReadingRecord($scope: IFormScope): void;
|
|
336
|
+
finishReadingThenProcessRecord($scope: IFormScope, ctrlState): void;
|
|
223
337
|
scrollTheList($scope: IFormScope);
|
|
224
338
|
getListData(record, fieldName, listSchema?, $scope?: IFormScope);
|
|
225
339
|
suffixCleanId(inst, suffix);
|
|
226
|
-
setData(object, fieldname, element, value);
|
|
340
|
+
setData(object, fieldname: string, element, value);
|
|
341
|
+
getData(object, fieldname: string, element?: any);
|
|
227
342
|
setUpLookupOptions(lookupCollection, schemaElement, $scope: IFormScope, ctrlState, handleSchema);
|
|
228
|
-
setUpLookupListOptions: (
|
|
343
|
+
setUpLookupListOptions: (
|
|
344
|
+
ref: IFngLookupListReference,
|
|
345
|
+
formInstructions: IFormInstruction,
|
|
346
|
+
$scope: IFormScope,
|
|
347
|
+
ctrlState: IFngCtrlState
|
|
348
|
+
) => void;
|
|
229
349
|
handleInternalLookup($scope: IFormScope, formInstructions, ref): void;
|
|
230
350
|
preservePristine(element, fn): void;
|
|
231
351
|
convertIdToListValue(id, idsArray, valuesArray, fname);
|
|
232
|
-
decorateScope($scope:IFormScope, $uibModal, recordHandlerInstance
|
|
233
|
-
fillFormFromBackendCustomSchema(
|
|
352
|
+
decorateScope($scope: IFormScope, $uibModal, recordHandlerInstance: IRecordHandlerService, ctrlState);
|
|
353
|
+
fillFormFromBackendCustomSchema(
|
|
354
|
+
schema,
|
|
355
|
+
$scope: IFormScope,
|
|
356
|
+
formGeneratorInstance,
|
|
357
|
+
recordHandlerInstance,
|
|
358
|
+
ctrlState
|
|
359
|
+
);
|
|
234
360
|
fillFormWithBackendSchema($scope: IFormScope, formGeneratorInstance, recordHandlerInstance, ctrlState);
|
|
235
361
|
handleError($scope: IFormScope);
|
|
236
362
|
}
|
|
237
363
|
|
|
238
|
-
export interface
|
|
239
|
-
generateEditUrl(obj, $scope:IFormScope): string;
|
|
364
|
+
export interface IFormGeneratorService {
|
|
365
|
+
generateEditUrl(obj, $scope: IFormScope): string;
|
|
366
|
+
generateViewUrl(obj, $scope: IFormScope): string;
|
|
240
367
|
generateNewUrl($scope: IFormScope): string;
|
|
241
368
|
handleFieldType(formInstructions, mongooseType, mongooseOptions, $scope: IFormScope, ctrlState);
|
|
242
|
-
handleSchema(
|
|
369
|
+
handleSchema(
|
|
370
|
+
description: string,
|
|
371
|
+
source,
|
|
372
|
+
destForm,
|
|
373
|
+
destList,
|
|
374
|
+
prefix,
|
|
375
|
+
doRecursion: boolean,
|
|
376
|
+
$scope: IFormScope,
|
|
377
|
+
ctrlState
|
|
378
|
+
);
|
|
243
379
|
updateDataDependentDisplay(curValue, oldValue, force, $scope: IFormScope);
|
|
244
|
-
add(fieldName, $event, $scope: IFormScope);
|
|
245
|
-
unshift(fieldName, $event, $scope: IFormScope);
|
|
246
|
-
remove(fieldName, value, $event, $scope: IFormScope);
|
|
380
|
+
add(fieldName: string, $event, $scope: IFormScope, modelOverride?: any);
|
|
381
|
+
unshift(fieldName: string, $event, $scope: IFormScope, modelOverride?: any);
|
|
382
|
+
remove(fieldName: string, value, $event, $scope: IFormScope, modelOverride?: any);
|
|
247
383
|
hasError(formName, name, index, $scope: IFormScope);
|
|
248
|
-
decorateScope($scope: IFormScope, formGeneratorInstance, recordHandlerInstance:
|
|
384
|
+
decorateScope($scope: IFormScope, formGeneratorInstance: IFormGeneratorService, recordHandlerInstance: IRecordHandlerService, sharedStuff, pseudoUrl?: string);
|
|
249
385
|
}
|
|
250
386
|
|
|
251
387
|
export interface IFngSingleLookupHandler {
|
|
252
388
|
formInstructions: IFormInstruction;
|
|
253
389
|
lastPart: string;
|
|
254
390
|
possibleArray: string;
|
|
391
|
+
// If the looked-up record changes, we use these fields to see if the old lookup value also exists in the new lookup record
|
|
392
|
+
oldValue?: string | string[];
|
|
393
|
+
oldId?: string | string[];
|
|
255
394
|
}
|
|
256
395
|
|
|
257
396
|
export interface IFngLookupHandler {
|
|
258
397
|
lookupOptions: string[];
|
|
259
398
|
lookupIds: string[];
|
|
260
|
-
handlers: IFngSingleLookupHandler[]
|
|
399
|
+
handlers: IFngSingleLookupHandler[];
|
|
261
400
|
}
|
|
262
401
|
|
|
263
402
|
export interface IFngInternalLookupHandlerInfo extends IFngLookupHandler {
|
|
@@ -268,16 +407,32 @@ declare module fng {
|
|
|
268
407
|
ref: IFngLookupListReference;
|
|
269
408
|
}
|
|
270
409
|
|
|
410
|
+
// we cannot use an enum here, so this will have to do. these are the values expected to be returned by the
|
|
411
|
+
// function on $rootScope with the name formsAngular.disabledSecurityFuncName.
|
|
412
|
+
// false = not disabled,
|
|
413
|
+
// true = disabled,
|
|
414
|
+
// "+" = this and all child elements disabled
|
|
415
|
+
export type DisabledOutcome = boolean | "+";
|
|
416
|
+
|
|
417
|
+
export interface ISecurableScope extends angular.IScope {
|
|
418
|
+
// added by ISecurityService
|
|
419
|
+
isSecurelyHidden: (elemId: string) => boolean;
|
|
420
|
+
isSecurelyDisabled: (elemId: string) => boolean;
|
|
421
|
+
requiresDisabledChildren: (elemId: string) => boolean;
|
|
422
|
+
}
|
|
423
|
+
|
|
271
424
|
/*
|
|
272
425
|
The scope which contains form data
|
|
273
426
|
*/
|
|
274
|
-
export interface IFormScope extends
|
|
427
|
+
export interface IFormScope extends ISecurableScope {
|
|
275
428
|
sharedData: any;
|
|
276
|
-
modelNameDisplay
|
|
429
|
+
modelNameDisplay: string;
|
|
277
430
|
modelName: string;
|
|
278
431
|
formName: string;
|
|
279
432
|
alertTitle: any;
|
|
433
|
+
errorVisible: boolean;
|
|
280
434
|
errorMessage: any;
|
|
435
|
+
errorHideTimer: number;
|
|
281
436
|
save: any;
|
|
282
437
|
newRecord: boolean;
|
|
283
438
|
initialiseNewRecord?: any;
|
|
@@ -288,17 +443,16 @@ declare module fng {
|
|
|
288
443
|
isCancelDisabled: any;
|
|
289
444
|
isNewDisabled: any;
|
|
290
445
|
isSaveDisabled: any;
|
|
291
|
-
|
|
446
|
+
whyDisabled: string;
|
|
292
447
|
unconfirmedDelete: boolean;
|
|
293
448
|
getVal: any;
|
|
294
449
|
sortableOptions: any;
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
tab?: string; // title of the active tab - from the route
|
|
450
|
+
tabs?: Array<any>; // In the case of forms that contain a tab set
|
|
451
|
+
tab?: string; // title of the active tab - from the route
|
|
298
452
|
activeTabNo?: number;
|
|
299
|
-
topLevelFormName: string;
|
|
453
|
+
topLevelFormName: string; // The name of the form
|
|
300
454
|
record: any;
|
|
301
|
-
originalData: any;
|
|
455
|
+
originalData: any; // the unconverted data read from the server
|
|
302
456
|
phase: any;
|
|
303
457
|
disableFunctions: any;
|
|
304
458
|
dataEventFunctions: any;
|
|
@@ -310,13 +464,17 @@ declare module fng {
|
|
|
310
464
|
conversions: any;
|
|
311
465
|
pageSize: any;
|
|
312
466
|
pagesLoaded: any;
|
|
467
|
+
redirectOptions?: { redirect?: string; allowChange?: boolean };
|
|
313
468
|
cancel: () => any;
|
|
314
|
-
showError: (error: any, alertTitle
|
|
469
|
+
showError: (error: any, alertTitle?: string) => void;
|
|
315
470
|
prepareForSave: (cb: (error: string, dataToSave?: any) => void) => void;
|
|
471
|
+
setDefaults: (formSchema: IFormSchema, base?: string) => any;
|
|
316
472
|
formSchema: IControlledFormSchema;
|
|
317
473
|
baseSchema: () => Array<any>;
|
|
318
474
|
setFormDirty: any;
|
|
319
475
|
add: any;
|
|
476
|
+
hideTab: (event, tabTitle: string, hiddenTabArrayProp: string) => void;
|
|
477
|
+
addTab: (event, tabTitle: string, hiddenTabArrayProp: string) => void;
|
|
320
478
|
hasError: any;
|
|
321
479
|
unshift: any;
|
|
322
480
|
remove: any;
|
|
@@ -325,23 +483,39 @@ declare module fng {
|
|
|
325
483
|
skipCols: any;
|
|
326
484
|
setPristine: any;
|
|
327
485
|
generateEditUrl: any;
|
|
486
|
+
generateViewUrl: any;
|
|
328
487
|
generateNewUrl: any;
|
|
329
488
|
scrollTheList: any;
|
|
330
489
|
getListData: any;
|
|
331
|
-
|
|
490
|
+
phaseWatcher: any;
|
|
491
|
+
dismissError: () => void;
|
|
492
|
+
stickError: () => void;
|
|
493
|
+
clearTimeout: () => void;
|
|
332
494
|
handleHttpError: (response: any) => void;
|
|
333
495
|
dropConversionWatcher: () => void;
|
|
496
|
+
readingRecord?: angular.IPromise<any>;
|
|
497
|
+
onSchemaFetch?: (description: string, source: IFieldViewInfo[]) => void;
|
|
498
|
+
onSchemaProcessed?: (description: string, formSchema: IFormInstruction[]) => void;
|
|
499
|
+
updateQueryForTab?: (tab: string) => void;
|
|
500
|
+
showLoading? : boolean;
|
|
501
|
+
tabDeselect?: ($event: any, $selectedIndex: number) => void;
|
|
502
|
+
setUpCustomLookupOptions?: (
|
|
503
|
+
schemaElement: IFormInstruction,
|
|
504
|
+
ids: string[],
|
|
505
|
+
options: string[],
|
|
506
|
+
baseScope: any
|
|
507
|
+
) => void;
|
|
334
508
|
}
|
|
335
509
|
|
|
336
510
|
export interface IContextMenuDivider {
|
|
337
511
|
divider: boolean;
|
|
338
512
|
}
|
|
339
|
-
export interface
|
|
340
|
-
//
|
|
341
|
-
|
|
342
|
-
fn?: () => void;
|
|
513
|
+
export interface IContextMenuBaseOption {
|
|
514
|
+
// provided to the security hook (see elemSecurityFuncName) - optional where that is not being used
|
|
515
|
+
id?: string;
|
|
343
516
|
|
|
344
|
-
text
|
|
517
|
+
text?: string;
|
|
518
|
+
textFunc?: () => string;
|
|
345
519
|
isDisabled?: () => boolean;
|
|
346
520
|
isHidden?: () => boolean;
|
|
347
521
|
|
|
@@ -350,11 +524,28 @@ declare module fng {
|
|
|
350
524
|
creating: boolean;
|
|
351
525
|
editing: boolean;
|
|
352
526
|
}
|
|
527
|
+
export interface IContextSubMenuOption extends IContextMenuBaseOption {
|
|
528
|
+
items: ContextMenuItem[];
|
|
529
|
+
}
|
|
530
|
+
export interface IContextMenuOption extends IContextMenuBaseOption{
|
|
531
|
+
// For it to make any sense, a menu option needs one of the next three properties
|
|
532
|
+
url?: string;
|
|
533
|
+
fn?: (...args: any) => void;
|
|
534
|
+
urlFunc?: () => string;
|
|
535
|
+
broadcast?: string;
|
|
536
|
+
args?: any[];
|
|
537
|
+
}
|
|
538
|
+
export type ContextMenuItem = IContextMenuOption | IContextSubMenuOption | IContextMenuDivider;
|
|
539
|
+
|
|
540
|
+
export interface IModelCtrlService {
|
|
541
|
+
loadControllerAndMenu: (sharedData: any, titleCaseModelName: string, level: number, needDivider: boolean, scope: angular.IScope) => void;
|
|
542
|
+
}
|
|
353
543
|
|
|
354
544
|
export interface IModelController extends IFormScope {
|
|
355
|
-
onBaseCtrlReady
|
|
356
|
-
onAllReady
|
|
357
|
-
contextMenu
|
|
545
|
+
onBaseCtrlReady?: (baseScope: IFormScope) => void; // Optional callback after form is instantiated
|
|
546
|
+
onAllReady?: (baseScope: IFormScope) => void; // Optional callback after form is instantiated and populated
|
|
547
|
+
contextMenu?: ContextMenuItem[];
|
|
548
|
+
contextMenuPromise?: Promise<ContextMenuItem[]>;
|
|
358
549
|
}
|
|
359
550
|
|
|
360
551
|
export interface IBaseFormOptions {
|
|
@@ -362,13 +553,13 @@ declare module fng {
|
|
|
362
553
|
* The style of the form layout. Supported values are horizontalcompact, horizontal, vertical, inline
|
|
363
554
|
*/
|
|
364
555
|
//TODO supported values should be in an enum
|
|
365
|
-
formstyle?:
|
|
556
|
+
formstyle?: formStyle;
|
|
366
557
|
/**
|
|
367
558
|
* Model on form scope (defaults to record).
|
|
368
559
|
* <li><strong>model</strong> the object in the scope to be bound to the model controller. Specifying
|
|
369
560
|
* the model inhibits the generation of the <strong>form</strong> tag unless the <strong>forceform</strong> attribute is set to true</li>
|
|
370
561
|
*/
|
|
371
|
-
model
|
|
562
|
+
model?: string;
|
|
372
563
|
/**
|
|
373
564
|
* The name to be given to the form - defaults to myForm
|
|
374
565
|
*/
|
|
@@ -377,60 +568,272 @@ declare module fng {
|
|
|
377
568
|
* Normally first field in a form gets autofocus set. Use this to prevent this
|
|
378
569
|
*/
|
|
379
570
|
noautofocus?: string;
|
|
571
|
+
/*
|
|
572
|
+
Suppress the generation of element ids
|
|
573
|
+
(sometimes required when using nested form-inputs in a directive)
|
|
574
|
+
*/
|
|
575
|
+
noid?: boolean;
|
|
380
576
|
}
|
|
381
577
|
|
|
382
578
|
export interface IFormAttrs extends IFormOptions, angular.IAttributes {
|
|
383
579
|
/**
|
|
384
580
|
* Schema used by the form
|
|
385
581
|
*/
|
|
386
|
-
schema
|
|
387
|
-
forceform?: string;
|
|
582
|
+
schema: string;
|
|
583
|
+
forceform?: string; // Must be true or omitted. Forces generation of the <strong>form</strong> tag when model is specified
|
|
584
|
+
noid?: boolean;
|
|
388
585
|
}
|
|
389
586
|
|
|
390
587
|
export interface IFormOptions extends IBaseFormOptions {
|
|
391
|
-
schema
|
|
588
|
+
schema?: string;
|
|
392
589
|
subkey?: string;
|
|
393
590
|
subkeyno?: number;
|
|
394
|
-
subschema
|
|
395
|
-
subschemaroot
|
|
591
|
+
subschema?: string;
|
|
592
|
+
subschemaroot?: string;
|
|
593
|
+
viewform?: boolean;
|
|
594
|
+
suppressNestingWarning?: boolean;
|
|
396
595
|
}
|
|
397
596
|
|
|
398
597
|
export interface IBuiltInRoute {
|
|
399
598
|
route: string;
|
|
400
|
-
state
|
|
401
|
-
templateUrl
|
|
402
|
-
options
|
|
599
|
+
state?: string;
|
|
600
|
+
templateUrl?: string;
|
|
601
|
+
options?: {
|
|
602
|
+
authenticate?: boolean;
|
|
603
|
+
templateUrl?: string | (() => void);
|
|
604
|
+
template?: string;
|
|
605
|
+
controller?: string;
|
|
606
|
+
}
|
|
403
607
|
}
|
|
404
608
|
|
|
405
609
|
export interface IRoutingConfig {
|
|
406
|
-
hashPrefix
|
|
610
|
+
hashPrefix?: string;
|
|
407
611
|
html5Mode: boolean;
|
|
408
|
-
routing: string;
|
|
409
|
-
|
|
410
|
-
prefix: string;
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
612
|
+
routing: string; // What sort of routing do we want? ngroute or uirouter.
|
|
613
|
+
// TODO Should be enum
|
|
614
|
+
prefix: string; // How do we want to prefix out routes? If not empty string then first character must be slash (which is added if not)
|
|
615
|
+
// for example '/db' that gets prepended to all the generated routes. This can be used to
|
|
616
|
+
// prevent generated routes (which have a lot of parameters) from clashing with other routes in
|
|
617
|
+
// the web app that have nothing to do with CRUD forms
|
|
414
618
|
fixedRoutes?: Array<IBuiltInRoute>;
|
|
415
|
-
templateFolder?: string;
|
|
416
|
-
add2fngRoutes?: any;
|
|
417
|
-
|
|
619
|
+
templateFolder?: string; // The folder where the templates for base-list, base-edit and base-analysis live. Internal templates used by default. For pre 0.7.0 behaviour use 'partials/'
|
|
620
|
+
add2fngRoutes?: any; // An object to add to the generated routes. One use case would be to add {authenticate: true}
|
|
621
|
+
// so that the client authenticates for certain routes
|
|
418
622
|
|
|
419
|
-
variantsForDemoWebsite
|
|
420
|
-
variants?: any;
|
|
623
|
+
variantsForDemoWebsite?: any; // Just for demo website
|
|
624
|
+
variants?: any; // Just for demo website
|
|
625
|
+
onDelete?: string; // Supports literal (such as '/') or 'new' (which will go to a /new of the model) default is to go to the list view
|
|
421
626
|
}
|
|
422
627
|
|
|
423
628
|
export interface IFngRoute {
|
|
424
|
-
newRecord?:
|
|
425
|
-
analyse?:
|
|
426
|
-
modelName?:
|
|
427
|
-
reportSchemaName
|
|
428
|
-
id
|
|
429
|
-
formName
|
|
430
|
-
tab
|
|
431
|
-
variant
|
|
629
|
+
newRecord?: boolean;
|
|
630
|
+
analyse?: boolean;
|
|
631
|
+
modelName?: string;
|
|
632
|
+
reportSchemaName?: string;
|
|
633
|
+
id?: string;
|
|
634
|
+
formName?: string;
|
|
635
|
+
tab?: string;
|
|
636
|
+
variant?: string; // TODO should be enum of supported frameworks
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
interface IBuildingBlocks {
|
|
640
|
+
common: string;
|
|
641
|
+
sizeClassBS3: string;
|
|
642
|
+
sizeClassBS2: string;
|
|
643
|
+
compactClass: string;
|
|
644
|
+
formControl: string;
|
|
645
|
+
modelString: string;
|
|
646
|
+
disableableAncestorStr: string;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
interface IProcessedAttrs {
|
|
650
|
+
info: IFormInstruction;
|
|
651
|
+
options: IFormOptions;
|
|
652
|
+
directiveOptions: any;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
interface IGenDisableStrParams {
|
|
656
|
+
forceNg?: boolean;
|
|
657
|
+
nonUniqueIdSuffix?: string;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
interface IPluginHelperService {
|
|
662
|
+
extractFromAttr: (
|
|
663
|
+
attr: any,
|
|
664
|
+
directiveName: string,
|
|
665
|
+
scope: fng.IFormScope
|
|
666
|
+
) => { info: IFormInstruction; options: IFormOptions; directiveOptions: any };
|
|
667
|
+
buildInputMarkup: (
|
|
668
|
+
scope: angular.IScope,
|
|
669
|
+
attrs: any,
|
|
670
|
+
params: {
|
|
671
|
+
processedAttrs?: IProcessedAttrs;
|
|
672
|
+
fieldInfoOverrides?: Partial<IFormInstruction>;
|
|
673
|
+
optionOverrides?: Partial<IFormOptions>;
|
|
674
|
+
addButtons?: boolean;
|
|
675
|
+
needsX?: boolean;
|
|
676
|
+
},
|
|
677
|
+
generateInputControl: (buildingBlocks: IBuildingBlocks) => string
|
|
678
|
+
) => string;
|
|
679
|
+
genIdString: (scope: angular.IScope, processedAttrs: IProcessedAttrs, idSuffix: string) => string;
|
|
680
|
+
genDisabledStr: (
|
|
681
|
+
scope: angular.IScope,
|
|
682
|
+
processedAttrs: IProcessedAttrs,
|
|
683
|
+
idSuffix: string,
|
|
684
|
+
params?: fng.IGenDisableStrParams
|
|
685
|
+
) => string;
|
|
686
|
+
genIdAndDisabledStr: (
|
|
687
|
+
scope: angular.IScope,
|
|
688
|
+
processedAttrs: IProcessedAttrs,
|
|
689
|
+
idSuffix: string,
|
|
690
|
+
params?: fng.IGenDisableStrParams
|
|
691
|
+
) => string;
|
|
692
|
+
genDateTimePickerDisabledStr: (scope: angular.IScope, processedAttrs: IProcessedAttrs, idSuffix: string) => string;
|
|
693
|
+
genDateTimePickerIdAndDisabledStr: (
|
|
694
|
+
scope: angular.IScope,
|
|
695
|
+
processedAttrs: IProcessedAttrs,
|
|
696
|
+
idSuffix: string
|
|
697
|
+
) => string;
|
|
698
|
+
genUiSelectIdAndDisabledStr: (
|
|
699
|
+
scope: angular.IScope,
|
|
700
|
+
processedAttrs: IProcessedAttrs,
|
|
701
|
+
idSuffix: string
|
|
702
|
+
) => string;
|
|
703
|
+
handlePseudos: (scope: fng.IFormScope, str: string) => string;
|
|
704
|
+
genDisableableAncestorStr: (processedAttrs: IProcessedAttrs) => string;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
interface ISecurityVisibility {
|
|
708
|
+
omit?: boolean;
|
|
709
|
+
visibilityAttr?: string;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
interface IGenerateDisableAttrParams {
|
|
713
|
+
attr?: string;
|
|
714
|
+
attrRequiresValue?: boolean;
|
|
715
|
+
forceNg?: boolean;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
type SecurityType = "hidden" | "disabled";
|
|
719
|
+
|
|
720
|
+
interface ISecurityService {
|
|
721
|
+
canDoSecurity: (type: SecurityType) => boolean;
|
|
722
|
+
canDoSecurityNow: (scope: fng.ISecurableScope, type: SecurityType) => boolean;
|
|
723
|
+
isSecurelyHidden: (elemId: string, pseudoUrl?: string) => boolean;
|
|
724
|
+
isSecurelyDisabled: (elemId: string, pseudoUrl?: string) => boolean;
|
|
725
|
+
decorateSecurableScope: (securableScope: ISecurableScope, params?: { pseudoUrl?: string, overrideSkipping?: boolean }) => void;
|
|
726
|
+
doSecurityWhenReady: (cb: () => void) => void;
|
|
727
|
+
considerVisibility: (id: string, scope: fng.ISecurableScope) => ISecurityVisibility;
|
|
728
|
+
considerContainerVisibility: (contentIds: string[], scope: fng.ISecurableScope) => fng.ISecurityVisibility;
|
|
729
|
+
getDisableableAttrs: (id: string) => string;
|
|
730
|
+
getHideableAttrs: (id: string) => string;
|
|
731
|
+
getDisableableAncestorAttrs: (id: string) => string;
|
|
732
|
+
generateDisabledAttr: (id: string, scope: fng.ISecurableScope, params?: IGenerateDisableAttrParams) => string;
|
|
432
733
|
}
|
|
433
734
|
|
|
735
|
+
interface IListQueryOptions {
|
|
736
|
+
limit?: number;
|
|
737
|
+
find?: any; // e.g., { "careWorker.isCareWorker": true }
|
|
738
|
+
aggregate?: any;
|
|
739
|
+
projection?: any;
|
|
740
|
+
order?: any; // e.g., { familyName: -1, givenName: -1 }
|
|
741
|
+
skip?: number;
|
|
742
|
+
concatenate?: boolean; // whether the list fields should be concatenated into a single .text property
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
interface ISubmissionsService {
|
|
746
|
+
// return all of the list attributes of the record from db.<modelName>.<id>
|
|
747
|
+
// where returnRaw is true, the document (albeit with only its list attributes present) will be returned without transformation
|
|
748
|
+
// otherwise, the list fields will be concatenated (space-seperated) and returned as the list property of a record { list: string }
|
|
749
|
+
// e.g., "John Doe", in the case of a person
|
|
750
|
+
getListAttributes: (
|
|
751
|
+
modelName: string,
|
|
752
|
+
id: string,
|
|
753
|
+
returnRaw?: boolean
|
|
754
|
+
) => angular.IHttpPromise<{ list: string } | any>;
|
|
755
|
+
readRecord: (modelName: string, id: string, formName?: string) => angular.IHttpPromise<any>;
|
|
756
|
+
getAll: (modelName: string, _options: any) => angular.IHttpPromise<any[]>;
|
|
757
|
+
getAllListAttributes: (ref: string) => angular.IHttpPromise<ILookupItem[]>;
|
|
758
|
+
getPagedAndFilteredList: (
|
|
759
|
+
modelName: string,
|
|
760
|
+
options: IListQueryOptions
|
|
761
|
+
) => angular.IHttpPromise<any[]>;
|
|
762
|
+
getPagedAndFilteredListFull: (
|
|
763
|
+
modelName: string,
|
|
764
|
+
options: IListQueryOptions
|
|
765
|
+
) => angular.IHttpPromise<any[]>;
|
|
766
|
+
deleteRecord: (model: string, id: string, formName: string) => angular.IHttpPromise<void>;
|
|
767
|
+
updateRecord: (modelName: string, id: string, dataToSave: any, formName?: string) => angular.IHttpPromise<any>;
|
|
768
|
+
createRecord: (modelName: string, dataToSave: any, formName?: string) => angular.IHttpPromise<any>;
|
|
769
|
+
useCache: (val: boolean) => void;
|
|
770
|
+
clearCache: () => void;
|
|
771
|
+
getCache: () => boolean;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
interface IRoutingServiceProvider {
|
|
775
|
+
start: (options: IRoutingConfig) => void;
|
|
776
|
+
addRoutes: (fixedRoutes: Array<IBuiltInRoute>, fngRoutes:Array<IBuiltInRoute>) => void;
|
|
777
|
+
registerAction: (action: string) => void;
|
|
778
|
+
$get: () => IRoutingService;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
interface IRoutingService {
|
|
782
|
+
router: () => string;
|
|
783
|
+
prefix: () => string;
|
|
784
|
+
parsePathFunc: () => (location: string) => void;
|
|
785
|
+
html5hash: () => string;
|
|
786
|
+
buildUrl: (path: string) => string;
|
|
787
|
+
buildOperationUrl: (
|
|
788
|
+
prefix: string,
|
|
789
|
+
operation: string,
|
|
790
|
+
modelName: string,
|
|
791
|
+
formName: string,
|
|
792
|
+
id: string,
|
|
793
|
+
tabName?: string
|
|
794
|
+
) => string;
|
|
795
|
+
redirectTo: () => (operation: string, scope: IFormScope, LocationService: angular.ILocationService, id?: string, tab?: string) => void;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
interface ICssFrameworkServiceProvider {
|
|
799
|
+
setOptions: (options: { framework: string }) => void;
|
|
800
|
+
$get: () => ICssFrameworkService;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
interface ICssFrameworkService {
|
|
804
|
+
framework: () => string;
|
|
805
|
+
span: (cols: number) => string;
|
|
806
|
+
offset: (cols: number) => string;
|
|
807
|
+
rowFluid: () => string;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
interface IFngUiSelectHelperService {
|
|
811
|
+
windowChanged: (width: number, height: number) => boolean;
|
|
812
|
+
addClientLookup: (lkpName: string, lkpData: any) => void;
|
|
813
|
+
clearCache: () => void;
|
|
814
|
+
lookupFunc: (value: string, formSchema: IFormInstruction, cb: (formSchema: IFormInstruction, value: ILookupItem ) => void) => void;
|
|
815
|
+
doOwnConversion: (scope: IFormScope, processedAttrs: any, ref: string) => void;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
interface IFormMarkupHelperService {
|
|
819
|
+
isHorizontalStyle: (formStyle: string, includeStacked: boolean) => boolean;
|
|
820
|
+
isArrayElement: (scope: angular.IScope, info: fng.IFormInstruction, options: fng.IFormOptions) => boolean;
|
|
821
|
+
fieldChrome: (scope: fng.IFormScope, info: fng.IFormInstruction, options: fng.IFormOptions) => { omit?: boolean, template?: string, closeTag?: string };
|
|
822
|
+
label: (scope: fng.IFormScope, fieldInfo: fng.IFormInstruction, addButtonMarkup: boolean, options: fng.IFormOptions) => string;
|
|
823
|
+
glyphClass: () => string;
|
|
824
|
+
allInputsVars: (scope: angular.IScope, fieldInfo: fng.IFormInstruction, options: fng.IFormOptions, modelString: string, idString: string, nameString: string) => Partial<fng.IBuildingBlocks>;
|
|
825
|
+
inputChrome: (value: string, fieldInfo: fng.IFormInstruction, options: fng.IFormOptions, markupVars) => string;
|
|
826
|
+
generateSimpleInput: (common: string, fieldInfo: fng.IFormInstruction, options: fng.IFormOptions) => string;
|
|
827
|
+
controlDivClasses: (options: fng.IFormOptions, fieldInfo: fng.IFormInstruction) => string[];
|
|
828
|
+
handleInputAndControlDiv: (inputMarkup: string, controlDivClasses: string[]) => string;
|
|
829
|
+
handleArrayInputAndControlDiv: (inputMarkup: string, controlDivClasses: string[], scope: fng.IFormScope, info: fng.IFormInstruction, options: fng.IFormOptions) => string;
|
|
830
|
+
addTextInputMarkup: (allInputsVars: Partial<fng.IBuildingBlocks>, fieldInfo: fng.IFormInstruction, requiredStr: string) => string;
|
|
831
|
+
handleReadOnlyDisabled: (partialFieldInfo: { name: string, id?: string, nonUniqueId?: string, readonly?: boolean | string }, scope: fng.IFormScope) => string[];
|
|
832
|
+
generateArrayElementIdString: (idString: string, info: fng.IFormInstruction, options: fng.IFormOptions) => string;
|
|
833
|
+
genDisableableAncestorStr: (id: string) => string;
|
|
834
|
+
generateNgShow: (showWhen: IFngShowWhen, model: string) => string;
|
|
835
|
+
handlePseudos: (scope: fng.IFormScope, str: string, dynamicFuncName?: string) => string;
|
|
836
|
+
}
|
|
434
837
|
}
|
|
435
838
|
|
|
436
|
-
declare var formsAngular:
|
|
839
|
+
declare var formsAngular: fng.IFng;
|