commons-shared-web-ui 0.0.55 → 0.0.57

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 (223) 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/src/lib/modules/button/button.theme.scss +4 -4
  6. package/.claude/settings.local.json +0 -10
  7. package/documentation/alert.md +0 -123
  8. package/documentation/button-dropdown.md +0 -126
  9. package/documentation/button.md +0 -184
  10. package/documentation/cards-usage-guidelines.md +0 -131
  11. package/documentation/configurable-form.md +0 -605
  12. package/documentation/confirmation-modal.md +0 -250
  13. package/documentation/filter-sidebar.md +0 -178
  14. package/documentation/filter-table-selector.md +0 -228
  15. package/documentation/form-builder.md +0 -599
  16. package/documentation/form-components.md +0 -384
  17. package/documentation/form-field-configuration.md +0 -250
  18. package/documentation/nav.md +0 -427
  19. package/documentation/pagination.md +0 -181
  20. package/documentation/side-nav-documentation.md +0 -169
  21. package/documentation/smart-form.md +0 -2765
  22. package/documentation/smart-table.md +0 -1221
  23. package/documentation/snackbar.md +0 -118
  24. package/documentation/style-externalization.md +0 -88
  25. package/documentation/summary-card.md +0 -279
  26. package/documentation/table-column-configuration.md +0 -221
  27. package/documentation/time-picker.md +0 -274
  28. package/ng-package.json +0 -30
  29. package/src/lib/modules/alert/alert.models.ts +0 -6
  30. package/src/lib/modules/alert/alert.module.ts +0 -16
  31. package/src/lib/modules/alert/components/alert/alert.component.html +0 -27
  32. package/src/lib/modules/alert/components/alert/alert.component.scss +0 -92
  33. package/src/lib/modules/alert/components/alert/alert.component.ts +0 -81
  34. package/src/lib/modules/button/button.models.ts +0 -13
  35. package/src/lib/modules/button/button.module.ts +0 -16
  36. package/src/lib/modules/button/components/button/button.component.html +0 -22
  37. package/src/lib/modules/button/components/button/button.component.scss +0 -88
  38. package/src/lib/modules/button/components/button/button.component.ts +0 -67
  39. package/src/lib/modules/button-dropdown/button-dropdown.models.ts +0 -26
  40. package/src/lib/modules/button-dropdown/button-dropdown.module.ts +0 -22
  41. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.html +0 -41
  42. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.scss +0 -135
  43. package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.ts +0 -160
  44. package/src/lib/modules/configurable-form/component/configurable-form.component.html +0 -294
  45. package/src/lib/modules/configurable-form/component/configurable-form.component.scss +0 -503
  46. package/src/lib/modules/configurable-form/component/configurable-form.component.ts +0 -628
  47. package/src/lib/modules/configurable-form/configurable-form.examples.ts +0 -154
  48. package/src/lib/modules/configurable-form/configurable-form.model.ts +0 -131
  49. package/src/lib/modules/configurable-form/configurable-form.module.ts +0 -19
  50. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.html +0 -77
  51. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.scss +0 -395
  52. package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.ts +0 -266
  53. package/src/lib/modules/confirmation-modal/confirmation-modal.models.ts +0 -71
  54. package/src/lib/modules/confirmation-modal/confirmation-modal.module.ts +0 -20
  55. package/src/lib/modules/filter/components/filter/filter.component.html +0 -131
  56. package/src/lib/modules/filter/components/filter/filter.component.scss +0 -245
  57. package/src/lib/modules/filter/components/filter/filter.component.ts +0 -216
  58. package/src/lib/modules/filter/filter.models.ts +0 -88
  59. package/src/lib/modules/filter/filter.module.ts +0 -24
  60. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html +0 -112
  61. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss +0 -186
  62. package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts +0 -163
  63. package/src/lib/modules/filter-sidebar/filter-sidebar.models.ts +0 -95
  64. package/src/lib/modules/filter-sidebar/filter-sidebar.module.ts +0 -24
  65. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.html +0 -73
  66. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.scss +0 -321
  67. package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.ts +0 -361
  68. package/src/lib/modules/filter-table-selector/filter-table-selector.models.ts +0 -91
  69. package/src/lib/modules/filter-table-selector/filter-table-selector.module.ts +0 -22
  70. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.html +0 -63
  71. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.scss +0 -496
  72. package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.ts +0 -445
  73. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.html +0 -75
  74. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.scss +0 -210
  75. package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.ts +0 -55
  76. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.html +0 -25
  77. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.scss +0 -82
  78. package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.ts +0 -95
  79. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.html +0 -20
  80. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.scss +0 -37
  81. package/src/lib/modules/form-builder/components/field-selection/field-selection.component.ts +0 -94
  82. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.html +0 -46
  83. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.scss +0 -102
  84. package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.ts +0 -50
  85. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.html +0 -35
  86. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.scss +0 -67
  87. package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.ts +0 -34
  88. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.html +0 -68
  89. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.scss +0 -113
  90. package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.ts +0 -74
  91. package/src/lib/modules/form-builder/configs/field-type-schema.map.ts +0 -533
  92. package/src/lib/modules/form-builder/form-builder.module.ts +0 -36
  93. package/src/lib/modules/form-builder/index.ts +0 -9
  94. package/src/lib/modules/form-builder/models/builder.models.ts +0 -7
  95. package/src/lib/modules/form-builder/models/field-configurator.models.ts +0 -38
  96. package/src/lib/modules/form-builder/models/field-selection.models.ts +0 -51
  97. package/src/lib/modules/form-builder/services/field-configurator.service.ts +0 -258
  98. package/src/lib/modules/form-builder/services/field-selection.service.ts +0 -299
  99. package/src/lib/modules/form-builder/services/form-schema-tree.service.ts +0 -670
  100. package/src/lib/modules/form-builder/tokens/builder.tokens.ts +0 -10
  101. package/src/lib/modules/form-builder/utils/constants.ts +0 -43
  102. package/src/lib/modules/form-components/components/checkbox/checkbox.component.html +0 -29
  103. package/src/lib/modules/form-components/components/checkbox/checkbox.component.scss +0 -111
  104. package/src/lib/modules/form-components/components/checkbox/checkbox.component.ts +0 -207
  105. package/src/lib/modules/form-components/components/checkbox/checkbox.models.ts +0 -35
  106. package/src/lib/modules/form-components/components/datepicker/datepicker.component.html +0 -42
  107. package/src/lib/modules/form-components/components/datepicker/datepicker.component.scss +0 -115
  108. package/src/lib/modules/form-components/components/datepicker/datepicker.component.ts +0 -267
  109. package/src/lib/modules/form-components/components/datepicker/datepicker.models.ts +0 -45
  110. package/src/lib/modules/form-components/components/dropdown/dropdown.component.html +0 -74
  111. package/src/lib/modules/form-components/components/dropdown/dropdown.component.scss +0 -252
  112. package/src/lib/modules/form-components/components/dropdown/dropdown.component.ts +0 -377
  113. package/src/lib/modules/form-components/components/dropdown/dropdown.models.ts +0 -53
  114. package/src/lib/modules/form-components/components/input/input.component.html +0 -51
  115. package/src/lib/modules/form-components/components/input/input.component.scss +0 -128
  116. package/src/lib/modules/form-components/components/input/input.component.ts +0 -250
  117. package/src/lib/modules/form-components/components/input/input.models.ts +0 -55
  118. package/src/lib/modules/form-components/components/radio/radio.component.html +0 -22
  119. package/src/lib/modules/form-components/components/radio/radio.component.scss +0 -107
  120. package/src/lib/modules/form-components/components/radio/radio.component.ts +0 -181
  121. package/src/lib/modules/form-components/components/radio/radio.models.ts +0 -39
  122. package/src/lib/modules/form-components/components/search/search.component.html +0 -15
  123. package/src/lib/modules/form-components/components/search/search.component.scss +0 -87
  124. package/src/lib/modules/form-components/components/search/search.component.ts +0 -213
  125. package/src/lib/modules/form-components/components/search/search.models.ts +0 -40
  126. package/src/lib/modules/form-components/components/toggle/toggle.component.html +0 -15
  127. package/src/lib/modules/form-components/components/toggle/toggle.component.scss +0 -81
  128. package/src/lib/modules/form-components/components/toggle/toggle.component.ts +0 -166
  129. package/src/lib/modules/form-components/components/toggle/toggle.models.ts +0 -27
  130. package/src/lib/modules/form-components/directives/click-outside.directive.ts +0 -22
  131. package/src/lib/modules/form-components/form-components.module.ts +0 -42
  132. package/src/lib/modules/form-field-configuration/components/_ffc-controls.scss +0 -89
  133. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.html +0 -68
  134. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.scss +0 -73
  135. package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.ts +0 -34
  136. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.html +0 -78
  137. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.scss +0 -83
  138. package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.ts +0 -94
  139. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.html +0 -38
  140. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.scss +0 -42
  141. package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.ts +0 -92
  142. package/src/lib/modules/form-field-configuration/form-field-configuration.module.ts +0 -23
  143. package/src/lib/modules/form-field-configuration/index.ts +0 -7
  144. package/src/lib/modules/form-field-configuration/models/field-configuration.models.ts +0 -62
  145. package/src/lib/modules/form-field-configuration/services/config-schema-tree.service.ts +0 -159
  146. package/src/lib/modules/form-field-configuration/services/field-configuration.service.ts +0 -228
  147. package/src/lib/modules/material/material.module.ts +0 -94
  148. package/src/lib/modules/nav/components/nav/nav.component.html +0 -34
  149. package/src/lib/modules/nav/components/nav/nav.component.scss +0 -171
  150. package/src/lib/modules/nav/components/nav/nav.component.ts +0 -82
  151. package/src/lib/modules/nav/nav.models.ts +0 -31
  152. package/src/lib/modules/nav/nav.module.ts +0 -17
  153. package/src/lib/modules/pagination/components/pagination/pagination.component.html +0 -52
  154. package/src/lib/modules/pagination/components/pagination/pagination.component.scss +0 -155
  155. package/src/lib/modules/pagination/components/pagination/pagination.component.ts +0 -109
  156. package/src/lib/modules/pagination/pagination.module.ts +0 -17
  157. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.html +0 -56
  158. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.scss +0 -342
  159. package/src/lib/modules/side-nav/components/side-nav/side-nav.component.ts +0 -135
  160. package/src/lib/modules/side-nav/side-nav.models.ts +0 -38
  161. package/src/lib/modules/side-nav/side-nav.module.ts +0 -16
  162. package/src/lib/modules/smart-form/components/form-field/form-field.component.html +0 -1330
  163. package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +0 -2112
  164. package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +0 -3006
  165. package/src/lib/modules/smart-form/components/form-section/form-section.component.html +0 -65
  166. package/src/lib/modules/smart-form/components/form-section/form-section.component.scss +0 -209
  167. package/src/lib/modules/smart-form/components/form-section/form-section.component.ts +0 -131
  168. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.html +0 -253
  169. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.scss +0 -689
  170. package/src/lib/modules/smart-form/components/smart-form/smart-form.component.ts +0 -1131
  171. package/src/lib/modules/smart-form/index.ts +0 -10
  172. package/src/lib/modules/smart-form/models/form-schema.model.ts +0 -793
  173. package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +0 -21
  174. package/src/lib/modules/smart-form/services/expression.service.ts +0 -75
  175. package/src/lib/modules/smart-form/services/smart-form-controller.service.ts +0 -67
  176. package/src/lib/modules/smart-form/smart-form.examples.ts +0 -1324
  177. package/src/lib/modules/smart-form/smart-form.module.ts +0 -38
  178. package/src/lib/modules/smart-form/utils/translation.utils.ts +0 -82
  179. package/src/lib/modules/smart-form/utils/trusted-url.pipe.ts +0 -25
  180. package/src/lib/modules/smart-form/utils/validation.utils.ts +0 -98
  181. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.html +0 -283
  182. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.scss +0 -685
  183. package/src/lib/modules/smart-table/components/smart-table/smart-table.component.ts +0 -1128
  184. package/src/lib/modules/smart-table/models/table-config.model.ts +0 -213
  185. package/src/lib/modules/smart-table/smart-table.module.ts +0 -30
  186. package/src/lib/modules/smart-table/utils/safe-html.pipe.ts +0 -28
  187. package/src/lib/modules/smart-table/utils/smart-table.utils.ts +0 -18
  188. package/src/lib/modules/snackbar/components/snackbar.component.html +0 -41
  189. package/src/lib/modules/snackbar/components/snackbar.component.scss +0 -99
  190. package/src/lib/modules/snackbar/components/snackbar.component.ts +0 -18
  191. package/src/lib/modules/snackbar/models/snackbar.models.ts +0 -10
  192. package/src/lib/modules/snackbar/services/snackbar.service.ts +0 -40
  193. package/src/lib/modules/snackbar/snackbar.module.ts +0 -11
  194. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.html +0 -47
  195. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.scss +0 -199
  196. package/src/lib/modules/summary-card/components/summary-card/summary-card.component.ts +0 -126
  197. package/src/lib/modules/summary-card/summary-card.module.ts +0 -18
  198. package/src/lib/modules/table-column-configuration/components/_tcc-controls.scss +0 -53
  199. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.html +0 -47
  200. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.scss +0 -50
  201. package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.ts +0 -33
  202. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.html +0 -30
  203. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.scss +0 -36
  204. package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.ts +0 -78
  205. package/src/lib/modules/table-column-configuration/index.ts +0 -5
  206. package/src/lib/modules/table-column-configuration/models/table-column-configuration.models.ts +0 -20
  207. package/src/lib/modules/table-column-configuration/services/table-column-configuration.service.ts +0 -77
  208. package/src/lib/modules/table-column-configuration/table-column-configuration.module.ts +0 -21
  209. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.html +0 -37
  210. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.scss +0 -102
  211. package/src/lib/modules/time-picker/components/time-picker/time-picker.component.ts +0 -178
  212. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.html +0 -78
  213. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.scss +0 -226
  214. package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.ts +0 -595
  215. package/src/lib/modules/time-picker/models/time-picker.models.ts +0 -49
  216. package/src/lib/modules/time-picker/time-picker.module.ts +0 -23
  217. package/src/lib/shared-ui.module.ts +0 -55
  218. package/src/lib/utils/constants.ts +0 -11
  219. package/src/lib/utils/storage.utils.ts +0 -37
  220. package/src/lib/utils/string.utils.ts +0 -23
  221. package/src/lib/utils/translation.utils.ts +0 -87
  222. package/src/public-api.ts +0 -127
  223. package/tsconfig.lib.json +0 -15
