platformcommons-web-lib 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/commons-shared-web-ui-1.0.0.tgz +0 -0
  2. package/documentation/alert.md +123 -0
  3. package/documentation/button-dropdown.md +126 -0
  4. package/documentation/button.md +184 -0
  5. package/documentation/cards-usage-guidelines.md +131 -0
  6. package/documentation/configurable-form.md +605 -0
  7. package/documentation/confirmation-modal.md +250 -0
  8. package/documentation/filter-sidebar.md +178 -0
  9. package/documentation/filter-table-selector.md +228 -0
  10. package/documentation/form-builder.md +597 -0
  11. package/documentation/form-components.md +384 -0
  12. package/documentation/nav.md +427 -0
  13. package/documentation/pagination.md +181 -0
  14. package/documentation/side-nav-documentation.md +169 -0
  15. package/documentation/smart-form.md +2177 -0
  16. package/documentation/smart-table.md +1198 -0
  17. package/documentation/snackbar.md +118 -0
  18. package/documentation/style-externalization.md +88 -0
  19. package/documentation/summary-card.md +279 -0
  20. package/ng-package.json +28 -0
  21. package/package.json +54 -0
  22. package/src/lib/modules/alert/alert.models.ts +6 -0
  23. package/src/lib/modules/alert/alert.module.ts +16 -0
  24. package/src/lib/modules/alert/alert.theme.scss +85 -0
  25. package/src/lib/modules/alert/components/alert/alert.component.html +27 -0
  26. package/src/lib/modules/alert/components/alert/alert.component.scss +92 -0
  27. package/src/lib/modules/alert/components/alert/alert.component.ts +81 -0
  28. package/src/lib/modules/button/button.models.ts +13 -0
  29. package/src/lib/modules/button/button.module.ts +16 -0
  30. package/src/lib/modules/button/button.theme.scss +121 -0
  31. package/src/lib/modules/button/components/button/button.component.html +22 -0
  32. package/src/lib/modules/button/components/button/button.component.scss +88 -0
  33. package/src/lib/modules/button/components/button/button.component.ts +67 -0
  34. package/src/lib/modules/button-dropdown/button-dropdown.models.ts +26 -0
  35. package/src/lib/modules/button-dropdown/button-dropdown.module.ts +22 -0
  36. package/src/lib/modules/button-dropdown/button-dropdown.theme.scss +87 -0
  37. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.html +41 -0
  38. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.scss +135 -0
  39. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.ts +160 -0
  40. package/src/lib/modules/configurable-form/component/configurable-form.component.html +294 -0
  41. package/src/lib/modules/configurable-form/component/configurable-form.component.scss +503 -0
  42. package/src/lib/modules/configurable-form/component/configurable-form.component.ts +628 -0
  43. package/src/lib/modules/configurable-form/configurable-form.examples.ts +154 -0
  44. package/src/lib/modules/configurable-form/configurable-form.model.ts +131 -0
  45. package/src/lib/modules/configurable-form/configurable-form.module.ts +19 -0
  46. package/src/lib/modules/configurable-form/configurable-form.theme.scss +78 -0
  47. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.html +77 -0
  48. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.scss +395 -0
  49. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.ts +266 -0
  50. package/src/lib/modules/confirmation-modal/confirmation-modal.models.ts +71 -0
  51. package/src/lib/modules/confirmation-modal/confirmation-modal.module.ts +20 -0
  52. package/src/lib/modules/confirmation-modal/confirmation-modal.theme.scss +87 -0
  53. package/src/lib/modules/filter/components/filter/filter.component.html +131 -0
  54. package/src/lib/modules/filter/components/filter/filter.component.scss +245 -0
  55. package/src/lib/modules/filter/components/filter/filter.component.ts +216 -0
  56. package/src/lib/modules/filter/filter.models.ts +88 -0
  57. package/src/lib/modules/filter/filter.module.ts +24 -0
  58. package/src/lib/modules/filter/filter.theme.scss +92 -0
  59. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html +112 -0
  60. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss +186 -0
  61. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts +163 -0
  62. package/src/lib/modules/filter-sidebar/filter-sidebar.models.ts +95 -0
  63. package/src/lib/modules/filter-sidebar/filter-sidebar.module.ts +24 -0
  64. package/src/lib/modules/filter-sidebar/filter-sidebar.theme.scss +38 -0
  65. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.html +73 -0
  66. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.scss +321 -0
  67. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.ts +361 -0
  68. package/src/lib/modules/filter-table-selector/filter-table-selector.models.ts +91 -0
  69. package/src/lib/modules/filter-table-selector/filter-table-selector.module.ts +22 -0
  70. package/src/lib/modules/filter-table-selector/filter-table-selector.theme.scss +36 -0
  71. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.html +63 -0
  72. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.scss +496 -0
  73. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.ts +445 -0
  74. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.html +75 -0
  75. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.scss +210 -0
  76. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.ts +55 -0
  77. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.html +25 -0
  78. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.scss +82 -0
  79. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.ts +95 -0
  80. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.html +20 -0
  81. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.scss +37 -0
  82. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.ts +94 -0
  83. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.html +46 -0
  84. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.scss +102 -0
  85. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.ts +50 -0
  86. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.html +35 -0
  87. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.scss +67 -0
  88. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.ts +34 -0
  89. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.html +68 -0
  90. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.scss +113 -0
  91. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.ts +74 -0
  92. package/src/lib/modules/form-builder/configs/field-type-schema.map.ts +533 -0
  93. package/src/lib/modules/form-builder/form-builder.module.ts +36 -0
  94. package/src/lib/modules/form-builder/form-builder.theme.scss +212 -0
  95. package/src/lib/modules/form-builder/index.ts +9 -0
  96. package/src/lib/modules/form-builder/models/builder.models.ts +7 -0
  97. package/src/lib/modules/form-builder/models/field-configurator.models.ts +38 -0
  98. package/src/lib/modules/form-builder/models/field-selection.models.ts +51 -0
  99. package/src/lib/modules/form-builder/services/field-configurator.service.ts +258 -0
  100. package/src/lib/modules/form-builder/services/field-selection.service.ts +300 -0
  101. package/src/lib/modules/form-builder/services/form-schema-tree.service.ts +652 -0
  102. package/src/lib/modules/form-builder/tokens/builder.tokens.ts +10 -0
  103. package/src/lib/modules/form-builder/utils/constants.ts +43 -0
  104. package/src/lib/modules/form-components/components/checkbox/_theme.scss +63 -0
  105. package/src/lib/modules/form-components/components/checkbox/checkbox.component.html +29 -0
  106. package/src/lib/modules/form-components/components/checkbox/checkbox.component.scss +111 -0
  107. package/src/lib/modules/form-components/components/checkbox/checkbox.component.ts +207 -0
  108. package/src/lib/modules/form-components/components/checkbox/checkbox.models.ts +35 -0
  109. package/src/lib/modules/form-components/components/datepicker/_theme.scss +82 -0
  110. package/src/lib/modules/form-components/components/datepicker/datepicker.component.html +42 -0
  111. package/src/lib/modules/form-components/components/datepicker/datepicker.component.scss +115 -0
  112. package/src/lib/modules/form-components/components/datepicker/datepicker.component.ts +267 -0
  113. package/src/lib/modules/form-components/components/datepicker/datepicker.models.ts +45 -0
  114. package/src/lib/modules/form-components/components/dropdown/_theme.scss +91 -0
  115. package/src/lib/modules/form-components/components/dropdown/dropdown.component.html +74 -0
  116. package/src/lib/modules/form-components/components/dropdown/dropdown.component.scss +252 -0
  117. package/src/lib/modules/form-components/components/dropdown/dropdown.component.ts +377 -0
  118. package/src/lib/modules/form-components/components/dropdown/dropdown.models.ts +53 -0
  119. package/src/lib/modules/form-components/components/input/_theme.scss +77 -0
  120. package/src/lib/modules/form-components/components/input/input.component.html +51 -0
  121. package/src/lib/modules/form-components/components/input/input.component.scss +128 -0
  122. package/src/lib/modules/form-components/components/input/input.component.ts +250 -0
  123. package/src/lib/modules/form-components/components/input/input.models.ts +55 -0
  124. package/src/lib/modules/form-components/components/radio/_theme.scss +61 -0
  125. package/src/lib/modules/form-components/components/radio/radio.component.html +22 -0
  126. package/src/lib/modules/form-components/components/radio/radio.component.scss +107 -0
  127. package/src/lib/modules/form-components/components/radio/radio.component.ts +181 -0
  128. package/src/lib/modules/form-components/components/radio/radio.models.ts +39 -0
  129. package/src/lib/modules/form-components/components/search/_theme.scss +73 -0
  130. package/src/lib/modules/form-components/components/search/search.component.html +15 -0
  131. package/src/lib/modules/form-components/components/search/search.component.scss +87 -0
  132. package/src/lib/modules/form-components/components/search/search.component.ts +213 -0
  133. package/src/lib/modules/form-components/components/search/search.models.ts +40 -0
  134. package/src/lib/modules/form-components/components/toggle/_theme.scss +45 -0
  135. package/src/lib/modules/form-components/components/toggle/toggle.component.html +15 -0
  136. package/src/lib/modules/form-components/components/toggle/toggle.component.scss +81 -0
  137. package/src/lib/modules/form-components/components/toggle/toggle.component.ts +166 -0
  138. package/src/lib/modules/form-components/components/toggle/toggle.models.ts +27 -0
  139. package/src/lib/modules/form-components/directives/click-outside.directive.ts +22 -0
  140. package/src/lib/modules/form-components/form-components.module.ts +41 -0
  141. package/src/lib/modules/form-components/form-components.theme.scss +25 -0
  142. package/src/lib/modules/material/material.module.ts +94 -0
  143. package/src/lib/modules/nav/components/nav/nav.component.html +34 -0
  144. package/src/lib/modules/nav/components/nav/nav.component.scss +171 -0
  145. package/src/lib/modules/nav/components/nav/nav.component.ts +82 -0
  146. package/src/lib/modules/nav/nav.models.ts +31 -0
  147. package/src/lib/modules/nav/nav.module.ts +17 -0
  148. package/src/lib/modules/nav/nav.theme.scss +86 -0
  149. package/src/lib/modules/pagination/components/pagination/pagination.component.html +52 -0
  150. package/src/lib/modules/pagination/components/pagination/pagination.component.scss +155 -0
  151. package/src/lib/modules/pagination/components/pagination/pagination.component.ts +109 -0
  152. package/src/lib/modules/pagination/pagination.module.ts +17 -0
  153. package/src/lib/modules/pagination/pagination.theme.scss +66 -0
  154. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.html +56 -0
  155. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.scss +342 -0
  156. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.ts +135 -0
  157. package/src/lib/modules/side-nav/side-nav.models.ts +38 -0
  158. package/src/lib/modules/side-nav/side-nav.module.ts +16 -0
  159. package/src/lib/modules/side-nav/side-nav.theme.scss +111 -0
  160. package/src/lib/modules/smart-form/components/form-field/form-field.component.html +1109 -0
  161. package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +1860 -0
  162. package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +2232 -0
  163. package/src/lib/modules/smart-form/components/form-section/form-section.component.html +64 -0
  164. package/src/lib/modules/smart-form/components/form-section/form-section.component.scss +209 -0
  165. package/src/lib/modules/smart-form/components/form-section/form-section.component.ts +119 -0
  166. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.html +253 -0
  167. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.scss +689 -0
  168. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.ts +1087 -0
  169. package/src/lib/modules/smart-form/index.ts +10 -0
  170. package/src/lib/modules/smart-form/models/form-schema.model.ts +700 -0
  171. package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +21 -0
  172. package/src/lib/modules/smart-form/services/expression.service.ts +75 -0
  173. package/src/lib/modules/smart-form/services/smart-form-controller.service.ts +65 -0
  174. package/src/lib/modules/smart-form/smart-form.examples.ts +1324 -0
  175. package/src/lib/modules/smart-form/smart-form.module.ts +36 -0
  176. package/src/lib/modules/smart-form/smart-form.theme.scss +890 -0
  177. package/src/lib/modules/smart-form/utils/translation.utils.ts +82 -0
  178. package/src/lib/modules/smart-form/utils/trusted-url.pipe.ts +25 -0
  179. package/src/lib/modules/smart-form/utils/validation.utils.ts +98 -0
  180. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.html +283 -0
  181. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.scss +685 -0
  182. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.ts +1118 -0
  183. package/src/lib/modules/smart-table/models/table-config.model.ts +202 -0
  184. package/src/lib/modules/smart-table/smart-table.module.ts +30 -0
  185. package/src/lib/modules/smart-table/smart-table.theme.scss +335 -0
  186. package/src/lib/modules/smart-table/utils/safe-html.pipe.ts +22 -0
  187. package/src/lib/modules/smart-table/utils/smart-table.utils.ts +18 -0
  188. package/src/lib/modules/snackbar/components/snackbar.component.html +41 -0
  189. package/src/lib/modules/snackbar/components/snackbar.component.scss +99 -0
  190. package/src/lib/modules/snackbar/components/snackbar.component.ts +18 -0
  191. package/src/lib/modules/snackbar/models/snackbar.models.ts +10 -0
  192. package/src/lib/modules/snackbar/services/snackbar.service.ts +40 -0
  193. package/src/lib/modules/snackbar/snackbar.module.ts +11 -0
  194. package/src/lib/modules/snackbar/snackbar.theme.scss +93 -0
  195. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.html +47 -0
  196. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.scss +199 -0
  197. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.ts +126 -0
  198. package/src/lib/modules/summary-card/summary-card.module.ts +18 -0
  199. package/src/lib/modules/summary-card/summary-card.theme.scss +176 -0
  200. package/src/lib/shared-ui.module.ts +44 -0
  201. package/src/lib/styles/global.scss +152 -0
  202. package/src/lib/styles/utilities.scss +250 -0
  203. package/src/lib/utils/constants.ts +11 -0
  204. package/src/lib/utils/storage.utils.ts +37 -0
  205. package/src/lib/utils/string.utils.ts +23 -0
  206. package/src/lib/utils/translation.utils.ts +87 -0
  207. package/src/public-api.ts +104 -0
  208. package/tsconfig.lib.json +15 -0
