commons-shared-web-ui 0.0.62 → 0.0.63

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 (222) hide show
  1. package/fesm2022/commons-shared-web-ui.mjs +16153 -0
  2. package/fesm2022/commons-shared-web-ui.mjs.map +1 -0
  3. package/index.d.ts +5033 -0
  4. package/package.json +34 -53
  5. package/.claude/settings.local.json +0 -10
  6. package/documentation/alert.md +0 -123
  7. package/documentation/button-dropdown.md +0 -126
  8. package/documentation/button.md +0 -184
  9. package/documentation/cards-usage-guidelines.md +0 -131
  10. package/documentation/configurable-form.md +0 -605
  11. package/documentation/confirmation-modal.md +0 -250
  12. package/documentation/filter-sidebar.md +0 -178
  13. package/documentation/filter-table-selector.md +0 -228
  14. package/documentation/form-builder.md +0 -599
  15. package/documentation/form-components.md +0 -384
  16. package/documentation/form-field-configuration.md +0 -250
  17. package/documentation/nav.md +0 -427
  18. package/documentation/pagination.md +0 -181
  19. package/documentation/side-nav-documentation.md +0 -169
  20. package/documentation/smart-form.md +0 -2819
  21. package/documentation/smart-table.md +0 -1297
  22. package/documentation/snackbar.md +0 -118
  23. package/documentation/style-externalization.md +0 -88
  24. package/documentation/summary-card.md +0 -279
  25. package/documentation/table-column-configuration.md +0 -221
  26. package/documentation/time-picker.md +0 -274
  27. package/ng-package.json +0 -30
  28. package/src/lib/modules/alert/alert.models.ts +0 -6
  29. package/src/lib/modules/alert/alert.module.ts +0 -16
  30. package/src/lib/modules/alert/components/alert/alert.component.html +0 -27
  31. package/src/lib/modules/alert/components/alert/alert.component.scss +0 -92
  32. package/src/lib/modules/alert/components/alert/alert.component.ts +0 -81
  33. package/src/lib/modules/button/button.models.ts +0 -13
  34. package/src/lib/modules/button/button.module.ts +0 -16
  35. package/src/lib/modules/button/components/button/button.component.html +0 -22
  36. package/src/lib/modules/button/components/button/button.component.scss +0 -92
  37. package/src/lib/modules/button/components/button/button.component.ts +0 -67
  38. package/src/lib/modules/button-dropdown/button-dropdown.models.ts +0 -26
  39. package/src/lib/modules/button-dropdown/button-dropdown.module.ts +0 -22
  40. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.html +0 -41
  41. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.scss +0 -135
  42. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.ts +0 -160
  43. package/src/lib/modules/configurable-form/component/configurable-form.component.html +0 -294
  44. package/src/lib/modules/configurable-form/component/configurable-form.component.scss +0 -503
  45. package/src/lib/modules/configurable-form/component/configurable-form.component.ts +0 -628
  46. package/src/lib/modules/configurable-form/configurable-form.examples.ts +0 -154
  47. package/src/lib/modules/configurable-form/configurable-form.model.ts +0 -131
  48. package/src/lib/modules/configurable-form/configurable-form.module.ts +0 -19
  49. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.html +0 -77
  50. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.scss +0 -395
  51. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.ts +0 -266
  52. package/src/lib/modules/confirmation-modal/confirmation-modal.models.ts +0 -71
  53. package/src/lib/modules/confirmation-modal/confirmation-modal.module.ts +0 -20
  54. package/src/lib/modules/filter/components/filter/filter.component.html +0 -131
  55. package/src/lib/modules/filter/components/filter/filter.component.scss +0 -245
  56. package/src/lib/modules/filter/components/filter/filter.component.ts +0 -216
  57. package/src/lib/modules/filter/filter.models.ts +0 -88
  58. package/src/lib/modules/filter/filter.module.ts +0 -24
  59. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html +0 -112
  60. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss +0 -186
  61. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts +0 -163
  62. package/src/lib/modules/filter-sidebar/filter-sidebar.models.ts +0 -95
  63. package/src/lib/modules/filter-sidebar/filter-sidebar.module.ts +0 -24
  64. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.html +0 -73
  65. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.scss +0 -321
  66. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.ts +0 -361
  67. package/src/lib/modules/filter-table-selector/filter-table-selector.models.ts +0 -91
  68. package/src/lib/modules/filter-table-selector/filter-table-selector.module.ts +0 -22
  69. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.html +0 -63
  70. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.scss +0 -496
  71. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.ts +0 -445
  72. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.html +0 -75
  73. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.scss +0 -210
  74. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.ts +0 -55
  75. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.html +0 -25
  76. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.scss +0 -82
  77. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.ts +0 -95
  78. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.html +0 -20
  79. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.scss +0 -37
  80. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.ts +0 -94
  81. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.html +0 -46
  82. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.scss +0 -102
  83. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.ts +0 -50
  84. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.html +0 -35
  85. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.scss +0 -67
  86. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.ts +0 -34
  87. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.html +0 -68
  88. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.scss +0 -113
  89. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.ts +0 -74
  90. package/src/lib/modules/form-builder/configs/field-type-schema.map.ts +0 -533
  91. package/src/lib/modules/form-builder/form-builder.module.ts +0 -36
  92. package/src/lib/modules/form-builder/index.ts +0 -9
  93. package/src/lib/modules/form-builder/models/builder.models.ts +0 -7
  94. package/src/lib/modules/form-builder/models/field-configurator.models.ts +0 -38
  95. package/src/lib/modules/form-builder/models/field-selection.models.ts +0 -51
  96. package/src/lib/modules/form-builder/services/field-configurator.service.ts +0 -258
  97. package/src/lib/modules/form-builder/services/field-selection.service.ts +0 -299
  98. package/src/lib/modules/form-builder/services/form-schema-tree.service.ts +0 -670
  99. package/src/lib/modules/form-builder/tokens/builder.tokens.ts +0 -10
  100. package/src/lib/modules/form-builder/utils/constants.ts +0 -43
  101. package/src/lib/modules/form-components/components/checkbox/checkbox.component.html +0 -29
  102. package/src/lib/modules/form-components/components/checkbox/checkbox.component.scss +0 -111
  103. package/src/lib/modules/form-components/components/checkbox/checkbox.component.ts +0 -207
  104. package/src/lib/modules/form-components/components/checkbox/checkbox.models.ts +0 -35
  105. package/src/lib/modules/form-components/components/datepicker/datepicker.component.html +0 -42
  106. package/src/lib/modules/form-components/components/datepicker/datepicker.component.scss +0 -115
  107. package/src/lib/modules/form-components/components/datepicker/datepicker.component.ts +0 -267
  108. package/src/lib/modules/form-components/components/datepicker/datepicker.models.ts +0 -45
  109. package/src/lib/modules/form-components/components/dropdown/dropdown.component.html +0 -74
  110. package/src/lib/modules/form-components/components/dropdown/dropdown.component.scss +0 -252
  111. package/src/lib/modules/form-components/components/dropdown/dropdown.component.ts +0 -377
  112. package/src/lib/modules/form-components/components/dropdown/dropdown.models.ts +0 -53
  113. package/src/lib/modules/form-components/components/input/input.component.html +0 -51
  114. package/src/lib/modules/form-components/components/input/input.component.scss +0 -128
  115. package/src/lib/modules/form-components/components/input/input.component.ts +0 -250
  116. package/src/lib/modules/form-components/components/input/input.models.ts +0 -55
  117. package/src/lib/modules/form-components/components/radio/radio.component.html +0 -22
  118. package/src/lib/modules/form-components/components/radio/radio.component.scss +0 -107
  119. package/src/lib/modules/form-components/components/radio/radio.component.ts +0 -181
  120. package/src/lib/modules/form-components/components/radio/radio.models.ts +0 -39
  121. package/src/lib/modules/form-components/components/search/search.component.html +0 -15
  122. package/src/lib/modules/form-components/components/search/search.component.scss +0 -87
  123. package/src/lib/modules/form-components/components/search/search.component.ts +0 -213
  124. package/src/lib/modules/form-components/components/search/search.models.ts +0 -40
  125. package/src/lib/modules/form-components/components/toggle/toggle.component.html +0 -15
  126. package/src/lib/modules/form-components/components/toggle/toggle.component.scss +0 -81
  127. package/src/lib/modules/form-components/components/toggle/toggle.component.ts +0 -166
  128. package/src/lib/modules/form-components/components/toggle/toggle.models.ts +0 -27
  129. package/src/lib/modules/form-components/directives/click-outside.directive.ts +0 -22
  130. package/src/lib/modules/form-components/form-components.module.ts +0 -42
  131. package/src/lib/modules/form-field-configuration/components/_ffc-controls.scss +0 -89
  132. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.html +0 -68
  133. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.scss +0 -73
  134. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.ts +0 -34
  135. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.html +0 -78
  136. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.scss +0 -83
  137. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.ts +0 -94
  138. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.html +0 -38
  139. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.scss +0 -42
  140. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.ts +0 -92
  141. package/src/lib/modules/form-field-configuration/form-field-configuration.module.ts +0 -23
  142. package/src/lib/modules/form-field-configuration/index.ts +0 -7
  143. package/src/lib/modules/form-field-configuration/models/field-configuration.models.ts +0 -62
  144. package/src/lib/modules/form-field-configuration/services/config-schema-tree.service.ts +0 -159
  145. package/src/lib/modules/form-field-configuration/services/field-configuration.service.ts +0 -228
  146. package/src/lib/modules/material/material.module.ts +0 -94
  147. package/src/lib/modules/nav/components/nav/nav.component.html +0 -34
  148. package/src/lib/modules/nav/components/nav/nav.component.scss +0 -171
  149. package/src/lib/modules/nav/components/nav/nav.component.ts +0 -82
  150. package/src/lib/modules/nav/nav.models.ts +0 -31
  151. package/src/lib/modules/nav/nav.module.ts +0 -17
  152. package/src/lib/modules/pagination/components/pagination/pagination.component.html +0 -52
  153. package/src/lib/modules/pagination/components/pagination/pagination.component.scss +0 -155
  154. package/src/lib/modules/pagination/components/pagination/pagination.component.ts +0 -109
  155. package/src/lib/modules/pagination/pagination.module.ts +0 -17
  156. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.html +0 -56
  157. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.scss +0 -342
  158. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.ts +0 -135
  159. package/src/lib/modules/side-nav/side-nav.models.ts +0 -38
  160. package/src/lib/modules/side-nav/side-nav.module.ts +0 -16
  161. package/src/lib/modules/smart-form/components/form-field/form-field.component.html +0 -1379
  162. package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +0 -2255
  163. package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +0 -3174
  164. package/src/lib/modules/smart-form/components/form-section/form-section.component.html +0 -67
  165. package/src/lib/modules/smart-form/components/form-section/form-section.component.scss +0 -209
  166. package/src/lib/modules/smart-form/components/form-section/form-section.component.ts +0 -142
  167. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.html +0 -253
  168. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.scss +0 -689
  169. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.ts +0 -1134
  170. package/src/lib/modules/smart-form/index.ts +0 -10
  171. package/src/lib/modules/smart-form/models/form-schema.model.ts +0 -803
  172. package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +0 -22
  173. package/src/lib/modules/smart-form/services/expression.service.ts +0 -75
  174. package/src/lib/modules/smart-form/services/smart-form-controller.service.ts +0 -67
  175. package/src/lib/modules/smart-form/smart-form.examples.ts +0 -1324
  176. package/src/lib/modules/smart-form/smart-form.module.ts +0 -40
  177. package/src/lib/modules/smart-form/utils/translation.utils.ts +0 -82
  178. package/src/lib/modules/smart-form/utils/trusted-url.pipe.ts +0 -25
  179. package/src/lib/modules/smart-form/utils/validation.utils.ts +0 -98
  180. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.html +0 -283
  181. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.scss +0 -685
  182. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.ts +0 -1219
  183. package/src/lib/modules/smart-table/models/table-config.model.ts +0 -247
  184. package/src/lib/modules/smart-table/smart-table.module.ts +0 -30
  185. package/src/lib/modules/smart-table/utils/safe-html.pipe.ts +0 -28
  186. package/src/lib/modules/smart-table/utils/smart-table.utils.ts +0 -18
  187. package/src/lib/modules/snackbar/components/snackbar.component.html +0 -41
  188. package/src/lib/modules/snackbar/components/snackbar.component.scss +0 -99
  189. package/src/lib/modules/snackbar/components/snackbar.component.ts +0 -18
  190. package/src/lib/modules/snackbar/models/snackbar.models.ts +0 -10
  191. package/src/lib/modules/snackbar/services/snackbar.service.ts +0 -40
  192. package/src/lib/modules/snackbar/snackbar.module.ts +0 -11
  193. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.html +0 -47
  194. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.scss +0 -199
  195. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.ts +0 -126
  196. package/src/lib/modules/summary-card/summary-card.module.ts +0 -18
  197. package/src/lib/modules/table-column-configuration/components/_tcc-controls.scss +0 -53
  198. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.html +0 -47
  199. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.scss +0 -50
  200. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.ts +0 -33
  201. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.html +0 -30
  202. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.scss +0 -36
  203. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.ts +0 -78
  204. package/src/lib/modules/table-column-configuration/index.ts +0 -5
  205. package/src/lib/modules/table-column-configuration/models/table-column-configuration.models.ts +0 -20
  206. package/src/lib/modules/table-column-configuration/services/table-column-configuration.service.ts +0 -77
  207. package/src/lib/modules/table-column-configuration/table-column-configuration.module.ts +0 -21
  208. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.html +0 -37
  209. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.scss +0 -102
  210. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.ts +0 -178
  211. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.html +0 -78
  212. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.scss +0 -226
  213. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.ts +0 -595
  214. package/src/lib/modules/time-picker/models/time-picker.models.ts +0 -49
  215. package/src/lib/modules/time-picker/time-picker.module.ts +0 -23
  216. package/src/lib/shared-ui.module.ts +0 -55
  217. package/src/lib/utils/constants.ts +0 -11
  218. package/src/lib/utils/storage.utils.ts +0 -37
  219. package/src/lib/utils/string.utils.ts +0 -23
  220. package/src/lib/utils/translation.utils.ts +0 -87
  221. package/src/public-api.ts +0 -127
  222. package/tsconfig.lib.json +0 -15
