@ajsf/bootstrap5 22.4.0 → 22.6.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.
@@ -1,266 +1,291 @@
1
- import * as i0 from '@angular/core';
2
- import { Input, ChangeDetectionStrategy, Component, Injectable, NgModule } from '@angular/core';
3
- import { CommonModule } from '@angular/common';
4
- import * as i1$1 from '@angular/forms';
5
- import { ReactiveFormsModule } from '@angular/forms';
6
- import * as i1 from '@ajsf/core';
7
- import { cloneDeep, addClasses, inArray, CheckboxComponent, CheckboxesComponent, RadiosComponent, Framework, JsonSchemaFormModule, WidgetLibraryModule, JsonSchemaFormService, FrameworkLibraryService, WidgetLibraryService } from '@ajsf/core';
8
-
9
- /**
10
- * Bootstrap 5 framework for Angular JSON Schema Form.
11
- *
12
- */
13
- class Bootstrap5FrameworkComponent {
14
- constructor(changeDetector, jsf) {
15
- this.changeDetector = changeDetector;
16
- this.jsf = jsf;
17
- this.frameworkInitialized = false;
18
- this.errorMessage = null;
19
- this.formControl = null;
20
- this.debugOutput = '';
21
- this.debug = '';
22
- this.parentArray = null;
23
- this.isOrderable = false;
24
- }
25
- get isSingleCheck() {
26
- return this.layoutNode.type === 'checkbox' &&
27
- !this.options.fieldAddonLeft && !this.options.fieldAddonRight;
28
- }
29
- get showRemoveButton() {
30
- if (!this.options.removable || this.options.readonly ||
31
- this.layoutNode.type === '$ref') {
32
- return false;
33
- }
34
- if (this.layoutNode.recursiveReference) {
35
- return true;
36
- }
37
- if (!this.layoutNode.arrayItem || !this.parentArray) {
38
- return false;
39
- }
40
- // If array length <= minItems, don't allow removing any items
41
- if (this.parentArray.items.length - 1 <= this.parentArray.options.minItems) {
42
- return false;
43
- }
44
- // For removable list items, allow removing any item
45
- if (this.layoutNode.arrayItemType === 'list') {
46
- return true;
47
- }
48
- // For removable tuple items, only allow removing last item in list
49
- return this.layoutIndex.at(-1) === this.parentArray.items.length - 2;
50
- }
51
- ngOnInit() {
52
- this.initializeFramework();
53
- if (this.layoutNode.arrayItem && this.layoutNode.type !== '$ref') {
54
- this.parentArray = this.jsf.getParentNode(this);
55
- if (this.parentArray) {
56
- this.isOrderable = this.layoutNode.arrayItemType === 'list' &&
57
- !this.options.readonly && this.parentArray.options.orderable;
58
- }
59
- }
60
- }
61
- ngOnChanges() {
62
- if (!this.frameworkInitialized) {
63
- this.initializeFramework();
64
- }
65
- }
66
- initializeFramework() {
67
- if (!this.layoutNode) {
68
- return;
69
- }
70
- this.options = cloneDeep(this.layoutNode.options);
71
- this.widgetLayoutNode = {
72
- ...this.layoutNode,
73
- options: cloneDeep(this.layoutNode.options)
74
- };
75
- this.widgetOptions = this.widgetLayoutNode.options;
76
- this.formControl = this.jsf.getFormControl(this);
77
- this.setInputWidget();
78
- this.options.title = this.setTitle();
79
- this.setLayoutClasses();
80
- this.widgetOptions.htmlClass = '';
81
- this.options.labelHtmlClass =
82
- addClasses(this.options.labelHtmlClass, 'form-label');
83
- this.widgetOptions.activeClass =
84
- addClasses(this.widgetOptions.activeClass, 'active');
85
- this.options.fieldAddonLeft =
86
- this.options.fieldAddonLeft || this.options.prepend;
87
- this.options.fieldAddonRight =
88
- this.options.fieldAddonRight || this.options.append;
89
- this.markRequiredTitle();
90
- this.applyWidgetStyles();
91
- this.subscribeToControlEvents();
92
- this.frameworkInitialized = true;
93
- }
94
- setInputWidget() {
95
- this.options.isInputWidget = inArray(this.layoutNode.type, [
96
- 'button', 'checkbox', 'checkboxbuttons', 'checkboxes-inline',
97
- 'checkboxes', 'color',
98
- 'date', 'datetime-local', 'datetime', 'email', 'file', 'hidden',
99
- 'image', 'integer', 'month', 'number', 'password', 'radio',
100
- 'radiobuttons', 'radios-inline', 'radios', 'range', 'reset', 'search',
101
- 'select', 'submit', 'tel', 'text', 'textarea', 'time', 'url', 'week'
102
- ]);
103
- }
104
- setLayoutClasses() {
105
- this.options.htmlClass =
106
- addClasses(this.options.htmlClass, 'schema-form-' + this.layoutNode.type);
107
- if (this.layoutNode.type === 'array') {
108
- this.options.htmlClass = addClasses(this.options.htmlClass, 'list-group');
109
- }
110
- else if (this.layoutNode.arrayItem && this.layoutNode.type !== '$ref') {
111
- this.options.htmlClass = addClasses(this.options.htmlClass, 'list-group-item');
112
- }
113
- else {
114
- // Bootstrap 5 dropped .form-group in favour of margin utilities.
115
- this.options.htmlClass = addClasses(this.options.htmlClass, 'mb-3');
116
- }
117
- }
118
- markRequiredTitle() {
119
- const titled = this.layoutNode.type === 'array' || this.layoutNode.type === 'fieldset'
120
- ? this.widgetOptions : this.options;
121
- if (titled.title && this.layoutNode.type !== 'tab' &&
122
- !this.options.notitle && this.options.required &&
123
- !titled.title.includes('*')) {
124
- titled.title += ' <strong class="text-danger">*</strong>';
125
- }
126
- }
127
- subscribeToControlEvents() {
128
- if (!this.formControl) {
129
- return;
130
- }
131
- this.updateHelpBlock(this.formControl.status);
132
- // events, not statusChanges: a blur marks the control touched without changing its status.
133
- this.formControl.events.subscribe(() => this.updateHelpBlock(this.formControl.status));
134
- if (this.options.debug) {
135
- this.debugOutput = '';
136
- }
137
- }
138
- applyWidgetStyles() {
139
- switch (this.layoutNode.type) {
140
- // Checkbox controls
141
- // The framework template puts [class.form-check]="isSingleCheck" on
142
- // its own wrapper div, so the single checkbox takes .form-check from
143
- // there rather than from this switch.
144
- case 'checkbox':
145
- this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, 'form-check-input');
146
- this.widgetOptions.itemLabelHtmlClass = addClasses(this.widgetOptions.itemLabelHtmlClass, 'form-check-label');
147
- break;
148
- case 'checkboxes':
149
- case 'radio':
150
- case 'radios':
151
- this.widgetOptions.htmlClass = addClasses(this.widgetOptions.htmlClass, 'form-check');
152
- this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, 'form-check-input');
153
- this.widgetOptions.itemLabelHtmlClass = addClasses(this.widgetOptions.itemLabelHtmlClass, 'form-check-label');
154
- break;
155
- case 'checkboxes-inline':
156
- case 'radios-inline':
157
- this.widgetOptions.htmlClass = addClasses(this.widgetOptions.htmlClass, 'form-check form-check-inline');
158
- this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, 'form-check-input');
159
- this.widgetOptions.itemLabelHtmlClass = addClasses(this.widgetOptions.itemLabelHtmlClass, 'form-check-label');
160
- break;
161
- // Button sets - checkboxbuttons and radiobuttons
162
- case 'checkboxbuttons':
163
- case 'radiobuttons':
164
- this.widgetOptions.htmlClass = addClasses(this.widgetOptions.htmlClass, 'btn-group');
165
- this.widgetOptions.itemLabelHtmlClass = addClasses(this.widgetOptions.itemLabelHtmlClass, 'btn');
166
- this.widgetOptions.itemLabelHtmlClass = addClasses(this.widgetOptions.itemLabelHtmlClass, this.options.style || 'btn-outline-primary');
167
- this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, 'btn-check');
168
- break;
169
- // Single button controls
170
- case 'button':
171
- case 'submit':
172
- this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, 'btn');
173
- this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, this.options.style || 'btn-info');
174
- break;
175
- // Containers - arrays and fieldsets
176
- case 'array':
177
- case 'fieldset':
178
- case 'section':
179
- case 'conditional':
180
- case 'advancedfieldset':
181
- case 'authfieldset':
182
- case 'selectfieldset':
183
- case 'optionfieldset':
184
- this.options.messageLocation = 'top';
185
- break;
186
- case 'tabarray':
187
- case 'tabs':
188
- this.widgetOptions.htmlClass = addClasses(this.widgetOptions.htmlClass, 'tab-content');
189
- this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, 'tab-pane');
190
- this.widgetOptions.labelHtmlClass = addClasses(this.widgetOptions.labelHtmlClass, 'nav nav-tabs');
191
- break;
192
- // 'Add' buttons - references
193
- case '$ref':
194
- this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, 'btn pull-right');
195
- this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, this.options.style || 'btn-default');
196
- this.options.icon = 'glyphicon glyphicon-plus';
197
- break;
198
- // Default - including regular inputs
199
- default:
200
- this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, 'form-control');
201
- }
202
- }
203
- updateHelpBlock(status) {
204
- this.errorMessage = status === 'INVALID' &&
205
- this.options.enableErrorState && this.formControl.errors &&
206
- (this.formControl.touched || this.formControl.dirty || this.options.feedbackOnRender) ?
207
- this.jsf.formatErrors(this.formControl.errors, this.options.validationMessages) : null;
208
- this.options.helpBlock = this.errorMessage || this.options.description || this.options.help || null;
209
- }
210
- setTitle() {
211
- switch (this.layoutNode.type) {
212
- case 'button':
213
- case 'checkbox':
214
- case 'section':
215
- case 'help':
216
- case 'msg':
217
- case 'submit':
218
- case 'message':
219
- case 'tabarray':
220
- case 'tabs':
221
- case '$ref':
222
- return null;
223
- case 'advancedfieldset':
224
- this.widgetOptions.expandable = true;
225
- this.widgetOptions.title = 'Advanced options';
226
- return null;
227
- case 'authfieldset':
228
- this.widgetOptions.expandable = true;
229
- this.widgetOptions.title = 'Authentication settings';
230
- return null;
231
- // An array is a fieldset: the widget owns the title and renders the legend.
232
- case 'array':
233
- case 'fieldset':
234
- this.widgetOptions.title = this.options.title;
235
- return null;
236
- default:
237
- this.widgetOptions.title = null;
238
- return this.jsf.setItemTitle(this);
239
- }
240
- }
241
- removeItem() {
242
- this.jsf.removeItem(this);
243
- }
244
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5FrameworkComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); }
245
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: Bootstrap5FrameworkComponent, isStandalone: false, selector: "bootstrap-5-framework", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, usesOnChanges: true, ngImport: i0, template: "<!--\nBootstrap 5 replaced the has-error and has-success wrapper classes with\nis-invalid and is-valid on the control itself, so the state classes are bound\nto the field rather than to this container.\n-->\n<div [class]=\"options?.htmlClass || ''\">\n\n @if (options?.messageLocation === 'top') {\n <div>\n @if (options?.helpBlock) {\n <p\n class=\"form-text\"\n [innerHTML]=\"$safeNavigationMigration(options?.helpBlock)\"></p>\n }\n </div>\n }\n\n @if (options?.title && layoutNode?.type !== 'tab') {\n <label\n [attr.for]=\"'control' + layoutNode?._id\"\n [class]=\"options?.labelHtmlClass || ''\"\n [class.visually-hidden]=\"options?.notitle\"\n [innerHTML]=\"$safeNavigationMigration(options?.title)\"></label>\n }\n @if (layoutNode?.type === 'submit' && jsf?.formOptions?.fieldsRequired) {\n <p>\n <strong class=\"text-danger\">*</strong> = required fields\n </p>\n }\n <!-- Bootstrap reveals .invalid-feedback only after the element carrying\n .is-invalid, so the marker belongs on this row, not on the control. -->\n <div\n [class.d-flex]=\"showRemoveButton\"\n [class.align-items-center]=\"showRemoveButton && options?.isInputWidget\"\n [class.align-items-start]=\"showRemoveButton && !options?.isInputWidget\"\n [class.is-invalid]=\"!!errorMessage\">\n <div\n [class.h-100]=\"true\"\n [class.mt-1]=\"true\"\n [class.form-check]=\"isSingleCheck\"\n [class.input-group]=\"options?.fieldAddonLeft || options?.fieldAddonRight\"\n [class.flex-grow-1]=\"showRemoveButton\"\n >\n @if (options?.fieldAddonLeft) {\n <div class=\"input-group-prepend\">\n <span class=\"input-group-text\" [innerHTML]=\"$safeNavigationMigration(options?.fieldAddonLeft)\"></span>\n </div>\n }\n\n <select-widget-widget\n [layoutNode]=\"widgetLayoutNode\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"></select-widget-widget>\n\n @if (options?.fieldAddonRight) {\n <div class=\"input-group-append\">\n <span class=\"input-group-text\" [innerHTML]=\"$safeNavigationMigration(options?.fieldAddonRight)\"></span>\n </div>\n }\n </div>\n\n @if (showRemoveButton) {\n <button\n class=\"ms-2 btn btn-outline-danger btn-sm\"\n type=\"button\"\n (click)=\"removeItem()\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n </div>\n\n @if (errorMessage && options.messageLocation !== 'top') {\n <div\n class=\"invalid-feedback\"\n [innerHTML]=\"errorMessage\"></div>\n }\n\n <!--\n description || help is the order updateHelpBlock uses for options.helpBlock,\n which this block replaced. Reading description alone lost help entirely.\n The messageLocation guard mirrors the paragraph above: containers set it\n to 'top', and without it the same text renders in both places.\n -->\n @if ((options?.description || options?.help) &&\n options?.messageLocation !== 'top' && !errorMessage) {\n <div\n class=\"form-text text-muted\"\n [innerHTML]=\"options?.description || options?.help\"></div>\n }\n</div>\n\n@if (debug && debugOutput) {\n <div>debug:\n <pre>{{debugOutput}}</pre>\n </div>\n}\n", styles: [":host ::ng-deep .list-group-item .form-control-feedback{top:40px}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}\n"], dependencies: [{ kind: "component", type: i1.SelectWidgetComponent, selector: "select-widget-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
246
- }
247
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5FrameworkComponent, decorators: [{
248
- type: Component,
249
- args: [{ selector: 'bootstrap-5-framework', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<!--\nBootstrap 5 replaced the has-error and has-success wrapper classes with\nis-invalid and is-valid on the control itself, so the state classes are bound\nto the field rather than to this container.\n-->\n<div [class]=\"options?.htmlClass || ''\">\n\n @if (options?.messageLocation === 'top') {\n <div>\n @if (options?.helpBlock) {\n <p\n class=\"form-text\"\n [innerHTML]=\"$safeNavigationMigration(options?.helpBlock)\"></p>\n }\n </div>\n }\n\n @if (options?.title && layoutNode?.type !== 'tab') {\n <label\n [attr.for]=\"'control' + layoutNode?._id\"\n [class]=\"options?.labelHtmlClass || ''\"\n [class.visually-hidden]=\"options?.notitle\"\n [innerHTML]=\"$safeNavigationMigration(options?.title)\"></label>\n }\n @if (layoutNode?.type === 'submit' && jsf?.formOptions?.fieldsRequired) {\n <p>\n <strong class=\"text-danger\">*</strong> = required fields\n </p>\n }\n <!-- Bootstrap reveals .invalid-feedback only after the element carrying\n .is-invalid, so the marker belongs on this row, not on the control. -->\n <div\n [class.d-flex]=\"showRemoveButton\"\n [class.align-items-center]=\"showRemoveButton && options?.isInputWidget\"\n [class.align-items-start]=\"showRemoveButton && !options?.isInputWidget\"\n [class.is-invalid]=\"!!errorMessage\">\n <div\n [class.h-100]=\"true\"\n [class.mt-1]=\"true\"\n [class.form-check]=\"isSingleCheck\"\n [class.input-group]=\"options?.fieldAddonLeft || options?.fieldAddonRight\"\n [class.flex-grow-1]=\"showRemoveButton\"\n >\n @if (options?.fieldAddonLeft) {\n <div class=\"input-group-prepend\">\n <span class=\"input-group-text\" [innerHTML]=\"$safeNavigationMigration(options?.fieldAddonLeft)\"></span>\n </div>\n }\n\n <select-widget-widget\n [layoutNode]=\"widgetLayoutNode\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"></select-widget-widget>\n\n @if (options?.fieldAddonRight) {\n <div class=\"input-group-append\">\n <span class=\"input-group-text\" [innerHTML]=\"$safeNavigationMigration(options?.fieldAddonRight)\"></span>\n </div>\n }\n </div>\n\n @if (showRemoveButton) {\n <button\n class=\"ms-2 btn btn-outline-danger btn-sm\"\n type=\"button\"\n (click)=\"removeItem()\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n </div>\n\n @if (errorMessage && options.messageLocation !== 'top') {\n <div\n class=\"invalid-feedback\"\n [innerHTML]=\"errorMessage\"></div>\n }\n\n <!--\n description || help is the order updateHelpBlock uses for options.helpBlock,\n which this block replaced. Reading description alone lost help entirely.\n The messageLocation guard mirrors the paragraph above: containers set it\n to 'top', and without it the same text renders in both places.\n -->\n @if ((options?.description || options?.help) &&\n options?.messageLocation !== 'top' && !errorMessage) {\n <div\n class=\"form-text text-muted\"\n [innerHTML]=\"options?.description || options?.help\"></div>\n }\n</div>\n\n@if (debug && debugOutput) {\n <div>debug:\n <pre>{{debugOutput}}</pre>\n </div>\n}\n", styles: [":host ::ng-deep .list-group-item .form-control-feedback{top:40px}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}\n"] }]
250
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.JsonSchemaFormService }], propDecorators: { layoutNode: [{
251
- type: Input
252
- }], layoutIndex: [{
253
- type: Input
254
- }], dataIndex: [{
255
- type: Input
256
- }] } });
257
-
258
- /**
259
- * Bootstrap 5 wants the input and label as siblings inside .form-check.
260
- */
261
- class Bootstrap5CheckboxComponent extends CheckboxComponent {
262
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5CheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
263
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: Bootstrap5CheckboxComponent, isStandalone: false, selector: "bootstrap5-checkbox-widget", usesInheritance: true, ngImport: i0, template: `
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, Injectable, Input, NgModule } from "@angular/core";
3
+ import { CommonModule } from "@angular/common";
4
+ import * as i1 from "@angular/forms";
5
+ import { ReactiveFormsModule } from "@angular/forms";
6
+ import * as i1$1 from "@ajsf/core";
7
+ import { CheckboxComponent, CheckboxesComponent, Framework, FrameworkLibraryService, JsonSchemaFormModule, JsonSchemaFormService, RadiosComponent, WidgetLibraryModule, WidgetLibraryService, addClasses, cloneDeep, inArray } from "@ajsf/core";
8
+ var Bootstrap5FrameworkComponent = class Bootstrap5FrameworkComponent {
9
+ constructor(changeDetector, jsf) {
10
+ this.changeDetector = changeDetector;
11
+ this.jsf = jsf;
12
+ this.frameworkInitialized = false;
13
+ this.errorMessage = null;
14
+ this.formControl = null;
15
+ this.debugOutput = "";
16
+ this.debug = "";
17
+ this.parentArray = null;
18
+ this.isOrderable = false;
19
+ }
20
+ get isSingleCheck() {
21
+ return this.layoutNode.type === "checkbox" && !this.options.fieldAddonLeft && !this.options.fieldAddonRight;
22
+ }
23
+ get showRemoveButton() {
24
+ if (!this.options.removable || this.options.readonly || this.layoutNode.type === "$ref") return false;
25
+ if (this.layoutNode.recursiveReference) return true;
26
+ if (!this.layoutNode.arrayItem || !this.parentArray) return false;
27
+ if (this.parentArray.items.length - 1 <= this.parentArray.options.minItems) return false;
28
+ if (this.layoutNode.arrayItemType === "list") return true;
29
+ return this.layoutIndex.at(-1) === this.parentArray.items.length - 2;
30
+ }
31
+ ngOnInit() {
32
+ this.initializeFramework();
33
+ if (this.layoutNode.arrayItem && this.layoutNode.type !== "$ref") {
34
+ this.parentArray = this.jsf.getParentNode(this);
35
+ if (this.parentArray) this.isOrderable = this.layoutNode.arrayItemType === "list" && !this.options.readonly && this.parentArray.options.orderable;
36
+ }
37
+ }
38
+ ngOnChanges() {
39
+ if (!this.frameworkInitialized) this.initializeFramework();
40
+ }
41
+ initializeFramework() {
42
+ if (!this.layoutNode) return;
43
+ this.options = cloneDeep(this.layoutNode.options);
44
+ this.widgetLayoutNode = {
45
+ ...this.layoutNode,
46
+ options: cloneDeep(this.layoutNode.options)
47
+ };
48
+ this.widgetOptions = this.widgetLayoutNode.options;
49
+ this.formControl = this.jsf.getFormControl(this);
50
+ this.setInputWidget();
51
+ this.options.title = this.setTitle();
52
+ this.setLayoutClasses();
53
+ this.widgetOptions.htmlClass = "";
54
+ this.options.labelHtmlClass = addClasses(this.options.labelHtmlClass, "form-label");
55
+ this.widgetOptions.activeClass = addClasses(this.widgetOptions.activeClass, "active");
56
+ this.options.fieldAddonLeft = this.options.fieldAddonLeft || this.options.prepend;
57
+ this.options.fieldAddonRight = this.options.fieldAddonRight || this.options.append;
58
+ this.markRequiredTitle();
59
+ this.applyWidgetStyles();
60
+ this.subscribeToControlEvents();
61
+ this.frameworkInitialized = true;
62
+ }
63
+ setInputWidget() {
64
+ this.options.isInputWidget = inArray(this.layoutNode.type, [
65
+ "button",
66
+ "checkbox",
67
+ "checkboxbuttons",
68
+ "checkboxes-inline",
69
+ "checkboxes",
70
+ "color",
71
+ "date",
72
+ "datetime-local",
73
+ "datetime",
74
+ "email",
75
+ "file",
76
+ "hidden",
77
+ "image",
78
+ "integer",
79
+ "month",
80
+ "number",
81
+ "password",
82
+ "radio",
83
+ "radiobuttons",
84
+ "radios-inline",
85
+ "radios",
86
+ "range",
87
+ "reset",
88
+ "search",
89
+ "select",
90
+ "submit",
91
+ "tel",
92
+ "text",
93
+ "textarea",
94
+ "time",
95
+ "url",
96
+ "week"
97
+ ]);
98
+ }
99
+ setLayoutClasses() {
100
+ this.options.htmlClass = addClasses(this.options.htmlClass, "schema-form-" + this.layoutNode.type);
101
+ if (this.layoutNode.type === "array") this.options.htmlClass = addClasses(this.options.htmlClass, "list-group");
102
+ else if (this.layoutNode.arrayItem && this.layoutNode.type !== "$ref") this.options.htmlClass = addClasses(this.options.htmlClass, "list-group-item");
103
+ else this.options.htmlClass = addClasses(this.options.htmlClass, "mb-3");
104
+ }
105
+ markRequiredTitle() {
106
+ const titled = this.layoutNode.type === "array" || this.layoutNode.type === "fieldset" ? this.widgetOptions : this.options;
107
+ if (titled.title && this.layoutNode.type !== "tab" && !this.options.notitle && this.options.required && !titled.title.includes("*")) titled.title += " <strong class=\"text-danger\">*</strong>";
108
+ }
109
+ subscribeToControlEvents() {
110
+ if (!this.formControl) return;
111
+ this.updateHelpBlock(this.formControl.status);
112
+ this.formControl.events.subscribe(() => this.updateHelpBlock(this.formControl.status));
113
+ if (this.options.debug) this.debugOutput = "";
114
+ }
115
+ applyWidgetStyles() {
116
+ switch (this.layoutNode.type) {
117
+ case "checkbox":
118
+ this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, "form-check-input");
119
+ this.widgetOptions.itemLabelHtmlClass = addClasses(this.widgetOptions.itemLabelHtmlClass, "form-check-label");
120
+ break;
121
+ case "checkboxes":
122
+ case "radio":
123
+ case "radios":
124
+ this.widgetOptions.htmlClass = addClasses(this.widgetOptions.htmlClass, "form-check");
125
+ this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, "form-check-input");
126
+ this.widgetOptions.itemLabelHtmlClass = addClasses(this.widgetOptions.itemLabelHtmlClass, "form-check-label");
127
+ break;
128
+ case "checkboxes-inline":
129
+ case "radios-inline":
130
+ this.widgetOptions.htmlClass = addClasses(this.widgetOptions.htmlClass, "form-check form-check-inline");
131
+ this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, "form-check-input");
132
+ this.widgetOptions.itemLabelHtmlClass = addClasses(this.widgetOptions.itemLabelHtmlClass, "form-check-label");
133
+ break;
134
+ case "checkboxbuttons":
135
+ case "radiobuttons":
136
+ this.widgetOptions.htmlClass = addClasses(this.widgetOptions.htmlClass, "btn-group");
137
+ this.widgetOptions.itemLabelHtmlClass = addClasses(this.widgetOptions.itemLabelHtmlClass, "btn");
138
+ this.widgetOptions.itemLabelHtmlClass = addClasses(this.widgetOptions.itemLabelHtmlClass, this.options.style || "btn-outline-primary");
139
+ this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, "btn-check");
140
+ break;
141
+ case "button":
142
+ case "submit":
143
+ this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, "btn");
144
+ this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, this.options.style || "btn-info");
145
+ break;
146
+ case "array":
147
+ case "fieldset":
148
+ case "section":
149
+ case "conditional":
150
+ case "advancedfieldset":
151
+ case "authfieldset":
152
+ case "selectfieldset":
153
+ case "optionfieldset":
154
+ this.options.messageLocation = "top";
155
+ break;
156
+ case "tabarray":
157
+ case "tabs":
158
+ this.widgetOptions.htmlClass = addClasses(this.widgetOptions.htmlClass, "tab-content");
159
+ this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, "tab-pane");
160
+ this.widgetOptions.labelHtmlClass = addClasses(this.widgetOptions.labelHtmlClass, "nav nav-tabs");
161
+ break;
162
+ case "$ref":
163
+ this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, "btn pull-right");
164
+ this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, this.options.style || "btn-default");
165
+ this.options.icon = "glyphicon glyphicon-plus";
166
+ break;
167
+ default: this.widgetOptions.fieldHtmlClass = addClasses(this.widgetOptions.fieldHtmlClass, "form-control");
168
+ }
169
+ }
170
+ updateHelpBlock(status) {
171
+ this.errorMessage = status === "INVALID" && this.options.enableErrorState && this.formControl.errors && (this.formControl.touched || this.formControl.dirty || this.options.feedbackOnRender) ? this.jsf.formatErrors(this.formControl.errors, this.options.validationMessages) : null;
172
+ this.options.helpBlock = this.errorMessage || this.options.description || this.options.help || null;
173
+ }
174
+ setTitle() {
175
+ switch (this.layoutNode.type) {
176
+ case "button":
177
+ case "checkbox":
178
+ case "section":
179
+ case "help":
180
+ case "msg":
181
+ case "submit":
182
+ case "message":
183
+ case "tabarray":
184
+ case "tabs":
185
+ case "$ref": return null;
186
+ case "advancedfieldset":
187
+ this.widgetOptions.expandable = true;
188
+ this.widgetOptions.title = "Advanced options";
189
+ return null;
190
+ case "authfieldset":
191
+ this.widgetOptions.expandable = true;
192
+ this.widgetOptions.title = "Authentication settings";
193
+ return null;
194
+ case "array":
195
+ case "fieldset":
196
+ this.widgetOptions.title = this.options.title;
197
+ return null;
198
+ default:
199
+ this.widgetOptions.title = null;
200
+ return this.jsf.setItemTitle(this);
201
+ }
202
+ }
203
+ removeItem() {
204
+ this.jsf.removeItem(this);
205
+ }
206
+ static {
207
+ this.ɵfac = i0.ɵɵngDeclareFactory({
208
+ minVersion: "12.0.0",
209
+ version: "22.2.3",
210
+ ngImport: i0,
211
+ type: Bootstrap5FrameworkComponent,
212
+ deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.JsonSchemaFormService }],
213
+ target: i0.ɵɵFactoryTarget.Component
214
+ });
215
+ }
216
+ static {
217
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
218
+ minVersion: "17.0.0",
219
+ version: "22.2.3",
220
+ type: Bootstrap5FrameworkComponent,
221
+ isStandalone: false,
222
+ selector: "bootstrap-5-framework",
223
+ inputs: {
224
+ layoutNode: "layoutNode",
225
+ layoutIndex: "layoutIndex",
226
+ dataIndex: "dataIndex"
227
+ },
228
+ usesOnChanges: true,
229
+ ngImport: i0,
230
+ template: "<!--\nBootstrap 5 replaced the has-error and has-success wrapper classes with\nis-invalid and is-valid on the control itself, so the state classes are bound\nto the field rather than to this container.\n-->\n<div [class]=\"options?.htmlClass || ''\">\n\n @if (options?.messageLocation === 'top') {\n <div>\n @if (options?.helpBlock) {\n <p\n class=\"form-text\"\n [innerHTML]=\"$safeNavigationMigration(options?.helpBlock)\"></p>\n }\n </div>\n }\n\n @if (options?.title && layoutNode?.type !== 'tab') {\n <label\n [attr.for]=\"'control' + layoutNode?._id\"\n [class]=\"options?.labelHtmlClass || ''\"\n [class.visually-hidden]=\"options?.notitle\"\n [innerHTML]=\"$safeNavigationMigration(options?.title)\"></label>\n }\n @if (layoutNode?.type === 'submit' && jsf?.formOptions?.fieldsRequired) {\n <p>\n <strong class=\"text-danger\">*</strong> = required fields\n </p>\n }\n <!-- Bootstrap reveals .invalid-feedback only after the element carrying\n .is-invalid, so the marker belongs on this row, not on the control. -->\n <div\n [class.d-flex]=\"showRemoveButton\"\n [class.align-items-center]=\"showRemoveButton && options?.isInputWidget\"\n [class.align-items-start]=\"showRemoveButton && !options?.isInputWidget\"\n [class.is-invalid]=\"!!errorMessage\">\n <div\n [class.h-100]=\"true\"\n [class.mt-1]=\"true\"\n [class.form-check]=\"isSingleCheck\"\n [class.input-group]=\"options?.fieldAddonLeft || options?.fieldAddonRight\"\n [class.flex-grow-1]=\"showRemoveButton\"\n >\n @if (options?.fieldAddonLeft) {\n <div class=\"input-group-prepend\">\n <span class=\"input-group-text\" [innerHTML]=\"$safeNavigationMigration(options?.fieldAddonLeft)\"></span>\n </div>\n }\n\n <select-widget-widget\n [layoutNode]=\"widgetLayoutNode\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"></select-widget-widget>\n\n @if (options?.fieldAddonRight) {\n <div class=\"input-group-append\">\n <span class=\"input-group-text\" [innerHTML]=\"$safeNavigationMigration(options?.fieldAddonRight)\"></span>\n </div>\n }\n </div>\n\n @if (showRemoveButton) {\n <button\n class=\"ms-2 btn btn-outline-danger btn-sm\"\n type=\"button\"\n (click)=\"removeItem()\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n </div>\n\n @if (errorMessage && options.messageLocation !== 'top') {\n <div\n class=\"invalid-feedback\"\n [innerHTML]=\"errorMessage\"></div>\n }\n\n <!--\n description || help is the order updateHelpBlock uses for options.helpBlock,\n which this block replaced. Reading description alone lost help entirely.\n The messageLocation guard mirrors the paragraph above: containers set it\n to 'top', and without it the same text renders in both places.\n -->\n @if ((options?.description || options?.help) &&\n options?.messageLocation !== 'top' && !errorMessage) {\n <div\n class=\"form-text text-muted\"\n [innerHTML]=\"options?.description || options?.help\"></div>\n }\n</div>\n\n@if (debug && debugOutput) {\n <div>debug:\n <pre>{{debugOutput}}</pre>\n </div>\n}\n",
231
+ styles: [":host ::ng-deep .list-group-item .form-control-feedback{top:40px}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}\n"],
232
+ dependencies: [{
233
+ kind: "component",
234
+ type: i1$1.SelectWidgetComponent,
235
+ selector: "select-widget-widget",
236
+ inputs: [
237
+ "layoutNode",
238
+ "layoutIndex",
239
+ "dataIndex"
240
+ ]
241
+ }],
242
+ changeDetection: i0.ChangeDetectionStrategy.Eager
243
+ });
244
+ }
245
+ };
246
+ i0.ɵɵngDeclareClassMetadata({
247
+ minVersion: "12.0.0",
248
+ version: "22.2.3",
249
+ ngImport: i0,
250
+ type: Bootstrap5FrameworkComponent,
251
+ decorators: [{
252
+ type: Component,
253
+ args: [{
254
+ selector: "bootstrap-5-framework",
255
+ changeDetection: ChangeDetectionStrategy.Eager,
256
+ standalone: false,
257
+ template: "<!--\nBootstrap 5 replaced the has-error and has-success wrapper classes with\nis-invalid and is-valid on the control itself, so the state classes are bound\nto the field rather than to this container.\n-->\n<div [class]=\"options?.htmlClass || ''\">\n\n @if (options?.messageLocation === 'top') {\n <div>\n @if (options?.helpBlock) {\n <p\n class=\"form-text\"\n [innerHTML]=\"$safeNavigationMigration(options?.helpBlock)\"></p>\n }\n </div>\n }\n\n @if (options?.title && layoutNode?.type !== 'tab') {\n <label\n [attr.for]=\"'control' + layoutNode?._id\"\n [class]=\"options?.labelHtmlClass || ''\"\n [class.visually-hidden]=\"options?.notitle\"\n [innerHTML]=\"$safeNavigationMigration(options?.title)\"></label>\n }\n @if (layoutNode?.type === 'submit' && jsf?.formOptions?.fieldsRequired) {\n <p>\n <strong class=\"text-danger\">*</strong> = required fields\n </p>\n }\n <!-- Bootstrap reveals .invalid-feedback only after the element carrying\n .is-invalid, so the marker belongs on this row, not on the control. -->\n <div\n [class.d-flex]=\"showRemoveButton\"\n [class.align-items-center]=\"showRemoveButton && options?.isInputWidget\"\n [class.align-items-start]=\"showRemoveButton && !options?.isInputWidget\"\n [class.is-invalid]=\"!!errorMessage\">\n <div\n [class.h-100]=\"true\"\n [class.mt-1]=\"true\"\n [class.form-check]=\"isSingleCheck\"\n [class.input-group]=\"options?.fieldAddonLeft || options?.fieldAddonRight\"\n [class.flex-grow-1]=\"showRemoveButton\"\n >\n @if (options?.fieldAddonLeft) {\n <div class=\"input-group-prepend\">\n <span class=\"input-group-text\" [innerHTML]=\"$safeNavigationMigration(options?.fieldAddonLeft)\"></span>\n </div>\n }\n\n <select-widget-widget\n [layoutNode]=\"widgetLayoutNode\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"></select-widget-widget>\n\n @if (options?.fieldAddonRight) {\n <div class=\"input-group-append\">\n <span class=\"input-group-text\" [innerHTML]=\"$safeNavigationMigration(options?.fieldAddonRight)\"></span>\n </div>\n }\n </div>\n\n @if (showRemoveButton) {\n <button\n class=\"ms-2 btn btn-outline-danger btn-sm\"\n type=\"button\"\n (click)=\"removeItem()\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n }\n </div>\n\n @if (errorMessage && options.messageLocation !== 'top') {\n <div\n class=\"invalid-feedback\"\n [innerHTML]=\"errorMessage\"></div>\n }\n\n <!--\n description || help is the order updateHelpBlock uses for options.helpBlock,\n which this block replaced. Reading description alone lost help entirely.\n The messageLocation guard mirrors the paragraph above: containers set it\n to 'top', and without it the same text renders in both places.\n -->\n @if ((options?.description || options?.help) &&\n options?.messageLocation !== 'top' && !errorMessage) {\n <div\n class=\"form-text text-muted\"\n [innerHTML]=\"options?.description || options?.help\"></div>\n }\n</div>\n\n@if (debug && debugOutput) {\n <div>debug:\n <pre>{{debugOutput}}</pre>\n </div>\n}\n",
258
+ styles: [":host ::ng-deep .list-group-item .form-control-feedback{top:40px}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}\n"]
259
+ }]
260
+ }],
261
+ ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$1.JsonSchemaFormService }],
262
+ propDecorators: {
263
+ layoutNode: [{ type: Input }],
264
+ layoutIndex: [{ type: Input }],
265
+ dataIndex: [{ type: Input }]
266
+ }
267
+ });
268
+ var Bootstrap5CheckboxComponent = class Bootstrap5CheckboxComponent extends CheckboxComponent {
269
+ static {
270
+ this.ɵfac = i0.ɵɵngDeclareFactory({
271
+ minVersion: "12.0.0",
272
+ version: "22.2.3",
273
+ ngImport: i0,
274
+ type: Bootstrap5CheckboxComponent,
275
+ deps: null,
276
+ target: i0.ɵɵFactoryTarget.Component
277
+ });
278
+ }
279
+ static {
280
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
281
+ minVersion: "17.0.0",
282
+ version: "22.2.3",
283
+ type: Bootstrap5CheckboxComponent,
284
+ isStandalone: false,
285
+ selector: "bootstrap5-checkbox-widget",
286
+ usesInheritance: true,
287
+ ngImport: i0,
288
+ template: `
264
289
  <div [class]="options?.htmlClass || ''">
265
290
  @if (boundControl) {
266
291
  <input
@@ -298,15 +323,48 @@ class Bootstrap5CheckboxComponent extends CheckboxComponent {
298
323
  [innerHTML]="options?.title"></span>
299
324
  }
300
325
  </label>
301
- </div>`, isInline: true, dependencies: [{ kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
302
- }
303
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5CheckboxComponent, decorators: [{
304
- type: Component,
305
- args: [{
306
- selector: 'bootstrap5-checkbox-widget',
307
- changeDetection: ChangeDetectionStrategy.Eager,
308
- standalone: false,
309
- template: `
326
+ </div>`,
327
+ isInline: true,
328
+ dependencies: [
329
+ {
330
+ kind: "directive",
331
+ type: i1.CheckboxControlValueAccessor,
332
+ selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]"
333
+ },
334
+ {
335
+ kind: "directive",
336
+ type: i1.NgControlStatus,
337
+ selector: "[formControlName],[ngModel],[formControl]"
338
+ },
339
+ {
340
+ kind: "directive",
341
+ type: i1.FormControlDirective,
342
+ selector: "[formControl]",
343
+ inputs: [
344
+ "formControl",
345
+ "disabled",
346
+ "ngModel"
347
+ ],
348
+ outputs: ["ngModelChange"],
349
+ exportAs: ["ngForm"]
350
+ }
351
+ ],
352
+ changeDetection: i0.ChangeDetectionStrategy.Eager
353
+ });
354
+ }
355
+ };
356
+ i0.ɵɵngDeclareClassMetadata({
357
+ minVersion: "12.0.0",
358
+ version: "22.2.3",
359
+ ngImport: i0,
360
+ type: Bootstrap5CheckboxComponent,
361
+ decorators: [{
362
+ type: Component,
363
+ args: [{
364
+ selector: "bootstrap5-checkbox-widget",
365
+ changeDetection: ChangeDetectionStrategy.Eager,
366
+ standalone: false,
367
+ template: `
310
368
  <div [class]="options?.htmlClass || ''">
311
369
  @if (boundControl) {
312
370
  <input
@@ -344,17 +402,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
344
402
  [innerHTML]="options?.title"></span>
345
403
  }
346
404
  </label>
347
- </div>`,
348
- }]
349
- }] });
350
-
351
- /**
352
- * Siblings throughout: Bootstrap 5 button sets use .btn-check, which is a
353
- * sibling input too.
354
- */
355
- class Bootstrap5CheckboxesComponent extends CheckboxesComponent {
356
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5CheckboxesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
357
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: Bootstrap5CheckboxesComponent, isStandalone: false, selector: "bootstrap5-checkboxes-widget", usesInheritance: true, ngImport: i0, template: `
405
+ </div>`
406
+ }]
407
+ }]
408
+ });
409
+ var Bootstrap5CheckboxesComponent = class Bootstrap5CheckboxesComponent extends CheckboxesComponent {
410
+ static {
411
+ this.ɵfac = i0.ɵɵngDeclareFactory({
412
+ minVersion: "12.0.0",
413
+ version: "22.2.3",
414
+ ngImport: i0,
415
+ type: Bootstrap5CheckboxesComponent,
416
+ deps: null,
417
+ target: i0.ɵɵFactoryTarget.Component
418
+ });
419
+ }
420
+ static {
421
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
422
+ minVersion: "17.0.0",
423
+ version: "22.2.3",
424
+ type: Bootstrap5CheckboxesComponent,
425
+ isStandalone: false,
426
+ selector: "bootstrap5-checkboxes-widget",
427
+ usesInheritance: true,
428
+ ngImport: i0,
429
+ template: `
358
430
  @if (options?.title) {
359
431
  <label
360
432
  [class]="options?.labelHtmlClass || ''"
@@ -433,15 +505,24 @@ class Bootstrap5CheckboxesComponent extends CheckboxesComponent {
433
505
  </div>
434
506
  }
435
507
  </div>
436
- }`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.Eager }); }
437
- }
438
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5CheckboxesComponent, decorators: [{
439
- type: Component,
440
- args: [{
441
- selector: 'bootstrap5-checkboxes-widget',
442
- changeDetection: ChangeDetectionStrategy.Eager,
443
- standalone: false,
444
- template: `
508
+ }`,
509
+ isInline: true,
510
+ changeDetection: i0.ChangeDetectionStrategy.Eager
511
+ });
512
+ }
513
+ };
514
+ i0.ɵɵngDeclareClassMetadata({
515
+ minVersion: "12.0.0",
516
+ version: "22.2.3",
517
+ ngImport: i0,
518
+ type: Bootstrap5CheckboxesComponent,
519
+ decorators: [{
520
+ type: Component,
521
+ args: [{
522
+ selector: "bootstrap5-checkboxes-widget",
523
+ changeDetection: ChangeDetectionStrategy.Eager,
524
+ standalone: false,
525
+ template: `
445
526
  @if (options?.title) {
446
527
  <label
447
528
  [class]="options?.labelHtmlClass || ''"
@@ -520,17 +601,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
520
601
  </div>
521
602
  }
522
603
  </div>
523
- }`,
524
- }]
525
- }] });
526
-
527
- /**
528
- * Siblings throughout: Bootstrap 5 button sets use .btn-check, which is a
529
- * sibling input too.
530
- */
531
- class Bootstrap5RadiosComponent extends RadiosComponent {
532
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5RadiosComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
533
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: Bootstrap5RadiosComponent, isStandalone: false, selector: "bootstrap5-radios-widget", usesInheritance: true, ngImport: i0, template: `
604
+ }`
605
+ }]
606
+ }]
607
+ });
608
+ var Bootstrap5RadiosComponent = class Bootstrap5RadiosComponent extends RadiosComponent {
609
+ static {
610
+ this.ɵfac = i0.ɵɵngDeclareFactory({
611
+ minVersion: "12.0.0",
612
+ version: "22.2.3",
613
+ ngImport: i0,
614
+ type: Bootstrap5RadiosComponent,
615
+ deps: null,
616
+ target: i0.ɵɵFactoryTarget.Component
617
+ });
618
+ }
619
+ static {
620
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
621
+ minVersion: "17.0.0",
622
+ version: "22.2.3",
623
+ type: Bootstrap5RadiosComponent,
624
+ isStandalone: false,
625
+ selector: "bootstrap5-radios-widget",
626
+ usesInheritance: true,
627
+ ngImport: i0,
628
+ template: `
534
629
  @if (options?.title) {
535
630
  <label
536
631
  [attr.for]="'control' + layoutNode?._id"
@@ -616,15 +711,24 @@ class Bootstrap5RadiosComponent extends RadiosComponent {
616
711
  </div>
617
712
  }
618
713
  </div>
619
- }`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.Eager }); }
620
- }
621
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5RadiosComponent, decorators: [{
622
- type: Component,
623
- args: [{
624
- selector: 'bootstrap5-radios-widget',
625
- changeDetection: ChangeDetectionStrategy.Eager,
626
- standalone: false,
627
- template: `
714
+ }`,
715
+ isInline: true,
716
+ changeDetection: i0.ChangeDetectionStrategy.Eager
717
+ });
718
+ }
719
+ };
720
+ i0.ɵɵngDeclareClassMetadata({
721
+ minVersion: "12.0.0",
722
+ version: "22.2.3",
723
+ ngImport: i0,
724
+ type: Bootstrap5RadiosComponent,
725
+ decorators: [{
726
+ type: Component,
727
+ args: [{
728
+ selector: "bootstrap5-radios-widget",
729
+ changeDetection: ChangeDetectionStrategy.Eager,
730
+ standalone: false,
731
+ template: `
628
732
  @if (options?.title) {
629
733
  <label
630
734
  [attr.for]="'control' + layoutNode?._id"
@@ -710,95 +814,151 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
710
814
  </div>
711
815
  }
