ng-prime-tools 1.0.5 → 1.0.6

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 (227) hide show
  1. package/README.md +276 -0
  2. package/esm2022/lib/enums/button-color.enum.mjs +10 -0
  3. package/esm2022/lib/enums/form-input-type.enum.mjs +14 -0
  4. package/esm2022/lib/enums/index.mjs +2 -6
  5. package/esm2022/lib/enums/input-validation.enum.mjs +8 -0
  6. package/esm2022/lib/enums/public-api.mjs +7 -0
  7. package/esm2022/lib/enums/{search-criteria-type-enum.mjs → search-criteria-type.enum.mjs} +1 -1
  8. package/esm2022/lib/enums/{table-type-enum.mjs → table-type.enum.mjs} +1 -1
  9. package/esm2022/lib/models/filter-option.model.mjs +2 -0
  10. package/esm2022/lib/models/form-button.model.mjs +2 -0
  11. package/esm2022/lib/models/form-check-field.model.mjs +2 -0
  12. package/esm2022/lib/models/form-date-field.model.mjs +2 -0
  13. package/esm2022/lib/models/form-drop-down-field.model.mjs +2 -0
  14. package/esm2022/lib/models/form-field-group.model.mjs +2 -0
  15. package/esm2022/lib/models/form-field.model.mjs +2 -0
  16. package/esm2022/lib/models/form-multi-select.model.mjs +2 -0
  17. package/esm2022/lib/models/form-number-field.model.mjs +2 -0
  18. package/esm2022/lib/models/form-switch-field.model.mjs +2 -0
  19. package/esm2022/lib/models/form-text-area-field.model.mjs +2 -0
  20. package/esm2022/lib/models/form-text-field.model.mjs +2 -0
  21. package/esm2022/lib/models/index.mjs +2 -2
  22. package/esm2022/lib/models/public-api.mjs +15 -0
  23. package/esm2022/lib/models/search-criteria.model.mjs +2 -0
  24. package/esm2022/lib/models/table-column.model.mjs +2 -0
  25. package/esm2022/lib/multi-search-criteria/multi-search-criteria.component.mjs +1 -1
  26. package/esm2022/lib/ng-prime-tools.module.mjs +66 -6
  27. package/esm2022/lib/pt-check-box-input/index.mjs +2 -0
  28. package/esm2022/lib/pt-check-box-input/pt-check-box-input.component.mjs +61 -0
  29. package/esm2022/lib/pt-check-box-input/pt-check-box-input.module.mjs +20 -0
  30. package/esm2022/lib/pt-check-box-input/public-api.mjs +3 -0
  31. package/esm2022/lib/pt-date-input/index.mjs +2 -0
  32. package/esm2022/lib/pt-date-input/pt-date-input.component.mjs +85 -0
  33. package/esm2022/lib/pt-date-input/pt-date-input.module.mjs +20 -0
  34. package/esm2022/lib/pt-date-input/pt-date.service.mjs +62 -0
  35. package/esm2022/lib/pt-date-input/public-api.mjs +3 -0
  36. package/esm2022/lib/pt-dropdown/index.mjs +2 -0
  37. package/esm2022/lib/pt-dropdown/pt-dropdown.component.mjs +57 -0
  38. package/esm2022/lib/pt-dropdown/pt-dropdown.module.mjs +20 -0
  39. package/esm2022/lib/pt-dropdown/public-api.mjs +3 -0
  40. package/esm2022/lib/pt-form-builder/index.mjs +2 -0
  41. package/esm2022/lib/pt-form-builder/pt-dynamic-form-field/pt-dynamic-form-field-module.mjs +59 -0
  42. package/esm2022/lib/pt-form-builder/pt-dynamic-form-field/pt-dynamic-form-field.component.mjs +55 -0
  43. package/esm2022/lib/pt-form-builder/pt-form-builder.component.mjs +77 -0
  44. package/esm2022/lib/pt-form-builder/pt-form-builder.module.mjs +32 -0
  45. package/esm2022/lib/pt-form-builder/public-api.mjs +3 -0
  46. package/esm2022/lib/pt-multi-select/index.mjs +2 -0
  47. package/esm2022/lib/pt-multi-select/pt-multi-select.component.mjs +57 -0
  48. package/esm2022/lib/pt-multi-select/pt-multi-select.module.mjs +20 -0
  49. package/esm2022/lib/pt-multi-select/public-api.mjs +3 -0
  50. package/esm2022/lib/pt-number-input/index.mjs +2 -0
  51. package/esm2022/lib/pt-number-input/pt-number-input.component.mjs +88 -0
  52. package/esm2022/lib/pt-number-input/pt-number-input.module.mjs +43 -0
  53. package/esm2022/lib/pt-number-input/public-api.mjs +3 -0
  54. package/esm2022/lib/pt-switch-input/index.mjs +2 -0
  55. package/esm2022/lib/pt-switch-input/pt-switch-input.component.mjs +62 -0
  56. package/esm2022/lib/pt-switch-input/pt-switch-input.module.mjs +20 -0
  57. package/esm2022/lib/pt-switch-input/public-api.mjs +3 -0
  58. package/esm2022/lib/pt-text-area-input/index.mjs +2 -0
  59. package/esm2022/lib/pt-text-area-input/pt-text-area-input.component.mjs +83 -0
  60. package/esm2022/lib/pt-text-area-input/pt-text-area-input.module.mjs +36 -0
  61. package/esm2022/lib/pt-text-area-input/public-api.mjs +3 -0
  62. package/esm2022/lib/pt-text-input/index.mjs +2 -0
  63. package/esm2022/lib/pt-text-input/pt-text-input.component.mjs +86 -0
  64. package/esm2022/lib/pt-text-input/pt-text-input.module.mjs +36 -0
  65. package/esm2022/lib/pt-text-input/public-api.mjs +3 -0
  66. package/esm2022/lib/types/date-format.type.mjs +2 -0
  67. package/esm2022/lib/types/date-input.type.mjs +2 -0
  68. package/esm2022/lib/types/index.mjs +2 -0
  69. package/esm2022/lib/types/public-api.mjs +2 -0
  70. package/esm2022/lib/utils/date.util.mjs +69 -0
  71. package/esm2022/public-api.mjs +11 -2
  72. package/fesm2022/ng-prime-tools.mjs +1099 -18
  73. package/fesm2022/ng-prime-tools.mjs.map +1 -1
  74. package/lib/enums/button-color.enum.d.ts +9 -0
  75. package/lib/enums/button-color.enum.d.ts.map +1 -0
  76. package/lib/enums/form-input-type.enum.d.ts +13 -0
  77. package/lib/enums/form-input-type.enum.d.ts.map +1 -0
  78. package/lib/enums/index.d.ts +1 -5
  79. package/lib/enums/index.d.ts.map +1 -1
  80. package/lib/enums/input-validation.enum.d.ts +7 -0
  81. package/lib/enums/input-validation.enum.d.ts.map +1 -0
  82. package/lib/enums/public-api.d.ts +6 -0
  83. package/lib/enums/public-api.d.ts.map +1 -0
  84. package/lib/enums/{search-criteria-type-enum.d.ts → search-criteria-type.enum.d.ts} +1 -1
  85. package/lib/enums/search-criteria-type.enum.d.ts.map +1 -0
  86. package/lib/enums/{table-type-enum.d.ts → table-type.enum.d.ts} +1 -1
  87. package/lib/enums/table-type.enum.d.ts.map +1 -0
  88. package/lib/models/{filter-option.d.ts → filter-option.model.d.ts} +1 -1
  89. package/lib/models/filter-option.model.d.ts.map +1 -0
  90. package/lib/models/form-button.model.d.ts +10 -0
  91. package/lib/models/form-button.model.d.ts.map +1 -0
  92. package/lib/models/form-check-field.model.d.ts +4 -0
  93. package/lib/models/form-check-field.model.d.ts.map +1 -0
  94. package/lib/models/form-date-field.model.d.ts +11 -0
  95. package/lib/models/form-date-field.model.d.ts.map +1 -0
  96. package/lib/models/form-drop-down-field.model.d.ts +5 -0
  97. package/lib/models/form-drop-down-field.model.d.ts.map +1 -0
  98. package/lib/models/form-field-group.model.d.ts +7 -0
  99. package/lib/models/form-field-group.model.d.ts.map +1 -0
  100. package/lib/models/form-field.model.d.ts +16 -0
  101. package/lib/models/form-field.model.d.ts.map +1 -0
  102. package/lib/models/form-multi-select.model.d.ts +5 -0
  103. package/lib/models/form-multi-select.model.d.ts.map +1 -0
  104. package/lib/models/form-number-field.model.d.ts +11 -0
  105. package/lib/models/form-number-field.model.d.ts.map +1 -0
  106. package/lib/models/form-switch-field.model.d.ts +4 -0
  107. package/lib/models/form-switch-field.model.d.ts.map +1 -0
  108. package/lib/models/form-text-area-field.model.d.ts +11 -0
  109. package/lib/models/form-text-area-field.model.d.ts.map +1 -0
  110. package/lib/models/form-text-field.model.d.ts +8 -0
  111. package/lib/models/form-text-field.model.d.ts.map +1 -0
  112. package/lib/models/index.d.ts +1 -1
  113. package/lib/models/public-api.d.ts +15 -0
  114. package/lib/models/public-api.d.ts.map +1 -0
  115. package/lib/models/{search-criteria.d.ts → search-criteria.model.d.ts} +3 -3
  116. package/lib/models/search-criteria.model.d.ts.map +1 -0
  117. package/lib/models/{table-column.d.ts → table-column.model.d.ts} +2 -2
  118. package/lib/models/table-column.model.d.ts.map +1 -0
  119. package/lib/multi-search-criteria/multi-search-criteria.component.d.ts +2 -2
  120. package/lib/multi-search-criteria/multi-search-criteria.component.d.ts.map +1 -1
  121. package/lib/ng-prime-tools.module.d.ts +8 -1
  122. package/lib/ng-prime-tools.module.d.ts.map +1 -1
  123. package/lib/pt-check-box-input/index.d.ts +2 -0
  124. package/lib/pt-check-box-input/index.d.ts.map +1 -0
  125. package/lib/pt-check-box-input/pt-check-box-input.component.d.ts +16 -0
  126. package/lib/pt-check-box-input/pt-check-box-input.component.d.ts.map +1 -0
  127. package/lib/pt-check-box-input/pt-check-box-input.module.d.ts +11 -0
  128. package/lib/pt-check-box-input/pt-check-box-input.module.d.ts.map +1 -0
  129. package/lib/pt-check-box-input/public-api.d.ts +3 -0
  130. package/lib/pt-check-box-input/public-api.d.ts.map +1 -0
  131. package/lib/pt-date-input/index.d.ts +2 -0
  132. package/lib/pt-date-input/index.d.ts.map +1 -0
  133. package/lib/pt-date-input/pt-date-input.component.d.ts +24 -0
  134. package/lib/pt-date-input/pt-date-input.component.d.ts.map +1 -0
  135. package/lib/pt-date-input/pt-date-input.module.d.ts +11 -0
  136. package/lib/pt-date-input/pt-date-input.module.d.ts.map +1 -0
  137. package/lib/pt-date-input/pt-date.service.d.ts +11 -0
  138. package/lib/pt-date-input/pt-date.service.d.ts.map +1 -0
  139. package/lib/pt-date-input/public-api.d.ts +3 -0
  140. package/lib/pt-date-input/public-api.d.ts.map +1 -0
  141. package/lib/pt-dropdown/index.d.ts +2 -0
  142. package/lib/pt-dropdown/index.d.ts.map +1 -0
  143. package/lib/pt-dropdown/pt-dropdown.component.d.ts +15 -0
  144. package/lib/pt-dropdown/pt-dropdown.component.d.ts.map +1 -0
  145. package/lib/pt-dropdown/pt-dropdown.module.d.ts +11 -0
  146. package/lib/pt-dropdown/pt-dropdown.module.d.ts.map +1 -0
  147. package/lib/pt-dropdown/public-api.d.ts +3 -0
  148. package/lib/pt-dropdown/public-api.d.ts.map +1 -0
  149. package/lib/pt-form-builder/index.d.ts +2 -0
  150. package/lib/pt-form-builder/index.d.ts.map +1 -0
  151. package/lib/pt-form-builder/pt-dynamic-form-field/pt-dynamic-form-field-module.d.ts +18 -0
  152. package/lib/pt-form-builder/pt-dynamic-form-field/pt-dynamic-form-field-module.d.ts.map +1 -0
  153. package/lib/pt-form-builder/pt-dynamic-form-field/pt-dynamic-form-field.component.d.ts +29 -0
  154. package/lib/pt-form-builder/pt-dynamic-form-field/pt-dynamic-form-field.component.d.ts.map +1 -0
  155. package/lib/pt-form-builder/pt-form-builder.component.d.ts +33 -0
  156. package/lib/pt-form-builder/pt-form-builder.component.d.ts.map +1 -0
  157. package/lib/pt-form-builder/pt-form-builder.module.d.ts +12 -0
  158. package/lib/pt-form-builder/pt-form-builder.module.d.ts.map +1 -0
  159. package/lib/pt-form-builder/public-api.d.ts +3 -0
  160. package/lib/pt-form-builder/public-api.d.ts.map +1 -0
  161. package/lib/pt-multi-select/index.d.ts +2 -0
  162. package/lib/pt-multi-select/index.d.ts.map +1 -0
  163. package/lib/pt-multi-select/pt-multi-select.component.d.ts +15 -0
  164. package/lib/pt-multi-select/pt-multi-select.component.d.ts.map +1 -0
  165. package/lib/pt-multi-select/pt-multi-select.module.d.ts +11 -0
  166. package/lib/pt-multi-select/pt-multi-select.module.d.ts.map +1 -0
  167. package/lib/pt-multi-select/public-api.d.ts +3 -0
  168. package/lib/pt-multi-select/public-api.d.ts.map +1 -0
  169. package/lib/pt-number-input/index.d.ts +2 -0
  170. package/lib/pt-number-input/index.d.ts.map +1 -0
  171. package/lib/pt-number-input/pt-number-input.component.d.ts +16 -0
  172. package/lib/pt-number-input/pt-number-input.component.d.ts.map +1 -0
  173. package/lib/pt-number-input/pt-number-input.module.d.ts +14 -0
  174. package/lib/pt-number-input/pt-number-input.module.d.ts.map +1 -0
  175. package/lib/pt-number-input/public-api.d.ts +3 -0
  176. package/lib/pt-number-input/public-api.d.ts.map +1 -0
  177. package/lib/pt-switch-input/index.d.ts +2 -0
  178. package/lib/pt-switch-input/index.d.ts.map +1 -0
  179. package/lib/pt-switch-input/pt-switch-input.component.d.ts +16 -0
  180. package/lib/pt-switch-input/pt-switch-input.component.d.ts.map +1 -0
  181. package/lib/pt-switch-input/pt-switch-input.module.d.ts +11 -0
  182. package/lib/pt-switch-input/pt-switch-input.module.d.ts.map +1 -0
  183. package/lib/pt-switch-input/public-api.d.ts +3 -0
  184. package/lib/pt-switch-input/public-api.d.ts.map +1 -0
  185. package/lib/pt-text-area-input/index.d.ts +2 -0
  186. package/lib/pt-text-area-input/index.d.ts.map +1 -0
  187. package/lib/pt-text-area-input/pt-text-area-input.component.d.ts +17 -0
  188. package/lib/pt-text-area-input/pt-text-area-input.component.d.ts.map +1 -0
  189. package/lib/pt-text-area-input/pt-text-area-input.module.d.ts +13 -0
  190. package/lib/pt-text-area-input/pt-text-area-input.module.d.ts.map +1 -0
  191. package/lib/pt-text-area-input/public-api.d.ts +3 -0
  192. package/lib/pt-text-area-input/public-api.d.ts.map +1 -0
  193. package/lib/pt-text-input/index.d.ts +2 -0
  194. package/lib/pt-text-input/index.d.ts.map +1 -0
  195. package/lib/pt-text-input/pt-text-input.component.d.ts +18 -0
  196. package/lib/pt-text-input/pt-text-input.component.d.ts.map +1 -0
  197. package/lib/pt-text-input/pt-text-input.module.d.ts +13 -0
  198. package/lib/pt-text-input/pt-text-input.module.d.ts.map +1 -0
  199. package/lib/pt-text-input/public-api.d.ts +3 -0
  200. package/lib/pt-text-input/public-api.d.ts.map +1 -0
  201. package/lib/types/date-format.type.d.ts +2 -0
  202. package/lib/types/date-format.type.d.ts.map +1 -0
  203. package/lib/types/date-input.type.d.ts +2 -0
  204. package/lib/types/date-input.type.d.ts.map +1 -0
  205. package/lib/types/index.d.ts +2 -0
  206. package/lib/types/index.d.ts.map +1 -0
  207. package/lib/types/public-api.d.ts +2 -0
  208. package/lib/types/public-api.d.ts.map +1 -0
  209. package/lib/utils/date.util.d.ts +7 -0
  210. package/lib/utils/date.util.d.ts.map +1 -0
  211. package/package.json +1 -1
  212. package/public-api.d.ts +9 -0
  213. package/public-api.d.ts.map +1 -1
  214. package/esm2022/lib/enums/public_api.mjs +0 -4
  215. package/esm2022/lib/models/filter-option.mjs +0 -2
  216. package/esm2022/lib/models/public_api.mjs +0 -5
  217. package/esm2022/lib/models/search-criteria.mjs +0 -2
  218. package/esm2022/lib/models/table-column.mjs +0 -2
  219. package/lib/enums/public_api.d.ts +0 -3
  220. package/lib/enums/public_api.d.ts.map +0 -1
  221. package/lib/enums/search-criteria-type-enum.d.ts.map +0 -1
  222. package/lib/enums/table-type-enum.d.ts.map +0 -1
  223. package/lib/models/filter-option.d.ts.map +0 -1
  224. package/lib/models/public_api.d.ts +0 -4
  225. package/lib/models/public_api.d.ts.map +0 -1
  226. package/lib/models/search-criteria.d.ts.map +0 -1
  227. package/lib/models/table-column.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Pipe, EventEmitter, Component, Input, Output, ViewChild, NgModule } from '@angular/core';
