@ajf/material 18.4.0 → 18.5.0

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 (80) hide show
  1. package/README.md +167 -2
  2. package/audio/src/audio-module.d.ts +7 -6
  3. package/esm2022/audio/src/audio-module.mjs +22 -4
  4. package/esm2022/audio/src/audio.mjs +6 -6
  5. package/esm2022/barcode/barcode.mjs +3 -3
  6. package/esm2022/calendar/calendar.mjs +2 -2
  7. package/esm2022/checkbox-group/checkbox-group-item.mjs +3 -3
  8. package/esm2022/form-builder/form-builder-module.mjs +9 -2
  9. package/esm2022/form-builder/form-builder-service.mjs +63 -20
  10. package/esm2022/form-builder/form-builder.mjs +73 -9
  11. package/esm2022/form-builder/node-entry.mjs +3 -3
  12. package/esm2022/form-builder/node-properties.mjs +3 -13
  13. package/esm2022/form-builder/node-type-entry.mjs +3 -3
  14. package/esm2022/form-builder/node-type-groups.pipe.mjs +65 -0
  15. package/esm2022/form-builder/public_api.mjs +2 -1
  16. package/esm2022/form-builder/string-identifier-dialog.mjs +44 -60
  17. package/esm2022/forms/boolean-field.mjs +6 -5
  18. package/esm2022/forms/current-slide.mjs +92 -0
  19. package/esm2022/forms/date-input-field.mjs +7 -9
  20. package/esm2022/forms/display-field.mjs +2 -2
  21. package/esm2022/forms/empty-field.mjs +3 -3
  22. package/esm2022/forms/field-row.mjs +117 -0
  23. package/esm2022/forms/field.mjs +2 -2
  24. package/esm2022/forms/form.mjs +107 -13
  25. package/esm2022/forms/forms-module.mjs +26 -3
  26. package/esm2022/forms/input-field.mjs +6 -8
  27. package/esm2022/forms/multiple-choice-field.mjs +45 -10
  28. package/esm2022/forms/public_api.mjs +6 -1
  29. package/esm2022/forms/range-field.mjs +5 -6
  30. package/esm2022/forms/rep-strip.mjs +61 -0
  31. package/esm2022/forms/single-choice-field.mjs +26 -11
  32. package/esm2022/forms/slide-header.mjs +68 -0
  33. package/esm2022/forms/slide-stats.mjs +148 -0
  34. package/esm2022/forms/table-field.mjs +2 -2
  35. package/esm2022/forms/text-field.mjs +2 -2
  36. package/esm2022/forms/video-url-field.mjs +6 -8
  37. package/esm2022/geolocation/geolocation.mjs +4 -6
  38. package/esm2022/page-slider/page-slider.mjs +3 -3
  39. package/esm2022/signature/signature.mjs +5 -6
  40. package/esm2022/time/time-module.mjs +22 -4
  41. package/esm2022/time/time.mjs +4 -4
  42. package/fesm2022/ajf-material-audio.mjs +27 -9
  43. package/fesm2022/ajf-material-audio.mjs.map +1 -1
  44. package/fesm2022/ajf-material-barcode.mjs +2 -2
  45. package/fesm2022/ajf-material-barcode.mjs.map +1 -1
  46. package/fesm2022/ajf-material-calendar.mjs +2 -2
  47. package/fesm2022/ajf-material-calendar.mjs.map +1 -1
  48. package/fesm2022/ajf-material-checkbox-group.mjs +2 -2
  49. package/fesm2022/ajf-material-checkbox-group.mjs.map +1 -1
  50. package/fesm2022/ajf-material-form-builder.mjs +260 -108
  51. package/fesm2022/ajf-material-form-builder.mjs.map +1 -1
  52. package/fesm2022/ajf-material-forms.mjs +712 -99
  53. package/fesm2022/ajf-material-forms.mjs.map +1 -1
  54. package/fesm2022/ajf-material-geolocation.mjs +5 -7
  55. package/fesm2022/ajf-material-geolocation.mjs.map +1 -1
  56. package/fesm2022/ajf-material-page-slider.mjs +2 -2
  57. package/fesm2022/ajf-material-page-slider.mjs.map +1 -1
  58. package/fesm2022/ajf-material-signature.mjs +7 -8
  59. package/fesm2022/ajf-material-signature.mjs.map +1 -1
  60. package/fesm2022/ajf-material-time.mjs +24 -6
  61. package/fesm2022/ajf-material-time.mjs.map +1 -1
  62. package/form-builder/form-builder-module.d.ts +27 -25
  63. package/form-builder/form-builder-service.d.ts +25 -0
  64. package/form-builder/form-builder.d.ts +41 -2
  65. package/form-builder/node-type-groups.pipe.d.ts +45 -0
  66. package/form-builder/public_api.d.ts +1 -0
  67. package/form-builder/string-identifier-dialog.d.ts +10 -16
  68. package/forms/_theming.scss +142 -0
  69. package/forms/current-slide.d.ts +61 -0
  70. package/forms/field-row.d.ts +63 -0
  71. package/forms/form.d.ts +40 -3
  72. package/forms/forms-module.d.ts +57 -51
  73. package/forms/multiple-choice-field.d.ts +15 -1
  74. package/forms/public_api.d.ts +5 -0
  75. package/forms/rep-strip.d.ts +52 -0
  76. package/forms/single-choice-field.d.ts +7 -0
  77. package/forms/slide-header.d.ts +61 -0
  78. package/forms/slide-stats.d.ts +76 -0
  79. package/package.json +2 -2
  80. package/time/time-module.d.ts +4 -3