@@ -1,118 +0,0 @@
1
- # Snackbar Component
2
-
3
- The Configurable Snackbar component (`lib-snackbar`) is a fully customizable toast-style notification module built on top of `@angular/material/snack-bar`. It supports four distinct UI variants (success, error, warning, info) and is powered by a robust SCSS CSS-variables-based theming engine matching the design system of the `nav` and `pagination` components.
4
-
5
- ## Implementation Details
6
-
7
- ### Module Import
8
-
9
- To use the Snackbar, import the `SnackbarModule` into your Angular application module.
10
-
11
- ```typescript
12
- import { SnackbarModule } from "commons-shared-web-ui";
13
-
14
- @NgModule({
15
- imports: [SnackbarModule],
16
- })
17
- export class AppModule {}
18
- ```
19
-
20
- ### Displaying a Snackbar Programmatically
21
-
22
- The `SnackbarService` is provided in root and handles the instantiation of the custom component template seamlessly. You inject the service into your component/service:
23
-
24
- ```typescript
25
- import { Component } from "@angular/core";
26
- import { SnackbarService } from "commons-shared-web-ui";
27
-
28
- @Component({
29
- selector: "app-example",
30
- template: `<button (click)="submitForm()">Submit</button>`,
31
- })
32
- export class ExampleComponent {
33
- constructor(private snackbarService: SnackbarService) {}
34
-
35
- submitForm() {
36
- // Show a basic success toast
37
- this.snackbarService.success("Form submitted successfully!");
38
-
39
- // Show a basic error toast
40
- this.snackbarService.error("Failed to submit form.");
41
- }
42
- }
43
- ```
44
-
45
- ### Core Service API Methods
46
-
47
- - `success(message: string, duration?: number)`
48
- - `error(message: string, duration?: number)`
49
- - `warning(message: string, duration?: number)`
50
- - `info(message: string, duration?: number)`
51
- - `show(config: SnackbarConfig)`
52
-
53
- The `show()` method provides advanced initialization:
54
-
55
- ```typescript
56
- this.snackbarService.show({
57
- message: "Custom positioned explicit alert.",
58
- variant: "warning",
59
- duration: 8000,
60
- horizontalPosition: "center",
61
- verticalPosition: "bottom",
62
- showCloseButton: true,
63
- });
64
- ```
65
-
66
- ### Models
67
-
68
- #### `SnackbarConfig`
69
-
70
- | Property | Type | Default | Description |
71
- | -------------------- | --------------------------------------------------- | ------- | ------------------------------------------------------------- |
72
- | `message` | `string` | - | **Required.** The primary text to display in the snackbar. |
73
- | `variant` | `'success' \| 'error' \| 'warning' \| 'info'` | `info` | The visual severity of the toast, driving icon and colors. |
74
- | `duration` | `number` | `5000` | Auto-dismiss duration in milliseconds. |
75
- | `horizontalPosition` | `'start' \| 'center' \| 'end' \| 'left' \| 'right'` | `right` | Standard Material horizontal anchoring. |
76
- | `verticalPosition` | `'top' \| 'bottom'` | `top` | Standard Material vertical anchoring. |
77
- | `showCloseButton` | `boolean` | `false` | Renders a manual "X" close button inside the toast if `true`. |
78
-
79
- ## Customizing Theming & SCSS Overrides
80
-
81
- The notification toasts strictly use CSS variables that can be fully overridden in your consumer application.
82
-
83
- You can customize the styling of the snackbars globally in your application's main `styles.scss` using the exposed SCSS mixin `@include snackbar-theme(...)`.
84
-
85
- ```scss
86
- @use "commons-shared-web-ui/lib/modules/snackbar/snackbar.theme.scss" as
87
- snackbar;
88
-
89
- // Configure your application's specific branding limits
90
- :root {
91
- @include snackbar.snackbar-theme(
92
- (
93
- font-family: (
94
- "Roboto",
95
- sans-serif,
96
- ),
97
- radius: 4px,
98
- min-width: 350px,
99
- padding: 16px 20px,
100
- icon-size: 24px,
101
-
102
- // Branding Success overrides
103
- success-bg: #e8f5e9,
104
- success-color: #2e7d32,
105
- success-border: #c8e6c9,
106
- success-icon-color: #388e3c,
107
-
108
- // Branding Error overrides
109
- error-bg: #ffebee,
110
- error-color: #c62828,
111
- error-border: #ef9a9a,
112
- error-icon-color: #d32f2f,
113
- )
114
- );
115
- }
116
- ```
117
-
118
- If you only want to style the snackbar component exclusively within a nested layout or micro-frontend element space, simply invoke the mixin inside a constrained selector instead of `:root`.
@@ -1,88 +0,0 @@
1
- # Style Externalization Guide
2
-
3
- This guide describes the recommended pattern for externalizing styles in the shared UI library. This approach allows consuming applications (MFEs, Shell) to have full control over the visual appearance of components without modifying the library code.
4
-
5
- ## The Approach: Mixin + CSS Variables
6
-
7
- The core idea is to separate the **Theme Definition** (colors, fonts, etc.) from the **Component Implementation** (layout, structure).
8
-
9
- 1. **Library provides a Mixin**: The shared library exports a SCSS mixin that accepts a configuration map.
10
- 2. **Mixin generates CSS Variables**: The mixin processes the map and outputs CSS Custom Properties (Variables).
11
- 3. **Component uses CSS Variables**: The component's SCSS file uses _only_ `var(--...)` for dynamic styles.
12
- 4. **Consumer applies Mixin**: The parent app imports the mixin and generates the specific theme classes it needs.
13
-
14
- ## Implementation Steps for Library Developers
15
-
16
- ### 1. Create a `_theme.scss` file
17
-
18
- Create a file next to your component (e.g., `my-component.theme.scss`).
19
-
20
- ```scss
21
- @use "sass:map";
22
-
23
- // 1. Define Defaults
24
- $default-config: (
25
- primary-color: #007bff,
26
- bg-color: #ffffff,
27
- border-radius: 4px,
28
- );
29
-
30
- // 2. Create the Mixin
31
- @mixin my-component-theme($user-config: ()) {
32
- $config: map.merge($default-config, $user-config);
33
-
34
- // 3. Output Variables
35
- --cc-comp-primary: #{map.get($config, primary-color)};
36
- --cc-comp-bg: #{map.get($config, bg-color)};
37
- --cc-comp-radius: #{map.get($config, border-radius)};
38
- }
39
- ```
40
-
41
- ### 2. Update Component SCSS
42
-
43
- Refactor `my-component.component.scss` to use the variables.
44
-
45
- ```scss
46
- .my-component {
47
- background-color: var(--cc-comp-bg);
48
- border-radius: var(--cc-comp-radius);
49
-
50
- .btn {
51
- background-color: var(--cc-comp-primary);
52
- }
53
- }
54
- ```
55
-
56
- ## Usage for Application Developers
57
-
58
- In your application's `styles.scss`:
59
-
60
- ```scss
61
- @use "path/to/shared-ui/my-component.theme" as myComp;
62
-
63
- // Define a Light Theme
64
- .light-theme-app {
65
- @include myComp.my-component-theme(
66
- (
67
- primary-color: blue,
68
- bg-color: white,
69
- )
70
- );
71
- }
72
-
73
- // Define a Dark Theme
74
- .dark-theme-app {
75
- @include myComp.my-component-theme(
76
- (
77
- primary-color: lightblue,
78
- bg-color: #333,
79
- )
80
- );
81
- }
82
- ```
83
-
84
- ## Benefits
85
-
86
- - **True Decoupling**: The library has no opinion on the "Dark Mode" implementation of the parent app.
87
- - **Responsiveness**: CSS variables are runtime-dynamic.
88
- - **Maintenance**: Adding a new style parameter (e.g., specific padding) is as easy as adding a variable map.
@@ -1,279 +0,0 @@
1
- # Summary Card Component Documentation
2
-
3
- The `SummaryCardComponent` is a flexible and themeable card component for displaying key metrics and information with support for icons, images, and customizable layouts.
4
-
5
- ## Features
6
-
7
- - **Icon or Image Support**: Display either a Material icon or custom image
8
- - **Flexible Description Layout**: Position description text either below the value (default) or inline (right side)
9
- - **Fully Configurable Colors**: Customize colors for value, header, description, icon, and icon background
10
- - **Theme Support**: Two built-in themes (theme-1: clean/minimal, theme-2: aesthetic/modern)
11
- - **Responsive Design**: Mobile-friendly with responsive breakpoints
12
- - **Click Interaction**: Optional click events with disabled state support
13
- - **Theming**: Completely externalized theming support via SCSS mixins
14
-
15
- ## Installation
16
-
17
- To install the latest version of the `commons-shared-web-ui` library, run the following command:
18
-
19
- ```bash
20
- npm install commons-shared-web-ui@latest
21
- ```
22
-
23
- Import the `SummaryCardModule` into your feature module or `SharedModule`.
24
-
25
- ```typescript
26
- import { SummaryCardModule } from "@campus-cloud/shared-ui";
27
-
28
- @NgModule({
29
- imports: [
30
- SummaryCardModule,
31
- // ...
32
- ],
33
- })
34
- export class MyFeatureModule {}
35
- ```
36
-
37
- ## Theming & Styling
38
-
39
- The Summary Card Module uses a **Theme Externalization** pattern. It does not ship with hardcoded themes. Instead, the usage context (Parent App) **MUST** define the theme using the provided SCSS mixin.
40
-
41
- ### 1. Import the Mixin
42
-
43
- In your application's global styles (e.g., `styles.scss` or a dedicated theme file):
44
-
45
- ```scss
46
- @use "commons-shared-web-ui/src/lib/modules/summary-card/summary-card.theme"
47
- as summary-card;
48
- ```
49
-
50
- ### 2. Define Your Theme
51
-
52
- Create a class (or apply to `:root`) and include the mixin.
53
-
54
- #### Option A: Use Defaults (No Override)
55
-
56
- If you want the default look but still need the styles to load:
57
-
58
- ```scss
59
- .default-theme-summary-card {
60
- @include summary-card.summary-card-theme();
61
- }
62
- ```
63
-
64
- #### Option B: Override Specific Values
65
-
66
- Pass only the variables you want to change.
67
-
68
- ```scss
69
- .my-custom-theme {
70
- @include summary-card.summary-card-theme(
71
- (
72
- theme-1-bg: #ffffff,
73
- theme-2-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1),
74
- )
75
- );
76
- }
77
- ```
78
-
79
- ### 3. Usage in App
80
-
81
- Apply the theme class to the wrapper of the summary card component.
82
-
83
- ```html
84
- <div class="default-theme-summary-card">
85
- <lib-summary-card
86
- [config]="cardConfig"
87
- [theme]="'theme-1'"
88
- ></lib-summary-card>
89
- </div>
90
- ```
91
-
92
- ### Configuration Key Reference
93
-
94
- The `summary-card-theme` mixin accepts a map with the following optional keys. Any key not provided will fall back to its default value.
95
-
96
- | Key | Default | Description |
97
- | ------------------ | -------------------------------------- | ---------------------------------- |
98
- | **theme-1-border** | `1px solid #e8eaed` | Border for theme-1 cards |
99
- | **theme-1-shadow** | `0 1px 3px rgba(0, 0, 0, 0.1)` | Shadow for theme-1 cards |
100
- | **theme-1-bg** | `#ffffff` | Background color for theme-1 cards |
101
- | **theme-2-border** | `none` | Border for theme-2 cards |
102
- | **theme-2-shadow** | `0 10px 30px -10px rgba(0, 0, 0, 0.1)` | Shadow for theme-2 cards |
103
- | **theme-2-bg** | `#ffffff` | Background color for theme-2 cards |
104
-
105
- ### FAQ: Theme Configuration
106
-
107
- **Q: Where should I put the theme configuration?**
108
- A: In the `styles.scss` (or equivalent global stylesheet) of the application that is **rendering** the component.
109
-
110
- - If used in a **Remote MFE**: Define it in the MFE's `styles.scss`.
111
- - If used in the **Shell**: Define it in the Shell's `styles.scss`.
112
-
113
- **Q: Do I have to import it if I don't want to override anything?**
114
- A: **Yes**. The component relies 100% on CSS variables. If you do not include the mixin (even without arguments), variables will be undefined, and the component will look broken. Use `Option A` above to get the default look.
115
-
116
- ---
117
-
118
- ## API Reference
119
-
120
- ### Inputs
121
-
122
- | Input | Type | Default | Description |
123
- | -------- | ------------------------ | ----------- | ------------------------- |
124
- | `config` | `SummaryCardConfig` | required | Card configuration object |
125
- | `theme` | `'theme-1' \| 'theme-2'` | `'theme-1'` | Theme variant |
126
-
127
- ### Outputs
128
-
129
- | Output | Type | Description |
130
- | ----------- | -------------------- | ---------------------------- |
131
- | `cardClick` | `EventEmitter<void>` | Emitted when card is clicked |
132
-
133
- ### SummaryCardConfig Interface
134
-
135
- | Property | Type | Default | Description |
136
- | --------------------- | ---------------------- | ------------- | ---------------------------------------- |
137
- | `header` | `string` | required | Header text (usually uppercase label) |
138
- | `value` | `string` | required | Main value to display |
139
- | `description` | `string` | optional | Additional description text |
140
- | `icon` | `string` | optional | Material icon name (e.g., 'location_on') |
141
- | `iconImage` | `string` | optional | URL for custom image icon |
142
- | `descriptionPosition` | `'bottom' \| 'inline'` | `'bottom'` | Position of description text |
143
- | `valueColor` | `string` | theme default | Custom color for value text |
144
- | `headerColor` | `string` | theme default | Custom color for header text |
145
- | `descriptionColor` | `string` | theme default | Custom color for description text |
146
- | `iconColor` | `string` | theme default | Custom color for icon |
147
- | `iconBackgroundColor` | `string` | theme default | Background color for icon container |
148
- | `iconClass` | `string` | optional | Additional CSS classes for icon |
149
- | `valueClass` | `string` | optional | Additional CSS classes for value |
150
- | `headerClass` | `string` | optional | Additional CSS classes for header |
151
- | `descriptionClass` | `string` | optional | Additional CSS classes for description |
152
- | `isDisabled` | `boolean` | `false` | Disable click interaction |
153
- | `isClickable` | `boolean` | `true` | Whether card is clickable |
154
-
155
- ## Usage Examples
156
-
157
- ### Basic Example
158
-
159
- ```typescript
160
- import { SummaryCardModule } from "shared-ui";
161
-
162
- // In your component
163
- cardConfig = {
164
- header: "TOTAL GRANT AMOUNT",
165
- value: "₹ 25,00,000",
166
- description: "Across 3 campaigns",
167
- };
168
- ```
169
-
170
- ```html
171
- <lib-summary-card
172
- [config]="cardConfig"
173
- [theme]="'theme-1'"
174
- (cardClick)="onCardClick()"
175
- >
176
- </lib-summary-card>
177
- ```
178
-
179
- ### With Icon
180
-
181
- ```typescript
182
- cardConfig = {
183
- header: "APPROVED STATES",
184
- value: "02",
185
- description: "Karnataka, Maharashtra",
186
- icon: "location_on",
187
- iconBackgroundColor: "#fff0f0",
188
- iconColor: "#c21e25",
189
- };
190
- ```
191
-
192
- ### With Image
193
-
194
- ```typescript
195
- cardConfig = {
196
- header: "TOTAL BENEFICIARIES",
197
- value: "45,000",
198
- description: "Target",
199
- iconImage: "assets/icons/beneficiaries.png",
200
- iconBackgroundColor: "#fff7e6",
201
- iconColor: "#fa8c16",
202
- };
203
- ```
204
-
205
- ### With Inline Description
206
-
207
- ```typescript
208
- cardConfig = {
209
- header: "RECCE STATUS",
210
- value: "Completed",
211
- description: "75% Approval Rate",
212
- descriptionPosition: "inline", // Description appears on the right side of value
213
- valueColor: "#52c41a",
214
- };
215
- ```
216
-
217
- ### With Custom Colors
218
-
219
- ```typescript
220
- cardConfig = {
221
- header: "EXPECTED IMPACT",
222
- value: "2,150",
223
- description: "Beneficiaries found",
224
- valueColor: "#1890ff",
225
- headerColor: "#8c8c8c",
226
- descriptionColor: "#595959",
227
- };
228
- ```
229
-
230
- ## Themes
231
-
232
- ### Theme 1 (Clean & Minimal)
233
-
234
- - Clean borders and subtle shadows
235
- - Compact padding
236
- - Professional appearance
237
- - Best for dashboard layouts
238
-
239
- ### Theme 2 (Aesthetic & Modern)
240
-
241
- - No borders, elevated shadows
242
- - Generous padding
243
- - Modern gradient icon backgrounds
244
- - Best for landing pages and marketing content
245
-
246
- ## Responsive Design
247
-
248
- The component automatically adjusts for mobile devices:
249
-
250
- - Icon margins reduce on smaller screens
251
- - Font sizes scale down appropriately
252
- - Maintains readability and touch targets
253
-
254
- ## Accessibility
255
-
256
- - Semantic HTML structure
257
- - Proper color contrast ratios
258
- - Click events respect disabled state
259
- - Icon alt text support for images
260
-
261
- ## Playground Example
262
-
263
- You can use the following configuration in the UI Playground to test the component:
264
-
265
- ```json
266
- {
267
- "config": {
268
- "header": "TOTAL GRANT AMOUNT",
269
- "value": "₹ 25,00,000",
270
- "description": "Across 3 campaigns",
271
- "icon": "work_outline",
272
- "iconBackgroundColor": "#E3F2FD",
273
- "iconColor": "#1976D2"
274
- },
275
- "labels": {
276
- "iconAlt": "Grant Icon"
277
- }
278
- }
279
- ```
@@ -1,221 +0,0 @@
1
- # Table Column Configuration Module
2
-
3
- The `TableColumnConfigurationModule` provides a single component, `lib-table-column-configuration`, that lets an **end user** decide which **columns** of a Smart Table are **visible**, without touching the config by hand.
4
-
5
- It takes a `TableConfig` (the same config format used by `SmartTableModule`) as input and produces a **modified copy** of that config on demand. It is the table counterpart of [`lib-form-field-configuration`](./form-field-configuration.md) and is designed to be dropped inside a `cc-confirmation-modal` (a "Configure columns" dialog) on any list page.
6
-
7
- > The component only edits one thing per column: **visibility** (`isEnabled` / `visible`). It never changes labels, types, sorting, actions, or any other part of the config — only the `columns` array's visibility flags.
8
-
9
- ---
10
-
11
- ## Table of Contents
12
-
13
- - [Installation](#installation)
14
- - [Quick Start](#quick-start)
15
- - [How it works](#how-it-works)
16
- - [API Reference](#api-reference)
17
- - [Locking columns (non-hideable)](#locking-columns-non-hideable)
18
- - [Input → Output config](#input--output-config)
19
- - [Translating labels](#translating-labels)
20
- - [Making the table honour hidden columns](#making-the-table-honour-hidden-columns)
21
- - [Styling / theming](#styling--theming)
22
-
23
- ---
24
-
25
- ## Installation
26
-
27
- Import `TableColumnConfigurationModule` (and, typically, `ConfirmationModalModule`) into your Angular module:
28
-
29
- ```typescript
30
- import {
31
- TableColumnConfigurationModule,
32
- ConfirmationModalModule,
33
- } from 'commons-shared-web-ui';
34
-
35
- @NgModule({
36
- imports: [
37
- TableColumnConfigurationModule,
38
- ConfirmationModalModule,
39
- ],
40
- })
41
- export class DonorsModule {}
42
- ```
43
-
44
- ---
45
-
46
- ## Quick Start
47
-
48
- Put the component inside your "Configure columns" modal and read the result back on confirm using a template reference and `getUpdatedConfig()`.
49
-
50
- ```html
51
- <button (click)="openConfigure = true">Configure columns</button>
52
-
53
- <cc-confirmation-modal
54
- [isOpen]="openConfigure"
55
- [config]="{
56
- title: 'Configure columns',
57
- subtitle: 'Donors',
58
- confirmButton: { label: 'Save changes', type: 'primary' },
59
- size: 'md'
60
- }"
61
- (confirm)="onSaveColumnConfig()"
62
- (cancel)="openConfigure = false"
63
- (close)="openConfigure = false"
64
- >
65
- <lib-table-column-configuration
66
- #columnConfig
67
- [config]="tableConfig"
68
- [translate]="translateFn"
69
- />
70
- </cc-confirmation-modal>
71
- ```
72
-
73
- ```typescript
74
- import { ViewChild } from '@angular/core';
75
- import { TableColumnConfigurationComponent, TableConfig } from 'commons-shared-web-ui';
76
-
77
- export class DonorsPage {
78
- openConfigure = false;
79
- tableConfig: TableConfig = /* your master config */;
80
-
81
- @ViewChild('columnConfig') columnConfig!: TableColumnConfigurationComponent;
82
-
83
- // Optional: wire your i18n instant() so labels aren't raw keys
84
- translateFn = (key: string) => this.translate.instant(key);
85
-
86
- onSaveColumnConfig(): void {
87
- const updated = this.columnConfig.getUpdatedConfig();
88
- if (updated) {
89
- this.tableConfig = updated; // hand back the modified config
90
- // persist it / feed it to <lib-smart-table>, etc.
91
- }
92
- this.openConfigure = false;
93
- }
94
- }
95
- ```
96
-
97
- The dialog chrome (title, "Cancel" / "Save changes" buttons, scrolling body) is provided by `cc-confirmation-modal`. `lib-table-column-configuration` renders only the legend and the configurable column list.
98
-
99
- ---
100
-
101
- ## How it works
102
-
103
- 1. You pass a `TableConfig` via `[config]`.
104
- 2. The component **deep-clones** the config internally, so your object is **never mutated**.
105
- 3. It walks `config.columns` and renders one row per column with its label and a **visibility** toggle.
106
- 4. The user toggles visibility.
107
- 5. When you call `getUpdatedConfig()`, the current selections are written back onto the clone (`isEnabled` / `visible` per column) and a fresh copy is returned.
108
-
109
- Only the `columns` array is touched. `actions`, `topBarButtons`, `pagination`, `searchConfig`, etc. pass through untouched.
110
-
111
- ---
112
-
113
- ## API Reference
114
-
115
- | Input / Output / Method | Type | Default | Description |
116
- | :--- | :--- | :--- | :--- |
117
- | `[config]` | `TableConfig` | — | **Required.** The table config to configure. Deep-cloned internally; never mutated. |
118
- | `[translate]` | `(key: string) => string` | `undefined` | Optional label translator (e.g. ngx-translate `instant`). Applied to each column label at render time. |
119
- | `[showLegend]` | `boolean` | `true` | Show the "👁 Visible" legend row. |
120
- | `getUpdatedConfig()` | `() => TableConfig \| null` | — | **Method.** Returns a fresh, modified copy of the config with the current visibility choices applied. Returns `null` if no config has been loaded. Call it from your modal's confirm handler. |
121
-
122
- The component is `OnPush` and self-contained — it does **not** emit a live change event. Read the result on demand via `getUpdatedConfig()`.
123
-
124
- ---
125
-
126
- ## Locking columns (non-hideable)
127
-
128
- Some columns must always be present — e.g. you can't hide **Donor Name**. Mark them in the config with `lockVisibility` on the column:
129
-
130
- | Flag | Effect in the configurator |
131
- | :--- | :--- |
132
- | `lockVisibility: true` | The visibility toggle is replaced by a 🔒 lock icon. The column is always visible and cannot be turned off. |
133
-
134
- ```jsonc
135
- {
136
- "key": "name",
137
- "label": "PROGRAM_MANAGEMENT.DONORS.COLUMNS.DONOR_NAME",
138
- "type": "text",
139
- "sortable": true,
140
- "lockVisibility": true // can never be hidden
141
- }
142
- ```
143
-
144
- ---
145
-
146
- ## Input → Output config
147
-
148
- The component maps its one control onto the column's visibility flags, so the output plugs straight back into `<lib-smart-table>`:
149
-
150
- | UI control | Written to `TableColumn` |
151
- | :--- | :--- |
152
- | Visibility toggle | `isEnabled`, `visible` (both `true`/`false`) |
153
-
154
- **Example — before:**
155
-
156
- ```jsonc
157
- { "key": "website", "label": "...WEBSITE", "type": "text", "sortable": false }
158
- ```
159
-
160
- **After the user hides it:**
161
-
162
- ```jsonc
163
- { "key": "website", "label": "...WEBSITE", "type": "text", "sortable": false,
164
- "isEnabled": false, "visible": false }
165
- ```
166
-
167
- A column defaults to visible when both `isEnabled` and `visible` are absent.
168
-
169
- ---
170
-
171
- ## Translating labels
172
-
173
- Configs usually store i18n **keys** in `label` (e.g. `PROGRAM_MANAGEMENT.DONORS.COLUMNS.DONOR_NAME`). Pass a `translate` function to render human-readable labels — exactly like `lib-form-field-configuration`:
174
-
175
- ```typescript
176
- translateFn = (key: string) => this.translate.instant(key);
177
- ```
178
-
179
- ```html
180
- <lib-table-column-configuration [config]="tableConfig" [translate]="translateFn" />
181
- ```
182
-
183
- If `translate` is omitted, the raw label (or `key`) is shown. Translation is display-only — the output config keeps the original keys.
184
-
185
- ---
186
-
187
- ## Making the table honour hidden columns
188
-
189
- The configurator writes `isEnabled: false` onto hidden columns (the same convention `SmartTable` already uses for actions via `isEnabled !== false`). If your Smart Table should stop rendering hidden columns, filter them where you build/pass the config, e.g.:
190
-
191
- ```typescript
192
- const visibleConfig = {
193
- ...updated,
194
- columns: updated.columns.filter(c => c.isEnabled !== false),
195
- };
196
- ```
197
-
198
- ---
199
-
200
- ## Styling / theming
201
-
202
- The toggle and lock are **self-contained** (drawn in the module's own CSS) so they stay compact in the dense row. Everything ships neutral defaults and is themeable via CSS custom properties. Override any of these on a parent element:
203
-
204
- | Variable | Purpose | Default |
205
- | :--- | :--- | :--- |
206
- | `--tcc-toggle-on-bg` | Visibility toggle when ON | `#2f9e6f` (green) |
207
- | `--tcc-toggle-off-bg` | Visibility toggle when OFF | `#cbd2d9` |
208
- | `--tcc-toggle-width` / `--tcc-toggle-height` | Toggle pill size | `38px` / `22px` |
209
- | `--tcc-col-label-color` | Column label colour | `#1f2933` |
210
- | `--tcc-count-color` (legend) | Legend text colour | `#52606d` |
211
- | `--tcc-col-bg` / `--tcc-col-hover-bg` | Column row background / hover | `#ffffff` / `#f8fafc` |
212
- | `--tcc-eye-color` / `--tcc-eye-off-color` | Visible / hidden eye icon | `#6b7280` / `#b0b6be` |
213
- | `--tcc-lock-color` | Lock icon colour | `#9aa2ab` |
214
-
215
- Example — recolour the toggle to your brand:
216
-
217
- ```css
218
- lib-table-column-configuration {
219
- --tcc-toggle-on-bg: #1a73e8;
220
- }
221
- ```