@ajf/material 12.1.3 → 12.1.7
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/bundles/material-barcode.umd.js +3 -7
- package/bundles/material-barcode.umd.js.map +1 -1
- package/bundles/material-calendar.umd.js +5 -17
- package/bundles/material-calendar.umd.js.map +1 -1
- package/bundles/material-checkbox-group.umd.js +4 -14
- package/bundles/material-checkbox-group.umd.js.map +1 -1
- package/bundles/material-form-builder.umd.js +497 -483
- package/bundles/material-form-builder.umd.js.map +1 -1
- package/bundles/material-forms.umd.js +96 -64
- package/bundles/material-forms.umd.js.map +1 -1
- package/bundles/material-image.umd.js +3 -10
- package/bundles/material-image.umd.js.map +1 -1
- package/bundles/material-monaco-editor.umd.js +4 -7
- package/bundles/material-monaco-editor.umd.js.map +1 -1
- package/bundles/material-node-icon.umd.js +3 -10
- package/bundles/material-node-icon.umd.js.map +1 -1
- package/bundles/material-page-slider.umd.js +2 -7
- package/bundles/material-page-slider.umd.js.map +1 -1
- package/bundles/material-reports.umd.js +4 -6
- package/bundles/material-reports.umd.js.map +1 -1
- package/bundles/material-time.umd.js +4 -12
- package/bundles/material-time.umd.js.map +1 -1
- package/calendar/index.metadata.json +1 -1
- package/checkbox-group/index.metadata.json +1 -1
- package/esm2015/barcode/barcode-module.js +3 -7
- package/esm2015/barcode/barcode.js +3 -3
- package/esm2015/calendar/calendar-module.js +4 -14
- package/esm2015/calendar/calendar.js +4 -6
- package/esm2015/checkbox-group/checkbox-group-item.js +3 -3
- package/esm2015/checkbox-group/checkbox-group-module.js +4 -14
- package/esm2015/form-builder/branch-line.js +2 -2
- package/esm2015/form-builder/choices-origin-data-source.js +1 -1
- package/esm2015/form-builder/choices-origin-editor-dialog.js +7 -4
- package/esm2015/form-builder/choices-origin-editor.js +1 -1
- package/esm2015/form-builder/condition-editor-dialog.js +1 -1
- package/esm2015/form-builder/condition-editor.js +9 -8
- package/esm2015/form-builder/form-builder-module.js +29 -14
- package/esm2015/form-builder/form-builder-service.js +126 -125
- package/esm2015/form-builder/form-builder-utils.js +4 -3
- package/esm2015/form-builder/form-builder.js +30 -26
- package/esm2015/form-builder/node-entry.js +7 -5
- package/esm2015/form-builder/node-properties.js +297 -311
- package/esm2015/form-builder/node-type-entry.js +2 -2
- package/esm2015/form-builder/string-identifier-dialog.js +5 -7
- package/esm2015/form-builder/validation-condition-editor-dialog.js +1 -1
- package/esm2015/form-builder/warning-condition-editor-dialog.js +1 -1
- package/esm2015/forms/barcode-field.js +3 -3
- package/esm2015/forms/boolean-field.js +3 -3
- package/esm2015/forms/date-field.js +2 -2
- package/esm2015/forms/date-input-field.js +4 -4
- package/esm2015/forms/empty-field.js +3 -3
- package/esm2015/forms/field-service.js +42 -42
- package/esm2015/forms/field-warning-dialog.js +1 -1
- package/esm2015/forms/field.js +2 -2
- package/esm2015/forms/form.js +2 -2
- package/esm2015/forms/forms-module.js +55 -23
- package/esm2015/forms/input-field.js +2 -2
- package/esm2015/forms/multiple-choice-field.js +3 -3
- package/esm2015/forms/range-field.js +3 -3
- package/esm2015/forms/single-choice-field.js +3 -3
- package/esm2015/forms/table-field.js +3 -3
- package/esm2015/forms/text-field.js +2 -2
- package/esm2015/forms/time-field.js +3 -3
- package/esm2015/forms/video-url-field.js +2 -2
- package/esm2015/forms/warning-alert-service.js +1 -1
- package/esm2015/image/image-module.js +4 -11
- package/esm2015/image/image.js +2 -2
- package/esm2015/monaco-editor/autocomplete-singleton-model.js +3 -2
- package/esm2015/monaco-editor/editor-options-model.js +1 -1
- package/esm2015/monaco-editor/monaco-editor-module.js +3 -7
- package/esm2015/monaco-editor/monaco-editor.js +3 -3
- package/esm2015/node-icon/node-icon-module.js +4 -11
- package/esm2015/node-icon/node-icon.js +1 -1
- package/esm2015/page-slider/page-slider-module.js +3 -8
- package/esm2015/page-slider/page-slider.js +2 -2
- package/esm2015/reports/chart-widget.js +2 -2
- package/esm2015/reports/formula-widget.js +2 -2
- package/esm2015/reports/image-container-widget.js +2 -2
- package/esm2015/reports/image-widget.js +2 -2
- package/esm2015/reports/map-widget.js +2 -2
- package/esm2015/reports/page-break-widget.js +2 -2
- package/esm2015/reports/report.js +2 -2
- package/esm2015/reports/reports-module.js +3 -6
- package/esm2015/reports/table-widget.js +3 -3
- package/esm2015/reports/text-widget.js +2 -2
- package/esm2015/reports/widget.js +3 -2
- package/esm2015/time/time-module.js +4 -12
- package/esm2015/time/time.js +3 -3
- package/fesm2015/barcode.js +3 -7
- package/fesm2015/barcode.js.map +1 -1
- package/fesm2015/calendar.js +5 -17
- package/fesm2015/calendar.js.map +1 -1
- package/fesm2015/checkbox-group.js +4 -14
- package/fesm2015/checkbox-group.js.map +1 -1
- package/fesm2015/form-builder.js +494 -483
- package/fesm2015/form-builder.js.map +1 -1
- package/fesm2015/forms.js +96 -64
- package/fesm2015/forms.js.map +1 -1
- package/fesm2015/image.js +3 -10
- package/fesm2015/image.js.map +1 -1
- package/fesm2015/monaco-editor.js +5 -8
- package/fesm2015/monaco-editor.js.map +1 -1
- package/fesm2015/node-icon.js +3 -10
- package/fesm2015/node-icon.js.map +1 -1
- package/fesm2015/page-slider.js +2 -7
- package/fesm2015/page-slider.js.map +1 -1
- package/fesm2015/reports.js +4 -6
- package/fesm2015/reports.js.map +1 -1
- package/fesm2015/time.js +4 -12
- package/fesm2015/time.js.map +1 -1
- package/form-builder/index.metadata.json +1 -1
- package/forms/index.metadata.json +1 -1
- package/image/index.metadata.json +1 -1
- package/monaco-editor/index.metadata.json +1 -1
- package/node-icon/index.metadata.json +1 -1
- package/package.json +2 -4
- package/page-slider/index.metadata.json +1 -1
- package/reports/index.metadata.json +1 -1
- package/time/index.metadata.json +1 -1
- package/bundles/material-report-builder.umd.js +0 -5814
- package/bundles/material-report-builder.umd.js.map +0 -1
- package/esm2015/report-builder/column.js +0 -97
- package/esm2015/report-builder/condition-editor.js +0 -159
- package/esm2015/report-builder/content.js +0 -255
- package/esm2015/report-builder/custom-widget-dialog.js +0 -51
- package/esm2015/report-builder/custom-widget-toolbar-button.js +0 -70
- package/esm2015/report-builder/custom-widgets-toolbar.js +0 -124
- package/esm2015/report-builder/forms-analyzer-dialog.js +0 -315
- package/esm2015/report-builder/forms-analyzer.js +0 -264
- package/esm2015/report-builder/image-filter.js +0 -32
- package/esm2015/report-builder/image-group.js +0 -106
- package/esm2015/report-builder/index.js +0 -25
- package/esm2015/report-builder/models.js +0 -23
- package/esm2015/report-builder/operations.js +0 -23
- package/esm2015/report-builder/properties.js +0 -765
- package/esm2015/report-builder/public-api.js +0 -26
- package/esm2015/report-builder/quill-editor.js +0 -299
- package/esm2015/report-builder/renderer-widget.js +0 -238
- package/esm2015/report-builder/report-builder-drag-data.js +0 -23
- package/esm2015/report-builder/report-builder-module.js +0 -114
- package/esm2015/report-builder/report-builder-service.js +0 -1685
- package/esm2015/report-builder/report-builder.externs.js +0 -6
- package/esm2015/report-builder/report-builder.js +0 -69
- package/esm2015/report-builder/theme-color-dialog.js +0 -90
- package/esm2015/report-builder/theme-color.js +0 -215
- package/esm2015/report-builder/tokens.js +0 -24
- package/esm2015/report-builder/toolbar-dialog.js +0 -56
- package/esm2015/report-builder/toolbar.js +0 -90
- package/esm2015/report-builder/utils.js +0 -48
- package/esm2015/report-builder/widget-toolbar-button.js +0 -47
- package/esm2015/report-builder/widgets-row-buttons.js +0 -133
- package/esm2015/report-builder/widgets-toolbar.js +0 -79
- package/fesm2015/report-builder.js +0 -5332
- package/fesm2015/report-builder.js.map +0 -1
- package/report-builder/_report-builder.scss +0 -0
- package/report-builder/column.d.ts +0 -63
- package/report-builder/condition-editor.d.ts +0 -67
- package/report-builder/content.d.ts +0 -142
- package/report-builder/custom-widget-dialog.d.ts +0 -31
- package/report-builder/custom-widget-toolbar-button.d.ts +0 -45
- package/report-builder/custom-widgets-toolbar.d.ts +0 -71
- package/report-builder/forms-analyzer-dialog.d.ts +0 -91
- package/report-builder/forms-analyzer.d.ts +0 -102
- package/report-builder/image-filter.d.ts +0 -25
- package/report-builder/image-group.d.ts +0 -69
- package/report-builder/index.d.ts +0 -24
- package/report-builder/index.metadata.json +0 -1
- package/report-builder/models.d.ts +0 -43
- package/report-builder/operations.d.ts +0 -45
- package/report-builder/package.json +0 -9
- package/report-builder/properties.d.ts +0 -365
- package/report-builder/public-api.d.ts +0 -26
- package/report-builder/quill-editor.d.ts +0 -113
- package/report-builder/renderer-widget.d.ts +0 -80
- package/report-builder/report-builder-drag-data.d.ts +0 -32
- package/report-builder/report-builder-module.d.ts +0 -23
- package/report-builder/report-builder-service.d.ts +0 -722
- package/report-builder/report-builder.d.ts +0 -36
- package/report-builder/theme-color-dialog.d.ts +0 -42
- package/report-builder/theme-color.d.ts +0 -108
- package/report-builder/tokens.d.ts +0 -24
- package/report-builder/toolbar-dialog.d.ts +0 -30
- package/report-builder/toolbar.d.ts +0 -48
- package/report-builder/utils.d.ts +0 -29
- package/report-builder/widget-toolbar-button.d.ts +0 -28
- package/report-builder/widgets-row-buttons.d.ts +0 -57
- package/report-builder/widgets-toolbar.d.ts +0 -44
package/fesm2015/form-builder.js
CHANGED
|
@@ -251,7 +251,8 @@ function getNodeContainer(c, node) {
|
|
|
251
251
|
return null;
|
|
252
252
|
}
|
|
253
253
|
function buildFormBuilderNodesSubtree(nodes, parent, ignoreConditionalBranches = false) {
|
|
254
|
-
const entries = nodes
|
|
254
|
+
const entries = nodes
|
|
255
|
+
.filter(n => n.parent === parent.id)
|
|
255
256
|
.sort((n1, n2) => n1.parentNode - n2.parentNode)
|
|
256
257
|
.map(n => {
|
|
257
258
|
const children = buildFormBuilderNodesSubtree(nodes, n);
|
|
@@ -261,7 +262,7 @@ function buildFormBuilderNodesSubtree(nodes, parent, ignoreConditionalBranches =
|
|
|
261
262
|
return {
|
|
262
263
|
node: n,
|
|
263
264
|
children,
|
|
264
|
-
content: buildFormBuilderNodesContent(nodes, n)
|
|
265
|
+
content: buildFormBuilderNodesContent(nodes, n),
|
|
265
266
|
};
|
|
266
267
|
});
|
|
267
268
|
if (!ignoreConditionalBranches) {
|
|
@@ -290,9 +291,9 @@ function flattenNodes(nodes) {
|
|
|
290
291
|
return flatNodes;
|
|
291
292
|
}
|
|
292
293
|
function getDescendants(flatNodes, parentNode, branch = null) {
|
|
293
|
-
return branch != null
|
|
294
|
-
flatNodes.filter(n => n.parent === parentNode.id && n.parentNode === branch)
|
|
295
|
-
flatNodes.filter(n => n.parent === parentNode.id);
|
|
294
|
+
return branch != null
|
|
295
|
+
? flatNodes.filter(n => n.parent === parentNode.id && n.parentNode === branch)
|
|
296
|
+
: flatNodes.filter(n => n.parent === parentNode.id);
|
|
296
297
|
}
|
|
297
298
|
function removeNodes(nodes, ids) {
|
|
298
299
|
const len = nodes.length;
|
|
@@ -324,74 +325,74 @@ class AjfFormBuilderService {
|
|
|
324
325
|
label: 'Slide',
|
|
325
326
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-slide' },
|
|
326
327
|
nodeType: { node: AjfNodeType.AjfSlide },
|
|
327
|
-
isSlide: true
|
|
328
|
+
isSlide: true,
|
|
328
329
|
},
|
|
329
330
|
{
|
|
330
331
|
label: 'Repeating slide',
|
|
331
332
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-repeatingslide' },
|
|
332
333
|
nodeType: { node: AjfNodeType.AjfRepeatingSlide },
|
|
333
|
-
isSlide: true
|
|
334
|
+
isSlide: true,
|
|
334
335
|
},
|
|
335
336
|
{
|
|
336
337
|
label: 'String',
|
|
337
338
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-string' },
|
|
338
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.String }
|
|
339
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.String },
|
|
339
340
|
},
|
|
340
341
|
{
|
|
341
342
|
label: 'Text',
|
|
342
343
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-text' },
|
|
343
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Text }
|
|
344
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Text },
|
|
344
345
|
},
|
|
345
346
|
{
|
|
346
347
|
label: 'Number',
|
|
347
348
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-number' },
|
|
348
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Number }
|
|
349
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Number },
|
|
349
350
|
},
|
|
350
351
|
{
|
|
351
352
|
label: 'Boolean',
|
|
352
353
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-boolean' },
|
|
353
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Boolean }
|
|
354
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Boolean },
|
|
354
355
|
},
|
|
355
356
|
{
|
|
356
357
|
label: 'Single choice',
|
|
357
358
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-singlechoice' },
|
|
358
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.SingleChoice }
|
|
359
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.SingleChoice },
|
|
359
360
|
},
|
|
360
361
|
{
|
|
361
362
|
label: 'Multiple choice',
|
|
362
363
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-multiplechoice' },
|
|
363
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.MultipleChoice }
|
|
364
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.MultipleChoice },
|
|
364
365
|
},
|
|
365
366
|
{
|
|
366
367
|
label: 'Formula',
|
|
367
368
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-formula' },
|
|
368
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Formula }
|
|
369
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Formula },
|
|
369
370
|
},
|
|
370
371
|
{
|
|
371
372
|
label: 'Date',
|
|
372
373
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-date' },
|
|
373
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Date }
|
|
374
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Date },
|
|
374
375
|
},
|
|
375
376
|
{
|
|
376
377
|
label: 'Date input',
|
|
377
378
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-dateinput' },
|
|
378
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.DateInput }
|
|
379
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.DateInput },
|
|
379
380
|
},
|
|
380
381
|
{
|
|
381
382
|
label: 'Time',
|
|
382
383
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-time' },
|
|
383
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Time }
|
|
384
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Time },
|
|
384
385
|
},
|
|
385
386
|
{
|
|
386
387
|
label: 'Table',
|
|
387
388
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-table' },
|
|
388
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Table }
|
|
389
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Table },
|
|
389
390
|
},
|
|
390
391
|
{
|
|
391
392
|
label: 'Range',
|
|
392
393
|
icon: { fontSet: 'ajf-icon', fontIcon: 'field-range' },
|
|
393
|
-
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Range }
|
|
394
|
-
}
|
|
394
|
+
nodeType: { node: AjfNodeType.AjfField, field: AjfFieldType.Range },
|
|
395
|
+
},
|
|
395
396
|
];
|
|
396
397
|
this._form = new BehaviorSubject(null);
|
|
397
398
|
this._formObs = this._form;
|
|
@@ -400,11 +401,14 @@ class AjfFormBuilderService {
|
|
|
400
401
|
*/
|
|
401
402
|
this._connectedDropLists = new BehaviorSubject([]);
|
|
402
403
|
this._editedNodeEntry = new BehaviorSubject(null);
|
|
403
|
-
this._editedNodeEntryObs = this
|
|
404
|
+
this._editedNodeEntryObs = this
|
|
405
|
+
._editedNodeEntry;
|
|
404
406
|
this._editedCondition = new BehaviorSubject(null);
|
|
405
|
-
this._editedConditionObs = this
|
|
407
|
+
this._editedConditionObs = this
|
|
408
|
+
._editedCondition;
|
|
406
409
|
this._editedChoicesOrigin = new BehaviorSubject(null);
|
|
407
|
-
this._editedChoicesOriginObs = this
|
|
410
|
+
this._editedChoicesOriginObs = this
|
|
411
|
+
._editedChoicesOrigin;
|
|
408
412
|
this._beforeNodesUpdate = new EventEmitter();
|
|
409
413
|
this._beforeNodesUpdateObs = this._beforeNodesUpdate;
|
|
410
414
|
this._afterNodeUpdate = new EventEmitter();
|
|
@@ -555,9 +559,9 @@ class AjfFormBuilderService {
|
|
|
555
559
|
}
|
|
556
560
|
this._beforeNodesUpdate.emit();
|
|
557
561
|
this._nodesUpdates.next((nodes) => {
|
|
558
|
-
const cn = isContainerNode(parent) && inContent
|
|
559
|
-
parent
|
|
560
|
-
getNodeContainer({ nodes }, parent);
|
|
562
|
+
const cn = isContainerNode(parent) && inContent
|
|
563
|
+
? parent
|
|
564
|
+
: getNodeContainer({ nodes }, parent);
|
|
561
565
|
if (!isFieldNode) {
|
|
562
566
|
let newNodes = nodes.slice(0);
|
|
563
567
|
newNodes.splice(insertInIndex, 0, node);
|
|
@@ -592,10 +596,12 @@ class AjfFormBuilderService {
|
|
|
592
596
|
}
|
|
593
597
|
getCurrentForm() {
|
|
594
598
|
return combineLatest([
|
|
595
|
-
this.form,
|
|
596
|
-
this.
|
|
597
|
-
|
|
598
|
-
.
|
|
599
|
+
this.form,
|
|
600
|
+
this._nodesWithoutChoiceOrigins,
|
|
601
|
+
this.attachmentsOrigins,
|
|
602
|
+
this.choicesOrigins,
|
|
603
|
+
this.stringIdentifier,
|
|
604
|
+
]).pipe(filter(([form]) => form != null), map(([form, nodes, attachmentsOrigins, choicesOrigins, stringIdentifier]) => {
|
|
599
605
|
return createForm({
|
|
600
606
|
choicesOrigins: choicesOrigins.slice(0),
|
|
601
607
|
attachmentsOrigins: attachmentsOrigins.slice(0),
|
|
@@ -622,7 +628,7 @@ class AjfFormBuilderService {
|
|
|
622
628
|
if (isChoicesFixedOrigin(choicesOrigin)) {
|
|
623
629
|
choicesOrigin.choices = params.choices;
|
|
624
630
|
}
|
|
625
|
-
this._choicesOriginsUpdates.next(
|
|
631
|
+
this._choicesOriginsUpdates.next(choicesOrigins => {
|
|
626
632
|
const idx = choicesOrigins.indexOf(choicesOrigin);
|
|
627
633
|
if (idx > -1) {
|
|
628
634
|
choicesOrigins = [
|
|
@@ -655,7 +661,7 @@ class AjfFormBuilderService {
|
|
|
655
661
|
node: rootNode,
|
|
656
662
|
container: null,
|
|
657
663
|
children: buildFormBuilderNodesSubtree(nodes, rootNode),
|
|
658
|
-
content: buildFormBuilderNodesContent(nodes, rootNode)
|
|
664
|
+
content: buildFormBuilderNodesContent(nodes, rootNode),
|
|
659
665
|
});
|
|
660
666
|
return tree;
|
|
661
667
|
}
|
|
@@ -671,7 +677,7 @@ class AjfFormBuilderService {
|
|
|
671
677
|
}
|
|
672
678
|
_findMaxNodeId(nodes, _curMaxId = 0) {
|
|
673
679
|
let maxId = 0;
|
|
674
|
-
nodes.forEach(
|
|
680
|
+
nodes.forEach(n => {
|
|
675
681
|
maxId = Math.max(maxId, n.id);
|
|
676
682
|
if (isContainerNode(n)) {
|
|
677
683
|
maxId = Math.max(maxId, this._findMaxNodeId(n.nodes));
|
|
@@ -689,25 +695,24 @@ class AjfFormBuilderService {
|
|
|
689
695
|
return form != null && form.nodes != null ? form.nodes.slice(0) : [];
|
|
690
696
|
});
|
|
691
697
|
this._attachmentsOriginsUpdates.next((_attachmentsOrigins) => {
|
|
692
|
-
return form != null && form.attachmentsOrigins != null
|
|
693
|
-
form.attachmentsOrigins.slice(0)
|
|
694
|
-
[];
|
|
698
|
+
return form != null && form.attachmentsOrigins != null
|
|
699
|
+
? form.attachmentsOrigins.slice(0)
|
|
700
|
+
: [];
|
|
695
701
|
});
|
|
696
702
|
this._choicesOriginsUpdates.next((_choicesOrigins) => {
|
|
697
703
|
return form != null && form.choicesOrigins != null ? form.choicesOrigins.slice(0) : [];
|
|
698
704
|
});
|
|
699
705
|
this._stringIdentifierUpdates.next((_) => {
|
|
700
|
-
return form != null && form.stringIdentifier != null
|
|
701
|
-
|
|
706
|
+
return form != null && form.stringIdentifier != null
|
|
707
|
+
? form.stringIdentifier.slice(0)
|
|
708
|
+
: [];
|
|
702
709
|
});
|
|
703
710
|
});
|
|
704
711
|
}
|
|
705
712
|
_initChoicesOriginsStreams() {
|
|
706
|
-
this._choicesOrigins =
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
return op(choicesOrigins);
|
|
710
|
-
}, []), publishReplay(1), refCount());
|
|
713
|
+
this._choicesOrigins = (this._choicesOriginsUpdates).pipe(scan((choicesOrigins, op) => {
|
|
714
|
+
return op(choicesOrigins);
|
|
715
|
+
}, []), publishReplay(1), refCount());
|
|
711
716
|
}
|
|
712
717
|
_initAttachmentsOriginsStreams() {
|
|
713
718
|
this._attachmentsOrigins = this._attachmentsOriginsUpdates.pipe(scan((attachmentsOrigins, op) => {
|
|
@@ -720,27 +725,25 @@ class AjfFormBuilderService {
|
|
|
720
725
|
}, []), publishReplay(1), refCount());
|
|
721
726
|
}
|
|
722
727
|
_initNodesStreams() {
|
|
723
|
-
this._nodes = this._nodesUpdates
|
|
724
|
-
.pipe(scan((nodes, op) => {
|
|
728
|
+
this._nodes = this._nodesUpdates.pipe(scan((nodes, op) => {
|
|
725
729
|
return op(nodes);
|
|
726
730
|
}, []), publishReplay(1), refCount());
|
|
727
|
-
this._nodesWithoutChoiceOrigins =
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
delete fwc.choices;
|
|
734
|
-
}
|
|
735
|
-
if (fwc && fwc.choicesOrigin) {
|
|
736
|
-
delete fwc.choicesOrigin;
|
|
737
|
-
}
|
|
738
|
-
return fwc;
|
|
731
|
+
this._nodesWithoutChoiceOrigins = this._nodes.pipe(map(slides => slides.map(slide => {
|
|
732
|
+
slide.nodes = slide.nodes.map((node) => {
|
|
733
|
+
if (isFieldWithChoices(node)) {
|
|
734
|
+
const fwc = deepCopy(node);
|
|
735
|
+
if (fwc && fwc.choices) {
|
|
736
|
+
delete fwc.choices;
|
|
739
737
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
738
|
+
if (fwc && fwc.choicesOrigin) {
|
|
739
|
+
delete fwc.choicesOrigin;
|
|
740
|
+
}
|
|
741
|
+
return fwc;
|
|
742
|
+
}
|
|
743
|
+
return node;
|
|
744
|
+
});
|
|
745
|
+
return slide;
|
|
746
|
+
})));
|
|
744
747
|
this._flatNodes = this._nodes.pipe(map((nodes) => flattenNodes(nodes)), publishReplay(1), refCount());
|
|
745
748
|
this._flatFields = this._flatNodes.pipe(map((nodes) => nodes.filter(n => !isContainerNode(n))), publishReplay(1), refCount());
|
|
746
749
|
this._nodeEntriesTree = this._nodes.pipe(map(nodes => this._buildFormBuilderNodesTree(nodes)), publishReplay(1), refCount());
|
|
@@ -755,19 +758,22 @@ class AjfFormBuilderService {
|
|
|
755
758
|
node.id = nodeEntry.node.id;
|
|
756
759
|
node.name = properties.name;
|
|
757
760
|
node.label = properties.label;
|
|
758
|
-
node.visibility =
|
|
759
|
-
|
|
760
|
-
|
|
761
|
+
node.visibility =
|
|
762
|
+
properties.visibility != null
|
|
763
|
+
? createCondition({ condition: properties.visibility })
|
|
764
|
+
: null;
|
|
761
765
|
const oldConditionalBranches = node.conditionalBranches.length;
|
|
762
|
-
node.conditionalBranches =
|
|
763
|
-
properties.conditionalBranches
|
|
764
|
-
|
|
766
|
+
node.conditionalBranches =
|
|
767
|
+
properties.conditionalBranches != null
|
|
768
|
+
? properties.conditionalBranches.map((condition) => createCondition({ condition }))
|
|
769
|
+
: [alwaysCondition()];
|
|
765
770
|
const newConditionalBranches = node.conditionalBranches.length;
|
|
766
771
|
if (isRepeatingContainerNode(node)) {
|
|
767
772
|
const repNode = node;
|
|
768
|
-
repNode.formulaReps =
|
|
769
|
-
|
|
770
|
-
|
|
773
|
+
repNode.formulaReps =
|
|
774
|
+
properties.formulaReps != null
|
|
775
|
+
? createFormula({ formula: properties.formulaReps })
|
|
776
|
+
: undefined;
|
|
771
777
|
repNode.minReps = properties.minReps;
|
|
772
778
|
repNode.maxReps = properties.maxReps;
|
|
773
779
|
}
|
|
@@ -775,9 +781,8 @@ class AjfFormBuilderService {
|
|
|
775
781
|
const field = node;
|
|
776
782
|
field.description = properties.description;
|
|
777
783
|
field.defaultValue = properties.defaultValue;
|
|
778
|
-
field.formula =
|
|
779
|
-
createFormula({ formula: properties.formula }) :
|
|
780
|
-
undefined;
|
|
784
|
+
field.formula =
|
|
785
|
+
properties.formula != null ? createFormula({ formula: properties.formula }) : undefined;
|
|
781
786
|
const forceValue = properties.value;
|
|
782
787
|
const notEmpty = properties.notEmpty;
|
|
783
788
|
const validationConditions = properties.validationConditions;
|
|
@@ -797,25 +802,24 @@ class AjfFormBuilderService {
|
|
|
797
802
|
if (isNaN(maxDigits)) {
|
|
798
803
|
maxDigits = null;
|
|
799
804
|
}
|
|
800
|
-
if (forceValue != null ||
|
|
805
|
+
if (forceValue != null ||
|
|
806
|
+
notEmpty != null ||
|
|
801
807
|
(validationConditions != null && validationConditions.length > 0) ||
|
|
802
|
-
minValue != null ||
|
|
808
|
+
minValue != null ||
|
|
809
|
+
maxValue != null ||
|
|
810
|
+
minDigits != null ||
|
|
803
811
|
maxDigits != null) {
|
|
804
812
|
const validation = field.validation || createValidationGroup({});
|
|
805
813
|
validation.forceValue = forceValue;
|
|
806
814
|
validation.notEmpty = notEmpty ? notEmptyValidation() : undefined;
|
|
807
815
|
validation.minValue = minValue != null ? minValidation(minValue) : undefined;
|
|
808
816
|
validation.maxValue = maxValue != null ? maxValidation(maxValue) : undefined;
|
|
809
|
-
validation.minDigits =
|
|
810
|
-
|
|
811
|
-
validation.
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
[]).map((c) => createValidation({
|
|
816
|
-
condition: c.condition,
|
|
817
|
-
errorMessage: c.errorMessage
|
|
818
|
-
}));
|
|
817
|
+
validation.minDigits = minDigits != null ? minDigitsValidation(minDigits) : undefined;
|
|
818
|
+
validation.maxDigits = maxDigits != null ? maxDigitsValidation(maxDigits) : undefined;
|
|
819
|
+
validation.conditions = (validationConditions || []).map((c) => createValidation({
|
|
820
|
+
condition: c.condition,
|
|
821
|
+
errorMessage: c.errorMessage,
|
|
822
|
+
}));
|
|
819
823
|
field.validation = validation;
|
|
820
824
|
}
|
|
821
825
|
else {
|
|
@@ -827,20 +831,19 @@ class AjfFormBuilderService {
|
|
|
827
831
|
(warningConditions != null && warningConditions.length > 0)) {
|
|
828
832
|
const warning = field.warning || createWarningGroup({});
|
|
829
833
|
warning.notEmpty = notEmptyWarn ? notEmptyWarning() : undefined;
|
|
830
|
-
warning.conditions =
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
warningMessage: w.warningMessage
|
|
835
|
-
}));
|
|
834
|
+
warning.conditions = (warningConditions || []).map((w) => createWarning({
|
|
835
|
+
condition: w.condition,
|
|
836
|
+
warningMessage: w.warningMessage,
|
|
837
|
+
}));
|
|
836
838
|
field.warning = warning;
|
|
837
839
|
}
|
|
838
840
|
else {
|
|
839
841
|
field.warning = undefined;
|
|
840
842
|
}
|
|
841
|
-
field.nextSlideCondition =
|
|
842
|
-
|
|
843
|
-
|
|
843
|
+
field.nextSlideCondition =
|
|
844
|
+
properties.nextSlideCondition != null
|
|
845
|
+
? createCondition({ condition: properties.nextSlideCondition })
|
|
846
|
+
: undefined;
|
|
844
847
|
field.size = properties.size;
|
|
845
848
|
field.defaultValue = properties.defaultValue;
|
|
846
849
|
if (isFieldWithChoices(field)) {
|
|
@@ -848,8 +851,7 @@ class AjfFormBuilderService {
|
|
|
848
851
|
fwc.choicesOriginRef = properties.choicesOriginRef;
|
|
849
852
|
fwc.forceExpanded = properties.forceExpanded;
|
|
850
853
|
fwc.forceNarrow = properties.forceNarrow;
|
|
851
|
-
fwc.triggerConditions = (properties.triggerConditions ||
|
|
852
|
-
[]).map((t) => createCondition({ condition: t }));
|
|
854
|
+
fwc.triggerConditions = (properties.triggerConditions || []).map((t) => createCondition({ condition: t }));
|
|
853
855
|
}
|
|
854
856
|
}
|
|
855
857
|
this._editedNodeEntry.next(null);
|
|
@@ -915,32 +917,31 @@ class AjfFormBuilderService {
|
|
|
915
917
|
*/
|
|
916
918
|
_initMoveNode() {
|
|
917
919
|
this._moveNodeSub.unsubscribe();
|
|
918
|
-
this._moveNodeSub =
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
nodes = nodes.slice(0);
|
|
938
|
-
}
|
|
920
|
+
this._moveNodeSub = this._moveNodeEntryEvent
|
|
921
|
+
.pipe(map((moveEvent) => {
|
|
922
|
+
this._beforeNodesUpdate.emit();
|
|
923
|
+
return (nodes) => {
|
|
924
|
+
const nodeEntry = moveEvent.nodeEntry;
|
|
925
|
+
const node = nodeEntry.node;
|
|
926
|
+
let cn = getNodeContainer({ nodes }, node);
|
|
927
|
+
let newNodes = nodes;
|
|
928
|
+
if (cn != null) {
|
|
929
|
+
const replaceNodes = cn.nodes === nodes;
|
|
930
|
+
newNodes = cn.nodes;
|
|
931
|
+
moveItemInArray(newNodes, moveEvent.fromIndex, moveEvent.toIndex);
|
|
932
|
+
newNodes = this._updateNodesList(cn.id, newNodes);
|
|
933
|
+
cn.nodes = newNodes;
|
|
934
|
+
if (replaceNodes) {
|
|
935
|
+
nodes = newNodes;
|
|
936
|
+
}
|
|
937
|
+
else {
|
|
938
|
+
nodes = nodes.slice(0);
|
|
939
939
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
}
|
|
943
|
-
|
|
940
|
+
}
|
|
941
|
+
return nodes;
|
|
942
|
+
};
|
|
943
|
+
}))
|
|
944
|
+
.subscribe(this._nodesUpdates);
|
|
944
945
|
}
|
|
945
946
|
/**
|
|
946
947
|
* Updates the "id" and "parent" fields of a modified or rearranged list of nodes.
|
|
@@ -954,8 +955,8 @@ class AjfFormBuilderService {
|
|
|
954
955
|
const contId = containerId != undefined ? containerId : 0;
|
|
955
956
|
for (let idx = 0; idx < nodesList.length; idx++) {
|
|
956
957
|
let currentNode = nodesList[idx];
|
|
957
|
-
currentNode.id =
|
|
958
|
-
currentNode.parent = idx == 0 ? contId :
|
|
958
|
+
currentNode.id = contId * 1000 + idx + 1;
|
|
959
|
+
currentNode.parent = idx == 0 ? contId : contId * 1000 + idx;
|
|
959
960
|
if (currentNode.nodeType == AjfNodeType.AjfSlide ||
|
|
960
961
|
currentNode.nodeType == AjfNodeType.AjfRepeatingSlide) {
|
|
961
962
|
const currentSlide = currentNode;
|
|
@@ -996,14 +997,17 @@ AjfFormBuilderService.ctorParameters = () => [];
|
|
|
996
997
|
class AjfFbChoicesOriginEditorDialog {
|
|
997
998
|
constructor(_service) {
|
|
998
999
|
this._service = _service;
|
|
999
|
-
this._choicesOrigin =
|
|
1000
|
-
this._service.editedChoicesOrigin.pipe(filter(c => c != null), map(c => c));
|
|
1000
|
+
this._choicesOrigin = this._service.editedChoicesOrigin.pipe(filter(c => c != null), map(c => c));
|
|
1001
1001
|
}
|
|
1002
1002
|
get choicesOrigin() {
|
|
1003
1003
|
return this._choicesOrigin;
|
|
1004
1004
|
}
|
|
1005
1005
|
saveChoicesOrigin() {
|
|
1006
|
-
this._service.saveChoicesOrigin({
|
|
1006
|
+
this._service.saveChoicesOrigin({
|
|
1007
|
+
label: this.editor.label,
|
|
1008
|
+
name: this.editor.name,
|
|
1009
|
+
choices: this.editor.choicesArr,
|
|
1010
|
+
});
|
|
1007
1011
|
}
|
|
1008
1012
|
cancelChoicesOriginEdit() {
|
|
1009
1013
|
this._service.cancelChoicesOriginEdit();
|
|
@@ -1073,12 +1077,15 @@ class AjfFbConditionEditor {
|
|
|
1073
1077
|
}
|
|
1074
1078
|
}
|
|
1075
1079
|
onEditorInit() {
|
|
1076
|
-
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
|
1080
|
+
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
|
1081
|
+
noSemanticValidation: false,
|
|
1082
|
+
noSyntaxValidation: false,
|
|
1083
|
+
});
|
|
1077
1084
|
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
|
|
1078
1085
|
target: monaco.languages.typescript.ScriptTarget.ES2015,
|
|
1079
1086
|
allowNonTsExtensions: true,
|
|
1080
1087
|
allowJs: true,
|
|
1081
|
-
module: monaco.languages.typescript.ModuleKind.None
|
|
1088
|
+
module: monaco.languages.typescript.ModuleKind.None,
|
|
1082
1089
|
});
|
|
1083
1090
|
try {
|
|
1084
1091
|
monaco.languages.typescript.javascriptDefaults.addExtraLib('', 'condition-editor-variables.d.ts');
|
|
@@ -1109,16 +1116,14 @@ class AjfFbConditionEditor {
|
|
|
1109
1116
|
})
|
|
1110
1117
|
.join('\n');
|
|
1111
1118
|
}
|
|
1112
|
-
catch (e) {
|
|
1113
|
-
}
|
|
1119
|
+
catch (e) { }
|
|
1114
1120
|
}
|
|
1115
1121
|
_updateFunctions() {
|
|
1116
1122
|
try {
|
|
1117
1123
|
monaco.languages.typescript.javascriptDefaults._extraLibs['condition-editor-functions.d.ts'] =
|
|
1118
1124
|
AjfExpressionUtils.UTIL_FUNCTIONS;
|
|
1119
1125
|
}
|
|
1120
|
-
catch (e) {
|
|
1121
|
-
}
|
|
1126
|
+
catch (e) { }
|
|
1122
1127
|
}
|
|
1123
1128
|
_fieldVarType(fieldType) {
|
|
1124
1129
|
switch (fieldType) {
|
|
@@ -1254,8 +1259,9 @@ function onDropProcess(event, fbService, nodeEntry, content = false) {
|
|
|
1254
1259
|
fbService.insertNode(itemData, null, 0, content, event.currentIndex);
|
|
1255
1260
|
return;
|
|
1256
1261
|
}
|
|
1257
|
-
const emptySlot = content
|
|
1258
|
-
nodeEntry
|
|
1262
|
+
const emptySlot = content
|
|
1263
|
+
? { parent: nodeEntry.node, parentNode: 0 }
|
|
1264
|
+
: nodeEntry;
|
|
1259
1265
|
fbService.insertNode(itemData, emptySlot.parent, emptySlot.parentNode, content, event.currentIndex);
|
|
1260
1266
|
return;
|
|
1261
1267
|
}
|
|
@@ -1313,7 +1319,8 @@ class AjfFbStringIdentifierDialogComponent {
|
|
|
1313
1319
|
this._stringIdentifierSub = _service.stringIdentifier.subscribe(identifier => {
|
|
1314
1320
|
this.dataSource.data = [...identifier];
|
|
1315
1321
|
});
|
|
1316
|
-
this.fields$ = _service.flatFields.pipe(map(fields => fields
|
|
1322
|
+
this.fields$ = _service.flatFields.pipe(map(fields => fields
|
|
1323
|
+
.sort((f1, f2) => f1.name.localeCompare(f2.name))
|
|
1317
1324
|
.map(f => f.name)
|
|
1318
1325
|
.filter(f => f.length > 0)), shareReplay(1));
|
|
1319
1326
|
}
|
|
@@ -1337,10 +1344,7 @@ class AjfFbStringIdentifierDialogComponent {
|
|
|
1337
1344
|
removeValue(row, value) {
|
|
1338
1345
|
const idx = row.value.indexOf(value);
|
|
1339
1346
|
if (idx > -1) {
|
|
1340
|
-
row.value = [
|
|
1341
|
-
...row.value.slice(0, idx),
|
|
1342
|
-
...row.value.slice(idx + 1),
|
|
1343
|
-
];
|
|
1347
|
+
row.value = [...row.value.slice(0, idx), ...row.value.slice(idx + 1)];
|
|
1344
1348
|
this._cdr.markForCheck();
|
|
1345
1349
|
}
|
|
1346
1350
|
}
|
|
@@ -1408,28 +1412,28 @@ class AjfFormBuilder {
|
|
|
1408
1412
|
this._nodeTypes = _service.availableNodeTypes;
|
|
1409
1413
|
this._nodeEntriesTree = _service.nodeEntriesTree;
|
|
1410
1414
|
this._choicesOrigins = _service.choicesOrigins;
|
|
1411
|
-
this._editConditionSub =
|
|
1412
|
-
this.
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
this._editChoicesOriginSub =
|
|
1423
|
-
this.
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1415
|
+
this._editConditionSub = this._service.editedCondition.subscribe((condition) => {
|
|
1416
|
+
if (this._editConditionDialog != null) {
|
|
1417
|
+
this._editConditionDialog.close();
|
|
1418
|
+
this._editConditionDialog = null;
|
|
1419
|
+
}
|
|
1420
|
+
if (condition != null) {
|
|
1421
|
+
this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog, {
|
|
1422
|
+
disableClose: true,
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
});
|
|
1426
|
+
this._editChoicesOriginSub = this._service.editedChoicesOrigin.subscribe((choicesOrigin) => {
|
|
1427
|
+
if (this._editChoicesOriginDialog != null) {
|
|
1428
|
+
this._editChoicesOriginDialog.close();
|
|
1429
|
+
this._editChoicesOriginDialog = null;
|
|
1430
|
+
}
|
|
1431
|
+
if (choicesOrigin != null) {
|
|
1432
|
+
this._editChoicesOriginDialog = this._dialog.open(AjfFbChoicesOriginEditorDialog, {
|
|
1433
|
+
disableClose: true,
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
});
|
|
1433
1437
|
this._beforeNodesUpdateSub = this._service.beforeNodesUpdate.subscribe(() => {
|
|
1434
1438
|
if (this.designerCont == null) {
|
|
1435
1439
|
return;
|
|
@@ -1509,7 +1513,11 @@ class AjfFormBuilder {
|
|
|
1509
1513
|
this._stringIdentifierDialog.close();
|
|
1510
1514
|
this._stringIdentifierDialog = null;
|
|
1511
1515
|
}
|
|
1512
|
-
this._stringIdentifierDialog = this._dialog.open(AjfFbStringIdentifierDialogComponent, {
|
|
1516
|
+
this._stringIdentifierDialog = this._dialog.open(AjfFbStringIdentifierDialogComponent, {
|
|
1517
|
+
disableClose: true,
|
|
1518
|
+
width: '60%',
|
|
1519
|
+
height: '60%',
|
|
1520
|
+
});
|
|
1513
1521
|
}
|
|
1514
1522
|
expandAll() {
|
|
1515
1523
|
this._globalExpanded = true;
|
|
@@ -1744,7 +1752,9 @@ class AjfFbNodeEntry {
|
|
|
1744
1752
|
};
|
|
1745
1753
|
}
|
|
1746
1754
|
_updateBranchHeights() {
|
|
1747
|
-
if (this.nodeEntry == null ||
|
|
1755
|
+
if (this.nodeEntry == null ||
|
|
1756
|
+
!this.isNodeEntry ||
|
|
1757
|
+
this.branchLines == null ||
|
|
1748
1758
|
this.childEntries == null) {
|
|
1749
1759
|
return;
|
|
1750
1760
|
}
|
|
@@ -1946,15 +1956,17 @@ class AjfFbNodeProperties {
|
|
|
1946
1956
|
this._dialog = _dialog;
|
|
1947
1957
|
this._fb = _fb;
|
|
1948
1958
|
this._fieldSizes = [
|
|
1949
|
-
{ label: 'Normal', value: 'normal' },
|
|
1950
|
-
{ label: '
|
|
1951
|
-
{ label: '
|
|
1959
|
+
{ label: 'Normal', value: 'normal' },
|
|
1960
|
+
{ label: 'Small', value: 'small' },
|
|
1961
|
+
{ label: 'Smaller', value: 'smaller' },
|
|
1962
|
+
{ label: 'Tiny', value: 'tiny' },
|
|
1963
|
+
{ label: 'Mini', value: 'mini' },
|
|
1952
1964
|
];
|
|
1953
1965
|
this._choicesOrigins = [];
|
|
1954
1966
|
this._conditionalBranches = [];
|
|
1955
1967
|
this._validationConditions = [];
|
|
1956
1968
|
this._warningConditions = [];
|
|
1957
|
-
this.isRepeatingContainerNode =
|
|
1969
|
+
this.isRepeatingContainerNode = nodeEntry => {
|
|
1958
1970
|
return nodeEntry != null && isRepeatingContainerNode(nodeEntry.node);
|
|
1959
1971
|
};
|
|
1960
1972
|
this._visibilityOptSub = Subscription.EMPTY;
|
|
@@ -2007,9 +2019,8 @@ class AjfFbNodeProperties {
|
|
|
2007
2019
|
this._saveEvt = new EventEmitter();
|
|
2008
2020
|
this._saveSub = Subscription.EMPTY;
|
|
2009
2021
|
this._nodeEntry = _service.editedNodeEntry;
|
|
2010
|
-
this._choicesOriginsSub =
|
|
2011
|
-
|
|
2012
|
-
this._enabled = this._nodeEntry.pipe(map((n) => n != null));
|
|
2022
|
+
this._choicesOriginsSub = _service.choicesOrigins.subscribe(c => (this._choicesOrigins = c || []));
|
|
2023
|
+
this._enabled = this._nodeEntry.pipe(map(n => n != null));
|
|
2013
2024
|
this._initForm();
|
|
2014
2025
|
this._initVisibilityEdit();
|
|
2015
2026
|
this._initConditionalBranchEdit();
|
|
@@ -2204,7 +2215,7 @@ class AjfFbNodeProperties {
|
|
|
2204
2215
|
});
|
|
2205
2216
|
}
|
|
2206
2217
|
_initForm() {
|
|
2207
|
-
this._propertiesForm = this._nodeEntry.pipe(filter(
|
|
2218
|
+
this._propertiesForm = this._nodeEntry.pipe(filter(n => n != null), map(n => {
|
|
2208
2219
|
if (this._visibilityOptSub != null) {
|
|
2209
2220
|
this._visibilityOptSub.unsubscribe();
|
|
2210
2221
|
}
|
|
@@ -2222,7 +2233,7 @@ class AjfFbNodeProperties {
|
|
|
2222
2233
|
label: n.node.label,
|
|
2223
2234
|
visibilityOpt: [visibilityOpt, Validators.required],
|
|
2224
2235
|
visibility: [visibility, Validators.required],
|
|
2225
|
-
conditionalBranchesNum: n.node.conditionalBranches.length
|
|
2236
|
+
conditionalBranchesNum: n.node.conditionalBranches.length,
|
|
2226
2237
|
};
|
|
2227
2238
|
const validators = [];
|
|
2228
2239
|
if (isRepeatingContainerNode(n.node)) {
|
|
@@ -2287,12 +2298,10 @@ class AjfFbNodeProperties {
|
|
|
2287
2298
|
maxValue = (numField.validation.maxValue.condition || '').replace('$value <= ', '');
|
|
2288
2299
|
}
|
|
2289
2300
|
if (numField.validation.minDigits != null) {
|
|
2290
|
-
minDigits = (numField.validation.minDigits.condition ||
|
|
2291
|
-
'').replace('$value.toString().length >= ', '');
|
|
2301
|
+
minDigits = (numField.validation.minDigits.condition || '').replace('$value.toString().length >= ', '');
|
|
2292
2302
|
}
|
|
2293
2303
|
if (numField.validation.maxDigits != null) {
|
|
2294
|
-
maxDigits = (numField.validation.maxDigits.condition ||
|
|
2295
|
-
'').replace('$value.toString().length <= ', '');
|
|
2304
|
+
maxDigits = (numField.validation.maxDigits.condition || '').replace('$value.toString().length <= ', '');
|
|
2296
2305
|
}
|
|
2297
2306
|
}
|
|
2298
2307
|
controls.minValue = minValue;
|
|
@@ -2304,11 +2313,10 @@ class AjfFbNodeProperties {
|
|
|
2304
2313
|
}
|
|
2305
2314
|
if (this.isFieldWithChoices(n.node)) {
|
|
2306
2315
|
const fieldWithChoices = n.node;
|
|
2307
|
-
let triggerConditions = (fieldWithChoices.triggerConditions || []).map(
|
|
2316
|
+
let triggerConditions = (fieldWithChoices.triggerConditions || []).map(c => c.condition);
|
|
2308
2317
|
controls.choicesOriginRef = fieldWithChoices.choicesOriginRef;
|
|
2309
|
-
controls.choicesFilter =
|
|
2310
|
-
fieldWithChoices.choicesFilter.formula :
|
|
2311
|
-
null;
|
|
2318
|
+
controls.choicesFilter =
|
|
2319
|
+
fieldWithChoices.choicesFilter != null ? fieldWithChoices.choicesFilter.formula : null;
|
|
2312
2320
|
controls.forceExpanded = fieldWithChoices.forceExpanded;
|
|
2313
2321
|
controls.forceNarrow = fieldWithChoices.forceNarrow;
|
|
2314
2322
|
controls.triggerConditions = triggerConditions;
|
|
@@ -2395,27 +2403,27 @@ class AjfFbNodeProperties {
|
|
|
2395
2403
|
_initTriggerConditionEdit() {
|
|
2396
2404
|
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2397
2405
|
this._cdr.markForCheck();
|
|
2398
|
-
this._editTriggerConditionSub =
|
|
2399
|
-
this.
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2406
|
+
this._editTriggerConditionSub = this._editTriggerConditionEvt
|
|
2407
|
+
.pipe(withLatestFrom(this._propertiesForm))
|
|
2408
|
+
.subscribe(([vcIdx, fg]) => {
|
|
2409
|
+
this._destroyConditionDialog();
|
|
2410
|
+
if (vcIdx < 0 || vcIdx >= this._triggerConditions.length || fg == null) {
|
|
2411
|
+
return;
|
|
2412
|
+
}
|
|
2413
|
+
this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
|
|
2414
|
+
const cmp = this._editConditionDialog.componentInstance;
|
|
2415
|
+
cmp.condition = this._triggerConditions[vcIdx];
|
|
2416
|
+
this._editConditionDialogSub = this._editConditionDialog
|
|
2417
|
+
.afterClosed()
|
|
2418
|
+
.subscribe((cond) => {
|
|
2419
|
+
if (cond !== void 0) {
|
|
2420
|
+
this._triggerConditions[vcIdx] = cond;
|
|
2405
2421
|
}
|
|
2406
|
-
this.
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
this._editConditionDialogSub =
|
|
2410
|
-
this._editConditionDialog.afterClosed().subscribe((cond) => {
|
|
2411
|
-
if (cond !== void 0) {
|
|
2412
|
-
this._triggerConditions[vcIdx] = cond;
|
|
2413
|
-
}
|
|
2414
|
-
this._editConditionDialogSub.unsubscribe();
|
|
2415
|
-
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2416
|
-
this._cdr.markForCheck();
|
|
2417
|
-
});
|
|
2422
|
+
this._editConditionDialogSub.unsubscribe();
|
|
2423
|
+
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2424
|
+
this._cdr.markForCheck();
|
|
2418
2425
|
});
|
|
2426
|
+
});
|
|
2419
2427
|
}
|
|
2420
2428
|
_initRemoveWarningCondition() {
|
|
2421
2429
|
this._removeWarningConditionSub = this._removeWarningConditionEvt
|
|
@@ -2449,30 +2457,29 @@ class AjfFbNodeProperties {
|
|
|
2449
2457
|
});
|
|
2450
2458
|
}
|
|
2451
2459
|
_initWarningConditionEdit() {
|
|
2452
|
-
this._editWarningConditionSub =
|
|
2453
|
-
this.
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2460
|
+
this._editWarningConditionSub = this._editWarningConditionEvt
|
|
2461
|
+
.pipe(withLatestFrom(this._propertiesForm))
|
|
2462
|
+
.subscribe(([vcIdx, fg]) => {
|
|
2463
|
+
this._destroyWarningConditionDialog();
|
|
2464
|
+
if (vcIdx < 0 || vcIdx >= this._warningConditions.length || fg == null) {
|
|
2465
|
+
return;
|
|
2466
|
+
}
|
|
2467
|
+
this._editWarningConditionDialog = this._dialog.open(AjfFbWarningConditionEditorDialog);
|
|
2468
|
+
const cmp = this._editWarningConditionDialog.componentInstance;
|
|
2469
|
+
const w = this._warningConditions[vcIdx];
|
|
2470
|
+
cmp.condition = w.condition;
|
|
2471
|
+
cmp.warningMessage = w.warningMessage;
|
|
2472
|
+
this._editWarningConditionDialogSub = this._editWarningConditionDialog
|
|
2473
|
+
.afterClosed()
|
|
2474
|
+
.subscribe((cond) => {
|
|
2475
|
+
if (cond !== void 0) {
|
|
2476
|
+
this._warningConditions[vcIdx] = cond;
|
|
2459
2477
|
}
|
|
2460
|
-
this.
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
const w = this._warningConditions[vcIdx];
|
|
2464
|
-
cmp.condition = w.condition;
|
|
2465
|
-
cmp.warningMessage = w.warningMessage;
|
|
2466
|
-
this._editWarningConditionDialogSub =
|
|
2467
|
-
this._editWarningConditionDialog.afterClosed().subscribe((cond) => {
|
|
2468
|
-
if (cond !== void 0) {
|
|
2469
|
-
this._warningConditions[vcIdx] = cond;
|
|
2470
|
-
}
|
|
2471
|
-
this._editWarningConditionDialogSub.unsubscribe();
|
|
2472
|
-
this._editWarningConditionDialogSub = Subscription.EMPTY;
|
|
2473
|
-
this._cdr.markForCheck();
|
|
2474
|
-
});
|
|
2478
|
+
this._editWarningConditionDialogSub.unsubscribe();
|
|
2479
|
+
this._editWarningConditionDialogSub = Subscription.EMPTY;
|
|
2480
|
+
this._cdr.markForCheck();
|
|
2475
2481
|
});
|
|
2482
|
+
});
|
|
2476
2483
|
}
|
|
2477
2484
|
_initRemoveValidationCondition() {
|
|
2478
2485
|
this._removeValidationConditionSub = this._removeValidationConditionEvt
|
|
@@ -2506,205 +2513,202 @@ class AjfFbNodeProperties {
|
|
|
2506
2513
|
});
|
|
2507
2514
|
}
|
|
2508
2515
|
_initValidationConditionEdit() {
|
|
2509
|
-
this._editValidationConditionSub =
|
|
2510
|
-
this.
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
+
this._editValidationConditionSub = this._editValidationConditionEvt
|
|
2517
|
+
.pipe(withLatestFrom(this._propertiesForm))
|
|
2518
|
+
.subscribe(([vcIdx, fg]) => {
|
|
2519
|
+
this._destroyValidationConditionDialog();
|
|
2520
|
+
if (vcIdx < 0 || vcIdx >= this._validationConditions.length || fg == null) {
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2523
|
+
this._editValidationConditionDialog = this._dialog.open(AjfFbValidationConditionEditorDialog);
|
|
2524
|
+
const cmp = this._editValidationConditionDialog.componentInstance;
|
|
2525
|
+
const v = this._validationConditions[vcIdx];
|
|
2526
|
+
cmp.condition = v.condition;
|
|
2527
|
+
cmp.errorMessage = v.errorMessage;
|
|
2528
|
+
this._editValidationConditionDialogSub = this._editValidationConditionDialog
|
|
2529
|
+
.afterClosed()
|
|
2530
|
+
.subscribe((cond) => {
|
|
2531
|
+
if (cond !== void 0) {
|
|
2532
|
+
this._validationConditions[vcIdx] = cond;
|
|
2516
2533
|
}
|
|
2517
|
-
this.
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
const v = this._validationConditions[vcIdx];
|
|
2521
|
-
cmp.condition = v.condition;
|
|
2522
|
-
cmp.errorMessage = v.errorMessage;
|
|
2523
|
-
this._editValidationConditionDialogSub =
|
|
2524
|
-
this._editValidationConditionDialog.afterClosed().subscribe((cond) => {
|
|
2525
|
-
if (cond !== void 0) {
|
|
2526
|
-
this._validationConditions[vcIdx] = cond;
|
|
2527
|
-
}
|
|
2528
|
-
this._editValidationConditionDialogSub.unsubscribe();
|
|
2529
|
-
this._editValidationConditionDialogSub = Subscription.EMPTY;
|
|
2530
|
-
this._cdr.markForCheck();
|
|
2531
|
-
});
|
|
2534
|
+
this._editValidationConditionDialogSub.unsubscribe();
|
|
2535
|
+
this._editValidationConditionDialogSub = Subscription.EMPTY;
|
|
2536
|
+
this._cdr.markForCheck();
|
|
2532
2537
|
});
|
|
2538
|
+
});
|
|
2533
2539
|
}
|
|
2534
2540
|
_initForceValueEdit() {
|
|
2535
|
-
this._editForceValueSub =
|
|
2536
|
-
this.
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2541
|
+
this._editForceValueSub = this._editForceValueEvt
|
|
2542
|
+
.pipe(withLatestFrom(this._propertiesForm))
|
|
2543
|
+
.subscribe(([_, formGroup]) => {
|
|
2544
|
+
this._destroyConditionDialog();
|
|
2545
|
+
if (formGroup == null) {
|
|
2546
|
+
return;
|
|
2547
|
+
}
|
|
2548
|
+
const fg = formGroup;
|
|
2549
|
+
const ctrl = fg.controls['forceValue'];
|
|
2550
|
+
this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
|
|
2551
|
+
this._editConditionDialog.componentInstance.condition = ctrl.value;
|
|
2552
|
+
this._editConditionDialogSub = this._editConditionDialog
|
|
2553
|
+
.afterClosed()
|
|
2554
|
+
.subscribe((cond) => {
|
|
2555
|
+
if (cond !== void 0) {
|
|
2556
|
+
ctrl.setValue(cond);
|
|
2542
2557
|
}
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
this.
|
|
2546
|
-
this._editConditionDialog.componentInstance.condition = ctrl.value;
|
|
2547
|
-
this._editConditionDialogSub =
|
|
2548
|
-
this._editConditionDialog.afterClosed().subscribe((cond) => {
|
|
2549
|
-
if (cond !== void 0) {
|
|
2550
|
-
ctrl.setValue(cond);
|
|
2551
|
-
}
|
|
2552
|
-
this._editConditionDialogSub.unsubscribe();
|
|
2553
|
-
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2554
|
-
this._cdr.markForCheck();
|
|
2555
|
-
});
|
|
2558
|
+
this._editConditionDialogSub.unsubscribe();
|
|
2559
|
+
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2560
|
+
this._cdr.markForCheck();
|
|
2556
2561
|
});
|
|
2562
|
+
});
|
|
2557
2563
|
}
|
|
2558
2564
|
_initNextSlideConditionEdit() {
|
|
2559
|
-
this._editNextSlideConditionSub =
|
|
2560
|
-
this.
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2565
|
+
this._editNextSlideConditionSub = this._editNextSlideConditionEvt
|
|
2566
|
+
.pipe(withLatestFrom(this._propertiesForm))
|
|
2567
|
+
.subscribe(([_, formGroup]) => {
|
|
2568
|
+
this._destroyConditionDialog();
|
|
2569
|
+
if (formGroup == null) {
|
|
2570
|
+
return;
|
|
2571
|
+
}
|
|
2572
|
+
const fg = formGroup;
|
|
2573
|
+
const ctrl = fg.controls['nextSlideCondition'];
|
|
2574
|
+
this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
|
|
2575
|
+
this._editConditionDialog.componentInstance.condition = ctrl.value;
|
|
2576
|
+
this._editConditionDialogSub = this._editConditionDialog
|
|
2577
|
+
.afterClosed()
|
|
2578
|
+
.subscribe((cond) => {
|
|
2579
|
+
if (cond !== void 0) {
|
|
2580
|
+
ctrl.setValue(cond);
|
|
2566
2581
|
}
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
this.
|
|
2570
|
-
this._editConditionDialog.componentInstance.condition = ctrl.value;
|
|
2571
|
-
this._editConditionDialogSub =
|
|
2572
|
-
this._editConditionDialog.afterClosed().subscribe((cond) => {
|
|
2573
|
-
if (cond !== void 0) {
|
|
2574
|
-
ctrl.setValue(cond);
|
|
2575
|
-
}
|
|
2576
|
-
this._editConditionDialogSub.unsubscribe();
|
|
2577
|
-
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2578
|
-
this._cdr.markForCheck();
|
|
2579
|
-
});
|
|
2582
|
+
this._editConditionDialogSub.unsubscribe();
|
|
2583
|
+
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2584
|
+
this._cdr.markForCheck();
|
|
2580
2585
|
});
|
|
2586
|
+
});
|
|
2581
2587
|
}
|
|
2582
2588
|
_initFormulaEdit() {
|
|
2583
2589
|
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2584
2590
|
this._cdr.markForCheck();
|
|
2585
|
-
this._editFormulaSub =
|
|
2586
|
-
this.
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2591
|
+
this._editFormulaSub = this._editFormulaEvt
|
|
2592
|
+
.pipe(withLatestFrom(this._propertiesForm))
|
|
2593
|
+
.subscribe(([_, formGroup]) => {
|
|
2594
|
+
this._destroyConditionDialog();
|
|
2595
|
+
if (formGroup == null) {
|
|
2596
|
+
return;
|
|
2597
|
+
}
|
|
2598
|
+
const fg = formGroup;
|
|
2599
|
+
const ctrl = fg.controls['formula'];
|
|
2600
|
+
this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
|
|
2601
|
+
this._editConditionDialog.componentInstance.condition = ctrl.value;
|
|
2602
|
+
this._editConditionDialogSub = this._editConditionDialog
|
|
2603
|
+
.afterClosed()
|
|
2604
|
+
.subscribe((cond) => {
|
|
2605
|
+
if (cond !== void 0) {
|
|
2606
|
+
ctrl.setValue(cond);
|
|
2592
2607
|
}
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
this.
|
|
2596
|
-
this._editConditionDialog.componentInstance.condition = ctrl.value;
|
|
2597
|
-
this._editConditionDialogSub =
|
|
2598
|
-
this._editConditionDialog.afterClosed().subscribe((cond) => {
|
|
2599
|
-
if (cond !== void 0) {
|
|
2600
|
-
ctrl.setValue(cond);
|
|
2601
|
-
}
|
|
2602
|
-
this._editConditionDialogSub.unsubscribe();
|
|
2603
|
-
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2604
|
-
this._cdr.markForCheck();
|
|
2605
|
-
});
|
|
2608
|
+
this._editConditionDialogSub.unsubscribe();
|
|
2609
|
+
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2610
|
+
this._cdr.markForCheck();
|
|
2606
2611
|
});
|
|
2612
|
+
});
|
|
2607
2613
|
}
|
|
2608
2614
|
_initFormulaRepsEdit() {
|
|
2609
|
-
this._editFormulaRepsSub =
|
|
2610
|
-
this.
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2615
|
+
this._editFormulaRepsSub = this._editFormulaRepsEvt
|
|
2616
|
+
.pipe(withLatestFrom(this._propertiesForm))
|
|
2617
|
+
.subscribe(([_, formGroup]) => {
|
|
2618
|
+
this._destroyConditionDialog();
|
|
2619
|
+
if (formGroup == null) {
|
|
2620
|
+
return;
|
|
2621
|
+
}
|
|
2622
|
+
const fg = formGroup;
|
|
2623
|
+
const ctrl = fg.controls['formulaReps'];
|
|
2624
|
+
this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
|
|
2625
|
+
this._editConditionDialog.componentInstance.condition = ctrl.value;
|
|
2626
|
+
this._editConditionDialogSub = this._editConditionDialog
|
|
2627
|
+
.afterClosed()
|
|
2628
|
+
.subscribe((cond) => {
|
|
2629
|
+
if (cond !== void 0) {
|
|
2630
|
+
ctrl.setValue(cond);
|
|
2616
2631
|
}
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
this.
|
|
2620
|
-
this._editConditionDialog.componentInstance.condition = ctrl.value;
|
|
2621
|
-
this._editConditionDialogSub =
|
|
2622
|
-
this._editConditionDialog.afterClosed().subscribe((cond) => {
|
|
2623
|
-
if (cond !== void 0) {
|
|
2624
|
-
ctrl.setValue(cond);
|
|
2625
|
-
}
|
|
2626
|
-
this._editConditionDialogSub.unsubscribe();
|
|
2627
|
-
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2628
|
-
this._cdr.markForCheck();
|
|
2629
|
-
});
|
|
2632
|
+
this._editConditionDialogSub.unsubscribe();
|
|
2633
|
+
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2634
|
+
this._cdr.markForCheck();
|
|
2630
2635
|
});
|
|
2636
|
+
});
|
|
2631
2637
|
}
|
|
2632
2638
|
_initChoicesFilterEdit() {
|
|
2633
|
-
this._editChoicesFilterSub =
|
|
2634
|
-
this.
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2639
|
+
this._editChoicesFilterSub = this._editChoicesFilterEvt
|
|
2640
|
+
.pipe(withLatestFrom(this._propertiesForm))
|
|
2641
|
+
.subscribe(([_, formGroup]) => {
|
|
2642
|
+
this._destroyConditionDialog();
|
|
2643
|
+
if (formGroup == null) {
|
|
2644
|
+
return;
|
|
2645
|
+
}
|
|
2646
|
+
const fg = formGroup;
|
|
2647
|
+
const ctrl = fg.controls['choicesFilter'];
|
|
2648
|
+
this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
|
|
2649
|
+
this._editConditionDialog.componentInstance.condition = ctrl.value;
|
|
2650
|
+
this._editConditionDialogSub = this._editConditionDialog
|
|
2651
|
+
.afterClosed()
|
|
2652
|
+
.subscribe((cond) => {
|
|
2653
|
+
if (cond !== void 0) {
|
|
2654
|
+
ctrl.setValue(cond);
|
|
2640
2655
|
}
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
this.
|
|
2644
|
-
this._editConditionDialog.componentInstance.condition = ctrl.value;
|
|
2645
|
-
this._editConditionDialogSub =
|
|
2646
|
-
this._editConditionDialog.afterClosed().subscribe((cond) => {
|
|
2647
|
-
if (cond !== void 0) {
|
|
2648
|
-
ctrl.setValue(cond);
|
|
2649
|
-
}
|
|
2650
|
-
this._editConditionDialogSub.unsubscribe();
|
|
2651
|
-
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2652
|
-
this._cdr.markForCheck();
|
|
2653
|
-
});
|
|
2656
|
+
this._editConditionDialogSub.unsubscribe();
|
|
2657
|
+
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2658
|
+
this._cdr.markForCheck();
|
|
2654
2659
|
});
|
|
2660
|
+
});
|
|
2655
2661
|
}
|
|
2656
2662
|
_initConditionalBranchEdit() {
|
|
2657
|
-
this._editConditionalBranchSub =
|
|
2658
|
-
this.
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2663
|
+
this._editConditionalBranchSub = this._editConditionalBranchEvt
|
|
2664
|
+
.pipe(withLatestFrom(this._propertiesForm))
|
|
2665
|
+
.subscribe(([cbIdx, fg]) => {
|
|
2666
|
+
this._destroyConditionDialog();
|
|
2667
|
+
if (cbIdx < 0 || cbIdx >= this._conditionalBranches.length || fg == null) {
|
|
2668
|
+
return;
|
|
2669
|
+
}
|
|
2670
|
+
this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
|
|
2671
|
+
this._editConditionDialog.componentInstance.condition = this._conditionalBranches[cbIdx];
|
|
2672
|
+
this._editConditionDialogSub = this._editConditionDialog
|
|
2673
|
+
.afterClosed()
|
|
2674
|
+
.subscribe((cond) => {
|
|
2675
|
+
if (cond !== void 0) {
|
|
2676
|
+
this._conditionalBranches[cbIdx] = cond;
|
|
2664
2677
|
}
|
|
2665
|
-
this.
|
|
2666
|
-
this.
|
|
2667
|
-
|
|
2668
|
-
this._editConditionDialogSub =
|
|
2669
|
-
this._editConditionDialog.afterClosed().subscribe((cond) => {
|
|
2670
|
-
if (cond !== void 0) {
|
|
2671
|
-
this._conditionalBranches[cbIdx] = cond;
|
|
2672
|
-
}
|
|
2673
|
-
this._editConditionDialogSub.unsubscribe();
|
|
2674
|
-
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2675
|
-
this._cdr.markForCheck();
|
|
2676
|
-
});
|
|
2678
|
+
this._editConditionDialogSub.unsubscribe();
|
|
2679
|
+
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2680
|
+
this._cdr.markForCheck();
|
|
2677
2681
|
});
|
|
2682
|
+
});
|
|
2678
2683
|
}
|
|
2679
2684
|
_initVisibilityEdit() {
|
|
2680
|
-
this._editVisibilitySub =
|
|
2681
|
-
this.
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2685
|
+
this._editVisibilitySub = this._editVisibilityEvt
|
|
2686
|
+
.pipe(withLatestFrom(this._propertiesForm))
|
|
2687
|
+
.subscribe(([_, formGroup]) => {
|
|
2688
|
+
this._destroyConditionDialog();
|
|
2689
|
+
if (formGroup == null) {
|
|
2690
|
+
return;
|
|
2691
|
+
}
|
|
2692
|
+
const fg = formGroup;
|
|
2693
|
+
const ctrl = fg.controls['visibility'];
|
|
2694
|
+
const condition = ctrl.value;
|
|
2695
|
+
this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
|
|
2696
|
+
this._editConditionDialog.componentInstance.condition = condition;
|
|
2697
|
+
this._editConditionDialogSub = this._editConditionDialog
|
|
2698
|
+
.afterClosed()
|
|
2699
|
+
.subscribe((cond) => {
|
|
2700
|
+
if (cond !== void 0) {
|
|
2701
|
+
ctrl.setValue(cond);
|
|
2687
2702
|
}
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
|
|
2692
|
-
this._editConditionDialog.componentInstance.condition = condition;
|
|
2693
|
-
this._editConditionDialogSub =
|
|
2694
|
-
this._editConditionDialog.afterClosed().subscribe((cond) => {
|
|
2695
|
-
if (cond !== void 0) {
|
|
2696
|
-
ctrl.setValue(cond);
|
|
2697
|
-
}
|
|
2698
|
-
this._editConditionDialogSub.unsubscribe();
|
|
2699
|
-
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2700
|
-
this._cdr.markForCheck();
|
|
2701
|
-
});
|
|
2703
|
+
this._editConditionDialogSub.unsubscribe();
|
|
2704
|
+
this._editConditionDialogSub = Subscription.EMPTY;
|
|
2705
|
+
this._cdr.markForCheck();
|
|
2702
2706
|
});
|
|
2707
|
+
});
|
|
2703
2708
|
}
|
|
2704
2709
|
_handleTriggerCondtionsChange(fg) {
|
|
2705
2710
|
this._triggerConditionsSub = fg.valueChanges
|
|
2706
|
-
.pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.triggerConditions) ===
|
|
2707
|
-
JSON.stringify(v2.triggerConditions)))
|
|
2711
|
+
.pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.triggerConditions) === JSON.stringify(v2.triggerConditions)))
|
|
2708
2712
|
.subscribe((v) => {
|
|
2709
2713
|
this._triggerConditions = v.triggerConditions;
|
|
2710
2714
|
this._cdr.markForCheck();
|
|
@@ -2712,112 +2716,104 @@ class AjfFbNodeProperties {
|
|
|
2712
2716
|
}
|
|
2713
2717
|
_handleWarningCondtionsChange(fg) {
|
|
2714
2718
|
this._warningConditionsSub = fg.valueChanges
|
|
2715
|
-
.pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.warningConditions) ===
|
|
2716
|
-
JSON.stringify(v2.warningConditions)))
|
|
2719
|
+
.pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.warningConditions) === JSON.stringify(v2.warningConditions)))
|
|
2717
2720
|
.subscribe((v) => {
|
|
2718
2721
|
this._warningConditions = v.warningConditions;
|
|
2719
2722
|
this._cdr.markForCheck();
|
|
2720
2723
|
});
|
|
2721
2724
|
}
|
|
2722
2725
|
_handleValidationCondtionsChange(fg) {
|
|
2723
|
-
this._validationConditionsSub =
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
this._cdr.markForCheck();
|
|
2730
|
-
});
|
|
2726
|
+
this._validationConditionsSub = fg.valueChanges
|
|
2727
|
+
.pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.validationConditions) === JSON.stringify(v2.validationConditions)))
|
|
2728
|
+
.subscribe((v) => {
|
|
2729
|
+
this._validationConditions = v.validationConditions;
|
|
2730
|
+
this._cdr.markForCheck();
|
|
2731
|
+
});
|
|
2731
2732
|
}
|
|
2732
2733
|
_handleForceValueChange(fg) {
|
|
2733
|
-
this._forceValueSub =
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2734
|
+
this._forceValueSub = fg.valueChanges
|
|
2735
|
+
.pipe(distinctUntilChanged((v1, v2) => v1.forceValue === v2.forceValue))
|
|
2736
|
+
.subscribe((v) => {
|
|
2737
|
+
this._curForceValue = v.forceValue;
|
|
2738
|
+
this._cdr.markForCheck();
|
|
2739
|
+
});
|
|
2739
2740
|
}
|
|
2740
2741
|
_handleNextSlideConditionChange(fg) {
|
|
2741
|
-
this._formulaSub =
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
this._cdr.markForCheck();
|
|
2754
|
-
});
|
|
2742
|
+
this._formulaSub = fg.valueChanges
|
|
2743
|
+
.pipe(distinctUntilChanged((v1, v2) => v1.nextSlideCondition === v2.nextSlideCondition))
|
|
2744
|
+
.subscribe((v) => {
|
|
2745
|
+
this._nextSlideCondition = v.nextSlideCondition;
|
|
2746
|
+
this._cdr.markForCheck();
|
|
2747
|
+
});
|
|
2748
|
+
this._formulaSub = fg.valueChanges
|
|
2749
|
+
.pipe(distinctUntilChanged((v1, v2) => v1.nextSlideCondition === v2.nextSlideCondition))
|
|
2750
|
+
.subscribe((v) => {
|
|
2751
|
+
this._nextSlideCondition = v.nextSlideCondition;
|
|
2752
|
+
this._cdr.markForCheck();
|
|
2753
|
+
});
|
|
2755
2754
|
}
|
|
2756
2755
|
_handleFormulaChange(fg) {
|
|
2757
|
-
this._formulaSub =
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2756
|
+
this._formulaSub = fg.valueChanges
|
|
2757
|
+
.pipe(distinctUntilChanged((v1, v2) => v1.formula === v2.formula))
|
|
2758
|
+
.subscribe((v) => {
|
|
2759
|
+
this._curFormula = v.formula;
|
|
2760
|
+
this._cdr.markForCheck();
|
|
2761
|
+
});
|
|
2763
2762
|
}
|
|
2764
2763
|
_handleFormulaRepsChange(fg) {
|
|
2765
|
-
this._formulaRepsSub =
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2764
|
+
this._formulaRepsSub = fg.valueChanges
|
|
2765
|
+
.pipe(distinctUntilChanged((v1, v2) => v1.formulaReps === v2.formulaReps))
|
|
2766
|
+
.subscribe((v) => {
|
|
2767
|
+
this._curFormulaReps = v.formulaReps;
|
|
2768
|
+
this._cdr.markForCheck();
|
|
2769
|
+
});
|
|
2771
2770
|
}
|
|
2772
2771
|
_handleChoicesFilterChange(fg) {
|
|
2773
|
-
this._choicesFilterSub =
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
});
|
|
2772
|
+
this._choicesFilterSub = fg.valueChanges
|
|
2773
|
+
.pipe(distinctUntilChanged((v1, v2) => v1.choicesFilter === v2.choicesFilter))
|
|
2774
|
+
.subscribe((v) => {
|
|
2775
|
+
this._curChoicesFilter = v.choicesFilter;
|
|
2776
|
+
this._cdr.markForCheck();
|
|
2777
|
+
});
|
|
2780
2778
|
}
|
|
2781
2779
|
_handleConditionalBranchesChange(fg) {
|
|
2782
|
-
this._conditionalBranchesSub =
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
newCbs.push(alwaysCondition().condition);
|
|
2792
|
-
}
|
|
2793
|
-
this._conditionalBranches = this._conditionalBranches.concat(newCbs);
|
|
2794
|
-
}
|
|
2795
|
-
else if (curCbNum > cbNum) {
|
|
2796
|
-
this._conditionalBranches.splice(0, curCbNum - cbNum);
|
|
2780
|
+
this._conditionalBranchesSub = fg.valueChanges
|
|
2781
|
+
.pipe(distinctUntilChanged((v1, v2) => v1.conditionalBranchesNum === v2.conditionalBranchesNum))
|
|
2782
|
+
.subscribe((v) => {
|
|
2783
|
+
const cbNum = v.conditionalBranchesNum;
|
|
2784
|
+
const curCbNum = this._conditionalBranches.length;
|
|
2785
|
+
if (curCbNum < cbNum) {
|
|
2786
|
+
let newCbs = [];
|
|
2787
|
+
for (let i = curCbNum; i < cbNum; i++) {
|
|
2788
|
+
newCbs.push(alwaysCondition().condition);
|
|
2797
2789
|
}
|
|
2798
|
-
this.
|
|
2799
|
-
}
|
|
2790
|
+
this._conditionalBranches = this._conditionalBranches.concat(newCbs);
|
|
2791
|
+
}
|
|
2792
|
+
else if (curCbNum > cbNum) {
|
|
2793
|
+
this._conditionalBranches.splice(0, curCbNum - cbNum);
|
|
2794
|
+
}
|
|
2795
|
+
this._cdr.markForCheck();
|
|
2796
|
+
});
|
|
2800
2797
|
}
|
|
2801
2798
|
_handleVisibilityChange(fg) {
|
|
2802
|
-
this._visibilitySub =
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
});
|
|
2799
|
+
this._visibilitySub = fg.valueChanges
|
|
2800
|
+
.pipe(distinctUntilChanged((v1, v2) => v1.visibilityOpt === v2.visibilityOpt))
|
|
2801
|
+
.subscribe(v => {
|
|
2802
|
+
const visibilityOpt = v.visibilityOpt;
|
|
2803
|
+
let newCondition;
|
|
2804
|
+
switch (visibilityOpt) {
|
|
2805
|
+
case 'always':
|
|
2806
|
+
newCondition = alwaysCondition().condition;
|
|
2807
|
+
break;
|
|
2808
|
+
case 'never':
|
|
2809
|
+
newCondition = neverCondition().condition;
|
|
2810
|
+
break;
|
|
2811
|
+
default:
|
|
2812
|
+
newCondition = null;
|
|
2813
|
+
}
|
|
2814
|
+
this._curVisibility = newCondition;
|
|
2815
|
+
fg.controls['visibility'].setValue(newCondition);
|
|
2816
|
+
});
|
|
2821
2817
|
this._visibilitySub = fg.valueChanges
|
|
2822
2818
|
.pipe(filter(v => v.visibilityOpt === 'condition'), distinctUntilChanged((v1, v2) => v1.visibility === v2.visibility))
|
|
2823
2819
|
.subscribe(v => {
|
|
@@ -2926,13 +2922,32 @@ class AjfFormBuilderModule {
|
|
|
2926
2922
|
AjfFormBuilderModule.decorators = [
|
|
2927
2923
|
{ type: NgModule, args: [{
|
|
2928
2924
|
imports: [
|
|
2929
|
-
AjfMonacoEditorModule,
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2925
|
+
AjfMonacoEditorModule,
|
|
2926
|
+
AjfNodeIconModule,
|
|
2927
|
+
CommonModule,
|
|
2928
|
+
DragDropModule,
|
|
2929
|
+
FormsModule,
|
|
2930
|
+
MatAutocompleteModule,
|
|
2931
|
+
MatButtonModule,
|
|
2932
|
+
MatCardModule,
|
|
2933
|
+
MatCheckboxModule,
|
|
2934
|
+
MatChipsModule,
|
|
2935
|
+
MatDialogModule,
|
|
2936
|
+
MatFormFieldModule,
|
|
2937
|
+
MatIconModule,
|
|
2938
|
+
MatInputModule,
|
|
2939
|
+
MatListModule,
|
|
2940
|
+
MatMenuModule,
|
|
2941
|
+
MatSelectModule,
|
|
2942
|
+
MatSidenavModule,
|
|
2943
|
+
MatSliderModule,
|
|
2944
|
+
MatTableModule,
|
|
2945
|
+
MatToolbarModule,
|
|
2946
|
+
MatTooltipModule,
|
|
2947
|
+
ReactiveFormsModule,
|
|
2948
|
+
AjfTranslocoModule,
|
|
2949
|
+
MatExpansionModule,
|
|
2950
|
+
MatSlideToggleModule,
|
|
2936
2951
|
],
|
|
2937
2952
|
declarations: [
|
|
2938
2953
|
AjfFbBranchLine,
|
|
@@ -2948,12 +2963,8 @@ AjfFormBuilderModule.decorators = [
|
|
|
2948
2963
|
AjfFbWarningConditionEditorDialog,
|
|
2949
2964
|
AjfFormBuilder,
|
|
2950
2965
|
],
|
|
2951
|
-
exports: [
|
|
2952
|
-
|
|
2953
|
-
],
|
|
2954
|
-
providers: [
|
|
2955
|
-
AjfFormBuilderService,
|
|
2956
|
-
],
|
|
2966
|
+
exports: [AjfFormBuilder],
|
|
2967
|
+
providers: [AjfFormBuilderService],
|
|
2957
2968
|
},] }
|
|
2958
2969
|
];
|
|
2959
2970
|
|