@igo2/common 21.0.0-next.2 → 21.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/igo2-common-action.mjs +34 -49
- package/fesm2022/igo2-common-action.mjs.map +1 -1
- package/fesm2022/igo2-common-backdrop.mjs +5 -13
- package/fesm2022/igo2-common-backdrop.mjs.map +1 -1
- package/fesm2022/igo2-common-badge.mjs.map +1 -1
- package/fesm2022/igo2-common-collapsible.mjs +6 -14
- package/fesm2022/igo2-common-collapsible.mjs.map +1 -1
- package/fesm2022/igo2-common-color.mjs.map +1 -1
- package/fesm2022/igo2-common-confirm-dialog.mjs +2 -1
- package/fesm2022/igo2-common-confirm-dialog.mjs.map +1 -1
- package/fesm2022/igo2-common-context-menu.mjs +6 -4
- package/fesm2022/igo2-common-context-menu.mjs.map +1 -1
- package/fesm2022/igo2-common-datepicker.mjs +21 -15
- package/fesm2022/igo2-common-datepicker.mjs.map +1 -1
- package/fesm2022/igo2-common-dom.mjs +3 -1
- package/fesm2022/igo2-common-dom.mjs.map +1 -1
- package/fesm2022/igo2-common-drag-drop.mjs +59 -27
- package/fesm2022/igo2-common-drag-drop.mjs.map +1 -1
- package/fesm2022/igo2-common-dynamic-component.mjs +9 -3
- package/fesm2022/igo2-common-dynamic-component.mjs.map +1 -1
- package/fesm2022/igo2-common-entity.mjs +131 -98
- package/fesm2022/igo2-common-entity.mjs.map +1 -1
- package/fesm2022/igo2-common-flexible.mjs +19 -71
- package/fesm2022/igo2-common-flexible.mjs.map +1 -1
- package/fesm2022/igo2-common-form.mjs +46 -45
- package/fesm2022/igo2-common-form.mjs.map +1 -1
- package/fesm2022/igo2-common-icon.mjs +1 -1
- package/fesm2022/igo2-common-icon.mjs.map +1 -1
- package/fesm2022/igo2-common-image.mjs.map +1 -1
- package/fesm2022/igo2-common-interactive-tour.mjs +40 -17
- package/fesm2022/igo2-common-interactive-tour.mjs.map +1 -1
- package/fesm2022/igo2-common-json-dialog.mjs +2 -2
- package/fesm2022/igo2-common-json-dialog.mjs.map +1 -1
- package/fesm2022/igo2-common-keyvalue.mjs +3 -1
- package/fesm2022/igo2-common-keyvalue.mjs.map +1 -1
- package/fesm2022/igo2-common-list.mjs +11 -6
- package/fesm2022/igo2-common-list.mjs.map +1 -1
- package/fesm2022/igo2-common-panel.mjs +1 -1
- package/fesm2022/igo2-common-panel.mjs.map +1 -1
- package/fesm2022/igo2-common-resizable-bar.mjs +2 -4
- package/fesm2022/igo2-common-resizable-bar.mjs.map +1 -1
- package/fesm2022/igo2-common-select-value-dialog.mjs +14 -4
- package/fesm2022/igo2-common-select-value-dialog.mjs.map +1 -1
- package/fesm2022/igo2-common-sidenav.mjs.map +1 -1
- package/fesm2022/igo2-common-spinner.mjs +1 -1
- package/fesm2022/igo2-common-spinner.mjs.map +1 -1
- package/fesm2022/igo2-common-table.mjs +53 -60
- package/fesm2022/igo2-common-table.mjs.map +1 -1
- package/fesm2022/igo2-common-timepicker.mjs +8 -9
- package/fesm2022/igo2-common-timepicker.mjs.map +1 -1
- package/fesm2022/igo2-common-tool.mjs +19 -16
- package/fesm2022/igo2-common-tool.mjs.map +1 -1
- package/fesm2022/igo2-common-widget.mjs +4 -4
- package/fesm2022/igo2-common-widget.mjs.map +1 -1
- package/fesm2022/igo2-common-workspace.mjs +12 -16
- package/fesm2022/igo2-common-workspace.mjs.map +1 -1
- package/package.json +3 -3
- package/types/igo2-common-action.d.ts +2 -5
- package/types/igo2-common-backdrop.d.ts +2 -4
- package/types/igo2-common-badge.d.ts +4 -4
- package/types/igo2-common-collapsible.d.ts +2 -4
- package/types/igo2-common-confirm-dialog.d.ts +1 -1
- package/types/igo2-common-context-menu.d.ts +2 -2
- package/types/igo2-common-datepicker.d.ts +9 -9
- package/types/igo2-common-drag-drop.d.ts +14 -12
- package/types/igo2-common-dynamic-component.d.ts +3 -3
- package/types/igo2-common-entity.d.ts +61 -57
- package/types/igo2-common-flexible.d.ts +14 -28
- package/types/igo2-common-form.d.ts +24 -24
- package/types/igo2-common-icon.d.ts +1 -1
- package/types/igo2-common-interactive-tour.d.ts +6 -6
- package/types/igo2-common-json-dialog.d.ts +4 -4
- package/types/igo2-common-keyvalue.d.ts +4 -1
- package/types/igo2-common-list.d.ts +7 -7
- package/types/igo2-common-panel.d.ts +1 -1
- package/types/igo2-common-resizable-bar.d.ts +4 -5
- package/types/igo2-common-select-value-dialog.d.ts +2 -2
- package/types/igo2-common-sidenav.d.ts +2 -2
- package/types/igo2-common-spinner.d.ts +1 -1
- package/types/igo2-common-table.d.ts +16 -17
- package/types/igo2-common-timepicker.d.ts +3 -3
- package/types/igo2-common-tool.d.ts +7 -8
- package/types/igo2-common-widget.d.ts +7 -7
- package/types/igo2-common-workspace.d.ts +12 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, ChangeDetectorRef, viewChild, Input, Component, NgModule } from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, ChangeDetectorRef, viewChild, input, Input, Component, NgModule } from '@angular/core';
|
|
3
3
|
import { MediaService } from '@igo2/core/media';
|
|
4
4
|
|
|
5
5
|
class FlexibleComponent {
|
|
@@ -8,55 +8,13 @@ class FlexibleComponent {
|
|
|
8
8
|
cdr = inject(ChangeDetectorRef);
|
|
9
9
|
static transitionTime = 250;
|
|
10
10
|
main = viewChild('flexibleMain', ...(ngDevMode ? [{ debugName: "main" }] : /* istanbul ignore next */ []));
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
get collapsed() {
|
|
19
|
-
return this._collapsed;
|
|
20
|
-
}
|
|
21
|
-
set collapsed(value) {
|
|
22
|
-
this._collapsed = value;
|
|
23
|
-
}
|
|
24
|
-
_collapsed = '0';
|
|
25
|
-
get expanded() {
|
|
26
|
-
return this._expanded;
|
|
27
|
-
}
|
|
28
|
-
set expanded(value) {
|
|
29
|
-
this._expanded = value;
|
|
30
|
-
}
|
|
31
|
-
_expanded = '100%';
|
|
32
|
-
get initialMobile() {
|
|
33
|
-
return this._initialMobile;
|
|
34
|
-
}
|
|
35
|
-
set initialMobile(value) {
|
|
36
|
-
this._initialMobile = value;
|
|
37
|
-
}
|
|
38
|
-
_initialMobile = this.expanded;
|
|
39
|
-
get collapsedMobile() {
|
|
40
|
-
return this._collapsedMobile;
|
|
41
|
-
}
|
|
42
|
-
set collapsedMobile(value) {
|
|
43
|
-
this._collapsedMobile = value;
|
|
44
|
-
}
|
|
45
|
-
_collapsedMobile = this.collapsed;
|
|
46
|
-
get expandedMobile() {
|
|
47
|
-
return this._expandedMobile;
|
|
48
|
-
}
|
|
49
|
-
set expandedMobile(value) {
|
|
50
|
-
this._expandedMobile = value;
|
|
51
|
-
}
|
|
52
|
-
_expandedMobile = this.expanded;
|
|
53
|
-
get direction() {
|
|
54
|
-
return this._direction;
|
|
55
|
-
}
|
|
56
|
-
set direction(value) {
|
|
57
|
-
this._direction = value;
|
|
58
|
-
}
|
|
59
|
-
_direction = 'column';
|
|
11
|
+
initial = input('0', ...(ngDevMode ? [{ debugName: "initial" }] : /* istanbul ignore next */ []));
|
|
12
|
+
collapsed = input('0', ...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
13
|
+
expanded = input('100%', ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
14
|
+
initialMobile = input('100%', ...(ngDevMode ? [{ debugName: "initialMobile" }] : /* istanbul ignore next */ []));
|
|
15
|
+
collapsedMobile = input('0', ...(ngDevMode ? [{ debugName: "collapsedMobile" }] : /* istanbul ignore next */ []));
|
|
16
|
+
expandedMobile = input('100%', ...(ngDevMode ? [{ debugName: "expandedMobile" }] : /* istanbul ignore next */ []));
|
|
17
|
+
direction = input('column', ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
60
18
|
get state() {
|
|
61
19
|
return this._state;
|
|
62
20
|
}
|
|
@@ -96,34 +54,24 @@ class FlexibleComponent {
|
|
|
96
54
|
}
|
|
97
55
|
setSize(size) {
|
|
98
56
|
this._state = 'transition';
|
|
99
|
-
|
|
100
|
-
|
|
57
|
+
const el = this.main()?.nativeElement;
|
|
58
|
+
if (!el) {
|
|
59
|
+
return;
|
|
101
60
|
}
|
|
102
|
-
|
|
103
|
-
|
|
61
|
+
if (this.direction() === 'column') {
|
|
62
|
+
el.style.height = size;
|
|
63
|
+
}
|
|
64
|
+
else if (this.direction() === 'row') {
|
|
65
|
+
el.style.width = size;
|
|
104
66
|
}
|
|
105
67
|
}
|
|
106
68
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FlexibleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
107
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.10", type: FlexibleComponent, isStandalone: true, selector: "igo-flexible", inputs: { initial: "initial", collapsed: "collapsed", expanded: "expanded", initialMobile: "initialMobile", collapsedMobile: "collapsedMobile", expandedMobile: "expandedMobile", direction: "direction", state: "state" }, viewQueries: [{ propertyName: "main", first: true, predicate: ["flexibleMain"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #flexibleMain class=\"igo-flexible-main {{ state }} {{ direction }}\">\n <div class=\"igo-container\">\n <ng-content />\n </div>\n</div>\n<div class=\"igo-flexible-fill\">\n <div>\n <div class=\"igo-container\">\n <ng-content select=\"[igoFlexibleFill]\" />\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;height:100%;width:100%}:host.column{flex-direction:column}:host.row{flex-direction:row}:host .igo-flexible-main{flex:0 0 auto;overflow:hidden}:host .igo-flexible-main.column{transition:height .25s ease-in}:host .igo-flexible-main.row{transition:width .25s ease-in}:host .igo-flexible-fill>div{position:absolute;inset:0}:host .igo-container{height:100%;overflow:hidden;position:relative}:host ::ng-deep .igo-flexible-fill{flex:1 1 auto;overflow:hidden;position:relative}:host ::ng-deep .igo-content{height:100%;width:100%;overflow:auto}:host ::ng-deep igo-panel{height:100%}\n"] });
|
|
69
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.10", type: FlexibleComponent, isStandalone: true, selector: "igo-flexible", inputs: { initial: { classPropertyName: "initial", publicName: "initial", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, initialMobile: { classPropertyName: "initialMobile", publicName: "initialMobile", isSignal: true, isRequired: false, transformFunction: null }, collapsedMobile: { classPropertyName: "collapsedMobile", publicName: "collapsedMobile", isSignal: true, isRequired: false, transformFunction: null }, expandedMobile: { classPropertyName: "expandedMobile", publicName: "expandedMobile", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: false, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "main", first: true, predicate: ["flexibleMain"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #flexibleMain class=\"igo-flexible-main {{ state }} {{ direction() }}\">\n <div class=\"igo-container\">\n <ng-content />\n </div>\n</div>\n<div class=\"igo-flexible-fill\">\n <div>\n <div class=\"igo-container\">\n <ng-content select=\"[igoFlexibleFill]\" />\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;height:100%;width:100%}:host.column{flex-direction:column}:host.row{flex-direction:row}:host .igo-flexible-main{flex:0 0 auto;overflow:hidden}:host .igo-flexible-main.column{transition:height .25s ease-in}:host .igo-flexible-main.row{transition:width .25s ease-in}:host .igo-flexible-fill>div{position:absolute;inset:0}:host .igo-container{height:100%;overflow:hidden;position:relative}:host ::ng-deep .igo-flexible-fill{flex:1 1 auto;overflow:hidden;position:relative}:host ::ng-deep .igo-content{height:100%;width:100%;overflow:auto}:host ::ng-deep igo-panel{height:100%}\n"] });
|
|
108
70
|
}
|
|
109
71
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FlexibleComponent, decorators: [{
|
|
110
72
|
type: Component,
|
|
111
|
-
args: [{ selector: 'igo-flexible', template: "<div #flexibleMain class=\"igo-flexible-main {{ state }} {{ direction }}\">\n <div class=\"igo-container\">\n <ng-content />\n </div>\n</div>\n<div class=\"igo-flexible-fill\">\n <div>\n <div class=\"igo-container\">\n <ng-content select=\"[igoFlexibleFill]\" />\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;height:100%;width:100%}:host.column{flex-direction:column}:host.row{flex-direction:row}:host .igo-flexible-main{flex:0 0 auto;overflow:hidden}:host .igo-flexible-main.column{transition:height .25s ease-in}:host .igo-flexible-main.row{transition:width .25s ease-in}:host .igo-flexible-fill>div{position:absolute;inset:0}:host .igo-container{height:100%;overflow:hidden;position:relative}:host ::ng-deep .igo-flexible-fill{flex:1 1 auto;overflow:hidden;position:relative}:host ::ng-deep .igo-content{height:100%;width:100%;overflow:auto}:host ::ng-deep igo-panel{height:100%}\n"] }]
|
|
112
|
-
}], propDecorators: { main: [{ type: i0.ViewChild, args: ['flexibleMain', { isSignal: true }] }], initial: [{
|
|
113
|
-
type: Input
|
|
114
|
-
}], collapsed: [{
|
|
115
|
-
type: Input
|
|
116
|
-
}], expanded: [{
|
|
117
|
-
type: Input
|
|
118
|
-
}], initialMobile: [{
|
|
119
|
-
type: Input
|
|
120
|
-
}], collapsedMobile: [{
|
|
121
|
-
type: Input
|
|
122
|
-
}], expandedMobile: [{
|
|
123
|
-
type: Input
|
|
124
|
-
}], direction: [{
|
|
125
|
-
type: Input
|
|
126
|
-
}], state: [{
|
|
73
|
+
args: [{ selector: 'igo-flexible', template: "<div #flexibleMain class=\"igo-flexible-main {{ state }} {{ direction() }}\">\n <div class=\"igo-container\">\n <ng-content />\n </div>\n</div>\n<div class=\"igo-flexible-fill\">\n <div>\n <div class=\"igo-container\">\n <ng-content select=\"[igoFlexibleFill]\" />\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;height:100%;width:100%}:host.column{flex-direction:column}:host.row{flex-direction:row}:host .igo-flexible-main{flex:0 0 auto;overflow:hidden}:host .igo-flexible-main.column{transition:height .25s ease-in}:host .igo-flexible-main.row{transition:width .25s ease-in}:host .igo-flexible-fill>div{position:absolute;inset:0}:host .igo-container{height:100%;overflow:hidden;position:relative}:host ::ng-deep .igo-flexible-fill{flex:1 1 auto;overflow:hidden;position:relative}:host ::ng-deep .igo-content{height:100%;width:100%;overflow:auto}:host ::ng-deep igo-panel{height:100%}\n"] }]
|
|
74
|
+
}], propDecorators: { main: [{ type: i0.ViewChild, args: ['flexibleMain', { isSignal: true }] }], initial: [{ type: i0.Input, args: [{ isSignal: true, alias: "initial", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], initialMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialMobile", required: false }] }], collapsedMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedMobile", required: false }] }], expandedMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedMobile", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], state: [{
|
|
127
75
|
type: Input
|
|
128
76
|
}] } });
|
|
129
77
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-common-flexible.mjs","sources":["../../../packages/common/flexible/src/flexible.component.ts","../../../packages/common/flexible/src/flexible.component.html","../../../packages/common/flexible/src/flexible.module.ts","../../../packages/common/flexible/src/igo2-common-flexible.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n OnDestroy,\n OnInit,\n inject,\n viewChild\n} from '@angular/core';\n\nimport { MediaService } from '@igo2/core/media';\n\nimport { Subscription } from 'rxjs';\n\nimport { FlexibleDirection, FlexibleState } from './flexible.type';\n\n@Component({\n selector: 'igo-flexible',\n templateUrl: './flexible.component.html',\n styleUrls: ['./flexible.component.scss']\n})\nexport class FlexibleComponent implements OnInit, OnDestroy {\n private el = inject(ElementRef);\n private mediaService = inject(MediaService);\n private cdr = inject(ChangeDetectorRef);\n\n static transitionTime = 250;\n\n readonly main = viewChild<ElementRef>('flexibleMain');\n\n
|
|
1
|
+
{"version":3,"file":"igo2-common-flexible.mjs","sources":["../../../packages/common/flexible/src/flexible.component.ts","../../../packages/common/flexible/src/flexible.component.html","../../../packages/common/flexible/src/flexible.module.ts","../../../packages/common/flexible/src/igo2-common-flexible.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n OnDestroy,\n OnInit,\n inject,\n input,\n viewChild\n} from '@angular/core';\n\nimport { MediaService } from '@igo2/core/media';\n\nimport { Subscription } from 'rxjs';\n\nimport { FlexibleDirection, FlexibleState } from './flexible.type';\n\n@Component({\n selector: 'igo-flexible',\n templateUrl: './flexible.component.html',\n styleUrls: ['./flexible.component.scss']\n})\nexport class FlexibleComponent implements OnInit, OnDestroy {\n private el = inject(ElementRef);\n private mediaService = inject(MediaService);\n private cdr = inject(ChangeDetectorRef);\n\n static transitionTime = 250;\n\n readonly main = viewChild<ElementRef>('flexibleMain');\n\n readonly initial = input('0');\n readonly collapsed = input('0');\n readonly expanded = input('100%');\n readonly initialMobile = input('100%');\n readonly collapsedMobile = input('0');\n readonly expandedMobile = input('100%');\n readonly direction = input<FlexibleDirection>('column');\n\n @Input()\n get state(): FlexibleState {\n return this._state;\n }\n set state(value: FlexibleState) {\n const sizes: Record<string, unknown> = {\n initial: this.initial,\n collapsed: this.collapsed,\n expanded: this.expanded\n };\n\n if (this.mediaService.isMobile()) {\n Object.assign(sizes, {\n initial: this.initialMobile,\n collapsed: this.collapsedMobile,\n expanded: this.expandedMobile\n });\n }\n\n const size = sizes[value];\n if (size !== undefined) {\n this.setSize(size as string);\n setTimeout(() => {\n this._state = value;\n }, FlexibleComponent.transitionTime);\n }\n }\n private _state: FlexibleState = 'initial';\n\n private mediaService$$!: Subscription;\n\n ngOnInit() {\n this.el.nativeElement.className += this.direction;\n\n // Since this component supports different sizes\n // on mobile, force a redraw when the media changes\n this.mediaService$$ = this.mediaService.media$.subscribe(() =>\n this.cdr.markForCheck()\n );\n }\n\n ngOnDestroy() {\n if (this.mediaService$$) {\n this.mediaService$$.unsubscribe();\n }\n }\n\n private setSize(size: string) {\n this._state = 'transition';\n\n const el = this.main()?.nativeElement;\n if (!el) {\n return;\n }\n if (this.direction() === 'column') {\n el.style.height = size;\n } else if (this.direction() === 'row') {\n el.style.width = size;\n }\n }\n}\n","<div #flexibleMain class=\"igo-flexible-main {{ state }} {{ direction() }}\">\n <div class=\"igo-container\">\n <ng-content />\n </div>\n</div>\n<div class=\"igo-flexible-fill\">\n <div>\n <div class=\"igo-container\">\n <ng-content select=\"[igoFlexibleFill]\" />\n </div>\n </div>\n</div>\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { FlexibleComponent } from './flexible.component';\n\n/**\n * @deprecated import the FlexibleComponent directly\n */\n@NgModule({\n imports: [FlexibleComponent],\n exports: [FlexibleComponent]\n})\nexport class IgoFlexibleModule {\n static forRoot(): ModuleWithProviders<IgoFlexibleModule> {\n return {\n ngModule: IgoFlexibleModule,\n providers: []\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":"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"}
|
|
@@ -53,9 +53,8 @@ function getControlErrorMessage(control, messages) {
|
|
|
53
53
|
return errorMessages.length > 0 ? errorMessages[0] : '';
|
|
54
54
|
}
|
|
55
55
|
function getAllFormFields(form) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [].concat(form.fields));
|
|
56
|
+
const fields = form.fields ? [...form.fields] : [];
|
|
57
|
+
return form.groups.reduce((acc, group) => acc.concat(group.fields), fields);
|
|
59
58
|
}
|
|
60
59
|
function getFormFieldByName(form, name) {
|
|
61
60
|
const fields = getAllFormFields(form);
|
|
@@ -71,11 +70,11 @@ class FormComponent {
|
|
|
71
70
|
/**
|
|
72
71
|
* Form
|
|
73
72
|
*/
|
|
74
|
-
form = input(
|
|
73
|
+
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : /* istanbul ignore next */ []));
|
|
75
74
|
/**
|
|
76
75
|
* Input data
|
|
77
76
|
*/
|
|
78
|
-
formData = input(
|
|
77
|
+
formData = input(...(ngDevMode ? [undefined, { debugName: "formData" }] : /* istanbul ignore next */ []));
|
|
79
78
|
/**
|
|
80
79
|
* Form autocomplete
|
|
81
80
|
*/
|
|
@@ -86,7 +85,7 @@ class FormComponent {
|
|
|
86
85
|
submitForm = output();
|
|
87
86
|
buttons = viewChild('buttons', ...(ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []));
|
|
88
87
|
get hasButtons() {
|
|
89
|
-
return this.buttons()
|
|
88
|
+
return (this.buttons()?.nativeElement.children.length ?? 0) !== 0;
|
|
90
89
|
}
|
|
91
90
|
/**
|
|
92
91
|
* Is the entity or the template change, recreate the form or repopulate it.
|
|
@@ -141,15 +140,15 @@ class FormComponent {
|
|
|
141
140
|
* Clear form
|
|
142
141
|
*/
|
|
143
142
|
clear() {
|
|
144
|
-
this.form()
|
|
143
|
+
this.form()?.control.reset();
|
|
145
144
|
}
|
|
146
145
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
147
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.10", type: FormComponent, isStandalone: true, selector: "igo-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired:
|
|
146
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.10", type: FormComponent, isStandalone: true, selector: "igo-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, formData: { classPropertyName: "formData", publicName: "formData", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitForm: "submitForm" }, viewQueries: [{ propertyName: "buttons", first: true, predicate: ["buttons"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<form\n [autocomplete]=\"autocomplete()\"\n [formGroup]=\"form().control\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"igo-form-body\" [class.igo-form-body-with-buttons]=\"hasButtons\">\n <div class=\"igo-form-content\">\n <ng-content />\n </div>\n <div #buttons class=\"igo-form-buttons\">\n <ng-content select=\"[formButtons]\" />\n </div>\n </div>\n</form>\n", styles: [":host{display:block}form{width:100%;height:100%}.igo-form-body,.igo-form-content{height:100%}.igo-form-body-with-buttons .igo-form-content{height:calc(100% - 56px)}.igo-form-content{display:flex}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
148
147
|
}
|
|
149
148
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormComponent, decorators: [{
|
|
150
149
|
type: Component,
|
|
151
150
|
args: [{ selector: 'igo-form', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, ReactiveFormsModule], template: "<form\n [autocomplete]=\"autocomplete()\"\n [formGroup]=\"form().control\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"igo-form-body\" [class.igo-form-body-with-buttons]=\"hasButtons\">\n <div class=\"igo-form-content\">\n <ng-content />\n </div>\n <div #buttons class=\"igo-form-buttons\">\n <ng-content select=\"[formButtons]\" />\n </div>\n </div>\n</form>\n", styles: [":host{display:block}form{width:100%;height:100%}.igo-form-body,.igo-form-content{height:100%}.igo-form-body-with-buttons .igo-form-content{height:calc(100% - 56px)}.igo-form-content{display:flex}\n"] }]
|
|
152
|
-
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required:
|
|
151
|
+
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], formData: [{ type: i0.Input, args: [{ isSignal: true, alias: "formData", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], submitForm: [{ type: i0.Output, args: ["submitForm"] }], buttons: [{ type: i0.ViewChild, args: ['buttons', { isSignal: true }] }] } });
|
|
153
152
|
|
|
154
153
|
/**
|
|
155
154
|
* @deprecated import the FormComponent directly
|
|
@@ -215,15 +214,15 @@ let FormFieldSelectComponent = class FormFieldSelectComponent {
|
|
|
215
214
|
/**
|
|
216
215
|
* The field's form control
|
|
217
216
|
*/
|
|
218
|
-
formControl = input(
|
|
217
|
+
formControl = input.required(...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
|
|
219
218
|
/**
|
|
220
219
|
* Field placeholder
|
|
221
220
|
*/
|
|
222
|
-
placeholder = input(
|
|
221
|
+
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
223
222
|
/**
|
|
224
223
|
* Field placeholder
|
|
225
224
|
*/
|
|
226
|
-
errors = input(
|
|
225
|
+
errors = input(...(ngDevMode ? [undefined, { debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
227
226
|
/**
|
|
228
227
|
* Wheter a disable switch should be available
|
|
229
228
|
*/
|
|
@@ -241,7 +240,7 @@ let FormFieldSelectComponent = class FormFieldSelectComponent {
|
|
|
241
240
|
* Get error message
|
|
242
241
|
*/
|
|
243
242
|
getErrorMessage() {
|
|
244
|
-
return getControlErrorMessage(this.formControl(), this.errors());
|
|
243
|
+
return getControlErrorMessage(this.formControl(), this.errors() || {});
|
|
245
244
|
}
|
|
246
245
|
onDisableSwitchClick() {
|
|
247
246
|
this.toggleDisabled();
|
|
@@ -257,7 +256,7 @@ let FormFieldSelectComponent = class FormFieldSelectComponent {
|
|
|
257
256
|
this.disabled.set(disabled);
|
|
258
257
|
}
|
|
259
258
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
260
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldSelectComponent, isStandalone: true, selector: "igo-form-field-select", inputs: { choices: { classPropertyName: "choices", publicName: "choices", isSignal: true, isRequired: true, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired:
|
|
259
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldSelectComponent, isStandalone: true, selector: "igo-form-field-select", inputs: { choices: { classPropertyName: "choices", publicName: "choices", isSignal: true, isRequired: true, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n <mat-select\n [multiple]=\"multiple()\"\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n @for (choice of choices(); track choice) {\n <mat-option [value]=\"choice.value\">\n {{ choice.title }}\n </mat-option>\n }\n </mat-select>\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{ disabled() === true ? 'check_box_outline_blank' : 'check_box' }}\n </mat-icon>\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
261
260
|
};
|
|
262
261
|
FormFieldSelectComponent = __decorate([
|
|
263
262
|
IgoFormFieldComponent('select')
|
|
@@ -273,7 +272,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
273
272
|
MatIconModule,
|
|
274
273
|
IgoLanguageModule
|
|
275
274
|
], template: "<mat-form-field>\n <mat-select\n [multiple]=\"multiple()\"\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n @for (choice of choices(); track choice) {\n <mat-option [value]=\"choice.value\">\n {{ choice.title }}\n </mat-option>\n }\n </mat-select>\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{ disabled() === true ? 'check_box_outline_blank' : 'check_box' }}\n </mat-icon>\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n" }]
|
|
276
|
-
}], propDecorators: { choices: [{ type: i0.Input, args: [{ isSignal: true, alias: "choices", required: true }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required:
|
|
275
|
+
}], propDecorators: { choices: [{ type: i0.Input, args: [{ isSignal: true, alias: "choices", required: true }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
|
|
277
276
|
|
|
278
277
|
/**
|
|
279
278
|
* This component renders a text field
|
|
@@ -286,19 +285,19 @@ let FormFieldTextComponent = class FormFieldTextComponent {
|
|
|
286
285
|
/**
|
|
287
286
|
* The field's form control
|
|
288
287
|
*/
|
|
289
|
-
formControl = input(
|
|
288
|
+
formControl = input.required(...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
|
|
290
289
|
/**
|
|
291
290
|
* Field placeholder
|
|
292
291
|
*/
|
|
293
|
-
placeholder = input(
|
|
292
|
+
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
294
293
|
/**
|
|
295
294
|
* if the input is a password
|
|
296
295
|
*/
|
|
297
|
-
isPassword = input(
|
|
296
|
+
isPassword = input(...(ngDevMode ? [undefined, { debugName: "isPassword" }] : /* istanbul ignore next */ []));
|
|
298
297
|
/**
|
|
299
298
|
* Field placeholder
|
|
300
299
|
*/
|
|
301
|
-
errors = input(
|
|
300
|
+
errors = input(...(ngDevMode ? [undefined, { debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
302
301
|
/**
|
|
303
302
|
* Wheter a disable switch should be available
|
|
304
303
|
*/
|
|
@@ -316,7 +315,7 @@ let FormFieldTextComponent = class FormFieldTextComponent {
|
|
|
316
315
|
* Get error message
|
|
317
316
|
*/
|
|
318
317
|
getErrorMessage() {
|
|
319
|
-
return getControlErrorMessage(this.formControl(), this.errors());
|
|
318
|
+
return getControlErrorMessage(this.formControl(), this.errors() || {});
|
|
320
319
|
}
|
|
321
320
|
onDisableSwitchClick() {
|
|
322
321
|
this.toggleDisabled();
|
|
@@ -340,14 +339,14 @@ let FormFieldTextComponent = class FormFieldTextComponent {
|
|
|
340
339
|
if (this.lastTimeoutRequest) {
|
|
341
340
|
clearTimeout(this.lastTimeoutRequest);
|
|
342
341
|
}
|
|
343
|
-
this.lastTimeoutRequest = setTimeout(() => {
|
|
342
|
+
this.lastTimeoutRequest = window.setTimeout(() => {
|
|
344
343
|
this.hide = true;
|
|
345
344
|
this.cdRef.detectChanges();
|
|
346
345
|
}, delayMS);
|
|
347
346
|
}
|
|
348
347
|
}
|
|
349
348
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
350
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldTextComponent, isStandalone: true, selector: "igo-form-field-text", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired:
|
|
349
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldTextComponent, isStandalone: true, selector: "igo-form-field-text", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, isPassword: { classPropertyName: "isPassword", publicName: "isPassword", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n <input\n matInput\n (blur)=\"delayedHide(0)\"\n [type]=\"isPassword() ? (hide ? 'password' : 'text') : 'text'\"\n [required]=\"isPassword() ? 'true' : required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n (change)=\"delayedHide()\"\n />\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n }\n\n @if (isPassword()) {\n <button type=\"button\" matSuffix mat-icon-button (click)=\"togglePassword()\">\n <mat-icon color=\"primary\">{{\n hide ? 'visibility_off' : 'visibility'\n }}</mat-icon>\n </button>\n }\n\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
351
350
|
};
|
|
352
351
|
FormFieldTextComponent = __decorate([
|
|
353
352
|
IgoFormFieldComponent('text')
|
|
@@ -364,7 +363,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
364
363
|
AsyncPipe,
|
|
365
364
|
IgoLanguageModule
|
|
366
365
|
], template: "<mat-form-field>\n <input\n matInput\n (blur)=\"delayedHide(0)\"\n [type]=\"isPassword() ? (hide ? 'password' : 'text') : 'text'\"\n [required]=\"isPassword() ? 'true' : required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n (change)=\"delayedHide()\"\n />\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n }\n\n @if (isPassword()) {\n <button type=\"button\" matSuffix mat-icon-button (click)=\"togglePassword()\">\n <mat-icon color=\"primary\">{{\n hide ? 'visibility_off' : 'visibility'\n }}</mat-icon>\n </button>\n }\n\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n" }]
|
|
367
|
-
}], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required:
|
|
366
|
+
}], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], isPassword: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPassword", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
|
|
368
367
|
|
|
369
368
|
/**
|
|
370
369
|
* This component renders a textarea field
|
|
@@ -374,15 +373,15 @@ let FormFieldTextareaComponent = class FormFieldTextareaComponent {
|
|
|
374
373
|
/**
|
|
375
374
|
* The field's form control
|
|
376
375
|
*/
|
|
377
|
-
formControl = input(
|
|
376
|
+
formControl = input.required(...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
|
|
378
377
|
/**
|
|
379
378
|
* Field placeholder
|
|
380
379
|
*/
|
|
381
|
-
placeholder = input(
|
|
380
|
+
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
382
381
|
/**
|
|
383
382
|
* Field placeholder
|
|
384
383
|
*/
|
|
385
|
-
errors = input(
|
|
384
|
+
errors = input(...(ngDevMode ? [undefined, { debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
386
385
|
/**
|
|
387
386
|
* Wheter a disable switch should be available
|
|
388
387
|
*/
|
|
@@ -400,7 +399,7 @@ let FormFieldTextareaComponent = class FormFieldTextareaComponent {
|
|
|
400
399
|
* Get error message
|
|
401
400
|
*/
|
|
402
401
|
getErrorMessage() {
|
|
403
|
-
return getControlErrorMessage(this.formControl(), this.errors());
|
|
402
|
+
return getControlErrorMessage(this.formControl(), this.errors() || {});
|
|
404
403
|
}
|
|
405
404
|
onDisableSwitchClick() {
|
|
406
405
|
this.toggleDisabled();
|
|
@@ -416,7 +415,7 @@ let FormFieldTextareaComponent = class FormFieldTextareaComponent {
|
|
|
416
415
|
this.disabled$.next(disabled);
|
|
417
416
|
}
|
|
418
417
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
419
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldTextareaComponent, isStandalone: true, selector: "igo-form-field-textarea", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired:
|
|
418
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldTextareaComponent, isStandalone: true, selector: "igo-form-field-textarea", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disableSwitch: { classPropertyName: "disableSwitch", publicName: "disableSwitch", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-form-field>\n <textarea\n matInput\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n </textarea>\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n", dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
420
419
|
};
|
|
421
420
|
FormFieldTextareaComponent = __decorate([
|
|
422
421
|
IgoFormFieldComponent('textarea')
|
|
@@ -432,7 +431,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
432
431
|
AsyncPipe,
|
|
433
432
|
IgoLanguageModule
|
|
434
433
|
], template: "<mat-form-field>\n <textarea\n matInput\n [required]=\"required\"\n [placeholder]=\"placeholder() | translate\"\n [formControl]=\"formControl()\"\n >\n </textarea>\n @if (disableSwitch() === true) {\n <mat-icon\n class=\"igo-form-disable-switch\"\n (click)=\"onDisableSwitchClick()\"\n matPrefix\n >{{\n (disabled$ | async) === true ? 'check_box_outline_blank' : 'check_box'\n }}\n </mat-icon>\n }\n @if (formControl().errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n }\n</mat-form-field>\n" }]
|
|
435
|
-
}], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required:
|
|
434
|
+
}], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disableSwitch: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSwitch", required: false }] }] } });
|
|
436
435
|
|
|
437
436
|
class FormService {
|
|
438
437
|
formBuilder = inject(UntypedFormBuilder);
|
|
@@ -462,7 +461,7 @@ class FormService {
|
|
|
462
461
|
const options = config.options || {};
|
|
463
462
|
const state = {
|
|
464
463
|
value: options.initialValue ?? '',
|
|
465
|
-
disabled: options.disabled
|
|
464
|
+
disabled: options.disabled || false
|
|
466
465
|
};
|
|
467
466
|
const control = this.formBuilder.control(state);
|
|
468
467
|
if (options.validator) {
|
|
@@ -518,15 +517,15 @@ class FormFieldComponent {
|
|
|
518
517
|
/**
|
|
519
518
|
* Field configuration
|
|
520
519
|
*/
|
|
521
|
-
field = input(
|
|
520
|
+
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
522
521
|
/**
|
|
523
522
|
* Field inputs cache
|
|
524
523
|
*/
|
|
525
|
-
fieldInputs
|
|
524
|
+
fieldInputs;
|
|
526
525
|
/**
|
|
527
526
|
* Field subscribers cache
|
|
528
527
|
*/
|
|
529
|
-
fieldSubscribers
|
|
528
|
+
fieldSubscribers;
|
|
530
529
|
get fieldOptions() {
|
|
531
530
|
return this.field().options || {};
|
|
532
531
|
}
|
|
@@ -555,12 +554,12 @@ class FormFieldComponent {
|
|
|
555
554
|
return this.fieldSubscribers;
|
|
556
555
|
}
|
|
557
556
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
558
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldComponent, isStandalone: true, selector: "igo-form-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired:
|
|
557
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormFieldComponent, isStandalone: true, selector: "igo-form-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (field() !== undefined) {\n <igo-dynamic-outlet\n [component]=\"getFieldComponent()\"\n [inputs]=\"getFieldInputs()\"\n [subscribers]=\"getFieldSubscribers()\"\n />\n}\n", styles: ["::ng-deep mat-form-field{width:100%}::ng-deep .igo-form-disable-switch{margin-right:8px}\n"], dependencies: [{ kind: "component", type: DynamicOutletComponent, selector: "igo-dynamic-outlet", inputs: ["component", "inputs", "subscribers"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
559
558
|
}
|
|
560
559
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
561
560
|
type: Component,
|
|
562
561
|
args: [{ selector: 'igo-form-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [DynamicOutletComponent], template: "@if (field() !== undefined) {\n <igo-dynamic-outlet\n [component]=\"getFieldComponent()\"\n [inputs]=\"getFieldInputs()\"\n [subscribers]=\"getFieldSubscribers()\"\n />\n}\n", styles: ["::ng-deep mat-form-field{width:100%}::ng-deep .igo-form-disable-switch{margin-right:8px}\n"] }]
|
|
563
|
-
}], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required:
|
|
562
|
+
}], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }] } });
|
|
564
563
|
|
|
565
564
|
const FORM_FIELD_DIRECTIVES = [
|
|
566
565
|
FormFieldComponent,
|
|
@@ -594,11 +593,11 @@ class FormGroupComponent {
|
|
|
594
593
|
/**
|
|
595
594
|
* Form field group
|
|
596
595
|
*/
|
|
597
|
-
group = input(
|
|
596
|
+
group = input.required(...(ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []));
|
|
598
597
|
/**
|
|
599
598
|
* Field placeholder
|
|
600
599
|
*/
|
|
601
|
-
errors = input(
|
|
600
|
+
errors = input(...(ngDevMode ? [undefined, { debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
602
601
|
/**
|
|
603
602
|
* Form group control
|
|
604
603
|
*/
|
|
@@ -639,12 +638,12 @@ class FormGroupComponent {
|
|
|
639
638
|
return getControlErrorMessage(this.formControl, options.errors || {});
|
|
640
639
|
}
|
|
641
640
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
642
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormGroupComponent, isStandalone: true, selector: "igo-form-group", inputs: { group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired:
|
|
641
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormGroupComponent, isStandalone: true, selector: "igo-form-group", inputs: { group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (group() && group().fields.length > 0) {\n <div class=\"igo-form-group-fields\">\n @for (field of group().fields; track field) {\n <div class=\"igo-form-field-wrapper\" [ngClass]=\"getFieldNgClass(field)\">\n <igo-form-field [field]=\"field\" />\n </div>\n }\n </div>\n}\n\n<div class=\"igo-form-group-extra-content\">\n <ng-content />\n</div>\n\n@if (formControl.errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n}\n", styles: [":host{width:100%;height:100%;display:block;overflow:auto;padding:10px 5px;box-sizing:border-box}:host .igo-form-field-colspan-2{width:100%}:host .igo-form-field-colspan-1{width:50%}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FormFieldComponent, selector: "igo-form-field", inputs: ["field"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
643
642
|
}
|
|
644
643
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormGroupComponent, decorators: [{
|
|
645
644
|
type: Component,
|
|
646
645
|
args: [{ selector: 'igo-form-group', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, FormFieldComponent, MatFormFieldModule, IgoLanguageModule], template: "@if (group() && group().fields.length > 0) {\n <div class=\"igo-form-group-fields\">\n @for (field of group().fields; track field) {\n <div class=\"igo-form-field-wrapper\" [ngClass]=\"getFieldNgClass(field)\">\n <igo-form-field [field]=\"field\" />\n </div>\n }\n </div>\n}\n\n<div class=\"igo-form-group-extra-content\">\n <ng-content />\n</div>\n\n@if (formControl.errors) {\n <mat-error>{{ getErrorMessage() | translate }}</mat-error>\n}\n", styles: [":host{width:100%;height:100%;display:block;overflow:auto;padding:10px 5px;box-sizing:border-box}:host .igo-form-field-colspan-2{width:100%}:host .igo-form-field-colspan-1{width:50%}\n"] }]
|
|
647
|
-
}], propDecorators: { group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required:
|
|
646
|
+
}], propDecorators: { group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: true }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }] } });
|
|
648
647
|
|
|
649
648
|
/**
|
|
650
649
|
* @deprecated import the FormGroupComponent directly
|
|
@@ -691,14 +690,14 @@ class FormDialogComponent {
|
|
|
691
690
|
formService = inject(FormService);
|
|
692
691
|
data = inject(MAT_DIALOG_DATA);
|
|
693
692
|
form$ = new BehaviorSubject(undefined);
|
|
694
|
-
data
|
|
693
|
+
data$;
|
|
695
694
|
constructor() {
|
|
696
695
|
this.data.processButtonText =
|
|
697
696
|
this.data.processButtonText ?? 'igo.common.formDialog.processButtonText';
|
|
698
697
|
this.data.cancelButtonText =
|
|
699
698
|
this.data.cancelButtonText ?? 'igo.common.formDialog.cancelButtonText';
|
|
700
699
|
this.data.title = this.data.title ?? 'igo.common.formDialog.title';
|
|
701
|
-
this.data$ = this.data.data
|
|
700
|
+
this.data$ = this.data.data$ ?? new BehaviorSubject({});
|
|
702
701
|
const fields = [];
|
|
703
702
|
const groups = [];
|
|
704
703
|
this.data.formFieldConfigs?.map((config) => fields.push(this.formService.field(config)));
|
|
@@ -711,6 +710,8 @@ class FormDialogComponent {
|
|
|
711
710
|
}
|
|
712
711
|
onSubmit(data) {
|
|
713
712
|
const form = this.form$.getValue();
|
|
713
|
+
if (!form)
|
|
714
|
+
return;
|
|
714
715
|
if (form.control.valid) {
|
|
715
716
|
this.dialogRef.close(data);
|
|
716
717
|
}
|
|
@@ -735,7 +736,7 @@ class FormDialogComponent {
|
|
|
735
736
|
this.dialogRef.close();
|
|
736
737
|
}
|
|
737
738
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
738
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormDialogComponent, isStandalone: true, selector: "igo-form-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ data.title | translate }}</h1>\n\n@if (form$ | async; as form) {\n <igo-form\n [form]=\"form\"\n [formData]=\"data$ | async
|
|
739
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: FormDialogComponent, isStandalone: true, selector: "igo-form-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ data.title | translate }}</h1>\n\n@if (form$ | async; as form) {\n <igo-form\n [form]=\"form\"\n [formData]=\"(data$ | async)!\"\n (submitForm)=\"onSubmit($event)\"\n >\n @if (form.fields.length) {\n <div class=\"form-dialog-container\">\n @for (field of form.fields; track field) {\n <igo-form-field [field]=\"field\" />\n }\n @for (group of form.groups; track group) {\n <igo-form-group [group]=\"group\" />\n }\n </div>\n }\n <div formButtons mat-dialog-actions>\n <button\n mat-stroked-button\n type=\"button\"\n color=\"primary\"\n (click)=\"cancel()\"\n >\n {{ data.cancelButtonText | translate }}\n </button>\n <button matButton=\"filled\" type=\"submit\" color=\"primary\">\n {{ data.processButtonText | translate }}\n </button>\n </div>\n </igo-form>\n}\n<div>\n @if (data.notice && data.notice !== '') {\n <igo-custom-html [html]=\"data.notice\" />\n }\n</div>\n", styles: [":host div[mat-dialog-actions]{margin:10px 0 0}:host .form-dialog-container{width:100%;padding:10px}:host .form-dialog-container igo-form-field,:host .form-dialog-container igo-form-group{display:block;height:auto}\n"], dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "component", type: FormComponent, selector: "igo-form", inputs: ["form", "formData", "autocomplete"], outputs: ["submitForm"] }, { kind: "component", type: FormFieldComponent, selector: "igo-form-field", inputs: ["field"] }, { kind: "component", type: FormGroupComponent, selector: "igo-form-group", inputs: ["group", "errors"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: CustomHtmlComponent, selector: "igo-custom-html", inputs: ["html"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] });
|
|
739
740
|
}
|
|
740
741
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: FormDialogComponent, decorators: [{
|
|
741
742
|
type: Component,
|
|
@@ -749,15 +750,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
749
750
|
CustomHtmlComponent,
|
|
750
751
|
AsyncPipe,
|
|
751
752
|
IgoLanguageModule
|
|
752
|
-
], template: "<h1 mat-dialog-title>{{ data.title | translate }}</h1>\n\n@if (form$ | async; as form) {\n <igo-form\n [form]=\"form\"\n [formData]=\"data$ | async
|
|
753
|
+
], template: "<h1 mat-dialog-title>{{ data.title | translate }}</h1>\n\n@if (form$ | async; as form) {\n <igo-form\n [form]=\"form\"\n [formData]=\"(data$ | async)!\"\n (submitForm)=\"onSubmit($event)\"\n >\n @if (form.fields.length) {\n <div class=\"form-dialog-container\">\n @for (field of form.fields; track field) {\n <igo-form-field [field]=\"field\" />\n }\n @for (group of form.groups; track group) {\n <igo-form-group [group]=\"group\" />\n }\n </div>\n }\n <div formButtons mat-dialog-actions>\n <button\n mat-stroked-button\n type=\"button\"\n color=\"primary\"\n (click)=\"cancel()\"\n >\n {{ data.cancelButtonText | translate }}\n </button>\n <button matButton=\"filled\" type=\"submit\" color=\"primary\">\n {{ data.processButtonText | translate }}\n </button>\n </div>\n </igo-form>\n}\n<div>\n @if (data.notice && data.notice !== '') {\n <igo-custom-html [html]=\"data.notice\" />\n }\n</div>\n", styles: [":host div[mat-dialog-actions]{margin:10px 0 0}:host .form-dialog-container{width:100%;padding:10px}:host .form-dialog-container igo-form-field,:host .form-dialog-container igo-form-group{display:block;height:auto}\n"] }]
|
|
753
754
|
}], ctorParameters: () => [] });
|
|
754
755
|
|
|
755
756
|
class FormDialogService {
|
|
756
757
|
dialog = inject(MatDialog);
|
|
757
758
|
open(formDialogConfig, options) {
|
|
758
759
|
const data = {
|
|
759
|
-
formFieldConfigs: formDialogConfig
|
|
760
|
-
formGroupsConfigs: formDialogConfig
|
|
760
|
+
formFieldConfigs: formDialogConfig?.formFieldConfigs,
|
|
761
|
+
formGroupsConfigs: formDialogConfig?.formGroupsConfigs,
|
|
761
762
|
...options
|
|
762
763
|
};
|
|
763
764
|
const dialogRef = this.dialog.open(FormDialogComponent, {
|