2
+ import { Pipe, EventEmitter, Component, Input, Output, ViewChild, NgModule, Injectable } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from 'primeng/table';
@@ -11,8 +11,8 @@ import * as i5 from 'primeng/button';
11
11
  import { ButtonModule } from 'primeng/button';
12
12
  import * as i6 from 'primeng/calendar';
13
13
  import { CalendarModule } from 'primeng/calendar';
14
- import * as i7 from '@angular/forms';
15
- import { FormsModule } from '@angular/forms';
14
+ import * as i2$1 from '@angular/forms';
15
+ import { FormsModule, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
16
16
  import * as i8 from 'primeng/multiselect';
17
17
  import { MultiSelectModule } from 'primeng/multiselect';
18
18
  import * as i9 from 'primeng/tag';
@@ -25,6 +25,18 @@ import * as i8$1 from 'primeng/inputnumber';
25
25
  import { InputNumberModule } from 'primeng/inputnumber';
26
26
  import * as i9$1 from 'primeng/panel';
27
27
  import { PanelModule } from 'primeng/panel';
28
+ import * as i3$1 from 'primeng/checkbox';
29
+ import { CheckboxModule } from 'primeng/checkbox';
30
+ import * as i3$2 from 'primeng/inputgroup';
31
+ import { InputGroupModule } from 'primeng/inputgroup';
32
+ import * as i4$1 from 'primeng/inputgroupaddon';
33
+ import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
34
+ import * as i3$3 from 'primeng/inputswitch';
35
+ import { InputSwitchModule } from 'primeng/inputswitch';
36
+ import * as i3$4 from 'primeng/inputtextarea';
37
+ import { InputTextareaModule } from 'primeng/inputtextarea';
38
+ import * as i3$5 from 'primeng/dropdown';
39
+ import { DropdownModule } from 'primeng/dropdown';
28
40
 
29
41
  class CustomCurrencyPipe {
30
42
  transform(value, currency, decimalPlaces, thousandSeparator = 'comma', decimalSeparator = 'dot') {
@@ -369,7 +381,7 @@ class NgAdvancedPrimeTableComponent {
369
381
  return '';
370
382
  }
371
383
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgAdvancedPrimeTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
372
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: NgAdvancedPrimeTableComponent, selector: "ng-advanced-prime-table", inputs: { data: "data", columns: "columns", totalRecords: "totalRecords", rowsPerPage: "rowsPerPage", hasSearchFilter: "hasSearchFilter", hasColumnFilter: "hasColumnFilter", isPaginated: "isPaginated", actions: "actions", isSortable: "isSortable" }, outputs: { filter: "filter", search: "search" }, viewQueries: [{ propertyName: "dt", first: true, predicate: ["dt"], descendants: true }], ngImport: i0, template: "<div class=\"table-container\">\n <div>\n <p-table\n #dt\n [value]=\"data\"\n [rows]=\"rows\"\n [paginator]=\"isPaginated\"\n [globalFilterFields]=\"globalFilterFields\"\n [rowsPerPageOptions]=\"rowsPerPage\"\n dataKey=\"id\"\n styleClass=\"p-datatable-gridlines\"\n styleClass=\"p-datatable-striped\"\n editMode=\"row\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex\">\n <div>\n <h3>Total: {{ totalRecords }}</h3>\n </div>\n\n <div>\n <p-button\n label=\"Clear\"\n [outlined]=\"true\"\n icon=\"pi pi-filter-slash\"\n (click)=\"clear(dt)\"\n class=\"bt-filter-btn\"\n />\n </div>\n <div class=\"ml-auto\" *ngIf=\"hasSearchFilter\">\n <!-- Add this wrapper div with ml-auto class -->\n <p-iconField iconPosition=\"left\" class=\"ml-auto\">\n <p-inputIcon>\n <i class=\"pi pi-search\"></i>\n </p-inputIcon>\n <input\n pInputText\n type=\"text\"\n [(ngModel)]=\"searchValue\"\n (input)=\"filterGlobal($event)\"\n placeholder=\"Search keyword\"\n />\n </p-iconField>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr>\n <th *ngFor=\"let col of columns\">\n <ng-container\n *ngIf=\"isSortable && col.isSortable !== false; else noSortHeader\"\n >\n <th pSortableColumn=\"{{ col.code }}\" style=\"width: 20%\">\n <div class=\"header-container\">\n <span>{{ col.title }}</span>\n <p-sortIcon field=\"{{ col.code }}\" />\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n display=\"menu\"\n [type]=\"getColumnFilterType(col)\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </th>\n </ng-container>\n <ng-template #noSortHeader>\n <th>\n <div class=\"header-container\">\n <span>{{ col.title }}</span>\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </th>\n </ng-template>\n </th>\n </tr>\n </ng-template>\n\n <ng-template\n pTemplate=\"body\"\n let-data\n let-editing=\"editing\"\n let-ri=\"rowIndex\"\n >\n <!-- Render a table row and make it editable if `isEdit` is true -->\n <tr [pEditableRow]=\"isEdit ? data : null\">\n <!-- Loop through each column and render corresponding table cells -->\n <ng-container *ngFor=\"let col of columns\">\n <ng-container *ngIf=\"col.code !== undefined\">\n <!-- Check if the data for the column exists -->\n <ng-container *ngIf=\"data[col.code] !== undefined\">\n <!-- Render an editable cell if the column is editable -->\n <td *ngIf=\"isEditable(col.code); else normalTD\">\n <!-- Multi-select input for columns that are multi-selectable -->\n <ng-container\n *ngIf=\"isMultiSelect(col.code); else datePicker\"\n >\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-multiSelect\n appendTo=\"body\"\n [ngModel]=\"data[col.code]\"\n [style]=\"{ width: '100%' }\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [options]=\"optionValues\"\n ></p-multiSelect>\n </ng-template>\n <ng-template pTemplate=\"output\">\n <div class=\"multi-select-container\">\n <ng-container *ngFor=\"let rec of data[col.code]\">\n <p-tag [value]=\"rec\"></p-tag>\n </ng-container>\n </div>\n </ng-template>\n </p-cellEditor>\n </ng-container>\n\n <!-- Date picker input for columns that require date selection -->\n <ng-template #datePicker>\n <ng-container\n *ngIf=\"isDatePicker(col.code); else normalInput\"\n >\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-calendar\n [inputId]=\"data[col.code]\"\n [ngModel]=\"data[col.code]\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ data[col.code] | customDate }}\n </ng-template>\n </p-cellEditor>\n </ng-container>\n </ng-template>\n\n <!-- Normal text input for other columns -->\n <ng-template #normalInput>\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"data[col.code]\"\n (change)=\"onChange($event, data.id, col.code)\"\n />\n </ng-template>\n <ng-template pTemplate=\"output\">\n <!-- Use currency pipe to format the output for AMOUNT type -->\n <ng-container\n *ngIf=\"col.type === 'AMOUNT'; else normalOutput\"\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalOutput>\n {{ data[col.code] }}\n </ng-template>\n </ng-template>\n </p-cellEditor>\n </ng-template>\n </td>\n\n <!-- Render a normal table cell if the column is not editable -->\n <ng-template #normalTD>\n <td>\n <!-- Use customCurrency pipe to format the output for AMOUNT type with optional decimal places -->\n <ng-container\n *ngIf=\"col.type === 'AMOUNT'; else normalText\"\n >\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalText>\n {{ data[col.code] }}\n </ng-template>\n </td>\n </ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <!-- Render action buttons if there are any actions defined -->\n <td *ngIf=\"actions?.length\">\n <div class=\"action-buttons-container\">\n <!-- Delete button if deletion is allowed -->\n <div *ngIf=\"isDelete\">\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n (click)=\"Delete(data.id)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n <!-- Edit, save, and cancel buttons for row editing -->\n <div>\n <button\n pInitEditableRow\n *ngIf=\"!editing\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-pencil\"\n (click)=\"initEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pSaveEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-check\"\n (click)=\"saveEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pCancelEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n (click)=\"cancelEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n</div>\n", styles: [".date{width:100%;height:5rem;display:grid;justify-items:start;align-items:center}.filter-container{width:100%;display:flex;justify-content:space-between;align-items:center}.settings{display:flex;gap:1rem}.multi-select-container{display:flex;justify-content:center;align-items:center;gap:.3rem}::ng-deep p-table{min-width:50rem}.table-container{display:flex;flex-direction:column;gap:.5rem}::ng-deep .custom-multiselect .p-hidden-accessible input{display:none}::ng-deep .p-datatable .p-sortable-column.p-highlight:hover{background:none}::ng-deep .p-datatable .p-sortable-column:focus{box-shadow:none;outline:0 none}::ng-deep .header-container{display:flex;align-items:center}::ng-deep .header-container span{margin-right:.5em}::ng-deep p-columnfilter.p-element.ng-star-inserted{margin-top:4px}.flex{display:flex;justify-content:space-between;align-items:center}.ml-auto{margin-left:auto}::ng-deep p-inputicon{margin-right:-1.5rem;z-index:2;position:relative}::ng-deep .p-inputtext{padding-left:1.7rem}::ng-deep .bt-filter-btn button{cursor:pointer;margin-left:1rem}::ng-deep .p-icon-field-left .p-input-icon:first-of-type{left:-1rem}.table-row{text-align:center;display:flex;gap:1rem;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i2.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i2.CellEditor, selector: "p-cellEditor" }, { kind: "component", type: i2.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "directive", type: i2.EditableRow, selector: "[pEditableRow]", inputs: ["pEditableRow", "pEditableRowDisabled"] }, { kind: "directive", type: i2.InitEditableRow, selector: "[pInitEditableRow]" }, { kind: "directive", type: i2.SaveEditableRow, selector: "[pSaveEditableRow]" }, { kind: "directive", type: i2.CancelEditableRow, selector: "[pCancelEditableRow]" }, { kind: "component", type: i2.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping", "showButtons", "ariaLabel"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i6.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: i9.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }, { kind: "component", type: i10.IconField, selector: "p-iconField", inputs: ["iconPosition"] }, { kind: "component", type: i11.InputIcon, selector: "p-inputIcon", inputs: ["styleClass"] }, { kind: "pipe", type: CustomCurrencyPipe, name: "customCurrency" }, { kind: "pipe", type: CustomDatePipe, name: "customDate" }] }); }
384
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: NgAdvancedPrimeTableComponent, selector: "ng-advanced-prime-table", inputs: { data: "data", columns: "columns", totalRecords: "totalRecords", rowsPerPage: "rowsPerPage", hasSearchFilter: "hasSearchFilter", hasColumnFilter: "hasColumnFilter", isPaginated: "isPaginated", actions: "actions", isSortable: "isSortable" }, outputs: { filter: "filter", search: "search" }, viewQueries: [{ propertyName: "dt", first: true, predicate: ["dt"], descendants: true }], ngImport: i0, template: "<div class=\"table-container\">\n <div>\n <p-table\n #dt\n [value]=\"data\"\n [rows]=\"rows\"\n [paginator]=\"isPaginated\"\n [globalFilterFields]=\"globalFilterFields\"\n [rowsPerPageOptions]=\"rowsPerPage\"\n dataKey=\"id\"\n styleClass=\"p-datatable-gridlines\"\n styleClass=\"p-datatable-striped\"\n editMode=\"row\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex\">\n <div>\n <h3>Total: {{ totalRecords }}</h3>\n </div>\n\n <div>\n <p-button\n label=\"Clear\"\n [outlined]=\"true\"\n icon=\"pi pi-filter-slash\"\n (click)=\"clear(dt)\"\n class=\"bt-filter-btn\"\n />\n </div>\n <div class=\"ml-auto\" *ngIf=\"hasSearchFilter\">\n <!-- Add this wrapper div with ml-auto class -->\n <p-iconField iconPosition=\"left\" class=\"ml-auto\">\n <p-inputIcon>\n <i class=\"pi pi-search\"></i>\n </p-inputIcon>\n <input\n pInputText\n type=\"text\"\n [(ngModel)]=\"searchValue\"\n (input)=\"filterGlobal($event)\"\n placeholder=\"Search keyword\"\n />\n </p-iconField>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr>\n <th *ngFor=\"let col of columns\">\n <ng-container\n *ngIf=\"isSortable && col.isSortable !== false; else noSortHeader\"\n >\n <th pSortableColumn=\"{{ col.code }}\" style=\"width: 20%\">\n <div class=\"header-container\">\n <span>{{ col.title }}</span>\n <p-sortIcon field=\"{{ col.code }}\" />\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n display=\"menu\"\n [type]=\"getColumnFilterType(col)\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </th>\n </ng-container>\n <ng-template #noSortHeader>\n <th>\n <div class=\"header-container\">\n <span>{{ col.title }}</span>\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </th>\n </ng-template>\n </th>\n </tr>\n </ng-template>\n\n <ng-template\n pTemplate=\"body\"\n let-data\n let-editing=\"editing\"\n let-ri=\"rowIndex\"\n >\n <!-- Render a table row and make it editable if `isEdit` is true -->\n <tr [pEditableRow]=\"isEdit ? data : null\">\n <!-- Loop through each column and render corresponding table cells -->\n <ng-container *ngFor=\"let col of columns\">\n <ng-container *ngIf=\"col.code !== undefined\">\n <!-- Check if the data for the column exists -->\n <ng-container *ngIf=\"data[col.code] !== undefined\">\n <!-- Render an editable cell if the column is editable -->\n <td *ngIf=\"isEditable(col.code); else normalTD\">\n <!-- Multi-select input for columns that are multi-selectable -->\n <ng-container\n *ngIf=\"isMultiSelect(col.code); else datePicker\"\n >\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-multiSelect\n appendTo=\"body\"\n [ngModel]=\"data[col.code]\"\n [style]=\"{ width: '100%' }\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [options]=\"optionValues\"\n ></p-multiSelect>\n </ng-template>\n <ng-template pTemplate=\"output\">\n <div class=\"multi-select-container\">\n <ng-container *ngFor=\"let rec of data[col.code]\">\n <p-tag [value]=\"rec\"></p-tag>\n </ng-container>\n </div>\n </ng-template>\n </p-cellEditor>\n </ng-container>\n\n <!-- Date picker input for columns that require date selection -->\n <ng-template #datePicker>\n <ng-container\n *ngIf=\"isDatePicker(col.code); else normalInput\"\n >\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-calendar\n [inputId]=\"data[col.code]\"\n [ngModel]=\"data[col.code]\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ data[col.code] | customDate }}\n </ng-template>\n </p-cellEditor>\n </ng-container>\n </ng-template>\n\n <!-- Normal text input for other columns -->\n <ng-template #normalInput>\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"data[col.code]\"\n (change)=\"onChange($event, data.id, col.code)\"\n />\n </ng-template>\n <ng-template pTemplate=\"output\">\n <!-- Use currency pipe to format the output for AMOUNT type -->\n <ng-container\n *ngIf=\"col.type === 'AMOUNT'; else normalOutput\"\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalOutput>\n {{ data[col.code] }}\n </ng-template>\n </ng-template>\n </p-cellEditor>\n </ng-template>\n </td>\n\n <!-- Render a normal table cell if the column is not editable -->\n <ng-template #normalTD>\n <td>\n <!-- Use customCurrency pipe to format the output for AMOUNT type with optional decimal places -->\n <ng-container\n *ngIf=\"col.type === 'AMOUNT'; else normalText\"\n >\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalText>\n {{ data[col.code] }}\n </ng-template>\n </td>\n </ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <!-- Render action buttons if there are any actions defined -->\n <td *ngIf=\"actions?.length\">\n <div class=\"action-buttons-container\">\n <!-- Delete button if deletion is allowed -->\n <div *ngIf=\"isDelete\">\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n (click)=\"Delete(data.id)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n <!-- Edit, save, and cancel buttons for row editing -->\n <div>\n <button\n pInitEditableRow\n *ngIf=\"!editing\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-pencil\"\n (click)=\"initEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pSaveEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-check\"\n (click)=\"saveEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pCancelEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n (click)=\"cancelEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n</div>\n", styles: [".date{width:100%;height:5rem;display:grid;justify-items:start;align-items:center}.filter-container{width:100%;display:flex;justify-content:space-between;align-items:center}.settings{display:flex;gap:1rem}.multi-select-container{display:flex;justify-content:center;align-items:center;gap:.3rem}::ng-deep p-table{min-width:50rem}.table-container{display:flex;flex-direction:column;gap:.5rem}::ng-deep .custom-multiselect .p-hidden-accessible input{display:none}::ng-deep .p-datatable .p-sortable-column.p-highlight:hover{background:none}::ng-deep .p-datatable .p-sortable-column:focus{box-shadow:none;outline:0 none}::ng-deep .header-container{display:flex;align-items:center}::ng-deep .header-container span{margin-right:.5em}::ng-deep p-columnfilter.p-element.ng-star-inserted{margin-top:4px}.flex{display:flex;justify-content:space-between;align-items:center}.ml-auto{margin-left:auto}::ng-deep p-inputicon{margin-right:-1.5rem;z-index:2;position:relative}::ng-deep .p-inputtext{padding-left:1.7rem}::ng-deep .bt-filter-btn button{cursor:pointer;margin-left:1rem}::ng-deep .p-icon-field-left .p-input-icon:first-of-type{left:-1rem}.table-row{text-align:center;display:flex;gap:1rem;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i2.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i2.CellEditor, selector: "p-cellEditor" }, { kind: "component", type: i2.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "directive", type: i2.EditableRow, selector: "[pEditableRow]", inputs: ["pEditableRow", "pEditableRowDisabled"] }, { kind: "directive", type: i2.InitEditableRow, selector: "[pInitEditableRow]" }, { kind: "directive", type: i2.SaveEditableRow, selector: "[pSaveEditableRow]" }, { kind: "directive", type: i2.CancelEditableRow, selector: "[pCancelEditableRow]" }, { kind: "component", type: i2.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping", "showButtons", "ariaLabel"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i6.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: i9.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }, { kind: "component", type: i10.IconField, selector: "p-iconField", inputs: ["iconPosition"] }, { kind: "component", type: i11.InputIcon, selector: "p-inputIcon", inputs: ["styleClass"] }, { kind: "pipe", type: CustomCurrencyPipe, name: "customCurrency" }, { kind: "pipe", type: CustomDatePipe, name: "customDate" }] }); }
373
385
  }