@@ -1,59 +1,65 @@
1
1
  import { ModuleWithProviders } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "./audio-field";
4
- import * as i2 from "./barcode-field";
5
- import * as i3 from "./boolean-field";
6
- import * as i4 from "./date-field";
7
- import * as i5 from "./date-input-field";
8
- import * as i6 from "./empty-field";
9
- import * as i7 from "./field-warning-dialog";
10
- import * as i8 from "./field";
11
- import * as i9 from "./form";
12
- import * as i10 from "./geolocation-field";
13
- import * as i11 from "./input-field";
14
- import * as i12 from "./multiple-choice-field";
15
- import * as i13 from "./range-field";
16
- import * as i14 from "./signature-field";
17
- import * as i15 from "./single-choice-field";
18
- import * as i16 from "./table-field";
19
- import * as i17 from "./text-field";
20
- import * as i18 from "./time-field";
21
- import * as i19 from "./video-url-field";
22
- import * as i20 from "./display-field";
23
- import * as i21 from "@ajf/material/audio";
24
- import * as i22 from "@ajf/material/barcode";
25
- import * as i23 from "@ajf/material/calendar";
26
- import * as i24 from "@ajf/core/common";
27
- import * as i25 from "@ajf/material/checkbox-group";
28
- import * as i26 from "@ajf/material/geolocation";
29
- import * as i27 from "@ajf/material/page-slider";
30
- import * as i28 from "@ajf/material/signature";
31
- import * as i29 from "@ajf/material/time";
32
- import * as i30 from "@ajf/core/transloco";
33
- import * as i31 from "@angular/common";
34
- import * as i32 from "@ajf/core/forms";
35
- import * as i33 from "@angular/material/button";
36
- import * as i34 from "@angular/material/button-toggle";
37
- import * as i35 from "@angular/material/card";
38
- import * as i36 from "@angular/material/datepicker";
39
- import * as i37 from "@angular/material/dialog";
40
- import * as i38 from "@angular/material/form-field";
41
- import * as i39 from "@angular/material/icon";
42
- import * as i40 from "@angular/material/input";
43
- import * as i41 from "@angular/material/core";
44
- import * as i42 from "@angular/material/radio";
45
- import * as i43 from "@angular/material/select";
46
- import * as i44 from "@angular/material/slide-toggle";
47
- import * as i45 from "@angular/material/toolbar";
48
- import * as i46 from "@angular/material/tooltip";
49
- import * as i47 from "@angular/forms";
50
- import * as i48 from "@angular/cdk/text-field";
51
- import * as i49 from "@angular/material/slider";
52
- import * as i50 from "ngx-mat-select-search";
53
- import * as i51 from "ngx-quill";
4
+ import * as i2 from "./current-slide";
5
+ import * as i3 from "./barcode-field";
6
+ import * as i4 from "./boolean-field";
7
+ import * as i5 from "./date-field";
8
+ import * as i6 from "./date-input-field";
9
+ import * as i7 from "./empty-field";
10
+ import * as i8 from "./field-row";
11
+ import * as i9 from "./field-warning-dialog";
12
+ import * as i10 from "./field";
13
+ import * as i11 from "./slide-stats";
14
+ import * as i12 from "./form";
15
+ import * as i13 from "./geolocation-field";
16
+ import * as i14 from "./input-field";
17
+ import * as i15 from "./multiple-choice-field";
18
+ import * as i16 from "./range-field";
19
+ import * as i17 from "./rep-strip";
20
+ import * as i18 from "./signature-field";
21
+ import * as i19 from "./single-choice-field";
22
+ import * as i20 from "./slide-header";
23
+ import * as i21 from "./table-field";
24
+ import * as i22 from "./text-field";
25
+ import * as i23 from "./time-field";
26
+ import * as i24 from "./video-url-field";
27
+ import * as i25 from "./display-field";
28
+ import * as i26 from "@ajf/material/audio";
29
+ import * as i27 from "@ajf/material/barcode";
30
+ import * as i28 from "@ajf/material/calendar";
31
+ import * as i29 from "@ajf/core/common";
32
+ import * as i30 from "@ajf/material/checkbox-group";
33
+ import * as i31 from "@ajf/material/geolocation";
34
+ import * as i32 from "@ajf/material/page-slider";
35
+ import * as i33 from "@ajf/material/signature";
36
+ import * as i34 from "@ajf/material/time";
37
+ import * as i35 from "@ajf/core/transloco";
38
+ import * as i36 from "@angular/common";
39
+ import * as i37 from "@ajf/core/forms";
40
+ import * as i38 from "@angular/material/button";
41
+ import * as i39 from "@angular/material/button-toggle";
42
+ import * as i40 from "@angular/material/card";
43
+ import * as i41 from "@angular/material/datepicker";
44
+ import * as i42 from "@angular/material/dialog";
45
+ import * as i43 from "@angular/material/form-field";
46
+ import * as i44 from "@angular/material/icon";
47
+ import * as i45 from "@angular/material/input";
48
+ import * as i46 from "@angular/material/menu";
49
+ import * as i47 from "@angular/material/core";
50
+ import * as i48 from "@angular/material/radio";
51
+ import * as i49 from "@angular/material/select";
52
+ import * as i50 from "@angular/material/slide-toggle";
53
+ import * as i51 from "@angular/material/toolbar";
54
+ import * as i52 from "@angular/material/tooltip";
55
+ import * as i53 from "@angular/forms";
56
+ import * as i54 from "@angular/cdk/text-field";
57
+ import * as i55 from "@angular/material/slider";
58
+ import * as i56 from "ngx-mat-select-search";
59
+ import * as i57 from "ngx-quill";
54
60
  export declare class AjfFormsModule {
55
61
  static forRoot(): ModuleWithProviders<AjfFormsModule>;
56
62
  static ɵfac: i0.ɵɵFactoryDeclaration<AjfFormsModule, never>;
57
- static ɵmod: i0.ɵɵNgModuleDeclaration<AjfFormsModule, [typeof i1.AjfAudioFieldComponent, typeof i2.AjfBarcodeFieldComponent, typeof i3.AjfBooleanFieldComponent, typeof i4.AjfDateFieldComponent, typeof i5.AjfDateInputFieldComponent, typeof i6.AjfEmptyFieldComponent, typeof i7.AjfFieldWarningDialog, typeof i8.AjfFormField, typeof i9.AjfFormRenderer, typeof i10.AjfGeolocationFieldComponent, typeof i11.AjfInputFieldComponent, typeof i12.AjfMultipleChoiceFieldComponent, typeof i13.AjfRangeFieldComponent, typeof i14.AjfSignatureFieldComponent, typeof i15.AjfSingleChoiceFieldComponent, typeof i16.AjfTableFieldComponent, typeof i17.AjfTextFieldComponent, typeof i18.AjfTimeFieldComponent, typeof i19.AjfVideoUrlFieldComponent, typeof i20.AjfDisplayFieldComponent], [typeof i21.AjfAudioModule, typeof i22.AjfBarcodeModule, typeof i23.AjfCalendarModule, typeof i24.AjfCommonModule, typeof i25.AjfCheckboxGroupModule, typeof i26.AjfGeolocationModule, typeof i27.AjfPageSliderModule, typeof i28.AjfSignatureModule, typeof i29.AjfTimeModule, typeof i30.AjfTranslocoModule, typeof i31.CommonModule, typeof i32.AjfFormsModule, typeof i33.MatButtonModule, typeof i34.MatButtonToggleModule, typeof i35.MatCardModule, typeof i36.MatDatepickerModule, typeof i37.MatDialogModule, typeof i38.MatFormFieldModule, typeof i39.MatIconModule, typeof i40.MatInputModule, typeof i41.MatNativeDateModule, typeof i42.MatRadioModule, typeof i43.MatSelectModule, typeof i44.MatSlideToggleModule, typeof i45.MatToolbarModule, typeof i46.MatTooltipModule, typeof i47.ReactiveFormsModule, typeof i48.TextFieldModule, typeof i49.MatSliderModule, typeof i50.NgxMatSelectSearchModule, typeof i51.QuillModule], [typeof i8.AjfFormField, typeof i9.AjfFormRenderer]>;
63
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AjfFormsModule, [typeof i1.AjfAudioFieldComponent, typeof i2.AjfCurrentSlidePipe, typeof i3.AjfBarcodeFieldComponent, typeof i4.AjfBooleanFieldComponent, typeof i5.AjfDateFieldComponent, typeof i6.AjfDateInputFieldComponent, typeof i7.AjfEmptyFieldComponent, typeof i8.AjfFieldRow, typeof i9.AjfFieldWarningDialog, typeof i10.AjfFormField, typeof i11.AjfFormIssuesPipe, typeof i12.AjfFormRenderer, typeof i13.AjfGeolocationFieldComponent, typeof i14.AjfInputFieldComponent, typeof i15.AjfMultipleChoiceFieldComponent, typeof i16.AjfRangeFieldComponent, typeof i17.AjfRepStrip, typeof i18.AjfSignatureFieldComponent, typeof i19.AjfSingleChoiceFieldComponent, typeof i11.AjfSlideCompletionPipe, typeof i20.AjfSlideHeader, typeof i11.AjfSlideIssuesPipe, typeof i21.AjfTableFieldComponent, typeof i22.AjfTextFieldComponent, typeof i23.AjfTimeFieldComponent, typeof i24.AjfVideoUrlFieldComponent, typeof i25.AjfDisplayFieldComponent], [typeof i26.AjfAudioModule, typeof i27.AjfBarcodeModule, typeof i28.AjfCalendarModule, typeof i29.AjfCommonModule, typeof i30.AjfCheckboxGroupModule, typeof i31.AjfGeolocationModule, typeof i32.AjfPageSliderModule, typeof i33.AjfSignatureModule, typeof i34.AjfTimeModule, typeof i35.AjfTranslocoModule, typeof i36.CommonModule, typeof i37.AjfFormsModule, typeof i38.MatButtonModule, typeof i39.MatButtonToggleModule, typeof i40.MatCardModule, typeof i41.MatDatepickerModule, typeof i42.MatDialogModule, typeof i43.MatFormFieldModule, typeof i44.MatIconModule, typeof i45.MatInputModule, typeof i46.MatMenuModule, typeof i47.MatNativeDateModule, typeof i48.MatRadioModule, typeof i49.MatSelectModule, typeof i50.MatSlideToggleModule, typeof i51.MatToolbarModule, typeof i52.MatTooltipModule, typeof i53.ReactiveFormsModule, typeof i54.TextFieldModule, typeof i55.MatSliderModule, typeof i56.NgxMatSelectSearchModule, typeof i57.QuillModule], [typeof i8.AjfFieldRow, typeof i10.AjfFormField, typeof i12.AjfFormRenderer, typeof i17.AjfRepStrip, typeof i20.AjfSlideHeader]>;
58
64
  static ɵinj: i0.ɵɵInjectorDeclaration<AjfFormsModule>;
59
65
  }
