commons-shared-web-ui 0.0.55 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/fesm2022/commons-shared-web-ui.mjs +15897 -0
  2. package/fesm2022/commons-shared-web-ui.mjs.map +1 -0
  3. package/index.d.ts +4916 -0
  4. package/package.json +34 -53
  5. package/.claude/settings.local.json +0 -10
  6. package/documentation/alert.md +0 -123
  7. package/documentation/button-dropdown.md +0 -126
  8. package/documentation/button.md +0 -184
  9. package/documentation/cards-usage-guidelines.md +0 -131
  10. package/documentation/configurable-form.md +0 -605
  11. package/documentation/confirmation-modal.md +0 -250
  12. package/documentation/filter-sidebar.md +0 -178
  13. package/documentation/filter-table-selector.md +0 -228
  14. package/documentation/form-builder.md +0 -599
  15. package/documentation/form-components.md +0 -384
  16. package/documentation/form-field-configuration.md +0 -250
  17. package/documentation/nav.md +0 -427
  18. package/documentation/pagination.md +0 -181
  19. package/documentation/side-nav-documentation.md +0 -169
  20. package/documentation/smart-form.md +0 -2765
  21. package/documentation/smart-table.md +0 -1221
  22. package/documentation/snackbar.md +0 -118
  23. package/documentation/style-externalization.md +0 -88
  24. package/documentation/summary-card.md +0 -279
  25. package/documentation/table-column-configuration.md +0 -221
  26. package/documentation/time-picker.md +0 -274
  27. package/ng-package.json +0 -30
  28. package/src/lib/modules/alert/alert.models.ts +0 -6
  29. package/src/lib/modules/alert/alert.module.ts +0 -16
  30. package/src/lib/modules/alert/components/alert/alert.component.html +0 -27
  31. package/src/lib/modules/alert/components/alert/alert.component.scss +0 -92
  32. package/src/lib/modules/alert/components/alert/alert.component.ts +0 -81
  33. package/src/lib/modules/button/button.models.ts +0 -13
  34. package/src/lib/modules/button/button.module.ts +0 -16
  35. package/src/lib/modules/button/components/button/button.component.html +0 -22
  36. package/src/lib/modules/button/components/button/button.component.scss +0 -88
  37. package/src/lib/modules/button/components/button/button.component.ts +0 -67
  38. package/src/lib/modules/button-dropdown/button-dropdown.models.ts +0 -26
  39. package/src/lib/modules/button-dropdown/button-dropdown.module.ts +0 -22
  40. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.html +0 -41
  41. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.scss +0 -135
  42. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.ts +0 -160
  43. package/src/lib/modules/configurable-form/component/configurable-form.component.html +0 -294
  44. package/src/lib/modules/configurable-form/component/configurable-form.component.scss +0 -503
  45. package/src/lib/modules/configurable-form/component/configurable-form.component.ts +0 -628
  46. package/src/lib/modules/configurable-form/configurable-form.examples.ts +0 -154
  47. package/src/lib/modules/configurable-form/configurable-form.model.ts +0 -131
  48. package/src/lib/modules/configurable-form/configurable-form.module.ts +0 -19
  49. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.html +0 -77
  50. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.scss +0 -395
  51. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.ts +0 -266
  52. package/src/lib/modules/confirmation-modal/confirmation-modal.models.ts +0 -71
  53. package/src/lib/modules/confirmation-modal/confirmation-modal.module.ts +0 -20
  54. package/src/lib/modules/filter/components/filter/filter.component.html +0 -131
  55. package/src/lib/modules/filter/components/filter/filter.component.scss +0 -245
  56. package/src/lib/modules/filter/components/filter/filter.component.ts +0 -216
  57. package/src/lib/modules/filter/filter.models.ts +0 -88
  58. package/src/lib/modules/filter/filter.module.ts +0 -24
  59. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html +0 -112
  60. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss +0 -186
  61. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts +0 -163
  62. package/src/lib/modules/filter-sidebar/filter-sidebar.models.ts +0 -95
  63. package/src/lib/modules/filter-sidebar/filter-sidebar.module.ts +0 -24
  64. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.html +0 -73
  65. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.scss +0 -321
  66. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.ts +0 -361
  67. package/src/lib/modules/filter-table-selector/filter-table-selector.models.ts +0 -91
  68. package/src/lib/modules/filter-table-selector/filter-table-selector.module.ts +0 -22
  69. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.html +0 -63
  70. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.scss +0 -496
  71. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.ts +0 -445
  72. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.html +0 -75
  73. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.scss +0 -210
  74. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.ts +0 -55
  75. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.html +0 -25
  76. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.scss +0 -82
  77. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.ts +0 -95
  78. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.html +0 -20
  79. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.scss +0 -37
  80. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.ts +0 -94
  81. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.html +0 -46
  82. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.scss +0 -102
  83. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.ts +0 -50
  84. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.html +0 -35
  85. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.scss +0 -67
  86. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.ts +0 -34
  87. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.html +0 -68
  88. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.scss +0 -113
  89. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.ts +0 -74
  90. package/src/lib/modules/form-builder/configs/field-type-schema.map.ts +0 -533
  91. package/src/lib/modules/form-builder/form-builder.module.ts +0 -36
  92. package/src/lib/modules/form-builder/index.ts +0 -9
  93. package/src/lib/modules/form-builder/models/builder.models.ts +0 -7
  94. package/src/lib/modules/form-builder/models/field-configurator.models.ts +0 -38
  95. package/src/lib/modules/form-builder/models/field-selection.models.ts +0 -51
  96. package/src/lib/modules/form-builder/services/field-configurator.service.ts +0 -258
  97. package/src/lib/modules/form-builder/services/field-selection.service.ts +0 -299
  98. package/src/lib/modules/form-builder/services/form-schema-tree.service.ts +0 -670
  99. package/src/lib/modules/form-builder/tokens/builder.tokens.ts +0 -10
  100. package/src/lib/modules/form-builder/utils/constants.ts +0 -43
  101. package/src/lib/modules/form-components/components/checkbox/checkbox.component.html +0 -29
  102. package/src/lib/modules/form-components/components/checkbox/checkbox.component.scss +0 -111
  103. package/src/lib/modules/form-components/components/checkbox/checkbox.component.ts +0 -207
  104. package/src/lib/modules/form-components/components/checkbox/checkbox.models.ts +0 -35
  105. package/src/lib/modules/form-components/components/datepicker/datepicker.component.html +0 -42
  106. package/src/lib/modules/form-components/components/datepicker/datepicker.component.scss +0 -115
  107. package/src/lib/modules/form-components/components/datepicker/datepicker.component.ts +0 -267
  108. package/src/lib/modules/form-components/components/datepicker/datepicker.models.ts +0 -45
  109. package/src/lib/modules/form-components/components/dropdown/dropdown.component.html +0 -74
  110. package/src/lib/modules/form-components/components/dropdown/dropdown.component.scss +0 -252
  111. package/src/lib/modules/form-components/components/dropdown/dropdown.component.ts +0 -377
  112. package/src/lib/modules/form-components/components/dropdown/dropdown.models.ts +0 -53
  113. package/src/lib/modules/form-components/components/input/input.component.html +0 -51
  114. package/src/lib/modules/form-components/components/input/input.component.scss +0 -128
  115. package/src/lib/modules/form-components/components/input/input.component.ts +0 -250
  116. package/src/lib/modules/form-components/components/input/input.models.ts +0 -55
  117. package/src/lib/modules/form-components/components/radio/radio.component.html +0 -22
  118. package/src/lib/modules/form-components/components/radio/radio.component.scss +0 -107
  119. package/src/lib/modules/form-components/components/radio/radio.component.ts +0 -181
  120. package/src/lib/modules/form-components/components/radio/radio.models.ts +0 -39
  121. package/src/lib/modules/form-components/components/search/search.component.html +0 -15
  122. package/src/lib/modules/form-components/components/search/search.component.scss +0 -87
  123. package/src/lib/modules/form-components/components/search/search.component.ts +0 -213
  124. package/src/lib/modules/form-components/components/search/search.models.ts +0 -40
  125. package/src/lib/modules/form-components/components/toggle/toggle.component.html +0 -15
  126. package/src/lib/modules/form-components/components/toggle/toggle.component.scss +0 -81
  127. package/src/lib/modules/form-components/components/toggle/toggle.component.ts +0 -166
  128. package/src/lib/modules/form-components/components/toggle/toggle.models.ts +0 -27
  129. package/src/lib/modules/form-components/directives/click-outside.directive.ts +0 -22
  130. package/src/lib/modules/form-components/form-components.module.ts +0 -42
  131. package/src/lib/modules/form-field-configuration/components/_ffc-controls.scss +0 -89
  132. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.html +0 -68
  133. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.scss +0 -73
  134. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.ts +0 -34
  135. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.html +0 -78
  136. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.scss +0 -83
  137. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.ts +0 -94
  138. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.html +0 -38
  139. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.scss +0 -42
  140. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.ts +0 -92
  141. package/src/lib/modules/form-field-configuration/form-field-configuration.module.ts +0 -23
  142. package/src/lib/modules/form-field-configuration/index.ts +0 -7
  143. package/src/lib/modules/form-field-configuration/models/field-configuration.models.ts +0 -62
  144. package/src/lib/modules/form-field-configuration/services/config-schema-tree.service.ts +0 -159
  145. package/src/lib/modules/form-field-configuration/services/field-configuration.service.ts +0 -228
  146. package/src/lib/modules/material/material.module.ts +0 -94
  147. package/src/lib/modules/nav/components/nav/nav.component.html +0 -34
  148. package/src/lib/modules/nav/components/nav/nav.component.scss +0 -171
  149. package/src/lib/modules/nav/components/nav/nav.component.ts +0 -82
  150. package/src/lib/modules/nav/nav.models.ts +0 -31
  151. package/src/lib/modules/nav/nav.module.ts +0 -17
  152. package/src/lib/modules/pagination/components/pagination/pagination.component.html +0 -52
  153. package/src/lib/modules/pagination/components/pagination/pagination.component.scss +0 -155
  154. package/src/lib/modules/pagination/components/pagination/pagination.component.ts +0 -109
  155. package/src/lib/modules/pagination/pagination.module.ts +0 -17
  156. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.html +0 -56
  157. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.scss +0 -342
  158. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.ts +0 -135
  159. package/src/lib/modules/side-nav/side-nav.models.ts +0 -38
  160. package/src/lib/modules/side-nav/side-nav.module.ts +0 -16
  161. package/src/lib/modules/smart-form/components/form-field/form-field.component.html +0 -1330
  162. package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +0 -2112
  163. package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +0 -3006
  164. package/src/lib/modules/smart-form/components/form-section/form-section.component.html +0 -65
  165. package/src/lib/modules/smart-form/components/form-section/form-section.component.scss +0 -209
  166. package/src/lib/modules/smart-form/components/form-section/form-section.component.ts +0 -131
  167. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.html +0 -253
  168. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.scss +0 -689
  169. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.ts +0 -1131
  170. package/src/lib/modules/smart-form/index.ts +0 -10
  171. package/src/lib/modules/smart-form/models/form-schema.model.ts +0 -793
  172. package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +0 -21
  173. package/src/lib/modules/smart-form/services/expression.service.ts +0 -75
  174. package/src/lib/modules/smart-form/services/smart-form-controller.service.ts +0 -67
  175. package/src/lib/modules/smart-form/smart-form.examples.ts +0 -1324
  176. package/src/lib/modules/smart-form/smart-form.module.ts +0 -38
  177. package/src/lib/modules/smart-form/utils/translation.utils.ts +0 -82
  178. package/src/lib/modules/smart-form/utils/trusted-url.pipe.ts +0 -25
  179. package/src/lib/modules/smart-form/utils/validation.utils.ts +0 -98
  180. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.html +0 -283
  181. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.scss +0 -685
  182. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.ts +0 -1128
  183. package/src/lib/modules/smart-table/models/table-config.model.ts +0 -213
  184. package/src/lib/modules/smart-table/smart-table.module.ts +0 -30
  185. package/src/lib/modules/smart-table/utils/safe-html.pipe.ts +0 -28
  186. package/src/lib/modules/smart-table/utils/smart-table.utils.ts +0 -18
  187. package/src/lib/modules/snackbar/components/snackbar.component.html +0 -41
  188. package/src/lib/modules/snackbar/components/snackbar.component.scss +0 -99
  189. package/src/lib/modules/snackbar/components/snackbar.component.ts +0 -18
  190. package/src/lib/modules/snackbar/models/snackbar.models.ts +0 -10
  191. package/src/lib/modules/snackbar/services/snackbar.service.ts +0 -40
  192. package/src/lib/modules/snackbar/snackbar.module.ts +0 -11
  193. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.html +0 -47
  194. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.scss +0 -199
  195. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.ts +0 -126
  196. package/src/lib/modules/summary-card/summary-card.module.ts +0 -18
  197. package/src/lib/modules/table-column-configuration/components/_tcc-controls.scss +0 -53
  198. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.html +0 -47
  199. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.scss +0 -50
  200. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.ts +0 -33
  201. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.html +0 -30
  202. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.scss +0 -36
  203. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.ts +0 -78
  204. package/src/lib/modules/table-column-configuration/index.ts +0 -5
  205. package/src/lib/modules/table-column-configuration/models/table-column-configuration.models.ts +0 -20
  206. package/src/lib/modules/table-column-configuration/services/table-column-configuration.service.ts +0 -77
  207. package/src/lib/modules/table-column-configuration/table-column-configuration.module.ts +0 -21
  208. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.html +0 -37
  209. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.scss +0 -102
  210. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.ts +0 -178
  211. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.html +0 -78
  212. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.scss +0 -226
  213. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.ts +0 -595
  214. package/src/lib/modules/time-picker/models/time-picker.models.ts +0 -49
  215. package/src/lib/modules/time-picker/time-picker.module.ts +0 -23
  216. package/src/lib/shared-ui.module.ts +0 -55
  217. package/src/lib/utils/constants.ts +0 -11
  218. package/src/lib/utils/storage.utils.ts +0 -37
  219. package/src/lib/utils/string.utils.ts +0 -23
  220. package/src/lib/utils/translation.utils.ts +0 -87
  221. package/src/public-api.ts +0 -127
  222. package/tsconfig.lib.json +0 -15