374
386
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgAdvancedPrimeTableComponent, decorators: [{
375
387
  type: Component,
@@ -475,12 +487,39 @@ var SearchCriteriaTypeEnum;
475
487
  SearchCriteriaTypeEnum["MULTISELECT"] = "MULTISELECT";
476
488
  })(SearchCriteriaTypeEnum || (SearchCriteriaTypeEnum = {}));
477
489
 
478
- // projects/ng-prime-tools/src/lib/enums/public_api.ts
490
+ var FormInputTypeEnum;
491
+ (function (FormInputTypeEnum) {
492
+ FormInputTypeEnum["DATE"] = "DATE";
493
+ FormInputTypeEnum["TEXT"] = "TEXT";
494
+ FormInputTypeEnum["TEXTAREA"] = "TEXTAREA";
495
+ FormInputTypeEnum["AMOUNT"] = "AMOUNT";
496
+ FormInputTypeEnum["NUMBER"] = "NUMBER";
497
+ FormInputTypeEnum["MULTISELECT"] = "MULTISELECT";
498
+ FormInputTypeEnum["SELECT"] = "SELECT";
499
+ FormInputTypeEnum["CURRENCY"] = "CURRENCY";
500
+ FormInputTypeEnum["CHECKBOX"] = "CHECKBOX";
501
+ FormInputTypeEnum["SWITCH"] = "SWITCH";
502
+ })(FormInputTypeEnum || (FormInputTypeEnum = {}));
479
503
 
480
- /**
481
- * Generated bundle index. Do not edit.
482
- */
483
- /// <amd-module name="ng-prime-tools/enums" />
504
+ var ButtonColorEnum;
505
+ (function (ButtonColorEnum) {
506
+ ButtonColorEnum["PRIMARY"] = "p-button-primary";
507
+ ButtonColorEnum["SECONDARY"] = "p-button-secondary";
508
+ ButtonColorEnum["SUCCESS"] = "p-button-success";
509
+ ButtonColorEnum["INFO"] = "p-button-info";
510
+ ButtonColorEnum["WARNING"] = "p-button-warning";
511
+ ButtonColorEnum["DANGER"] = "p-button-danger";
512
+ })(ButtonColorEnum || (ButtonColorEnum = {}));
513
+
514
+ var InputValidationEnum;
515
+ (function (InputValidationEnum) {
516
+ InputValidationEnum["ONLY_LETTERS"] = "^[A-Za-z ]+$";
517
+ InputValidationEnum["ONLY_NUMBERS"] = "^[0-9]+$";
518
+ InputValidationEnum["LETTERS_AND_NUMBERS"] = "^[A-Za-z0-9 ]+$";
519
+ InputValidationEnum["PHONE_NUMBER"] = "^[0-9 ]+$";
520
+ })(InputValidationEnum || (InputValidationEnum = {}));
521
+
522
+ // projects/ng-prime-tools/src/lib/enums/public_api.ts
484
523
 
