commons-shared-web-ui 0.0.55 → 0.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/fesm2022/commons-shared-web-ui.mjs +15897 -0
  2. package/fesm2022/commons-shared-web-ui.mjs.map +1 -0
  3. package/index.d.ts +4916 -0
  4. package/package.json +34 -53
  5. package/src/lib/modules/button/button.theme.scss +4 -4
  6. package/.claude/settings.local.json +0 -10
  7. package/documentation/alert.md +0 -123
  8. package/documentation/button-dropdown.md +0 -126
  9. package/documentation/button.md +0 -184
  10. package/documentation/cards-usage-guidelines.md +0 -131
  11. package/documentation/configurable-form.md +0 -605
  12. package/documentation/confirmation-modal.md +0 -250
  13. package/documentation/filter-sidebar.md +0 -178
  14. package/documentation/filter-table-selector.md +0 -228
  15. package/documentation/form-builder.md +0 -599
  16. package/documentation/form-components.md +0 -384
  17. package/documentation/form-field-configuration.md +0 -250
  18. package/documentation/nav.md +0 -427
  19. package/documentation/pagination.md +0 -181
  20. package/documentation/side-nav-documentation.md +0 -169
  21. package/documentation/smart-form.md +0 -2765
  22. package/documentation/smart-table.md +0 -1221
  23. package/documentation/snackbar.md +0 -118
  24. package/documentation/style-externalization.md +0 -88
  25. package/documentation/summary-card.md +0 -279
  26. package/documentation/table-column-configuration.md +0 -221
  27. package/documentation/time-picker.md +0 -274
  28. package/ng-package.json +0 -30
  29. package/src/lib/modules/alert/alert.models.ts +0 -6
  30. package/src/lib/modules/alert/alert.module.ts +0 -16
  31. package/src/lib/modules/alert/components/alert/alert.component.html +0 -27
  32. package/src/lib/modules/alert/components/alert/alert.component.scss +0 -92
  33. package/src/lib/modules/alert/components/alert/alert.component.ts +0 -81
  34. package/src/lib/modules/button/button.models.ts +0 -13
  35. package/src/lib/modules/button/button.module.ts +0 -16
  36. package/src/lib/modules/button/components/button/button.component.html +0 -22
  37. package/src/lib/modules/button/components/button/button.component.scss +0 -88
  38. package/src/lib/modules/button/components/button/button.component.ts +0 -67
  39. package/src/lib/modules/button-dropdown/button-dropdown.models.ts +0 -26
  40. package/src/lib/modules/button-dropdown/button-dropdown.module.ts +0 -22
  41. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.html +0 -41
  42. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.scss +0 -135
  43. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.ts +0 -160
  44. package/src/lib/modules/configurable-form/component/configurable-form.component.html +0 -294
  45. package/src/lib/modules/configurable-form/component/configurable-form.component.scss +0 -503
  46. package/src/lib/modules/configurable-form/component/configurable-form.component.ts +0 -628
  47. package/src/lib/modules/configurable-form/configurable-form.examples.ts +0 -154
  48. package/src/lib/modules/configurable-form/configurable-form.model.ts +0 -131
  49. package/src/lib/modules/configurable-form/configurable-form.module.ts +0 -19
  50. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.html +0 -77
  51. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.scss +0 -395
  52. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.ts +0 -266
  53. package/src/lib/modules/confirmation-modal/confirmation-modal.models.ts +0 -71
  54. package/src/lib/modules/confirmation-modal/confirmation-modal.module.ts +0 -20
  55. package/src/lib/modules/filter/components/filter/filter.component.html +0 -131
  56. package/src/lib/modules/filter/components/filter/filter.component.scss +0 -245
  57. package/src/lib/modules/filter/components/filter/filter.component.ts +0 -216
  58. package/src/lib/modules/filter/filter.models.ts +0 -88
  59. package/src/lib/modules/filter/filter.module.ts +0 -24
  60. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html +0 -112
  61. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss +0 -186
  62. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts +0 -163
  63. package/src/lib/modules/filter-sidebar/filter-sidebar.models.ts +0 -95
  64. package/src/lib/modules/filter-sidebar/filter-sidebar.module.ts +0 -24
  65. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.html +0 -73
  66. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.scss +0 -321
  67. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.ts +0 -361
  68. package/src/lib/modules/filter-table-selector/filter-table-selector.models.ts +0 -91
  69. package/src/lib/modules/filter-table-selector/filter-table-selector.module.ts +0 -22
  70. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.html +0 -63
  71. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.scss +0 -496
  72. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.ts +0 -445
  73. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.html +0 -75
  74. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.scss +0 -210
  75. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.ts +0 -55
  76. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.html +0 -25
  77. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.scss +0 -82
  78. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.ts +0 -95
  79. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.html +0 -20
  80. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.scss +0 -37
  81. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.ts +0 -94
  82. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.html +0 -46
  83. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.scss +0 -102
  84. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.ts +0 -50
  85. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.html +0 -35
  86. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.scss +0 -67
  87. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.ts +0 -34
  88. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.html +0 -68
  89. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.scss +0 -113
  90. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.ts +0 -74
  91. package/src/lib/modules/form-builder/configs/field-type-schema.map.ts +0 -533
  92. package/src/lib/modules/form-builder/form-builder.module.ts +0 -36
  93. package/src/lib/modules/form-builder/index.ts +0 -9
  94. package/src/lib/modules/form-builder/models/builder.models.ts +0 -7
  95. package/src/lib/modules/form-builder/models/field-configurator.models.ts +0 -38
  96. package/src/lib/modules/form-builder/models/field-selection.models.ts +0 -51
  97. package/src/lib/modules/form-builder/services/field-configurator.service.ts +0 -258
  98. package/src/lib/modules/form-builder/services/field-selection.service.ts +0 -299
  99. package/src/lib/modules/form-builder/services/form-schema-tree.service.ts +0 -670
  100. package/src/lib/modules/form-builder/tokens/builder.tokens.ts +0 -10
  101. package/src/lib/modules/form-builder/utils/constants.ts +0 -43
  102. package/src/lib/modules/form-components/components/checkbox/checkbox.component.html +0 -29
  103. package/src/lib/modules/form-components/components/checkbox/checkbox.component.scss +0 -111
  104. package/src/lib/modules/form-components/components/checkbox/checkbox.component.ts +0 -207
  105. package/src/lib/modules/form-components/components/checkbox/checkbox.models.ts +0 -35
  106. package/src/lib/modules/form-components/components/datepicker/datepicker.component.html +0 -42
  107. package/src/lib/modules/form-components/components/datepicker/datepicker.component.scss +0 -115
  108. package/src/lib/modules/form-components/components/datepicker/datepicker.component.ts +0 -267
  109. package/src/lib/modules/form-components/components/datepicker/datepicker.models.ts +0 -45
  110. package/src/lib/modules/form-components/components/dropdown/dropdown.component.html +0 -74
  111. package/src/lib/modules/form-components/components/dropdown/dropdown.component.scss +0 -252
  112. package/src/lib/modules/form-components/components/dropdown/dropdown.component.ts +0 -377
  113. package/src/lib/modules/form-components/components/dropdown/dropdown.models.ts +0 -53
  114. package/src/lib/modules/form-components/components/input/input.component.html +0 -51
  115. package/src/lib/modules/form-components/components/input/input.component.scss +0 -128
  116. package/src/lib/modules/form-components/components/input/input.component.ts +0 -250
  117. package/src/lib/modules/form-components/components/input/input.models.ts +0 -55
  118. package/src/lib/modules/form-components/components/radio/radio.component.html +0 -22
  119. package/src/lib/modules/form-components/components/radio/radio.component.scss +0 -107
  120. package/src/lib/modules/form-components/components/radio/radio.component.ts +0 -181
  121. package/src/lib/modules/form-components/components/radio/radio.models.ts +0 -39
  122. package/src/lib/modules/form-components/components/search/search.component.html +0 -15
  123. package/src/lib/modules/form-components/components/search/search.component.scss +0 -87
  124. package/src/lib/modules/form-components/components/search/search.component.ts +0 -213
  125. package/src/lib/modules/form-components/components/search/search.models.ts +0 -40
  126. package/src/lib/modules/form-components/components/toggle/toggle.component.html +0 -15
  127. package/src/lib/modules/form-components/components/toggle/toggle.component.scss +0 -81
  128. package/src/lib/modules/form-components/components/toggle/toggle.component.ts +0 -166
  129. package/src/lib/modules/form-components/components/toggle/toggle.models.ts +0 -27
  130. package/src/lib/modules/form-components/directives/click-outside.directive.ts +0 -22
  131. package/src/lib/modules/form-components/form-components.module.ts +0 -42
  132. package/src/lib/modules/form-field-configuration/components/_ffc-controls.scss +0 -89
  133. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.html +0 -68
  134. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.scss +0 -73
  135. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.ts +0 -34
  136. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.html +0 -78
  137. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.scss +0 -83
  138. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.ts +0 -94
  139. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.html +0 -38
  140. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.scss +0 -42
  141. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.ts +0 -92
  142. package/src/lib/modules/form-field-configuration/form-field-configuration.module.ts +0 -23
  143. package/src/lib/modules/form-field-configuration/index.ts +0 -7
  144. package/src/lib/modules/form-field-configuration/models/field-configuration.models.ts +0 -62
  145. package/src/lib/modules/form-field-configuration/services/config-schema-tree.service.ts +0 -159
  146. package/src/lib/modules/form-field-configuration/services/field-configuration.service.ts +0 -228
  147. package/src/lib/modules/material/material.module.ts +0 -94
  148. package/src/lib/modules/nav/components/nav/nav.component.html +0 -34
  149. package/src/lib/modules/nav/components/nav/nav.component.scss +0 -171
  150. package/src/lib/modules/nav/components/nav/nav.component.ts +0 -82
  151. package/src/lib/modules/nav/nav.models.ts +0 -31
  152. package/src/lib/modules/nav/nav.module.ts +0 -17
  153. package/src/lib/modules/pagination/components/pagination/pagination.component.html +0 -52
  154. package/src/lib/modules/pagination/components/pagination/pagination.component.scss +0 -155
  155. package/src/lib/modules/pagination/components/pagination/pagination.component.ts +0 -109
  156. package/src/lib/modules/pagination/pagination.module.ts +0 -17
  157. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.html +0 -56
  158. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.scss +0 -342
  159. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.ts +0 -135
  160. package/src/lib/modules/side-nav/side-nav.models.ts +0 -38
  161. package/src/lib/modules/side-nav/side-nav.module.ts +0 -16
  162. package/src/lib/modules/smart-form/components/form-field/form-field.component.html +0 -1330
  163. package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +0 -2112
  164. package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +0 -3006
  165. package/src/lib/modules/smart-form/components/form-section/form-section.component.html +0 -65
  166. package/src/lib/modules/smart-form/components/form-section/form-section.component.scss +0 -209
  167. package/src/lib/modules/smart-form/components/form-section/form-section.component.ts +0 -131
  168. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.html +0 -253
  169. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.scss +0 -689
  170. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.ts +0 -1131
  171. package/src/lib/modules/smart-form/index.ts +0 -10
  172. package/src/lib/modules/smart-form/models/form-schema.model.ts +0 -793
  173. package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +0 -21
  174. package/src/lib/modules/smart-form/services/expression.service.ts +0 -75
  175. package/src/lib/modules/smart-form/services/smart-form-controller.service.ts +0 -67
  176. package/src/lib/modules/smart-form/smart-form.examples.ts +0 -1324
  177. package/src/lib/modules/smart-form/smart-form.module.ts +0 -38
  178. package/src/lib/modules/smart-form/utils/translation.utils.ts +0 -82
  179. package/src/lib/modules/smart-form/utils/trusted-url.pipe.ts +0 -25
  180. package/src/lib/modules/smart-form/utils/validation.utils.ts +0 -98
  181. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.html +0 -283
  182. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.scss +0 -685
  183. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.ts +0 -1128
  184. package/src/lib/modules/smart-table/models/table-config.model.ts +0 -213
  185. package/src/lib/modules/smart-table/smart-table.module.ts +0 -30
  186. package/src/lib/modules/smart-table/utils/safe-html.pipe.ts +0 -28
  187. package/src/lib/modules/smart-table/utils/smart-table.utils.ts +0 -18
  188. package/src/lib/modules/snackbar/components/snackbar.component.html +0 -41
  189. package/src/lib/modules/snackbar/components/snackbar.component.scss +0 -99
  190. package/src/lib/modules/snackbar/components/snackbar.component.ts +0 -18
  191. package/src/lib/modules/snackbar/models/snackbar.models.ts +0 -10
  192. package/src/lib/modules/snackbar/services/snackbar.service.ts +0 -40
  193. package/src/lib/modules/snackbar/snackbar.module.ts +0 -11
  194. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.html +0 -47
  195. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.scss +0 -199
  196. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.ts +0 -126
  197. package/src/lib/modules/summary-card/summary-card.module.ts +0 -18
  198. package/src/lib/modules/table-column-configuration/components/_tcc-controls.scss +0 -53
  199. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.html +0 -47
  200. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.scss +0 -50
  201. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.ts +0 -33
  202. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.html +0 -30
  203. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.scss +0 -36
  204. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.ts +0 -78
  205. package/src/lib/modules/table-column-configuration/index.ts +0 -5
  206. package/src/lib/modules/table-column-configuration/models/table-column-configuration.models.ts +0 -20
  207. package/src/lib/modules/table-column-configuration/services/table-column-configuration.service.ts +0 -77
  208. package/src/lib/modules/table-column-configuration/table-column-configuration.module.ts +0 -21
  209. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.html +0 -37
  210. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.scss +0 -102
  211. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.ts +0 -178
  212. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.html +0 -78
  213. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.scss +0 -226
  214. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.ts +0 -595
  215. package/src/lib/modules/time-picker/models/time-picker.models.ts +0 -49
  216. package/src/lib/modules/time-picker/time-picker.module.ts +0 -23
  217. package/src/lib/shared-ui.module.ts +0 -55
  218. package/src/lib/utils/constants.ts +0 -11
  219. package/src/lib/utils/storage.utils.ts +0 -37
  220. package/src/lib/utils/string.utils.ts +0 -23
  221. package/src/lib/utils/translation.utils.ts +0 -87
  222. package/src/public-api.ts +0 -127
  223. package/tsconfig.lib.json +0 -15
@@ -1,65 +0,0 @@
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>
@@ -1,209 +0,0 @@
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
- }
@@ -1,131 +0,0 @@
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
- }
@@ -1,253 +0,0 @@
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>