@@ -1,38 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { ReactiveFormsModule, FormsModule } from '@angular/forms';
4
- import { MaterialModule } from '../material/material.module';
5
- import { SmartFormComponent } from './components/smart-form/smart-form.component';
6
- import { FormSectionComponent } from './components/form-section/form-section.component';
7
- import { FormFieldComponent } from './components/form-field/form-field.component';
8
- import { ExpressionService } from './services/expression.service';
9
- import { ButtonModule } from '../button/button.module';
10
- import { AlertModule } from '../alert/alert.module';
11
- import { QuillModule } from 'ngx-quill';
12
- import { TrustedUrlPipe } from './utils/trusted-url.pipe';
13
- import { TimePickerModule } from '../time-picker/time-picker.module';
14
- @NgModule({
15
- declarations: [
16
- SmartFormComponent,
17
- FormSectionComponent,
18
- FormFieldComponent,
19
- TrustedUrlPipe
20
- ],
21
- imports: [
22
- CommonModule,
23
- ReactiveFormsModule,
24
- FormsModule,
25
- MaterialModule,
26
- ButtonModule,
27
- AlertModule,
28
- QuillModule.forRoot(),
29
- TimePickerModule
30
- ],
31
- exports: [
32
- SmartFormComponent
33
- ],
34
- providers: [
35
- ExpressionService
36
- ]
37
- })
38
- export class SmartFormModule { }
@@ -1,82 +0,0 @@
1
- import { FieldConfig, FormSchema } from '../models/form-schema.model';
2
-
3
- /**
4
- * Utility class for translating Smart Form schemas.
5
- */
6
- export class SmartFormTranslationUtils {
7
-
8
- /**
9
- * Recursively walks the schema and replaces i18n keys with values from labels map.
10
- * @param schema The FormSchema to translate.
11
- * @param labels The labels map (can be flat or contain labelsObject property).
12
- */
13
- static translateSchema(schema: FormSchema, labels: any): void {
14
- if (!schema || !labels) return;
15
-
16
- // Support both flat labels map and the pattern used in ConfigurableForm which passes { labelsObject: ... }
17
- const labelsMap = labels.labelsObject || labels;
18
- const translate = (key: string) => labelsMap[key] || key;
19
-
20
- // Root properties
21
- if (schema.label) schema.label = translate(schema.label);
22
- if (schema.description) schema.description = translate(schema.description);
23
-
24
- // Submit config
25
- if (schema.submitConfig) {
26
- if (schema.submitConfig.successMessage) schema.submitConfig.successMessage = translate(schema.submitConfig.successMessage);
27
- if (schema.submitConfig.errorMessage) schema.submitConfig.errorMessage = translate(schema.submitConfig.errorMessage);
28
- }
29
-
30
- // Section config
31
- if (schema.sectionConfig) {
32
- this.translateSection(schema.sectionConfig, translate);
33
- }
34
-
35
- // Stepper config
36
- if (schema.stepperConfig?.children) {
37
- schema.stepperConfig.children.forEach(field => this.translateField(field, translate));
38
- }
39
- }
40
-
41
- private static translateSection(section: any, translate: (key: string) => string): void {
42
- if (section.label) section.label = translate(section.label);
43
- if (section.children) {
44
- section.children.forEach((field: FieldConfig) => this.translateField(field, translate));
45
- }
46
- }
47
-
48
- private static translateField(field: FieldConfig, translate: (key: string) => string): void {
49
- if (field.label) field.label = translate(field.label);
50
- if (field.placeholder) field.placeholder = translate(field.placeholder);
51
- if (field.hint) field.hint = translate(field.hint);
52
-
53
- if (field.richTextConfig?.placeholder) {
54
- field.richTextConfig.placeholder = translate(field.richTextConfig.placeholder);
55
- }
56
-
57
- if (field.textConfig?.patternMessage) {
58
- field.textConfig.patternMessage = translate(field.textConfig.patternMessage);
59
- }
60
-
61
- if (field.attachmentConfig?.acceptLabel) {
62
- field.attachmentConfig.acceptLabel = translate(field.attachmentConfig.acceptLabel);
63
- }
64
-
65
- if (field.optionConfig?.optionList) {
66
- field.optionConfig.optionList.forEach(opt => {
67
- if (opt.label) opt.label = translate(opt.label);
68
- if (opt.hint) opt.hint = translate(opt.hint);
69
- });
70
- }
71
-
72
- // Recurse into children (ROW or GROUP)
73
- if (field.children) {
74
- field.children.forEach(child => this.translateField(child, translate));
75
- }
76
-
77
- // Recurse into nested section config
78
- if (field.sectionConfig) {
79
- this.translateSection(field.sectionConfig, translate);
80
- }
81
- }
82
- }
@@ -1,25 +0,0 @@
1
- import { Pipe, PipeTransform, SecurityContext } from '@angular/core';
2
- import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
3
-
4
- /**
5
- * Bypasses Angular's DomSanitizer for resource URLs (e.g. YouTube embed iframes).
6
- * Used only for trusted URLs such as YouTube embed links derived from user-provided video IDs.
7
- */
8
- @Pipe({
9
- name: 'trustedUrl',
10
- standalone: false
11
- })
12
- export class TrustedUrlPipe implements PipeTransform {
13
- constructor(private sanitizer: DomSanitizer) { }
14
-
15
- transform(url: string): SafeResourceUrl | null {
16
- if (!url) {
17
- return null;
18
- }
19
- const cleaned = this.sanitizer.sanitize(SecurityContext.URL, url);
20
- if (!cleaned) {
21
- return null;
22
- }
23
- return this.sanitizer.bypassSecurityTrustResourceUrl(cleaned);
24
- }
25
- }
@@ -1,98 +0,0 @@
1
- import { AbstractControl, FormGroup, ValidationErrors, ValidatorFn } from '@angular/forms';
2
-
3
- export class ValidationUtils {
4
-
5
-
6
-
7
- static email(): ValidatorFn {
8
- return (control: AbstractControl): ValidationErrors | null => {
9
- if (!control.value) return null;
10
- const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
11
- return emailRegex.test(control.value) ? null : { email: true };
12
- };
13
- }
14
-
15
- static phone(): ValidatorFn {
16
- return (control: AbstractControl): ValidationErrors | null => {
17
- if (!control.value) return null;
18
- const phoneRegex = /^\+?[\d\s\-\(\)]{10,}$/;
19
- return phoneRegex.test(control.value) ? null : { phone: true };
20
- };
21
- }
22
-
23
- static url(): ValidatorFn {
24
- return (control: AbstractControl): ValidationErrors | null => {
25
- if (!control.value) return null;
26
- const urlRegex = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/;
27
- return urlRegex.test(control.value) ? null : { url: true };
28
- };
29
- }
30
-
31
- static minLength(min: number): ValidatorFn {
32
- return (control: AbstractControl): ValidationErrors | null => {
33
- if (!control.value) return null;
34
- return control.value.length >= min ? null : { minLength: { min, actual: control.value.length } };
35
- };
36
- }
37
-
38
- static maxLength(max: number): ValidatorFn {
39
- return (control: AbstractControl): ValidationErrors | null => {
40
- if (!control.value) return null;
41
- return control.value.length <= max ? null : { maxLength: { max, actual: control.value.length } };
42
- };
43
- }
44
-
45
- static pattern(pattern: string, message?: string): ValidatorFn {
46
- return (control: AbstractControl): ValidationErrors | null => {
47
- if (!control.value) return null;
48
- const regex = new RegExp(pattern);
49
- return regex.test(control.value) ? null : { pattern: { message: message || 'Invalid format' } };
50
- };
51
- }
52
-
53
- static numberRange(min?: number, max?: number): ValidatorFn {
54
- return (control: AbstractControl): ValidationErrors | null => {
55
- if (!control.value && control.value !== 0) return null;
56
- const value = Number(control.value);
57
- if (min !== undefined && value < min) {
58
- return { min: { min, actual: value } };
59
- }
60
- if (max !== undefined && value > max) {
61
- return { max: { max, actual: value } };
62
- }
63
- return null;
64
- };
65
- }
66
-
67
- static dateRange(minDate?: string, maxDate?: string): ValidatorFn {
68
- return (control: AbstractControl): ValidationErrors | null => {
69
- if (!control.value) return null;
70
- const date = new Date(control.value);
71
- if (minDate && date < new Date(minDate)) {
72
- return { minDate: { minDate } };
73
- }
74
- if (maxDate && date > new Date(maxDate)) {
75
- return { maxDate: { maxDate } };
76
- }
77
- return null;
78
- };
79
- }
80
-
81
- static getErrorMessage(errors: ValidationErrors | null): string {
82
- if (!errors) return '';
83
-
84
- if (errors['required']) return 'This field is required';
85
- if (errors['email']) return 'Please enter a valid email address';
86
- if (errors['phone']) return 'Please enter a valid phone number';
87
- if (errors['url']) return 'Please enter a valid URL';
88
- if (errors['minLength']) return `Minimum length is ${errors['minLength'].min} characters`;
89
- if (errors['maxLength']) return `Maximum length is ${errors['maxLength'].max} characters`;
90
- if (errors['min']) return `Minimum value is ${errors['min'].min}`;
91
- if (errors['max']) return `Maximum value is ${errors['max'].max}`;
92
- if (errors['minDate']) return `Date must be after ${errors['minDate'].minDate}`;
93
- if (errors['maxDate']) return `Date must be before ${errors['maxDate'].maxDate}`;
94
- if (errors['pattern']) return errors['pattern'].message || 'Invalid format';
95
-
96
- return 'Invalid value';
97
- }
98
- }
@@ -1,283 +0,0 @@
1
- <div class="smart-table-outer">
2
- <!-- Table Card -->
3
- <div class="smart-table-wrapper">
4
- <!-- Top Toolbar -->
5
- <div class="st-toolbar" *ngIf="config.searchConfig?.enabled || (config.filters && config.filters.length > 0) || (config.topBarButtons && config.topBarButtons.length > 0)">
6
-
7
- <!-- Search -->
8
- <div class="st-search" *ngIf="config.searchConfig?.enabled">
9
- <i class="fa fa-search"></i>
10
- <input type="text" [placeholder]="config.labels?.searchPlaceholder || 'Search'" (input)="onSearch($event)">
11
- </div>
12
-
13
- <!-- Filters -->
14
- <div class="st-filters" *ngIf="config.filters">
15
- <div class="st-filter-item" *ngFor="let filter of config.filters">
16
- <!-- Trigger -->
17
- <div class="st-filter-trigger"
18
- [class.active]="openFilterKey === filter.key"
19
- [class.has-value]="isFilterActive(filter)"
20
- (click)="toggleFilter(filter.key, $event)">
21
- <span class="st-filter-trigger-label">{{ getFilterDisplay(filter) }}</span>
22
- <svg class="st-filter-chevron" width="12" height="12" viewBox="0 0 12 12" fill="none">
23
- <path d="M2.5 4.5L6 8L9.5 4.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
24
- </svg>
25
- </div>
26
- </div>
27
- </div>
28
-
29
- <!-- Top Bar Buttons -->
30
- <div class="st-actions" *ngIf="config.topBarButtons">
31
- <lib-button *ngFor="let btn of getVisibleActions(config.topBarButtons)"
32
- [variant]="btn.btnVariant || 'primary'"
33
- [icon]="btn.icon || ''"
34
- (click)="onTopAction(btn)">
35
- {{ btn.label }}
36
- </lib-button>
37
- </div>
38
- </div>
39
-
40
- <!-- Selection count strip — visible whenever selectable is enabled -->
41
- <div class="st-selection-strip" *ngIf="config.selectable">
42
- <span class="st-selection-count">{{ selectedRows.length }} of {{ totalItems > 0 ? totalItems : data.length }} selected</span>
43
- </div>
44
-
45
- <!-- Table Container -->
46
- <div class="st-table-container">
47
- <div class="st-check-loader" *ngIf="loading">
48
- <div class="spinner"></div>
49
- </div>
50
- <table class="st-table" [class.loading-data]="loading" [class.is-selectable]="config.selectable">
51
- <thead>
52
- <tr>
53
- <th *ngIf="config.selectable" class="st-checkbox-col">
54
- <input type="checkbox" (change)="onSelectAll($event)">
55
- </th>
56
- <th *ngFor="let col of config.columns; let colIndex = index"
57
- #stickyHeader
58
- [class.sortable]="col.sortable"
59
- [class.sticky-col]="col.sticky"
60
- [class.first-data-col]="colIndex === 0"
61
- [ngStyle]="stickyColumnStyles[col.key]"
62
- (click)="onSort(col)">
63
- {{ col.label }}
64
- <span *ngIf="col.sortable" class="sort-icon-wrap">
65
- <svg width="18" height="18" viewBox="0 0 18 18" fill="none">
66
- <!-- Down arrow — RIGHT side, prominent when DESC -->
67
- <path d="M11.258 15.8153L14.5913 13.2699C14.7483 13.15 14.8364 12.9875 14.8364 12.818C14.8364 12.6486 14.7483 12.4861 14.5913 12.3662C14.4344 12.2464 14.2216 12.1791 13.9997 12.1791C13.7778 12.1791 13.5649 12.2464 13.408 12.3662L11.4997 13.8299V2.63636C11.4997 2.46758 11.4119 2.30572 11.2556 2.18638C11.0993 2.06704 10.8874 2 10.6663 2C10.4453 2 10.2334 2.06704 10.0771 2.18638C9.92081 2.30572 9.83301 2.46758 9.83301 2.63636V15.3635C9.83383 15.4891 9.88333 15.6117 9.97528 15.7159C10.0672 15.8201 10.1975 15.9012 10.3497 15.9489C10.4486 15.9845 10.557 16.002 10.6663 15.9998C10.776 16.0003 10.8847 15.9843 10.9863 15.9526C11.0878 15.9209 11.1801 15.8743 11.258 15.8153Z"
68
- fill="black" [attr.fill-opacity]="getDescOpacity(col.key)"/>
69
- <!-- Up arrow — LEFT side, prominent when ASC -->
70
- <path d="M7.33316 16C7.11215 16 6.90019 15.933 6.74391 15.8136C6.58763 15.6942 6.49983 15.5324 6.49983 15.3636V4.16902L4.5915 5.63278C4.43458 5.75262 4.22175 5.81995 3.99983 5.81995C3.77791 5.81995 3.56508 5.75262 3.40816 5.63278C3.25124 5.51294 3.16309 5.3504 3.16309 5.18093C3.16309 5.01145 3.25124 4.84891 3.40816 4.72907L6.7415 2.18341C6.85868 2.0951 7.00749 2.03528 7.16915 2.01149C7.33081 1.98771 7.49807 2.00102 7.64983 2.04976C7.80201 2.0975 7.93228 2.17858 8.02423 2.28278C8.11617 2.38697 8.16567 2.50962 8.1665 2.63526V15.3636C8.1665 15.5324 8.0787 15.6942 7.92242 15.8136C7.76614 15.933 7.55418 16 7.33316 16Z"
71
- fill="black" [attr.fill-opacity]="getAscOpacity(col.key)"/>
72
- </svg>
73
- </span>
74
- </th>
75
- <th *ngIf="getVisibleActions(config.actions).length > 0" class="st-actions-col">
76
- {{ config.labels?.actionColumnHeader || 'Actions' }}
77
- </th>
78
- </tr>
79
- </thead>
80
- <tbody>
81
- <tr *ngFor="let row of data; let rowIndex = index" [class.editing-row]="row.isEditing" [ngClass]="row.isEditing && config.editingRowClass ? config.editingRowClass : ''">
82
- <td *ngIf="config.selectable" class="st-checkbox-col">
83
- <input type="checkbox" [(ngModel)]="row.selected" (change)="onRowSelect(row)">
84
- </td>
85
- <td *ngFor="let col of config.columns; let colIndex = index"
86
- [class.sticky-col]="col.sticky"
87
- [class.first-data-col]="colIndex === 0"
88
- [ngStyle]="stickyColumnStyles[col.key]"
89
- [class.clickable-cell]="col.clickAction"
90
- (click)="onColumnClick(row, col)">
91
- <!-- READ MODE -->
92
- <ng-container *ngIf="!row.isEditing">
93
- <!-- Text/Number/Date -->
94
- <span *ngIf="col.type !== 'custom' && col.type !== 'html' && col.type !== 'badge'">
95
- {{ getCellValue(row, col) }}
96
- </span>
97
- <!-- HTML -->
98
- <div *ngIf="col.type === 'html'" [innerHTML]="getCellValue(row, col) | safeHtml"></div>
99
- <!-- Badge -->
100
- <span *ngIf="col.type === 'badge'" class="st-badge" [ngClass]="getBadgeClass(row, col)">
101
- {{ getCellValue(row, col) }}
102
- </span>
103
- </ng-container>
104
-
105
- <!-- EDIT/ADD MODE -->
106
- <ng-container *ngIf="row.isEditing">
107
- <!-- Multi-field cell (stacked inputs) -->
108
- <div *ngIf="col.subFields" class="st-stacked-inputs">
109
- <ng-container *ngFor="let sub of col.subFields">
110
- <select *ngIf="sub.dataType === 'select'"
111
- [(ngModel)]="row[sub.key]"
112
- [disabled]="sub.editable === false || col.editConfig?.disabled"
113
- class="st-cell-select">
114
- <option *ngFor="let opt of sub.options" [value]="opt.value">{{ opt.label }}</option>
115
- </select>
116
- <!-- Date picker -->
117
- <div *ngIf="sub.dataType === 'date'" class="st-date-cell">
118
- <input matInput [matDatepicker]="subPicker"
119
- [(ngModel)]="row[sub.key]"
120
- [disabled]="sub.editable === false || col.editConfig?.disabled"
121
- [placeholder]="sub.placeholder || ''"
122
- class="st-cell-input"
123
- (click)="subPicker.open()">
124
- <mat-datepicker-toggle [for]="subPicker"></mat-datepicker-toggle>
125
- <mat-datepicker #subPicker></mat-datepicker>
126
- </div>
127
- <input *ngIf="sub.dataType !== 'select' && sub.dataType !== 'date'"
128
- [type]="sub.dataType"
129
- [(ngModel)]="row[sub.key]"
130
- [disabled]="sub.editable === false || col.editConfig?.disabled"
131
- [placeholder]="sub.placeholder || ''"
132
- class="st-cell-input">
133
- </ng-container>
134
- </div>
135
-
136
- <!-- Single field cell input -->
137
- <div *ngIf="!col.subFields">
138
- <select *ngIf="col.dataType === 'select'"
139
- [(ngModel)]="row[col.key]"
140
- [disabled]="col.editable === false || col.editConfig?.disabled"
141
- class="st-cell-select">
142
- <option *ngFor="let opt of col.options" [value]="opt.value">{{ opt.label }}</option>
143
- </select>
144
- <!-- Date picker -->
145
- <div *ngIf="col.dataType === 'date'" class="st-date-cell">
146
- <input matInput [matDatepicker]="colPicker"
147
- [(ngModel)]="row[col.key]"
148
- [disabled]="col.editable === false || col.editConfig?.disabled"
149
- class="st-cell-input"
150
- (click)="colPicker.open()">
151
- <mat-datepicker-toggle [for]="colPicker"></mat-datepicker-toggle>
152
- <mat-datepicker #colPicker></mat-datepicker>
153
- </div>
154
- <input *ngIf="col.dataType !== 'select' && col.dataType !== 'date'"
155
- [type]="col.dataType || 'text'"
156
- [(ngModel)]="row[col.key]"
157
- [disabled]="col.editable === false || col.editConfig?.disabled"
158
- class="st-cell-input">
159
- </div>
160
- </ng-container>
161
- </td>
162
-
163
- <!-- Row Actions -->
164
- <td *ngIf="getVisibleActions(config.actions).length > 0" class="st-row-actions st-actions-col">
165
- <div class="action-buttons">
166
- <!-- EDIT MODE ACTIONS -->
167
- <ng-container *ngIf="row.isEditing">
168
- <div class="edit-mode-actions">
169
- <lib-button variant="outline" (click)="onCancelRow(row, rowIndex); $event.stopPropagation()">
170
- {{ config.labels?.cancelLabel || 'Cancel' }}
171
- </lib-button>
172
- <lib-button [variant]="row.isNew ? (config.labels?.addButtonVariant || 'danger') : (config.labels?.saveButtonVariant || 'primary')" (click)="onSaveRow(row); $event.stopPropagation()">
173
- {{ row.isNew ? (config.labels?.addLabel || 'Add') : (config.labels?.saveLabel || 'Save') }}
174
- </lib-button>
175
- </div>
176
- </ng-container>
177
-
178
- <!-- READ MODE ACTIONS -->
179
- <ng-container *ngIf="!row.isEditing">
180
- <ng-container *ngFor="let action of getVisibleActions(config.actions); let i = index">
181
- <ng-container *ngIf="action.type === 'dropdown'">
182
- <div class="st-dropdown-container" (click)="$event.stopPropagation()">
183
- <button class="st-dropdown-btn"
184
- [class.active]="openDropdownId === (rowIndex + '-' + i)"
185
- (click)="toggleDropdown(rowIndex + '-' + i, $event, getVisibleActions(action.items), row)">
186
- <span class="action-circle">
187
- <i class="fa fa-ellipsis-h"></i>
188
- </span>
189
- </button>
190
- </div>
191
- </ng-container>
192
- <ng-container *ngIf="action.type !== 'dropdown'">
193
- <lib-button
194
- [variant]="action.btnVariant || 'secondary'"
195
- [icon]="action.icon || ''"
196
- (click)="onAction(action, row)">
197
- {{ action.label }}
198
- </lib-button>
199
- </ng-container>
200
- </ng-container>
201
- </ng-container>
202
- </div>
203
- </td>
204
- </tr>
205
- <tr *ngIf="data.length === 0 && !loading">
206
- <td [attr.colspan]="columnCount + (config.selectable ? 1 : 0) + (getVisibleActions(config.actions).length > 0 ? 1 : 0)" class="no-data">
207
- {{ config.labels?.noDataMessage || 'No data available' }}
208
- </td>
209
- </tr>
210
- </tbody>
211
- </table>
212
- </div>
213
-
214
- <!-- Pagination — inside the card, sticks to the bottom -->
215
- <div class="st-pagination" *ngIf="showPagination">
216
- <lib-pagination
217
- [totalItems]="totalItems"
218
- [itemsPerPage]="config.pagination!.pageSize"
219
- [currentPage]="currentPage"
220
- [pageSizeOptions]="config.pagination!.pageSizeOptions"
221
- (pageChange)="onPageChange($event)"
222
- (itemsPerPageChange)="onPageSizeChange($event)">
223
- </lib-pagination>
224
- </div>
225
-
226
- <!-- Built-in Delete Confirmation Modal -->
227
- <cc-confirmation-modal
228
- [isOpen]="deleteModalOpen"
229
- [config]="deleteModalConfig"
230
- (confirm)="onDeleteConfirm()"
231
- (cancel)="onDeleteCancel()"
232
- (close)="onDeleteCancel()">
233
- <p>{{ deleteModalMessage }}</p>
234
- </cc-confirmation-modal>
235
- </div>
236
- </div>
237
-
238
- <!--
239
- Filter panel portal — position:fixed keeps it above all overflow/sticky containers.
240
- -->
241
- <div class="st-filter-panel"
242
- *ngIf="openFilterKey !== null && activeFilterData"
243
- [ngStyle]="{
244
- position: 'fixed',
245
- top: filterPosition.top + 'px',
246
- left: filterPosition.left + 'px',
247
- 'z-index': '99999'
248
- }"
249
- (click)="$event.stopPropagation()">
250
- <div class="st-filter-option"
251
- [class.selected]="!isFilterActive(activeFilterData)"
252
- (click)="selectFilterOption(activeFilterData, null)">
253
- All {{ activeFilterData.label }}
254
- </div>
255
- <div class="st-filter-option"
256
- *ngFor="let opt of getValidFilterOptions(activeFilterData)"
257
- [class.selected]="activeFilters[activeFilterData.key] === opt.value"
258
- (click)="selectFilterOption(activeFilterData, opt)">
259
- {{ opt.label }}
260
- </div>
261
- </div>
262
-
263
- <!--
264
- Dropdown portal — rendered OUTSIDE every scroll/sticky container.
265
- position:fixed + z-index:99999 here is unconditionally above all sticky table cells.
266
- -->
267
- <div class="st-dropdown-menu st-dropdown-portal"
268
- *ngIf="openDropdownId !== null && activeDropdownItems"
269
- [ngStyle]="{
270
- position: 'fixed',
271
- top: dropdownPosition.top + 'px',
272
- right: dropdownPosition.right + 'px',
273
- left: 'auto',
274
- 'z-index': '99999'
275
- }"
276
- (click)="$event.stopPropagation()">
277
- <button class="st-dropdown-item"
278
- *ngFor="let item of activeDropdownItems"
279
- (click)="onActionItemClick(item, activeDropdownRow, $event); closeDropdown()">
280
- <i *ngIf="item.icon" [class]="item.icon + ' st-action-icon'"></i>
281
- <span>{{ item.label }}</span>
282
- </button>
283
- </div>