@ajf/material 12.1.5 → 12.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/bundles/material-barcode.umd.js +3 -7
  2. package/bundles/material-barcode.umd.js.map +1 -1
  3. package/bundles/material-calendar.umd.js +5 -17
  4. package/bundles/material-calendar.umd.js.map +1 -1
  5. package/bundles/material-checkbox-group.umd.js +4 -14
  6. package/bundles/material-checkbox-group.umd.js.map +1 -1
  7. package/bundles/material-form-builder.umd.js +523 -484
  8. package/bundles/material-form-builder.umd.js.map +1 -1
  9. package/bundles/material-forms.umd.js +95 -63
  10. package/bundles/material-forms.umd.js.map +1 -1
  11. package/bundles/material-image.umd.js +3 -10
  12. package/bundles/material-image.umd.js.map +1 -1
  13. package/bundles/material-monaco-editor.umd.js +4 -7
  14. package/bundles/material-monaco-editor.umd.js.map +1 -1
  15. package/bundles/material-node-icon.umd.js +3 -10
  16. package/bundles/material-node-icon.umd.js.map +1 -1
  17. package/bundles/material-page-slider.umd.js +2 -7
  18. package/bundles/material-page-slider.umd.js.map +1 -1
  19. package/bundles/material-reports.umd.js +68 -12
  20. package/bundles/material-reports.umd.js.map +1 -1
  21. package/bundles/material-time.umd.js +4 -12
  22. package/bundles/material-time.umd.js.map +1 -1
  23. package/calendar/index.metadata.json +1 -1
  24. package/checkbox-group/index.metadata.json +1 -1
  25. package/esm2015/barcode/barcode-module.js +3 -7
  26. package/esm2015/barcode/barcode.js +3 -3
  27. package/esm2015/calendar/calendar-module.js +4 -14
  28. package/esm2015/calendar/calendar.js +4 -6
  29. package/esm2015/checkbox-group/checkbox-group-item.js +3 -3
  30. package/esm2015/checkbox-group/checkbox-group-module.js +4 -14
  31. package/esm2015/form-builder/branch-line.js +2 -2
  32. package/esm2015/form-builder/choices-origin-data-source.js +1 -1
  33. package/esm2015/form-builder/choices-origin-editor-dialog.js +7 -4
  34. package/esm2015/form-builder/choices-origin-editor.js +1 -1
  35. package/esm2015/form-builder/condition-editor-dialog.js +1 -1
  36. package/esm2015/form-builder/condition-editor.js +9 -8
  37. package/esm2015/form-builder/form-builder-module.js +29 -14
  38. package/esm2015/form-builder/form-builder-service.js +132 -125
  39. package/esm2015/form-builder/form-builder-utils.js +4 -3
  40. package/esm2015/form-builder/form-builder.js +30 -26
  41. package/esm2015/form-builder/node-entry.js +7 -5
  42. package/esm2015/form-builder/node-properties.js +317 -312
  43. package/esm2015/form-builder/node-type-entry.js +2 -2
  44. package/esm2015/form-builder/string-identifier-dialog.js +5 -7
  45. package/esm2015/form-builder/validation-condition-editor-dialog.js +1 -1
  46. package/esm2015/form-builder/warning-condition-editor-dialog.js +1 -1
  47. package/esm2015/forms/barcode-field.js +3 -3
  48. package/esm2015/forms/boolean-field.js +3 -3
  49. package/esm2015/forms/date-field.js +2 -2
  50. package/esm2015/forms/date-input-field.js +3 -3
  51. package/esm2015/forms/empty-field.js +3 -3
  52. package/esm2015/forms/field-service.js +42 -42
  53. package/esm2015/forms/field-warning-dialog.js +1 -1
  54. package/esm2015/forms/field.js +2 -2
  55. package/esm2015/forms/form.js +2 -2
  56. package/esm2015/forms/forms-module.js +55 -23
  57. package/esm2015/forms/input-field.js +2 -2
  58. package/esm2015/forms/multiple-choice-field.js +3 -3
  59. package/esm2015/forms/range-field.js +3 -3
  60. package/esm2015/forms/single-choice-field.js +3 -3
  61. package/esm2015/forms/table-field.js +3 -3
  62. package/esm2015/forms/text-field.js +2 -2
  63. package/esm2015/forms/time-field.js +3 -3
  64. package/esm2015/forms/video-url-field.js +2 -2
  65. package/esm2015/forms/warning-alert-service.js +1 -1
  66. package/esm2015/image/image-module.js +4 -11
  67. package/esm2015/image/image.js +2 -2
  68. package/esm2015/monaco-editor/autocomplete-singleton-model.js +3 -2
  69. package/esm2015/monaco-editor/editor-options-model.js +1 -1
  70. package/esm2015/monaco-editor/monaco-editor-module.js +3 -7
  71. package/esm2015/monaco-editor/monaco-editor.js +3 -3
  72. package/esm2015/node-icon/node-icon-module.js +4 -11
  73. package/esm2015/node-icon/node-icon.js +1 -1
  74. package/esm2015/page-slider/page-slider-module.js +3 -8
  75. package/esm2015/page-slider/page-slider.js +2 -2
  76. package/esm2015/reports/chart-widget.js +2 -2
  77. package/esm2015/reports/filter-widget.js +78 -0
  78. package/esm2015/reports/formula-widget.js +2 -2
  79. package/esm2015/reports/image-container-widget.js +2 -2
  80. package/esm2015/reports/image-widget.js +2 -2
  81. package/esm2015/reports/map-widget.js +2 -2
  82. package/esm2015/reports/page-break-widget.js +2 -2
  83. package/esm2015/reports/public-api.js +2 -1
  84. package/esm2015/reports/report.js +2 -2
  85. package/esm2015/reports/reports-module.js +7 -6
  86. package/esm2015/reports/table-widget.js +3 -3
  87. package/esm2015/reports/text-widget.js +2 -2
  88. package/esm2015/reports/widget.js +7 -4
  89. package/esm2015/time/time-module.js +4 -12
  90. package/esm2015/time/time.js +3 -3
  91. package/fesm2015/barcode.js +3 -7
  92. package/fesm2015/barcode.js.map +1 -1
  93. package/fesm2015/calendar.js +5 -17
  94. package/fesm2015/calendar.js.map +1 -1
  95. package/fesm2015/checkbox-group.js +4 -14
  96. package/fesm2015/checkbox-group.js.map +1 -1
  97. package/fesm2015/form-builder.js +521 -485
  98. package/fesm2015/form-builder.js.map +1 -1
  99. package/fesm2015/forms.js +95 -63
  100. package/fesm2015/forms.js.map +1 -1
  101. package/fesm2015/image.js +3 -10
  102. package/fesm2015/image.js.map +1 -1
  103. package/fesm2015/monaco-editor.js +5 -8
  104. package/fesm2015/monaco-editor.js.map +1 -1
  105. package/fesm2015/node-icon.js +3 -10
  106. package/fesm2015/node-icon.js.map +1 -1
  107. package/fesm2015/page-slider.js +2 -7
  108. package/fesm2015/page-slider.js.map +1 -1
  109. package/fesm2015/reports.js +89 -13
  110. package/fesm2015/reports.js.map +1 -1
  111. package/fesm2015/time.js +4 -12
  112. package/fesm2015/time.js.map +1 -1
  113. package/form-builder/index.metadata.json +1 -1
  114. package/form-builder/node-properties.d.ts +1 -0
  115. package/forms/index.metadata.json +1 -1
  116. package/image/index.metadata.json +1 -1
  117. package/monaco-editor/index.metadata.json +1 -1
  118. package/node-icon/index.metadata.json +1 -1
  119. package/package.json +2 -4
  120. package/page-slider/index.metadata.json +1 -1
  121. package/{report-builder/widget-toolbar-button.d.ts → reports/filter-widget.d.ts} +11 -5
  122. package/reports/index.metadata.json +1 -1
  123. package/reports/public-api.d.ts +1 -0
  124. package/time/index.metadata.json +1 -1
  125. package/bundles/material-report-builder.umd.js +0 -5814
  126. package/bundles/material-report-builder.umd.js.map +0 -1
  127. package/esm2015/report-builder/column.js +0 -97
  128. package/esm2015/report-builder/condition-editor.js +0 -159
  129. package/esm2015/report-builder/content.js +0 -255
  130. package/esm2015/report-builder/custom-widget-dialog.js +0 -51
  131. package/esm2015/report-builder/custom-widget-toolbar-button.js +0 -70
  132. package/esm2015/report-builder/custom-widgets-toolbar.js +0 -124
  133. package/esm2015/report-builder/forms-analyzer-dialog.js +0 -315
  134. package/esm2015/report-builder/forms-analyzer.js +0 -264
  135. package/esm2015/report-builder/image-filter.js +0 -32
  136. package/esm2015/report-builder/image-group.js +0 -106
  137. package/esm2015/report-builder/index.js +0 -25
  138. package/esm2015/report-builder/models.js +0 -23
  139. package/esm2015/report-builder/operations.js +0 -23
  140. package/esm2015/report-builder/properties.js +0 -765
  141. package/esm2015/report-builder/public-api.js +0 -26
  142. package/esm2015/report-builder/quill-editor.js +0 -299
  143. package/esm2015/report-builder/renderer-widget.js +0 -238
  144. package/esm2015/report-builder/report-builder-drag-data.js +0 -23
  145. package/esm2015/report-builder/report-builder-module.js +0 -114
  146. package/esm2015/report-builder/report-builder-service.js +0 -1685
  147. package/esm2015/report-builder/report-builder.externs.js +0 -6
  148. package/esm2015/report-builder/report-builder.js +0 -69
  149. package/esm2015/report-builder/theme-color-dialog.js +0 -90
  150. package/esm2015/report-builder/theme-color.js +0 -215
  151. package/esm2015/report-builder/tokens.js +0 -24
  152. package/esm2015/report-builder/toolbar-dialog.js +0 -56
  153. package/esm2015/report-builder/toolbar.js +0 -90
  154. package/esm2015/report-builder/utils.js +0 -48
  155. package/esm2015/report-builder/widget-toolbar-button.js +0 -47
  156. package/esm2015/report-builder/widgets-row-buttons.js +0 -133
  157. package/esm2015/report-builder/widgets-toolbar.js +0 -79
  158. package/fesm2015/report-builder.js +0 -5332
  159. package/fesm2015/report-builder.js.map +0 -1
  160. package/report-builder/_report-builder.scss +0 -0
  161. package/report-builder/column.d.ts +0 -63
  162. package/report-builder/condition-editor.d.ts +0 -67
  163. package/report-builder/content.d.ts +0 -142
  164. package/report-builder/custom-widget-dialog.d.ts +0 -31
  165. package/report-builder/custom-widget-toolbar-button.d.ts +0 -45
  166. package/report-builder/custom-widgets-toolbar.d.ts +0 -71
  167. package/report-builder/forms-analyzer-dialog.d.ts +0 -91
  168. package/report-builder/forms-analyzer.d.ts +0 -102
  169. package/report-builder/image-filter.d.ts +0 -25
  170. package/report-builder/image-group.d.ts +0 -69
  171. package/report-builder/index.d.ts +0 -24
  172. package/report-builder/index.metadata.json +0 -1
  173. package/report-builder/models.d.ts +0 -43
  174. package/report-builder/operations.d.ts +0 -45
  175. package/report-builder/package.json +0 -9
  176. package/report-builder/properties.d.ts +0 -365
  177. package/report-builder/public-api.d.ts +0 -26
  178. package/report-builder/quill-editor.d.ts +0 -113
  179. package/report-builder/renderer-widget.d.ts +0 -80
  180. package/report-builder/report-builder-drag-data.d.ts +0 -32
  181. package/report-builder/report-builder-module.d.ts +0 -23
  182. package/report-builder/report-builder-service.d.ts +0 -722
  183. package/report-builder/report-builder.d.ts +0 -36
  184. package/report-builder/theme-color-dialog.d.ts +0 -42
  185. package/report-builder/theme-color.d.ts +0 -108
  186. package/report-builder/tokens.d.ts +0 -24
  187. package/report-builder/toolbar-dialog.d.ts +0 -30
  188. package/report-builder/toolbar.d.ts +0 -48
  189. package/report-builder/utils.d.ts +0 -29
  190. package/report-builder/widgets-row-buttons.d.ts +0 -57
  191. package/report-builder/widgets-toolbar.d.ts +0 -44