@@ -21,17 +21,31 @@
21
21
  */
22
22
  import { AjfChoice, AjfFieldWithChoicesComponent, AjfFormRendererService } from '@ajf/core/forms';
23
23
  import { ChangeDetectorRef, OnDestroy } from '@angular/core';
24
- import { FormControl } from '@angular/forms';
24
+ import { FormControl, UntypedFormControl } from '@angular/forms';
25
25
  import { Observable } from 'rxjs';
26
26
  import { AjfWarningAlertService } from './warning-alert-service';
27
27
  import * as i0 from "@angular/core";
28
28
  export declare class AjfMultipleChoiceFieldComponent<T> extends AjfFieldWithChoicesComponent<T> implements OnDestroy {
29
29
  readonly expandThreshold: number;
30
30
  readonly searchFilterCtrl: FormControl<string>;
31
+ /**
32
+ * Whether the choices collapse into a searchable dropdown. Below the search
33
+ * threshold they are laid out as buttons instead, which reads faster for a
34
+ * short list. `forceExpanded` wins over `forceNarrow`, so a schema can pin
35
+ * either presentation regardless of how many choices there are.
36
+ */
37
+ get isNarrow(): boolean;
31
38
  filteredChoices$: Observable<AjfChoice<any>[]>;
32
39
  private readonly _choicesUpdate$;
33
40
  private _instanceUpdateForChoicesSub;
34
41
  constructor(cdr: ChangeDetectorRef, service: AjfFormRendererService, was: AjfWarningAlertService, searchThreshold: number);
42
+ /** The label shown on a selection chip. */
43
+ labelFor(value: any): string;
44
+ /**
45
+ * Drop one value from the selection, from the chip's own button. The click has
46
+ * to be stopped from reaching the trigger, which would reopen the panel.
47
+ */
48
+ removeValue(ctrl: UntypedFormControl, value: any, event: Event): void;
35
49
  protected _onInstanceChange(): void;
36
50
  ngOnDestroy(): void;
37
51
  static ɵfac: i0.ɵɵFactoryDeclaration<AjfMultipleChoiceFieldComponent<any>, [null, null, null, { optional: true; }]>;
@@ -20,17 +20,22 @@
20
20
  *
21
21
  */
22
22
  export * from './boolean-field';
23
+ export * from './current-slide';
23
24
  export * from './date-field';
24
25
  export * from './date-input-field';
25
26
  export * from './empty-field';
26
27
  export * from './field';
28
+ export * from './field-row';
27
29
  export * from './field-service';
28
30
  export * from './field-warning-dialog';
29
31
  export * from './input-field';
30
32
  export * from './form';
31
33
  export * from './forms-module';
32
34
  export * from './multiple-choice-field';
35
+ export * from './rep-strip';
33
36
  export * from './single-choice-field';
37
+ export * from './slide-header';
38
+ export * from './slide-stats';
34
39
  export * from './table-field';
35
40
  export * from './time-field';
36
41
  export * from './warning-alert-service';
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @license
3
+ * Copyright (C) Gnucoop soc. coop.
4
+ *
5
+ * This file is part of the Advanced JSON forms (ajf).
6
+ *
7
+ * Advanced JSON forms (ajf) is free software: you can redistribute it and/or
8
+ * modify it under the terms of the GNU Affero General Public License as
9
+ * published by the Free Software Foundation, either version 3 of the License,
10
+ * or (at your option) any later version.
11
+ *
12
+ * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
15
+ * General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Affero General Public License
18
+ * along with Advanced JSON forms (ajf).
19
+ * If not, see http://www.gnu.org/licenses/.
20
+ *
21
+ */
22
+ import { AjfRepeatingSlideInstance } from '@ajf/core/forms';
23
+ import { BooleanInput } from '@angular/cdk/coercion';
24
+ import { EventEmitter } from '@angular/core';
25
+ import * as i0 from "@angular/core";
26
+ /**
27
+ * The pager for a repeating slide: one button per repetition plus add and remove
28
+ * actions. The renderer keeps one page per repetition, so picking a number here
29
+ * is a page change, which the renderer performs.
30
+ */
31
+ export declare class AjfRepStrip {
32
+ slide: AjfRepeatingSlideInstance;
33
+ /** The repetition currently on screen, zero based. */
34
+ current: number;
35
+ set readonly(readonly: boolean);
36
+ get readonly(): boolean;
37
+ private _readonly;
38
+ readonly goTo: EventEmitter<number>;
39
+ readonly add: EventEmitter<void>;
40
+ readonly remove: EventEmitter<void>;
41
+ /**
42
+ * A repetition count driven by a formula is not the reader's to change:
43
+ * `AjfFormRendererService.addGroup` and `removeGroup` both refuse the call
44
+ * outright, so without this the buttons would sit enabled and do nothing.
45
+ */
46
+ private get manualReps();
47
+ get canAdd(): boolean;
48
+ get canRemove(): boolean;
49
+ static ngAcceptInputType_readonly: BooleanInput;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<AjfRepStrip, never>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<AjfRepStrip, "ajf-rep-strip", never, { "slide": { "alias": "slide"; "required": false; }; "current": { "alias": "current"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, { "goTo": "goTo"; "add": "add"; "remove": "remove"; }, never, never, false, never>;
52
+ }
@@ -28,6 +28,13 @@ import * as i0 from "@angular/core";
28
28
  export declare class AjfSingleChoiceFieldComponent<T> extends AjfFieldWithChoicesComponent<T> implements OnDestroy {
29
29
  readonly expandThreshold: number;
30
30
  readonly searchFilterCtrl: FormControl<string>;
31
+ /**
32
+ * Whether the choices collapse into a searchable dropdown. Below the search
33
+ * threshold they are laid out as buttons instead, which reads faster for a
34
+ * short list. `forceExpanded` wins over `forceNarrow`, so a schema can pin
35
+ * either presentation regardless of how many choices there are.
36
+ */
37
+ get isNarrow(): boolean;
31
38
  filteredChoices$: Observable<AjfChoice<any>[]>;
32
39
  private readonly _choicesUpdate$;
33
40
  private _instanceUpdateForChoicesSub;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @license
3
+ * Copyright (C) Gnucoop soc. coop.
4
+ *
5
+ * This file is part of the Advanced JSON forms (ajf).
6
+ *
7
+ * Advanced JSON forms (ajf) is free software: you can redistribute it and/or
8
+ * modify it under the terms of the GNU Affero General Public License as
9
+ * published by the Free Software Foundation, either version 3 of the License,
10
+ * or (at your option) any later version.
11
+ *
12
+ * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
15
+ * General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Affero General Public License
18
+ * along with Advanced JSON forms (ajf).
19
+ * If not, see http://www.gnu.org/licenses/.
20
+ *
21
+ */
22
+ import { AjfSlideInstance } from '@ajf/core/forms';
23
+ import { EventEmitter } from '@angular/core';
24
+ import * as i0 from "@angular/core";
25
+ /**
26
+ * The bar at the top of every slide: its number and title, a menu to jump to any
27
+ * other slide, previous/next paging, and a slot for the form's own action
28
+ * buttons.
29
+ *
30
+ * What the form still has failing is reported by the footer alone. Naming it
31
+ * here too cost a phone's whole header width to repeat something already on
32
+ * screen.
33
+ *
34
+ * Paging belongs to the renderer, which owns the page slider, so it is raised
35
+ * as an event rather than handled here.
36
+ */
37
+ export declare class AjfSlideHeader {
38
+ /** Absent while a start or end message page is on screen. */
39
+ slide: AjfSlideInstance | null;
40
+ /** The number shown in the badge, already offset by any start message. */
41
+ displayNumber: number;
42
+ /** Every slide of the form, for the jump menu. */
43
+ slides: AjfSlideInstance[];
44
+ /** How many pages the slider holds, repetitions and message pages included. */
45
+ pages: number;
46
+ /**
47
+ * Whether the form has anywhere to page to. A single page form gets no arrows
48
+ * and no "slide 1 of 1": both are controls that cannot do anything.
49
+ */
50
+ get canNavigate(): boolean;
51
+ /**
52
+ * Whether the jump menu is worth opening. Counted over the visible slides, the
53
+ * only ones the menu can actually reach.
54
+ */
55
+ get canJump(): boolean;
56
+ readonly jumpTo: EventEmitter<AjfSlideInstance>;
57
+ readonly prev: EventEmitter<void>;
58
+ readonly next: EventEmitter<void>;
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<AjfSlideHeader, never>;
60
+ static ɵcmp: i0.ɵɵComponentDeclaration<AjfSlideHeader, "ajf-slide-header", never, { "slide": { "alias": "slide"; "required": false; }; "displayNumber": { "alias": "displayNumber"; "required": false; }; "slides": { "alias": "slides"; "required": false; }; "pages": { "alias": "pages"; "required": false; }; }, { "jumpTo": "jumpTo"; "prev": "prev"; "next": "next"; }, never, ["*"], false, never>;
61
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @license
3
+ * Copyright (C) Gnucoop soc. coop.
4
+ *
5
+ * This file is part of the Advanced JSON forms (ajf).
6
+ *
7
+ * Advanced JSON forms (ajf) is free software: you can redistribute it and/or
8
+ * modify it under the terms of the GNU Affero General Public License as
9
+ * published by the Free Software Foundation, either version 3 of the License,
10
+ * or (at your option) any later version.
11
+ *
12
+ * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
15
+ * General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Affero General Public License
18
+ * along with Advanced JSON forms (ajf).
19
+ * If not, see http://www.gnu.org/licenses/.
20
+ *
21
+ */
22
+ import { AjfBaseSlideInstance, AjfSlideInstance } from '@ajf/core/forms';
23
+ import { PipeTransform } from '@angular/core';
24
+ import { UntypedFormGroup } from '@angular/forms';
25
+ import * as i0 from "@angular/core";
26
+ /** The filled/total counter shown as a chip in the slide header. */
27
+ export interface AjfSlideCompletion {
28
+ done: number;
29
+ total: number;
30
+ }
31
+ /**
32
+ * How many of a slide's fields carry a value, out of how many are on it. Notes
33
+ * (`AjfFieldType.Empty`) hold no value and are left out of both numbers.
34
+ *
35
+ * Impure because it reads mutable instance state, in the same way as
36
+ * `ajfValidSlide` and `ajfAsFieldInstanceErrors`. Returns a memoized object; see
37
+ * the note inside.
38
+ */
39
+ export declare class AjfSlideCompletionPipe implements PipeTransform {
40
+ private _last;
41
+ transform(slide: AjfBaseSlideInstance, idx?: number, formGroup?: UntypedFormGroup | null): AjfSlideCompletion;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<AjfSlideCompletionPipe, never>;
43
+ static ɵpipe: i0.ɵɵPipeDeclaration<AjfSlideCompletionPipe, "ajfSlideCompletion", false>;
44
+ }
45
+ /**
46
+ * How many of a slide's visible fields are failing validation.
47
+ */
48
+ export declare class AjfSlideIssuesPipe implements PipeTransform {
49
+ transform(slide: AjfBaseSlideInstance, idx?: number): number;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<AjfSlideIssuesPipe, never>;
51
+ static ɵpipe: i0.ɵɵPipeDeclaration<AjfSlideIssuesPipe, "ajfSlideIssues", false>;
52
+ }
53
+ /** What is left to fix in the whole form, for the header and footer alerts. */
54
+ export interface AjfFormIssues {
55
+ /** Visible fields failing validation, across every slide and repetition. */
56
+ fields: number;
57
+ /** How many slides hold at least one of them. */
58
+ slides: number;
59
+ }
60
+ /**
61
+ * The form's outstanding work in one place. A per-slide count only tells the
62
+ * reader about the slide they are already looking at, which is the one place
63
+ * they can see the failing fields for themselves.
64
+ *
65
+ * Counted here rather than taken from `AjfFormRendererService.errors`, which
66
+ * counts invalid slide pages and says nothing about how many fields are behind
67
+ * them.
68
+ *
69
+ * Impure and memoized, like its neighbours above.
70
+ */
71
+ export declare class AjfFormIssuesPipe implements PipeTransform {
72
+ private _last;
73
+ transform(slides: AjfSlideInstance[] | null): AjfFormIssues;
74
+ static ɵfac: i0.ɵɵFactoryDeclaration<AjfFormIssuesPipe, never>;
75
+ static ɵpipe: i0.ɵɵPipeDeclaration<AjfFormIssuesPipe, "ajfFormIssues", false>;
76
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ajf/material",
3
- "version": "18.4.0",
3
+ "version": "18.5.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "homepage": "https://github.com/gnucoop/ajf#readme",
15
15
  "peerDependencies": {
16
- "@ajf/core": "18.4.0",
16
+ "@ajf/core": "18.5.0",
17
17
  "@angular/animations": "^18.2.13",
18
18
  "@angular/cdk": "^18.2.14",
19
19
  "@angular/common": "^18.2.13",
@@ -3,10 +3,11 @@ import * as i1 from "./time";
3
3
  import * as i2 from "@angular/common";
4
4
  import * as i3 from "@angular/forms";
5
5
  import * as i4 from "@angular/material/form-field";
6
- import * as i5 from "@angular/material/input";
7
- import * as i6 from "@angular/material/select";
6
+ import * as i5 from "@angular/material/icon";
7
+ import * as i6 from "@angular/material/input";
8
+ import * as i7 from "@angular/material/select";
8
9
  export declare class AjfTimeModule {
9
10
  static ɵfac: i0.ɵɵFactoryDeclaration<AjfTimeModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<AjfTimeModule, [typeof i1.AjfTime], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.MatFormFieldModule, typeof i5.MatInputModule, typeof i6.MatSelectModule], [typeof i1.AjfTime]>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AjfTimeModule, [typeof i1.AjfTime], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.MatFormFieldModule, typeof i5.MatIconModule, typeof i6.MatInputModule, typeof i7.MatSelectModule], [typeof i1.AjfTime]>;
11
12
  static ɵinj: i0.ɵɵInjectorDeclaration<AjfTimeModule>;
12
13
  }