@@ -1,250 +0,0 @@
1
- import { Component, Input, Output, EventEmitter, forwardRef, OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
- import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
3
- import { InputConfig, InputType, InputLabels } from './input.models';
4
-
5
- @Component({
6
- selector: 'lib-input',
7
- templateUrl: './input.component.html',
8
- styleUrls: ['./input.component.scss'],
9
- standalone: false,
10
- providers: [
11
- {
12
- provide: NG_VALUE_ACCESSOR,
13
- useExisting: forwardRef(() => InputComponent),
14
- multi: true
15
- }
16
- ]
17
- })
18
- export class InputComponent implements ControlValueAccessor, OnInit, OnChanges {
19
- @Input() config?: InputConfig;
20
- @Input() labels?: InputLabels;
21
- @Input() type: InputType = 'text';
22
- @Input() label: string = '';
23
- @Input() placeholder: string = '';
24
- @Input() disabled: boolean = false;
25
- @Input() required: boolean = false;
26
- @Input() readonly: boolean = false;
27
- @Input() clearable: boolean = true;
28
- @Input() maxLength?: number;
29
- @Input() minLength?: number;
30
- @Input() min?: number | string;
31
- @Input() max?: number | string;
32
- @Input() pattern?: string;
33
- @Input() errorMessage: string = '';
34
- @Input() helperText: string = '';
35
- @Input() rows: number = 3;
36
- @Input() prefixIcon?: any;
37
- @Input() suffixIcon?: any;
38
- @Input() value: any = '';
39
-
40
- // Style inputs
41
- @Input() width?: string;
42
- @Input() height?: string;
43
- @Input() borderRadius?: string;
44
- @Input() fontSize?: string;
45
-
46
- @Input() gap?: string;
47
- @Input() fontFamily?: string;
48
- @Input() labelColor?: string;
49
- @Input() labelFontSize?: string;
50
- @Input() labelFontWeight?: string;
51
-
52
- @Input() backgroundColor?: string;
53
- @Input() borderColor?: string;
54
- @Input() borderWidth?: string;
55
- @Input() padding?: string;
56
- @Input() fontWeight?: string;
57
- @Input() color?: string;
58
- @Input() placeholderColor?: string;
59
- @Input() focusBorderColor?: string;
60
- @Input() errorColor?: string;
61
- @Input() disabledBackgroundColor?: string;
62
- @Input() disabledColor?: string;
63
- @Input() boxShadow?: string;
64
-
65
- @Output() valueChange = new EventEmitter<any>();
66
- @Output() inputBlur = new EventEmitter<void>();
67
- @Output() inputFocus = new EventEmitter<void>();
68
-
69
- showPassword = false;
70
- focused = false;
71
- onChange: (value: any) => void = () => { };
72
- onTouched: () => void = () => { };
73
-
74
- ngOnInit(): void {
75
- this.updateFromConfig();
76
- this.updateFromLabels();
77
- }
78
-
79
- ngOnChanges(changes: SimpleChanges): void {
80
- if (changes['config']) {
81
- this.updateFromConfig();
82
- }
83
- if (changes['labels']) {
84
- this.updateFromLabels();
85
- }
86
- }
87
-
88
- private updateFromConfig(): void {
89
- if (this.config) {
90
- this.type = this.config.type ?? this.type;
91
- this.label = this.config.label ?? this.label;
92
- this.placeholder = this.config.placeholder ?? this.placeholder;
93
- this.disabled = this.config.disabled ?? this.disabled;
94
- this.required = this.config.required ?? this.required;
95
- this.readonly = this.config.readonly ?? this.readonly;
96
- this.maxLength = this.config.maxLength ?? this.maxLength;
97
- this.minLength = this.config.minLength ?? this.minLength;
98
- this.min = this.config.min ?? this.min;
99
- this.max = this.config.max ?? this.max;
100
- this.pattern = this.config.pattern ?? this.pattern;
101
- this.errorMessage = this.config.errorMessage ?? this.errorMessage;
102
- this.helperText = this.config.helperText ?? this.helperText;
103
- this.rows = this.config.rows ?? this.rows;
104
- this.prefixIcon = this.config.prefixIcon ?? this.prefixIcon;
105
- this.suffixIcon = this.config.suffixIcon ?? this.suffixIcon;
106
-
107
- // Style inputs
108
- this.width = this.config.width ?? this.width;
109
- this.height = this.config.height ?? this.height;
110
- this.borderRadius = this.config.borderRadius ?? this.borderRadius;
111
- this.fontSize = this.config.fontSize ?? this.fontSize;
112
- this.gap = this.config.gap ?? this.gap;
113
- this.fontFamily = this.config.fontFamily ?? this.fontFamily;
114
- this.labelColor = this.config.labelColor ?? this.labelColor;
115
- this.labelFontSize = this.config.labelFontSize ?? this.labelFontSize;
116
- this.labelFontWeight = this.config.labelFontWeight ?? this.labelFontWeight;
117
- this.backgroundColor = this.config.backgroundColor ?? this.backgroundColor;
118
- this.borderColor = this.config.borderColor ?? this.borderColor;
119
- this.borderWidth = this.config.borderWidth ?? this.borderWidth;
120
- this.padding = this.config.padding ?? this.padding;
121
- this.fontWeight = this.config.fontWeight ?? this.fontWeight;
122
- this.color = this.config.color ?? this.color;
123
- this.placeholderColor = this.config.placeholderColor ?? this.placeholderColor;
124
- this.focusBorderColor = this.config.focusBorderColor ?? this.focusBorderColor;
125
- this.errorColor = this.config.errorColor ?? this.errorColor;
126
- this.disabledBackgroundColor = this.config.disabledBackgroundColor ?? this.disabledBackgroundColor;
127
- this.disabledColor = this.config.disabledColor ?? this.disabledColor;
128
- this.boxShadow = this.config.boxShadow ?? this.boxShadow;
129
-
130
- if (this.config.value !== undefined) {
131
- this.value = this.config.value;
132
- }
133
- }
134
- }
135
-
136
- private updateFromLabels(): void {
137
- if (this.labels) {
138
- this.label = this.labels.label || this.label;
139
- this.placeholder = this.labels.placeholder || this.placeholder;
140
- this.errorMessage = this.labels.errorMessage || this.errorMessage;
141
- this.helperText = this.labels.helperText || this.helperText;
142
- }
143
- }
144
-
145
- get requiredMarker(): string {
146
- return this.labels?.requiredMarker || '*';
147
- }
148
-
149
- writeValue(value: any): void {
150
- this.value = value;
151
- }
152
-
153
- registerOnChange(fn: any): void {
154
- this.onChange = fn;
155
- }
156
-
157
- registerOnTouched(fn: any): void {
158
- this.onTouched = fn;
159
- }
160
-
161
- setDisabledState(isDisabled: boolean): void {
162
- this.disabled = isDisabled;
163
- }
164
-
165
- onInputChange(event: any): void {
166
- const value = event.target.value;
167
- this.value = this.type === 'number' ? (value ? Number(value) : null) : value;
168
- this.onChange(this.value);
169
- this.valueChange.emit(this.value);
170
- }
171
-
172
- onBlur(): void {
173
- this.focused = false;
174
- this.onTouched();
175
- this.inputBlur.emit();
176
- }
177
-
178
- onFocus(): void {
179
- this.focused = true;
180
- this.inputFocus.emit();
181
- }
182
-
183
- togglePasswordVisibility(): void {
184
- this.showPassword = !this.showPassword;
185
- }
186
-
187
- getIconType(icon: any): 'material' | 'fontawesome' | 'img' | 'none' {
188
- if (!icon) return 'none';
189
- if (typeof icon === 'string') {
190
- if (icon.includes('/') || icon.includes('.') || icon.startsWith('http')) {
191
- return 'img';
192
- }
193
- return 'material';
194
- }
195
- return icon.type || 'material';
196
- }
197
-
198
- getIconValue(icon: any): string {
199
- if (typeof icon === 'string') return icon;
200
- return icon?.value || '';
201
- }
202
-
203
- get inputType(): string {
204
- if (this.type === 'password' && this.showPassword) {
205
- return 'text';
206
- }
207
- return this.type === 'textarea' ? 'text' : this.type;
208
- }
209
-
210
- private getStyleValue(value: string | undefined): string | undefined {
211
- return value ? `${value}` : undefined;
212
- }
213
-
214
- get wrapperStyles(): { [key: string]: string | undefined } {
215
- return {
216
- 'width': this.getStyleValue(this.width),
217
- '--cc-input-label-gap': this.getStyleValue(this.gap),
218
- '--cc-input-font-family': this.getStyleValue(this.fontFamily)
219
- };
220
- }
221
-
222
- get labelStyles(): { [key: string]: string | undefined } {
223
- return {
224
- '--cc-input-label-color': this.getStyleValue(this.labelColor),
225
- '--cc-input-label-font-size': this.getStyleValue(this.labelFontSize),
226
- '--cc-input-label-font-weight': this.getStyleValue(this.labelFontWeight)
227
- };
228
- }
229
-
230
- get fieldStyles(): { [key: string]: string | undefined } {
231
- return {
232
- '--cc-input-bg': this.getStyleValue(this.backgroundColor),
233
- '--cc-input-border-radius': this.getStyleValue(this.borderRadius),
234
- '--cc-input-border-color': this.getStyleValue(this.borderColor),
235
- '--cc-input-border-width': this.getStyleValue(this.borderWidth),
236
- '--cc-input-height': this.getStyleValue(this.height),
237
- '--cc-input-padding': this.getStyleValue(this.padding),
238
- '--cc-input-font-size': this.getStyleValue(this.fontSize),
239
- '--cc-input-font-weight': this.getStyleValue(this.fontWeight),
240
- '--cc-input-color': this.getStyleValue(this.color),
241
- '--cc-input-placeholder-color': this.getStyleValue(this.placeholderColor),
242
- '--cc-input-focus-border-color': this.getStyleValue(this.focusBorderColor),
243
- '--cc-input-error-color': this.getStyleValue(this.errorColor),
244
- '--cc-input-disabled-bg': this.getStyleValue(this.disabledBackgroundColor),
245
- '--cc-input-disabled-color': this.getStyleValue(this.disabledColor),
246
- 'box-shadow': this.getStyleValue(this.boxShadow)
247
- };
248
- }
249
- }
250
-
@@ -1,55 +0,0 @@
1
- export type InputType = 'text' | 'number' | 'email' | 'password' | 'tel' | 'url' | 'textarea';
2
-
3
- export interface InputLabels {
4
- label?: string;
5
- placeholder?: string;
6
- errorMessage?: string;
7
- helperText?: string;
8
- requiredMarker?: string;
9
- passwordToggleAriaLabel?: string;
10
- prefixAltText?: string;
11
- suffixAltText?: string;
12
- }
13
-
14
- export interface InputConfig {
15
- type?: InputType;
16
- label?: string;
17
- placeholder?: string;
18
- value?: any;
19
- disabled?: boolean;
20
- required?: boolean;
21
- readonly?: boolean;
22
- maxLength?: number;
23
- minLength?: number;
24
- min?: number;
25
- max?: number;
26
- pattern?: string;
27
- errorMessage?: string;
28
- helperText?: string;
29
- rows?: number; // For textarea
30
- // Icons
31
- prefixIcon?: string | { type: 'material' | 'fontawesome' | 'img'; value: string };
32
- suffixIcon?: string | { type: 'material' | 'fontawesome' | 'img'; value: string };
33
- // Customization
34
- width?: string;
35
- height?: string;
36
- borderRadius?: string;
37
- fontSize?: string;
38
- gap?: string;
39
- fontFamily?: string;
40
- labelColor?: string;
41
- labelFontSize?: string;
42
- labelFontWeight?: string;
43
- backgroundColor?: string;
44
- borderColor?: string;
45
- borderWidth?: string;
46
- padding?: string;
47
- fontWeight?: string;
48
- color?: string;
49
- placeholderColor?: string;
50
- focusBorderColor?: string;
51
- errorColor?: string;
52
- disabledBackgroundColor?: string;
53
- disabledColor?: string;
54
- boxShadow?: string;
55
- }
@@ -1,22 +0,0 @@
1
- <div class="cc-radio-wrapper" [ngStyle]="wrapperStyles">
2
- <label *ngIf="label" class="cc-radio-group-label" [class.disabled]="disabled">
3
- {{ label }}
4
- <span *ngIf="required" class="cc-required">{{ requiredMarker }}</span>
5
- </label>
6
-
7
- <div class="cc-radio-group" [class.horizontal]="layout === 'horizontal'" [class.vertical]="layout === 'vertical'"
8
- role="radiogroup">
9
-
10
- <label class="cc-radio-label" *ngFor="let option of visibleOptions; let i = index"
11
- [class.disabled]="disabled || option.disabled" [class.checked]="value === option.value"
12
- [class.label-before]="labelPosition === 'before'">
13
-
14
- <input type="radio" [name]="uuid" [value]="option.value" [checked]="value === option.value"
15
- [disabled]="disabled || option.disabled" (change)="onRadioChange(option)" class="cc-native-radio"
16
- [id]="uuid + '-' + i">
17
-
18
- <span class="cc-radio-circle"></span>
19
- <span class="cc-text">{{ option.label }}</span>
20
- </label>
21
- </div>
22
- </div>
@@ -1,107 +0,0 @@
1
- /* Radio Component - Alternative Approach with Native Fallback */
2
-
3
- .cc-radio-wrapper {
4
- display: block;
5
- width: 100%;
6
- font-family: var(--cc-radio-font-family, inherit);
7
- }
8
-
9
- .cc-radio-group-label {
10
- display: block;
11
- font-size: var(--cc-radio-group-label-font-size, 14px);
12
- font-weight: var(--cc-radio-group-label-font-weight, 500);
13
- color: var(--cc-radio-group-label-color, #202124);
14
- margin-bottom: 8px;
15
- }
16
-
17
- .cc-radio-group {
18
- display: flex;
19
- gap: var(--cc-radio-group-gap, 12px);
20
- }
21
-
22
- .cc-radio-group.vertical {
23
- flex-direction: column;
24
- }
25
-
26
- .cc-radio-group.horizontal {
27
- flex-direction: row;
28
- flex-wrap: wrap;
29
- }
30
-
31
- .cc-radio-label {
32
- display: flex;
33
- align-items: center;
34
- cursor: pointer;
35
- font-size: var(--cc-radio-font-size, 14px);
36
- color: var(--cc-radio-label-color, #202124);
37
- user-select: none;
38
- padding: 4px 0;
39
- }
40
-
41
- /* APPROACH 1: Custom Circle (Primary) */
42
- .cc-native-radio {
43
- /* Completely hide but keep accessible */
44
- position: absolute;
45
- left: -9999px;
46
- }
47
-
48
- .cc-radio-circle {
49
- width: var(--cc-radio-size, 20px);
50
- height: var(--cc-radio-size, 20px);
51
- border: 2px solid var(--cc-radio-unchecked-color, #5F6368);
52
- border-radius: var(--cc-radio-border-radius, 50%);
53
- margin-right: 8px;
54
- flex-shrink: 0;
55
- position: relative;
56
- background: white;
57
- box-sizing: border-box;
58
- }
59
-
60
- .cc-radio-circle::after {
61
- content: '';
62
- width: calc(var(--cc-radio-size, 20px) * 0.5);
63
- height: calc(var(--cc-radio-size, 20px) * 0.5);
64
- background: var(--cc-radio-checked-color, #1A73E8);
65
- border-radius: var(--cc-radio-border-radius, 50%);
66
- position: absolute;
67
- top: 50%;
68
- left: 50%;
69
- transform: translate(-50%, -50%) scale(0);
70
- transition: transform 0.2s;
71
- }
72
-
73
- .cc-native-radio:checked+.cc-radio-circle {
74
- border-color: var(--cc-radio-checked-color, #1A73E8);
75
- }
76
-
77
- .cc-native-radio:checked+.cc-radio-circle::after {
78
- transform: translate(-50%, -50%) scale(1);
79
- }
80
-
81
- /* APPROACH 2: Visible Native Radio (Fallback - uncomment if custom doesn't work) */
82
- /*
83
- .cc-native-radio {
84
- width: 20px;
85
- height: 20px;
86
- margin-right: 8px;
87
- cursor: pointer;
88
- flex-shrink: 0;
89
- appearance: auto;
90
- -webkit-appearance: radio;
91
- -moz-appearance: radio;
92
- }
93
-
94
- .cc-radio-circle {
95
- display: none;
96
- }
97
- */
98
-
99
- .cc-text {
100
- line-height: 1.5;
101
- }
102
-
103
- /* Disabled states */
104
- .cc-radio-label.disabled {
105
- opacity: 0.5;
106
- cursor: not-allowed;
107
- }
@@ -1,181 +0,0 @@
1
- import { Component, Input, Output, EventEmitter, forwardRef, OnInit } from '@angular/core';
2
- import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
3
- import { RadioConfig, RadioOption, RadioLabels } from './radio.models';
4
-
5
- @Component({
6
- selector: 'lib-radio',
7
- templateUrl: './radio.component.html',
8
- styleUrls: ['./radio.component.scss'],
9
- standalone: false,
10
- providers: [
11
- {
12
- provide: NG_VALUE_ACCESSOR,
13
- useExisting: forwardRef(() => RadioComponent),
14
- multi: true
15
- }
16
- ]
17
- })
18
- export class RadioComponent implements ControlValueAccessor, OnInit {
19
- @Input() config?: RadioConfig;
20
- @Input() label: string = '';
21
- @Input() options: RadioOption[] = [];
22
- @Input() disabled: boolean = false;
23
- @Input() required: boolean = false;
24
- @Input() labelPosition: 'before' | 'after' = 'after';
25
- @Input() color: 'primary' | 'warning' | 'danger' | 'success' | 'accent' | 'warn' | string = 'primary';
26
- @Input() layout: 'vertical' | 'horizontal' = 'vertical';
27
-
28
- // i18n Labels
29
- @Input() labels: RadioLabels = {};
30
-
31
- // Customization — Layout
32
- @Input() gap?: string;
33
-
34
- // Customization — Colors
35
- @Input() labelColor?: string;
36
- @Input() checkedColor?: string;
37
- @Input() uncheckedColor?: string;
38
-
39
- // Customization — Typography
40
- @Input() fontSize?: string;
41
- @Input() fontWeight?: string;
42
- @Input() fontFamily?: string;
43
-
44
- // Customization — Group label
45
- @Input() groupLabelColor?: string;
46
- @Input() groupLabelFontSize?: string;
47
- @Input() groupLabelFontWeight?: string;
48
-
49
- // Customization — States
50
- @Input() disabledColor?: string;
51
- @Input() errorColor?: string;
52
-
53
- // Customization — Size
54
- @Input() size?: string;
55
- @Input() borderRadius?: string;
56
-
57
- // Customization — Synonyms for Playground
58
- @Input() labelFontSize?: string;
59
- @Input() labelFontWeight?: string;
60
-
61
- @Output() selectionChange = new EventEmitter<any>();
62
-
63
- value: any;
64
- uuid = `radio-group-${Math.random().toString(36).substr(2, 9)}`;
65
-
66
- private onChange: (value: any) => void = () => { };
67
- private onTouched: () => void = () => { };
68
-
69
- ngOnInit(): void {
70
- this.updateFromConfig();
71
- // i18n labels override
72
- if (this.labels) {
73
- this.label = this.labels.label || this.label;
74
- }
75
- }
76
-
77
- ngOnChanges(changes: any): void {
78
- if (changes.config) {
79
- this.updateFromConfig();
80
- }
81
- }
82
-
83
- private updateFromConfig(): void {
84
- if (this.config) {
85
- this.label = this.config.label ?? this.label;
86
- this.options = this.config.options || this.options;
87
- this.disabled = this.config.disabled ?? this.disabled;
88
- this.required = this.config.required ?? this.required;
89
- this.labelPosition = this.config.labelPosition ?? this.labelPosition;
90
- this.color = this.config.color ?? this.color;
91
- this.layout = this.config.layout ?? this.layout;
92
- this.value = this.config.value;
93
-
94
- // Style mappings
95
- this.gap = this.config.gap ?? this.gap;
96
- this.labelColor = this.config.labelColor ?? this.labelColor;
97
- this.checkedColor = this.config.checkedColor ?? this.checkedColor;
98
- this.uncheckedColor = this.config.uncheckedColor ?? this.uncheckedColor;
99
- this.fontSize = this.config.fontSize ?? this.fontSize;
100
- this.fontWeight = this.config.fontWeight ?? this.fontWeight;
101
- this.fontFamily = this.config.fontFamily ?? this.fontFamily;
102
- this.groupLabelColor = this.config.groupLabelColor ?? this.groupLabelColor;
103
- this.groupLabelFontSize = this.config.groupLabelFontSize ?? this.groupLabelFontSize;
104
- this.groupLabelFontWeight = this.config.groupLabelFontWeight ?? this.groupLabelFontWeight;
105
- this.disabledColor = this.config.disabledColor ?? this.disabledColor;
106
- this.errorColor = this.config.errorColor ?? this.errorColor;
107
- this.size = this.config.size ?? this.size;
108
- this.borderRadius = this.config.borderRadius ?? this.borderRadius;
109
- this.labelFontSize = this.config.labelFontSize ?? this.labelFontSize;
110
- this.labelFontWeight = this.config.labelFontWeight ?? this.labelFontWeight;
111
- }
112
- }
113
-
114
-
115
- get requiredMarker(): string {
116
- return this.labels?.requiredMarker || '*';
117
- }
118
-
119
- get visibleOptions(): RadioOption[] {
120
- return this.options.filter(o => o.label != null && o.label !== '');
121
- }
122
-
123
- writeValue(value: any): void {
124
- this.value = value;
125
- }
126
-
127
- registerOnChange(fn: any): void {
128
- this.onChange = fn;
129
- }
130
-
131
- registerOnTouched(fn: any): void {
132
- this.onTouched = fn;
133
- }
134
-
135
- setDisabledState(isDisabled: boolean): void {
136
- this.disabled = isDisabled;
137
- }
138
-
139
- onRadioChange(option: RadioOption): void {
140
- this.value = option.value;
141
- this.onChange(this.value);
142
- this.onTouched();
143
- this.selectionChange.emit(this.value);
144
- }
145
-
146
- private getStyleValue(value: string | undefined): string | undefined {
147
- return value ? `${value}` : undefined;
148
- }
149
-
150
- private getThemeColor(colorStr: string | undefined): string | undefined {
151
- if (!colorStr) return undefined;
152
- const themeColors: { [key: string]: string } = {
153
- 'primary': 'var(--cc-radio-primary-bg, var(--cc-btn-primary-bg, #1A73E8))',
154
- 'warning': 'var(--cc-radio-warning-bg, var(--cc-btn-warning-bg, #F9C80E))',
155
- 'danger': 'var(--cc-radio-danger-bg, var(--cc-btn-danger-bg, #dc3545))',
156
- 'success': 'var(--cc-radio-success-bg, var(--cc-btn-success-bg, #28a745))',
157
- 'warn': 'var(--cc-radio-danger-bg, var(--cc-btn-danger-bg, #dc3545))',
158
- 'accent': 'var(--cc-radio-accent-bg, #ff4081)'
159
- };
160
- return themeColors[colorStr] || colorStr;
161
- }
162
-
163
- get wrapperStyles(): { [key: string]: string | undefined } {
164
- return {
165
- '--cc-radio-font-family': this.getStyleValue(this.fontFamily),
166
- '--cc-radio-font-size': this.getStyleValue(this.fontSize || this.labelFontSize),
167
- '--cc-radio-font-weight': this.getStyleValue(this.fontWeight || this.labelFontWeight),
168
- '--cc-radio-label-color': this.getStyleValue(this.labelColor),
169
- '--cc-radio-size': this.getStyleValue(this.size),
170
- '--cc-radio-border-radius': this.getStyleValue(this.borderRadius),
171
- '--cc-radio-checked-color': this.getStyleValue(this.getThemeColor(this.checkedColor || this.color)),
172
- '--cc-radio-unchecked-color': this.getStyleValue(this.uncheckedColor),
173
- '--cc-radio-disabled-color': this.getStyleValue(this.disabledColor),
174
- '--cc-radio-error-color': this.getStyleValue(this.errorColor),
175
- '--cc-radio-group-gap': this.getStyleValue(this.gap),
176
- '--cc-radio-group-label-color': this.getStyleValue(this.groupLabelColor),
177
- '--cc-radio-group-label-font-size': this.getStyleValue(this.groupLabelFontSize),
178
- '--cc-radio-group-label-font-weight': this.getStyleValue(this.groupLabelFontWeight)
179
- };
180
- }
181
- }
@@ -1,39 +0,0 @@
1
- export interface RadioOption {
2
- value: any;
3
- label: string;
4
- disabled?: boolean;
5
- }
6
-
7
- export interface RadioLabels {
8
- label?: string;
9
- requiredMarker?: string;
10
- }
11
-
12
- export interface RadioConfig {
13
- label?: string;
14
- options: RadioOption[];
15
- value?: any;
16
- disabled?: boolean;
17
- required?: boolean;
18
- labelPosition?: 'before' | 'after';
19
- color?: 'primary' | 'warning' | 'danger' | 'success' | 'accent' | 'warn' | string;
20
- layout?: 'vertical' | 'horizontal';
21
-
22
- // Customization
23
- gap?: string;
24
- labelColor?: string;
25
- checkedColor?: string;
26
- uncheckedColor?: string;
27
- fontSize?: string;
28
- fontWeight?: string;
29
- fontFamily?: string;
30
- groupLabelColor?: string;
31
- groupLabelFontSize?: string;
32
- groupLabelFontWeight?: string;
33
- disabledColor?: string;
34
- errorColor?: string;
35
- size?: string;
36
- borderRadius?: string;
37
- labelFontSize?: string;
38
- labelFontWeight?: string;
39
- }
@@ -1,15 +0,0 @@
1
- <div class="cc-search-wrapper" [ngStyle]="wrapperStyles">
2
- <label *ngIf="label" class="cc-search-label" [ngStyle]="labelStyles">{{ label }}</label>
3
-
4
- <div class="cc-search-field" [class.focused]="focused" [class.disabled]="disabled" [ngStyle]="fieldStyles">
5
- <span class="cc-search-icon material-icons">search</span>
6
-
7
- <input type="text" class="cc-search-input" [value]="value" [placeholder]="placeholder" [disabled]="disabled"
8
- (input)="onInputChange($event)" (blur)="onBlur()" (focus)="onFocus()" />
9
-
10
- <button *ngIf="clearable && value && !disabled" type="button" class="cc-clear-btn" (click)="onClear()"
11
- [attr.aria-label]="clearAriaLabel">
12
- <span class="material-icons">close</span>
13
- </button>
14
- </div>
15
- </div>