485
524
  class MultiSearchCriteriaComponent {
486
525
  constructor() {
@@ -587,7 +626,7 @@ class MultiSearchCriteriaComponent {
587
626
  return null;
588
627
  }
589
628
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: MultiSearchCriteriaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
590
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: MultiSearchCriteriaComponent, selector: "multi-search-criteria", inputs: { title: "title", criteria: "criteria", inputsPerRow: "inputsPerRow", data: "data", mode: "mode" }, outputs: { filteredData: "filteredData", searchCriteria: "searchCriteria" }, ngImport: i0, template: "<p-panel header=\"{{ title }}\" [toggleable]=\"true\" [collapsed]=\"true\">\n <div\n class=\"criteria-container\"\n [ngStyle]=\"{ 'grid-template-columns': 'repeat(' + inputsPerRow + ', 1fr)' }\"\n >\n <div *ngFor=\"let input of criteria\" class=\"criteria-item\">\n <label class=\"bsc-label\">{{ input.title }}</label>\n\n <ng-container [ngSwitch]=\"input.type\">\n <p-calendar\n *ngSwitchCase=\"SearchCriteriaTypeEnum.DATERANGE\"\n [(ngModel)]=\"input.value\"\n selectionMode=\"range\"\n [dateFormat]=\"'dd/mm/yy'\"\n class=\"full-width-input\"\n [showIcon]=\"true\"\n (ngModelChange)=\"input.value = $event\"\n ></p-calendar>\n <p-calendar\n *ngSwitchCase=\"SearchCriteriaTypeEnum.DATE\"\n [ngModel]=\"input.value\"\n (ngModelChange)=\"input.value = $event\"\n [dateFormat]=\"'dd/mm/yy'\"\n [showIcon]=\"true\"\n class=\"full-width-input\"\n ></p-calendar>\n <input\n *ngSwitchCase=\"SearchCriteriaTypeEnum.STRING\"\n type=\"text\"\n pInputText\n [(ngModel)]=\"input.value\"\n class=\"full-width-input\"\n />\n\n <p-inputNumber\n *ngSwitchCase=\"SearchCriteriaTypeEnum.AMOUNT\"\n type=\"number\"\n [(ngModel)]=\"input.value\"\n mode=\"decimal\"\n inputId=\"minmaxfraction\"\n [minFractionDigits]=\"2\"\n [maxFractionDigits]=\"5\"\n [placeholder]=\"getCurrencySymbol(input)\"\n class=\"full-width-input\"\n ></p-inputNumber>\n\n <p-inputNumber\n *ngSwitchCase=\"SearchCriteriaTypeEnum.NUMBER\"\n type=\"number\"\n [(ngModel)]=\"input.value\"\n class=\"full-width-input\"\n ></p-inputNumber>\n\n <p-multiSelect\n *ngSwitchCase=\"SearchCriteriaTypeEnum.MULTISELECT\"\n [options]=\"input.filterOptions\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n [selectAll]=\"selectAll\"\n [(ngModel)]=\"input.value\"\n optionLabel=\"label\"\n (onSelectAllChange)=\"onSelectAllChange($event, input)\"\n class=\"custom-multiselect full-width-input\"\n ></p-multiSelect>\n </ng-container>\n </div>\n </div>\n\n <ng-template pTemplate=\"footer\">\n <div class=\"footer-buttons\">\n <p-button\n label=\"Effacer\"\n icon=\"pi pi-times\"\n (click)=\"clear()\"\n class=\"footer-button\"\n ></p-button>\n <p-button\n label=\"Rechercher\"\n icon=\"pi pi-search\"\n (click)=\"search()\"\n class=\"footer-button\"\n ></p-button>\n </div>\n </ng-template>\n</p-panel>\n", styles: ["::ng-deep .p-element .p-hidden-accessible input{display:none}::ng-deep .bsc-label{display:block;margin-bottom:5px;font-weight:700}::ng-deep .custom-multiselect{width:100%}::ng-deep .p-multiselect .p-multiselect-label{font-size:14px;color:#333}::ng-deep .p-inputtext{width:100%}::ng-deep .p-calendar .p-inputtext{width:100%}::ng-deep .p-inputnumber{width:100%}.criteria-container{display:grid;gap:10px}.criteria-item{margin-bottom:10px;box-sizing:border-box}.full-width-input,::ng-deep .p-calendar,::ng-deep .p-multiselect{width:100%}::ng-deep .p-calendar .p-inputtext,::ng-deep .p-multiselect .p-multiselect-label{width:100%}.footer-buttons{display:flex;justify-content:flex-end;gap:10px}::ng-deep .footer-button button{width:140px;cursor:pointer}::ng-deep .p-panel .p-panel-footer{background:#f8f9fa}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i6.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: i8.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8$1.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: i9$1.Panel, selector: "p-panel", inputs: ["toggleable", "header", "collapsed", "style", "styleClass", "iconPos", "expandIcon", "collapseIcon", "showHeader", "toggler", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] }); }
629
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: MultiSearchCriteriaComponent, selector: "multi-search-criteria", inputs: { title: "title", criteria: "criteria", inputsPerRow: "inputsPerRow", data: "data", mode: "mode" }, outputs: { filteredData: "filteredData", searchCriteria: "searchCriteria" }, ngImport: i0, template: "<p-panel header=\"{{ title }}\" [toggleable]=\"true\" [collapsed]=\"true\">\n <div\n class=\"criteria-container\"\n [ngStyle]=\"{ 'grid-template-columns': 'repeat(' + inputsPerRow + ', 1fr)' }\"\n >\n <div *ngFor=\"let input of criteria\" class=\"criteria-item\">\n <label class=\"bsc-label\">{{ input.title }}</label>\n\n <ng-container [ngSwitch]=\"input.type\">\n <p-calendar\n *ngSwitchCase=\"SearchCriteriaTypeEnum.DATERANGE\"\n [(ngModel)]=\"input.value\"\n selectionMode=\"range\"\n [dateFormat]=\"'dd/mm/yy'\"\n class=\"full-width-input\"\n [showIcon]=\"true\"\n (ngModelChange)=\"input.value = $event\"\n ></p-calendar>\n <p-calendar\n *ngSwitchCase=\"SearchCriteriaTypeEnum.DATE\"\n [ngModel]=\"input.value\"\n (ngModelChange)=\"input.value = $event\"\n [dateFormat]=\"'dd/mm/yy'\"\n [showIcon]=\"true\"\n class=\"full-width-input\"\n ></p-calendar>\n <input\n *ngSwitchCase=\"SearchCriteriaTypeEnum.STRING\"\n type=\"text\"\n pInputText\n [(ngModel)]=\"input.value\"\n class=\"full-width-input\"\n />\n\n <p-inputNumber\n *ngSwitchCase=\"SearchCriteriaTypeEnum.AMOUNT\"\n type=\"number\"\n [(ngModel)]=\"input.value\"\n mode=\"decimal\"\n inputId=\"minmaxfraction\"\n [minFractionDigits]=\"2\"\n [maxFractionDigits]=\"5\"\n [placeholder]=\"getCurrencySymbol(input)\"\n class=\"full-width-input\"\n ></p-inputNumber>\n\n <p-inputNumber\n *ngSwitchCase=\"SearchCriteriaTypeEnum.NUMBER\"\n type=\"number\"\n [(ngModel)]=\"input.value\"\n class=\"full-width-input\"\n ></p-inputNumber>\n\n <p-multiSelect\n *ngSwitchCase=\"SearchCriteriaTypeEnum.MULTISELECT\"\n [options]=\"input.filterOptions\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n [selectAll]=\"selectAll\"\n [(ngModel)]=\"input.value\"\n optionLabel=\"label\"\n (onSelectAllChange)=\"onSelectAllChange($event, input)\"\n class=\"custom-multiselect full-width-input\"\n ></p-multiSelect>\n </ng-container>\n </div>\n </div>\n\n <ng-template pTemplate=\"footer\">\n <div class=\"footer-buttons\">\n <p-button\n label=\"Effacer\"\n icon=\"pi pi-times\"\n (click)=\"clear()\"\n class=\"footer-button\"\n ></p-button>\n <p-button\n label=\"Rechercher\"\n icon=\"pi pi-search\"\n (click)=\"search()\"\n class=\"footer-button\"\n ></p-button>\n </div>\n </ng-template>\n</p-panel>\n", styles: ["::ng-deep .p-element .p-hidden-accessible input{display:none}::ng-deep .bsc-label{display:block;margin-bottom:5px;font-weight:700}::ng-deep .custom-multiselect{width:100%}::ng-deep .p-multiselect .p-multiselect-label{font-size:14px;color:#333}::ng-deep .p-inputtext{width:100%}::ng-deep .p-calendar .p-inputtext{width:100%}::ng-deep .p-inputnumber{width:100%}.criteria-container{display:grid;gap:10px}.criteria-item{margin-bottom:10px;box-sizing:border-box}.full-width-input,::ng-deep .p-calendar,::ng-deep .p-multiselect{width:100%}::ng-deep .p-calendar .p-inputtext,::ng-deep .p-multiselect .p-multiselect-label{width:100%}.footer-buttons{display:flex;justify-content:flex-end;gap:10px}::ng-deep .footer-button button{width:140px;cursor:pointer}::ng-deep .p-panel .p-panel-footer{background:#f8f9fa}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i6.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: i8.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8$1.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: i9$1.Panel, selector: "p-panel", inputs: ["toggleable", "header", "collapsed", "style", "styleClass", "iconPos", "expandIcon", "collapseIcon", "showHeader", "toggler", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] }); }
591
630
  }
592
631
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: MultiSearchCriteriaComponent, decorators: [{
593
632
  type: Component,
@@ -652,16 +691,1043 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
652
691
  */
653
692
  /// <amd-module name="ng-prime-tools/multi-search-criteria" />
654
693
 
694
+ class PTCheckBoxInputComponent {
695
+ ngOnInit() {
696
+ this.setupControl();
697
+ }
698
+ setupControl() {
699
+ let control = this.formGroup.get(this.formField.name);
700
+ if (!control) {
701
+ control = new FormControl(null);
702
+ this.formGroup.addControl(this.formField.name, control);
703
+ }
704
+ setTimeout(() => {
705
+ if (this.formField.disabled) {
706
+ control.disable({ emitEvent: false });
707
+ }
708
+ else {
709
+ control.enable({ emitEvent: false });
710
+ }
711
+ });
712
+ const validators = this.getValidators();
713
+ control.setValidators(validators);
714
+ control.updateValueAndValidity({ emitEvent: false });
715
+ }
716
+ getValidators() {
717
+ const validators = [];
718
+ if (this.formField.required) {
719
+ validators.push(this.requireChoiceValidator());
720
+ }
721
+ return validators;
722
+ }
723
+ requireChoiceValidator() {
724
+ return (control) => {
725
+ return control.value !== null && control.value !== undefined
726
+ ? null
727
+ : { requiredChoice: true };
728
+ };
729
+ }
730
+ getErrorMessage() {
731
+ const control = this.formGroup.get(this.formField.name);
732
+ if (control?.errors?.['requiredChoice'] && !control?.dirty) {
733
+ return this.formField.errorText || `${this.formField.label} is required`;
734
+ }
735
+ return '';
736
+ }
737
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCheckBoxInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
738
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTCheckBoxInputComponent, selector: "pt-check-box-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <div class=\"checkbox-container\">\n <p-checkbox\n [formControlName]=\"formField.name\"\n [binary]=\"true\"\n [label]=\"formField.label || ''\"\n ></p-checkbox>\n </div>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.errors &&\n (formGroup.get(formField.name)?.touched ||\n formGroup.get(formField.name)?.dirty)\n \"\n class=\"error-container\"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.checkbox-container{display:flex;align-items:center}.p-error{font-size:.8rem;color:#f44336}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$1.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }] }); }
739
+ }
740
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCheckBoxInputComponent, decorators: [{
741
+ type: Component,
742
+ args: [{ selector: 'pt-check-box-input', template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <div class=\"checkbox-container\">\n <p-checkbox\n [formControlName]=\"formField.name\"\n [binary]=\"true\"\n [label]=\"formField.label || ''\"\n ></p-checkbox>\n </div>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.errors &&\n (formGroup.get(formField.name)?.touched ||\n formGroup.get(formField.name)?.dirty)\n \"\n class=\"error-container\"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.checkbox-container{display:flex;align-items:center}.p-error{font-size:.8rem;color:#f44336}\n"] }]
743
+ }], propDecorators: { formGroup: [{
744
+ type: Input
745
+ }], formField: [{
746
+ type: Input
747
+ }] } });
748
+
749
+ // date.util.ts
750
+ function getDefaultDateFormat(dateInputType) {
751
+ switch (dateInputType) {
752
+ case 'time':
753
+ return 'HH:mm';
754
+ case 'datetime':
755
+ return 'dd/mm/yy';
756
+ case 'date':
757
+ default:
758
+ return 'dd/mm/yy';
759
+ }
760
+ }
761
+ function getDefaultPlaceholder(dateInputType) {
762
+ switch (dateInputType) {
763
+ case 'time':
764
+ return 'Select time';
765
+ case 'datetime':
766
+ return 'Select date and time';
767
+ case 'date':
768
+ default:
769
+ return 'Select date';
770
+ }
771
+ }
772
+ function parseDate(dateString, format) {
773
+ const parts = dateString.match(/\d+/g);
774
+ if (!parts || parts.length < 2)
775
+ throw new Error(`Invalid date string: ${dateString}`);
776
+ let day, month, year, hour, minute, second;
777
+ switch (format) {
778
+ case 'dd/mm/yy':
779
+ case 'dd-mm-yy':
780
+ case 'dd.mm.yy':
781
+ [day, month, year] = parts;
782
+ break;
783
+ case 'mm/dd/yy':
784
+ [month, day, year] = parts;
785
+ break;
786
+ case 'yy/mm/dd':
787
+ [year, month, day] = parts;
788
+ break;
789
+ case 'HH:mm':
790
+ [hour, minute] = parts;
791
+ return new Date(0, 0, 0, Number(hour), Number(minute));
792
+ case 'HH:mm:ss':
793
+ [hour, minute, second] = parts;
794
+ return new Date(0, 0, 0, Number(hour), Number(minute), Number(second));
795
+ default:
796
+ throw new Error(`Unsupported date format: ${format}`);
797
+ }
798
+ year = year.length === 2 ? `20${year}` : year;
799
+ return new Date(Number(year), Number(month) - 1, Number(day), Number(hour || 0), Number(minute || 0), Number(second || 0));
800
+ }
801
+ function validateTimeValue(value, dateFormat, valueType, hourFormat) {
802
+ const timeFormat = dateFormat.includes('ss') ? 'HH:mm:ss' : 'HH:mm';
803
+ const timeParts = value.match(/\d+/g);
804
+ if (!timeParts || timeParts.length !== (timeFormat === 'HH:mm:ss' ? 3 : 2)) {
805
+ throw new Error(`Invalid ${valueType} "${value}" for time format "${timeFormat}".`);
806
+ }
807
+ const [hour, minute, second] = timeParts.map(Number);
808
+ const maxHour = hourFormat === '12' ? 12 : 23;
809
+ if (hour < 0 ||
810
+ hour > maxHour ||
811
+ minute < 0 ||
812
+ minute > 59 ||
813
+ (second !== undefined && (second < 0 || second > 59))) {
814
+ throw new Error(`Invalid ${valueType} "${value}". Time must be between 00:00 and ${maxHour}:59.`);
815
+ }
816
+ }
817
+
818
+ // pt-date.service.ts
819
+ class PTDateService {
820
+ constructor() { }
821
+ // Assign default date format based on input type
822
+ assignDefaultDateFormat(dateInputType, currentFormat) {
823
+ return currentFormat || getDefaultDateFormat(dateInputType);
824
+ }
825
+ // Validate date format and input type compatibility
826
+ validateDateFormatAndType(dateFormat, dateInputType, minValue, maxValue, hourFormat = '24') {
827
+ const dateOnlyFormats = [
828
+ 'dd/mm/yy',
829
+ 'dd-mm-yy',
830
+ 'dd.mm.yy',
831
+ 'mm/dd/yy',
832
+ 'yy/mm/dd',
833
+ ];
834
+ const timeOnlyFormats = ['HH:mm', 'HH:mm:ss'];
835
+ const dateTimeFormats = dateOnlyFormats;
836
+ switch (dateInputType) {
837
+ case 'date':
838
+ if (!dateOnlyFormats.includes(dateFormat)) {
839
+ throw new Error(`Invalid dateFormat "${dateFormat}" for dateInputType "date".`);
840
+ }
841
+ break;
842
+ case 'time':
843
+ if (!timeOnlyFormats.includes(dateFormat)) {
844
+ throw new Error(`Invalid dateFormat "${dateFormat}" for dateInputType "time".`);
845
+ }
846
+ if (minValue) {
847
+ validateTimeValue(minValue, dateFormat, 'minValue', hourFormat);
848
+ }
849
+ if (maxValue) {
850
+ validateTimeValue(maxValue, dateFormat, 'maxValue', hourFormat);
851
+ }
852
+ break;
853
+ case 'datetime':
854
+ if (!dateTimeFormats.includes(dateFormat)) {
855
+ throw new Error(`Invalid dateFormat "${dateFormat}" for dateInputType "datetime".`);
856
+ }
857
+ break;
858
+ case 'range':
859
+ if (!dateOnlyFormats.includes(dateFormat)) {
860
+ throw new Error(`Invalid dateFormat "${dateFormat}" for dateInputType "range".`);
861
+ }
862
+ break;
863
+ default:
864
+ throw new Error(`Unsupported dateInputType: ${dateInputType}`);
865
+ }
866
+ }
867
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
868
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDateService, providedIn: 'root' }); }
869
+ }
870
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDateService, decorators: [{
871
+ type: Injectable,
872
+ args: [{
873
+ providedIn: 'root',
874
+ }]
875
+ }], ctorParameters: () => [] });
876
+
877
+ class PTDateInputComponent {
878
+ constructor(dateService) {
879
+ this.dateService = dateService;
880
+ this.minDate = null;
881
+ this.maxDate = null;
882
+ this.defaultPlaceholder = 'Select date';
883
+ this.defaultDateFormat = 'dd/mm/yy';
884
+ }
885
+ ngOnInit() {
886
+ this.defaultDateFormat = this.dateService.assignDefaultDateFormat(this.formField.dateInputType || 'date', this.formField.dateFormat);
887
+ this.setupControl();
888
+ this.initializeDateLimits();
889
+ try {
890
+ this.dateService.validateDateFormatAndType(this.defaultDateFormat, this.formField.dateInputType || 'date', this.formField.minValue, this.formField.maxValue, this.formField.hourFormat || '24');
891
+ }
892
+ catch (error) {
893
+ if (error instanceof Error) {
894
+ console.error(error.message);
895
+ }
896
+ else {
897
+ console.error('An unknown error occurred.');
898
+ }
899
+ }
900
+ this.defaultPlaceholder = getDefaultPlaceholder(this.formField.dateInputType || 'date');
901
+ }
902
+ setupControl() {
903
+ let control = this.formGroup.get(this.formField.name);
904
+ if (!control) {
905
+ control = new FormControl(null);
906
+ this.formGroup.addControl(this.formField.name, control);
907
+ }
908
+ setTimeout(() => {
909
+ if (this.formField.disabled) {
910
+ control.disable({ emitEvent: false });
911
+ }
912
+ else {
913
+ control.enable({ emitEvent: false });
914
+ }
915
+ });
916
+ control.setValidators(this.getValidators());
917
+ control.updateValueAndValidity({ emitEvent: false });
918
+ }
919
+ initializeDateLimits() {
920
+ const dateFormat = this.formField.dateFormat;
921
+ if (this.formField.minValue) {
922
+ this.minDate = parseDate(this.formField.minValue, dateFormat);
923
+ }
924
+ if (this.formField.maxValue) {
925
+ this.maxDate = parseDate(this.formField.maxValue, dateFormat);
926
+ }
927
+ }
928
+ getValidators() {
929
+ const validators = [];
930
+ if (this.formField.required) {
931
+ validators.push(Validators.required);
932
+ }
933
+ return validators;
934
+ }
935
+ getErrorMessage() {
936
+ const control = this.formGroup.get(this.formField.name);
937
+ if (control?.hasError('required')) {
938
+ return this.formField.errorText || `${this.formField.label} is required`;
939
+ }
940
+ return '';
941
+ }
942
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDateInputComponent, deps: [{ token: PTDateService }], target: i0.ɵɵFactoryTarget.Component }); }
943
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTDateInputComponent, selector: "pt-date-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-calendar\n [formControlName]=\"formField.name\"\n [placeholder]=\"formField.placeholder || defaultPlaceholder\"\n [dateFormat]=\"formField.dateFormat || defaultDateFormat\"\n [showIcon]=\"true\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [showTime]=\"\n formField.dateInputType === 'datetime' ||\n formField.dateInputType === 'time'\n \"\n [timeOnly]=\"formField.dateInputType === 'time'\"\n [hourFormat]=\"formField.hourFormat || '24'\"\n [selectionMode]=\"formField.dateInputType === 'range' ? 'range' : 'single'\"\n ></p-calendar>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i6.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }] }); }
944
+ }
945
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDateInputComponent, decorators: [{
946
+ type: Component,
947
+ args: [{ selector: 'pt-date-input', template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-calendar\n [formControlName]=\"formField.name\"\n [placeholder]=\"formField.placeholder || defaultPlaceholder\"\n [dateFormat]=\"formField.dateFormat || defaultDateFormat\"\n [showIcon]=\"true\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [showTime]=\"\n formField.dateInputType === 'datetime' ||\n formField.dateInputType === 'time'\n \"\n [timeOnly]=\"formField.dateInputType === 'time'\"\n [hourFormat]=\"formField.hourFormat || '24'\"\n [selectionMode]=\"formField.dateInputType === 'range' ? 'range' : 'single'\"\n ></p-calendar>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"] }]
948
+ }], ctorParameters: () => [{ type: PTDateService }], propDecorators: { formGroup: [{
949
+ type: Input
950
+ }], formField: [{
951
+ type: Input
952
+ }] } });
953
+
954
+ class PTNumberInputComponent {
955
+ ngOnInit() {
956
+ this.setupControl();
957
+ }
958
+ setupControl() {
959
+ const control = this.formGroup.get(this.formField.name);
960
+ if (control) {
961
+ const validators = this.getValidators();
962
+ control.setValidators(validators);
963
+ // Manage the disabled state directly
964
+ setTimeout(() => {
965
+ if (this.formField.disabled) {
966
+ control.disable({ emitEvent: false });
967
+ }
968
+ else {
969
+ control.enable({ emitEvent: false });
970
+ }
971
+ control.updateValueAndValidity({ emitEvent: false });
972
+ });
973
+ }
974
+ }
975
+ getValidators() {
976
+ const validators = [];
977
+ if (this.formField.required) {
978
+ validators.push(Validators.required);
979
+ }
980
+ if (this.formField.minValue !== undefined) {
981
+ const minValue = Number(this.formField.minValue);
982
+ if (!isNaN(minValue)) {
983
+ validators.push(Validators.min(minValue));
984
+ }
985
+ else {
986
+ console.error(`Invalid minValue: ${this.formField.minValue} is not a number.`);
987
+ }
988
+ }
989
+ if (this.formField.maxValue !== undefined) {
990
+ const maxValue = Number(this.formField.maxValue);
991
+ if (!isNaN(maxValue)) {
992
+ validators.push(Validators.max(maxValue));
993
+ }
994
+ else {
995
+ console.error(`Invalid maxValue: ${this.formField.maxValue} is not a number.`);
996
+ }
997
+ }
998
+ if (this.formField.inputValidation) {
999
+ validators.push(this.validateWithInputValidation(this.formField.inputValidation));
1000
+ }
1001
+ return validators;
1002
+ }
1003
+ validateWithInputValidation(inputValidation) {
1004
+ return Validators.pattern(new RegExp(inputValidation));
1005
+ }
1006
+ getErrorMessage() {
1007
+ const control = this.formGroup.get(this.formField.name);
1008
+ if (control?.hasError('required')) {
1009
+ return this.formField.errorText || `${this.formField.label} is required`;
1010
+ }
1011
+ else if (control?.hasError('min')) {
1012
+ return `${this.formField.label} must be at least ${this.formField.minValue}`;
1013
+ }
1014
+ else if (control?.hasError('max')) {
1015
+ return `${this.formField.label} must be at most ${this.formField.maxValue}`;
1016
+ }
1017
+ else if (control?.hasError('pattern')) {
1018
+ return `${this.formField.label} is invalid`;
1019
+ }
1020
+ return '';
1021
+ }
1022
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNumberInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1023
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTNumberInputComponent, selector: "pt-number-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-inputGroup>\n <ng-container\n *ngIf=\"!formField.iconPosition || formField.iconPosition === 'left'\"\n >\n <p-inputGroupAddon *ngIf=\"formField.iconClass || formField.currency\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n <span *ngIf=\"!formField.iconClass && formField.currency\">\n {{ formField.currency }}\n </span>\n </p-inputGroupAddon>\n <p-inputNumber\n [formControlName]=\"formField.name\"\n mode=\"decimal\"\n [locale]=\"formField.numberFormat || undefined\"\n [useGrouping]=\"formField.numberFormat ? true : false\"\n [minFractionDigits]=\"formField.decimalDigits || 0\"\n [maxFractionDigits]=\"formField.decimalDigits || 0\"\n [placeholder]=\"formField.placeholder || ''\"\n ></p-inputNumber>\n </ng-container>\n <ng-container *ngIf=\"formField.iconPosition === 'right'\">\n <p-inputNumber\n [formControlName]=\"formField.name\"\n mode=\"decimal\"\n [locale]=\"formField.numberFormat || undefined\"\n [useGrouping]=\"formField.numberFormat ? true : false\"\n [minFractionDigits]=\"formField.decimalDigits || 0\"\n [maxFractionDigits]=\"formField.decimalDigits || 0\"\n [placeholder]=\"formField.placeholder || ''\"\n ></p-inputNumber>\n <p-inputGroupAddon *ngIf=\"formField.iconClass || formField.currency\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n <span *ngIf=\"!formField.iconClass && formField.currency\">\n {{ formField.currency }}\n </span>\n </p-inputGroupAddon>\n </ng-container>\n </p-inputGroup>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$2.InputGroup, selector: "p-inputGroup", inputs: ["style", "styleClass"] }, { kind: "component", type: i4$1.InputGroupAddon, selector: "p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "component", type: i8$1.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }] }); }
1024
+ }
1025
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNumberInputComponent, decorators: [{
1026
+ type: Component,
1027
+ args: [{ selector: 'pt-number-input', template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-inputGroup>\n <ng-container\n *ngIf=\"!formField.iconPosition || formField.iconPosition === 'left'\"\n >\n <p-inputGroupAddon *ngIf=\"formField.iconClass || formField.currency\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n <span *ngIf=\"!formField.iconClass && formField.currency\">\n {{ formField.currency }}\n </span>\n </p-inputGroupAddon>\n <p-inputNumber\n [formControlName]=\"formField.name\"\n mode=\"decimal\"\n [locale]=\"formField.numberFormat || undefined\"\n [useGrouping]=\"formField.numberFormat ? true : false\"\n [minFractionDigits]=\"formField.decimalDigits || 0\"\n [maxFractionDigits]=\"formField.decimalDigits || 0\"\n [placeholder]=\"formField.placeholder || ''\"\n ></p-inputNumber>\n </ng-container>\n <ng-container *ngIf=\"formField.iconPosition === 'right'\">\n <p-inputNumber\n [formControlName]=\"formField.name\"\n mode=\"decimal\"\n [locale]=\"formField.numberFormat || undefined\"\n [useGrouping]=\"formField.numberFormat ? true : false\"\n [minFractionDigits]=\"formField.decimalDigits || 0\"\n [maxFractionDigits]=\"formField.decimalDigits || 0\"\n [placeholder]=\"formField.placeholder || ''\"\n ></p-inputNumber>\n <p-inputGroupAddon *ngIf=\"formField.iconClass || formField.currency\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n <span *ngIf=\"!formField.iconClass && formField.currency\">\n {{ formField.currency }}\n </span>\n </p-inputGroupAddon>\n </ng-container>\n </p-inputGroup>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"] }]
1028
+ }], propDecorators: { formGroup: [{
1029
+ type: Input
1030
+ }], formField: [{
1031
+ type: Input
1032
+ }] } });
1033
+
1034
+ class PTSwitchInputComponent {
1035
+ ngOnInit() {
1036
+ this.setupControl();
1037
+ }
1038
+ setupControl() {
1039
+ let control = this.formGroup.get(this.formField.name);
1040
+ if (!control) {
1041
+ // Initialize control with false indicating not activated
1042
+ control = new FormControl(this.formField.required ? null : false);
1043
+ this.formGroup.addControl(this.formField.name, control);
1044
+ }
1045
+ // Apply validators and manage disabled state
1046
+ control.setValidators(this.getValidators());
1047
+ setTimeout(() => {
1048
+ if (this.formField.disabled) {
1049
+ control.disable({ emitEvent: false });
1050
+ }
1051
+ else {
1052
+ control.enable({ emitEvent: false });
1053
+ }
1054
+ control.updateValueAndValidity({ emitEvent: false });
1055
+ });
1056
+ }
1057
+ getValidators() {
1058
+ const validators = [];
1059
+ if (this.formField.required) {
1060
+ validators.push(this.requireChoiceValidator());
1061
+ }
1062
+ return validators;
1063
+ }
1064
+ requireChoiceValidator() {
1065
+ return (control) => {
1066
+ return control.value !== null && control.value !== undefined
1067
+ ? null
1068
+ : { requiredChoice: true };
1069
+ };
1070
+ }
1071
+ getErrorMessage() {
1072
+ const control = this.formGroup.get(this.formField.name);
1073
+ if (control?.errors?.['requiredChoice'] && !control?.dirty) {
1074
+ return this.formField.errorText || `${this.formField.label} is required`;
1075
+ }
1076
+ return '';
1077
+ }
1078
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSwitchInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1079
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTSwitchInputComponent, selector: "pt-switch-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <div class=\"switch-container\" style=\"display: flex; align-items: center\">\n <p-inputSwitch [formControlName]=\"formField.name\"></p-inputSwitch>\n <label *ngIf=\"formField.label\" style=\"margin-left: 8px\">{{\n formField.label\n }}</label>\n </div>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.errors &&\n (formGroup.get(formField.name)?.touched ||\n formGroup.get(formField.name)?.dirty)\n \"\n class=\"error-container\"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".switch-container{display:flex;align-items:center}.error-container{margin-top:5px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$3.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabel", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }] }); }
1080
+ }
1081
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSwitchInputComponent, decorators: [{
1082
+ type: Component,
1083
+ args: [{ selector: 'pt-switch-input', template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <div class=\"switch-container\" style=\"display: flex; align-items: center\">\n <p-inputSwitch [formControlName]=\"formField.name\"></p-inputSwitch>\n <label *ngIf=\"formField.label\" style=\"margin-left: 8px\">{{\n formField.label\n }}</label>\n </div>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.errors &&\n (formGroup.get(formField.name)?.touched ||\n formGroup.get(formField.name)?.dirty)\n \"\n class=\"error-container\"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".switch-container{display:flex;align-items:center}.error-container{margin-top:5px}\n"] }]
1084
+ }], propDecorators: { formGroup: [{
1085
+ type: Input
1086
+ }], formField: [{
1087
+ type: Input
1088
+ }] } });
1089
+
1090
+ class PTTextAreaInputComponent {
1091
+ constructor() {
1092
+ this.characterCount = 0;
1093
+ }
1094
+ ngOnInit() {
1095
+ this.setupControl();
1096
+ }
1097
+ setupControl() {
1098
+ const control = this.formGroup.get(this.formField.name);
1099
+ if (control) {
1100
+ const validators = this.getValidators();
1101
+ control.setValidators(validators);
1102
+ // Manage the disabled state here
1103
+ setTimeout(() => {
1104
+ if (this.formField.disabled) {
1105
+ control.disable();
1106
+ }
1107
+ else {
1108
+ control.enable();
1109
+ }
1110
+ control.updateValueAndValidity();
1111
+ });
1112
+ // Subscribe to value changes to update character count
1113
+ control.valueChanges.subscribe((value) => {
1114
+ this.characterCount = value ? value.length : 0;
1115
+ });
1116
+ }
1117
+ }
1118
+ getValidators() {
1119
+ const validators = [];
1120
+ if (this.formField.required) {
1121
+ validators.push(Validators.required);
1122
+ }
1123
+ if (this.formField.minLength !== undefined) {
1124
+ validators.push(Validators.minLength(this.formField.minLength));
1125
+ }
1126
+ if (this.formField.maxLength !== undefined) {
1127
+ validators.push(Validators.maxLength(this.formField.maxLength));
1128
+ }
1129
+ if (this.formField.inputValidation) {
1130
+ validators.push(this.validateWithInputValidation(this.formField.inputValidation));
1131
+ }
1132
+ return validators;
1133
+ }
1134
+ validateWithInputValidation(inputValidation) {
1135
+ return Validators.pattern(new RegExp(inputValidation));
1136
+ }
1137
+ getErrorMessage() {
1138
+ const control = this.formGroup.get(this.formField.name);
1139
+ if (control?.hasError('required')) {
1140
+ return this.formField.errorText || `${this.formField.label} is required`;
1141
+ }
1142
+ else if (control?.hasError('minlength')) {
1143
+ return `${this.formField.label} must be at least ${this.formField.minLength} characters long`;
1144
+ }
1145
+ else if (control?.hasError('maxlength')) {
1146
+ return `${this.formField.label} must be at most ${this.formField.maxLength} characters long`;
1147
+ }
1148
+ else if (control?.hasError('pattern')) {
1149
+ return `${this.formField.label} is invalid`;
1150
+ }
1151
+ return '';
1152
+ }
1153
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextAreaInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1154
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTTextAreaInputComponent, selector: "pt-text-area-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n *ngIf=\"!formField.hidden\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-inputGroup>\n <ng-container\n *ngIf=\"!formField.iconPosition || formField.iconPosition === 'left'\"\n >\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n </ng-container>\n <ng-container *ngIf=\"formField.iconPosition === 'right'\">\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n </ng-container>\n </p-inputGroup>\n <div class=\"form-info-row\">\n <small\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n class=\"p-error\"\n >\n {{ getErrorMessage() }}\n </small>\n <div class=\"spacer\"></div>\n <!-- Spacer to ensure alignment -->\n <div\n *ngIf=\"!formField.disabled && formField.maxLength !== undefined\"\n class=\"character-counter\"\n >\n {{ characterCount }}/{{ formField.maxLength }} characters\n </div>\n </div>\n</div>\n", styles: [".form-field{position:relative;margin-bottom:2rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.form-info-row{display:flex;justify-content:space-between;align-items:center;margin-top:.5rem}.spacer{flex-grow:1}.character-counter{font-size:.8rem;color:#888;text-align:right;margin-left:auto}.p-error{font-size:.8rem;color:#f44336}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$4.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "component", type: i3$2.InputGroup, selector: "p-inputGroup", inputs: ["style", "styleClass"] }, { kind: "component", type: i4$1.InputGroupAddon, selector: "p-inputGroupAddon", inputs: ["style", "styleClass"] }] }); }
1155
+ }
1156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextAreaInputComponent, decorators: [{
1157
+ type: Component,
1158
+ args: [{ selector: 'pt-text-area-input', template: "<div\n [formGroup]=\"formGroup\"\n *ngIf=\"!formField.hidden\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-inputGroup>\n <ng-container\n *ngIf=\"!formField.iconPosition || formField.iconPosition === 'left'\"\n >\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n </ng-container>\n <ng-container *ngIf=\"formField.iconPosition === 'right'\">\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n </ng-container>\n </p-inputGroup>\n <div class=\"form-info-row\">\n <small\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n class=\"p-error\"\n >\n {{ getErrorMessage() }}\n </small>\n <div class=\"spacer\"></div>\n <!-- Spacer to ensure alignment -->\n <div\n *ngIf=\"!formField.disabled && formField.maxLength !== undefined\"\n class=\"character-counter\"\n >\n {{ characterCount }}/{{ formField.maxLength }} characters\n </div>\n </div>\n</div>\n", styles: [".form-field{position:relative;margin-bottom:2rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.form-info-row{display:flex;justify-content:space-between;align-items:center;margin-top:.5rem}.spacer{flex-grow:1}.character-counter{font-size:.8rem;color:#888;text-align:right;margin-left:auto}.p-error{font-size:.8rem;color:#f44336}\n"] }]
1159
+ }], propDecorators: { formGroup: [{
1160
+ type: Input
1161
+ }], formField: [{
1162
+ type: Input
1163
+ }] } });
1164
+
1165
+ class PTTextInputComponent {
1166
+ constructor() {
1167
+ this.characterCount = 0;
1168
+ }
1169
+ ngOnInit() {
1170
+ this.setupControl();
1171
+ this.updateCharacterCount();
1172
+ }
1173
+ setupControl() {
1174
+ const control = this.formGroup.get(this.formField.name);
1175
+ if (control) {
1176
+ const validators = this.getValidators();
1177
+ control.setValidators(validators);
1178
+ setTimeout(() => {
1179
+ if (this.formField.disabled) {
1180
+ control.disable({ emitEvent: false });
1181
+ }
1182
+ else {
1183
+ control.enable({ emitEvent: false });
1184
+ control.valueChanges.subscribe(() => {
1185
+ this.updateCharacterCount();
1186
+ });
1187
+ }
1188
+ control.updateValueAndValidity({ emitEvent: false });
1189
+ });
1190
+ }
1191
+ }
1192
+ updateCharacterCount() {
1193
+ const control = this.formGroup.get(this.formField.name);
1194
+ this.characterCount = control.value ? control.value.length : 0;
1195
+ }
1196
+ getValidators() {
1197
+ const validators = [];
1198
+ if (this.formField.required) {
1199
+ validators.push(Validators.required);
1200
+ }
1201
+ if (this.formField.minLength !== undefined) {
1202
+ validators.push(Validators.minLength(this.formField.minLength));
1203
+ }
1204
+ if (this.formField.maxLength !== undefined) {
1205
+ validators.push(Validators.maxLength(this.formField.maxLength));
1206
+ }
1207
+ if (this.formField.inputValidation) {
1208
+ validators.push(this.validateWithInputValidation(this.formField.inputValidation));
1209
+ }
1210
+ return validators;
1211
+ }
1212
+ validateWithInputValidation(inputValidation) {
1213
+ return Validators.pattern(new RegExp(inputValidation));
1214
+ }
1215
+ getErrorMessage() {
1216
+ const control = this.formGroup.get(this.formField.name);
1217
+ if (control?.hasError('required')) {
1218
+ return `${this.formField.label} is required`;
1219
+ }
1220
+ else if (control?.hasError('minlength')) {
1221
+ return `${this.formField.label} must be at least ${this.formField.minLength} characters`;
1222
+ }
1223
+ else if (control?.hasError('maxlength')) {
1224
+ return `${this.formField.label} must be at most ${this.formField.maxLength} characters`;
1225
+ }
1226
+ else if (control?.hasError('pattern')) {
1227
+ return `${this.formField.label} is invalid`;
1228
+ }
1229
+ return '';
1230
+ }
1231
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1232
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTTextInputComponent, selector: "pt-text-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <ng-container *ngIf=\"formField.iconClass; else noIcon\">\n <p-iconField [iconPosition]=\"formField.iconPosition || 'left'\">\n <p-inputIcon\n *ngIf=\"formField.iconClass\"\n [styleClass]=\"formField.iconClass\"\n ></p-inputIcon>\n <input\n type=\"text\"\n pInputText\n [formControlName]=\"formField.name\"\n [placeholder]=\"formField.placeholder ?? ''\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n />\n </p-iconField>\n </ng-container>\n <ng-template #noIcon>\n <input\n type=\"text\"\n pInputText\n [formControlName]=\"formField.name\"\n [placeholder]=\"formField.placeholder ?? ''\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [ngStyle]=\"{ width: '100%' }\"\n />\n </ng-template>\n <div class=\"form-info-row\">\n <small\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n class=\"p-error\"\n >\n {{ getErrorMessage() }}\n </small>\n <div class=\"spacer\"></div>\n <!-- Spacer to maintain right alignment -->\n <div\n *ngIf=\"!formField.disabled && formField.maxLength !== undefined\"\n class=\"character-counter\"\n >\n {{ characterCount }}/{{ formField.maxLength }} characters\n </div>\n </div>\n</div>\n", styles: [".form-field{position:relative;margin-bottom:2rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.form-info-row{display:flex;justify-content:space-between;align-items:center;margin-top:.5rem}.spacer{flex-grow:1}.character-counter{font-size:.8rem;color:#888;text-align:right;margin-left:auto}.p-error{font-size:.8rem;color:#f44336}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: i10.IconField, selector: "p-iconField", inputs: ["iconPosition"] }, { kind: "component", type: i11.InputIcon, selector: "p-inputIcon", inputs: ["styleClass"] }] }); }
1233
+ }
1234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextInputComponent, decorators: [{
1235
+ type: Component,
1236
+ args: [{ selector: 'pt-text-input', template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <ng-container *ngIf=\"formField.iconClass; else noIcon\">\n <p-iconField [iconPosition]=\"formField.iconPosition || 'left'\">\n <p-inputIcon\n *ngIf=\"formField.iconClass\"\n [styleClass]=\"formField.iconClass\"\n ></p-inputIcon>\n <input\n type=\"text\"\n pInputText\n [formControlName]=\"formField.name\"\n [placeholder]=\"formField.placeholder ?? ''\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n />\n </p-iconField>\n </ng-container>\n <ng-template #noIcon>\n <input\n type=\"text\"\n pInputText\n [formControlName]=\"formField.name\"\n [placeholder]=\"formField.placeholder ?? ''\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [ngStyle]=\"{ width: '100%' }\"\n />\n </ng-template>\n <div class=\"form-info-row\">\n <small\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n class=\"p-error\"\n >\n {{ getErrorMessage() }}\n </small>\n <div class=\"spacer\"></div>\n <!-- Spacer to maintain right alignment -->\n <div\n *ngIf=\"!formField.disabled && formField.maxLength !== undefined\"\n class=\"character-counter\"\n >\n {{ characterCount }}/{{ formField.maxLength }} characters\n </div>\n </div>\n</div>\n", styles: [".form-field{position:relative;margin-bottom:2rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.form-info-row{display:flex;justify-content:space-between;align-items:center;margin-top:.5rem}.spacer{flex-grow:1}.character-counter{font-size:.8rem;color:#888;text-align:right;margin-left:auto}.p-error{font-size:.8rem;color:#f44336}\n"] }]
1237
+ }], propDecorators: { formGroup: [{
1238
+ type: Input
1239
+ }], formField: [{
1240
+ type: Input
1241
+ }] } });
1242
+
1243
+ class PTDropdownComponent {
1244
+ ngOnInit() {
1245
+ this.setupControl();
1246
+ }
1247
+ setupControl() {
1248
+ let control = this.formGroup.get(this.formField.name);
1249
+ if (!control) {
1250
+ control = new FormControl(this.formField.value || null);
1251
+ this.formGroup.addControl(this.formField.name, control);
1252
+ }
1253
+ const validators = this.getValidators();
1254
+ control.setValidators(validators);
1255
+ // Manage the disabled state using form control
1256
+ setTimeout(() => {
1257
+ if (this.formField.disabled !== undefined) {
1258
+ if (this.formField.disabled) {
1259
+ control.disable({ emitEvent: false });
1260
+ }
1261
+ else {
1262
+ control.enable({ emitEvent: false });
1263
+ }
1264
+ }
1265
+ control.updateValueAndValidity({ emitEvent: false });
1266
+ });
1267
+ }
1268
+ getValidators() {
1269
+ const validators = [];
1270
+ if (this.formField.required) {
1271
+ validators.push(Validators.required);
1272
+ }
1273
+ return validators;
1274
+ }
1275
+ getErrorMessage() {
1276
+ const control = this.formGroup.get(this.formField.name);
1277
+ if (control?.hasError('required')) {
1278
+ return this.formField.errorText || `${this.formField.label} is required`;
1279
+ }
1280
+ return '';
1281
+ }
1282
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1283
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTDropdownComponent, selector: "pt-dropdown", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-dropdown\n [formControlName]=\"formField.name\"\n [options]=\"formField.options\"\n [placeholder]=\"formField.placeholder || 'Select an option'\"\n optionLabel=\"label\"\n ></p-dropdown>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$5.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }] }); }
1284
+ }
1285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDropdownComponent, decorators: [{
1286
+ type: Component,
1287
+ args: [{ selector: 'pt-dropdown', template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-dropdown\n [formControlName]=\"formField.name\"\n [options]=\"formField.options\"\n [placeholder]=\"formField.placeholder || 'Select an option'\"\n optionLabel=\"label\"\n ></p-dropdown>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"] }]
1288
+ }], propDecorators: { formGroup: [{
1289
+ type: Input
1290
+ }], formField: [{
1291
+ type: Input
1292
+ }] } });
1293
+
1294
+ class PTMultiSelectComponent {
1295
+ ngOnInit() {
1296
+ this.setupControl();
1297
+ }
1298
+ setupControl() {
1299
+ let control = this.formGroup.get(this.formField.name);
1300
+ if (!control) {
1301
+ control = new FormControl(this.formField.value || []);
1302
+ this.formGroup.addControl(this.formField.name, control);
1303
+ }
1304
+ const validators = this.getValidators();
1305
+ control.setValidators(validators);
1306
+ // Manage the disabled state using form control
1307
+ setTimeout(() => {
1308
+ if (this.formField.disabled !== undefined) {
1309
+ if (this.formField.disabled) {
1310
+ control.disable({ emitEvent: false });
1311
+ }
1312
+ else {
1313
+ control.enable({ emitEvent: false });
1314
+ }
1315
+ }
1316
+ control.updateValueAndValidity({ emitEvent: false });
1317
+ });
1318
+ }
1319
+ getValidators() {
1320
+ const validators = [];
1321
+ if (this.formField.required) {
1322
+ validators.push(Validators.required);
1323
+ }
1324
+ return validators;
1325
+ }
1326
+ getErrorMessage() {
1327
+ const control = this.formGroup.get(this.formField.name);
1328
+ if (control?.hasError('required')) {
1329
+ return this.formField.errorText || `${this.formField.label} is required`;
1330
+ }
1331
+ return '';
1332
+ }
1333
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1334
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTMultiSelectComponent, selector: "pt-multi-select", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-multiSelect\n [formControlName]=\"formField.name\"\n [options]=\"formField.options\"\n [placeholder]=\"formField.placeholder || 'Select options'\"\n optionLabel=\"label\"\n ></p-multiSelect>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }] }); }
1335
+ }
1336
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMultiSelectComponent, decorators: [{
1337
+ type: Component,
1338
+ args: [{ selector: 'pt-multi-select', template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-multiSelect\n [formControlName]=\"formField.name\"\n [options]=\"formField.options\"\n [placeholder]=\"formField.placeholder || 'Select options'\"\n optionLabel=\"label\"\n ></p-multiSelect>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"] }]
1339
+ }], propDecorators: { formGroup: [{
1340
+ type: Input
1341
+ }], formField: [{
1342
+ type: Input
1343
+ }] } });
1344
+
1345
+ class PTDynamicFormFieldComponent {
1346
+ constructor() {
1347
+ this.FormInputTypeEnum = FormInputTypeEnum;
1348
+ }
1349
+ asTextField(field) {
1350
+ return field;
1351
+ }
1352
+ asNumberField(field) {
1353
+ return field;
1354
+ }
1355
+ asTextAreaField(field) {
1356
+ return field;
1357
+ }
1358
+ asDateField(field) {
1359
+ return field;
1360
+ }
1361
+ asSelectField(field) {
1362
+ return field;
1363
+ }
1364
+ asMultiSelectField(field) {
1365
+ return field;
1366
+ }
1367
+ asCheckboxField(field) {
1368
+ return field;
1369
+ }
1370
+ asSwitchField(field) {
1371
+ return field;
1372
+ }
1373
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDynamicFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1374
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTDynamicFormFieldComponent, selector: "pt-dynamic-form-field", inputs: { field: "field", form: "form", inputWidth: "inputWidth" }, ngImport: i0, template: "<div\n [formGroup]=\"form\"\n class=\"form-field\"\n [ngStyle]=\"{\n width:\n field.type !== FormInputTypeEnum.CHECKBOX &&\n field.type !== FormInputTypeEnum.SWITCH\n ? field.width || inputWidth\n : 'auto'\n }\"\n>\n <ng-container [ngSwitch]=\"field.type\">\n <pt-text-input\n *ngSwitchCase=\"FormInputTypeEnum.TEXT\"\n [formGroup]=\"form\"\n [formField]=\"asTextField(field)\"\n ></pt-text-input>\n <pt-number-input\n *ngSwitchCase=\"FormInputTypeEnum.NUMBER\"\n [formGroup]=\"form\"\n [formField]=\"asNumberField(field)\"\n ></pt-number-input>\n <pt-number-input\n *ngSwitchCase=\"FormInputTypeEnum.AMOUNT\"\n [formGroup]=\"form\"\n [formField]=\"asNumberField(field)\"\n ></pt-number-input>\n <pt-text-area-input\n *ngSwitchCase=\"FormInputTypeEnum.TEXTAREA\"\n [formGroup]=\"form\"\n [formField]=\"asTextAreaField(field)\"\n ></pt-text-area-input>\n <pt-date-input\n *ngSwitchCase=\"FormInputTypeEnum.DATE\"\n [formGroup]=\"form\"\n [formField]=\"asDateField(field)\"\n ></pt-date-input>\n <pt-multi-select\n *ngSwitchCase=\"FormInputTypeEnum.MULTISELECT\"\n [formGroup]=\"form\"\n [formField]=\"asMultiSelectField(field)\"\n ></pt-multi-select>\n <pt-dropdown\n *ngSwitchCase=\"FormInputTypeEnum.SELECT\"\n [formGroup]=\"form\"\n [formField]=\"asSelectField(field)\"\n ></pt-dropdown>\n <pt-check-box-input\n *ngSwitchCase=\"FormInputTypeEnum.CHECKBOX\"\n [formGroup]=\"form\"\n [formField]=\"asCheckboxField(field)\"\n ></pt-check-box-input>\n <pt-switch-input\n *ngSwitchCase=\"FormInputTypeEnum.SWITCH\"\n [formGroup]=\"form\"\n [formField]=\"asSwitchField(field)\"\n ></pt-switch-input>\n </ng-container>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: PTCheckBoxInputComponent, selector: "pt-check-box-input", inputs: ["formGroup", "formField"] }, { kind: "component", type: PTDateInputComponent, selector: "pt-date-input", inputs: ["formGroup", "formField"] }, { kind: "component", type: PTNumberInputComponent, selector: "pt-number-input", inputs: ["formGroup", "formField"] }, { kind: "component", type: PTSwitchInputComponent, selector: "pt-switch-input", inputs: ["formGroup", "formField"] }, { kind: "component", type: PTTextAreaInputComponent, selector: "pt-text-area-input", inputs: ["formGroup", "formField"] }, { kind: "component", type: PTTextInputComponent, selector: "pt-text-input", inputs: ["formGroup", "formField"] }, { kind: "component", type: PTDropdownComponent, selector: "pt-dropdown", inputs: ["formGroup", "formField"] }, { kind: "component", type: PTMultiSelectComponent, selector: "pt-multi-select", inputs: ["formGroup", "formField"] }] }); }
1375
+ }
1376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDynamicFormFieldComponent, decorators: [{
1377
+ type: Component,
1378
+ args: [{ selector: 'pt-dynamic-form-field', template: "<div\n [formGroup]=\"form\"\n class=\"form-field\"\n [ngStyle]=\"{\n width:\n field.type !== FormInputTypeEnum.CHECKBOX &&\n field.type !== FormInputTypeEnum.SWITCH\n ? field.width || inputWidth\n : 'auto'\n }\"\n>\n <ng-container [ngSwitch]=\"field.type\">\n <pt-text-input\n *ngSwitchCase=\"FormInputTypeEnum.TEXT\"\n [formGroup]=\"form\"\n [formField]=\"asTextField(field)\"\n ></pt-text-input>\n <pt-number-input\n *ngSwitchCase=\"FormInputTypeEnum.NUMBER\"\n [formGroup]=\"form\"\n [formField]=\"asNumberField(field)\"\n ></pt-number-input>\n <pt-number-input\n *ngSwitchCase=\"FormInputTypeEnum.AMOUNT\"\n [formGroup]=\"form\"\n [formField]=\"asNumberField(field)\"\n ></pt-number-input>\n <pt-text-area-input\n *ngSwitchCase=\"FormInputTypeEnum.TEXTAREA\"\n [formGroup]=\"form\"\n [formField]=\"asTextAreaField(field)\"\n ></pt-text-area-input>\n <pt-date-input\n *ngSwitchCase=\"FormInputTypeEnum.DATE\"\n [formGroup]=\"form\"\n [formField]=\"asDateField(field)\"\n ></pt-date-input>\n <pt-multi-select\n *ngSwitchCase=\"FormInputTypeEnum.MULTISELECT\"\n [formGroup]=\"form\"\n [formField]=\"asMultiSelectField(field)\"\n ></pt-multi-select>\n <pt-dropdown\n *ngSwitchCase=\"FormInputTypeEnum.SELECT\"\n [formGroup]=\"form\"\n [formField]=\"asSelectField(field)\"\n ></pt-dropdown>\n <pt-check-box-input\n *ngSwitchCase=\"FormInputTypeEnum.CHECKBOX\"\n [formGroup]=\"form\"\n [formField]=\"asCheckboxField(field)\"\n ></pt-check-box-input>\n <pt-switch-input\n *ngSwitchCase=\"FormInputTypeEnum.SWITCH\"\n [formGroup]=\"form\"\n [formField]=\"asSwitchField(field)\"\n ></pt-switch-input>\n </ng-container>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"] }]
1379
+ }], propDecorators: { field: [{
1380
+ type: Input
1381
+ }], form: [{
1382
+ type: Input
1383
+ }], inputWidth: [{
1384
+ type: Input
1385
+ }] } });
1386
+
1387
+ class PTFormBuilderComponent {
1388
+ constructor(fb) {
1389
+ this.fb = fb;
1390
+ this.mainGroup = { fields: [], groups: [] };
1391
+ this.buttons = [];
1392
+ this.inputWidth = '100%';
1393
+ this.language = 'en';
1394
+ this.formSubmit = new EventEmitter();
1395
+ this.FormInputTypeEnum = FormInputTypeEnum;
1396
+ this.errorMessages = {
1397
+ en: {
1398
+ required: 'is required',
1399
+ },
1400
+ fr: {
1401
+ required: 'est requis',
1402
+ },
1403
+ };
1404
+ this.form = this.fb.group({});
1405
+ }
1406
+ ngOnInit() {
1407
+ this.buildFormGroup(this.mainGroup);
1408
+ }
1409
+ buildFormGroup(group) {
1410
+ group.fields?.forEach((field) => {
1411
+ const validators = field.required ? [Validators.required] : [];
1412
+ this.form.addControl(field.name, this.fb.control(field.value, validators));
1413
+ });
1414
+ group.groups?.forEach((subGroup) => {
1415
+ this.buildFormGroup(subGroup);
1416
+ });
1417
+ }
1418
+ getErrorMessage(field) {
1419
+ if (this.form.get(field.name)?.hasError('required')) {
1420
+ return (field.errorText ||
1421
+ `${field.label} ${this.errorMessages[this.language].required}`);
1422
+ }
1423
+ return '';
1424
+ }
1425
+ onSubmit() {
1426
+ this.form.markAllAsTouched();
1427
+ if (this.form.valid) {
1428
+ this.formSubmit.emit(this.form.value);
1429
+ }
1430
+ }
1431
+ onClear() {
1432
+ this.form.reset();
1433
+ }
1434
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFormBuilderComponent, deps: [{ token: i2$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
1435
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTFormBuilderComponent, selector: "pt-form-builder", inputs: { mainGroup: "mainGroup", buttons: "buttons", title: "title", titleStyle: "titleStyle", inputWidth: "inputWidth", language: "language" }, outputs: { formSubmit: "formSubmit" }, ngImport: i0, template: "<div *ngIf=\"title\" [ngStyle]=\"titleStyle\" class=\"form-title\">{{ title }}</div>\n<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <ng-container *ngFor=\"let field of mainGroup.fields\">\n <pt-dynamic-form-field\n [field]=\"field\"\n [form]=\"form\"\n [inputWidth]=\"inputWidth\"\n ></pt-dynamic-form-field>\n </ng-container>\n\n <ng-container *ngFor=\"let group of mainGroup.groups\">\n <div class=\"form-field-group\" [ngStyle]=\"{ width: group.width || '100%' }\">\n <ng-container *ngFor=\"let field of group.fields\">\n <pt-dynamic-form-field\n [field]=\"field\"\n [form]=\"form\"\n class=\"flex-item\"\n ></pt-dynamic-form-field>\n </ng-container>\n </div>\n </ng-container>\n\n <div class=\"button-group\">\n <button\n *ngFor=\"let button of buttons\"\n type=\"button\"\n pButton\n [label]=\"button.text\"\n [icon]=\"button.icon || ''\"\n [class]=\"button.color\"\n (click)=\"\n button.isSubmit\n ? onSubmit()\n : button.isClear\n ? onClear()\n : button.action\n ? button.action()\n : null\n \"\n ></button>\n </div>\n</form>\n", styles: [".form-title{text-align:center;margin-bottom:1rem;font-size:1.5rem;font-weight:700}.form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}::ng-deep .p-inputtext,::ng-deep .p-inputtextarea,::ng-deep .p-calendar,::ng-deep .p-inputnumber,::ng-deep .p-multiselect,::ng-deep .p-dropdown{width:100%!important}::ng-deep .p-inputnumber,::ng-deep p-inputnumber{display:flex!important}.button-group{display:flex;gap:1rem;margin-top:1rem;justify-content:space-between}.button-group button{flex:1;display:flex;align-items:center;justify-content:center}.button-group button i{margin-right:.5rem}.button-group button.p-button-primary{background-color:#007bff;color:#fff}.button-group button.p-button-secondary{background-color:#6c757d;color:#fff}.button-group button.p-button-success{background-color:#28a745;color:#fff}.button-group button:hover{opacity:.9}.form-field-group{display:flex;gap:1rem}.form-field-group .flex-item{flex:1}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: PTDynamicFormFieldComponent, selector: "pt-dynamic-form-field", inputs: ["field", "form", "inputWidth"] }] }); }
1436
+ }
1437
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFormBuilderComponent, decorators: [{
1438
+ type: Component,
1439
+ args: [{ selector: 'pt-form-builder', template: "<div *ngIf=\"title\" [ngStyle]=\"titleStyle\" class=\"form-title\">{{ title }}</div>\n<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <ng-container *ngFor=\"let field of mainGroup.fields\">\n <pt-dynamic-form-field\n [field]=\"field\"\n [form]=\"form\"\n [inputWidth]=\"inputWidth\"\n ></pt-dynamic-form-field>\n </ng-container>\n\n <ng-container *ngFor=\"let group of mainGroup.groups\">\n <div class=\"form-field-group\" [ngStyle]=\"{ width: group.width || '100%' }\">\n <ng-container *ngFor=\"let field of group.fields\">\n <pt-dynamic-form-field\n [field]=\"field\"\n [form]=\"form\"\n class=\"flex-item\"\n ></pt-dynamic-form-field>\n </ng-container>\n </div>\n </ng-container>\n\n <div class=\"button-group\">\n <button\n *ngFor=\"let button of buttons\"\n type=\"button\"\n pButton\n [label]=\"button.text\"\n [icon]=\"button.icon || ''\"\n [class]=\"button.color\"\n (click)=\"\n button.isSubmit\n ? onSubmit()\n : button.isClear\n ? onClear()\n : button.action\n ? button.action()\n : null\n \"\n ></button>\n </div>\n</form>\n", styles: [".form-title{text-align:center;margin-bottom:1rem;font-size:1.5rem;font-weight:700}.form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}::ng-deep .p-inputtext,::ng-deep .p-inputtextarea,::ng-deep .p-calendar,::ng-deep .p-inputnumber,::ng-deep .p-multiselect,::ng-deep .p-dropdown{width:100%!important}::ng-deep .p-inputnumber,::ng-deep p-inputnumber{display:flex!important}.button-group{display:flex;gap:1rem;margin-top:1rem;justify-content:space-between}.button-group button{flex:1;display:flex;align-items:center;justify-content:center}.button-group button i{margin-right:.5rem}.button-group button.p-button-primary{background-color:#007bff;color:#fff}.button-group button.p-button-secondary{background-color:#6c757d;color:#fff}.button-group button.p-button-success{background-color:#28a745;color:#fff}.button-group button:hover{opacity:.9}.form-field-group{display:flex;gap:1rem}.form-field-group .flex-item{flex:1}\n"] }]
1440
+ }], ctorParameters: () => [{ type: i2$1.FormBuilder }], propDecorators: { mainGroup: [{
1441
+ type: Input
1442
+ }], buttons: [{
1443
+ type: Input
1444
+ }], title: [{
1445
+ type: Input
1446
+ }], titleStyle: [{
1447
+ type: Input
1448
+ }], inputWidth: [{
1449
+ type: Input
1450
+ }], language: [{
1451
+ type: Input
1452
+ }], formSubmit: [{
1453
+ type: Output
1454
+ }] } });
1455
+
1456
+ class PTCheckBoxInputModule {
1457
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCheckBoxInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1458
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTCheckBoxInputModule, declarations: [PTCheckBoxInputComponent], imports: [CommonModule, ReactiveFormsModule, CheckboxModule], exports: [PTCheckBoxInputComponent] }); }
1459
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCheckBoxInputModule, imports: [CommonModule, ReactiveFormsModule, CheckboxModule] }); }
1460
+ }
1461
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCheckBoxInputModule, decorators: [{
1462
+ type: NgModule,
1463
+ args: [{
1464
+ declarations: [PTCheckBoxInputComponent],
1465
+ imports: [CommonModule, ReactiveFormsModule, CheckboxModule],
1466
+ exports: [PTCheckBoxInputComponent],
1467
+ }]
1468
+ }] });
1469
+
1470
+ class PTNumberInputModule {
1471
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNumberInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1472
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTNumberInputModule, declarations: [PTNumberInputComponent], imports: [CommonModule,
1473
+ ReactiveFormsModule,
1474
+ FormsModule,
1475
+ InputGroupModule,
1476
+ InputGroupAddonModule,
1477
+ InputTextModule,
1478
+ InputNumberModule], exports: [PTNumberInputComponent] }); }
1479
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNumberInputModule, imports: [CommonModule,
1480
+ ReactiveFormsModule,
1481
+ FormsModule,
1482
+ InputGroupModule,
1483
+ InputGroupAddonModule,
1484
+ InputTextModule,
1485
+ InputNumberModule] }); }
1486
+ }
1487
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNumberInputModule, decorators: [{
1488
+ type: NgModule,
1489
+ args: [{
1490
+ declarations: [PTNumberInputComponent],
1491
+ imports: [
1492
+ CommonModule,
1493
+ ReactiveFormsModule,
1494
+ FormsModule,
1495
+ InputGroupModule,
1496
+ InputGroupAddonModule,
1497
+ InputTextModule,
1498
+ InputNumberModule,
1499
+ ],
1500
+ exports: [PTNumberInputComponent],
1501
+ }]
1502
+ }] });
1503
+
1504
+ class PTSwitchInputModule {
1505
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSwitchInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1506
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTSwitchInputModule, declarations: [PTSwitchInputComponent], imports: [CommonModule, ReactiveFormsModule, InputSwitchModule], exports: [PTSwitchInputComponent] }); }
1507
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSwitchInputModule, imports: [CommonModule, ReactiveFormsModule, InputSwitchModule] }); }
1508
+ }
1509
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSwitchInputModule, decorators: [{
1510
+ type: NgModule,
1511
+ args: [{
1512
+ declarations: [PTSwitchInputComponent],
1513
+ imports: [CommonModule, ReactiveFormsModule, InputSwitchModule],
1514
+ exports: [PTSwitchInputComponent],
1515
+ }]
1516
+ }] });
1517
+
1518
+ class PTTextInputModule {
1519
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1520
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTTextInputModule, declarations: [PTTextInputComponent], imports: [CommonModule,
1521
+ ReactiveFormsModule,
1522
+ InputTextModule,
1523
+ IconFieldModule,
1524
+ InputIconModule], exports: [PTTextInputComponent] }); }
1525
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextInputModule, imports: [CommonModule,
1526
+ ReactiveFormsModule,
1527
+ InputTextModule,
1528
+ IconFieldModule,
1529
+ InputIconModule] }); }
1530
+ }
1531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextInputModule, decorators: [{
1532
+ type: NgModule,
1533
+ args: [{
1534
+ declarations: [PTTextInputComponent],
1535
+ imports: [
1536
+ CommonModule,
1537
+ ReactiveFormsModule,
1538
+ InputTextModule,
1539
+ IconFieldModule,
1540
+ InputIconModule,
1541
+ ],
1542
+ exports: [PTTextInputComponent],
1543
+ }]
1544
+ }] });
1545
+
1546
+ class PTTextAreaInputModule {
1547
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextAreaInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1548
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTTextAreaInputModule, declarations: [PTTextAreaInputComponent], imports: [CommonModule,
1549
+ ReactiveFormsModule,
1550
+ InputTextareaModule,
1551
+ InputGroupModule,
1552
+ InputGroupAddonModule], exports: [PTTextAreaInputComponent] }); }
1553
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextAreaInputModule, imports: [CommonModule,
1554
+ ReactiveFormsModule,
1555
+ InputTextareaModule,
1556
+ InputGroupModule,
1557
+ InputGroupAddonModule] }); }
1558
+ }
1559
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextAreaInputModule, decorators: [{
1560
+ type: NgModule,
1561
+ args: [{
1562
+ declarations: [PTTextAreaInputComponent],
1563
+ imports: [
1564
+ CommonModule,
1565
+ ReactiveFormsModule,
1566
+ InputTextareaModule,
1567
+ InputGroupModule,
1568
+ InputGroupAddonModule,
1569
+ ],
1570
+ exports: [PTTextAreaInputComponent],
1571
+ }]
1572
+ }] });
1573
+
1574
+ class PTDateInputModule {
1575
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDateInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1576
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTDateInputModule, declarations: [PTDateInputComponent], imports: [CommonModule, ReactiveFormsModule, CalendarModule], exports: [PTDateInputComponent] }); }
1577
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDateInputModule, imports: [CommonModule, ReactiveFormsModule, CalendarModule] }); }
1578
+ }
1579
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDateInputModule, decorators: [{
1580
+ type: NgModule,
1581
+ args: [{
1582
+ declarations: [PTDateInputComponent],
1583
+ imports: [CommonModule, ReactiveFormsModule, CalendarModule],
1584
+ exports: [PTDateInputComponent],
1585
+ }]
1586
+ }] });
1587
+
1588
+ class PTDropdownModule {
1589
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1590
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTDropdownModule, declarations: [PTDropdownComponent], imports: [CommonModule, ReactiveFormsModule, DropdownModule], exports: [PTDropdownComponent] }); }
1591
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDropdownModule, imports: [CommonModule, ReactiveFormsModule, DropdownModule] }); }
1592
+ }
1593
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDropdownModule, decorators: [{
1594
+ type: NgModule,
1595
+ args: [{
1596
+ declarations: [PTDropdownComponent],
1597
+ imports: [CommonModule, ReactiveFormsModule, DropdownModule],
1598
+ exports: [PTDropdownComponent],
1599
+ }]
1600
+ }] });
1601
+
1602
+ class PTMultiSelectModule {
1603
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMultiSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1604
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTMultiSelectModule, declarations: [PTMultiSelectComponent], imports: [CommonModule, ReactiveFormsModule, MultiSelectModule], exports: [PTMultiSelectComponent] }); }
1605
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMultiSelectModule, imports: [CommonModule, ReactiveFormsModule, MultiSelectModule] }); }
1606
+ }
1607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMultiSelectModule, decorators: [{
1608
+ type: NgModule,
1609
+ args: [{
1610
+ declarations: [PTMultiSelectComponent],
1611
+ imports: [CommonModule, ReactiveFormsModule, MultiSelectModule],
1612
+ exports: [PTMultiSelectComponent],
1613
+ }]
1614
+ }] });
1615
+
1616
+ class PTDynamicFormFieldModule {
1617
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDynamicFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1618
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTDynamicFormFieldModule, declarations: [PTDynamicFormFieldComponent], imports: [CommonModule,
1619
+ ReactiveFormsModule,
1620
+ // Inputs
1621
+ PTCheckBoxInputModule,
1622
+ PTDateInputModule,
1623
+ PTNumberInputModule,
1624
+ PTSwitchInputModule,
1625
+ PTTextAreaInputModule,
1626
+ PTTextInputModule,
1627
+ PTDropdownModule,
1628
+ PTMultiSelectModule], exports: [PTDynamicFormFieldComponent] }); }
1629
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDynamicFormFieldModule, imports: [CommonModule,
1630
+ ReactiveFormsModule,
1631
+ // Inputs
1632
+ PTCheckBoxInputModule,
1633
+ PTDateInputModule,
1634
+ PTNumberInputModule,
1635
+ PTSwitchInputModule,
1636
+ PTTextAreaInputModule,
1637
+ PTTextInputModule,
1638
+ PTDropdownModule,
1639
+ PTMultiSelectModule] }); }
1640
+ }
1641
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDynamicFormFieldModule, decorators: [{
1642
+ type: NgModule,
1643
+ args: [{
1644
+ declarations: [PTDynamicFormFieldComponent],
1645
+ imports: [
1646
+ CommonModule,
1647
+ ReactiveFormsModule,
1648
+ // Inputs
1649
+ PTCheckBoxInputModule,
1650
+ PTDateInputModule,
1651
+ PTNumberInputModule,
1652
+ PTSwitchInputModule,
1653
+ PTTextAreaInputModule,
1654
+ PTTextInputModule,
1655
+ PTDropdownModule,
1656
+ PTMultiSelectModule,
1657
+ ],
1658
+ exports: [PTDynamicFormFieldComponent],
1659
+ }]
1660
+ }] });
1661
+
1662
+ class PTFormBuilderModule {
1663
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFormBuilderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1664
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTFormBuilderModule, declarations: [PTFormBuilderComponent], imports: [CommonModule,
1665
+ ReactiveFormsModule,
1666
+ ButtonModule,
1667
+ PTDynamicFormFieldModule], exports: [PTFormBuilderComponent] }); }
1668
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFormBuilderModule, imports: [CommonModule,
1669
+ ReactiveFormsModule,
1670
+ ButtonModule,
1671
+ PTDynamicFormFieldModule] }); }
1672
+ }
1673
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFormBuilderModule, decorators: [{
1674
+ type: NgModule,
1675
+ args: [{
1676
+ declarations: [PTFormBuilderComponent],
1677
+ imports: [
1678
+ CommonModule,
1679
+ ReactiveFormsModule,
1680
+ ButtonModule,
1681
+ PTDynamicFormFieldModule,
1682
+ ],
1683
+ exports: [PTFormBuilderComponent],
1684
+ }]
1685
+ }] });
1686
+
655
1687
  class NgPrimeToolsModule {
656
1688
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
657
1689
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, imports: [CommonModule,
658
1690
  FormsModule,
659
1691
  NgAdvancedPrimeTableModule,
660
- MultiSearchCriteriaModule], exports: [NgAdvancedPrimeTableModule, MultiSearchCriteriaModule] }); }
1692
+ MultiSearchCriteriaModule,
1693
+ // Inputs
1694
+ PTCheckBoxInputModule,
1695
+ PTDateInputModule,
1696
+ PTFormBuilderModule,
1697
+ PTNumberInputModule,
1698
+ PTSwitchInputModule,
1699
+ PTTextAreaInputModule,
1700
+ PTTextInputModule], exports: [NgAdvancedPrimeTableModule,
1701
+ MultiSearchCriteriaModule,
1702
+ // Inputs
1703
+ PTCheckBoxInputModule,
1704
+ PTDateInputModule,
1705
+ PTFormBuilderModule,
1706
+ PTNumberInputModule,
1707
+ PTSwitchInputModule,
1708
+ PTTextAreaInputModule,
1709
+ PTTextInputModule] }); }
661
1710
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, imports: [CommonModule,
662
1711
  FormsModule,
663
1712
  NgAdvancedPrimeTableModule,
664
- MultiSearchCriteriaModule, NgAdvancedPrimeTableModule, MultiSearchCriteriaModule] }); }
1713
+ MultiSearchCriteriaModule,
1714
+ // Inputs
1715
+ PTCheckBoxInputModule,
1716
+ PTDateInputModule,
1717
+ PTFormBuilderModule,
1718
+ PTNumberInputModule,
1719
+ PTSwitchInputModule,
1720
+ PTTextAreaInputModule,
1721
+ PTTextInputModule, NgAdvancedPrimeTableModule,
1722
+ MultiSearchCriteriaModule,
1723
+ // Inputs
1724
+ PTCheckBoxInputModule,
1725
+ PTDateInputModule,
1726
+ PTFormBuilderModule,
1727
+ PTNumberInputModule,
1728
+ PTSwitchInputModule,
1729
+ PTTextAreaInputModule,
1730
+ PTTextInputModule] }); }
665
1731
  }
