commons-shared-web-ui 0.0.54 → 0.0.55
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/.claude/settings.local.json +10 -0
- package/documentation/alert.md +123 -0
- package/documentation/button-dropdown.md +126 -0
- package/documentation/button.md +184 -0
- package/documentation/cards-usage-guidelines.md +131 -0
- package/documentation/configurable-form.md +605 -0
- package/documentation/confirmation-modal.md +250 -0
- package/documentation/filter-sidebar.md +178 -0
- package/documentation/filter-table-selector.md +228 -0
- package/documentation/form-builder.md +599 -0
- package/documentation/form-components.md +384 -0
- package/documentation/form-field-configuration.md +250 -0
- package/documentation/nav.md +427 -0
- package/documentation/pagination.md +181 -0
- package/documentation/side-nav-documentation.md +169 -0
- package/documentation/smart-form.md +2765 -0
- package/documentation/smart-table.md +1221 -0
- package/documentation/snackbar.md +118 -0
- package/documentation/style-externalization.md +88 -0
- package/documentation/summary-card.md +279 -0
- package/documentation/table-column-configuration.md +221 -0
- package/documentation/time-picker.md +274 -0
- package/ng-package.json +30 -0
- package/package.json +53 -34
- package/src/lib/modules/alert/alert.models.ts +6 -0
- package/src/lib/modules/alert/alert.module.ts +16 -0
- package/src/lib/modules/alert/components/alert/alert.component.html +27 -0
- package/src/lib/modules/alert/components/alert/alert.component.scss +92 -0
- package/src/lib/modules/alert/components/alert/alert.component.ts +81 -0
- package/src/lib/modules/button/button.models.ts +13 -0
- package/src/lib/modules/button/button.module.ts +16 -0
- package/src/lib/modules/button/components/button/button.component.html +22 -0
- package/src/lib/modules/button/components/button/button.component.scss +88 -0
- package/src/lib/modules/button/components/button/button.component.ts +67 -0
- package/src/lib/modules/button-dropdown/button-dropdown.models.ts +26 -0
- package/src/lib/modules/button-dropdown/button-dropdown.module.ts +22 -0
- package/src/lib/modules/button-dropdown/button-dropdown.theme.scss +87 -0
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.html +41 -0
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.scss +135 -0
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.ts +160 -0
- package/src/lib/modules/configurable-form/component/configurable-form.component.html +294 -0
- package/src/lib/modules/configurable-form/component/configurable-form.component.scss +503 -0
- package/src/lib/modules/configurable-form/component/configurable-form.component.ts +628 -0
- package/src/lib/modules/configurable-form/configurable-form.examples.ts +154 -0
- package/src/lib/modules/configurable-form/configurable-form.model.ts +131 -0
- package/src/lib/modules/configurable-form/configurable-form.module.ts +19 -0
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.html +77 -0
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.scss +395 -0
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.ts +266 -0
- package/src/lib/modules/confirmation-modal/confirmation-modal.models.ts +71 -0
- package/src/lib/modules/confirmation-modal/confirmation-modal.module.ts +20 -0
- package/src/lib/modules/filter/components/filter/filter.component.html +131 -0
- package/src/lib/modules/filter/components/filter/filter.component.scss +245 -0
- package/src/lib/modules/filter/components/filter/filter.component.ts +216 -0
- package/src/lib/modules/filter/filter.models.ts +88 -0
- package/src/lib/modules/filter/filter.module.ts +24 -0
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html +112 -0
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss +186 -0
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts +163 -0
- package/src/lib/modules/filter-sidebar/filter-sidebar.models.ts +95 -0
- package/src/lib/modules/filter-sidebar/filter-sidebar.module.ts +24 -0
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.html +73 -0
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.scss +321 -0
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.ts +361 -0
- package/src/lib/modules/filter-table-selector/filter-table-selector.models.ts +91 -0
- package/src/lib/modules/filter-table-selector/filter-table-selector.module.ts +22 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.html +63 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.scss +496 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.ts +445 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.html +75 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.scss +210 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.ts +55 -0
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.html +25 -0
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.scss +82 -0
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.ts +95 -0
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.html +20 -0
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.scss +37 -0
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.ts +94 -0
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.html +46 -0
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.scss +102 -0
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.ts +50 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.html +35 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.scss +67 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.ts +34 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.html +68 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.scss +113 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.ts +74 -0
- package/src/lib/modules/form-builder/configs/field-type-schema.map.ts +533 -0
- package/src/lib/modules/form-builder/form-builder.module.ts +36 -0
- package/src/lib/modules/form-builder/index.ts +9 -0
- package/src/lib/modules/form-builder/models/builder.models.ts +7 -0
- package/src/lib/modules/form-builder/models/field-configurator.models.ts +38 -0
- package/src/lib/modules/form-builder/models/field-selection.models.ts +51 -0
- package/src/lib/modules/form-builder/services/field-configurator.service.ts +258 -0
- package/src/lib/modules/form-builder/services/field-selection.service.ts +299 -0
- package/src/lib/modules/form-builder/services/form-schema-tree.service.ts +670 -0
- package/src/lib/modules/form-builder/tokens/builder.tokens.ts +10 -0
- package/src/lib/modules/form-builder/utils/constants.ts +43 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.html +29 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.scss +111 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.ts +207 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.models.ts +35 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.html +42 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.scss +115 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.ts +267 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.models.ts +45 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.html +74 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.scss +252 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.ts +377 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.models.ts +53 -0
- package/src/lib/modules/form-components/components/input/input.component.html +51 -0
- package/src/lib/modules/form-components/components/input/input.component.scss +128 -0
- package/src/lib/modules/form-components/components/input/input.component.ts +250 -0
- package/src/lib/modules/form-components/components/input/input.models.ts +55 -0
- package/src/lib/modules/form-components/components/radio/radio.component.html +22 -0
- package/src/lib/modules/form-components/components/radio/radio.component.scss +107 -0
- package/src/lib/modules/form-components/components/radio/radio.component.ts +181 -0
- package/src/lib/modules/form-components/components/radio/radio.models.ts +39 -0
- package/src/lib/modules/form-components/components/search/search.component.html +15 -0
- package/src/lib/modules/form-components/components/search/search.component.scss +87 -0
- package/src/lib/modules/form-components/components/search/search.component.ts +213 -0
- package/src/lib/modules/form-components/components/search/search.models.ts +40 -0
- package/src/lib/modules/form-components/components/toggle/toggle.component.html +15 -0
- package/src/lib/modules/form-components/components/toggle/toggle.component.scss +81 -0
- package/src/lib/modules/form-components/components/toggle/toggle.component.ts +166 -0
- package/src/lib/modules/form-components/components/toggle/toggle.models.ts +27 -0
- package/src/lib/modules/form-components/directives/click-outside.directive.ts +22 -0
- package/src/lib/modules/form-components/form-components.module.ts +42 -0
- package/src/lib/modules/form-field-configuration/components/_ffc-controls.scss +89 -0
- package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.html +68 -0
- package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.scss +73 -0
- package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.ts +34 -0
- package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.html +78 -0
- package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.scss +83 -0
- package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.ts +94 -0
- package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.html +38 -0
- package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.scss +42 -0
- package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.ts +92 -0
- package/src/lib/modules/form-field-configuration/form-field-configuration.module.ts +23 -0
- package/src/lib/modules/form-field-configuration/index.ts +7 -0
- package/src/lib/modules/form-field-configuration/models/field-configuration.models.ts +62 -0
- package/src/lib/modules/form-field-configuration/services/config-schema-tree.service.ts +159 -0
- package/src/lib/modules/form-field-configuration/services/field-configuration.service.ts +228 -0
- package/src/lib/modules/material/material.module.ts +94 -0
- package/src/lib/modules/nav/components/nav/nav.component.html +34 -0
- package/src/lib/modules/nav/components/nav/nav.component.scss +171 -0
- package/src/lib/modules/nav/components/nav/nav.component.ts +82 -0
- package/src/lib/modules/nav/nav.models.ts +31 -0
- package/src/lib/modules/nav/nav.module.ts +17 -0
- package/src/lib/modules/pagination/components/pagination/pagination.component.html +52 -0
- package/src/lib/modules/pagination/components/pagination/pagination.component.scss +155 -0
- package/src/lib/modules/pagination/components/pagination/pagination.component.ts +109 -0
- package/src/lib/modules/pagination/pagination.module.ts +17 -0
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.html +56 -0
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.scss +342 -0
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.ts +135 -0
- package/src/lib/modules/side-nav/side-nav.models.ts +38 -0
- package/src/lib/modules/side-nav/side-nav.module.ts +16 -0
- package/src/lib/modules/smart-form/components/form-field/form-field.component.html +1330 -0
- package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +2112 -0
- package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +3006 -0
- package/src/lib/modules/smart-form/components/form-section/form-section.component.html +65 -0
- package/src/lib/modules/smart-form/components/form-section/form-section.component.scss +209 -0
- package/src/lib/modules/smart-form/components/form-section/form-section.component.ts +131 -0
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.html +253 -0
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.scss +689 -0
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.ts +1131 -0
- package/src/lib/modules/smart-form/index.ts +10 -0
- package/src/lib/modules/smart-form/models/form-schema.model.ts +793 -0
- package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +21 -0
- package/src/lib/modules/smart-form/services/expression.service.ts +75 -0
- package/src/lib/modules/smart-form/services/smart-form-controller.service.ts +67 -0
- package/src/lib/modules/smart-form/smart-form.examples.ts +1324 -0
- package/src/lib/modules/smart-form/smart-form.module.ts +38 -0
- package/src/lib/modules/smart-form/utils/translation.utils.ts +82 -0
- package/src/lib/modules/smart-form/utils/trusted-url.pipe.ts +25 -0
- package/src/lib/modules/smart-form/utils/validation.utils.ts +98 -0
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.html +283 -0
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.scss +685 -0
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.ts +1128 -0
- package/src/lib/modules/smart-table/models/table-config.model.ts +213 -0
- package/src/lib/modules/smart-table/smart-table.module.ts +30 -0
- package/src/lib/modules/smart-table/utils/safe-html.pipe.ts +28 -0
- package/src/lib/modules/smart-table/utils/smart-table.utils.ts +18 -0
- package/src/lib/modules/snackbar/components/snackbar.component.html +41 -0
- package/src/lib/modules/snackbar/components/snackbar.component.scss +99 -0
- package/src/lib/modules/snackbar/components/snackbar.component.ts +18 -0
- package/src/lib/modules/snackbar/models/snackbar.models.ts +10 -0
- package/src/lib/modules/snackbar/services/snackbar.service.ts +40 -0
- package/src/lib/modules/snackbar/snackbar.module.ts +11 -0
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.html +47 -0
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.scss +199 -0
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.ts +126 -0
- package/src/lib/modules/summary-card/summary-card.module.ts +18 -0
- package/src/lib/modules/table-column-configuration/components/_tcc-controls.scss +53 -0
- package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.html +47 -0
- package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.scss +50 -0
- package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.ts +33 -0
- package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.html +30 -0
- package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.scss +36 -0
- package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.ts +78 -0
- package/src/lib/modules/table-column-configuration/index.ts +5 -0
- package/src/lib/modules/table-column-configuration/models/table-column-configuration.models.ts +20 -0
- package/src/lib/modules/table-column-configuration/services/table-column-configuration.service.ts +77 -0
- package/src/lib/modules/table-column-configuration/table-column-configuration.module.ts +21 -0
- package/src/lib/modules/time-picker/components/time-picker/time-picker.component.html +37 -0
- package/src/lib/modules/time-picker/components/time-picker/time-picker.component.scss +102 -0
- package/src/lib/modules/time-picker/components/time-picker/time-picker.component.ts +178 -0
- package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.html +78 -0
- package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.scss +226 -0
- package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.ts +595 -0
- package/src/lib/modules/time-picker/models/time-picker.models.ts +49 -0
- package/src/lib/modules/time-picker/time-picker.module.ts +23 -0
- package/src/lib/modules/time-picker/time-picker.theme.scss +87 -0
- package/src/lib/shared-ui.module.ts +55 -0
- package/src/lib/styles/global.scss +10 -0
- package/src/lib/utils/constants.ts +11 -0
- package/src/lib/utils/storage.utils.ts +37 -0
- package/src/lib/utils/string.utils.ts +23 -0
- package/src/lib/utils/translation.utils.ts +87 -0
- package/src/public-api.ts +127 -0
- package/tsconfig.lib.json +15 -0
- package/fesm2022/commons-shared-web-ui.mjs +0 -14823
- package/fesm2022/commons-shared-web-ui.mjs.map +0 -1
- package/index.d.ts +0 -4679
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<div class="form-section-container">
|
|
2
|
+
<h3 class="section-label" *ngIf="config.label && !config.allowMulti">{{ config.label }}</h3>
|
|
3
|
+
|
|
4
|
+
<!-- ══ Repeater (allowMulti) ══════════════════════════════════════════════ -->
|
|
5
|
+
<ng-container *ngIf="config.allowMulti">
|
|
6
|
+
<h3 class="section-label">{{ config.label }}</h3>
|
|
7
|
+
|
|
8
|
+
<div *ngFor="let instanceGroup of instanceGroups; let i = index"
|
|
9
|
+
class="accordion-instance"
|
|
10
|
+
[class.is-expanded]="isExpanded(i)">
|
|
11
|
+
|
|
12
|
+
<!-- Accordion header (always visible) -->
|
|
13
|
+
<div class="accordion-header" (click)="toggleInstance(i)" role="button" [attr.aria-expanded]="isExpanded(i)">
|
|
14
|
+
<div class="accordion-header-left">
|
|
15
|
+
<span class="instance-badge">{{ i + 1 }}</span>
|
|
16
|
+
<span class="instance-title">{{ config.label }} #{{ i + 1 }}</span>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="accordion-header-right">
|
|
19
|
+
<button type="button" class="accordion-remove-btn"
|
|
20
|
+
*ngIf="instanceGroups.length > 1"
|
|
21
|
+
(click)="$event.stopPropagation(); removeInstance(i)"
|
|
22
|
+
aria-label="Remove instance">
|
|
23
|
+
<mat-icon>delete_outline</mat-icon>
|
|
24
|
+
</button>
|
|
25
|
+
<mat-icon class="accordion-chevron">
|
|
26
|
+
{{ isExpanded(i) ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}
|
|
27
|
+
</mat-icon>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<!-- Accordion body (always mounted so form controls survive collapse) -->
|
|
32
|
+
<div class="accordion-body" [hidden]="!isExpanded(i)">
|
|
33
|
+
<div class="section-fields sf-grid">
|
|
34
|
+
<ng-container *ngFor="let field of config.children">
|
|
35
|
+
<div class="sf-col" [style.gridColumn]="'span ' + (field.colSpan || 12)"
|
|
36
|
+
*ngIf="field.isEnabled !== false">
|
|
37
|
+
<lib-form-field [config]="field" [controller]="controller" [formGroup]="instanceGroup"
|
|
38
|
+
[siblingFormArray]="repeaterFormArray" [siblingIndex]="i">
|
|
39
|
+
</lib-form-field>
|
|
40
|
+
</div>
|
|
41
|
+
</ng-container>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<!-- Full-width dashed Add button -->
|
|
47
|
+
<button type="button" class="btn-add-section" (click)="addInstance()">
|
|
48
|
+
<mat-icon>add</mat-icon> Add {{ config.label }}
|
|
49
|
+
</button>
|
|
50
|
+
</ng-container>
|
|
51
|
+
|
|
52
|
+
<!-- ══ Non-repeater (single instance) ════════════════════════════════════ -->
|
|
53
|
+
<ng-container *ngIf="!config.allowMulti">
|
|
54
|
+
<div class="section-fields sf-grid">
|
|
55
|
+
<ng-container *ngFor="let field of config.children">
|
|
56
|
+
<div class="sf-col" [style.gridColumn]="'span ' + (field.colSpan || 12)"
|
|
57
|
+
*ngIf="field.isEnabled !== false">
|
|
58
|
+
<lib-form-field [config]="field" [controller]="controller" [formGroup]="flatFormGroup">
|
|
59
|
+
</lib-form-field>
|
|
60
|
+
</div>
|
|
61
|
+
</ng-container>
|
|
62
|
+
</div>
|
|
63
|
+
</ng-container>
|
|
64
|
+
|
|
65
|
+
</div>
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
// Form Section — modern card layout with elegant section headers
|
|
3
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
|
|
5
|
+
@keyframes section-card-in {
|
|
6
|
+
from { opacity: 0; margin-top: 10px; }
|
|
7
|
+
to { opacity: 1; margin-top: 0; }
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.form-section-container {
|
|
11
|
+
background: #ffffff;
|
|
12
|
+
border: 1px solid #EAECF0;
|
|
13
|
+
border-radius: 14px;
|
|
14
|
+
padding: 22px 24px 24px;
|
|
15
|
+
margin-bottom: 14px;
|
|
16
|
+
box-shadow:
|
|
17
|
+
0 1px 2px rgba(0,0,0,.04),
|
|
18
|
+
0 4px 12px rgba(99, 102, 241, .04);
|
|
19
|
+
animation: section-card-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
|
|
20
|
+
transition: box-shadow 0.2s ease;
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
box-shadow:
|
|
24
|
+
0 1px 2px rgba(0,0,0,.04),
|
|
25
|
+
0 6px 20px rgba(99, 102, 241, .08);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:last-child { margin-bottom: 0; }
|
|
29
|
+
|
|
30
|
+
// ── Section heading ─────────────────────────────────────────────────────────
|
|
31
|
+
.section-label {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 10px;
|
|
35
|
+
font-size: 0.9375rem;
|
|
36
|
+
font-weight: 700;
|
|
37
|
+
color: #111827;
|
|
38
|
+
margin: 0 0 20px 0;
|
|
39
|
+
padding-bottom: 14px;
|
|
40
|
+
border-bottom: 1px solid #F3F4F6;
|
|
41
|
+
letter-spacing: -.01em;
|
|
42
|
+
|
|
43
|
+
// Coloured square accent dot
|
|
44
|
+
&::before {
|
|
45
|
+
content: '';
|
|
46
|
+
display: inline-block;
|
|
47
|
+
width: 4px;
|
|
48
|
+
height: 18px;
|
|
49
|
+
border-radius: 4px;
|
|
50
|
+
background: linear-gradient(180deg, #6366F1 0%, #8B5CF6 100%);
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ── 12-column grid ──────────────────────────────────────────────────────────
|
|
56
|
+
.section-fields {
|
|
57
|
+
&.sf-grid {
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-columns: repeat(12, 1fr);
|
|
60
|
+
gap: 18px 20px;
|
|
61
|
+
align-items: start;
|
|
62
|
+
|
|
63
|
+
@media (max-width: 640px) {
|
|
64
|
+
grid-template-columns: 1fr;
|
|
65
|
+
.sf-col { grid-column: span 12 !important; }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ── Accordion repeater instance ─────────────────────────────────────────────
|
|
71
|
+
.accordion-instance {
|
|
72
|
+
border: 1px solid #E8EAF0;
|
|
73
|
+
border-radius: 10px;
|
|
74
|
+
margin-bottom: 10px;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
77
|
+
background: #FAFBFF;
|
|
78
|
+
|
|
79
|
+
&:last-of-type { margin-bottom: 0; }
|
|
80
|
+
|
|
81
|
+
&.is-expanded {
|
|
82
|
+
border-color: #C7D2FE;
|
|
83
|
+
box-shadow: 0 0 0 3px rgba(99, 102, 241, .07);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.accordion-header {
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
align-items: center;
|
|
90
|
+
padding: 11px 16px;
|
|
91
|
+
background: #F8F9FF;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
user-select: none;
|
|
94
|
+
transition: background 0.15s ease;
|
|
95
|
+
|
|
96
|
+
&:hover { background: #EEF0FF; }
|
|
97
|
+
|
|
98
|
+
.accordion-header-left {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: 10px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.instance-badge {
|
|
105
|
+
width: 24px;
|
|
106
|
+
height: 24px;
|
|
107
|
+
border-radius: 6px;
|
|
108
|
+
background: linear-gradient(135deg, #6366F1, #8B5CF6);
|
|
109
|
+
color: #ffffff;
|
|
110
|
+
font-size: 0.75rem;
|
|
111
|
+
font-weight: 700;
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
flex-shrink: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.instance-title {
|
|
119
|
+
font-size: 0.8125rem;
|
|
120
|
+
font-weight: 600;
|
|
121
|
+
color: #1F2937;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.accordion-header-right {
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
gap: 6px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.accordion-remove-btn {
|
|
131
|
+
background: none;
|
|
132
|
+
border: none;
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
color: #EF4444;
|
|
135
|
+
padding: 4px 6px;
|
|
136
|
+
border-radius: 6px;
|
|
137
|
+
line-height: 1;
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
141
|
+
|
|
142
|
+
mat-icon {
|
|
143
|
+
font-size: 1.1rem;
|
|
144
|
+
width: 1.1rem;
|
|
145
|
+
height: 1.1rem;
|
|
146
|
+
line-height: 1.1rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&:hover {
|
|
150
|
+
background: #FEE2E2;
|
|
151
|
+
color: #DC2626;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.accordion-chevron {
|
|
156
|
+
font-size: 1.25rem;
|
|
157
|
+
width: 1.25rem;
|
|
158
|
+
height: 1.25rem;
|
|
159
|
+
line-height: 1.25rem;
|
|
160
|
+
color: #6B7280;
|
|
161
|
+
transition: transform 0.2s ease;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.accordion-body {
|
|
166
|
+
padding: 18px 16px;
|
|
167
|
+
background: #ffffff;
|
|
168
|
+
border-top: 1px solid #E8EAF0;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// ── Add button ──────────────────────────────────────────────────────────────
|
|
173
|
+
.btn-add-section {
|
|
174
|
+
display: flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
gap: 7px;
|
|
178
|
+
width: 100%;
|
|
179
|
+
padding: 11px 20px;
|
|
180
|
+
margin-top: 14px;
|
|
181
|
+
background: transparent;
|
|
182
|
+
color: #6366F1;
|
|
183
|
+
border: 1.5px dashed #C7D2FE;
|
|
184
|
+
border-radius: 8px;
|
|
185
|
+
cursor: pointer;
|
|
186
|
+
font-family: inherit;
|
|
187
|
+
font-size: 0.8125rem;
|
|
188
|
+
font-weight: 600;
|
|
189
|
+
transition: all 0.2s ease;
|
|
190
|
+
letter-spacing: .01em;
|
|
191
|
+
|
|
192
|
+
mat-icon {
|
|
193
|
+
font-size: 1.1rem;
|
|
194
|
+
width: 1.1rem;
|
|
195
|
+
height: 1.1rem;
|
|
196
|
+
line-height: 1.1rem;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&:hover {
|
|
200
|
+
background: #EEF2FF;
|
|
201
|
+
border-color: #A5B4FC;
|
|
202
|
+
border-style: solid;
|
|
203
|
+
transform: translateY(-1px);
|
|
204
|
+
box-shadow: 0 2px 8px rgba(99, 102, 241, .12);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&:active { transform: translateY(0); }
|
|
208
|
+
}
|
|
209
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Component, Input, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { SectionConfig, FieldConfig } from '../../models/form-schema.model';
|
|
4
|
+
import { SmartFormController } from '../../services/smart-form-controller.service';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'lib-form-section',
|
|
8
|
+
templateUrl: './form-section.component.html',
|
|
9
|
+
styleUrls: ['./form-section.component.scss'],
|
|
10
|
+
standalone: false
|
|
11
|
+
})
|
|
12
|
+
export class FormSectionComponent implements OnInit, OnDestroy {
|
|
13
|
+
@Input() config!: SectionConfig;
|
|
14
|
+
@Input() controller!: SmartFormController;
|
|
15
|
+
@Input() formGroup!: FormGroup;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* For allowMulti sections: the FormArray registered on the root formGroup.
|
|
19
|
+
* Each element is a FormGroup representing one repeater instance.
|
|
20
|
+
*/
|
|
21
|
+
repeaterFormArray!: FormArray;
|
|
22
|
+
|
|
23
|
+
/** Tracks which accordion panels are open (by index). New instances start expanded. */
|
|
24
|
+
expandedInstances = new Set<number>();
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The key under which the FormArray is registered in the root formGroup.
|
|
28
|
+
* Falls back to config.name or a generated key.
|
|
29
|
+
*/
|
|
30
|
+
get arrayKey(): string {
|
|
31
|
+
return this.config.name || '__repeater__';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
constructor(private fb: FormBuilder) { }
|
|
35
|
+
|
|
36
|
+
ngOnInit(): void {
|
|
37
|
+
if (this.config.allowMulti) {
|
|
38
|
+
this.repeaterFormArray = this.fb.array([]);
|
|
39
|
+
this.formGroup.addControl(this.arrayKey, this.repeaterFormArray);
|
|
40
|
+
// Start with one empty instance
|
|
41
|
+
this.addInstance();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ngOnDestroy(): void {
|
|
46
|
+
if (this.config.allowMulti && this.formGroup.contains(this.arrayKey)) {
|
|
47
|
+
this.formGroup.removeControl(this.arrayKey);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// ── Repeater helpers ──────────────────────────────────────────────────────
|
|
52
|
+
|
|
53
|
+
/** Creates a fresh FormGroup for one repeater instance */
|
|
54
|
+
private createInstanceGroup(): FormGroup {
|
|
55
|
+
return this.fb.group({});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
addInstance(): void {
|
|
59
|
+
const newIndex = this.repeaterFormArray.length;
|
|
60
|
+
// Require the last existing instance to be valid before allowing another — otherwise
|
|
61
|
+
// a user can stack up multiple incomplete entries (e.g. several "Parent Details" rows
|
|
62
|
+
// all missing the required name) with no indication anything is wrong until final submit.
|
|
63
|
+
if (newIndex > 0) {
|
|
64
|
+
const lastGroup = this.repeaterFormArray.at(newIndex - 1) as FormGroup;
|
|
65
|
+
lastGroup.markAllAsTouched();
|
|
66
|
+
if (lastGroup.invalid) {
|
|
67
|
+
this.expandedInstances.clear();
|
|
68
|
+
this.expandedInstances.add(newIndex - 1);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
this.repeaterFormArray.push(this.createInstanceGroup());
|
|
73
|
+
// Collapse all existing panels; expand only the new one
|
|
74
|
+
this.expandedInstances.clear();
|
|
75
|
+
this.expandedInstances.add(newIndex);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
removeInstance(index: number): void {
|
|
79
|
+
if (this.repeaterFormArray.length > 1) {
|
|
80
|
+
this.repeaterFormArray.removeAt(index);
|
|
81
|
+
// Rebuild expanded set to account for shifted indices
|
|
82
|
+
const updated = new Set<number>();
|
|
83
|
+
this.expandedInstances.forEach(i => {
|
|
84
|
+
if (i < index) updated.add(i);
|
|
85
|
+
else if (i > index) updated.add(i - 1);
|
|
86
|
+
});
|
|
87
|
+
this.expandedInstances = updated;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
toggleInstance(index: number): void {
|
|
92
|
+
if (this.expandedInstances.has(index)) {
|
|
93
|
+
this.expandedInstances.delete(index);
|
|
94
|
+
} else {
|
|
95
|
+
this.expandedInstances.add(index);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
isExpanded(index: number): boolean {
|
|
100
|
+
return this.expandedInstances.has(index);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
getInstanceGroup(index: number): FormGroup {
|
|
104
|
+
return this.repeaterFormArray.at(index) as FormGroup;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
get instanceGroups(): FormGroup[] {
|
|
108
|
+
return this.repeaterFormArray.controls as FormGroup[];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ── Non-repeater: flat single FormGroup (root formGroup passed through) ──
|
|
112
|
+
|
|
113
|
+
/** For non-allowMulti sections we simply pass the root formGroup down */
|
|
114
|
+
get flatFormGroup(): FormGroup {
|
|
115
|
+
return this.formGroup;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// ── Collect nested fields for a given child ───────────────────────────────
|
|
119
|
+
/** Flatten a field tree to get all leaf fields (for ROW children etc.) */
|
|
120
|
+
getFlatFields(fields: FieldConfig[]): FieldConfig[] {
|
|
121
|
+
const result: FieldConfig[] = [];
|
|
122
|
+
fields.forEach(f => {
|
|
123
|
+
if (f.type === 'ROW' && f.children) {
|
|
124
|
+
result.push(...this.getFlatFields(f.children));
|
|
125
|
+
} else {
|
|
126
|
+
result.push(f);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
<div class="smart-form-container">
|
|
2
|
+
|
|
3
|
+
<!-- ══ Skeleton loader ════════════════════════════════════════════════════ -->
|
|
4
|
+
<div class="smart-form-skeleton" *ngIf="!isFormReady" aria-hidden="true">
|
|
5
|
+
|
|
6
|
+
<!-- Title + description -->
|
|
7
|
+
<div class="skel-header">
|
|
8
|
+
<div class="skel-block skel-title" style="--sd: 0s"></div>
|
|
9
|
+
<div class="skel-block skel-desc" style="--sd: 0.07s"></div>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<!-- Section 1 — two full-width fields -->
|
|
13
|
+
<div class="skel-section">
|
|
14
|
+
<div class="skel-block skel-section-label" style="--sd: 0.1s; width: 32%"></div>
|
|
15
|
+
<div class="skel-fields skel-fields--two">
|
|
16
|
+
<div class="skel-field">
|
|
17
|
+
<div class="skel-block skel-label" style="--sd: 0.13s; width: 55%"></div>
|
|
18
|
+
<div class="skel-block skel-input" style="--sd: 0.15s"></div>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="skel-field">
|
|
21
|
+
<div class="skel-block skel-label" style="--sd: 0.16s; width: 45%"></div>
|
|
22
|
+
<div class="skel-block skel-input" style="--sd: 0.18s"></div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="skel-field skel-field--full">
|
|
25
|
+
<div class="skel-block skel-label" style="--sd: 0.2s; width: 38%"></div>
|
|
26
|
+
<div class="skel-block skel-input skel-input--textarea" style="--sd: 0.22s"></div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<!-- Section 2 — three columns -->
|
|
32
|
+
<div class="skel-section">
|
|
33
|
+
<div class="skel-block skel-section-label" style="--sd: 0.25s; width: 24%"></div>
|
|
34
|
+
<div class="skel-fields skel-fields--three">
|
|
35
|
+
<div class="skel-field">
|
|
36
|
+
<div class="skel-block skel-label" style="--sd: 0.28s; width: 60%"></div>
|
|
37
|
+
<div class="skel-block skel-input" style="--sd: 0.30s"></div>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="skel-field">
|
|
40
|
+
<div class="skel-block skel-label" style="--sd: 0.31s; width: 50%"></div>
|
|
41
|
+
<div class="skel-block skel-input" style="--sd: 0.33s"></div>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="skel-field">
|
|
44
|
+
<div class="skel-block skel-label" style="--sd: 0.34s; width: 65%"></div>
|
|
45
|
+
<div class="skel-block skel-input" style="--sd: 0.36s"></div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<!-- Section 3 — two columns + chip row -->
|
|
51
|
+
<div class="skel-section">
|
|
52
|
+
<div class="skel-block skel-section-label" style="--sd: 0.38s; width: 28%"></div>
|
|
53
|
+
<div class="skel-fields skel-fields--two">
|
|
54
|
+
<div class="skel-field">
|
|
55
|
+
<div class="skel-block skel-label" style="--sd: 0.40s; width: 48%"></div>
|
|
56
|
+
<div class="skel-block skel-input" style="--sd: 0.42s"></div>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="skel-field">
|
|
59
|
+
<div class="skel-block skel-label" style="--sd: 0.43s; width: 55%"></div>
|
|
60
|
+
<div class="skel-block skel-input" style="--sd: 0.45s"></div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<div class="skel-chips">
|
|
64
|
+
<div class="skel-block skel-chip" style="--sd: 0.47s; width: 72px"></div>
|
|
65
|
+
<div class="skel-block skel-chip" style="--sd: 0.49s; width: 96px"></div>
|
|
66
|
+
<div class="skel-block skel-chip" style="--sd: 0.51s; width: 80px"></div>
|
|
67
|
+
<div class="skel-block skel-chip" style="--sd: 0.53s; width: 64px"></div>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<!-- Action bar -->
|
|
72
|
+
<div class="skel-actions">
|
|
73
|
+
<div class="skel-block skel-btn" style="--sd: 0.55s; width: 88px"></div>
|
|
74
|
+
<div class="skel-block skel-btn skel-btn--primary" style="--sd: 0.58s; width: 120px"></div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<!-- ══════════════════════════════════════════════════════════════════════
|
|
79
|
+
SECTION STEPPER layout — stepper nav card + per-step form panels.
|
|
80
|
+
Rendered when formSchema.sectionStepper === true.
|
|
81
|
+
The nav and each step section are separate cards (no outer wrapper card).
|
|
82
|
+
══════════════════════════════════════════════════════════════════════ -->
|
|
83
|
+
<ng-container *ngIf="formSchema && isFormReady && isSectionStepper">
|
|
84
|
+
|
|
85
|
+
<!-- Horizontal stepper nav card — hidden for a single step (nothing to step between) -->
|
|
86
|
+
<div class="section-stepper-nav" *ngIf="sectionSteps.length > 1">
|
|
87
|
+
<div class="section-stepper-track">
|
|
88
|
+
<div
|
|
89
|
+
*ngFor="let step of sectionSteps; let i = index"
|
|
90
|
+
class="section-stepper-step"
|
|
91
|
+
[class.ss-active]="i === currentSectionStep"
|
|
92
|
+
[class.ss-completed]="i < currentSectionStep && stepValidationStates[i] !== 'warning'"
|
|
93
|
+
[class.ss-warning]="i < currentSectionStep && stepValidationStates[i] === 'warning'"
|
|
94
|
+
[attr.data-tooltip]="step.sectionConfig?.label || 'Step ' + (i + 1)"
|
|
95
|
+
(click)="goToSectionStep(i)">
|
|
96
|
+
|
|
97
|
+
<!-- Connector line — left side (hidden for first step) -->
|
|
98
|
+
<div class="ss-connector ss-connector--left" *ngIf="i > 0"></div>
|
|
99
|
+
|
|
100
|
+
<!-- Step badge -->
|
|
101
|
+
<div class="ss-badge">
|
|
102
|
+
<!-- Green checkmark: visited and valid -->
|
|
103
|
+
<svg *ngIf="i < currentSectionStep && stepValidationStates[i] !== 'warning'"
|
|
104
|
+
width="13" height="13" viewBox="0 0 24 24"
|
|
105
|
+
fill="none" stroke="currentColor" stroke-width="3"
|
|
106
|
+
stroke-linecap="round" stroke-linejoin="round">
|
|
107
|
+
<polyline points="20 6 9 17 4 12"></polyline>
|
|
108
|
+
</svg>
|
|
109
|
+
<!-- Warning: bold ! is the most visible option inside a 38px circle badge -->
|
|
110
|
+
<span *ngIf="i < currentSectionStep && stepValidationStates[i] === 'warning'"
|
|
111
|
+
class="ss-warning-mark">!</span>
|
|
112
|
+
<!-- Number: current or future step -->
|
|
113
|
+
<span *ngIf="i >= currentSectionStep">{{ i + 1 }}</span>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<!-- Step label (truncated; full text revealed by CSS tooltip) -->
|
|
117
|
+
<div class="ss-label" [title]="step.sectionConfig?.label || 'Step ' + (i + 1)">
|
|
118
|
+
{{ step.sectionConfig?.label || 'Step ' + (i + 1) }}
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<!-- Connector line — right side (hidden for last step) -->
|
|
122
|
+
<div class="ss-connector ss-connector--right" *ngIf="i < sectionSteps.length - 1"></div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<!-- Step panels — all mounted, only active one is visible (preserves form data) -->
|
|
128
|
+
<form [formGroup]="formGroup" class="smart-form ss-form">
|
|
129
|
+
<div
|
|
130
|
+
*ngFor="let step of sectionSteps; let i = index"
|
|
131
|
+
class="ss-step-panel"
|
|
132
|
+
[style.display]="i === currentSectionStep ? 'block' : 'none'">
|
|
133
|
+
<lib-form-section
|
|
134
|
+
[config]="getSectionStepConfig(step)"
|
|
135
|
+
[controller]="controller"
|
|
136
|
+
[formGroup]="formGroup">
|
|
137
|
+
</lib-form-section>
|
|
138
|
+
</div>
|
|
139
|
+
</form>
|
|
140
|
+
|
|
141
|
+
<!-- ── Action bar: Prev / custom action buttons / Next ──────────────────── -->
|
|
142
|
+
<div class="form-actions"
|
|
143
|
+
*ngIf="!readOnly && formSchema.showActions !== false && actionBarConfig?.buttons?.length">
|
|
144
|
+
|
|
145
|
+
<!-- LEFT GROUP: Previous button + left-aligned custom buttons -->
|
|
146
|
+
<div class="action-group action-group--left">
|
|
147
|
+
<lib-button
|
|
148
|
+
*ngIf="!isSectionStepFirst"
|
|
149
|
+
variant="outline"
|
|
150
|
+
(click)="navigateToPrevious()">
|
|
151
|
+
{{ previousLabel }}
|
|
152
|
+
</lib-button>
|
|
153
|
+
<ng-container *ngFor="let btn of getButtonsForAlignment('left')">
|
|
154
|
+
<lib-button
|
|
155
|
+
*ngIf="!btn.showOnLastStepOnly || isSectionStepLast"
|
|
156
|
+
[variant]="$any(btn.variant) || 'outline'"
|
|
157
|
+
[disabled]="isButtonDisabled(btn)"
|
|
158
|
+
(click)="handleButtonClick(btn)">
|
|
159
|
+
{{ getButtonLabel(btn) }}
|
|
160
|
+
</lib-button>
|
|
161
|
+
</ng-container>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<!-- RIGHT GROUP: right-aligned custom buttons + Next button -->
|
|
165
|
+
<div class="action-group action-group--right">
|
|
166
|
+
<ng-container *ngFor="let btn of getButtonsForAlignment('right')">
|
|
167
|
+
<lib-button
|
|
168
|
+
*ngIf="!btn.showOnLastStepOnly || isSectionStepLast"
|
|
169
|
+
[variant]="$any(btn.variant) || 'primary'"
|
|
170
|
+
[disabled]="isButtonDisabled(btn)"
|
|
171
|
+
(click)="handleButtonClick(btn)">
|
|
172
|
+
{{ getButtonLabel(btn) }}
|
|
173
|
+
</lib-button>
|
|
174
|
+
</ng-container>
|
|
175
|
+
<lib-button
|
|
176
|
+
*ngIf="!isSectionStepLast"
|
|
177
|
+
variant="primary"
|
|
178
|
+
(click)="navigateToNext()">
|
|
179
|
+
{{ nextLabel }}
|
|
180
|
+
</lib-button>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
</ng-container>
|
|
186
|
+
|
|
187
|
+
<!-- ══════════════════════════════════════════════════════════════════════
|
|
188
|
+
Regular card wrapper — used for SECTION and STEPPER form types.
|
|
189
|
+
══════════════════════════════════════════════════════════════════════ -->
|
|
190
|
+
<div class="smart-form-wrapper" *ngIf="formSchema && isFormReady && !isSectionStepper"
|
|
191
|
+
[class.smart-form-wrapper--readonly]="readOnly">
|
|
192
|
+
|
|
193
|
+
<!-- Form Header -->
|
|
194
|
+
<div class="form-header" *ngIf="formSchema.showTitle !== false">
|
|
195
|
+
<h2 class="form-title">{{ formSchema.label }}</h2>
|
|
196
|
+
<p class="form-description" *ngIf="formSchema.description">{{ formSchema.description }}</p>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<!-- STEPPER type nav -->
|
|
200
|
+
<div class="stepper-nav" *ngIf="isStepper && formSchema.stepperConfig?.showStep !== false">
|
|
201
|
+
<div class="stepper-steps" [class.horizontal]="formSchema.stepperConfig?.isHorizontal !== false">
|
|
202
|
+
<div *ngFor="let step of fieldList; let i = index" class="stepper-step" [class.active]="i === currentStep"
|
|
203
|
+
[class.completed]="i < currentStep">
|
|
204
|
+
<div class="step-number">{{ i + 1 }}</div>
|
|
205
|
+
<div class="step-label">{{ step.sectionConfig?.label || 'Step ' + (i + 1) }}</div>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<!-- Form Content -->
|
|
211
|
+
<form [formGroup]="formGroup" class="smart-form">
|
|
212
|
+
<!-- Regular SECTION form -->
|
|
213
|
+
<div *ngIf="!isStepper && formSchema.sectionConfig && formSchema.sectionConfig.isEnabled !== false" class="form-section">
|
|
214
|
+
<lib-form-section [config]="formSchema.sectionConfig" [controller]="controller" [formGroup]="formGroup">
|
|
215
|
+
</lib-form-section>
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<!-- STEPPER type form -->
|
|
219
|
+
<div *ngIf="isStepper && currentStepConfig && currentStepConfig.sectionConfig?.isEnabled !== false" class="form-stepper">
|
|
220
|
+
<lib-form-section [config]="currentStepConfig.sectionConfig!" [controller]="controller" [formGroup]="formGroup">
|
|
221
|
+
</lib-form-section>
|
|
222
|
+
</div>
|
|
223
|
+
</form>
|
|
224
|
+
|
|
225
|
+
<!-- ── Form Actions ──────────────────────────────────────────────────── -->
|
|
226
|
+
<div class="form-actions" *ngIf="formSchema.showActions !== false && !readOnly && actionBarConfig?.buttons?.length">
|
|
227
|
+
|
|
228
|
+
<!-- LEFT GROUP -->
|
|
229
|
+
<div class="action-group action-group--left">
|
|
230
|
+
<lib-button
|
|
231
|
+
*ngFor="let btn of getButtonsForAlignment('left')"
|
|
232
|
+
[variant]="$any(btn.variant) || 'outline'"
|
|
233
|
+
[disabled]="isButtonDisabled(btn)"
|
|
234
|
+
(click)="handleButtonClick(btn)">
|
|
235
|
+
{{ getButtonLabel(btn) }}
|
|
236
|
+
</lib-button>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<!-- RIGHT GROUP -->
|
|
240
|
+
<div class="action-group action-group--right">
|
|
241
|
+
<lib-button
|
|
242
|
+
*ngFor="let btn of getButtonsForAlignment('right')"
|
|
243
|
+
[variant]="$any(btn.variant) || 'primary'"
|
|
244
|
+
[disabled]="isButtonDisabled(btn)"
|
|
245
|
+
(click)="handleButtonClick(btn)">
|
|
246
|
+
{{ getButtonLabel(btn) }}
|
|
247
|
+
</lib-button>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
</div>
|