712
816
  </div>
713
- }`,
714
- }]
715
- }] });
716
-
717
- // Bootstrap 5 Framework
718
- // https://github.com/ng-bootstrap/ng-bootstrap
719
- class Bootstrap5Framework extends Framework {
720
- constructor() {
721
- super(...arguments);
722
- this.name = 'bootstrap-5';
723
- this.framework = Bootstrap5FrameworkComponent;
724
- this.widgets = {
725
- 'checkbox': Bootstrap5CheckboxComponent,
726
- 'checkboxes': Bootstrap5CheckboxesComponent,
727
- 'radios': Bootstrap5RadiosComponent,
728
- };
729
- this.stylesheets = [
730
- '//cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css'
731
- ];
732
- // Bootstrap 5 dropped jQuery, and the bundle build already contains Popper,
733
- // so this is one script where Bootstrap 4 needed three.
734
- this.scripts = [
735
- '//cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js',
736
- ];
737
- }
738
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5Framework, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
739
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5Framework }); }
740
- }
741
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5Framework, decorators: [{
742
- type: Injectable
743
- }] });
744
-
817
+ }`
818
+ }]
819
+ }]
820
+ });
821
+ var Bootstrap5Framework = class Bootstrap5Framework extends Framework {
822
+ constructor() {
823
+ super(...arguments);
824
+ this.name = "bootstrap-5";
825
+ this.framework = Bootstrap5FrameworkComponent;
826
+ this.widgets = {
827
+ "checkbox": Bootstrap5CheckboxComponent,
828
+ "checkboxes": Bootstrap5CheckboxesComponent,
829
+ "radios": Bootstrap5RadiosComponent
830
+ };
831
+ this.stylesheets = ["//cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css"];
832
+ this.scripts = ["//cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"];
833
+ }
834
+ static {
835
+ this.ɵfac = i0.ɵɵngDeclareFactory({
836
+ minVersion: "12.0.0",
837
+ version: "22.2.3",
838
+ ngImport: i0,
839
+ type: Bootstrap5Framework,
840
+ deps: null,
841
+ target: i0.ɵɵFactoryTarget.Injectable
842
+ });
843
+ }
844
+ static {
845
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
846
+ minVersion: "12.0.0",
847
+ version: "22.2.3",
848
+ ngImport: i0,
849
+ type: Bootstrap5Framework
850
+ });
851
+ }
852
+ };
853
+ i0.ɵɵngDeclareClassMetadata({
854
+ minVersion: "12.0.0",
855
+ version: "22.2.3",
856
+ ngImport: i0,
857
+ type: Bootstrap5Framework,
858
+ decorators: [{ type: Injectable }]
859
+ });
745
860
  const BOOTSTRAP5_FRAMEWORK_COMPONENTS = [
746
- Bootstrap5CheckboxComponent,
747
- Bootstrap5CheckboxesComponent,
748
- Bootstrap5RadiosComponent,
861
+ Bootstrap5CheckboxComponent,
862
+ Bootstrap5CheckboxesComponent,
863
+ Bootstrap5RadiosComponent
749
864
  ];