@@ -24,7 +24,7 @@ import { MatSliderModule } from '@angular/material/slider';
24
24
  import { MatTableDataSource, MatTableModule } from '@angular/material/table';
25
25
  import { MatToolbarModule } from '@angular/material/toolbar';
26
26
  import { MatTooltipModule } from '@angular/material/tooltip';
27
- import { isChoicesFixedOrigin, isContainerNode, AjfNodeType, AjfFieldType, createField, createContainerNode, createForm, createChoicesFixedOrigin, isSlidesNode, isFieldWithChoices, isRepeatingContainerNode, isField, createValidationGroup, notEmptyValidation, minValidation, maxValidation, minDigitsValidation, maxDigitsValidation, createValidation, createWarningGroup, notEmptyWarning, createWarning, AjfValidationService, isNumberField } from '@ajf/core/forms';
27
+ import { isChoicesFixedOrigin, isContainerNode, AjfNodeType, AjfFieldType, createField, createContainerNode, createForm, createChoicesFixedOrigin, isSlidesNode, isFieldWithChoices, isRepeatingContainerNode, isField, createValidationGroup, notEmptyValidation, minValidation, maxValidation, minDigitsValidation, maxDigitsValidation, createValidation, createWarningGroup, notEmptyWarning, createWarning, isRangeField, AjfValidationService, isNumberField } from '@ajf/core/forms';
28
28
  import { DataSource } from '@angular/cdk/collections';
29
29
  import { BehaviorSubject, Subject, Subscription, combineLatest } from 'rxjs';
30
30
  import { filter, map, scan, publishReplay, refCount, withLatestFrom, shareReplay, sample, distinctUntilChanged } from 'rxjs/operators';
@@ -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.filter(n => n.parent === parent.id)
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._editedNodeEntry;
404
+ this._editedNodeEntryObs = this
405
+ ._editedNodeEntry;
404
406
  this._editedCondition = new BehaviorSubject(null);
405
- this._editedConditionObs = this._editedCondition;
407
+ this._editedConditionObs = this
408
+ ._editedCondition;
406
409
  this._editedChoicesOrigin = new BehaviorSubject(null);
