commons-shared-web-ui 0.0.51 → 0.0.53

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 (215) hide show
  1. package/.claude/settings.local.json +10 -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 +599 -0
  11. package/documentation/form-components.md +384 -0
  12. package/documentation/form-field-configuration.md +250 -0
  13. package/documentation/nav.md +427 -0
  14. package/documentation/pagination.md +181 -0
  15. package/documentation/side-nav-documentation.md +169 -0
  16. package/documentation/smart-form.md +2532 -0
  17. package/documentation/smart-table.md +1221 -0
  18. package/documentation/snackbar.md +118 -0
  19. package/documentation/style-externalization.md +88 -0
  20. package/documentation/summary-card.md +279 -0
  21. package/documentation/table-column-configuration.md +221 -0
  22. package/ng-package.json +28 -0
  23. package/package.json +53 -34
  24. package/src/lib/modules/alert/alert.models.ts +6 -0
  25. package/src/lib/modules/alert/alert.module.ts +16 -0
  26. package/src/lib/modules/alert/components/alert/alert.component.html +27 -0
  27. package/src/lib/modules/alert/components/alert/alert.component.scss +92 -0
  28. package/src/lib/modules/alert/components/alert/alert.component.ts +81 -0
  29. package/src/lib/modules/button/button.models.ts +13 -0
  30. package/src/lib/modules/button/button.module.ts +16 -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/confirmation-modal/components/confirmation-modal/confirmation-modal.component.html +77 -0
  47. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.scss +395 -0
  48. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.ts +266 -0
  49. package/src/lib/modules/confirmation-modal/confirmation-modal.models.ts +71 -0
  50. package/src/lib/modules/confirmation-modal/confirmation-modal.module.ts +20 -0
  51. package/src/lib/modules/filter/components/filter/filter.component.html +131 -0
  52. package/src/lib/modules/filter/components/filter/filter.component.scss +245 -0
  53. package/src/lib/modules/filter/components/filter/filter.component.ts +216 -0
  54. package/src/lib/modules/filter/filter.models.ts +88 -0
  55. package/src/lib/modules/filter/filter.module.ts +24 -0
  56. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html +112 -0
  57. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss +186 -0
  58. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts +163 -0
  59. package/src/lib/modules/filter-sidebar/filter-sidebar.models.ts +95 -0
  60. package/src/lib/modules/filter-sidebar/filter-sidebar.module.ts +24 -0
  61. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.html +73 -0
  62. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.scss +321 -0
  63. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.ts +361 -0
  64. package/src/lib/modules/filter-table-selector/filter-table-selector.models.ts +91 -0
  65. package/src/lib/modules/filter-table-selector/filter-table-selector.module.ts +22 -0
  66. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.html +63 -0
  67. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.scss +496 -0
  68. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.ts +445 -0
  69. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.html +75 -0
  70. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.scss +210 -0
  71. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.ts +55 -0
  72. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.html +25 -0
  73. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.scss +82 -0
  74. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.ts +95 -0
  75. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.html +20 -0
  76. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.scss +37 -0
  77. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.ts +94 -0
  78. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.html +46 -0
  79. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.scss +102 -0
  80. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.ts +50 -0
  81. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.html +35 -0
  82. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.scss +67 -0
  83. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.ts +34 -0
  84. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.html +68 -0
  85. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.scss +113 -0
  86. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.ts +74 -0
  87. package/src/lib/modules/form-builder/configs/field-type-schema.map.ts +533 -0
  88. package/src/lib/modules/form-builder/form-builder.module.ts +36 -0
  89. package/src/lib/modules/form-builder/index.ts +9 -0
  90. package/src/lib/modules/form-builder/models/builder.models.ts +7 -0
  91. package/src/lib/modules/form-builder/models/field-configurator.models.ts +38 -0
  92. package/src/lib/modules/form-builder/models/field-selection.models.ts +51 -0
  93. package/src/lib/modules/form-builder/services/field-configurator.service.ts +258 -0
  94. package/src/lib/modules/form-builder/services/field-selection.service.ts +299 -0
  95. package/src/lib/modules/form-builder/services/form-schema-tree.service.ts +670 -0
  96. package/src/lib/modules/form-builder/tokens/builder.tokens.ts +10 -0
  97. package/src/lib/modules/form-builder/utils/constants.ts +43 -0
  98. package/src/lib/modules/form-components/components/checkbox/checkbox.component.html +29 -0
  99. package/src/lib/modules/form-components/components/checkbox/checkbox.component.scss +111 -0
  100. package/src/lib/modules/form-components/components/checkbox/checkbox.component.ts +207 -0
  101. package/src/lib/modules/form-components/components/checkbox/checkbox.models.ts +35 -0
  102. package/src/lib/modules/form-components/components/datepicker/datepicker.component.html +42 -0
  103. package/src/lib/modules/form-components/components/datepicker/datepicker.component.scss +115 -0
  104. package/src/lib/modules/form-components/components/datepicker/datepicker.component.ts +267 -0
  105. package/src/lib/modules/form-components/components/datepicker/datepicker.models.ts +45 -0
  106. package/src/lib/modules/form-components/components/dropdown/dropdown.component.html +74 -0
  107. package/src/lib/modules/form-components/components/dropdown/dropdown.component.scss +252 -0
  108. package/src/lib/modules/form-components/components/dropdown/dropdown.component.ts +377 -0
  109. package/src/lib/modules/form-components/components/dropdown/dropdown.models.ts +53 -0
  110. package/src/lib/modules/form-components/components/input/input.component.html +51 -0
  111. package/src/lib/modules/form-components/components/input/input.component.scss +128 -0
  112. package/src/lib/modules/form-components/components/input/input.component.ts +250 -0
  113. package/src/lib/modules/form-components/components/input/input.models.ts +55 -0
  114. package/src/lib/modules/form-components/components/radio/radio.component.html +22 -0
  115. package/src/lib/modules/form-components/components/radio/radio.component.scss +107 -0
  116. package/src/lib/modules/form-components/components/radio/radio.component.ts +181 -0
  117. package/src/lib/modules/form-components/components/radio/radio.models.ts +39 -0
  118. package/src/lib/modules/form-components/components/search/search.component.html +15 -0
  119. package/src/lib/modules/form-components/components/search/search.component.scss +87 -0
  120. package/src/lib/modules/form-components/components/search/search.component.ts +213 -0
  121. package/src/lib/modules/form-components/components/search/search.models.ts +40 -0
  122. package/src/lib/modules/form-components/components/toggle/toggle.component.html +15 -0
  123. package/src/lib/modules/form-components/components/toggle/toggle.component.scss +81 -0
  124. package/src/lib/modules/form-components/components/toggle/toggle.component.ts +166 -0
  125. package/src/lib/modules/form-components/components/toggle/toggle.models.ts +27 -0
  126. package/src/lib/modules/form-components/directives/click-outside.directive.ts +22 -0
  127. package/src/lib/modules/form-components/form-components.module.ts +41 -0
  128. package/src/lib/modules/form-field-configuration/components/_ffc-controls.scss +89 -0
  129. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.html +68 -0
  130. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.scss +73 -0
  131. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.ts +34 -0
  132. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.html +78 -0
  133. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.scss +83 -0
  134. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.ts +94 -0
  135. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.html +38 -0
  136. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.scss +42 -0
  137. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.ts +92 -0
  138. package/src/lib/modules/form-field-configuration/form-field-configuration.module.ts +23 -0
  139. package/src/lib/modules/form-field-configuration/index.ts +7 -0
  140. package/src/lib/modules/form-field-configuration/models/field-configuration.models.ts +62 -0
  141. package/src/lib/modules/form-field-configuration/services/config-schema-tree.service.ts +148 -0
  142. package/src/lib/modules/form-field-configuration/services/field-configuration.service.ts +228 -0
  143. package/src/lib/modules/material/material.module.ts +94 -0
  144. package/src/lib/modules/nav/components/nav/nav.component.html +34 -0
  145. package/src/lib/modules/nav/components/nav/nav.component.scss +171 -0
  146. package/src/lib/modules/nav/components/nav/nav.component.ts +82 -0
  147. package/src/lib/modules/nav/nav.models.ts +31 -0
  148. package/src/lib/modules/nav/nav.module.ts +17 -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/side-nav/components/side-nav/side-nav.component.html +56 -0
  154. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.scss +342 -0
  155. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.ts +135 -0
  156. package/src/lib/modules/side-nav/side-nav.models.ts +38 -0
  157. package/src/lib/modules/side-nav/side-nav.module.ts +16 -0
  158. package/src/lib/modules/smart-form/components/form-field/form-field.component.html +1196 -0
  159. package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +2014 -0
  160. package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +2782 -0
  161. package/src/lib/modules/smart-form/components/form-section/form-section.component.html +65 -0
  162. package/src/lib/modules/smart-form/components/form-section/form-section.component.scss +209 -0
  163. package/src/lib/modules/smart-form/components/form-section/form-section.component.ts +131 -0
  164. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.html +253 -0
  165. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.scss +689 -0
  166. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.ts +1131 -0
  167. package/src/lib/modules/smart-form/index.ts +10 -0
  168. package/src/lib/modules/smart-form/models/form-schema.model.ts +749 -0
  169. package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +21 -0
  170. package/src/lib/modules/smart-form/services/expression.service.ts +75 -0
  171. package/src/lib/modules/smart-form/services/smart-form-controller.service.ts +67 -0
  172. package/src/lib/modules/smart-form/smart-form.examples.ts +1324 -0
  173. package/src/lib/modules/smart-form/smart-form.module.ts +36 -0
  174. package/src/lib/modules/smart-form/utils/translation.utils.ts +82 -0
  175. package/src/lib/modules/smart-form/utils/trusted-url.pipe.ts +25 -0
  176. package/src/lib/modules/smart-form/utils/validation.utils.ts +98 -0
  177. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.html +283 -0
  178. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.scss +685 -0
  179. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.ts +1128 -0
  180. package/src/lib/modules/smart-table/models/table-config.model.ts +213 -0
  181. package/src/lib/modules/smart-table/smart-table.module.ts +30 -0
  182. package/src/lib/modules/smart-table/utils/safe-html.pipe.ts +28 -0
  183. package/src/lib/modules/smart-table/utils/smart-table.utils.ts +18 -0
  184. package/src/lib/modules/snackbar/components/snackbar.component.html +41 -0
  185. package/src/lib/modules/snackbar/components/snackbar.component.scss +99 -0
  186. package/src/lib/modules/snackbar/components/snackbar.component.ts +18 -0
  187. package/src/lib/modules/snackbar/models/snackbar.models.ts +10 -0
  188. package/src/lib/modules/snackbar/services/snackbar.service.ts +40 -0
  189. package/src/lib/modules/snackbar/snackbar.module.ts +11 -0
  190. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.html +47 -0
  191. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.scss +199 -0
  192. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.ts +126 -0
  193. package/src/lib/modules/summary-card/summary-card.module.ts +18 -0
  194. package/src/lib/modules/table-column-configuration/components/_tcc-controls.scss +53 -0
  195. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.html +47 -0
  196. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.scss +50 -0
  197. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.ts +33 -0
  198. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.html +30 -0
  199. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.scss +36 -0
  200. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.ts +78 -0
  201. package/src/lib/modules/table-column-configuration/index.ts +5 -0
  202. package/src/lib/modules/table-column-configuration/models/table-column-configuration.models.ts +20 -0
  203. package/src/lib/modules/table-column-configuration/services/table-column-configuration.service.ts +77 -0
  204. package/src/lib/modules/table-column-configuration/table-column-configuration.module.ts +21 -0
  205. package/src/lib/shared-ui.module.ts +50 -0
  206. package/src/lib/styles/utilities.scss +1 -0
  207. package/src/lib/utils/constants.ts +11 -0
  208. package/src/lib/utils/storage.utils.ts +37 -0
  209. package/src/lib/utils/string.utils.ts +23 -0
  210. package/src/lib/utils/translation.utils.ts +87 -0
  211. package/src/public-api.ts +121 -0
  212. package/tsconfig.lib.json +15 -0
  213. package/fesm2022/commons-shared-web-ui.mjs +0 -13828
  214. package/fesm2022/commons-shared-web-ui.mjs.map +0 -1
  215. package/index.d.ts +0 -4258
