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,94 @@
1
+ import { NgModule } from "@angular/core";
2
+ import { MatCardModule } from '@angular/material/card';
3
+ import { MatSnackBarModule } from "@angular/material/snack-bar";
4
+ import { MatCheckboxModule } from '@angular/material/checkbox'
5
+ import { MatDividerModule } from '@angular/material/divider';
6
+ import { MatRadioModule } from '@angular/material/radio';
7
+ import { MatDialogModule } from "@angular/material/dialog";
8
+ import { MatFormFieldModule } from '@angular/material/form-field';
9
+ import { MatIconModule } from '@angular/material/icon';
10
+ import { MatButtonModule } from "@angular/material/button";
11
+ import { MatMenuModule } from '@angular/material/menu';
12
+ import { MatDatepickerModule } from '@angular/material/datepicker';
13
+ import { MatTabsModule } from '@angular/material/tabs';
14
+ import { MatNativeDateModule } from "@angular/material/core";
15
+ import { MatInputModule } from '@angular/material/input';
16
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
17
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
18
+ import { MatSelectModule } from '@angular/material/select';
19
+ import { MatTooltipModule } from '@angular/material/tooltip';
20
+ import {MatSliderModule} from '@angular/material/slider';
21
+ import {MatListModule} from '@angular/material/list';
22
+ import {MatChipsModule} from '@angular/material/chips';
23
+ import {MatPaginatorModule} from '@angular/material/paginator';
24
+ import {MatTableModule} from '@angular/material/table';
25
+ import {MatExpansionModule} from '@angular/material/expansion';
26
+ import {CdkAccordionModule} from '@angular/cdk/accordion';
27
+ import { MatSortModule } from "@angular/material/sort";
28
+ import {MatAutocompleteModule} from '@angular/material/autocomplete';
29
+ import {MatSlideToggleModule} from '@angular/material/slide-toggle';
30
+ import {MatButtonToggleModule} from '@angular/material/button-toggle';
31
+
32
+ @NgModule({
33
+ imports: [
34
+ MatCardModule,
35
+ MatSnackBarModule,
36
+ MatCheckboxModule,
37
+ MatDividerModule,
38
+ MatSelectModule,
39
+ MatRadioModule,
40
+ MatDialogModule,
41
+ MatFormFieldModule,
42
+ MatDatepickerModule,
43
+ MatNativeDateModule,
44
+ MatInputModule,
45
+ MatIconModule,
46
+ MatProgressSpinnerModule,
47
+ MatTabsModule,
48
+ MatButtonModule,
49
+ MatMenuModule,
50
+ MatTabsModule,
51
+ MatProgressBarModule,
52
+ MatTooltipModule,
53
+ MatSliderModule,
54
+ MatListModule,
55
+ MatChipsModule,
56
+ MatSortModule,
57
+ MatAutocompleteModule,
58
+ MatSlideToggleModule,
59
+ MatButtonToggleModule
60
+ ],
61
+ exports: [
62
+ MatCardModule,
63
+ MatSnackBarModule,
64
+ MatCheckboxModule,
65
+ MatDividerModule,
66
+ MatSelectModule,
67
+ MatRadioModule,
68
+ MatDialogModule,
69
+ MatFormFieldModule,
70
+ MatDatepickerModule,
71
+ MatNativeDateModule,
72
+ MatInputModule,
73
+ MatIconModule,
74
+ MatProgressSpinnerModule,
75
+ MatTabsModule,
76
+ MatButtonModule,
77
+ MatMenuModule,
78
+ MatTabsModule,
79
+ MatProgressBarModule,
80
+ MatTooltipModule,
81
+ MatSliderModule,
82
+ MatListModule,
83
+ MatChipsModule,
84
+ MatPaginatorModule,
85
+ MatTableModule,
86
+ MatExpansionModule,
87
+ CdkAccordionModule,
88
+ MatSortModule,
89
+ MatAutocompleteModule,
90
+ MatSlideToggleModule,
91
+ MatButtonToggleModule
92
+ ]
93
+ })
94
+ export class MaterialModule { }
@@ -0,0 +1,34 @@
1
+ <nav
2
+ class="cc-nav"
3
+ [ngClass]="[variant, orientation]"
4
+ [ngStyle]="computedStyles"
5
+ role="tablist"
6
+ [attr.aria-orientation]="orientation">
7
+
8
+ <button
9
+ *ngFor="let item of items; trackBy: trackById"
10
+ class="cc-nav-item"
11
+ [class.active]="item.id === activeId"
12
+ [class.disabled]="item.disabled"
13
+ [disabled]="item.disabled"
14
+ role="tab"
15
+ [attr.aria-selected]="item.id === activeId"
16
+ [attr.aria-disabled]="item.disabled || null"
17
+ (click)="onItemClick(item)">
18
+
19
+ <!-- Icon (optional) -->
20
+ <span *ngIf="item.icon" class="cc-nav-item-icon">
21
+ <i [ngClass]="item.icon"></i>
22
+ </span>
23
+
24
+ <!-- Label -->
25
+ <span class="cc-nav-item-label">{{ item.label }}</span>
26
+
27
+ <!-- Badge (optional) -->
28
+ <span *ngIf="item.badge != null" class="cc-nav-item-badge">
29
+ {{ item.badge }}
30
+ </span>
31
+
32
+ </button>
33
+
34
+ </nav>
@@ -0,0 +1,171 @@
1
+ .cc-nav {
2
+ display: flex;
3
+ align-items: center;
4
+ background-color: var(--cc-nav-container-bg);
5
+ padding: var(--cc-nav-container-padding);
6
+ border-radius: var(--cc-nav-container-radius);
7
+ border: var(--cc-nav-container-border);
8
+ gap: var(--cc-nav-container-gap);
9
+ font-family: var(--cc-nav-font-family);
10
+ font-size: var(--cc-nav-font-size);
11
+ box-sizing: border-box;
12
+ width: 100%;
13
+
14
+ /* ========================
15
+ Orientation
16
+ ======================== */
17
+ &.horizontal {
18
+ flex-direction: row;
19
+ overflow-x: auto;
20
+
21
+ /* Hide scrollbar but keep scroll functionality */
22
+ -ms-overflow-style: none;
23
+ scrollbar-width: none;
24
+
25
+ &::-webkit-scrollbar {
26
+ display: none;
27
+ }
28
+ }
29
+
30
+ &.vertical {
31
+ flex-direction: column;
32
+ align-items: stretch;
33
+ }
34
+
35
+ /* ========================
36
+ Nav Item (Default State)
37
+ ======================== */
38
+ .cc-nav-item {
39
+ display: inline-flex;
40
+ align-items: center;
41
+ gap: 6px;
42
+ padding: var(--cc-nav-item-padding);
43
+ border-radius: var(--cc-nav-item-radius);
44
+ border: var(--cc-nav-item-border);
45
+ background-color: var(--cc-nav-item-bg);
46
+ color: var(--cc-nav-item-color);
47
+ font-family: inherit;
48
+ font-size: inherit;
49
+ font-weight: var(--cc-nav-font-weight);
50
+ cursor: pointer;
51
+ white-space: nowrap;
52
+ user-select: none;
53
+ transition: all 0.2s ease;
54
+ position: relative;
55
+ outline: none;
56
+ margin-right: 0.3rem;
57
+
58
+ /* Hover */
59
+ &:hover:not(:disabled):not(.active) {
60
+ background-color: var(--cc-nav-item-hover-bg);
61
+ color: var(--cc-nav-item-hover-color);
62
+ }
63
+
64
+ /* Active */
65
+ &.active {
66
+ background-color: var(--cc-nav-item-active-bg);
67
+ color: var(--cc-nav-item-active-color);
68
+ font-weight: var(--cc-nav-item-active-font-weight);
69
+ box-shadow: var(--cc-nav-item-active-shadow);
70
+ }
71
+
72
+ /* Disabled */
73
+ &:disabled,
74
+ &.disabled {
75
+ opacity: var(--cc-nav-disabled-opacity);
76
+ cursor: not-allowed;
77
+ }
78
+
79
+ /* Icon */
80
+ .cc-nav-item-icon {
81
+ display: inline-flex;
82
+ align-items: center;
83
+ font-size: 1.1em;
84
+ line-height: 1;
85
+ }
86
+
87
+ /* Badge */
88
+ .cc-nav-item-badge {
89
+ display: inline-flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ min-width: var(--cc-nav-badge-size);
93
+ height: var(--cc-nav-badge-size);
94
+ border-radius: 50%;
95
+ background-color: var(--cc-nav-badge-bg);
96
+ color: var(--cc-nav-badge-color);
97
+ font-size: var(--cc-nav-badge-font-size);
98
+ font-weight: var(--cc-nav-badge-font-weight, 600);
99
+ padding: 0 4px;
100
+ line-height: 1;
101
+ }
102
+ }
103
+
104
+ /* ========================
105
+ Variant: filled (default)
106
+ ======================== */
107
+ &.filled {
108
+ .cc-nav-item.active {
109
+ border-bottom: var(--cc-nav-item-active-border-width) solid var(--cc-nav-item-active-border-color);
110
+ }
111
+ }
112
+
113
+ /* ========================
114
+ Variant: underline
115
+ ======================== */
116
+ &.underline {
117
+ background-color: transparent;
118
+ border-radius: 0;
119
+ padding: 0;
120
+ border-bottom: 1px solid #e0e0e0;
121
+
122
+ .cc-nav-item {
123
+ background-color: transparent;
124
+ border-radius: 0;
125
+ border: none;
126
+ border-bottom: var(--cc-nav-item-active-border-width) solid transparent;
127
+ box-shadow: none;
128
+
129
+ &:hover:not(:disabled):not(.active) {
130
+ background-color: transparent;
131
+ border-bottom-color: #ccc;
132
+ }
133
+
134
+ &.active {
135
+ background-color: transparent;
136
+ border-bottom-color: var(--cc-nav-item-active-border-color);
137
+ box-shadow: none;
138
+ }
139
+ }
140
+ }
141
+
142
+ /* ========================
143
+ Variant: pills
144
+ ======================== */
145
+ &.pills {
146
+ background-color: transparent;
147
+ padding: 0;
148
+
149
+ .cc-nav-item {
150
+ border-radius: 999px;
151
+
152
+ &.active {
153
+ border-radius: 999px;
154
+ }
155
+ }
156
+ }
157
+
158
+ /* ========================
159
+ Mobile Responsiveness
160
+ ======================== */
161
+ @media (max-width: 600px) {
162
+ &.horizontal {
163
+ gap: 2px;
164
+
165
+ .cc-nav-item {
166
+ padding: 6px 12px;
167
+ font-size: 13px;
168
+ }
169
+ }
170
+ }
171
+ }
@@ -0,0 +1,82 @@
1
+ import { Component, EventEmitter, Input, Output, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { NAV_VARIANT_DEFAULT, NAV_ORIENTATION_DEFAULT } from '../../../../utils/constants';
3
+ import { NavStyleConfig } from '../../nav.models';
4
+
5
+ export interface NavItem {
6
+ id: string | number;
7
+ label: string;
8
+ icon?: string;
9
+ badge?: string | number;
10
+ disabled?: boolean;
11
+ }
12
+
13
+ @Component({
14
+ selector: 'lib-nav',
15
+ templateUrl: './nav.component.html',
16
+ styleUrls: ['./nav.component.scss'],
17
+ standalone: false
18
+ })
19
+ export class NavComponent implements OnChanges {
20
+ @Input() items: NavItem[] = [];
21
+ @Input() activeId: string | number | null = null;
22
+ @Input() variant: 'filled' | 'underline' | 'pills' = NAV_VARIANT_DEFAULT;
23
+ @Input() orientation: 'horizontal' | 'vertical' = NAV_ORIENTATION_DEFAULT;
24
+ @Input() styleConfig: NavStyleConfig = {};
25
+
26
+ @Output() selectionChange = new EventEmitter<NavItem>();
27
+
28
+ ngOnChanges(changes: SimpleChanges): void {
29
+ if (changes['styleConfig']) {
30
+ console.log(' [NavComponent] styleConfig changed:', this.styleConfig);
31
+ console.log(' [NavComponent] computedStyles:', this.computedStyles);
32
+ }
33
+ }
34
+
35
+ get computedStyles(): { [key: string]: string | undefined } {
36
+ const c = this.styleConfig;
37
+ return {
38
+ // Container (direct CSS)
39
+ 'width': c.width,
40
+ 'box-shadow': c.boxShadow,
41
+
42
+ // Container (CSS Variables)
43
+ '--cc-nav-container-bg': c.backgroundColor,
44
+ '--cc-nav-container-radius': c.borderRadius,
45
+ '--cc-nav-container-border': c.border,
46
+ '--cc-nav-container-padding': c.padding,
47
+ '--cc-nav-container-gap': c.gap,
48
+
49
+ // Item (CSS Variables)
50
+ '--cc-nav-font-size': c.fontSize,
51
+ '--cc-nav-font-weight': c.fontWeight,
52
+ '--cc-nav-item-color': c.itemColor,
53
+ '--cc-nav-item-radius': c.itemRadius,
54
+ '--cc-nav-item-padding': c.itemPadding,
55
+
56
+ // Active Item (CSS Variables)
57
+ '--cc-nav-item-active-bg': c.activeItemBg,
58
+ '--cc-nav-item-active-color': c.activeItemColor,
59
+ '--cc-nav-item-active-font-weight': c.activeItemFontWeight,
60
+ '--cc-nav-item-active-border-color': c.activeItemBorderColor,
61
+
62
+ // Hover Item (CSS Variables)
63
+ '--cc-nav-item-hover-bg': c.hoverItemBg,
64
+ '--cc-nav-item-hover-color': c.hoverItemColor,
65
+
66
+ // Badge (CSS Variables)
67
+ '--cc-nav-badge-bg': c.badgeBg,
68
+ '--cc-nav-badge-color': c.badgeColor,
69
+ };
70
+ }
71
+
72
+ onItemClick(item: NavItem): void {
73
+ if (item.disabled) return;
74
+ if (item.id === this.activeId) return;
75
+
76
+ this.selectionChange.emit(item);
77
+ }
78
+
79
+ trackById(index: number, item: NavItem): string | number {
80
+ return item.id;
81
+ }
82
+ }
@@ -0,0 +1,31 @@
1
+ export interface NavStyleConfig {
2
+ // Container
3
+ width?: string;
4
+ backgroundColor?: string;
5
+ borderRadius?: string;
6
+ border?: string;
7
+ padding?: string;
8
+ gap?: string;
9
+ boxShadow?: string;
10
+
11
+ // Item
12
+ itemColor?: string;
13
+ itemRadius?: string;
14
+ itemPadding?: string;
15
+ fontSize?: string;
16
+ fontWeight?: string;
17
+
18
+ // Active Item
19
+ activeItemBg?: string;
20
+ activeItemColor?: string;
21
+ activeItemFontWeight?: string;
22
+ activeItemBorderColor?: string;
23
+
24
+ // Hover Item
25
+ hoverItemBg?: string;
26
+ hoverItemColor?: string;
27
+
28
+ // Badge
29
+ badgeBg?: string;
30
+ badgeColor?: string;
31
+ }
@@ -0,0 +1,17 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { NavComponent } from './components/nav/nav.component';
4
+
5
+
6
+ @NgModule({
7
+ declarations: [
8
+ NavComponent
9
+ ],
10
+ imports: [
11
+ CommonModule
12
+ ],
13
+ exports: [
14
+ NavComponent
15
+ ]
16
+ })
17
+ export class NavModule { }
@@ -0,0 +1,86 @@
1
+ @use 'sass:map';
2
+
3
+ // Default configuration for the nav theme
4
+ $default-nav-config: (
5
+ // Container
6
+ container-bg: #f5f5f5,
7
+ container-padding: 4px,
8
+ container-radius: 6px,
9
+ container-border: none,
10
+ container-gap: 4px,
11
+
12
+ // Item - Font & Text
13
+ font-family: ('Roboto', sans-serif),
14
+ font-size: 14px,
15
+ font-weight: 500,
16
+ item-color: #666666,
17
+ item-bg: transparent,
18
+ item-padding: 8px 16px,
19
+ item-radius: 4px,
20
+ item-border: none,
21
+
22
+ // Item - Active State
23
+ item-active-bg: #ffffff,
24
+ item-active-color: #1a1a1a,
25
+ item-active-font-weight: 600,
26
+ item-active-border-color: transparent,
27
+ item-active-border-width: 2px,
28
+ item-active-shadow: 0 1px 3px rgba(0, 0, 0, 0.1),
29
+
30
+ // Item - Hover State
31
+ item-hover-bg: #eeeeee,
32
+ item-hover-color: #333333,
33
+
34
+ // Item - Disabled State
35
+ disabled-opacity: 0.5,
36
+
37
+ // Badge
38
+ badge-bg: #e74c3c,
39
+ badge-color: #ffffff,
40
+ badge-size: 18px,
41
+ badge-font-size: 10px
42
+ );
43
+
44
+ // Mixin to generate CSS variables for the nav component
45
+ @mixin nav-theme($user-config: ()) {
46
+ // Merge user config with defaults
47
+ $config: map.merge($default-nav-config, $user-config);
48
+
49
+ // Container
50
+ --cc-nav-container-bg: #{map.get($config, container-bg)};
51
+ --cc-nav-container-padding: #{map.get($config, container-padding)};
52
+ --cc-nav-container-radius: #{map.get($config, container-radius)};
53
+ --cc-nav-container-border: #{map.get($config, container-border)};
54
+ --cc-nav-container-gap: #{map.get($config, container-gap)};
55
+
56
+ // Item - Font & Text
57
+ --cc-nav-font-family: #{map.get($config, font-family)};
58
+ --cc-nav-font-size: #{map.get($config, font-size)};
59
+ --cc-nav-font-weight: #{map.get($config, font-weight)};
60
+ --cc-nav-item-color: #{map.get($config, item-color)};
61
+ --cc-nav-item-bg: #{map.get($config, item-bg)};
62
+ --cc-nav-item-padding: #{map.get($config, item-padding)};
63
+ --cc-nav-item-radius: #{map.get($config, item-radius)};
64
+ --cc-nav-item-border: #{map.get($config, item-border)};
65
+
66
+ // Item - Active State
67
+ --cc-nav-item-active-bg: #{map.get($config, item-active-bg)};
68
+ --cc-nav-item-active-color: #{map.get($config, item-active-color)};
69
+ --cc-nav-item-active-font-weight: #{map.get($config, item-active-font-weight)};
70
+ --cc-nav-item-active-border-color: #{map.get($config, item-active-border-color)};
71
+ --cc-nav-item-active-border-width: #{map.get($config, item-active-border-width)};
72
+ --cc-nav-item-active-shadow: #{map.get($config, item-active-shadow)};
73
+
74
+ // Item - Hover State
75
+ --cc-nav-item-hover-bg: #{map.get($config, item-hover-bg)};
76
+ --cc-nav-item-hover-color: #{map.get($config, item-hover-color)};
77
+
78
+ // Item - Disabled State
79
+ --cc-nav-disabled-opacity: #{map.get($config, disabled-opacity)};
80
+
81
+ // Badge
82
+ --cc-nav-badge-bg: #{map.get($config, badge-bg)};
83
+ --cc-nav-badge-color: #{map.get($config, badge-color)};
84
+ --cc-nav-badge-size: #{map.get($config, badge-size)};
85
+ --cc-nav-badge-font-size: #{map.get($config, badge-font-size)};
86
+ }
@@ -0,0 +1,52 @@
1
+ <div class="cc-pagination" [ngClass]="theme">
2
+ <!-- Left Side: Items Info & Per Page -->
3
+ <div class="pagination-left" *ngIf="pageSizeOptions.length > 1 || totalItems > 0">
4
+ <span class="items-info">
5
+ {{ startItem }}-{{ endItem }} {{ labels.of }} {{ totalItems }} {{ labels.items }}
6
+ </span>
7
+
8
+ <div class="per-page-selector" *ngIf="pageSizeOptions.length > 1">
9
+ <div class="select-wrapper">
10
+ <select (change)="onItemsPerPageChange($event)">
11
+ <option *ngFor="let option of pageSizeOptions" [value]="option" [selected]="option === itemsPerPage">
12
+ {{ option }}
13
+ </option>
14
+ </select>
15
+ <span class="select-arrow"></span>
16
+ </div>
17
+ <span class="per-page-label">{{ labels.perPage }}</span>
18
+ </div>
19
+ </div>
20
+
21
+ <!-- Right Side: Page Controls -->
22
+ <div class="pagination-right">
23
+ <button
24
+ class="page-btn prev-btn"
25
+ [disabled]="currentPage === 1"
26
+ (click)="prevPage()"
27
+ aria-label="Previous Page">
28
+ <span class="icon">&lsaquo;</span>
29
+ </button>
30
+
31
+ <div class="page-numbers">
32
+ <ng-container *ngFor="let page of pages">
33
+ <button
34
+ *ngIf="page !== '...'"
35
+ class="page-btn number-btn"
36
+ [class.active]="page === currentPage"
37
+ (click)="onPageChange(page)">
38
+ {{ page }}
39
+ </button>
40
+ <span *ngIf="page === '...'" class="ellipsis">...</span>
41
+ </ng-container>
42
+ </div>
43
+
44
+ <button
45
+ class="page-btn next-btn"
46
+ [disabled]="currentPage === totalPages || totalPages === 0"
47
+ (click)="nextPage()"
48
+ aria-label="Next Page">
49
+ <span class="icon">&rsaquo;</span>
50
+ </button>
51
+ </div>
52
+ </div>