750
-
751
- class Bootstrap5FrameworkModule {
752
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5FrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
753
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5FrameworkModule, declarations: [Bootstrap5FrameworkComponent, Bootstrap5CheckboxComponent, Bootstrap5CheckboxesComponent, Bootstrap5RadiosComponent], imports: [JsonSchemaFormModule,
754
- CommonModule,
755
- ReactiveFormsModule,
756
- WidgetLibraryModule], exports: [JsonSchemaFormModule,
757
- Bootstrap5FrameworkComponent, Bootstrap5CheckboxComponent, Bootstrap5CheckboxesComponent, Bootstrap5RadiosComponent] }); }
758
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5FrameworkModule, providers: [
759
- JsonSchemaFormService,
760
- FrameworkLibraryService,
761
- WidgetLibraryService,
762
- { provide: Framework, useClass: Bootstrap5Framework, multi: true },
763
- ], imports: [JsonSchemaFormModule,
764
- CommonModule,
765
- ReactiveFormsModule,
766
- WidgetLibraryModule, JsonSchemaFormModule] }); }
767
- }
768
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Bootstrap5FrameworkModule, decorators: [{
769
- type: NgModule,
770
- args: [{
771
- imports: [
772
- JsonSchemaFormModule,
773
- CommonModule,
774
- ReactiveFormsModule,
775
- WidgetLibraryModule,
776
- ],
777
- declarations: [
778
- Bootstrap5FrameworkComponent,
779
- ...BOOTSTRAP5_FRAMEWORK_COMPONENTS,
780
- ],
781
- exports: [
782
- JsonSchemaFormModule,
783
- Bootstrap5FrameworkComponent,
784
- ...BOOTSTRAP5_FRAMEWORK_COMPONENTS,
785
- ],
786
- providers: [
787
- JsonSchemaFormService,
788
- FrameworkLibraryService,
789
- WidgetLibraryService,
790
- { provide: Framework, useClass: Bootstrap5Framework, multi: true },
791
- ]
792
- }]
793
- }] });
794
-
795
- /**
796
- * @module \@ajsf/bootstrap5
797
- */
798
-
799
- /**
800
- * Generated bundle index. Do not edit.
801
- */
802
-
865
+ var Bootstrap5FrameworkModule = class Bootstrap5FrameworkModule {
866
+ static {
867
+ this.ɵfac = i0.ɵɵngDeclareFactory({
868
+ minVersion: "12.0.0",
869
+ version: "22.2.3",
870
+ ngImport: i0,
871
+ type: Bootstrap5FrameworkModule,
872
+ deps: [],
873
+ target: i0.ɵɵFactoryTarget.NgModule
874
+ });
875
+ }
876
+ static {
877
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
878
+ minVersion: "14.0.0",
879
+ version: "22.2.3",
880
+ ngImport: i0,
881
+ type: Bootstrap5FrameworkModule,
882
+ declarations: [
883
+ Bootstrap5FrameworkComponent,
884
+ Bootstrap5CheckboxComponent,
885
+ Bootstrap5CheckboxesComponent,
886
+ Bootstrap5RadiosComponent
887
+ ],
888
+ imports: [
889
+ JsonSchemaFormModule,
890
+ CommonModule,
891
+ ReactiveFormsModule,
892
+ WidgetLibraryModule
893
+ ],
894
+ exports: [
895
+ JsonSchemaFormModule,
896
+ Bootstrap5FrameworkComponent,
897
+ Bootstrap5CheckboxComponent,
898
+ Bootstrap5CheckboxesComponent,
899
+ Bootstrap5RadiosComponent
900
+ ]
901
+ });
902
+ }
903
+ static {
904
+ this.ɵinj = i0.ɵɵngDeclareInjector({
905
+ minVersion: "12.0.0",
906
+ version: "22.2.3",
907
+ ngImport: i0,
908
+ type: Bootstrap5FrameworkModule,
909
+ providers: [
910
+ JsonSchemaFormService,
911
+ FrameworkLibraryService,
912
+ WidgetLibraryService,
913
+ {
914
+ provide: Framework,
915
+ useClass: Bootstrap5Framework,
916
+ multi: true
917
+ }
918
+ ],
919
+ imports: [
920
+ JsonSchemaFormModule,
921
+ CommonModule,
922
+ ReactiveFormsModule,
923
+ WidgetLibraryModule,
924
+ JsonSchemaFormModule
925
+ ]
926
+ });
927
+ }
928
+ };
929
+ i0.ɵɵngDeclareClassMetadata({
930
+ minVersion: "12.0.0",
931
+ version: "22.2.3",
932
+ ngImport: i0,
933
+ type: Bootstrap5FrameworkModule,
934
+ decorators: [{
935
+ type: NgModule,
936
+ args: [{
937
+ imports: [
938
+ JsonSchemaFormModule,
939
+ CommonModule,
940
+ ReactiveFormsModule,
941
+ WidgetLibraryModule
942
+ ],
943
+ declarations: [Bootstrap5FrameworkComponent, ...BOOTSTRAP5_FRAMEWORK_COMPONENTS],
944
+ exports: [
945
+ JsonSchemaFormModule,
946
+ Bootstrap5FrameworkComponent,
947
+ ...BOOTSTRAP5_FRAMEWORK_COMPONENTS
948
+ ],
949
+ providers: [
950
+ JsonSchemaFormService,
951
+ FrameworkLibraryService,
952
+ WidgetLibraryService,
953
+ {
954
+ provide: Framework,
955
+ useClass: Bootstrap5Framework,
956
+ multi: true
957
+ }
958
+ ]
959
+ }]
960
+ }]
961
+ });
803
962
  export { BOOTSTRAP5_FRAMEWORK_COMPONENTS, Bootstrap5CheckboxComponent, Bootstrap5CheckboxesComponent, Bootstrap5Framework, Bootstrap5FrameworkComponent, Bootstrap5FrameworkModule, Bootstrap5RadiosComponent };
804
- //# sourceMappingURL=ajsf-bootstrap5.mjs.map
963
+
964
+ //# sourceMappingURL=ajsf-bootstrap5.mjs.map