@@ -0,0 +1,88 @@
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
+ import { FilterItemType } from '../filter-sidebar/filter-sidebar.models';
9
+
10
+ // Reuse the same item structure as sidebar for consistency
11
+ export interface TableFilterItem {
12
+ key?: string;
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?: TableFilterItem[];
28
+ expanded?: boolean;
29
+
30
+ // Customization
31
+ styles?: { [key: string]: string };
32
+ }
33
+
34
+ export interface TableFilterConfig {
35
+ items: TableFilterItem[];
36
+
37
+ // Global Filter Styling
38
+ styles?: {
39
+ width?: string;
40
+ padding?: string;
41
+ gap?: string;
42
+ backgroundColor?: string;
43
+ borderRadius?: string;
44
+ headerHeight?: string;
45
+ };
46
+
47
+ columns?: TableFilterColumn[];
48
+
49
+ settings?: {
50
+ persistent?: boolean;
51
+ collapsible?: boolean;
52
+ };
53
+
54
+ // Actions visibility
55
+ actions?: {
56
+ clear?: { visible?: boolean; label?: string; };
57
+ apply?: { visible?: boolean; label?: string; };
58
+ }
59
+ }
60
+
61
+ export interface TableFilterColumn {
62
+ id: string;
63
+ label: string;
64
+ visible: boolean;
65
+ filterable?: boolean;
66
+ filterOptions?: any[]; // Legacy or simple options
67
+ }
68
+
69
+ export interface TableFilterLabels {
70
+ filterBtn: string;
71
+ clear: string;
72
+ apply: string;
73
+ search: string;
74
+ columns: string; // Tab label
75
+ showAll: string;
76
+ hideAll: string;
77
+ items?: string;
78
+ }
79
+
80
+ export interface TableFilterOutput {
81
+ [key: string]: any;
82
+ }
83
+
84
+ export interface TableFilterChangeEvent {
85
+ key: string;
86
+ value: any;
87
+ allFilters: TableFilterOutput;
88
+ }
@@ -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 { ButtonModule } from '../button/button.module';
6
+ import { FormComponentsModule } from '../form-components/form-components.module';
7
+ import { FilterComponent } from './components/filter/filter.component';
8
+
9
+ @NgModule({
10
+ declarations: [
11
+ FilterComponent
12
+ ],
13
+ imports: [
14
+ CommonModule,
15
+ FormsModule,
16
+ ReactiveFormsModule,
17
+ ButtonModule,
18
+ FormComponentsModule
19
+ ],
20
+ exports: [
21
+ FilterComponent
22
+ ]
23
+ })
24
+ export class FilterModule { }
@@ -0,0 +1,112 @@
1
+ <div class="cc-filter-sidebar" [ngStyle]="sidebarStyles" [class.collapsed]="isCollapsed">
2
+
3
+ <!-- Header -->
4
+ <div class="cc-filter-header" *ngIf="config.header?.visible !== false">
5
+ <div class="cc-header-content">
6
+ <span class="cc-header-title" *ngIf="config.header?.title">
7
+ <span *ngIf="config.header?.icon" [class]="config.header?.icon" class="cc-header-icon material-icons">
8
+ <!-- {{config.header?.icon }} -->
9
+ </span>
10
+ {{ config.header?.title }}
11
+ </span>
12
+ <ng-content select="[header-actions]"></ng-content>
13
+ </div>
14
+ <button type="button" *ngIf="config.settings?.collapsible" (click)="toggleCollapse()" class="cc-icon-btn"
15
+ [attr.aria-label]="isCollapsed ? config.labels?.expandAriaLabel : config.labels?.collapseAriaLabel">
16
+ <span class="material-icons">{{ isCollapsed ? 'menu_open' : 'menu' }}</span>
17
+ </button>
18
+ <button type="button" *ngIf="config.header?.showClose && !isCollapsed" (click)="onClose()"
19
+ class="cc-icon-btn cc-close-btn" [attr.aria-label]="config.labels?.closeAriaLabel">
20
+ <span class="material-icons">close</span>
21
+ </button>
22
+ <!-- Code snippet debug (optional) -->
23
+ <button type="button" *ngIf="config.settings?.showCodeSnippet" (click)="onShowCodeSnippet()" class="cc-icon-btn"
24
+ [attr.aria-label]="config.labels?.codeSnippetAriaLabel">
25
+ <span class="material-icons">code</span>
26
+ </button>
27
+ </div>
28
+
29
+ <!-- Content (Scrollable) -->
30
+ <div class="cc-filter-content" [class.hidden]="isCollapsed">
31
+ <ng-container *ngFor="let item of config.items; trackBy: trackByFn">
32
+ <ng-container *ngTemplateOutlet="itemTemplate; context: { item: item }"></ng-container>
33
+ </ng-container>
34
+ </div>
35
+
36
+ <!-- Footer -->
37
+ <div class="cc-filter-footer" *ngIf="config.footer?.visible !== false && !isCollapsed">
38
+ <lib-button variant="outline" color="warn" class="cc-btn-clear"
39
+ *ngIf="config.footer?.clearButton?.visible !== false" (click)="clearFilters()">
40
+ {{ config.footer?.clearButton?.label }}
41
+ </lib-button>
42
+ <lib-button variant="primary" color="warn" class="cc-btn-apply"
43
+ *ngIf="config.footer?.applyButton?.visible !== false" [disabled]="config.footer?.applyButton?.disabled ?? false"
44
+ (click)="applyFilters()">
45
+ {{ config.footer?.applyButton?.label }}
46
+ </lib-button>
47
+ </div>
48
+ </div>
49
+
50
+ <!-- Recursive Template for Items -->
51
+ <ng-template #itemTemplate let-item="item">
52
+ <div class="cc-filter-item" [ngClass]="['type-' + item.type]"
53
+ [style.display]="item.visible === false ? 'none' : 'block'" [ngStyle]="item.styles">
54
+
55
+ <ng-container [ngSwitch]="item.type">
56
+
57
+ <!-- Input -->
58
+ <lib-input *ngSwitchCase="'input'" [config]="item.inputConfig" [label]="item.label"
59
+ [ngModel]="filters[item.key]" (valueChange)="onValueChange(item.key, $event)">
60
+ </lib-input>
61
+
62
+ <!-- Dropdown -->
63
+ <lib-dropdown *ngSwitchCase="'dropdown'" [config]="item.dropdownConfig" [label]="item.label"
64
+ [ngModel]="filters[item.key]" (selectionChange)="onValueChange(item.key, $event)">
65
+ </lib-dropdown>
66
+
67
+ <!-- Checkbox -->
68
+ <lib-checkbox *ngSwitchCase="'checkbox'" [config]="item.checkboxConfig" [label]="item.label"
69
+ [checked]="!!filters[item.key]" (checkedChange)="onValueChange(item.key, $event)">
70
+ </lib-checkbox>
71
+
72
+ <!-- Radio -->
73
+ <lib-radio *ngSwitchCase="'radio'" [config]="item.radioConfig" [label]="item.label"
74
+ [ngModel]="filters[item.key]" (selectionChange)="onValueChange(item.key, $event)">
75
+ </lib-radio>
76
+
77
+ <!-- Toggle -->
78
+ <lib-toggle *ngSwitchCase="'toggle'" [config]="item.toggleConfig" [label]="item.label"
79
+ [checked]="filters[item.key]" (toggleChange)="onValueChange(item.key, $event)">
80
+ </lib-toggle>
81
+
82
+ <!-- Datepicker -->
83
+ <lib-datepicker *ngSwitchCase="'datepicker'" [config]="item.datepickerConfig" [label]="item.label"
84
+ [ngModel]="filters[item.key]" (dateChange)="onValueChange(item.key, $event)">
85
+ </lib-datepicker>
86
+
87
+ <!-- Search -->
88
+ <lib-search *ngSwitchCase="'active-search'" [config]="item.searchConfig" [label]="item.label"
89
+ [ngModel]="filters[item.key]" (search)="onValueChange(item.key, $event)">
90
+ </lib-search>
91
+
92
+ <!-- Group / Accordion -->
93
+ <div *ngSwitchCase="'group'" class="cc-accordion-item" [class.expanded]="item.expanded">
94
+ <button type="button" class="cc-accordion-header" (click)="item.expanded = !item.expanded">
95
+ <span class="cc-accordion-title">{{ item.label }}</span>
96
+ <span class="material-icons cc-accordion-icon">{{ item.expanded ? 'expand_less' : 'expand_more'
97
+ }}</span>
98
+ </button>
99
+
100
+ <div class="cc-accordion-body" *ngIf="item.expanded">
101
+ <ng-container *ngFor="let child of item.children; trackBy: trackByFn">
102
+ <ng-container *ngTemplateOutlet="itemTemplate; context: { item: child }"></ng-container>
103
+ </ng-container>
104
+ </div>
105
+ </div>
106
+
107
+ <!-- Custom Divider -->
108
+ <div *ngSwitchCase="'divider'" class="cc-filter-divider"></div>
109
+
110
+ </ng-container>
111
+ </div>
112
+ </ng-template>
@@ -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 { }