666
1732
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, decorators: [{
667
1733
  type: NgModule,
@@ -671,23 +1737,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
671
1737
  FormsModule,
672
1738
  NgAdvancedPrimeTableModule,
673
1739
  MultiSearchCriteriaModule,
1740
+ // Inputs
1741
+ PTCheckBoxInputModule,
1742
+ PTDateInputModule,
1743
+ PTFormBuilderModule,
1744
+ PTNumberInputModule,
1745
+ PTSwitchInputModule,
1746
+ PTTextAreaInputModule,
1747
+ PTTextInputModule,
1748
+ ],
1749
+ exports: [
1750
+ NgAdvancedPrimeTableModule,
1751
+ MultiSearchCriteriaModule,
1752
+ // Inputs
1753
+ PTCheckBoxInputModule,
1754
+ PTDateInputModule,
1755
+ PTFormBuilderModule,
1756
+ PTNumberInputModule,
1757
+ PTSwitchInputModule,
1758
+ PTTextAreaInputModule,
1759
+ PTTextInputModule,
674
1760
  ],
675
- exports: [NgAdvancedPrimeTableModule, MultiSearchCriteriaModule],
676
1761
  }]
677
1762
  }] });
678
1763
 
679
- // projects/ng-prime-tools/src/lib/models/public_api.ts
680
-
681
1764
  /**
682
1765
  * Generated bundle index. Do not edit.
683
1766
  */