@@ -0,0 +1,186 @@
1
+ @use '../../filter-sidebar.theme' as theme;
2
+
3
+ :host {
4
+ display: block;
5
+ height: 100%;
6
+
7
+ @include theme.filter-sidebar-theme();
8
+ }
9
+
10
+ .cc-filter-sidebar {
11
+ display: flex;
12
+ flex-direction: column;
13
+ height: 100%;
14
+ width: var(--cc-filter-sidebar-width, 280px);
15
+ background-color: var(--cc-filter-sidebar-bg, #FEFEFE);
16
+ padding: var(--cc-filter-sidebar-padding, 1.5rem);
17
+ box-sizing: border-box;
18
+ overflow: hidden;
19
+ border-radius: var(--cc-filter-sidebar-border-radius, 0);
20
+ transition: width 0.3s ease, padding 0.3s ease;
21
+
22
+ &.collapsed {
23
+ width: 60px !important;
24
+ padding: 1.5rem 0.5rem;
25
+
26
+ .cc-filter-header {
27
+ justify-content: center;
28
+ margin-bottom: 0;
29
+
30
+ .cc-header-content {
31
+ display: none;
32
+ }
33
+
34
+ .cc-close-btn {
35
+ display: none;
36
+ }
37
+ }
38
+
39
+ .cc-filter-content {
40
+ display: none;
41
+ }
42
+ }
43
+ }
44
+
45
+ .cc-filter-header {
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: space-between;
49
+ min-height: var(--cc-filter-header-height, 3rem);
50
+ margin-bottom: 1rem;
51
+ flex-shrink: 0;
52
+
53
+ .cc-header-content {
54
+ display: flex;
55
+ align-items: center;
56
+ gap: 0.5rem;
57
+ flex: 1;
58
+ }
59
+
60
+ .cc-header-title {
61
+ font-size: var(--cc-filter-header-title-size, 1.125rem);
62
+ font-weight: var(--cc-filter-header-title-weight, 500);
63
+ color: var(--cc-filter-header-title-color, #202124);
64
+ display: flex;
65
+ align-items: center;
66
+ gap: 0.5rem;
67
+ }
68
+ }
69
+
70
+ .cc-filter-content {
71
+ flex: 1;
72
+ overflow-y: auto;
73
+ display: flex;
74
+ flex-direction: column;
75
+ gap: var(--cc-filter-sidebar-gap, 1.5rem);
76
+ padding-right: 0.25rem; // Space for scrollbar
77
+
78
+ // Custom Scrollbar
79
+ &::-webkit-scrollbar {
80
+ width: 6px;
81
+ }
82
+
83
+ &::-webkit-scrollbar-thumb {
84
+ background-color: #E0E0E0;
85
+ border-radius: 3px;
86
+ }
87
+ }
88
+
89
+ .cc-filter-item {}
90
+
91
+ // Accordion overrides
92
+ .cc-accordion-item {
93
+ border-bottom: 1px solid #E0E0E0;
94
+
95
+ &:last-child {
96
+ border-bottom: none;
97
+ }
98
+
99
+ .cc-accordion-header {
100
+ display: flex;
101
+ align-items: center;
102
+ justify-content: space-between;
103
+ width: 100%;
104
+ padding: 0.75rem 0;
105
+ background: none;
106
+ border: none;
107
+ cursor: pointer;
108
+ text-align: left;
109
+ outline: none;
110
+
111
+ .cc-accordion-title {
112
+ font-size: 0.875rem;
113
+ font-weight: 500;
114
+ color: #202124;
115
+ }
116
+
117
+ .cc-accordion-icon {
118
+ color: #5F6368;
119
+ transition: transform 0.2s;
120
+ }
121
+ }
122
+
123
+ .cc-accordion-body {
124
+ padding: 0 0 1rem 0;
125
+ display: flex;
126
+ flex-direction: column;
127
+ gap: 1rem;
128
+ animation: slideDown 0.2s ease-out;
129
+ }
130
+ }
131
+
132
+ @keyframes slideDown {
133
+ from {
134
+ opacity: 0;
135
+ transform: translateY(-5px);
136
+ }
137
+
138
+ to {
139
+ opacity: 1;
140
+ transform: translateY(0);
141
+ }
142
+ }
143
+
144
+ .cc-group-content {
145
+ display: flex;
146
+ flex-direction: column;
147
+ gap: 1rem;
148
+ }
149
+
150
+ .cc-filter-divider {
151
+ height: 1px;
152
+ background-color: #E0E0E0;
153
+ margin: 0.5rem 0;
154
+ }
155
+
156
+ .cc-filter-footer {
157
+ display: flex;
158
+ gap: var(--cc-filter-footer-gap, 1rem);
159
+ padding: var(--cc-filter-footer-padding, 1rem 0 0 0);
160
+ margin-top: auto;
161
+ flex-shrink: 0;
162
+
163
+ button {
164
+ flex: 1;
165
+ }
166
+ }
167
+
168
+ .cc-icon-btn {
169
+ background: none;
170
+ border: none;
171
+ cursor: pointer;
172
+ color: #5F6368;
173
+ padding: 0.5rem;
174
+ border-radius: 50%;
175
+ display: flex;
176
+ align-items: center;
177
+ justify-content: center;
178
+
179
+ &:hover {
180
+ background-color: rgba(0, 0, 0, 0.04);
181
+ }
182
+ }
183
+
184
+ .cc-close-btn {
185
+ margin-right: -0.5rem;
186
+ }
@@ -0,0 +1,163 @@
1
+ import { Component, EventEmitter, Input, OnInit, Output, forwardRef } from '@angular/core';
2
+ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
3
+ import { Router, ActivatedRoute } from '@angular/router';
4
+ import { FilterSidebarChangeEvent, FilterSidebarConfig, FilterSidebarOutput, FilterItem } from '../../filter-sidebar.models';
5
+
6
+ @Component({
7
+ selector: 'lib-filter-sidebar',
8
+ templateUrl: './filter-sidebar.component.html',
9
+ styleUrls: ['./filter-sidebar.component.scss'],
10
+ standalone: false,
11
+ providers: [
12
+ {
13
+ provide: NG_VALUE_ACCESSOR,
14
+ useExisting: forwardRef(() => FilterSidebarComponent),
15
+ multi: true
16
+ }
17
+ ]
18
+ })
19
+ export class FilterSidebarComponent implements OnInit, ControlValueAccessor {
20
+ @Input() config!: FilterSidebarConfig;
21
+ @Input() initialFilters: FilterSidebarOutput = {};
22
+
23
+ @Output() filterChange = new EventEmitter<FilterSidebarChangeEvent>();
24
+ @Output() filterApply = new EventEmitter<FilterSidebarOutput>();
25
+ @Output() filterClear = new EventEmitter<void>();
26
+ @Output() showCodeSnippet = new EventEmitter<void>();
27
+ @Output() close = new EventEmitter<void>();
28
+
29
+ filters: FilterSidebarOutput = {};
30
+
31
+ // ControlValueAccessor callbacks
32
+ onChange: any = () => { };
33
+ onTouched: any = () => { };
34
+
35
+ isCollapsed = false;
36
+
37
+ toggleCollapse(): void {
38
+ this.isCollapsed = !this.isCollapsed;
39
+ }
40
+
41
+ constructor(
42
+ private router: Router,
43
+ private route: ActivatedRoute
44
+ ) { }
45
+
46
+ ngOnInit(): void {
47
+ if (this.initialFilters) {
48
+ this.filters = { ...this.initialFilters };
49
+ }
50
+
51
+ // Initialize from URL query params if persistent
52
+ if (this.config.settings?.persistent !== false) {
53
+ this.route.queryParams.subscribe(params => {
54
+ if (Object.keys(params).length > 0) {
55
+ // Start with existing filters to preserve defaults not in URL
56
+ const newFilters = { ...this.filters };
57
+
58
+ Object.keys(params).forEach(key => {
59
+ // Try to parse arrays or numbers if possible, otherwise string
60
+ // This is a naive implementation, ideally config should dictate type
61
+ const val = params[key];
62
+ // If comma separated and looked like array? For now keep simple
63
+ newFilters[key] = val;
64
+ });
65
+
66
+ this.filters = newFilters;
67
+ }
68
+ });
69
+ }
70
+ }
71
+
72
+ // ControlValueAccessor Implementation
73
+ writeValue(value: any): void {
74
+ if (value) {
75
+ this.filters = { ...value };
76
+ } else {
77
+ this.filters = {};
78
+ }
79
+ }
80
+
81
+ registerOnChange(fn: any): void {
82
+ this.onChange = fn;
83
+ }
84
+
85
+ registerOnTouched(fn: any): void {
86
+ this.onTouched = fn;
87
+ }
88
+
89
+ // Component Logic
90
+ onValueChange(key: string | undefined, value: any): void {
91
+ if (!key) return;
92
+
93
+ this.filters[key] = value;
94
+ this.notifyChanges(key, value);
95
+ }
96
+
97
+ private notifyChanges(key: string, value: any): void {
98
+ this.onChange(this.filters);
99
+
100
+ // Update URL if persistent
101
+ if (this.config.settings?.persistent !== false) {
102
+ this.updateUrl();
103
+ }
104
+
105
+ this.filterChange.emit({
106
+ key,
107
+ value,
108
+ allFilters: this.filters
109
+ });
110
+ }
111
+
112
+ private updateUrl(): void {
113
+ this.router.navigate([], {
114
+ relativeTo: this.route,
115
+ queryParams: this.filters,
116
+ queryParamsHandling: 'merge',
117
+ replaceUrl: true
118
+ });
119
+ }
120
+
121
+ applyFilters(): void {
122
+ this.filterApply.emit(this.filters);
123
+ }
124
+
125
+ clearFilters(): void {
126
+ this.filters = {};
127
+ this.onChange(this.filters);
128
+
129
+ if (this.config.settings?.persistent !== false) {
130
+ this.router.navigate([], {
131
+ relativeTo: this.route,
132
+ queryParams: {},
133
+ });
134
+ }
135
+
136
+ this.filterClear.emit();
137
+ }
138
+
139
+ onClose(): void {
140
+ this.close.emit();
141
+ }
142
+
143
+ onShowCodeSnippet(): void {
144
+ this.showCodeSnippet.emit();
145
+ }
146
+
147
+ get sidebarStyles(): { [key: string]: string } {
148
+ const styles: { [key: string]: string } = {};
149
+ if (this.config?.styles) {
150
+ if (this.config.styles.width) styles['--cc-filter-sidebar-width'] = this.config.styles.width;
151
+ if (this.config.styles.padding) styles['--cc-filter-sidebar-padding'] = this.config.styles.padding;
152
+ if (this.config.styles.gap) styles['--cc-filter-sidebar-gap'] = this.config.styles.gap;
153
+ if (this.config.styles.backgroundColor) styles['--cc-filter-sidebar-bg'] = this.config.styles.backgroundColor;
154
+ if (this.config.styles.headerHeight) styles['--cc-filter-header-height'] = this.config.styles.headerHeight;
155
+ if (this.config.styles.borderRadius) styles['--cc-filter-sidebar-border-radius'] = this.config.styles.borderRadius;
156
+ }
157
+ return styles;
158
+ }
159
+
160
+ trackByFn(index: number, item: FilterItem): any {
161
+ return item.key || index;
162
+ }
163
+ }
@@ -0,0 +1,95 @@
1
+ import { InputConfig } from '../form-components/components/input/input.models';
2
+ import { DropdownConfig } from '../form-components/components/dropdown/dropdown.models';
3
+ import { CheckboxConfig } from '../form-components/components/checkbox/checkbox.models';
4
+ import { RadioConfig } from '../form-components/components/radio/radio.models';
5
+ import { ToggleConfig } from '../form-components/components/toggle/toggle.models';
6
+ import { DatePickerConfig } from '../form-components/components/datepicker/datepicker.models';
7
+ import { FilterSearchConfig } from '../form-components/components/search/search.models';
8
+
9
+ export type FilterItemType = 'input' | 'dropdown' | 'checkbox' | 'radio' | 'toggle' | 'datepicker' | 'active-search' | 'group' | 'custom' | 'divider';
10
+
11
+ export interface FilterItem {
12
+ key?: string; // Optional for dividers or purely layout groups
13
+ type: FilterItemType;
14
+ label?: string;
15
+ visible?: boolean;
16
+
17
+ // Component Configs
18
+ inputConfig?: InputConfig;
19
+ dropdownConfig?: DropdownConfig;
20
+ checkboxConfig?: CheckboxConfig;
21
+ radioConfig?: RadioConfig;
22
+ toggleConfig?: ToggleConfig;
23
+ datepickerConfig?: DatePickerConfig;
24
+ searchConfig?: FilterSearchConfig;
25
+
26
+ // Layout / Grouping
27
+ children?: FilterItem[]; // For groups/accordions
28
+ expanded?: boolean; // For accordions
29
+
30
+ // Customization
31
+ styles?: { [key: string]: string }; // Container styles override
32
+ }
33
+
34
+ export interface FilterSidebarConfig {
35
+ items: FilterItem[];
36
+
37
+ // Global Sidebar Styling
38
+ styles?: {
39
+ width?: string;
40
+ padding?: string;
41
+ gap?: string;
42
+ backgroundColor?: string;
43
+ headerHeight?: string;
44
+ borderRadius?: string;
45
+ };
46
+
47
+ header?: {
48
+ title?: string;
49
+ icon?: string;
50
+ visible?: boolean;
51
+ showClose?: boolean;
52
+ };
53
+
54
+ footer?: {
55
+ visible?: boolean;
56
+ applyButton?: {
57
+ label?: string;
58
+ visible?: boolean;
59
+ disabled?: boolean;
60
+ };
61
+ clearButton?: {
62
+ label?: string;
63
+ visible?: boolean;
64
+ };
65
+ };
66
+
67
+ settings?: {
68
+ collapsible?: boolean; // If the whole sidebar is collapsible
69
+ persistent?: boolean; // URL sync
70
+ showCodeSnippet?: boolean;
71
+ };
72
+
73
+ // i18n Labels
74
+ labels?: {
75
+ collapseAriaLabel?: string;
76
+ expandAriaLabel?: string;
77
+ closeAriaLabel?: string;
78
+ codeSnippetAriaLabel?: string;
79
+ };
80
+ }
81
+
82
+ export interface FilterSidebarOutput {
83
+ [key: string]: any;
84
+ }
85
+
86
+ export interface FilterSidebarChangeEvent {
87
+ key: string;
88
+ value: any;
89
+ allFilters: FilterSidebarOutput;
90
+ }
91
+
92
+ // Backward compatibility aliases
93
+ export type FilterConfig = FilterSidebarConfig;
94
+ export type FilterChangeEvent = FilterSidebarChangeEvent;
95
+ export type FilterOutput = FilterSidebarOutput;
@@ -0,0 +1,24 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
4
+
5
+ import { FilterSidebarComponent } from './components/filter-sidebar/filter-sidebar.component';
6
+ import { FormComponentsModule } from '../form-components/form-components.module';
7
+ import { ButtonModule } from '../button/button.module';
8
+
9
+ @NgModule({
10
+ declarations: [
11
+ FilterSidebarComponent
12
+ ],
13
+ imports: [
14
+ CommonModule,
15
+ FormsModule,
16
+ ReactiveFormsModule,
17
+ FormComponentsModule,
18
+ ButtonModule
19
+ ],
20
+ exports: [
21
+ FilterSidebarComponent
22
+ ]
23
+ })
24
+ export class FilterSidebarModule { }
@@ -0,0 +1,38 @@
1
+ @use 'sass:map';
2
+
3
+ $default-filter-sidebar-config: (
4
+ // Layout
5
+ width: 100%,
6
+ padding: 1.5rem,
7
+ gap: 1.5rem,
8
+ bg: #FEFEFE,
9
+ border-radius: 0,
10
+
11
+ // Header
12
+ header-height: 3rem,
13
+ header-title-size: 1.125rem,
14
+ header-title-weight: 500,
15
+ header-title-color: #202124,
16
+
17
+ // Footer
18
+ footer-padding: 1rem 0 0 0,
19
+ footer-gap: 1rem,
20
+ );
21
+
22
+ @mixin filter-sidebar-theme($user-config: ()) {
23
+ $config: map.merge($default-filter-sidebar-config, $user-config);
24
+
25
+ --cc-filter-sidebar-width: #{map.get($config, width)};
26
+ --cc-filter-sidebar-padding: #{map.get($config, padding)};
27
+ --cc-filter-sidebar-gap: #{map.get($config, gap)};
28
+ --cc-filter-sidebar-bg: #{map.get($config, bg)};
29
+ --cc-filter-sidebar-border-radius: #{map.get($config, border-radius)};
30
+
31
+ --cc-filter-header-height: #{map.get($config, header-height)};
32
+ --cc-filter-header-title-size: #{map.get($config, header-title-size)};
33
+ --cc-filter-header-title-weight: #{map.get($config, header-title-weight)};
34
+ --cc-filter-header-title-color: #{map.get($config, header-title-color)};
35
+
36
+ --cc-filter-footer-padding: #{map.get($config, footer-padding)};
37
+ --cc-filter-footer-gap: #{map.get($config, footer-gap)};
38
+ }
@@ -0,0 +1,73 @@
1
+ <div class="fts-container">
2
+
3
+ <!-- ── Modal Header ──────────────────────────────────────────────────────── -->
4
+ <div class="fts-header" *ngIf="config?.title">
5
+ <h2 class="fts-header__title">{{ titleLabel }}</h2>
6
+ </div>
7
+
8
+ <!-- ── Body: Filter Panel + Table Panel ──────────────────────────────────── -->
9
+ <div class="fts-body" *ngIf="config">
10
+
11
+ <!-- LEFT: Filter Panel -->
12
+ <aside class="fts-filter-panel" [class.fts-filter-panel--hidden]="!filterPanelVisible">
13
+
14
+ <div class="fts-filter-panel__header">
15
+ <span class="fts-filter-panel__title">{{ translate('COMMON.FILTER_TABLE.FILTER_BY') || 'Filter By' }}</span>
16
+ </div>
17
+
18
+ <div class="fts-filter-panel__content">
19
+ <!-- SmartForm renders the dynamic filter form. -->
20
+ <ng-container *ngIf="resolvedFormJson && formVersion >= 0">
21
+ <lib-smart-form [formJson]="resolvedFormJson" [labels]="labels" [initialValues]="resolvedInitialValues"
22
+ (valueChange)="onFormValueChange($event)">
23
+ </lib-smart-form>
24
+ </ng-container>
25
+ </div>
26
+
27
+ </aside>
28
+
29
+ <!-- RIGHT: Table Panel -->
30
+ <section class="fts-table-panel">
31
+
32
+ <!-- Table toolbar: selection count -->
33
+ <!-- <div class="fts-table-panel__toolbar">
34
+ <span class="fts-selection-count" *ngIf="config.selectionConfig?.selectionCountLabel">
35
+ {{ selectionCountText }}
36
+ </span>
37
+ </div> -->
38
+
39
+ <!-- SmartTable -->
40
+ <div class="fts-table-wrapper">
41
+ <lib-smart-table *ngIf="resolvedTableConfig" [config]="resolvedTableConfig" [selectedRows]="selectedRows"
42
+ (rowSelect)="onRowSelect($event)">
43
+ </lib-smart-table>
44
+ </div>
45
+
46
+ </section>
47
+
48
+ </div>
49
+
50
+ <!-- ── Footer Action Bar ─────────────────────────────────────────────────── -->
51
+ <div class="fts-footer">
52
+ <div class="fts-footer__left">
53
+ <lib-button id="fts-clear-filter-btn" variant="outline" (click)="onClearFilter()">
54
+ {{ clearFilterButtonLabel }}
55
+ </lib-button>
56
+
57
+ <lib-button id="fts-apply-filter-btn" variant="primary" (click)="applyCurrentFilter()">
58
+ {{ applyFilterButtonLabel }}
59
+ </lib-button>
60
+ </div>
61
+
62
+ <div class="fts-footer__right">
63
+ <lib-button id="fts-cancel-btn" variant="outline" (click)="handleCancel()">
64
+ {{ cancelButtonLabel }}
65
+ </lib-button>
66
+
67
+ <lib-button id="fts-submit-btn" variant="primary" (click)="handleSubmit()">
68
+ {{ submitButtonLabel }}
69
+ </lib-button>
70
+ </div>
71
+ </div>
72
+
73
+ </div>