forms-angular 0.12.0-beta.191 → 0.12.0-beta.193
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.js +444 -182
- package/dist/client/forms-angular.min.js +1 -1
- package/dist/client/index.d.ts +211 -102
- package/dist/server/data_form.js +2 -4
- package/package.json +1 -1
package/dist/client/index.d.ts
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
declare module fng {
|
|
2
2
|
export interface IFng extends angular.IModule {
|
|
3
|
-
beforeProcess
|
|
4
|
-
title?: {prefix?: string
|
|
3
|
+
beforeProcess?: (scope: IFormScope, cb: (err?: Error) => void) => void;
|
|
4
|
+
title?: { prefix?: string; suffix?: string };
|
|
5
|
+
// when provided, the named function (assumed to be present on $rootscope) will be used to determine the visibility
|
|
6
|
+
// of menu items and control groups, and the disabled state of menu items and individual form input controls
|
|
7
|
+
elemSecurityFuncName?: string;
|
|
8
|
+
// how the function identified by elemSecurityFuncName should be bound. "instant" means that it will be called
|
|
9
|
+
// as the markup is being constructed, with 'hidden' elements not included in the markup at all, and disable elements
|
|
10
|
+
// given a simple DISABLED attribute. this is the most efficient approach. "one-time" will add ng-hide and
|
|
11
|
+
// ng-disabled directives to the relevant elements, with one-time binding to the security function. this is
|
|
12
|
+
// also reasonably efficient (but not as efficient as "instant" due to the need for watches). "normal" will not use
|
|
13
|
+
// one-time binding, which has the potential to be highly resource-intensive on large forms. which
|
|
14
|
+
// option is chosen will depend upon when the function identified by elemSecurityFuncName will be ready to
|
|
15
|
+
// make the necessary determination.
|
|
16
|
+
elemSecurityFuncBinding?: "instant" | "one-time" | "normal";
|
|
5
17
|
}
|
|
6
18
|
var formsAngular: IFng;
|
|
7
19
|
|
|
8
20
|
/*
|
|
9
21
|
Type definitions for types that are used on both the client and the server
|
|
10
22
|
*/
|
|
11
|
-
type formStyle =
|
|
23
|
+
type formStyle = "inline" | "vertical" | "horizontal" | "horizontalCompact" | "stacked";
|
|
12
24
|
|
|
13
25
|
export interface IBaseArrayLookupReference {
|
|
14
26
|
property: string;
|
|
@@ -28,7 +40,7 @@ declare module fng {
|
|
|
28
40
|
});
|
|
29
41
|
*/
|
|
30
42
|
export interface IFngInternalLookupReference extends IBaseArrayLookupReference {
|
|
31
|
-
noConvert
|
|
43
|
+
noConvert?: boolean; // can be used by a tricksy hack to get around nesting limitations
|
|
32
44
|
}
|
|
33
45
|
|
|
34
46
|
/*
|
|
@@ -42,7 +54,7 @@ declare module fng {
|
|
|
42
54
|
};
|
|
43
55
|
*/
|
|
44
56
|
export interface IFngLookupListReference extends IBaseArrayLookupReference {
|
|
45
|
-
collection: string;
|
|
57
|
+
collection: string; // collection that contains the list
|
|
46
58
|
/*
|
|
47
59
|
Some means of calculating _id in collection. If it starts with $ then it is property in record
|
|
48
60
|
*/
|
|
@@ -65,7 +77,7 @@ declare module fng {
|
|
|
65
77
|
*/
|
|
66
78
|
export interface IFngShowWhen {
|
|
67
79
|
lhs: any;
|
|
68
|
-
comp:
|
|
80
|
+
comp: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
69
81
|
rhs: any;
|
|
70
82
|
}
|
|
71
83
|
|
|
@@ -73,14 +85,14 @@ declare module fng {
|
|
|
73
85
|
link allows the setting up of hyperlinks for lookup reference fields
|
|
74
86
|
*/
|
|
75
87
|
export interface IFngLinkSetup {
|
|
76
|
-
linkOnly?: boolean;
|
|
77
|
-
label?: boolean;
|
|
78
|
-
form?: string;
|
|
79
|
-
linktab?: string;
|
|
80
|
-
text?: string;
|
|
88
|
+
linkOnly?: boolean; // if true then the input element is not generated (this overrides label)
|
|
89
|
+
label?: boolean; // Make a link out of the label (causes text to be overridden) (this overrides text)
|
|
90
|
+
form?: string; // can be used to generate a link to a custom schema
|
|
91
|
+
linktab?: string; // can be used to generate a link to a tab on a form
|
|
92
|
+
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.
|
|
81
93
|
}
|
|
82
94
|
|
|
83
|
-
export type FieldSizeString =
|
|
95
|
+
export type FieldSizeString = "mini" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "block-level"; // sets control width. Default is 'medium''
|
|
84
96
|
|
|
85
97
|
export interface IFngSchemaTypeFormOpts {
|
|
86
98
|
/*
|
|
@@ -100,35 +112,36 @@ declare module fng {
|
|
|
100
112
|
*/
|
|
101
113
|
type?: string;
|
|
102
114
|
|
|
103
|
-
hidden?: boolean;
|
|
104
|
-
label?: string | null;
|
|
105
|
-
ref?: string;
|
|
106
|
-
internalRef
|
|
115
|
+
hidden?: boolean; // inhibits this schema key from appearing on the generated form.
|
|
116
|
+
label?: string | null; // overrides the default input label. label:null suppresses the label altogether.
|
|
117
|
+
ref?: string; // reference to another collection
|
|
118
|
+
internalRef?: IFngInternalLookupReference;
|
|
107
119
|
lookupListRef?: IFngLookupListReference;
|
|
108
120
|
id?: string; // specifies the id of the input field (which defaults to f_name)
|
|
109
121
|
|
|
110
|
-
placeHolder?: string // adds placeholder text to the input (depending on data type).
|
|
111
|
-
help?: string;
|
|
112
|
-
helpInline?: string;
|
|
113
|
-
popup?: string;
|
|
114
|
-
ariaLabel?: string;
|
|
115
|
-
order?: number;
|
|
122
|
+
placeHolder?: string; // adds placeholder text to the input (depending on data type).
|
|
123
|
+
help?: string; // adds help text under the input.
|
|
124
|
+
helpInline?: string; // adds help to the right of the input.
|
|
125
|
+
popup?: string; // adds title (popup help) as specified.
|
|
126
|
+
ariaLabel?: string; // adds aria-label as specified.
|
|
127
|
+
order?: number; // allows user to specify the order / tab order of this field in the form. This overrides the position in the Mongoose schema.
|
|
116
128
|
size?: FieldSizeString;
|
|
117
|
-
readonly?: boolean | string;
|
|
118
|
-
rows?: number |
|
|
119
|
-
tab?: string;
|
|
120
|
-
showWhen?: IFngShowWhen | string;
|
|
129
|
+
readonly?: boolean | string; // adds the readonly or ng-readonly attribute to the generated input (currently doesn't work with date - and perhaps other types).
|
|
130
|
+
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.
|
|
131
|
+
tab?: string; // Used to divide a large form up into a tabset with multiple tabs
|
|
132
|
+
showWhen?: IFngShowWhen | string; // allows conditional display of fields based on values elsewhere. string must be an abular expression.
|
|
121
133
|
|
|
122
134
|
/*
|
|
123
135
|
add: 'class="myClass"' allows custom styling of a specific input
|
|
124
136
|
Angular model options can be used - for example add: 'ng-model-options="{updateOn: \'default blur\', debounce: { \'default\': 500, \'blur\': 0 }}" '
|
|
125
137
|
custom validation directives, such as the timezone validation in this schema
|
|
126
138
|
*/
|
|
127
|
-
add?: string;
|
|
139
|
+
add?: string; // allows arbitrary attributes to be added to the input tag.
|
|
128
140
|
|
|
129
|
-
class?: string;
|
|
130
|
-
inlineRadio?: boolean;
|
|
141
|
+
class?: string; // allows arbitrary classes to be added to the input tag.
|
|
142
|
+
inlineRadio?: boolean; // (only valid when type is radio) should be set to true to present all radio button options in a single line
|
|
131
143
|
link?: IFngLinkSetup; // handles displaying links for ref lookups
|
|
144
|
+
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.
|
|
132
145
|
|
|
133
146
|
/*
|
|
134
147
|
With a select / radio type you can specify the options.
|
|
@@ -154,12 +167,18 @@ declare module fng {
|
|
|
154
167
|
noAdd?: boolean | string; // inhibits an Add button being generated for arrays.
|
|
155
168
|
noneIndicator?: boolean; // show "None" where there's no add button and no array items
|
|
156
169
|
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.
|
|
157
|
-
noRemove?: boolean | string;
|
|
158
|
-
formstyle?: formStyle;
|
|
159
|
-
sortable
|
|
170
|
+
noRemove?: boolean | string; // inhibits a Remove button being generated for array elements.
|
|
171
|
+
formstyle?: formStyle; // (only valid on a sub schema) sets style of sub form.
|
|
172
|
+
sortable?: boolean | string; // Allows drag and drop sorting of arrays - requires angular-ui-sortable
|
|
160
173
|
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
|
|
161
174
|
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)
|
|
162
|
-
subDocContainerType?:
|
|
175
|
+
subDocContainerType?:
|
|
176
|
+
| "fieldset"
|
|
177
|
+
| "well"
|
|
178
|
+
| "well-large"
|
|
179
|
+
| "well-small"
|
|
180
|
+
| string
|
|
181
|
+
| ((info) => { before: ""; after: "" }); // allows each element in the array to be nested in a container
|
|
163
182
|
subDocContainerProps?: any; // the parameters that will be passed if subDocContainerType is a function
|
|
164
183
|
|
|
165
184
|
/*
|
|
@@ -173,7 +192,7 @@ declare module fng {
|
|
|
173
192
|
Suppresses warnings about attenpting deep nesting which would be logged to console in some circumstances when a
|
|
174
193
|
directive fakes deep nesting
|
|
175
194
|
*/
|
|
176
|
-
suppressNestingWarning
|
|
195
|
+
suppressNestingWarning?: boolean;
|
|
177
196
|
}
|
|
178
197
|
|
|
179
198
|
// Schema passed from server - derived from Mongoose schema
|
|
@@ -181,34 +200,44 @@ declare module fng {
|
|
|
181
200
|
name: string;
|
|
182
201
|
schema?: Array<IFieldViewInfo>;
|
|
183
202
|
array?: boolean;
|
|
184
|
-
showIf
|
|
203
|
+
showIf?: any;
|
|
185
204
|
required?: boolean;
|
|
186
|
-
step
|
|
205
|
+
step?: number;
|
|
187
206
|
}
|
|
188
207
|
|
|
189
|
-
export type fieldType =
|
|
208
|
+
export type fieldType =
|
|
209
|
+
| "string"
|
|
210
|
+
| "text"
|
|
211
|
+
| "textarea"
|
|
212
|
+
| "number"
|
|
213
|
+
| "select"
|
|
214
|
+
| "link"
|
|
215
|
+
| "date"
|
|
216
|
+
| "checkbox"
|
|
217
|
+
| "password"
|
|
218
|
+
| "radio";
|
|
190
219
|
|
|
191
220
|
// Schema used internally on client - often derived from IFieldViewInfo passed from server
|
|
192
221
|
export interface IFormInstruction extends IFieldViewInfo {
|
|
193
|
-
id
|
|
222
|
+
id?: string; // id of generated DOM element
|
|
194
223
|
type?: fieldType;
|
|
195
|
-
defaultValue
|
|
196
|
-
rows
|
|
224
|
+
defaultValue?: any;
|
|
225
|
+
rows?: number;
|
|
197
226
|
label?: string;
|
|
198
227
|
options?: any;
|
|
199
228
|
ids?: any;
|
|
200
229
|
hidden?: boolean;
|
|
201
230
|
tab?: string;
|
|
202
|
-
add
|
|
203
|
-
ref
|
|
204
|
-
link
|
|
231
|
+
add?: string;
|
|
232
|
+
ref?: any;
|
|
233
|
+
link?: any;
|
|
205
234
|
linktext?: string;
|
|
206
235
|
linklabel?: boolean;
|
|
207
|
-
form?: string;
|
|
208
|
-
select2
|
|
209
|
-
schema?: IFormInstruction[];
|
|
210
|
-
intType
|
|
211
|
-
[
|
|
236
|
+
form?: string; // the form that is linked to
|
|
237
|
+
select2?: any; // deprecated
|
|
238
|
+
schema?: IFormInstruction[]; // If the field is an array of fields
|
|
239
|
+
intType?: "date";
|
|
240
|
+
[directiveOptions: string]: any;
|
|
212
241
|
}
|
|
213
242
|
|
|
214
243
|
export interface IContainer {
|
|
@@ -218,14 +247,14 @@ declare module fng {
|
|
|
218
247
|
In the case of a string which does not match one of the predefined options
|
|
219
248
|
the generated container div is given the class of the name
|
|
220
249
|
*/
|
|
221
|
-
containerType:
|
|
250
|
+
containerType: "fieldset" | "well" | "tabset" | "tab" | "well-large" | "well-small" | string;
|
|
222
251
|
title?: string;
|
|
223
252
|
|
|
224
253
|
/*
|
|
225
254
|
h1...h6 will use a header style
|
|
226
255
|
anything else will be used as a paragraph stype
|
|
227
256
|
*/
|
|
228
|
-
titleTagOrClass
|
|
257
|
+
titleTagOrClass?: string;
|
|
229
258
|
content: IFormInstruction[];
|
|
230
259
|
}
|
|
231
260
|
|
|
@@ -237,40 +266,60 @@ declare module fng {
|
|
|
237
266
|
export interface IEnumInstruction {
|
|
238
267
|
repeat: string;
|
|
239
268
|
value: string;
|
|
240
|
-
label
|
|
269
|
+
label?: string;
|
|
241
270
|
}
|
|
242
271
|
|
|
243
272
|
export interface IFngCtrlState {
|
|
244
273
|
master: any;
|
|
245
|
-
allowLocationChange: boolean;
|
|
274
|
+
allowLocationChange: boolean; // Do we allow location change or prompt for permission
|
|
246
275
|
}
|
|
247
276
|
export interface IRecordHandler {
|
|
248
277
|
convertToMongoModel(schema: IControlledFormSchema, anObject: any, prefixLength: number, scope: IFormScope): any;
|
|
249
278
|
createNew(dataToSave: any, options: any, scope: IFormScope, ctrlState: IFngCtrlState): void;
|
|
250
279
|
deleteRecord(id: string, scope: IFormScope, ctrlState: IFngCtrlState): void;
|
|
251
|
-
updateDocument(dataToSave
|
|
280
|
+
updateDocument(dataToSave: any, options: any, scope: IFormScope, ctrlState: IFngCtrlState): void;
|
|
252
281
|
readRecord($scope: IFormScope, ctrlState);
|
|
253
282
|
scrollTheList($scope: IFormScope);
|
|
254
283
|
getListData(record, fieldName, listSchema?, $scope?: IFormScope);
|
|
255
284
|
suffixCleanId(inst, suffix);
|
|
256
285
|
setData(object, fieldname, element, value);
|
|
257
286
|
setUpLookupOptions(lookupCollection, schemaElement, $scope: IFormScope, ctrlState, handleSchema);
|
|
258
|
-
setUpLookupListOptions: (
|
|
287
|
+
setUpLookupListOptions: (
|
|
288
|
+
ref: IFngLookupListReference,
|
|
289
|
+
formInstructions: IFormInstruction,
|
|
290
|
+
$scope: IFormScope,
|
|
291
|
+
ctrlState: IFngCtrlState
|
|
292
|
+
) => void;
|
|
259
293
|
handleInternalLookup($scope: IFormScope, formInstructions, ref): void;
|
|
260
294
|
preservePristine(element, fn): void;
|
|
261
295
|
convertIdToListValue(id, idsArray, valuesArray, fname);
|
|
262
|
-
decorateScope($scope:IFormScope, $uibModal, recordHandlerInstance
|
|
263
|
-
fillFormFromBackendCustomSchema(
|
|
296
|
+
decorateScope($scope: IFormScope, $uibModal, recordHandlerInstance: IRecordHandler, ctrlState);
|
|
297
|
+
fillFormFromBackendCustomSchema(
|
|
298
|
+
schema,
|
|
299
|
+
$scope: IFormScope,
|
|
300
|
+
formGeneratorInstance,
|
|
301
|
+
recordHandlerInstance,
|
|
302
|
+
ctrlState
|
|
303
|
+
);
|
|
264
304
|
fillFormWithBackendSchema($scope: IFormScope, formGeneratorInstance, recordHandlerInstance, ctrlState);
|
|
265
305
|
handleError($scope: IFormScope);
|
|
266
306
|
}
|
|
267
307
|
|
|
268
308
|
export interface IFormGenerator {
|
|
269
|
-
generateEditUrl(obj, $scope:IFormScope): string;
|
|
270
|
-
generateViewUrl(obj, $scope:IFormScope): string;
|
|
309
|
+
generateEditUrl(obj, $scope: IFormScope): string;
|
|
310
|
+
generateViewUrl(obj, $scope: IFormScope): string;
|
|
271
311
|
generateNewUrl($scope: IFormScope): string;
|
|
272
312
|
handleFieldType(formInstructions, mongooseType, mongooseOptions, $scope: IFormScope, ctrlState);
|
|
273
|
-
handleSchema(
|
|
313
|
+
handleSchema(
|
|
314
|
+
description: string,
|
|
315
|
+
source,
|
|
316
|
+
destForm,
|
|
317
|
+
destList,
|
|
318
|
+
prefix,
|
|
319
|
+
doRecursion: boolean,
|
|
320
|
+
$scope: IFormScope,
|
|
321
|
+
ctrlState
|
|
322
|
+
);
|
|
274
323
|
updateDataDependentDisplay(curValue, oldValue, force, $scope: IFormScope);
|
|
275
324
|
add(fieldName: string, $event, $scope: IFormScope, modelOverride?: any);
|
|
276
325
|
unshift(fieldName: string, $event, $scope: IFormScope, modelOverride?: any);
|
|
@@ -291,7 +340,7 @@ declare module fng {
|
|
|
291
340
|
export interface IFngLookupHandler {
|
|
292
341
|
lookupOptions: string[];
|
|
293
342
|
lookupIds: string[];
|
|
294
|
-
handlers: IFngSingleLookupHandler[]
|
|
343
|
+
handlers: IFngSingleLookupHandler[];
|
|
295
344
|
}
|
|
296
345
|
|
|
297
346
|
export interface IFngInternalLookupHandlerInfo extends IFngLookupHandler {
|
|
@@ -307,7 +356,7 @@ declare module fng {
|
|
|
307
356
|
*/
|
|
308
357
|
export interface IFormScope extends angular.IScope {
|
|
309
358
|
sharedData: any;
|
|
310
|
-
modelNameDisplay
|
|
359
|
+
modelNameDisplay: string;
|
|
311
360
|
modelName: string;
|
|
312
361
|
formName: string;
|
|
313
362
|
alertTitle: any;
|
|
@@ -328,12 +377,12 @@ declare module fng {
|
|
|
328
377
|
unconfirmedDelete: boolean;
|
|
329
378
|
getVal: any;
|
|
330
379
|
sortableOptions: any;
|
|
331
|
-
tabs?: Array<any>;
|
|
332
|
-
tab?: string;
|
|
380
|
+
tabs?: Array<any>; // In the case of forms that contain a tab set
|
|
381
|
+
tab?: string; // title of the active tab - from the route
|
|
333
382
|
activeTabNo?: number;
|
|
334
|
-
topLevelFormName: string;
|
|
383
|
+
topLevelFormName: string; // The name of the form
|
|
335
384
|
record: any;
|
|
336
|
-
originalData: any;
|
|
385
|
+
originalData: any; // the unconverted data read from the server
|
|
337
386
|
phase: any;
|
|
338
387
|
disableFunctions: any;
|
|
339
388
|
dataEventFunctions: any;
|
|
@@ -346,7 +395,7 @@ declare module fng {
|
|
|
346
395
|
pageSize: any;
|
|
347
396
|
pagesLoaded: any;
|
|
348
397
|
cancel: () => any;
|
|
349
|
-
showError: (error: any, alertTitle
|
|
398
|
+
showError: (error: any, alertTitle?: string) => void;
|
|
350
399
|
prepareForSave: (cb: (error: string, dataToSave?: any) => void) => void;
|
|
351
400
|
setDefaults: (formSchema: IFormSchema, base?: string) => any;
|
|
352
401
|
formSchema: IControlledFormSchema;
|
|
@@ -376,7 +425,12 @@ declare module fng {
|
|
|
376
425
|
onSchemaProcessed?: (description: string, formSchema: IFormInstruction[]) => void;
|
|
377
426
|
updateQueryForTab?: (tab: string) => void;
|
|
378
427
|
tabDeselect?: ($event: any, $selectedIndex: number) => void;
|
|
379
|
-
setUpCustomLookupOptions?: (
|
|
428
|
+
setUpCustomLookupOptions?: (
|
|
429
|
+
schemaElement: IFormInstruction,
|
|
430
|
+
ids: string[],
|
|
431
|
+
options: string[],
|
|
432
|
+
baseScope: any
|
|
433
|
+
) => void;
|
|
380
434
|
}
|
|
381
435
|
|
|
382
436
|
export interface IContextMenuDivider {
|
|
@@ -388,6 +442,9 @@ declare module fng {
|
|
|
388
442
|
fn?: () => void;
|
|
389
443
|
urlFunc?: () => string;
|
|
390
444
|
|
|
445
|
+
// provided to the security hook (see elemSecurityFuncName) - optional where that is not being used
|
|
446
|
+
id?: string;
|
|
447
|
+
|
|
391
448
|
text?: string;
|
|
392
449
|
textFunc?: () => string;
|
|
393
450
|
isDisabled?: () => boolean;
|
|
@@ -400,10 +457,10 @@ declare module fng {
|
|
|
400
457
|
}
|
|
401
458
|
|
|
402
459
|
export interface IModelController extends IFormScope {
|
|
403
|
-
onBaseCtrlReady
|
|
404
|
-
onAllReady
|
|
405
|
-
contextMenu
|
|
406
|
-
contextMenuPromise
|
|
460
|
+
onBaseCtrlReady?: (baseScope: IFormScope) => void; // Optional callback after form is instantiated
|
|
461
|
+
onAllReady?: (baseScope: IFormScope) => void; // Optional callback after form is instantiated and populated
|
|
462
|
+
contextMenu?: Array<IContextMenuOption | IContextMenuDivider>;
|
|
463
|
+
contextMenuPromise?: Promise<Array<IContextMenuOption | IContextMenuDivider>>;
|
|
407
464
|
}
|
|
408
465
|
|
|
409
466
|
export interface IBaseFormOptions {
|
|
@@ -417,7 +474,7 @@ declare module fng {
|
|
|
417
474
|
* <li><strong>model</strong> the object in the scope to be bound to the model controller. Specifying
|
|
418
475
|
* the model inhibits the generation of the <strong>form</strong> tag unless the <strong>forceform</strong> attribute is set to true</li>
|
|
419
476
|
*/
|
|
420
|
-
model
|
|
477
|
+
model?: string;
|
|
421
478
|
/**
|
|
422
479
|
* The name to be given to the form - defaults to myForm
|
|
423
480
|
*/
|
|
@@ -430,65 +487,117 @@ declare module fng {
|
|
|
430
487
|
Suppress the generation of element ids
|
|
431
488
|
(sometimes required when using nested form-inputs in a directive)
|
|
432
489
|
*/
|
|
433
|
-
noid
|
|
490
|
+
noid?: boolean;
|
|
434
491
|
}
|
|
435
492
|
|
|
436
493
|
export interface IFormAttrs extends IFormOptions, angular.IAttributes {
|
|
437
494
|
/**
|
|
438
495
|
* Schema used by the form
|
|
439
496
|
*/
|
|
440
|
-
schema
|
|
441
|
-
forceform?: string;
|
|
442
|
-
noid
|
|
497
|
+
schema: string;
|
|
498
|
+
forceform?: string; // Must be true or omitted. Forces generation of the <strong>form</strong> tag when model is specified
|
|
499
|
+
noid?: boolean;
|
|
443
500
|
}
|
|
444
501
|
|
|
445
502
|
export interface IFormOptions extends IBaseFormOptions {
|
|
446
|
-
schema
|
|
503
|
+
schema?: string;
|
|
447
504
|
subkey?: string;
|
|
448
505
|
subkeyno?: number;
|
|
449
|
-
subschema
|
|
450
|
-
subschemaroot
|
|
451
|
-
viewform
|
|
452
|
-
suppressNestingWarning
|
|
506
|
+
subschema?: string;
|
|
507
|
+
subschemaroot?: string;
|
|
508
|
+
viewform?: boolean;
|
|
509
|
+
suppressNestingWarning?: boolean;
|
|
453
510
|
}
|
|
454
511
|
|
|
455
512
|
export interface IBuiltInRoute {
|
|
456
513
|
route: string;
|
|
457
514
|
state: string;
|
|
458
515
|
templateUrl: string;
|
|
459
|
-
options
|
|
516
|
+
options?: any;
|
|
460
517
|
}
|
|
461
518
|
|
|
462
519
|
export interface IRoutingConfig {
|
|
463
520
|
hashPrefix: string;
|
|
464
521
|
html5Mode: boolean;
|
|
465
|
-
routing: string;
|
|
466
|
-
|
|
467
|
-
prefix: string;
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
522
|
+
routing: string; // What sort of routing do we want? ngroute or uirouter.
|
|
523
|
+
// TODO Should be enum
|
|
524
|
+
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)
|
|
525
|
+
// for example '/db' that gets prepended to all the generated routes. This can be used to
|
|
526
|
+
// prevent generated routes (which have a lot of parameters) from clashing with other routes in
|
|
527
|
+
// the web app that have nothing to do with CRUD forms
|
|
471
528
|
fixedRoutes?: Array<IBuiltInRoute>;
|
|
472
|
-
templateFolder?: string;
|
|
473
|
-
add2fngRoutes?: any;
|
|
474
|
-
|
|
529
|
+
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/'
|
|
530
|
+
add2fngRoutes?: any; // An object to add to the generated routes. One use case would be to add {authenticate: true}
|
|
531
|
+
// so that the client authenticates for certain routes
|
|
475
532
|
|
|
476
|
-
variantsForDemoWebsite
|
|
477
|
-
variants?: any;
|
|
478
|
-
onDelete?: string;
|
|
533
|
+
variantsForDemoWebsite?: any; // Just for demo website
|
|
534
|
+
variants?: any; // Just for demo website
|
|
535
|
+
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
|
|
479
536
|
}
|
|
480
537
|
|
|
481
538
|
export interface IFngRoute {
|
|
482
|
-
newRecord?:
|
|
483
|
-
analyse?:
|
|
484
|
-
modelName?:
|
|
485
|
-
reportSchemaName
|
|
486
|
-
id
|
|
487
|
-
formName
|
|
488
|
-
tab
|
|
489
|
-
variant
|
|
539
|
+
newRecord?: boolean;
|
|
540
|
+
analyse?: boolean;
|
|
541
|
+
modelName?: string;
|
|
542
|
+
reportSchemaName?: string;
|
|
543
|
+
id?: string;
|
|
544
|
+
formName?: string;
|
|
545
|
+
tab?: string;
|
|
546
|
+
variant?: string; // TODO should be enum of supported frameworks
|
|
490
547
|
}
|
|
491
548
|
|
|
549
|
+
interface IBuildingBlocks {
|
|
550
|
+
common: string;
|
|
551
|
+
sizeClassBS3: string;
|
|
552
|
+
sizeClassBS2: string;
|
|
553
|
+
compactClass: string;
|
|
554
|
+
formControl: string;
|
|
555
|
+
modelString: string;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
interface IProcessedAttrs {
|
|
559
|
+
info: IFormInstruction;
|
|
560
|
+
options: IFormOptions;
|
|
561
|
+
directiveOptions: any;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
interface IPluginHelper {
|
|
565
|
+
extractFromAttr: (
|
|
566
|
+
attr: any,
|
|
567
|
+
directiveName: string
|
|
568
|
+
) => { info: IFormInstruction; options: IFormOptions; directiveOptions: any };
|
|
569
|
+
buildInputMarkup: (
|
|
570
|
+
scope: angular.IScope,
|
|
571
|
+
attrs: any,
|
|
572
|
+
params: {
|
|
573
|
+
processedAttrs?: IProcessedAttrs;
|
|
574
|
+
fieldInfoOverrides?: Partial<IFormInstruction>;
|
|
575
|
+
optionOverrides?: Partial<IFormOptions>;
|
|
576
|
+
addButtons?: boolean;
|
|
577
|
+
needsX?: boolean;
|
|
578
|
+
},
|
|
579
|
+
generateInputControl: (buildingBlocks: IBuildingBlocks) => string
|
|
580
|
+
) => string;
|
|
581
|
+
genIdString: (scope: angular.IScope, processedAttrs: IProcessedAttrs, idSuffix: string) => string;
|
|
582
|
+
genDisabledStr: (
|
|
583
|
+
scope: angular.IScope,
|
|
584
|
+
processedAttrs: IProcessedAttrs,
|
|
585
|
+
idSuffix: string,
|
|
586
|
+
forceNg?: boolean
|
|
587
|
+
) => string;
|
|
588
|
+
genIdAndDisabledStr: (
|
|
589
|
+
scope: angular.IScope,
|
|
590
|
+
processedAttrs: IProcessedAttrs,
|
|
591
|
+
idSuffix: string,
|
|
592
|
+
forceNg?: boolean
|
|
593
|
+
) => string;
|
|
594
|
+
genDateTimePickerDisabledStr: (scope: angular.IScope, processedAttrs: IProcessedAttrs, idSuffix: string) => string;
|
|
595
|
+
genDateTimePickerIdAndDisabledStr: (
|
|
596
|
+
scope: angular.IScope,
|
|
597
|
+
processedAttrs: IProcessedAttrs,
|
|
598
|
+
idSuffix: string
|
|
599
|
+
) => string;
|
|
600
|
+
}
|
|
492
601
|
}
|
|
493
602
|
|
|
494
603
|
declare var formsAngular: fng.IFng;
|
package/dist/server/data_form.js
CHANGED
|
@@ -292,7 +292,7 @@ var FormsAngular = /** @class */ (function () {
|
|
|
292
292
|
default:
|
|
293
293
|
collectionName = searchFor.slice(0, colonPos);
|
|
294
294
|
collectionNameLower = collectionName.toLowerCase();
|
|
295
|
-
searchFor = searchFor.slice(colonPos + 1, 999);
|
|
295
|
+
searchFor = searchFor.slice(colonPos + 1, 999).trim();
|
|
296
296
|
if (searchFor === '') {
|
|
297
297
|
searchFor = '?';
|
|
298
298
|
}
|
|
@@ -1499,9 +1499,7 @@ var FormsAngular = /** @class */ (function () {
|
|
|
1499
1499
|
acc.push({ resource: r, keys: fldList });
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
|
-
|
|
1503
|
-
searchPaths(r.model.schema, '');
|
|
1504
|
-
}
|
|
1502
|
+
searchPaths(r.model.schema, '');
|
|
1505
1503
|
return acc;
|
|
1506
1504
|
}, []);
|
|
1507
1505
|
for (var pluginName in that.options.plugins) {
|
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.
|
|
6
|
+
"version": "0.12.0-beta.193",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=8.x",
|
|
9
9
|
"npm": ">=5.x"
|