684
1767
  /// <amd-module name="ng-prime-tools/models" />
685
1768
 
686
- // projects/ng-prime-tools/src/public-api.ts
687
-
688
1769
  /**
689
1770
  * Generated bundle index. Do not edit.
690
1771
  */
691
1772
 
692
- export { MultiSearchCriteriaComponent, MultiSearchCriteriaModule, NgAdvancedPrimeTableComponent, NgAdvancedPrimeTableModule, NgPrimeToolsModule, SearchCriteriaTypeEnum, TableTypeEnum };
1773
+ export { ButtonColorEnum, FormInputTypeEnum, InputValidationEnum, MultiSearchCriteriaComponent, MultiSearchCriteriaModule, NgAdvancedPrimeTableComponent, NgAdvancedPrimeTableModule, NgPrimeToolsModule, PTCheckBoxInputComponent, PTCheckBoxInputModule, PTDateInputComponent, PTDateInputModule, PTDropdownComponent, PTDropdownModule, PTFormBuilderComponent, PTFormBuilderModule, PTNumberInputComponent, PTNumberInputModule, PTSwitchInputComponent, PTSwitchInputModule, PTTextAreaInputComponent, PTTextAreaInputModule, PTTextInputComponent, PTTextInputModule, SearchCriteriaTypeEnum, TableTypeEnum };
693
1774
  //# sourceMappingURL=ng-prime-tools.mjs.map