@sneat/components 0.1.3 → 0.1.4

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 (170) hide show
  1. package/esm2022/index.js +15 -0
  2. package/esm2022/index.js.map +1 -0
  3. package/esm2022/lib/app-version/app-version.component.js +16 -0
  4. package/esm2022/lib/app-version/app-version.component.js.map +1 -0
  5. package/esm2022/lib/app-version/build-info.js +5 -0
  6. package/esm2022/lib/app-version/build-info.js.map +1 -0
  7. package/esm2022/lib/app-version/index.js +3 -0
  8. package/esm2022/lib/app-version/index.js.map +1 -0
  9. package/esm2022/lib/card-list/index.js +2 -0
  10. package/esm2022/lib/card-list/index.js.map +1 -0
  11. package/esm2022/lib/card-list/sneat-card-list.component.js +106 -0
  12. package/esm2022/lib/card-list/sneat-card-list.component.js.map +1 -0
  13. package/esm2022/lib/copyright/copyright.component.js +11 -0
  14. package/esm2022/lib/copyright/copyright.component.js.map +1 -0
  15. package/esm2022/lib/copyright/index.js +2 -0
  16. package/esm2022/lib/copyright/index.js.map +1 -0
  17. package/esm2022/lib/country-input/country-input.component.js +59 -0
  18. package/esm2022/lib/country-input/country-input.component.js.map +1 -0
  19. package/esm2022/lib/country-input/index.js +2 -0
  20. package/esm2022/lib/country-input/index.js.map +1 -0
  21. package/esm2022/lib/country-selector/countries-loader.service.js +91 -0
  22. package/esm2022/lib/country-selector/countries-loader.service.js.map +1 -0
  23. package/esm2022/lib/country-selector/countries.js +22 -0
  24. package/esm2022/lib/country-selector/countries.js.map +1 -0
  25. package/esm2022/lib/country-selector/country-selector.component.js +103 -0
  26. package/esm2022/lib/country-selector/country-selector.component.js.map +1 -0
  27. package/esm2022/lib/country-selector/country-selector.service.js +15 -0
  28. package/esm2022/lib/country-selector/country-selector.service.js.map +1 -0
  29. package/esm2022/lib/country-selector/index.js +5 -0
  30. package/esm2022/lib/country-selector/index.js.map +1 -0
  31. package/esm2022/lib/date-input/date-input.component.js +70 -0
  32. package/esm2022/lib/date-input/date-input.component.js.map +1 -0
  33. package/esm2022/lib/date-input/date-modal.component.js +53 -0
  34. package/esm2022/lib/date-input/date-modal.component.js.map +1 -0
  35. package/esm2022/lib/dialog-header/dialog-header.component.js +23 -0
  36. package/esm2022/lib/dialog-header/dialog-header.component.js.map +1 -0
  37. package/esm2022/lib/dialog-header/index.js +2 -0
  38. package/esm2022/lib/dialog-header/index.js.map +1 -0
  39. package/esm2022/lib/error-card/index.js +2 -0
  40. package/esm2022/lib/error-card/index.js.map +1 -0
  41. package/esm2022/lib/error-card/sneat-error-card.component.js +23 -0
  42. package/esm2022/lib/error-card/sneat-error-card.component.js.map +1 -0
  43. package/esm2022/lib/filter-item/filter-item.component.js +37 -0
  44. package/esm2022/lib/filter-item/filter-item.component.js.map +1 -0
  45. package/esm2022/lib/filter-item/index.js +2 -0
  46. package/esm2022/lib/filter-item/index.js.map +1 -0
  47. package/esm2022/lib/pipes/country-emoji.pipe.js +69 -0
  48. package/esm2022/lib/pipes/country-emoji.pipe.js.map +1 -0
  49. package/esm2022/lib/pipes/decimal64p2.pipe.js +47 -0
  50. package/esm2022/lib/pipes/decimal64p2.pipe.js.map +1 -0
  51. package/esm2022/lib/pipes/gender.pipes.js +69 -0
  52. package/esm2022/lib/pipes/gender.pipes.js.map +1 -0
  53. package/esm2022/lib/pipes/index.js +7 -0
  54. package/esm2022/lib/pipes/index.js.map +1 -0
  55. package/esm2022/lib/pipes/long-month-name.pipe.js +41 -0
  56. package/esm2022/lib/pipes/long-month-name.pipe.js.map +1 -0
  57. package/esm2022/lib/pipes/short-month-name.pipe.js +31 -0
  58. package/esm2022/lib/pipes/short-month-name.pipe.js.map +1 -0
  59. package/esm2022/lib/pipes/team-emoji.pipe.js +31 -0
  60. package/esm2022/lib/pipes/team-emoji.pipe.js.map +1 -0
  61. package/esm2022/lib/save-event.js +2 -0
  62. package/esm2022/lib/save-event.js.map +1 -0
  63. package/esm2022/lib/user-country/user-country.component.js +136 -0
  64. package/esm2022/lib/user-country/user-country.component.js.map +1 -0
  65. package/esm2022/lib/virtual-slider/virtual-slider.js +83 -0
  66. package/esm2022/lib/virtual-slider/virtual-slider.js.map +1 -0
  67. package/esm2022/sneat-components.js +5 -0
  68. package/esm2022/sneat-components.js.map +1 -0
  69. package/lib/app-version/app-version.component.d.ts +9 -0
  70. package/lib/app-version/build-info.d.ts +4 -0
  71. package/lib/card-list/sneat-card-list.component.d.ts +43 -0
  72. package/lib/copyright/copyright.component.d.ts +5 -0
  73. package/lib/country-input/country-input.component.d.ts +16 -0
  74. package/lib/country-selector/countries-loader.service.d.ts +43 -0
  75. package/lib/country-selector/countries.d.ts +25 -0
  76. package/lib/country-selector/country-selector.component.d.ts +31 -0
  77. package/lib/country-selector/country-selector.service.d.ts +8 -0
  78. package/lib/date-input/date-input.component.d.ts +21 -0
  79. package/lib/date-input/date-modal.component.d.ts +13 -0
  80. package/lib/dialog-header/dialog-header.component.d.ts +8 -0
  81. package/lib/error-card/sneat-error-card.component.d.ts +8 -0
  82. package/lib/filter-item/filter-item.component.d.ts +13 -0
  83. package/lib/pipes/country-emoji.pipe.d.ts +29 -0
  84. package/lib/pipes/decimal64p2.pipe.d.ts +12 -0
  85. package/lib/pipes/gender.pipes.d.ts +20 -0
  86. package/lib/pipes/long-month-name.pipe.d.ts +7 -0
  87. package/lib/pipes/short-month-name.pipe.d.ts +8 -0
  88. package/lib/pipes/team-emoji.pipe.d.ts +8 -0
  89. package/lib/save-event.d.ts +5 -0
  90. package/lib/user-country/user-country.component.d.ts +24 -0
  91. package/lib/virtual-slider/virtual-slider.d.ts +13 -0
  92. package/package.json +14 -2
  93. package/sneat-components.d.ts +5 -0
  94. package/eslint.config.js +0 -7
  95. package/ng-package.json +0 -10
  96. package/project.json +0 -38
  97. package/src/assets/data/countries.json +0 -1730
  98. package/src/lib/app-version/app-version.component.html +0 -15
  99. package/src/lib/app-version/app-version.component.spec.ts +0 -25
  100. package/src/lib/app-version/app-version.component.ts +0 -17
  101. package/src/lib/app-version/build-info.ts +0 -8
  102. package/src/lib/card-list/sneat-card-list.component.html +0 -108
  103. package/src/lib/card-list/sneat-card-list.component.spec.ts +0 -131
  104. package/src/lib/card-list/sneat-card-list.component.ts +0 -125
  105. package/src/lib/copyright/copyright.component.html +0 -1
  106. package/src/lib/copyright/copyright.component.spec.ts +0 -24
  107. package/src/lib/copyright/copyright.component.ts +0 -7
  108. package/src/lib/country-input/country-input.component.html +0 -33
  109. package/src/lib/country-input/country-input.component.spec.ts +0 -84
  110. package/src/lib/country-input/country-input.component.ts +0 -76
  111. package/src/lib/country-selector/countries-loader.service.spec.ts +0 -149
  112. package/src/lib/country-selector/countries-loader.service.ts +0 -100
  113. package/src/lib/country-selector/countries.ts +0 -42
  114. package/src/lib/country-selector/country-selector.component.html +0 -24
  115. package/src/lib/country-selector/country-selector.component.spec.ts +0 -5
  116. package/src/lib/country-selector/country-selector.component.ts +0 -125
  117. package/src/lib/country-selector/country-selector.service.spec.ts +0 -23
  118. package/src/lib/country-selector/country-selector.service.ts +0 -11
  119. package/src/lib/date-input/date-input.component.html +0 -39
  120. package/src/lib/date-input/date-input.component.spec.ts +0 -179
  121. package/src/lib/date-input/date-input.component.ts +0 -97
  122. package/src/lib/date-input/date-modal.component.html +0 -23
  123. package/src/lib/date-input/date-modal.component.spec.ts +0 -105
  124. package/src/lib/date-input/date-modal.component.ts +0 -67
  125. package/src/lib/dialog-header/dialog-header.component.html +0 -8
  126. package/src/lib/dialog-header/dialog-header.component.spec.ts +0 -67
  127. package/src/lib/dialog-header/dialog-header.component.ts +0 -26
  128. package/src/lib/dismissable.ts +0 -6
  129. package/src/lib/error-card/sneat-error-card.component.html +0 -20
  130. package/src/lib/error-card/sneat-error-card.component.spec.ts +0 -49
  131. package/src/lib/error-card/sneat-error-card.component.ts +0 -28
  132. package/src/lib/filter-item/filter-item.component.html +0 -19
  133. package/src/lib/filter-item/filter-item.component.spec.ts +0 -83
  134. package/src/lib/filter-item/filter-item.component.ts +0 -47
  135. package/src/lib/pipes/country-emoji.pipe.spec.ts +0 -116
  136. package/src/lib/pipes/country-emoji.pipe.ts +0 -67
  137. package/src/lib/pipes/decimal64p2.pipe.spec.ts +0 -61
  138. package/src/lib/pipes/decimal64p2.pipe.ts +0 -35
  139. package/src/lib/pipes/gender.pipes.spec.ts +0 -84
  140. package/src/lib/pipes/gender.pipes.ts +0 -65
  141. package/src/lib/pipes/long-month-name.pipe.spec.ts +0 -36
  142. package/src/lib/pipes/long-month-name.pipe.ts +0 -35
  143. package/src/lib/pipes/short-month-name.pipe.spec.ts +0 -28
  144. package/src/lib/pipes/short-month-name.pipe.ts +0 -26
  145. package/src/lib/pipes/team-emoji.pipe.spec.ts +0 -27
  146. package/src/lib/pipes/team-emoji.pipe.ts +0 -26
  147. package/src/lib/save-event.ts +0 -5
  148. package/src/lib/test-ide-bug.ts +0 -24
  149. package/src/lib/user-country/user-country.component.html +0 -44
  150. package/src/lib/user-country/user-country.component.spec.ts +0 -136
  151. package/src/lib/user-country/user-country.component.ts +0 -172
  152. package/src/lib/virtual-slider/odd-even-virtual-slider.ts +0 -1
  153. package/src/lib/virtual-slider/virtual-slider.ts +0 -130
  154. package/src/lib/webstorm-type-err-demo.component.ts +0 -35
  155. package/src/test-setup.ts +0 -3
  156. package/tsconfig.json +0 -13
  157. package/tsconfig.lib.json +0 -19
  158. package/tsconfig.lib.prod.json +0 -7
  159. package/tsconfig.spec.json +0 -31
  160. package/vite.config.mts +0 -10
  161. /package/{src/index.ts → index.d.ts} +0 -0
  162. /package/{src/lib/app-version/index.ts → lib/app-version/index.d.ts} +0 -0
  163. /package/{src/lib/card-list/index.ts → lib/card-list/index.d.ts} +0 -0
  164. /package/{src/lib/copyright/index.ts → lib/copyright/index.d.ts} +0 -0
  165. /package/{src/lib/country-input/index.ts → lib/country-input/index.d.ts} +0 -0
  166. /package/{src/lib/country-selector/index.ts → lib/country-selector/index.d.ts} +0 -0
  167. /package/{src/lib/dialog-header/index.ts → lib/dialog-header/index.d.ts} +0 -0
  168. /package/{src/lib/error-card/index.ts → lib/error-card/index.d.ts} +0 -0
  169. /package/{src/lib/filter-item/index.ts → lib/filter-item/index.d.ts} +0 -0
  170. /package/{src/lib/pipes/index.ts → lib/pipes/index.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-selector.component.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/country-selector/country-selector.component.ts","../../../../../../libs/components/src/lib/country-selector/country-selector.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,KAAK,EAGL,MAAM,EACN,MAAM,GAEP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAe,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;;;AAOpE,MAAM,OAAO,wBAAwB;IALrC;QAMmB,oBAAe,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;QAE/C,eAAU,GAGvB;YACJ,EAAE,EAAE,EAAE,QAAQ,EAAE;YAChB,EAAE,EAAE,EAAE,MAAM,EAAE;YACd,EAAE,EAAE,EAAE,UAAU,EAAE;YAClB,EAAE,EAAE,EAAE,QAAQ,EAAE;SACjB,CAAC;QAMO,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QACjB,UAAK,GAAG,QAAQ,CAAC;QACjB,iBAAY,GAAG,KAAK,CAAC;QAEX,oBAAe,GAAG,IAAI,YAAY,EAAU,CAAC;QAE7C,WAAM,GAAG,MAAM,CAAS,EAAE,kDAAC,CAAC;QAC5B,cAAS,GAAG,MAAM,CAAiC,KAAK,qDAAC,CAAC;QAC1D,iBAAY,GAAG,MAAM,CAAsB,EAAE,wDAAC,CAAC;QAC/C,mBAAc,GAAG,MAAM,CAAuB,SAAS,0DAAC,CAAC;QAEzD,cAAS,GAAG,QAAQ,CAAyB,GAAG,EAAE;YACnE,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YACzC,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9B,OAAO,EAAE,CAAC,CAAC,sBAAsB;YACnC,CAAC;YAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,eAAe,GAA2B,MAAM;gBAClD,CAAC,CAAC,YAAY;gBACd,CAAC,CAAC,YAAY,CAAC,MAAM,CACjB,CAAC,CAAC,EAAE,EAAE,CACJ,IAAI,CAAC,SAAS,EAAE,KAAK,KAAK;oBAC1B,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,UAAU;wBAC9B,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC;4BACrC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;oBAC5C,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAe,CAAC,CACvD,CAAC;YACN,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC/C,eAAe,GAAG,CAAC,GAAG,eAAe,EAAE,IAAI,CAAC,cAAc,EAAG,CAAC,CAAC;YACjE,CAAC;YACD,OAAO,eAAe,CAAC;QACzB,CAAC,qDAAC,CAAC;QA2CgB,wBAAmB,GAAG,CACvC,IAAiB,EACjB,MAAc,EACd,EAAE;YACF,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACtC,MAAM,CAAC,GAAG,IAAgB,CAAC;YAC3B,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC;KACH;IAjDC,QAAQ;QACN,sBAAsB;QACtB,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;YACrD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YACxD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,+DAA+D;IAErD,SAAS;QACjB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IAES,eAAe,CAAC,MAAc;QACtC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED,WAAW,CAAC,OAAsB;QAChC,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACxE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,CAAC;QACD,IACE,OAAO,CAAC,kBAAkB,CAAC;YAC3B,CAAC,IAAI,CAAC,SAAS;YACf,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,gBAAgB,KAAK,IAAI,EAC9B,CAAC;YACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC;YACvC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IAES,eAAe,CAAC,KAAY;QACpC,IAAI,CAAC,SAAS,CAAC,GAAG,CACf,KAAqB,CAAC,MAAM,CAAC,KAAuC,CACtE,CAAC;IACJ,CAAC;8GA3FU,wBAAwB;kGAAxB,wBAAwB,4TCvBrC,6xBAwBA,2CDHY,WAAW,+VAAE,uBAAuB,8WAAE,UAAU,uJAAE,gBAAgB;;2FAEjE,wBAAwB;kBALpC,SAAS;+BACE,wBAAwB,WAEzB,CAAC,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,gBAAgB,CAAC;;sBAe5E,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAExB,KAAK;;sBAEL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBAEL,MAAM","sourcesContent":["import {\n Component,\n computed,\n EventEmitter,\n inject,\n Input,\n OnChanges,\n OnInit,\n Output,\n signal,\n SimpleChanges,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { IonSegment, IonSegmentButton } from '@ionic/angular/standalone';\nimport { ISelectItem, SelectFromListComponent } from '@sneat/ui';\nimport { GeoRegion, ICountry } from './countries';\nimport { CountriesLoaderService } from './countries-loader.service';\n\n@Component({\n selector: 'sneat-country-selector',\n templateUrl: './country-selector.component.html',\n imports: [FormsModule, SelectFromListComponent, IonSegment, IonSegmentButton],\n})\nexport class CountrySelectorComponent implements OnInit, OnChanges {\n private readonly countriesLoader = inject(CountriesLoaderService);\n\n protected readonly geoRegions: readonly {\n readonly id: string;\n title?: string;\n }[] = [\n { id: 'Europe' },\n { id: 'Asia' },\n { id: 'Americas' },\n { id: 'Africa' },\n ];\n\n @Input({ required: true }) countryID?: string;\n\n @Input() defaultCountryID?: string;\n\n @Input() readonly = false;\n @Input() disabled = false;\n @Input() label = 'search';\n @Input() canBeUnknown = false;\n\n @Output() readonly countryIDChange = new EventEmitter<string>();\n\n protected readonly filter = signal<string>('');\n protected readonly geoRegion = signal<GeoRegion | 'All' | 'Americas'>('All');\n protected readonly allCountries = signal<readonly ICountry[]>([]);\n protected readonly unknownCountry = signal<ICountry | undefined>(undefined);\n\n protected readonly countries = computed<readonly ISelectItem[]>(() => {\n const allCountries = this.allCountries();\n if (allCountries.length === 0) {\n return []; // Data not loaded yet\n }\n\n const filter = this.filter();\n let countriesToShow: readonly ISelectItem[] = filter\n ? allCountries\n : allCountries.filter(\n (c) =>\n this.geoRegion() === 'All' ||\n (this.geoRegion() === 'Americas' &&\n (c.geoRegions.includes('North America') ||\n c.geoRegions.includes('South America'))) ||\n c.geoRegions.includes(this.geoRegion() as GeoRegion),\n );\n if (this.canBeUnknown && this.unknownCountry()) {\n countriesToShow = [...countriesToShow, this.unknownCountry()!];\n }\n return countriesToShow;\n });\n\n ngOnInit(): void {\n // Load countries data\n this.countriesLoader.getCountries().then((countries) => {\n this.allCountries.set(countries);\n });\n this.countriesLoader.getUnknownCountry().then((unknown) => {\n this.unknownCountry.set(unknown);\n });\n }\n\n // protected geoRegion: GeoRegion | 'All' | 'Americas' = 'All';\n\n protected onChanged(): void {\n this.countryIDChange.emit(this.countryID);\n }\n\n protected onFilterChanged(filter: string): void {\n this.filter.set(filter);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['country'] && this.countryID === '--' && !this.canBeUnknown) {\n this.countryID = undefined;\n }\n if (\n changes['defaultCountryID'] &&\n !this.countryID &&\n this.defaultCountryID &&\n this.defaultCountryID !== '--'\n ) {\n this.countryID = this.defaultCountryID;\n this.countryIDChange.emit(this.countryID);\n }\n }\n\n protected onRegionChanged(event: Event): void {\n this.geoRegion.set(\n (event as CustomEvent).detail.value as GeoRegion | 'All' | 'Americas',\n );\n }\n\n protected readonly filterCountryByCode = (\n item: ISelectItem,\n filter: string,\n ) => {\n const f = filter.trim().toUpperCase();\n const c = item as ICountry;\n return c.id === f || c.id3.startsWith(f);\n };\n}\n","<sneat-select-from-list\n [value]=\"countryID || ''\"\n [isFilterable]=\"true\"\n [filterLabel]=\"label\"\n [label]=\"label\"\n [items]=\"countries()\"\n [(ngModel)]=\"countryID\"\n (ngModelChange)=\"onChanged()\"\n [isReadonly]=\"readonly\"\n [filterItem]=\"filterCountryByCode\"\n (filterChanged)=\"onFilterChanged($event)\"\n labelPlacement=\"start\"\n>\n @if (!countryID && !filter()) {\n <ion-segment [(ngModel)]=\"geoRegion\" (ionChange)=\"onRegionChanged($event)\">\n <ion-segment-button value=\"All\">All</ion-segment-button>\n @for (region of geoRegions; track region.id) {\n <ion-segment-button [value]=\"region.id\">\n <small>{{ region.id }}</small>\n </ion-segment-button>\n }\n </ion-segment>\n }\n</sneat-select-from-list>\n"]}
@@ -0,0 +1,15 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { SelectorBaseService } from '@sneat/ui';
3
+ import { CountrySelectorComponent } from './country-selector.component';
4
+ import * as i0 from "@angular/core";
5
+ export class CountrySelectorService extends SelectorBaseService {
6
+ constructor() {
7
+ super(CountrySelectorComponent);
8
+ }
9
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CountrySelectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
10
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CountrySelectorService }); }
11
+ }
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CountrySelectorService, decorators: [{
13
+ type: Injectable
14
+ }], ctorParameters: () => [] });
15
+ //# sourceMappingURL=country-selector.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-selector.service.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/country-selector/country-selector.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;;AAGxE,MAAM,OAAO,sBAAuB,SAAQ,mBAA6B;IACvE;QACE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAClC,CAAC;8GAHU,sBAAsB;kHAAtB,sBAAsB;;2FAAtB,sBAAsB;kBADlC,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\nimport { SelectorBaseService } from '@sneat/ui';\nimport { ICountry } from './countries';\nimport { CountrySelectorComponent } from './country-selector.component';\n\n@Injectable()\nexport class CountrySelectorService extends SelectorBaseService<ICountry> {\n constructor() {\n super(CountrySelectorComponent);\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export * from './country-selector.component';
2
+ export * from './country-selector.service';
3
+ export * from './countries';
4
+ export * from './countries-loader.service';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/country-selector/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './country-selector.component';\nexport * from './country-selector.service';\nexport * from './countries';\nexport * from './countries-loader.service';\n"]}
@@ -0,0 +1,70 @@
1
+ import { Component, computed, inject, input, Output, EventEmitter, signal, } from '@angular/core';
2
+ import { IonInput, IonLabel, IonButton, IonButtons, IonItem, PopoverController, IonIcon, IonSpinner, } from '@ionic/angular/standalone';
3
+ import { DateModalComponent } from './date-modal.component';
4
+ import * as i0 from "@angular/core";
5
+ export class DateInputComponent {
6
+ constructor() {
7
+ this.$label = input.required(...(ngDevMode ? [{ debugName: "$label" }] : []));
8
+ this.$value = input.required(...(ngDevMode ? [{ debugName: "$value" }] : []));
9
+ this.$max = input(...(ngDevMode ? [undefined, { debugName: "$max" }] : []));
10
+ this.$newValue = signal(undefined, ...(ngDevMode ? [{ debugName: "$newValue" }] : []));
11
+ this.$displayValue = computed(() => this.$updating() ? this.$newValue() : this.$value(), ...(ngDevMode ? [{ debugName: "$displayValue" }] : []));
12
+ this.$updating = input(...(ngDevMode ? [undefined, { debugName: "$updating" }] : []));
13
+ this.valueChange = new EventEmitter();
14
+ this.$noValueLabel = input(...(ngDevMode ? [undefined, { debugName: "$noValueLabel" }] : []));
15
+ this.$noValueText = computed(() => this.$noValueLabel() || '(not set)', ...(ngDevMode ? [{ debugName: "$noValueText" }] : []));
16
+ this.$noValueButtonColor = input(...(ngDevMode ? [undefined, { debugName: "$noValueButtonColor" }] : []));
17
+ this.popoverCtrl = inject(PopoverController);
18
+ }
19
+ onValueChanged(event) {
20
+ const newValue = event.detail.value;
21
+ // console.log('onValueChanged', newValue);
22
+ this.$newValue.set(newValue);
23
+ }
24
+ save(event) {
25
+ event.preventDefault();
26
+ event.stopPropagation();
27
+ this.valueChange.emit(this.$newValue());
28
+ }
29
+ async openDatePicker(event) {
30
+ event.stopPropagation();
31
+ event.preventDefault();
32
+ const popover = await this.popoverCtrl.create({
33
+ reference: 'trigger',
34
+ event,
35
+ side: 'bottom',
36
+ alignment: 'center',
37
+ component: DateModalComponent,
38
+ componentProps: {
39
+ title: this.$label(),
40
+ max: this.$max(),
41
+ },
42
+ });
43
+ popover.onDidDismiss().then((eventDetail) => {
44
+ // console.log(`Selected "${this.$label()}":`, eventDetail.data);
45
+ const value = eventDetail.data;
46
+ if (value !== undefined) {
47
+ this.$newValue.set(value || '');
48
+ this.valueChange.emit(eventDetail.data);
49
+ }
50
+ });
51
+ await popover.present();
52
+ }
53
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DateInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
54
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: DateInputComponent, isStandalone: true, selector: "sneat-date-input", inputs: { $label: { classPropertyName: "$label", publicName: "$label", isSignal: true, isRequired: true, transformFunction: null }, $value: { classPropertyName: "$value", publicName: "$value", isSignal: true, isRequired: true, transformFunction: null }, $max: { classPropertyName: "$max", publicName: "$max", isSignal: true, isRequired: false, transformFunction: null }, $updating: { classPropertyName: "$updating", publicName: "$updating", isSignal: true, isRequired: false, transformFunction: null }, $noValueLabel: { classPropertyName: "$noValueLabel", publicName: "$noValueLabel", isSignal: true, isRequired: false, transformFunction: null }, $noValueButtonColor: { classPropertyName: "$noValueButtonColor", publicName: "$noValueButtonColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, providers: [PopoverController], ngImport: i0, template: "<ion-item class=\"sneat-tiny-end-padding\" lines=\"none\">\n @let displayValue = $displayValue();\n\n <ion-input\n [label]=\"$label()\"\n type=\"date\"\n [readonly]=\"$value() === undefined || $updating()\"\n [value]=\"displayValue\"\n (ionChange)=\"onValueChanged($event)\"\n />\n\n @if ($value() !== undefined || $newValue()) {\n <ion-buttons slot=\"end\">\n @if ($updating()) {\n <ion-button disabled=\"true\" (click)=\"openDatePicker($event)\">\n <ion-spinner name=\"lines-small\" slot=\"start\" />\n <ion-label>Saving...</ion-label>\n </ion-button>\n } @else if ($newValue() !== undefined && $newValue() !== $value()) {\n <ion-button color=\"danger\" fill=\"solid\" (click)=\"save($event)\">\n <ion-icon name=\"save-outline\" slot=\"start\" />\n <ion-label>Save</ion-label>\n </ion-button>\n } @else if ($value()) {\n <ion-button color=\"medium\" (click)=\"openDatePicker($event)\">\n <ion-icon name=\"chevron-down-outline\" slot=\"start\" />\n </ion-button>\n } @else {\n <ion-button\n fill=\"solid\"\n [color]=\"$noValueButtonColor() || 'danger'\"\n (click)=\"openDatePicker($event)\"\n >\n <ion-label>Add</ion-label>\n </ion-button>\n }\n </ion-buttons>\n }\n</ion-item>\n", dependencies: [{ kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }] }); }
55
+ }
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DateInputComponent, decorators: [{
57
+ type: Component,
58
+ args: [{ selector: 'sneat-date-input', imports: [
59
+ IonItem,
60
+ IonInput,
61
+ IonLabel,
62
+ IonButtons,
63
+ IonButton,
64
+ IonIcon,
65
+ IonSpinner,
66
+ ], providers: [PopoverController], template: "<ion-item class=\"sneat-tiny-end-padding\" lines=\"none\">\n @let displayValue = $displayValue();\n\n <ion-input\n [label]=\"$label()\"\n type=\"date\"\n [readonly]=\"$value() === undefined || $updating()\"\n [value]=\"displayValue\"\n (ionChange)=\"onValueChanged($event)\"\n />\n\n @if ($value() !== undefined || $newValue()) {\n <ion-buttons slot=\"end\">\n @if ($updating()) {\n <ion-button disabled=\"true\" (click)=\"openDatePicker($event)\">\n <ion-spinner name=\"lines-small\" slot=\"start\" />\n <ion-label>Saving...</ion-label>\n </ion-button>\n } @else if ($newValue() !== undefined && $newValue() !== $value()) {\n <ion-button color=\"danger\" fill=\"solid\" (click)=\"save($event)\">\n <ion-icon name=\"save-outline\" slot=\"start\" />\n <ion-label>Save</ion-label>\n </ion-button>\n } @else if ($value()) {\n <ion-button color=\"medium\" (click)=\"openDatePicker($event)\">\n <ion-icon name=\"chevron-down-outline\" slot=\"start\" />\n </ion-button>\n } @else {\n <ion-button\n fill=\"solid\"\n [color]=\"$noValueButtonColor() || 'danger'\"\n (click)=\"openDatePicker($event)\"\n >\n <ion-label>Add</ion-label>\n </ion-button>\n }\n </ion-buttons>\n }\n</ion-item>\n" }]
67
+ }], propDecorators: { $label: [{ type: i0.Input, args: [{ isSignal: true, alias: "$label", required: true }] }], $value: [{ type: i0.Input, args: [{ isSignal: true, alias: "$value", required: true }] }], $max: [{ type: i0.Input, args: [{ isSignal: true, alias: "$max", required: false }] }], $updating: [{ type: i0.Input, args: [{ isSignal: true, alias: "$updating", required: false }] }], valueChange: [{
68
+ type: Output
69
+ }], $noValueLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "$noValueLabel", required: false }] }], $noValueButtonColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "$noValueButtonColor", required: false }] }] } });
70
+ //# sourceMappingURL=date-input.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-input.component.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/date-input/date-input.component.ts","../../../../../../libs/components/src/lib/date-input/date-input.component.html"],"names":[],"mappings":"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","sourcesContent":["import {\n Component,\n computed,\n inject,\n input,\n Output,\n EventEmitter,\n signal,\n} from '@angular/core';\nimport {\n IonInput,\n IonLabel,\n IonButton,\n IonButtons,\n IonItem,\n PopoverController,\n IonIcon,\n IonSpinner,\n} from '@ionic/angular/standalone';\nimport { DateModalComponent } from './date-modal.component';\n\n@Component({\n selector: 'sneat-date-input',\n templateUrl: 'date-input.component.html',\n imports: [\n IonItem,\n IonInput,\n IonLabel,\n IonButtons,\n IonButton,\n IonIcon,\n IonSpinner,\n ],\n providers: [PopoverController],\n})\nexport class DateInputComponent {\n public readonly $label = input.required<string>();\n public readonly $value = input.required<string | undefined>();\n public readonly $max = input<string>();\n\n public readonly $newValue = signal<string | undefined>(undefined);\n\n public readonly $displayValue = computed(() =>\n this.$updating() ? this.$newValue() : this.$value(),\n );\n\n public readonly $updating = input<boolean>();\n\n @Output() public valueChange = new EventEmitter<string | undefined>();\n\n public readonly $noValueLabel = input<string>();\n\n protected readonly $noValueText = computed(\n () => this.$noValueLabel() || '(not set)',\n );\n\n protected readonly $noValueButtonColor = input<string>();\n\n protected readonly popoverCtrl = inject(PopoverController);\n\n protected onValueChanged(event: CustomEvent): void {\n const newValue = event.detail.value as string;\n // console.log('onValueChanged', newValue);\n this.$newValue.set(newValue);\n }\n\n protected save(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.valueChange.emit(this.$newValue());\n }\n\n protected async openDatePicker(event: Event): Promise<void> {\n event.stopPropagation();\n event.preventDefault();\n const popover = await this.popoverCtrl.create({\n reference: 'trigger',\n event,\n side: 'bottom',\n alignment: 'center',\n component: DateModalComponent,\n componentProps: {\n title: this.$label(),\n max: this.$max(),\n },\n });\n popover.onDidDismiss().then((eventDetail) => {\n // console.log(`Selected \"${this.$label()}\":`, eventDetail.data);\n const value = eventDetail.data as string | undefined;\n if (value !== undefined) {\n this.$newValue.set(value || '');\n this.valueChange.emit(eventDetail.data as string | undefined);\n }\n });\n await popover.present();\n }\n}\n","<ion-item class=\"sneat-tiny-end-padding\" lines=\"none\">\n @let displayValue = $displayValue();\n\n <ion-input\n [label]=\"$label()\"\n type=\"date\"\n [readonly]=\"$value() === undefined || $updating()\"\n [value]=\"displayValue\"\n (ionChange)=\"onValueChanged($event)\"\n />\n\n @if ($value() !== undefined || $newValue()) {\n <ion-buttons slot=\"end\">\n @if ($updating()) {\n <ion-button disabled=\"true\" (click)=\"openDatePicker($event)\">\n <ion-spinner name=\"lines-small\" slot=\"start\" />\n <ion-label>Saving...</ion-label>\n </ion-button>\n } @else if ($newValue() !== undefined && $newValue() !== $value()) {\n <ion-button color=\"danger\" fill=\"solid\" (click)=\"save($event)\">\n <ion-icon name=\"save-outline\" slot=\"start\" />\n <ion-label>Save</ion-label>\n </ion-button>\n } @else if ($value()) {\n <ion-button color=\"medium\" (click)=\"openDatePicker($event)\">\n <ion-icon name=\"chevron-down-outline\" slot=\"start\" />\n </ion-button>\n } @else {\n <ion-button\n fill=\"solid\"\n [color]=\"$noValueButtonColor() || 'danger'\"\n (click)=\"openDatePicker($event)\"\n >\n <ion-label>Add</ion-label>\n </ion-button>\n }\n </ion-buttons>\n }\n</ion-item>\n"]}
@@ -0,0 +1,53 @@
1
+ import { Component, inject, Input, signal, ChangeDetectionStrategy, } from '@angular/core';
2
+ import { IonButton, IonButtons, IonContent, IonDatetime, IonHeader, IonLabel, IonTitle, IonToolbar, PopoverController, } from '@ionic/angular/standalone';
3
+ import { ClassName, SneatBaseComponent } from '@sneat/ui';
4
+ import * as i0 from "@angular/core";
5
+ export class DateModalComponent extends SneatBaseComponent {
6
+ constructor() {
7
+ super();
8
+ this.popoverCtrl = inject(PopoverController);
9
+ this.$date = signal(undefined, ...(ngDevMode ? [{ debugName: "$date" }] : []));
10
+ }
11
+ onDateChanged(event) {
12
+ let { value } = event.detail;
13
+ if (value) {
14
+ value = value.slice(0, 10);
15
+ }
16
+ this.$date.set(value);
17
+ }
18
+ dismiss() {
19
+ this.popoverCtrl
20
+ .dismiss(this.$date())
21
+ .catch(this.errorLogger.logErrorHandler('failed to dismiss date modal'));
22
+ }
23
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DateModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
24
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: DateModalComponent, isStandalone: true, selector: "sneat-contact-dob-modal", inputs: { title: "title", max: "max" }, providers: [
25
+ {
26
+ provide: ClassName,
27
+ useValue: 'DateModalComponent',
28
+ },
29
+ ], usesInheritance: true, ngImport: i0, template: "<ion-header>\n <ion-toolbar>\n <ion-title>{{ title }}</ion-title>\n <ion-buttons slot=\"end\">\n <ion-button\n (click)=\"dismiss()\"\n [disabled]=\"!$date()\"\n [color]=\"$date() ? 'primary' : undefined\"\n [fill]=\"$date() ? 'solid' : undefined\"\n >\n <ion-label>Set</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content>\n <ion-datetime\n [value]=\"$date()\"\n [max]=\"max\"\n (ionChange)=\"onDateChanged($event)\"\n presentation=\"date\"\n />\n</ion-content>\n", dependencies: [{ kind: "component", type: IonDatetime, selector: "ion-datetime", inputs: ["cancelText", "clearText", "color", "dayValues", "disabled", "doneText", "firstDayOfWeek", "formatOptions", "highlightedDates", "hourCycle", "hourValues", "isDateEnabled", "locale", "max", "min", "minuteValues", "mode", "monthValues", "multiple", "name", "preferWheel", "presentation", "readonly", "showAdjacentDays", "showClearButton", "showDefaultButtons", "showDefaultTimeLabel", "showDefaultTitle", "size", "titleSelectedDatesFormatter", "value", "yearValues"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
30
+ }
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DateModalComponent, decorators: [{
32
+ type: Component,
33
+ args: [{ imports: [
34
+ IonDatetime,
35
+ IonHeader,
36
+ IonToolbar,
37
+ IonTitle,
38
+ IonContent,
39
+ IonButton,
40
+ IonButtons,
41
+ IonLabel,
42
+ ], providers: [
43
+ {
44
+ provide: ClassName,
45
+ useValue: 'DateModalComponent',
46
+ },
47
+ ], changeDetection: ChangeDetectionStrategy.OnPush, selector: 'sneat-contact-dob-modal', template: "<ion-header>\n <ion-toolbar>\n <ion-title>{{ title }}</ion-title>\n <ion-buttons slot=\"end\">\n <ion-button\n (click)=\"dismiss()\"\n [disabled]=\"!$date()\"\n [color]=\"$date() ? 'primary' : undefined\"\n [fill]=\"$date() ? 'solid' : undefined\"\n >\n <ion-label>Set</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content>\n <ion-datetime\n [value]=\"$date()\"\n [max]=\"max\"\n (ionChange)=\"onDateChanged($event)\"\n presentation=\"date\"\n />\n</ion-content>\n" }]
48
+ }], ctorParameters: () => [], propDecorators: { title: [{
49
+ type: Input
50
+ }], max: [{
51
+ type: Input
52
+ }] } });
53
+ //# sourceMappingURL=date-modal.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-modal.component.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/date-input/date-modal.component.ts","../../../../../../libs/components/src/lib/date-input/date-modal.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,KAAK,EACL,MAAM,EACN,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;;AAuB1D,MAAM,OAAO,kBAAmB,SAAQ,kBAAkB;IAIxD;QACE,KAAK,EAAE,CAAC;QAGF,gBAAW,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAE7B,UAAK,GAAG,MAAM,CAAqB,SAAS,iDAAC,CAAC;IAJjE,CAAC;IAMS,aAAa,CAAC,KAAkB;QACxC,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;QAC7B,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,GAAI,KAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAES,OAAO;QACf,IAAI,CAAC,WAAW;aACb,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;aACrB,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC7E,CAAC;8GAxBU,kBAAkB;kGAAlB,kBAAkB,8GAVlB;YACT;gBACE,OAAO,EAAE,SAAS;gBAClB,QAAQ,EAAE,oBAAoB;aAC/B;SACF,iDCpCH,kkBAuBA,4CDDI,WAAW,ohBACX,SAAS,oGACT,UAAU,mFACV,QAAQ,iFACR,UAAU,wKACV,SAAS,oPACT,UAAU,8EACV,QAAQ;;2FAYC,kBAAkB;kBArB9B,SAAS;8BACC;wBACP,WAAW;wBACX,SAAS;wBACT,UAAU;wBACV,QAAQ;wBACR,UAAU;wBACV,SAAS;wBACT,UAAU;wBACV,QAAQ;qBACT,aACU;wBACT;4BACE,OAAO,EAAE,SAAS;4BAClB,QAAQ,EAAE,oBAAoB;yBAC/B;qBACF,mBACgB,uBAAuB,CAAC,MAAM,YACrC,yBAAyB;;sBAIlC,KAAK;;sBACL,KAAK","sourcesContent":["import {\n Component,\n inject,\n Input,\n signal,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport {\n IonButton,\n IonButtons,\n IonContent,\n IonDatetime,\n IonHeader,\n IonLabel,\n IonTitle,\n IonToolbar,\n PopoverController,\n} from '@ionic/angular/standalone';\nimport { ClassName, SneatBaseComponent } from '@sneat/ui';\n\n@Component({\n imports: [\n IonDatetime,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonContent,\n IonButton,\n IonButtons,\n IonLabel,\n ],\n providers: [\n {\n provide: ClassName,\n useValue: 'DateModalComponent',\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'sneat-contact-dob-modal',\n templateUrl: 'date-modal.component.html',\n})\nexport class DateModalComponent extends SneatBaseComponent {\n @Input() title?: string;\n @Input() max?: string;\n\n public constructor() {\n super();\n }\n\n private popoverCtrl = inject(PopoverController);\n\n protected readonly $date = signal<string | undefined>(undefined);\n\n protected onDateChanged(event: CustomEvent): void {\n let { value } = event.detail;\n if (value) {\n value = (value as string).slice(0, 10);\n }\n this.$date.set(value);\n }\n\n protected dismiss(): void {\n this.popoverCtrl\n .dismiss(this.$date())\n .catch(this.errorLogger.logErrorHandler('failed to dismiss date modal'));\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-title>{{ title }}</ion-title>\n <ion-buttons slot=\"end\">\n <ion-button\n (click)=\"dismiss()\"\n [disabled]=\"!$date()\"\n [color]=\"$date() ? 'primary' : undefined\"\n [fill]=\"$date() ? 'solid' : undefined\"\n >\n <ion-label>Set</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content>\n <ion-datetime\n [value]=\"$date()\"\n [max]=\"max\"\n (ionChange)=\"onDateChanged($event)\"\n presentation=\"date\"\n />\n</ion-content>\n"]}
@@ -0,0 +1,23 @@
1
+ import { Component, Input, inject } from '@angular/core';
2
+ import { ModalController, IonButton, IonButtons, IonIcon, IonItem, IonLabel, } from '@ionic/angular/standalone';
3
+ import * as i0 from "@angular/core";
4
+ export class DialogHeaderComponent {
5
+ constructor() {
6
+ this.modalController = inject(ModalController);
7
+ this.dialogTitle = 'Dialog';
8
+ }
9
+ close(event) {
10
+ event.stopPropagation();
11
+ event.preventDefault();
12
+ this.modalController.dismiss().catch(console.error);
13
+ }
14
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DialogHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
15
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: DialogHeaderComponent, isStandalone: true, selector: "sneat-dialog-header", inputs: { dialogTitle: "dialogTitle" }, ngImport: i0, template: "<ion-item color=\"primary\" class=\"sneat-tiny-end-padding\">\n <ion-label>{{ dialogTitle }}</ion-label>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"close($event)\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n </ion-buttons>\n</ion-item>\n", dependencies: [{ kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }] }); }
16
+ }
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DialogHeaderComponent, decorators: [{
18
+ type: Component,
19
+ args: [{ selector: 'sneat-dialog-header', imports: [IonItem, IonLabel, IonButtons, IonButton, IonIcon], template: "<ion-item color=\"primary\" class=\"sneat-tiny-end-padding\">\n <ion-label>{{ dialogTitle }}</ion-label>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"close($event)\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n </ion-buttons>\n</ion-item>\n" }]
20
+ }], propDecorators: { dialogTitle: [{
21
+ type: Input
22
+ }] } });
23
+ //# sourceMappingURL=dialog-header.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-header.component.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/dialog-header/dialog-header.component.ts","../../../../../../libs/components/src/lib/dialog-header/dialog-header.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EACL,eAAe,EACf,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,QAAQ,GACT,MAAM,2BAA2B,CAAC;;AAOnC,MAAM,OAAO,qBAAqB;IALlC;QAMmB,oBAAe,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;QAElD,gBAAW,GAAG,QAAQ,CAAC;KAOjC;IALC,KAAK,CAAC,KAAY;QAChB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;8GATU,qBAAqB;kGAArB,qBAAqB,uHCflC,oRAQA,4CDKY,OAAO,0NAAE,QAAQ,6FAAE,UAAU,8EAAE,SAAS,oPAAE,OAAO;;2FAEhD,qBAAqB;kBALjC,SAAS;+BACE,qBAAqB,WAEtB,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC;;sBAK3D,KAAK","sourcesContent":["import { Component, Input, inject } from '@angular/core';\nimport {\n ModalController,\n IonButton,\n IonButtons,\n IonIcon,\n IonItem,\n IonLabel,\n} from '@ionic/angular/standalone';\n\n@Component({\n selector: 'sneat-dialog-header',\n templateUrl: './dialog-header.component.html',\n imports: [IonItem, IonLabel, IonButtons, IonButton, IonIcon],\n})\nexport class DialogHeaderComponent {\n private readonly modalController = inject(ModalController);\n\n @Input() dialogTitle = 'Dialog';\n\n close(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n this.modalController.dismiss().catch(console.error);\n }\n}\n","<ion-item color=\"primary\" class=\"sneat-tiny-end-padding\">\n <ion-label>{{ dialogTitle }}</ion-label>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"close($event)\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n </ion-buttons>\n</ion-item>\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './dialog-header.component';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/dialog-header/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC","sourcesContent":["export * from './dialog-header.component';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './sneat-error-card.component';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/error-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './sneat-error-card.component';\n"]}
@@ -0,0 +1,23 @@
1
+ import { JsonPipe } from '@angular/common';
2
+ import { Component, Input } from '@angular/core';
3
+ import { IonCard, IonCardContent, IonCardHeader, IonCardTitle, IonItem, IonTextarea, } from '@ionic/angular/standalone';
4
+ import * as i0 from "@angular/core";
5
+ export class SneatErrorCardComponent {
6
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SneatErrorCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: SneatErrorCardComponent, isStandalone: true, selector: "sneat-datatug-error-card", inputs: { error: "error" }, ngImport: i0, template: "<ion-card>\n <ion-card-header>\n <ion-card-title color=\"danger\">Error</ion-card-title>\n </ion-card-header>\n <ion-card-content>\n @if (error?.message) {\n <p>\n {{ error?.message }}\n </p>\n }\n <ion-item>\n <ion-textarea\n readonly=\"true\"\n [value]=\"error | json\"\n autoGrow=\"true\"\n color=\"medium\"\n />\n </ion-item>\n </ion-card-content>\n</ion-card>\n", dependencies: [{ kind: "component", type: IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonCardHeader, selector: "ion-card-header", inputs: ["color", "mode", "translucent"] }, { kind: "component", type: IonCardTitle, selector: "ion-card-title", inputs: ["color", "mode"] }, { kind: "component", type: IonCardContent, selector: "ion-card-content", inputs: ["mode"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonTextarea, selector: "ion-textarea", inputs: ["autoGrow", "autocapitalize", "autofocus", "clearOnEdit", "color", "cols", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "maxlength", "minlength", "mode", "name", "placeholder", "readonly", "required", "rows", "shape", "spellcheck", "value", "wrap"] }, { kind: "pipe", type: JsonPipe, name: "json" }] }); }
8
+ }
9
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SneatErrorCardComponent, decorators: [{
10
+ type: Component,
11
+ args: [{ selector: 'sneat-datatug-error-card', imports: [
12
+ IonCard,
13
+ IonCardHeader,
14
+ IonCardTitle,
15
+ IonCardContent,
16
+ IonItem,
17
+ IonTextarea,
18
+ JsonPipe,
19
+ ], template: "<ion-card>\n <ion-card-header>\n <ion-card-title color=\"danger\">Error</ion-card-title>\n </ion-card-header>\n <ion-card-content>\n @if (error?.message) {\n <p>\n {{ error?.message }}\n </p>\n }\n <ion-item>\n <ion-textarea\n readonly=\"true\"\n [value]=\"error | json\"\n autoGrow=\"true\"\n color=\"medium\"\n />\n </ion-item>\n </ion-card-content>\n</ion-card>\n" }]
20
+ }], propDecorators: { error: [{
21
+ type: Input
22
+ }] } });
23
+ //# sourceMappingURL=sneat-error-card.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sneat-error-card.component.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/error-card/sneat-error-card.component.ts","../../../../../../libs/components/src/lib/error-card/sneat-error-card.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACL,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,OAAO,EACP,WAAW,GACZ,MAAM,2BAA2B,CAAC;;AAenC,MAAM,OAAO,uBAAuB;8GAAvB,uBAAuB;kGAAvB,uBAAuB,gHCxBpC,0bAoBA,4CDLI,OAAO,yLACP,aAAa,sGACb,YAAY,sFACZ,cAAc,+EACd,OAAO,0NACP,WAAW,4ZACX,QAAQ;;2FAGC,uBAAuB;kBAbnC,SAAS;+BACE,0BAA0B,WAE3B;wBACP,OAAO;wBACP,aAAa;wBACb,YAAY;wBACZ,cAAc;wBACd,OAAO;wBACP,WAAW;wBACX,QAAQ;qBACT;;sBAGA,KAAK","sourcesContent":["import { JsonPipe } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport {\n IonCard,\n IonCardContent,\n IonCardHeader,\n IonCardTitle,\n IonItem,\n IonTextarea,\n} from '@ionic/angular/standalone';\n\n@Component({\n selector: 'sneat-datatug-error-card',\n templateUrl: './sneat-error-card.component.html',\n imports: [\n IonCard,\n IonCardHeader,\n IonCardTitle,\n IonCardContent,\n IonItem,\n IonTextarea,\n JsonPipe,\n ],\n})\nexport class SneatErrorCardComponent {\n @Input()\n error?: { message?: string };\n}\n","<ion-card>\n <ion-card-header>\n <ion-card-title color=\"danger\">Error</ion-card-title>\n </ion-card-header>\n <ion-card-content>\n @if (error?.message) {\n <p>\n {{ error?.message }}\n </p>\n }\n <ion-item>\n <ion-textarea\n readonly=\"true\"\n [value]=\"error | json\"\n autoGrow=\"true\"\n color=\"medium\"\n />\n </ion-item>\n </ion-card-content>\n</ion-card>\n"]}
@@ -0,0 +1,37 @@
1
+ import { ChangeDetectionStrategy, Component, EventEmitter, input, Output, } from '@angular/core';
2
+ import { IonButton, IonButtons, IonIcon, IonInput, IonItem, } from '@ionic/angular/standalone';
3
+ import * as i0 from "@angular/core";
4
+ export class FilterItemComponent {
5
+ constructor() {
6
+ this.$filter = input.required(...(ngDevMode ? [{ debugName: "$filter" }] : []));
7
+ this.changed = new EventEmitter();
8
+ this.blured = new EventEmitter();
9
+ }
10
+ clearFilter(event) {
11
+ event.stopPropagation();
12
+ event.preventDefault();
13
+ this.emitChanged('');
14
+ }
15
+ onFilterChanged(event) {
16
+ // console.log(`FilterItemComponent.onFilterChanged()`, event);
17
+ this.emitChanged(event.detail.value || '');
18
+ }
19
+ onBlured(event) {
20
+ this.blured.emit(event);
21
+ }
22
+ emitChanged(value) {
23
+ // console.log(`FilterItemComponent.emitChange(value=${value})`);
24
+ this.changed.emit(value);
25
+ }
26
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FilterItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
27
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: FilterItemComponent, isStandalone: true, selector: "sneat-filter-item", inputs: { $filter: { classPropertyName: "$filter", publicName: "$filter", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { changed: "changed", blured: "blured" }, ngImport: i0, template: "<ion-item class=\"with-buttons\" lines=\"none\">\n @if (!$filter()) {\n <ion-icon name=\"search-outline\" slot=\"start\" />\n }\n <ion-input\n [label]=\"$filter() ? 'Filter:' : ''\"\n placeholder=\"Filter\"\n [value]=\"$filter()\"\n (ionInput)=\"onFilterChanged($event)\"\n (ionBlur)=\"onBlured($event)\"\n />\n @if (!!$filter()) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"medium\" (click)=\"clearFilter($event)\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n </ion-buttons>\n }\n</ion-item>\n", dependencies: [{ kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
28
+ }
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FilterItemComponent, decorators: [{
30
+ type: Component,
31
+ args: [{ selector: 'sneat-filter-item', imports: [IonItem, IonIcon, IonInput, IonButtons, IonButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-item class=\"with-buttons\" lines=\"none\">\n @if (!$filter()) {\n <ion-icon name=\"search-outline\" slot=\"start\" />\n }\n <ion-input\n [label]=\"$filter() ? 'Filter:' : ''\"\n placeholder=\"Filter\"\n [value]=\"$filter()\"\n (ionInput)=\"onFilterChanged($event)\"\n (ionBlur)=\"onBlured($event)\"\n />\n @if (!!$filter()) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"medium\" (click)=\"clearFilter($event)\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n </ion-buttons>\n }\n</ion-item>\n" }]
32
+ }], propDecorators: { $filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "$filter", required: true }] }], changed: [{
33
+ type: Output
34
+ }], blured: [{
35
+ type: Output
36
+ }] } });
37
+ //# sourceMappingURL=filter-item.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-item.component.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/filter-item/filter-item.component.ts","../../../../../../libs/components/src/lib/filter-item/filter-item.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,YAAY,EACZ,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,QAAQ,EACR,OAAO,GACR,MAAM,2BAA2B,CAAC;;AAQnC,MAAM,OAAO,mBAAmB;IANhC;QAOkB,YAAO,GAAG,KAAK,CAAC,QAAQ,kDAAU,CAAC;QAEhC,YAAO,GAAG,IAAI,YAAY,EAAU,CAAC;QACrC,WAAM,GAAG,IAAI,YAAY,EAAS,CAAC;KAqBvD;IAnBW,WAAW,CAAC,KAAY;QAChC,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACvB,CAAC;IAES,eAAe,CAAC,KAAkB;QAC1C,+DAA+D;QAC/D,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IAES,QAAQ,CAAC,KAAY;QAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAEO,WAAW,CAAC,KAAa;QAC/B,iEAAiE;QACjE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;8GAxBU,mBAAmB;kGAAnB,mBAAmB,yQCrBhC,mjBAmBA,4CDDY,OAAO,0NAAE,OAAO,2JAAE,QAAQ,8eAAE,UAAU,8EAAE,SAAS;;2FAGhD,mBAAmB;kBAN/B,SAAS;+BACE,mBAAmB,WAEpB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,mBAC3C,uBAAuB,CAAC,MAAM;;sBAK9C,MAAM;;sBACN,MAAM","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n input,\n Output,\n} from '@angular/core';\nimport {\n IonButton,\n IonButtons,\n IonIcon,\n IonInput,\n IonItem,\n} from '@ionic/angular/standalone';\n\n@Component({\n selector: 'sneat-filter-item',\n templateUrl: './filter-item.component.html',\n imports: [IonItem, IonIcon, IonInput, IonButtons, IonButton],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FilterItemComponent {\n public readonly $filter = input.required<string>();\n\n @Output() readonly changed = new EventEmitter<string>();\n @Output() readonly blured = new EventEmitter<Event>();\n\n protected clearFilter(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n this.emitChanged('');\n }\n\n protected onFilterChanged(event: CustomEvent): void {\n // console.log(`FilterItemComponent.onFilterChanged()`, event);\n this.emitChanged(event.detail.value || '');\n }\n\n protected onBlured(event: Event): void {\n this.blured.emit(event);\n }\n\n private emitChanged(value: string): void {\n // console.log(`FilterItemComponent.emitChange(value=${value})`);\n this.changed.emit(value);\n }\n}\n","<ion-item class=\"with-buttons\" lines=\"none\">\n @if (!$filter()) {\n <ion-icon name=\"search-outline\" slot=\"start\" />\n }\n <ion-input\n [label]=\"$filter() ? 'Filter:' : ''\"\n placeholder=\"Filter\"\n [value]=\"$filter()\"\n (ionInput)=\"onFilterChanged($event)\"\n (ionBlur)=\"onBlured($event)\"\n />\n @if (!!$filter()) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"medium\" (click)=\"clearFilter($event)\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n </ion-buttons>\n }\n</ion-item>\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './filter-item.component';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/filter-item/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './filter-item.component';\n"]}
@@ -0,0 +1,69 @@
1
+ import { inject, Pipe } from '@angular/core';
2
+ import { CountriesLoaderService } from '../country-selector';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Base class for country-related pipes that need to cache country data.
6
+ */
7
+ class CountryDataPipe {
8
+ constructor() {
9
+ this.countriesLoader = inject(CountriesLoaderService);
10
+ this.isLoading = false;
11
+ this.loadError = false;
12
+ // Eagerly load countries data when pipe is created
13
+ this.loadCountriesData();
14
+ }
15
+ loadCountriesData() {
16
+ if (this.isLoading)
17
+ return;
18
+ this.isLoading = true;
19
+ this.countriesLoader
20
+ .getCountriesByID()
21
+ .then((countries) => {
22
+ this.countriesCache = Object.fromEntries(Object.entries(countries).map(([id, country]) => [
23
+ id,
24
+ { emoji: country.emoji, title: country.title },
25
+ ]));
26
+ })
27
+ .catch((error) => {
28
+ console.error('Failed to load countries data for pipe:', error);
29
+ this.loadError = true;
30
+ // Set empty cache to avoid repeated load attempts
31
+ this.countriesCache = {};
32
+ })
33
+ .finally(() => {
34
+ this.isLoading = false;
35
+ });
36
+ }
37
+ }
38
+ export const countryFlagEmoji = (countryID) => countryID && countryID !== '--' ? countryID : '';
39
+ export class CountryFlagPipe extends CountryDataPipe {
40
+ transform(countryID) {
41
+ if (!countryID || countryID === '--') {
42
+ return '';
43
+ }
44
+ // Return country emoji from cache if available, otherwise return countryID
45
+ return this.countriesCache?.[countryID]?.emoji || countryID;
46
+ }
47
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CountryFlagPipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
48
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: CountryFlagPipe, isStandalone: true, name: "countryFlag" }); }
49
+ }
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CountryFlagPipe, decorators: [{
51
+ type: Pipe,
52
+ args: [{ name: 'countryFlag' }]
53
+ }] });
54
+ export class CountryTitle extends CountryDataPipe {
55
+ transform(countryID) {
56
+ if (!countryID) {
57
+ return '';
58
+ }
59
+ // Return country title from cache if available, otherwise return countryID
60
+ return this.countriesCache?.[countryID]?.title || countryID;
61
+ }
62
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CountryTitle, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
63
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: CountryTitle, isStandalone: true, name: "countryTitle" }); }
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CountryTitle, decorators: [{
66
+ type: Pipe,
67
+ args: [{ name: 'countryTitle' }]
68
+ }] });
69
+ //# sourceMappingURL=country-emoji.pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-emoji.pipe.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/pipes/country-emoji.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;;AAE7D;;GAEG;AACH,MAAe,eAAe;IAM5B;QALmB,oBAAe,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;QAE1D,cAAS,GAAG,KAAK,CAAC;QAClB,cAAS,GAAG,KAAK,CAAC;QAG1B,mDAAmD;QACnD,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAEO,iBAAiB;QACvB,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO;QAC3B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,IAAI,CAAC,eAAe;aACjB,gBAAgB,EAAE;aAClB,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;YAClB,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,WAAW,CACtC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;gBAC/C,EAAE;gBACF,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE;aAC/C,CAAC,CACH,CAAC;QACJ,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;YAChE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,kDAAkD;YAClD,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QAC3B,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACZ,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAkB,EAAU,EAAE,CAC7D,SAAS,IAAI,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;AAGnD,MAAM,OAAO,eAAgB,SAAQ,eAAe;IAClD,SAAS,CAAC,SAAkB;QAC1B,IAAI,CAAC,SAAS,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACrC,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,2EAA2E;QAC3E,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,IAAI,SAAS,CAAC;IAC9D,CAAC;8GAPU,eAAe;4GAAf,eAAe;;2FAAf,eAAe;kBAD3B,IAAI;mBAAC,EAAE,IAAI,EAAE,aAAa,EAAE;;AAY7B,MAAM,OAAO,YAAa,SAAQ,eAAe;IAC/C,SAAS,CAAC,SAAkB;QAC1B,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,2EAA2E;QAC3E,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,IAAI,SAAS,CAAC;IAC9D,CAAC;8GAPU,YAAY;4GAAZ,YAAY;;2FAAZ,YAAY;kBADxB,IAAI;mBAAC,EAAE,IAAI,EAAE,cAAc,EAAE","sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { CountriesLoaderService } from '../country-selector';\n\n/**\n * Base class for country-related pipes that need to cache country data.\n */\nabstract class CountryDataPipe {\n protected readonly countriesLoader = inject(CountriesLoaderService);\n protected countriesCache?: Record<string, { emoji: string; title: string }>;\n protected isLoading = false;\n protected loadError = false;\n\n constructor() {\n // Eagerly load countries data when pipe is created\n this.loadCountriesData();\n }\n\n private loadCountriesData(): void {\n if (this.isLoading) return;\n this.isLoading = true;\n\n this.countriesLoader\n .getCountriesByID()\n .then((countries) => {\n this.countriesCache = Object.fromEntries(\n Object.entries(countries).map(([id, country]) => [\n id,\n { emoji: country.emoji, title: country.title },\n ]),\n );\n })\n .catch((error) => {\n console.error('Failed to load countries data for pipe:', error);\n this.loadError = true;\n // Set empty cache to avoid repeated load attempts\n this.countriesCache = {};\n })\n .finally(() => {\n this.isLoading = false;\n });\n }\n}\n\nexport const countryFlagEmoji = (countryID?: string): string =>\n countryID && countryID !== '--' ? countryID : '';\n\n@Pipe({ name: 'countryFlag' })\nexport class CountryFlagPipe extends CountryDataPipe implements PipeTransform {\n transform(countryID?: string): string {\n if (!countryID || countryID === '--') {\n return '';\n }\n // Return country emoji from cache if available, otherwise return countryID\n return this.countriesCache?.[countryID]?.emoji || countryID;\n }\n}\n\n@Pipe({ name: 'countryTitle' })\nexport class CountryTitle extends CountryDataPipe implements PipeTransform {\n transform(countryID?: string): string {\n if (!countryID) {\n return '';\n }\n // Return country title from cache if available, otherwise return countryID\n return this.countriesCache?.[countryID]?.title || countryID;\n }\n}\n"]}
@@ -0,0 +1,47 @@
1
+ import { Pipe } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class Decimal64p2Pipe {
4
+ constructor() {
5
+ this.transform = (value) => (value ? value / 100 : 0);
6
+ }
7
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Decimal64p2Pipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
8
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: Decimal64p2Pipe, isStandalone: true, name: "decimal64p2" }); }
9
+ }
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Decimal64p2Pipe, decorators: [{
11
+ type: Pipe,
12
+ args: [{ name: 'decimal64p2' }]
13
+ }] });
14
+ export class Numeral2Pipe {
15
+ constructor() {
16
+ this.transform = (value) => {
17
+ const s = value?.toString();
18
+ if (s?.endsWith('1')) {
19
+ return value + 'st';
20
+ }
21
+ if (s === '13' ||
22
+ s?.endsWith('4') ||
23
+ s?.endsWith('5') ||
24
+ s?.endsWith('6') ||
25
+ s?.endsWith('7') ||
26
+ s?.endsWith('8') ||
27
+ s?.endsWith('9') ||
28
+ s?.endsWith('0')) {
29
+ return value + 'th';
30
+ }
31
+ if (s?.endsWith('2')) {
32
+ return value + 'nd';
33
+ }
34
+ if (s?.endsWith('3')) {
35
+ return value + 'd';
36
+ }
37
+ return value;
38
+ };
39
+ }
40
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Numeral2Pipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
41
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: Numeral2Pipe, isStandalone: true, name: "numeral" }); }
42
+ }
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: Numeral2Pipe, decorators: [{
44
+ type: Pipe,
45
+ args: [{ name: 'numeral' }]
46
+ }] });
47
+ //# sourceMappingURL=decimal64p2.pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimal64p2.pipe.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/pipes/decimal64p2.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAGpD,MAAM,OAAO,eAAe;IAD5B;QAEW,cAAS,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACpE;8GAFY,eAAe;4GAAf,eAAe;;2FAAf,eAAe;kBAD3B,IAAI;mBAAC,EAAE,IAAI,EAAE,aAAa,EAAE;;AAM7B,MAAM,OAAO,YAAY;IADzB;QAEW,cAAS,GAAG,CAAC,KAAuB,EAAE,EAAE;YAC/C,MAAM,CAAC,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC;YAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB,OAAO,KAAK,GAAG,IAAI,CAAC;YACtB,CAAC;YACD,IACE,CAAC,KAAK,IAAI;gBACV,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC;gBAChB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC;gBAChB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC;gBAChB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC;gBAChB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC;gBAChB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC;gBAChB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,EAChB,CAAC;gBACD,OAAO,KAAK,GAAG,IAAI,CAAC;YACtB,CAAC;YACD,IAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB,OAAO,KAAK,GAAG,IAAI,CAAC;YACtB,CAAC;YACD,IAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB,OAAO,KAAK,GAAG,GAAG,CAAC;YACrB,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;KACH;8GA1BY,YAAY;4GAAZ,YAAY;;2FAAZ,YAAY;kBADxB,IAAI;mBAAC,EAAE,IAAI,EAAE,SAAS,EAAE","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'decimal64p2' })\nexport class Decimal64p2Pipe implements PipeTransform {\n readonly transform = (value?: number) => (value ? value / 100 : 0);\n}\n\n@Pipe({ name: 'numeral' })\nexport class Numeral2Pipe implements PipeTransform {\n readonly transform = (value?: number | string) => {\n const s = value?.toString();\n if (s?.endsWith('1')) {\n return value + 'st';\n }\n if (\n s === '13' ||\n s?.endsWith('4') ||\n s?.endsWith('5') ||\n s?.endsWith('6') ||\n s?.endsWith('7') ||\n s?.endsWith('8') ||\n s?.endsWith('9') ||\n s?.endsWith('0')\n ) {\n return value + 'th';\n }\n if (s?.endsWith('2')) {\n return value + 'nd';\n }\n if (s?.endsWith('3')) {\n return value + 'd';\n }\n return value;\n };\n}\n"]}
@@ -0,0 +1,69 @@
1
+ import { Pipe } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class GenderIconNamePipe {
4
+ transform(gender) {
5
+ switch (gender) {
6
+ case 'male':
7
+ return 'man-outline';
8
+ case 'female':
9
+ return 'woman-outline';
10
+ case 'other':
11
+ return 'person-circle-outline';
12
+ case 'unknown':
13
+ return 'person-outline';
14
+ case 'undisclosed':
15
+ return 'person';
16
+ }
17
+ return 'person-outline';
18
+ }
19
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GenderIconNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
20
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: GenderIconNamePipe, isStandalone: true, name: "genderIconName" }); }
21
+ }
22
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GenderIconNamePipe, decorators: [{
23
+ type: Pipe,
24
+ args: [{ name: 'genderIconName' }]
25
+ }] });
26
+ export class GenderEmojiPipe {
27
+ transform(gender) {
28
+ switch (gender) {
29
+ case 'male':
30
+ return 'man-outline';
31
+ case 'female':
32
+ return 'woman-outline';
33
+ }
34
+ return 'person-outline';
35
+ }
36
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GenderEmojiPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
37
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: GenderEmojiPipe, isStandalone: true, name: "genderEmoji" }); }
38
+ }
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GenderEmojiPipe, decorators: [{
40
+ type: Pipe,
41
+ args: [{ name: 'genderEmoji' }]
42
+ }] });
43
+ export function genderColor(gender) {
44
+ switch (gender) {
45
+ case 'male':
46
+ return 'primary';
47
+ case 'female':
48
+ return 'danger';
49
+ case 'other':
50
+ return 'warning';
51
+ case 'unknown':
52
+ return 'medium';
53
+ case 'undisclosed':
54
+ return 'medium';
55
+ }
56
+ return 'dark';
57
+ }
58
+ export class GenderColorPipe {
59
+ constructor() {
60
+ this.transform = genderColor;
61
+ }
62
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GenderColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
63
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: GenderColorPipe, isStandalone: true, name: "genderColor" }); }
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GenderColorPipe, decorators: [{
66
+ type: Pipe,
67
+ args: [{ name: 'genderColor' }]
68
+ }] });
69
+ //# sourceMappingURL=gender.pipes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gender.pipes.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/pipes/gender.pipes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAIpD,MAAM,OAAO,kBAAkB;IAC7B,SAAS,CAAC,MAAe;QACvB,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,MAAM;gBACT,OAAO,aAAa,CAAC;YACvB,KAAK,QAAQ;gBACX,OAAO,eAAe,CAAC;YACzB,KAAK,OAAO;gBACV,OAAO,uBAAuB,CAAC;YACjC,KAAK,SAAS;gBACZ,OAAO,gBAAgB,CAAC;YAC1B,KAAK,aAAa;gBAChB,OAAO,QAAQ,CAAC;QACpB,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;8GAfU,kBAAkB;4GAAlB,kBAAkB;;2FAAlB,kBAAkB;kBAD9B,IAAI;mBAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE;;AAoBhC,MAAM,OAAO,eAAe;IAC1B,SAAS,CAAC,MAAe;QACvB,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,MAAM;gBACT,OAAO,aAAa,CAAC;YACvB,KAAK,QAAQ;gBACX,OAAO,eAAe,CAAC;QAC3B,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;8GATU,eAAe;4GAAf,eAAe;;2FAAf,eAAe;kBAD3B,IAAI;mBAAC,EAAE,IAAI,EAAE,aAAa,EAAE;;AAuB7B,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,MAAM;YACT,OAAO,SAAS,CAAC;QACnB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB,KAAK,SAAS;YACZ,OAAO,QAAQ,CAAC;QAClB,KAAK,aAAa;YAChB,OAAO,QAAQ,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAGD,MAAM,OAAO,eAAe;IAD5B;QAEW,cAAS,GAAG,WAAW,CAAC;KAClC;8GAFY,eAAe;4GAAf,eAAe;;2FAAf,eAAe;kBAD3B,IAAI;mBAAC,EAAE,IAAI,EAAE,aAAa,EAAE","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { Gender } from '@sneat/core';\n\n@Pipe({ name: 'genderIconName' })\nexport class GenderIconNamePipe implements PipeTransform {\n transform(gender?: Gender): string {\n switch (gender) {\n case 'male':\n return 'man-outline';\n case 'female':\n return 'woman-outline';\n case 'other':\n return 'person-circle-outline';\n case 'unknown':\n return 'person-outline';\n case 'undisclosed':\n return 'person';\n }\n return 'person-outline';\n }\n}\n\n@Pipe({ name: 'genderEmoji' })\nexport class GenderEmojiPipe implements PipeTransform {\n transform(gender?: Gender): string {\n switch (gender) {\n case 'male':\n return 'man-outline';\n case 'female':\n return 'woman-outline';\n }\n return 'person-outline';\n }\n}\n\nexport type GenderColor =\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger'\n | 'dark'\n | 'medium';\n\nexport function genderColor(gender?: Gender): GenderColor {\n switch (gender) {\n case 'male':\n return 'primary';\n case 'female':\n return 'danger';\n case 'other':\n return 'warning';\n case 'unknown':\n return 'medium';\n case 'undisclosed':\n return 'medium';\n }\n return 'dark';\n}\n\n@Pipe({ name: 'genderColor' })\nexport class GenderColorPipe implements PipeTransform {\n readonly transform = genderColor;\n}\n"]}