407
- this._editedChoicesOriginObs = this._editedChoicesOrigin;
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, this._nodesWithoutChoiceOrigins, this.attachmentsOrigins,
596
- this.choicesOrigins, this.stringIdentifier
597
- ])
598
- .pipe(filter(([form]) => form != null), map(([form, nodes, attachmentsOrigins, choicesOrigins, stringIdentifier]) => {
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((choicesOrigins) => {
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((n) => {
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 ? form.stringIdentifier.slice(0) :
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
- this._choicesOriginsUpdates
708
- .pipe(scan((choicesOrigins, op) => {
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
- this._nodes.pipe(map(slides => slides.map(slide => {
729
- slide.nodes = slide.nodes.map((node) => {
730
- if (isFieldWithChoices(node)) {
731
- const fwc = deepCopy(node);
732
- if (fwc && fwc.choices) {
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
- return node;
741
- });
742
- return slide;
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 = properties.visibility != null ?
759
- createCondition({ condition: properties.visibility }) :
760
- null;
761
+ node.visibility =
762
+ properties.visibility != null
763
+ ? createCondition({ condition: properties.visibility })
764
+ : null;
761
765
  const oldConditionalBranches = node.conditionalBranches.length;
762
- node.conditionalBranches = properties.conditionalBranches != null ?
763
- properties.conditionalBranches.map((condition) => createCondition({ condition })) :
764
- [alwaysCondition()];
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 = properties.formulaReps != null ?
769
- createFormula({ formula: properties.formulaReps }) :
770
- undefined;
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 = properties.formula != null ?
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 || notEmpty != null ||
805
+ if (forceValue != null ||
806
+ notEmpty != null ||
801
807
  (validationConditions != null && validationConditions.length > 0) ||
802
- minValue != null || maxValue != null || minDigits != 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
- minDigits != null ? minDigitsValidation(minDigits) : undefined;
811
- validation.maxDigits =
812
- maxDigits != null ? maxDigitsValidation(maxDigits) : undefined;
813
- validation.conditions =
814
- (validationConditions ||
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
- (warningConditions ||
832
- []).map((w) => createWarning({
833
- condition: w.condition,
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 = properties.nextSlideCondition != null ?
842
- createCondition({ condition: properties.nextSlideCondition }) :
843
- undefined;
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,13 @@ 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 }));
855
+ }
856
+ if (isRangeField(field)) {
857
+ const rf = field;
858
+ rf.start = properties.start;
859
+ rf.end = properties.end;
860
+ rf.step = properties.step;
853
861
  }
854
862
  }
855
863
  this._editedNodeEntry.next(null);
@@ -915,32 +923,31 @@ class AjfFormBuilderService {
915
923
  */
916
924
  _initMoveNode() {
917
925
  this._moveNodeSub.unsubscribe();
918
- this._moveNodeSub =
919
- this._moveNodeEntryEvent
920
- .pipe(map((moveEvent) => {
921
- this._beforeNodesUpdate.emit();
922
- return (nodes) => {
923
- const nodeEntry = moveEvent.nodeEntry;
924
- const node = nodeEntry.node;
925
- let cn = getNodeContainer({ nodes }, node);
926
- let newNodes = nodes;
927
- if (cn != null) {
928
- const replaceNodes = cn.nodes === nodes;
929
- newNodes = cn.nodes;
930
- moveItemInArray(newNodes, moveEvent.fromIndex, moveEvent.toIndex);
931
- newNodes = this._updateNodesList(cn.id, newNodes);
932
- cn.nodes = newNodes;
933
- if (replaceNodes) {
934
- nodes = newNodes;
935
- }
936
- else {
937
- nodes = nodes.slice(0);
938
- }
926
+ this._moveNodeSub = this._moveNodeEntryEvent
927
+ .pipe(map((moveEvent) => {
928
+ this._beforeNodesUpdate.emit();
929
+ return (nodes) => {
930
+ const nodeEntry = moveEvent.nodeEntry;
931
+ const node = nodeEntry.node;
932
+ let cn = getNodeContainer({ nodes }, node);
933
+ let newNodes = nodes;
934
+ if (cn != null) {
935
+ const replaceNodes = cn.nodes === nodes;
936
+ newNodes = cn.nodes;
937
+ moveItemInArray(newNodes, moveEvent.fromIndex, moveEvent.toIndex);
938
+ newNodes = this._updateNodesList(cn.id, newNodes);
939
+ cn.nodes = newNodes;
940
+ if (replaceNodes) {
941
+ nodes = newNodes;
942
+ }
943
+ else {
944
+ nodes = nodes.slice(0);
939
945
  }
940
- return nodes;
941
- };
942
- }))
943
- .subscribe(this._nodesUpdates);
946
+ }
947
+ return nodes;
948
+ };
949
+ }))
950
+ .subscribe(this._nodesUpdates);
944
951
  }
945
952
  /**
946
953
  * Updates the "id" and "parent" fields of a modified or rearranged list of nodes.
@@ -954,8 +961,8 @@ class AjfFormBuilderService {
954
961
  const contId = containerId != undefined ? containerId : 0;
955
962
  for (let idx = 0; idx < nodesList.length; idx++) {
956
963
  let currentNode = nodesList[idx];
957
- currentNode.id = (contId * 1000) + idx + 1;
958
- currentNode.parent = idx == 0 ? contId : (contId * 1000) + idx;
964
+ currentNode.id = contId * 1000 + idx + 1;
965
+ currentNode.parent = idx == 0 ? contId : contId * 1000 + idx;
959
966
  if (currentNode.nodeType == AjfNodeType.AjfSlide ||
960
967
  currentNode.nodeType == AjfNodeType.AjfRepeatingSlide) {
961
968
  const currentSlide = currentNode;
@@ -996,14 +1003,17 @@ AjfFormBuilderService.ctorParameters = () => [];
996
1003
  class AjfFbChoicesOriginEditorDialog {
997
1004
  constructor(_service) {
998
1005
  this._service = _service;
999
- this._choicesOrigin =
1000
- this._service.editedChoicesOrigin.pipe(filter(c => c != null), map(c => c));
1006
+ this._choicesOrigin = this._service.editedChoicesOrigin.pipe(filter(c => c != null), map(c => c));
1001
1007
  }
1002
1008
  get choicesOrigin() {
1003
1009
  return this._choicesOrigin;
1004
1010
  }
1005
1011
  saveChoicesOrigin() {
1006
- this._service.saveChoicesOrigin({ label: this.editor.label, name: this.editor.name, choices: this.editor.choicesArr });
1012
+ this._service.saveChoicesOrigin({
1013
+ label: this.editor.label,
1014
+ name: this.editor.name,
1015
+ choices: this.editor.choicesArr,
1016
+ });
1007
1017
  }
1008
1018
  cancelChoicesOriginEdit() {
1009
1019
  this._service.cancelChoicesOriginEdit();
@@ -1073,12 +1083,15 @@ class AjfFbConditionEditor {
1073
1083
  }
1074
1084
  }
1075
1085
  onEditorInit() {
1076
- monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({ noSemanticValidation: false, noSyntaxValidation: false });
1086
+ monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
1087
+ noSemanticValidation: false,
1088
+ noSyntaxValidation: false,
1089
+ });
1077
1090
  monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
1078
1091
  target: monaco.languages.typescript.ScriptTarget.ES2015,
1079
1092
  allowNonTsExtensions: true,
1080
1093
  allowJs: true,
1081
- module: monaco.languages.typescript.ModuleKind.None
1094
+ module: monaco.languages.typescript.ModuleKind.None,
1082
1095
  });
1083
1096
  try {
1084
1097
  monaco.languages.typescript.javascriptDefaults.addExtraLib('', 'condition-editor-variables.d.ts');
@@ -1109,16 +1122,14 @@ class AjfFbConditionEditor {
1109
1122
  })
1110
1123
  .join('\n');
1111
1124
  }
1112
- catch (e) {
1113
- }
1125
+ catch (e) { }
1114
1126
  }
1115
1127
  _updateFunctions() {
1116
1128
  try {
1117
1129
  monaco.languages.typescript.javascriptDefaults._extraLibs['condition-editor-functions.d.ts'] =
1118
1130
  AjfExpressionUtils.UTIL_FUNCTIONS;
1119
1131
  }
1120
- catch (e) {
1121
- }
1132
+ catch (e) { }
1122
1133
  }
1123
1134
  _fieldVarType(fieldType) {
1124
1135
  switch (fieldType) {
@@ -1254,8 +1265,9 @@ function onDropProcess(event, fbService, nodeEntry, content = false) {
1254
1265
  fbService.insertNode(itemData, null, 0, content, event.currentIndex);
1255
1266
  return;
1256
1267
  }
1257
- const emptySlot = content ? { parent: nodeEntry.node, parentNode: 0 } :
1258
- nodeEntry;
1268
+ const emptySlot = content
1269
+ ? { parent: nodeEntry.node, parentNode: 0 }
1270
+ : nodeEntry;
1259
1271
  fbService.insertNode(itemData, emptySlot.parent, emptySlot.parentNode, content, event.currentIndex);
1260
1272
  return;
1261
1273
  }
@@ -1313,7 +1325,8 @@ class AjfFbStringIdentifierDialogComponent {
1313
1325
  this._stringIdentifierSub = _service.stringIdentifier.subscribe(identifier => {
1314
1326
  this.dataSource.data = [...identifier];
1315
1327
  });
1316
- this.fields$ = _service.flatFields.pipe(map(fields => fields.sort((f1, f2) => f1.name.localeCompare(f2.name))
1328
+ this.fields$ = _service.flatFields.pipe(map(fields => fields
1329
+ .sort((f1, f2) => f1.name.localeCompare(f2.name))
1317
1330
  .map(f => f.name)
1318
1331
  .filter(f => f.length > 0)), shareReplay(1));
1319
1332
  }
@@ -1337,10 +1350,7 @@ class AjfFbStringIdentifierDialogComponent {
1337
1350
  removeValue(row, value) {
1338
1351
  const idx = row.value.indexOf(value);
1339
1352
  if (idx > -1) {
1340
- row.value = [
1341
- ...row.value.slice(0, idx),
1342
- ...row.value.slice(idx + 1),
1343
- ];
1353
+ row.value = [...row.value.slice(0, idx), ...row.value.slice(idx + 1)];
1344
1354
  this._cdr.markForCheck();
1345
1355
  }
1346
1356
  }
@@ -1408,28 +1418,28 @@ class AjfFormBuilder {
1408
1418
  this._nodeTypes = _service.availableNodeTypes;
1409
1419
  this._nodeEntriesTree = _service.nodeEntriesTree;
1410
1420
  this._choicesOrigins = _service.choicesOrigins;
1411
- this._editConditionSub =
1412
- this._service.editedCondition.subscribe((condition) => {
1413
- if (this._editConditionDialog != null) {
1414
- this._editConditionDialog.close();
1415
- this._editConditionDialog = null;
1416
- }
1417
- if (condition != null) {
1418
- this._editConditionDialog =
1419
- this._dialog.open(AjfFbConditionEditorDialog, { disableClose: true });
1420
- }
1421
- });
1422
- this._editChoicesOriginSub =
1423
- this._service.editedChoicesOrigin.subscribe((choicesOrigin) => {
1424
- if (this._editChoicesOriginDialog != null) {
1425
- this._editChoicesOriginDialog.close();
1426
- this._editChoicesOriginDialog = null;
1427
- }
1428
- if (choicesOrigin != null) {
1429
- this._editChoicesOriginDialog =
1430
- this._dialog.open(AjfFbChoicesOriginEditorDialog, { disableClose: true });
1431
- }
1432
- });
1421
+ this._editConditionSub = this._service.editedCondition.subscribe((condition) => {
1422
+ if (this._editConditionDialog != null) {
1423
+ this._editConditionDialog.close();
1424
+ this._editConditionDialog = null;
1425
+ }
1426
+ if (condition != null) {
1427
+ this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog, {
1428
+ disableClose: true,
1429
+ });
1430
+ }
1431
+ });
1432
+ this._editChoicesOriginSub = this._service.editedChoicesOrigin.subscribe((choicesOrigin) => {
1433
+ if (this._editChoicesOriginDialog != null) {
1434
+ this._editChoicesOriginDialog.close();
1435
+ this._editChoicesOriginDialog = null;
1436
+ }
1437
+ if (choicesOrigin != null) {
1438
+ this._editChoicesOriginDialog = this._dialog.open(AjfFbChoicesOriginEditorDialog, {
1439
+ disableClose: true,
1440
+ });
1441
+ }
1442
+ });
1433
1443
  this._beforeNodesUpdateSub = this._service.beforeNodesUpdate.subscribe(() => {
1434
1444
  if (this.designerCont == null) {
1435
1445
  return;
@@ -1509,7 +1519,11 @@ class AjfFormBuilder {
1509
1519
  this._stringIdentifierDialog.close();
1510
1520
  this._stringIdentifierDialog = null;
1511
1521
  }
1512
- this._stringIdentifierDialog = this._dialog.open(AjfFbStringIdentifierDialogComponent, { disableClose: true, width: '60%', height: '60%' });
1522
+ this._stringIdentifierDialog = this._dialog.open(AjfFbStringIdentifierDialogComponent, {
1523
+ disableClose: true,
1524
+ width: '60%',
1525
+ height: '60%',
1526
+ });
1513
1527
  }
1514
1528
  expandAll() {
1515
1529
  this._globalExpanded = true;
@@ -1744,7 +1758,9 @@ class AjfFbNodeEntry {
1744
1758
  };
1745
1759
  }
1746
1760
  _updateBranchHeights() {
1747
- if (this.nodeEntry == null || !this.isNodeEntry || this.branchLines == null ||
1761
+ if (this.nodeEntry == null ||
1762
+ !this.isNodeEntry ||
1763
+ this.branchLines == null ||
1748
1764
  this.childEntries == null) {
1749
1765
  return;
1750
1766
  }
@@ -1939,6 +1955,13 @@ function checkDigitsValidity(c) {
1939
1955
  }
1940
1956
  return null;
1941
1957
  }
1958
+ function checkRangeValidity(c) {
1959
+ const { start, end } = c.value;
1960
+ if (start != null && end != null && start > end) {
1961
+ return { range: 'End must be greater than start' };
1962
+ }
1963
+ return null;
1964
+ }
1942
1965
  class AjfFbNodeProperties {
1943
1966
  constructor(_cdr, _service, _dialog, _fb) {
1944
1967
  this._cdr = _cdr;
@@ -1946,15 +1969,17 @@ class AjfFbNodeProperties {
1946
1969
  this._dialog = _dialog;
1947
1970
  this._fb = _fb;
1948
1971
  this._fieldSizes = [
1949
- { label: 'Normal', value: 'normal' }, { label: 'Small', value: 'small' },
1950
- { label: 'Smaller', value: 'smaller' }, { label: 'Tiny', value: 'tiny' },
1951
- { label: 'Mini', value: 'mini' }
1972
+ { label: 'Normal', value: 'normal' },
1973
+ { label: 'Small', value: 'small' },
1974
+ { label: 'Smaller', value: 'smaller' },
1975
+ { label: 'Tiny', value: 'tiny' },
1976
+ { label: 'Mini', value: 'mini' },
1952
1977
  ];
1953
1978
  this._choicesOrigins = [];
1954
1979
  this._conditionalBranches = [];
1955
1980
  this._validationConditions = [];
1956
1981
  this._warningConditions = [];
1957
- this.isRepeatingContainerNode = (nodeEntry) => {
1982
+ this.isRepeatingContainerNode = nodeEntry => {
1958
1983
  return nodeEntry != null && isRepeatingContainerNode(nodeEntry.node);
1959
1984
  };
1960
1985
  this._visibilityOptSub = Subscription.EMPTY;
@@ -2007,9 +2032,8 @@ class AjfFbNodeProperties {
2007
2032
  this._saveEvt = new EventEmitter();
2008
2033
  this._saveSub = Subscription.EMPTY;
2009
2034
  this._nodeEntry = _service.editedNodeEntry;
2010
- this._choicesOriginsSub =
2011
- _service.choicesOrigins.subscribe((c) => this._choicesOrigins = c || []);
2012
- this._enabled = this._nodeEntry.pipe(map((n) => n != null));
2035
+ this._choicesOriginsSub = _service.choicesOrigins.subscribe(c => (this._choicesOrigins = c || []));
2036
+ this._enabled = this._nodeEntry.pipe(map(n => n != null));
2013
2037
  this._initForm();
2014
2038
  this._initVisibilityEdit();
2015
2039
  this._initConditionalBranchEdit();
@@ -2155,6 +2179,9 @@ class AjfFbNodeProperties {
2155
2179
  isFieldWithChoices(node) {
2156
2180
  return isField(node) && isFieldWithChoices(node);
2157
2181
  }
2182
+ isRangeField(node) {
2183
+ return isField(node) && isRangeField(node);
2184
+ }
2158
2185
  save() {
2159
2186
  this._saveEvt.emit();
2160
2187
  }
@@ -2200,11 +2227,12 @@ class AjfFbNodeProperties {
2200
2227
  .subscribe(([_, formGroup]) => {
2201
2228
  const fg = formGroup;
2202
2229
  const val = Object.assign(Object.assign({}, fg.value), { conditionalBranches: this._conditionalBranches });
2230
+ console.log(val);
2203
2231
  this._service.saveNodeEntry(val);
2204
2232
  });
2205
2233
  }
2206
2234
  _initForm() {
2207
- this._propertiesForm = this._nodeEntry.pipe(filter((n) => n != null), map((n) => {
2235
+ this._propertiesForm = this._nodeEntry.pipe(filter(n => n != null), map(n => {
2208
2236
  if (this._visibilityOptSub != null) {
2209
2237
  this._visibilityOptSub.unsubscribe();
2210
2238
  }
@@ -2222,7 +2250,7 @@ class AjfFbNodeProperties {
2222
2250
  label: n.node.label,
2223
2251
  visibilityOpt: [visibilityOpt, Validators.required],
2224
2252
  visibility: [visibility, Validators.required],
2225
- conditionalBranchesNum: n.node.conditionalBranches.length
2253
+ conditionalBranchesNum: n.node.conditionalBranches.length,
2226
2254
  };
2227
2255
  const validators = [];
2228
2256
  if (isRepeatingContainerNode(n.node)) {
@@ -2287,12 +2315,10 @@ class AjfFbNodeProperties {
2287
2315
  maxValue = (numField.validation.maxValue.condition || '').replace('$value <= ', '');
2288
2316
  }
2289
2317
  if (numField.validation.minDigits != null) {
2290
- minDigits = (numField.validation.minDigits.condition ||
2291
- '').replace('$value.toString().length >= ', '');
2318
+ minDigits = (numField.validation.minDigits.condition || '').replace('$value.toString().length >= ', '');
2292
2319
  }
2293
2320
  if (numField.validation.maxDigits != null) {
2294
- maxDigits = (numField.validation.maxDigits.condition ||
2295
- '').replace('$value.toString().length <= ', '');
2321
+ maxDigits = (numField.validation.maxDigits.condition || '').replace('$value.toString().length <= ', '');
2296
2322
  }
2297
2323
  }
2298
2324
  controls.minValue = minValue;
@@ -2302,13 +2328,20 @@ class AjfFbNodeProperties {
2302
2328
  validators.push(checkValueLimitsValidity);
2303
2329
  validators.push(checkDigitsValidity);
2304
2330
  }
2331
+ if (this.isRangeField(n.node)) {
2332
+ const rangeField = n.node;
2333
+ const { start, end, step } = rangeField;
2334
+ controls.start = start;
2335
+ controls.end = end;
2336
+ controls.step = step;
2337
+ validators.push(checkRangeValidity);
2338
+ }
2305
2339
  if (this.isFieldWithChoices(n.node)) {
2306
2340
  const fieldWithChoices = n.node;
2307
- let triggerConditions = (fieldWithChoices.triggerConditions || []).map((c) => c.condition);
2341
+ let triggerConditions = (fieldWithChoices.triggerConditions || []).map(c => c.condition);
2308
2342
  controls.choicesOriginRef = fieldWithChoices.choicesOriginRef;
2309
- controls.choicesFilter = fieldWithChoices.choicesFilter != null ?
2310
- fieldWithChoices.choicesFilter.formula :
2311
- null;
2343
+ controls.choicesFilter =
2344
+ fieldWithChoices.choicesFilter != null ? fieldWithChoices.choicesFilter.formula : null;
2312
2345
  controls.forceExpanded = fieldWithChoices.forceExpanded;
2313
2346
  controls.forceNarrow = fieldWithChoices.forceNarrow;
2314
2347
  controls.triggerConditions = triggerConditions;
@@ -2395,27 +2428,27 @@ class AjfFbNodeProperties {
2395
2428
  _initTriggerConditionEdit() {
2396
2429
  this._editConditionDialogSub = Subscription.EMPTY;
2397
2430
  this._cdr.markForCheck();
2398
- this._editTriggerConditionSub =
2399
- this._editTriggerConditionEvt
2400
- .pipe(withLatestFrom(this._propertiesForm))
2401
- .subscribe(([vcIdx, fg]) => {
2402
- this._destroyConditionDialog();
2403
- if (vcIdx < 0 || vcIdx >= this._triggerConditions.length || fg == null) {
2404
- return;
2431
+ this._editTriggerConditionSub = this._editTriggerConditionEvt
2432
+ .pipe(withLatestFrom(this._propertiesForm))
2433
+ .subscribe(([vcIdx, fg]) => {
2434
+ this._destroyConditionDialog();
2435
+ if (vcIdx < 0 || vcIdx >= this._triggerConditions.length || fg == null) {
2436
+ return;
2437
+ }
2438
+ this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
2439
+ const cmp = this._editConditionDialog.componentInstance;
2440
+ cmp.condition = this._triggerConditions[vcIdx];
2441
+ this._editConditionDialogSub = this._editConditionDialog
2442
+ .afterClosed()
2443
+ .subscribe((cond) => {
2444
+ if (cond !== void 0) {
2445
+ this._triggerConditions[vcIdx] = cond;
2405
2446
  }
2406
- this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
2407
- const cmp = this._editConditionDialog.componentInstance;
2408
- cmp.condition = this._triggerConditions[vcIdx];
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
- });
2447
+ this._editConditionDialogSub.unsubscribe();
2448
+ this._editConditionDialogSub = Subscription.EMPTY;
2449
+ this._cdr.markForCheck();
2418
2450
  });
2451
+ });
2419
2452
  }
2420
2453
  _initRemoveWarningCondition() {
2421
2454
  this._removeWarningConditionSub = this._removeWarningConditionEvt
@@ -2449,30 +2482,29 @@ class AjfFbNodeProperties {
2449
2482
  });
2450
2483
  }
2451
2484
  _initWarningConditionEdit() {
2452
- this._editWarningConditionSub =
2453
- this._editWarningConditionEvt
2454
- .pipe(withLatestFrom(this._propertiesForm))
2455
- .subscribe(([vcIdx, fg]) => {
2456
- this._destroyWarningConditionDialog();
2457
- if (vcIdx < 0 || vcIdx >= this._warningConditions.length || fg == null) {
2458
- return;
2485
+ this._editWarningConditionSub = this._editWarningConditionEvt
2486
+ .pipe(withLatestFrom(this._propertiesForm))
2487
+ .subscribe(([vcIdx, fg]) => {
2488
+ this._destroyWarningConditionDialog();
2489
+ if (vcIdx < 0 || vcIdx >= this._warningConditions.length || fg == null) {
2490
+ return;
2491
+ }
2492
+ this._editWarningConditionDialog = this._dialog.open(AjfFbWarningConditionEditorDialog);
2493
+ const cmp = this._editWarningConditionDialog.componentInstance;
2494
+ const w = this._warningConditions[vcIdx];
2495
+ cmp.condition = w.condition;
2496
+ cmp.warningMessage = w.warningMessage;
2497
+ this._editWarningConditionDialogSub = this._editWarningConditionDialog
2498
+ .afterClosed()
2499
+ .subscribe((cond) => {
2500
+ if (cond !== void 0) {
2501
+ this._warningConditions[vcIdx] = cond;
2459
2502
  }
2460
- this._editWarningConditionDialog =
2461
- this._dialog.open(AjfFbWarningConditionEditorDialog);
2462
- const cmp = this._editWarningConditionDialog.componentInstance;
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
- });
2503
+ this._editWarningConditionDialogSub.unsubscribe();
2504
+ this._editWarningConditionDialogSub = Subscription.EMPTY;
2505
+ this._cdr.markForCheck();
2475
2506
  });
2507
+ });
2476
2508
  }
2477
2509
  _initRemoveValidationCondition() {
2478
2510
  this._removeValidationConditionSub = this._removeValidationConditionEvt
@@ -2506,205 +2538,202 @@ class AjfFbNodeProperties {
2506
2538
  });
2507
2539
  }
2508
2540
  _initValidationConditionEdit() {
2509
- this._editValidationConditionSub =
2510
- this._editValidationConditionEvt
2511
- .pipe(withLatestFrom(this._propertiesForm))
2512
- .subscribe(([vcIdx, fg]) => {
2513
- this._destroyValidationConditionDialog();
2514
- if (vcIdx < 0 || vcIdx >= this._validationConditions.length || fg == null) {
2515
- return;
2541
+ this._editValidationConditionSub = this._editValidationConditionEvt
2542
+ .pipe(withLatestFrom(this._propertiesForm))
2543
+ .subscribe(([vcIdx, fg]) => {
2544
+ this._destroyValidationConditionDialog();
2545
+ if (vcIdx < 0 || vcIdx >= this._validationConditions.length || fg == null) {
2546
+ return;
2547
+ }
2548
+ this._editValidationConditionDialog = this._dialog.open(AjfFbValidationConditionEditorDialog);
2549
+ const cmp = this._editValidationConditionDialog.componentInstance;
2550
+ const v = this._validationConditions[vcIdx];
2551
+ cmp.condition = v.condition;
2552
+ cmp.errorMessage = v.errorMessage;
2553
+ this._editValidationConditionDialogSub = this._editValidationConditionDialog
2554
+ .afterClosed()
2555
+ .subscribe((cond) => {
2556
+ if (cond !== void 0) {
2557
+ this._validationConditions[vcIdx] = cond;
2516
2558
  }
2517
- this._editValidationConditionDialog =
2518
- this._dialog.open(AjfFbValidationConditionEditorDialog);
2519
- const cmp = this._editValidationConditionDialog.componentInstance;
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
- });
2559
+ this._editValidationConditionDialogSub.unsubscribe();
2560
+ this._editValidationConditionDialogSub = Subscription.EMPTY;
2561
+ this._cdr.markForCheck();
2532
2562
  });
2563
+ });
2533
2564
  }
2534
2565
  _initForceValueEdit() {
2535
- this._editForceValueSub =
2536
- this._editForceValueEvt
2537
- .pipe(withLatestFrom(this._propertiesForm))
2538
- .subscribe(([_, formGroup]) => {
2539
- this._destroyConditionDialog();
2540
- if (formGroup == null) {
2541
- return;
2566
+ this._editForceValueSub = this._editForceValueEvt
2567
+ .pipe(withLatestFrom(this._propertiesForm))
2568
+ .subscribe(([_, formGroup]) => {
2569
+ this._destroyConditionDialog();
2570
+ if (formGroup == null) {
2571
+ return;
2572
+ }
2573
+ const fg = formGroup;
2574
+ const ctrl = fg.controls['forceValue'];
2575
+ this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
2576
+ this._editConditionDialog.componentInstance.condition = ctrl.value;
2577
+ this._editConditionDialogSub = this._editConditionDialog
2578
+ .afterClosed()
2579
+ .subscribe((cond) => {
2580
+ if (cond !== void 0) {
2581
+ ctrl.setValue(cond);
2542
2582
  }
2543
- const fg = formGroup;
2544
- const ctrl = fg.controls['forceValue'];
2545
- this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
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
- });
2583
+ this._editConditionDialogSub.unsubscribe();
2584
+ this._editConditionDialogSub = Subscription.EMPTY;
2585
+ this._cdr.markForCheck();
2556
2586
  });
2587
+ });
2557
2588
  }
2558
2589
  _initNextSlideConditionEdit() {
2559
- this._editNextSlideConditionSub =
2560
- this._editNextSlideConditionEvt
2561
- .pipe(withLatestFrom(this._propertiesForm))
2562
- .subscribe(([_, formGroup]) => {
2563
- this._destroyConditionDialog();
2564
- if (formGroup == null) {
2565
- return;
2590
+ this._editNextSlideConditionSub = this._editNextSlideConditionEvt
2591
+ .pipe(withLatestFrom(this._propertiesForm))
2592
+ .subscribe(([_, formGroup]) => {
2593
+ this._destroyConditionDialog();
2594
+ if (formGroup == null) {
2595
+ return;
2596
+ }
2597
+ const fg = formGroup;
2598
+ const ctrl = fg.controls['nextSlideCondition'];
2599
+ this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
2600
+ this._editConditionDialog.componentInstance.condition = ctrl.value;
2601
+ this._editConditionDialogSub = this._editConditionDialog
2602
+ .afterClosed()
2603
+ .subscribe((cond) => {
2604
+ if (cond !== void 0) {
2605
+ ctrl.setValue(cond);
2566
2606
  }
2567
- const fg = formGroup;
2568
- const ctrl = fg.controls['nextSlideCondition'];
2569
- this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
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
- });
2607
+ this._editConditionDialogSub.unsubscribe();
2608
+ this._editConditionDialogSub = Subscription.EMPTY;
2609
+ this._cdr.markForCheck();
2580
2610
  });
2611
+ });
2581
2612
  }
2582
2613
  _initFormulaEdit() {
2583
2614
  this._editConditionDialogSub = Subscription.EMPTY;
2584
2615
  this._cdr.markForCheck();
2585
- this._editFormulaSub =
2586
- this._editFormulaEvt
2587
- .pipe(withLatestFrom(this._propertiesForm))
2588
- .subscribe(([_, formGroup]) => {
2589
- this._destroyConditionDialog();
2590
- if (formGroup == null) {
2591
- return;
2616
+ this._editFormulaSub = this._editFormulaEvt
2617
+ .pipe(withLatestFrom(this._propertiesForm))
2618
+ .subscribe(([_, formGroup]) => {
2619
+ this._destroyConditionDialog();
2620
+ if (formGroup == null) {
2621
+ return;
2622
+ }
2623
+ const fg = formGroup;
2624
+ const ctrl = fg.controls['formula'];
2625
+ this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
2626
+ this._editConditionDialog.componentInstance.condition = ctrl.value;
2627
+ this._editConditionDialogSub = this._editConditionDialog
2628
+ .afterClosed()
2629
+ .subscribe((cond) => {
2630
+ if (cond !== void 0) {
2631
+ ctrl.setValue(cond);
2592
2632
  }
2593
- const fg = formGroup;
2594
- const ctrl = fg.controls['formula'];
2595
- this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
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
- });
2633
+ this._editConditionDialogSub.unsubscribe();
2634
+ this._editConditionDialogSub = Subscription.EMPTY;
2635
+ this._cdr.markForCheck();
2606
2636
  });
2637
+ });
2607
2638
  }
2608
2639
  _initFormulaRepsEdit() {
2609
- this._editFormulaRepsSub =
2610
- this._editFormulaRepsEvt
2611
- .pipe(withLatestFrom(this._propertiesForm))
2612
- .subscribe(([_, formGroup]) => {
2613
- this._destroyConditionDialog();
2614
- if (formGroup == null) {
2615
- return;
2640
+ this._editFormulaRepsSub = this._editFormulaRepsEvt
2641
+ .pipe(withLatestFrom(this._propertiesForm))
2642
+ .subscribe(([_, formGroup]) => {
2643
+ this._destroyConditionDialog();
2644
+ if (formGroup == null) {
2645
+ return;
2646
+ }
2647
+ const fg = formGroup;
2648
+ const ctrl = fg.controls['formulaReps'];
2649
+ this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
2650
+ this._editConditionDialog.componentInstance.condition = ctrl.value;
2651
+ this._editConditionDialogSub = this._editConditionDialog
2652
+ .afterClosed()
2653
+ .subscribe((cond) => {
2654
+ if (cond !== void 0) {
2655
+ ctrl.setValue(cond);
2616
2656
  }
2617
- const fg = formGroup;
2618
- const ctrl = fg.controls['formulaReps'];
2619
- this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
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
- });
2657
+ this._editConditionDialogSub.unsubscribe();
2658
+ this._editConditionDialogSub = Subscription.EMPTY;
2659
+ this._cdr.markForCheck();
2630
2660
  });
2661
+ });
2631
2662
  }
2632
2663
  _initChoicesFilterEdit() {
2633
- this._editChoicesFilterSub =
2634
- this._editChoicesFilterEvt
2635
- .pipe(withLatestFrom(this._propertiesForm))
2636
- .subscribe(([_, formGroup]) => {
2637
- this._destroyConditionDialog();
2638
- if (formGroup == null) {
2639
- return;
2664
+ this._editChoicesFilterSub = this._editChoicesFilterEvt
2665
+ .pipe(withLatestFrom(this._propertiesForm))
2666
+ .subscribe(([_, formGroup]) => {
2667
+ this._destroyConditionDialog();
2668
+ if (formGroup == null) {
2669
+ return;
2670
+ }
2671
+ const fg = formGroup;
2672
+ const ctrl = fg.controls['choicesFilter'];
2673
+ this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
2674
+ this._editConditionDialog.componentInstance.condition = ctrl.value;
2675
+ this._editConditionDialogSub = this._editConditionDialog
2676
+ .afterClosed()
2677
+ .subscribe((cond) => {
2678
+ if (cond !== void 0) {
2679
+ ctrl.setValue(cond);
2640
2680
  }
2641
- const fg = formGroup;
2642
- const ctrl = fg.controls['choicesFilter'];
2643
- this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
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
- });
2681
+ this._editConditionDialogSub.unsubscribe();
2682
+ this._editConditionDialogSub = Subscription.EMPTY;
2683
+ this._cdr.markForCheck();
2654
2684
  });
2685
+ });
2655
2686
  }
2656
2687
  _initConditionalBranchEdit() {
2657
- this._editConditionalBranchSub =
2658
- this._editConditionalBranchEvt
2659
- .pipe(withLatestFrom(this._propertiesForm))
2660
- .subscribe(([cbIdx, fg]) => {
2661
- this._destroyConditionDialog();
2662
- if (cbIdx < 0 || cbIdx >= this._conditionalBranches.length || fg == null) {
2663
- return;
2688
+ this._editConditionalBranchSub = this._editConditionalBranchEvt
2689
+ .pipe(withLatestFrom(this._propertiesForm))
2690
+ .subscribe(([cbIdx, fg]) => {
2691
+ this._destroyConditionDialog();
2692
+ if (cbIdx < 0 || cbIdx >= this._conditionalBranches.length || fg == null) {
2693
+ return;
2694
+ }
2695
+ this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
2696
+ this._editConditionDialog.componentInstance.condition = this._conditionalBranches[cbIdx];
2697
+ this._editConditionDialogSub = this._editConditionDialog
2698
+ .afterClosed()
2699
+ .subscribe((cond) => {
2700
+ if (cond !== void 0) {
2701
+ this._conditionalBranches[cbIdx] = cond;
2664
2702
  }
2665
- this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
2666
- this._editConditionDialog.componentInstance.condition =
2667
- this._conditionalBranches[cbIdx];
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
- });
2703
+ this._editConditionDialogSub.unsubscribe();
2704
+ this._editConditionDialogSub = Subscription.EMPTY;
2705
+ this._cdr.markForCheck();
2677
2706
  });
2707
+ });
2678
2708
  }
2679
2709
  _initVisibilityEdit() {
2680
- this._editVisibilitySub =
2681
- this._editVisibilityEvt
2682
- .pipe(withLatestFrom(this._propertiesForm))
2683
- .subscribe(([_, formGroup]) => {
2684
- this._destroyConditionDialog();
2685
- if (formGroup == null) {
2686
- return;
2710
+ this._editVisibilitySub = this._editVisibilityEvt
2711
+ .pipe(withLatestFrom(this._propertiesForm))
2712
+ .subscribe(([_, formGroup]) => {
2713
+ this._destroyConditionDialog();
2714
+ if (formGroup == null) {
2715
+ return;
2716
+ }
2717
+ const fg = formGroup;
2718
+ const ctrl = fg.controls['visibility'];
2719
+ const condition = ctrl.value;
2720
+ this._editConditionDialog = this._dialog.open(AjfFbConditionEditorDialog);
2721
+ this._editConditionDialog.componentInstance.condition = condition;
2722
+ this._editConditionDialogSub = this._editConditionDialog
2723
+ .afterClosed()
2724
+ .subscribe((cond) => {
2725
+ if (cond !== void 0) {
2726
+ ctrl.setValue(cond);
2687
2727
  }
2688
- const fg = formGroup;
2689
- const ctrl = fg.controls['visibility'];
2690
- const condition = ctrl.value;
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
- });
2728
+ this._editConditionDialogSub.unsubscribe();
2729
+ this._editConditionDialogSub = Subscription.EMPTY;
2730
+ this._cdr.markForCheck();
2702
2731
  });
2732
+ });
2703
2733
  }
2704
2734
  _handleTriggerCondtionsChange(fg) {
2705
2735
  this._triggerConditionsSub = fg.valueChanges
2706
- .pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.triggerConditions) ===
2707
- JSON.stringify(v2.triggerConditions)))
2736
+ .pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.triggerConditions) === JSON.stringify(v2.triggerConditions)))
2708
2737
  .subscribe((v) => {
2709
2738
  this._triggerConditions = v.triggerConditions;
2710
2739
  this._cdr.markForCheck();
@@ -2712,112 +2741,104 @@ class AjfFbNodeProperties {
2712
2741
  }
2713
2742
  _handleWarningCondtionsChange(fg) {
2714
2743
  this._warningConditionsSub = fg.valueChanges
2715
- .pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.warningConditions) ===
2716
- JSON.stringify(v2.warningConditions)))
2744
+ .pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.warningConditions) === JSON.stringify(v2.warningConditions)))
2717
2745
  .subscribe((v) => {
2718
2746
  this._warningConditions = v.warningConditions;
2719
2747
  this._cdr.markForCheck();
2720
2748
  });
2721
2749
  }
2722
2750
  _handleValidationCondtionsChange(fg) {
2723
- this._validationConditionsSub =
2724
- fg.valueChanges
2725
- .pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.validationConditions) ===
2726
- JSON.stringify(v2.validationConditions)))
2727
- .subscribe((v) => {
2728
- this._validationConditions = v.validationConditions;
2729
- this._cdr.markForCheck();
2730
- });
2751
+ this._validationConditionsSub = fg.valueChanges
2752
+ .pipe(distinctUntilChanged((v1, v2) => JSON.stringify(v1.validationConditions) === JSON.stringify(v2.validationConditions)))
2753
+ .subscribe((v) => {
2754
+ this._validationConditions = v.validationConditions;
2755
+ this._cdr.markForCheck();
2756
+ });
2731
2757
  }
2732
2758
  _handleForceValueChange(fg) {
2733
- this._forceValueSub =
2734
- fg.valueChanges.pipe(distinctUntilChanged((v1, v2) => v1.forceValue === v2.forceValue))
2735
- .subscribe((v) => {
2736
- this._curForceValue = v.forceValue;
2737
- this._cdr.markForCheck();
2738
- });
2759
+ this._forceValueSub = fg.valueChanges
2760
+ .pipe(distinctUntilChanged((v1, v2) => v1.forceValue === v2.forceValue))
2761
+ .subscribe((v) => {
2762
+ this._curForceValue = v.forceValue;
2763
+ this._cdr.markForCheck();
2764
+ });
2739
2765
  }
2740
2766
  _handleNextSlideConditionChange(fg) {
2741
- this._formulaSub =
2742
- 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 =
2749
- fg.valueChanges
2750
- .pipe(distinctUntilChanged((v1, v2) => v1.nextSlideCondition === v2.nextSlideCondition))
2751
- .subscribe((v) => {
2752
- this._nextSlideCondition = v.nextSlideCondition;
2753
- this._cdr.markForCheck();
2754
- });
2767
+ this._formulaSub = fg.valueChanges
2768
+ .pipe(distinctUntilChanged((v1, v2) => v1.nextSlideCondition === v2.nextSlideCondition))
2769
+ .subscribe((v) => {
2770
+ this._nextSlideCondition = v.nextSlideCondition;
2771
+ this._cdr.markForCheck();
2772
+ });
2773
+ this._formulaSub = fg.valueChanges
2774
+ .pipe(distinctUntilChanged((v1, v2) => v1.nextSlideCondition === v2.nextSlideCondition))
2775
+ .subscribe((v) => {
2776
+ this._nextSlideCondition = v.nextSlideCondition;
2777
+ this._cdr.markForCheck();
2778
+ });
2755
2779
  }
2756
2780
  _handleFormulaChange(fg) {
2757
- this._formulaSub =
2758
- fg.valueChanges.pipe(distinctUntilChanged((v1, v2) => v1.formula === v2.formula))
2759
- .subscribe((v) => {
2760
- this._curFormula = v.formula;
2761
- this._cdr.markForCheck();
2762
- });
2781
+ this._formulaSub = fg.valueChanges
2782
+ .pipe(distinctUntilChanged((v1, v2) => v1.formula === v2.formula))
2783
+ .subscribe((v) => {
2784
+ this._curFormula = v.formula;
2785
+ this._cdr.markForCheck();
2786
+ });
2763
2787
  }
2764
2788
  _handleFormulaRepsChange(fg) {
2765
- this._formulaRepsSub =
2766
- fg.valueChanges.pipe(distinctUntilChanged((v1, v2) => v1.formulaReps === v2.formulaReps))
2767
- .subscribe((v) => {
2768
- this._curFormulaReps = v.formulaReps;
2769
- this._cdr.markForCheck();
2770
- });
2789
+ this._formulaRepsSub = fg.valueChanges
2790
+ .pipe(distinctUntilChanged((v1, v2) => v1.formulaReps === v2.formulaReps))
2791
+ .subscribe((v) => {
2792
+ this._curFormulaReps = v.formulaReps;
2793
+ this._cdr.markForCheck();
2794
+ });
2771
2795
  }
2772
2796
  _handleChoicesFilterChange(fg) {
2773
- this._choicesFilterSub =
2774
- fg.valueChanges
2775
- .pipe(distinctUntilChanged((v1, v2) => v1.choicesFilter === v2.choicesFilter))
2776
- .subscribe((v) => {
2777
- this._curChoicesFilter = v.choicesFilter;
2778
- this._cdr.markForCheck();
2779
- });
2797
+ this._choicesFilterSub = fg.valueChanges
2798
+ .pipe(distinctUntilChanged((v1, v2) => v1.choicesFilter === v2.choicesFilter))
2799
+ .subscribe((v) => {
2800
+ this._curChoicesFilter = v.choicesFilter;
2801
+ this._cdr.markForCheck();
2802
+ });
2780
2803
  }
2781
2804
  _handleConditionalBranchesChange(fg) {
2782
- this._conditionalBranchesSub =
2783
- fg.valueChanges
2784
- .pipe(distinctUntilChanged((v1, v2) => v1.conditionalBranchesNum === v2.conditionalBranchesNum))
2785
- .subscribe((v) => {
2786
- const cbNum = v.conditionalBranchesNum;
2787
- const curCbNum = this._conditionalBranches.length;
2788
- if (curCbNum < cbNum) {
2789
- let newCbs = [];
2790
- for (let i = curCbNum; i < cbNum; i++) {
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);
2805
+ this._conditionalBranchesSub = fg.valueChanges
2806
+ .pipe(distinctUntilChanged((v1, v2) => v1.conditionalBranchesNum === v2.conditionalBranchesNum))
2807
+ .subscribe((v) => {
2808
+ const cbNum = v.conditionalBranchesNum;
2809
+ const curCbNum = this._conditionalBranches.length;
2810
+ if (curCbNum < cbNum) {
2811
+ let newCbs = [];
2812
+ for (let i = curCbNum; i < cbNum; i++) {
2813
+ newCbs.push(alwaysCondition().condition);
2797
2814
  }
2798
- this._cdr.markForCheck();
2799
- });
2815
+ this._conditionalBranches = this._conditionalBranches.concat(newCbs);
2816
+ }
2817
+ else if (curCbNum > cbNum) {
2818
+ this._conditionalBranches.splice(0, curCbNum - cbNum);
2819
+ }
2820
+ this._cdr.markForCheck();
2821
+ });
2800
2822
  }
2801
2823
  _handleVisibilityChange(fg) {
2802
- this._visibilitySub =
2803
- fg.valueChanges
2804
- .pipe(distinctUntilChanged((v1, v2) => v1.visibilityOpt === v2.visibilityOpt))
2805
- .subscribe((v) => {
2806
- const visibilityOpt = v.visibilityOpt;
2807
- let newCondition;
2808
- switch (visibilityOpt) {
2809
- case 'always':
2810
- newCondition = alwaysCondition().condition;
2811
- break;
2812
- case 'never':
2813
- newCondition = neverCondition().condition;
2814
- break;
2815
- default:
2816
- newCondition = null;
2817
- }
2818
- this._curVisibility = newCondition;
2819
- fg.controls['visibility'].setValue(newCondition);
2820
- });
2824
+ this._visibilitySub = fg.valueChanges
2825
+ .pipe(distinctUntilChanged((v1, v2) => v1.visibilityOpt === v2.visibilityOpt))
2826
+ .subscribe(v => {
2827
+ const visibilityOpt = v.visibilityOpt;
2828
+ let newCondition;
2829
+ switch (visibilityOpt) {
2830
+ case 'always':
2831
+ newCondition = alwaysCondition().condition;
2832
+ break;
2833
+ case 'never':
2834
+ newCondition = neverCondition().condition;
2835
+ break;
2836
+ default:
2837
+ newCondition = null;
2838
+ }
2839
+ this._curVisibility = newCondition;
2840
+ fg.controls['visibility'].setValue(newCondition);
2841
+ });
2821
2842
  this._visibilitySub = fg.valueChanges
2822
2843
  .pipe(filter(v => v.visibilityOpt === 'condition'), distinctUntilChanged((v1, v2) => v1.visibility === v2.visibility))
2823
2844
  .subscribe(v => {
@@ -2838,7 +2859,7 @@ class AjfFbNodeProperties {
2838
2859
  AjfFbNodeProperties.decorators = [
2839
2860
  { type: Component, args: [{
2840
2861
  selector: 'ajf-fb-node-properties',
2841
- template: "<div\n [style.display]=\"(enabled|async) ? 'none' : 'block'\"\n class=\"ajf-disabled-overlay\"\n></div>\n<div class=\"ajf-header\">\n <h3>{{'Properties'|transloco}}</h3>\n <mat-icon (click)=\"save()\">save</mat-icon>\n <mat-icon (click)=\"cancel()\">cancel</mat-icon>\n</div>\n<ng-container *ngIf=\"nodeEntry|async as ne\">\n <ng-container *ngIf=\"propertiesForm|async as pf\">\n <form [formGroup]=\"pf!\" novalidate>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"name\"\n [placeholder]=\"'Name' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"label\"\n [placeholder]=\"'Label' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <mat-label>{{'Visibility'|transloco}}</mat-label>\n <mat-select\n formControlName=\"visibilityOpt\"\n [placeholder]=\"'Visible' | transloco\"\n >\n <mat-option value=\"always\">{{'Always'|transloco}}</mat-option>\n <mat-option value=\"never\">{{'Never'|transloco}}</mat-option>\n <mat-option value=\"condition\"\n >{{'Condition...'|transloco}}</mat-option\n >\n </mat-select>\n </mat-form-field>\n <button\n (click)=\"editVisibility()\"\n [disabled]=\"pf!.value.visibilityOpt != 'condition'\"\n mat-raised-button\n [matTooltip]=\"curVisibility || ''\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ curVisibility }}</span>\n </div>\n </button>\n </div>\n <div class=\"ajf-prop\">\n <div><label>{{'Branches'|transloco}}</label></div>\n <div>\n <mat-slider\n formControlName=\"conditionalBranchesNum\"\n thumbLabel\n tickInterval=\"auto\"\n min=\"1\"\n max=\"5\"\n step=\"1\"\n ></mat-slider>\n </div>\n <div *ngFor=\"let branch of conditionalBranches; let idx = index\">\n <button\n (click)=\"editConditionalBranch(idx)\"\n mat-raised-button\n [matTooltip]=\"branch\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ branch }}</span>\n </div>\n </button>\n </div>\n </div>\n <ng-template [ngIf]=\"isRepeatingContainerNode(ne)\">\n <div class=\"ajf-prop\">\n <div><label>{{'Repetitions'|transloco}}</label></div>\n <div>\n <button\n (click)=\"editFormulaReps()\"\n mat-raised-button\n [matTooltip]=\"curFormulaReps || ''\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ curFormulaReps }}</span>\n </div>\n </button>\n </div>\n <div><label>{{'Min repetitions'|transloco}}</label></div>\n <div>\n <mat-slider\n formControlName=\"minReps\"\n thumbLabel\n tickInterval=\"auto\"\n min=\"1\"\n max=\"5\"\n step=\"1\"\n ></mat-slider>\n </div>\n <div><label>{{'Max repetitions'|transloco}}</label></div>\n <div>\n <mat-slider\n formControlName=\"maxReps\"\n thumbLabel\n tickInterval=\"auto\"\n min=\"1\"\n max=\"5\"\n step=\"1\"\n ></mat-slider>\n </div>\n </div>\n </ng-template>\n <ng-template [ngIf]=\"isField(ne)\">\n <div class=\"ajf-prop\">\n <mat-form-field>\n <mat-label>{{'Field size'|transloco}}</mat-label>\n <mat-select\n formControlName=\"size\"\n [placeholder]=\"'Size' | transloco\"\n >\n <mat-option\n *ngFor=\"let fieldSize of fieldSizes\"\n [value]=\"fieldSize.value\"\n >\n {{ fieldSize.label|transloco }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"hint\"\n [placeholder]=\"'Hint' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <textarea\n matInput\n formControlName=\"description\"\n [placeholder]=\"'Description' | transloco\"\n ></textarea>\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"defaultValue\"\n [placeholder]=\"'Default value' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <div><label>{{'Formula'|transloco}}</label></div>\n <div>\n <button\n (click)=\"editFormula()\"\n mat-raised-button\n [matTooltip]=\"curFormula || ''\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ curFormula }}</span>\n </div>\n </button>\n </div>\n </div>\n <!-- <div class=\"ajf-prop\">\n <div><label>{{'Force value'|translco}}</label></div>\n <div>\n <button (click)=\"editForceValue()\" mat-raised-button [matTooltip]=\"curForceValue\">\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ curForceValue }}</span>\n </div>\n </button>\n </div>\n </div> -->\n <div class=\"ajf-prop\">\n <mat-checkbox formControlName=\"notEmpty\"\n >{{'Not empty'|transloco}}</mat-checkbox\n >\n </div>\n <ng-template [ngIf]=\"isNumericField(ne!.node)\">\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"minValue\"\n [placeholder]=\"'Min value' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"maxValue\"\n [placeholder]=\"'Max value' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"minDigits\"\n [placeholder]=\"'Min digits' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"maxDigits\"\n [placeholder]=\"'Max digits' | transloco\"\n />\n </mat-form-field>\n </div>\n </ng-template>\n <div class=\"ajf-prop\">\n <div class=\"ajf-header\">\n <label>{{ 'Validation' | transloco }}</label>\n <mat-icon class=\"ajf-pointer\" (click)=\"addValidationCondition()\"\n >add_circle_outline</mat-icon\n >\n </div>\n <div\n *ngIf=\"validationConditions == null || validationConditions.length == 0\"\n class=\"ajf-validation-row ajf-emph\"\n >\n {{'No conditions'|transloco}}\n </div>\n <div\n class=\"ajf-validation-row\"\n *ngFor=\"let validationCondition of validationConditions; let idx = index\"\n >\n <button\n (click)=\"editValidationCondition(idx)\"\n mat-raised-button\n [matTooltip]=\"validationCondition.condition\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ validationCondition.condition }}</span>\n </div>\n </button>\n <mat-icon\n class=\"ajf-pointer\"\n (click)=\"removeValidationCondition(idx)\"\n >remove_circle_outline</mat-icon\n >\n </div>\n </div>\n <div class=\"ajf-prop\">\n <mat-checkbox formControlName=\"notEmptyWarning\"\n >{{'Not empty warning'|transloco}}</mat-checkbox\n >\n </div>\n <div class=\"ajf-prop\">\n <div class=\"ajf-header\">\n <label>{{'Warnings'|transloco}}</label>\n <mat-icon class=\"ajf-pointer\" (click)=\"addWarningCondition()\"\n >add_circle_outline</mat-icon\n >\n </div>\n <div\n *ngIf=\"warningConditions == null || warningConditions.length == 0\"\n class=\"ajf-validation-row ajf-emph\"\n >\n {{'No warnings'|transloco}}\n </div>\n <div\n class=\"ajf-validation-row\"\n *ngFor=\"let warningCondition of warningConditions; let idx = index\"\n >\n <button\n (click)=\"editWarningCondition(idx)\"\n mat-raised-button\n [matTooltip]=\"warningCondition.condition\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ warningCondition.condition }}</span>\n </div>\n </button>\n <mat-icon class=\"ajf-pointer\" (click)=\"removeWarningCondition(idx)\"\n >remove_circle_outline</mat-icon\n >\n </div>\n </div>\n <div class=\"ajf-prop\">\n <div><label>{{'Go to next slide condition'|transloco}}</label></div>\n <div>\n <button\n (click)=\"editNextSlideCondition()\"\n mat-raised-button\n [matTooltip]=\"nextSlideCondition\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ nextSlideCondition }}</span>\n </div>\n </button>\n </div>\n </div>\n <ng-template [ngIf]=\"isFieldWithChoices(ne!.node)\">\n <div class=\"ajf-prop\">\n <mat-form-field>\n <mat-label>{{'Choices origins'|transloco}}</mat-label>\n <mat-select\n formControlName=\"choicesOriginRef\"\n [placeholder]=\"'Choices' | transloco\"\n >\n <mat-option\n *ngFor=\"let choicesOrigin of choicesOrigins\"\n [value]=\"choicesOrigin.name\"\n >\n {{ (choicesOrigin.label || choicesOrigin.name)|transloco }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <div><label>{{'Choices filter'|transloco}}</label></div>\n <div>\n <button\n (click)=\"editChoicesFilter()\"\n mat-raised-button\n [matTooltip]=\"curChoicesFilter\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ curChoicesFilter }}</span>\n </div>\n </button>\n </div>\n </div>\n <div class=\"ajf-prop\">\n <mat-checkbox formControlName=\"forceExpanded\"\n >{{'Force expanded selection'|transloco}}</mat-checkbox\n >\n </div>\n <div class=\"ajf-prop\">\n <mat-checkbox formControlName=\"forceNarrow\"\n >{{'Force narrow selection'|transloco}}</mat-checkbox\n >\n </div>\n <div class=\"ajf-prop\">\n <div class=\"ajf-header\">\n <label>{{'Trigger selection'|transloco}}</label>\n <mat-icon class=\"ajf-pointer\" (click)=\"addTriggerCondition()\"\n >add_circle_outline</mat-icon\n >\n </div>\n <div\n *ngIf=\"triggerConditions == null || triggerConditions.length == 0\"\n class=\"ajf-validation-row ajf-emph\"\n >\n {{'No trigger condition'|transloco}}\n </div>\n <div\n class=\"ajf-validation-row\"\n *ngFor=\"let triggerCondition of triggerConditions; let idx = index\"\n >\n <button\n (click)=\"editTriggerCondition(idx)\"\n mat-raised-button\n [matTooltip]=\"triggerCondition\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ triggerCondition }}</span>\n </div>\n </button>\n <mat-icon class=\"pointer\" (click)=\"removeTriggerCondition(idx)\"\n >remove_circle_outline</mat-icon\n >\n </div>\n </div>\n </ng-template>\n </ng-template>\n </form>\n </ng-container>\n</ng-container>\n",
2862
+ template: "<div\n [style.display]=\"(enabled|async) ? 'none' : 'block'\"\n class=\"ajf-disabled-overlay\"\n></div>\n<div class=\"ajf-header\">\n <h3>{{'Properties'|transloco}}</h3>\n <mat-icon (click)=\"save()\">save</mat-icon>\n <mat-icon (click)=\"cancel()\">cancel</mat-icon>\n</div>\n<ng-container *ngIf=\"nodeEntry|async as ne\">\n <ng-container *ngIf=\"propertiesForm|async as pf\">\n <form [formGroup]=\"pf!\" novalidate>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"name\"\n [placeholder]=\"'Name' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"label\"\n [placeholder]=\"'Label' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <mat-label>{{'Visibility'|transloco}}</mat-label>\n <mat-select\n formControlName=\"visibilityOpt\"\n [placeholder]=\"'Visible' | transloco\"\n >\n <mat-option value=\"always\">{{'Always'|transloco}}</mat-option>\n <mat-option value=\"never\">{{'Never'|transloco}}</mat-option>\n <mat-option value=\"condition\"\n >{{'Condition...'|transloco}}</mat-option\n >\n </mat-select>\n </mat-form-field>\n <button\n (click)=\"editVisibility()\"\n [disabled]=\"pf!.value.visibilityOpt != 'condition'\"\n mat-raised-button\n [matTooltip]=\"curVisibility || ''\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ curVisibility }}</span>\n </div>\n </button>\n </div>\n <div class=\"ajf-prop\">\n <div><label>{{'Branches'|transloco}}</label></div>\n <div>\n <mat-slider\n formControlName=\"conditionalBranchesNum\"\n thumbLabel\n tickInterval=\"auto\"\n min=\"1\"\n max=\"5\"\n step=\"1\"\n ></mat-slider>\n </div>\n <div *ngFor=\"let branch of conditionalBranches; let idx = index\">\n <button\n (click)=\"editConditionalBranch(idx)\"\n mat-raised-button\n [matTooltip]=\"branch\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ branch }}</span>\n </div>\n </button>\n </div>\n </div>\n <ng-template [ngIf]=\"isRepeatingContainerNode(ne)\">\n <div class=\"ajf-prop\">\n <div><label>{{'Repetitions'|transloco}}</label></div>\n <div>\n <button\n (click)=\"editFormulaReps()\"\n mat-raised-button\n [matTooltip]=\"curFormulaReps || ''\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ curFormulaReps }}</span>\n </div>\n </button>\n </div>\n <div><label>{{'Min repetitions'|transloco}}</label></div>\n <div>\n <mat-slider\n formControlName=\"minReps\"\n thumbLabel\n tickInterval=\"auto\"\n min=\"1\"\n max=\"5\"\n step=\"1\"\n ></mat-slider>\n </div>\n <div><label>{{'Max repetitions'|transloco}}</label></div>\n <div>\n <mat-slider\n formControlName=\"maxReps\"\n thumbLabel\n tickInterval=\"auto\"\n min=\"1\"\n max=\"5\"\n step=\"1\"\n ></mat-slider>\n </div>\n </div>\n </ng-template>\n <ng-template [ngIf]=\"isField(ne)\">\n <div class=\"ajf-prop\">\n <mat-form-field>\n <mat-label>{{'Field size'|transloco}}</mat-label>\n <mat-select\n formControlName=\"size\"\n [placeholder]=\"'Size' | transloco\"\n >\n <mat-option\n *ngFor=\"let fieldSize of fieldSizes\"\n [value]=\"fieldSize.value\"\n >\n {{ fieldSize.label|transloco }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"hint\"\n [placeholder]=\"'Hint' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <textarea\n matInput\n formControlName=\"description\"\n [placeholder]=\"'Description' | transloco\"\n ></textarea>\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"defaultValue\"\n [placeholder]=\"'Default value' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <div><label>{{'Formula'|transloco}}</label></div>\n <div>\n <button\n (click)=\"editFormula()\"\n mat-raised-button\n [matTooltip]=\"curFormula || ''\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ curFormula }}</span>\n </div>\n </button>\n </div>\n </div>\n <!-- <div class=\"ajf-prop\">\n <div><label>{{'Force value'|translco}}</label></div>\n <div>\n <button (click)=\"editForceValue()\" mat-raised-button [matTooltip]=\"curForceValue\">\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ curForceValue }}</span>\n </div>\n </button>\n </div>\n </div> -->\n <div class=\"ajf-prop\">\n <mat-checkbox formControlName=\"notEmpty\"\n >{{'Not empty'|transloco}}</mat-checkbox\n >\n </div>\n <ng-template [ngIf]=\"isNumericField(ne!.node)\">\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"minValue\"\n [placeholder]=\"'Min value' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"maxValue\"\n [placeholder]=\"'Max value' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"minDigits\"\n [placeholder]=\"'Min digits' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n formControlName=\"maxDigits\"\n [placeholder]=\"'Max digits' | transloco\"\n />\n </mat-form-field>\n </div>\n </ng-template>\n <ng-template [ngIf]=\"isRangeField(ne!.node)\">\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n type=\"number\"\n formControlName=\"start\"\n [placeholder]=\"'Start' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n type=\"number\"\n formControlName=\"end\"\n [placeholder]=\"'End' | transloco\"\n />\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <mat-form-field>\n <input\n matInput\n type=\"number\"\n formControlName=\"step\"\n [placeholder]=\"'Step' | transloco\"\n />\n </mat-form-field>\n </div>\n </ng-template>\n <div class=\"ajf-prop\">\n <div class=\"ajf-header\">\n <label>{{ 'Validation' | transloco }}</label>\n <mat-icon class=\"ajf-pointer\" (click)=\"addValidationCondition()\"\n >add_circle_outline</mat-icon\n >\n </div>\n <div\n *ngIf=\"validationConditions == null || validationConditions.length == 0\"\n class=\"ajf-validation-row ajf-emph\"\n >\n {{'No conditions'|transloco}}\n </div>\n <div\n class=\"ajf-validation-row\"\n *ngFor=\"let validationCondition of validationConditions; let idx = index\"\n >\n <button\n (click)=\"editValidationCondition(idx)\"\n mat-raised-button\n [matTooltip]=\"validationCondition.condition\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ validationCondition.condition }}</span>\n </div>\n </button>\n <mat-icon\n class=\"ajf-pointer\"\n (click)=\"removeValidationCondition(idx)\"\n >remove_circle_outline</mat-icon\n >\n </div>\n </div>\n <div class=\"ajf-prop\">\n <mat-checkbox formControlName=\"notEmptyWarning\"\n >{{'Not empty warning'|transloco}}</mat-checkbox\n >\n </div>\n <div class=\"ajf-prop\">\n <div class=\"ajf-header\">\n <label>{{'Warnings'|transloco}}</label>\n <mat-icon class=\"ajf-pointer\" (click)=\"addWarningCondition()\"\n >add_circle_outline</mat-icon\n >\n </div>\n <div\n *ngIf=\"warningConditions == null || warningConditions.length == 0\"\n class=\"ajf-validation-row ajf-emph\"\n >\n {{'No warnings'|transloco}}\n </div>\n <div\n class=\"ajf-validation-row\"\n *ngFor=\"let warningCondition of warningConditions; let idx = index\"\n >\n <button\n (click)=\"editWarningCondition(idx)\"\n mat-raised-button\n [matTooltip]=\"warningCondition.condition\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ warningCondition.condition }}</span>\n </div>\n </button>\n <mat-icon class=\"ajf-pointer\" (click)=\"removeWarningCondition(idx)\"\n >remove_circle_outline</mat-icon\n >\n </div>\n </div>\n <div class=\"ajf-prop\">\n <div><label>{{'Go to next slide condition'|transloco}}</label></div>\n <div>\n <button\n (click)=\"editNextSlideCondition()\"\n mat-raised-button\n [matTooltip]=\"nextSlideCondition\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ nextSlideCondition }}</span>\n </div>\n </button>\n </div>\n </div>\n <ng-template [ngIf]=\"isFieldWithChoices(ne!.node)\">\n <div class=\"ajf-prop\">\n <mat-form-field>\n <mat-label>{{'Choices origins'|transloco}}</mat-label>\n <mat-select\n formControlName=\"choicesOriginRef\"\n [placeholder]=\"'Choices' | transloco\"\n >\n <mat-option\n *ngFor=\"let choicesOrigin of choicesOrigins\"\n [value]=\"choicesOrigin.name\"\n >\n {{ (choicesOrigin.label || choicesOrigin.name)|transloco }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"ajf-prop\">\n <div><label>{{'Choices filter'|transloco}}</label></div>\n <div>\n <button\n (click)=\"editChoicesFilter()\"\n mat-raised-button\n [matTooltip]=\"curChoicesFilter\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ curChoicesFilter }}</span>\n </div>\n </button>\n </div>\n </div>\n <div class=\"ajf-prop\">\n <mat-checkbox formControlName=\"forceExpanded\"\n >{{'Force expanded selection'|transloco}}</mat-checkbox\n >\n </div>\n <div class=\"ajf-prop\">\n <mat-checkbox formControlName=\"forceNarrow\"\n >{{'Force narrow selection'|transloco}}</mat-checkbox\n >\n </div>\n <div class=\"ajf-prop\">\n <div class=\"ajf-header\">\n <label>{{'Trigger selection'|transloco}}</label>\n <mat-icon class=\"ajf-pointer\" (click)=\"addTriggerCondition()\"\n >add_circle_outline</mat-icon\n >\n </div>\n <div\n *ngIf=\"triggerConditions == null || triggerConditions.length == 0\"\n class=\"ajf-validation-row ajf-emph\"\n >\n {{'No trigger condition'|transloco}}\n </div>\n <div\n class=\"ajf-validation-row\"\n *ngFor=\"let triggerCondition of triggerConditions; let idx = index\"\n >\n <button\n (click)=\"editTriggerCondition(idx)\"\n mat-raised-button\n [matTooltip]=\"triggerCondition\"\n >\n <div class=\"ajf-icon-cont\">\n <mat-icon>edit</mat-icon>\n <span>{{ triggerCondition }}</span>\n </div>\n </button>\n <mat-icon class=\"pointer\" (click)=\"removeTriggerCondition(idx)\"\n >remove_circle_outline</mat-icon\n >\n </div>\n </div>\n </ng-template>\n </ng-template>\n </form>\n </ng-container>\n</ng-container>\n",
2842
2863
  encapsulation: ViewEncapsulation.None,
2843
2864
  changeDetection: ChangeDetectionStrategy.OnPush,
2844
2865
  styles: ["ajf-fb-node-properties{display:block;padding:1em;position:relative}ajf-fb-node-properties mat-icon{cursor:pointer}ajf-fb-node-properties .ajf-header{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap}ajf-fb-node-properties .ajf-header>h3,ajf-fb-node-properties .ajf-header>label{flex:1 0 auto;margin-right:.5em}ajf-fb-node-properties .ajf-header>mat-icon{flex:0 0 auto;margin-left:.5em}ajf-fb-node-properties .ajf-disabled-overlay{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.4;background-color:#fff}ajf-fb-node-properties .ajf-emph{font-style:italic}ajf-fb-node-properties [mat-raised-button]{margin:.5em 0}ajf-fb-node-properties [mat-raised-button].ajf-pointer{cursor:pointer}ajf-fb-node-properties [mat-raised-button] .ajf-icon-cont{display:flex;flex-direction:row;align-items:center}ajf-fb-node-properties [mat-raised-button] .ajf-icon-cont span{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;display:block;min-height:36px}ajf-fb-node-properties .ajf-validation-row{margin:.5em 0;display:flex;flex-direction:row;align-items:center}ajf-fb-node-properties .ajf-validation-row button{flex:1 1 auto}ajf-fb-node-properties .ajf-validation-row mat-icon{flex:0 0 auto}ajf-fb-node-properties .ajf-prop{margin:.5em 0}ajf-fb-node-properties mat-form-field,ajf-fb-node-properties mat-slider,ajf-fb-node-properties [mat-raised-button]{width:100%}\n"]
@@ -2926,13 +2947,32 @@ class AjfFormBuilderModule {
2926
2947
  AjfFormBuilderModule.decorators = [
2927
2948
  { type: NgModule, args: [{
2928
2949
  imports: [
2929
- AjfMonacoEditorModule, AjfNodeIconModule, CommonModule, DragDropModule,
2930
- FormsModule, MatAutocompleteModule, MatButtonModule, MatCardModule,
2931
- MatCheckboxModule, MatChipsModule, MatDialogModule, MatFormFieldModule,
2932
- MatIconModule, MatInputModule, MatListModule, MatMenuModule,
2933
- MatSelectModule, MatSidenavModule, MatSliderModule, MatTableModule,
2934
- MatToolbarModule, MatTooltipModule, ReactiveFormsModule, AjfTranslocoModule,
2935
- MatExpansionModule, MatSlideToggleModule,
2950
+ AjfMonacoEditorModule,
2951
+ AjfNodeIconModule,
2952
+ CommonModule,
2953
+ DragDropModule,
2954
+ FormsModule,
2955
+ MatAutocompleteModule,
2956
+ MatButtonModule,
2957
+ MatCardModule,
2958
+ MatCheckboxModule,
2959
+ MatChipsModule,
2960
+ MatDialogModule,
2961
+ MatFormFieldModule,
2962
+ MatIconModule,
2963
+ MatInputModule,
2964
+ MatListModule,
2965
+ MatMenuModule,
2966
+ MatSelectModule,
2967
+ MatSidenavModule,
2968
+ MatSliderModule,
2969
+ MatTableModule,
2970
+ MatToolbarModule,
2971
+ MatTooltipModule,
2972
+ ReactiveFormsModule,
2973
+ AjfTranslocoModule,
2974
+ MatExpansionModule,
2975
+ MatSlideToggleModule,
2936
2976
  ],
2937
2977
  declarations: [
2938
2978
  AjfFbBranchLine,
@@ -2948,12 +2988,8 @@ AjfFormBuilderModule.decorators = [
2948
2988
  AjfFbWarningConditionEditorDialog,
2949
2989
  AjfFormBuilder,
2950
2990
  ],
2951
- exports: [
2952
- AjfFormBuilder,
2953
- ],
2954
- providers: [
2955
- AjfFormBuilderService,
2956
- ],
2991
+ exports: [AjfFormBuilder],
2992
+ providers: [AjfFormBuilderService],
2957
2993
  },] }
2958
2994
  ];
2959
2995