@sneat/components 0.1.3 → 0.1.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 (171) 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/tsconfig.lib.prod.tsbuildinfo +1 -0
  95. package/eslint.config.js +0 -7
  96. package/ng-package.json +0 -10
  97. package/project.json +0 -38
  98. package/src/assets/data/countries.json +0 -1730
  99. package/src/lib/app-version/app-version.component.html +0 -15
  100. package/src/lib/app-version/app-version.component.spec.ts +0 -25
  101. package/src/lib/app-version/app-version.component.ts +0 -17
  102. package/src/lib/app-version/build-info.ts +0 -8
  103. package/src/lib/card-list/sneat-card-list.component.html +0 -108
  104. package/src/lib/card-list/sneat-card-list.component.spec.ts +0 -131
  105. package/src/lib/card-list/sneat-card-list.component.ts +0 -125
  106. package/src/lib/copyright/copyright.component.html +0 -1
  107. package/src/lib/copyright/copyright.component.spec.ts +0 -24
  108. package/src/lib/copyright/copyright.component.ts +0 -7
  109. package/src/lib/country-input/country-input.component.html +0 -33
  110. package/src/lib/country-input/country-input.component.spec.ts +0 -84
  111. package/src/lib/country-input/country-input.component.ts +0 -76
  112. package/src/lib/country-selector/countries-loader.service.spec.ts +0 -149
  113. package/src/lib/country-selector/countries-loader.service.ts +0 -100
  114. package/src/lib/country-selector/countries.ts +0 -42
  115. package/src/lib/country-selector/country-selector.component.html +0 -24
  116. package/src/lib/country-selector/country-selector.component.spec.ts +0 -5
  117. package/src/lib/country-selector/country-selector.component.ts +0 -125
  118. package/src/lib/country-selector/country-selector.service.spec.ts +0 -23
  119. package/src/lib/country-selector/country-selector.service.ts +0 -11
  120. package/src/lib/date-input/date-input.component.html +0 -39
  121. package/src/lib/date-input/date-input.component.spec.ts +0 -179
  122. package/src/lib/date-input/date-input.component.ts +0 -97
  123. package/src/lib/date-input/date-modal.component.html +0 -23
  124. package/src/lib/date-input/date-modal.component.spec.ts +0 -105
  125. package/src/lib/date-input/date-modal.component.ts +0 -67
  126. package/src/lib/dialog-header/dialog-header.component.html +0 -8
  127. package/src/lib/dialog-header/dialog-header.component.spec.ts +0 -67
  128. package/src/lib/dialog-header/dialog-header.component.ts +0 -26
  129. package/src/lib/dismissable.ts +0 -6
  130. package/src/lib/error-card/sneat-error-card.component.html +0 -20
  131. package/src/lib/error-card/sneat-error-card.component.spec.ts +0 -49
  132. package/src/lib/error-card/sneat-error-card.component.ts +0 -28
  133. package/src/lib/filter-item/filter-item.component.html +0 -19
  134. package/src/lib/filter-item/filter-item.component.spec.ts +0 -83
  135. package/src/lib/filter-item/filter-item.component.ts +0 -47
  136. package/src/lib/pipes/country-emoji.pipe.spec.ts +0 -116
  137. package/src/lib/pipes/country-emoji.pipe.ts +0 -67
  138. package/src/lib/pipes/decimal64p2.pipe.spec.ts +0 -61
  139. package/src/lib/pipes/decimal64p2.pipe.ts +0 -35
  140. package/src/lib/pipes/gender.pipes.spec.ts +0 -84
  141. package/src/lib/pipes/gender.pipes.ts +0 -65
  142. package/src/lib/pipes/long-month-name.pipe.spec.ts +0 -36
  143. package/src/lib/pipes/long-month-name.pipe.ts +0 -35
  144. package/src/lib/pipes/short-month-name.pipe.spec.ts +0 -28
  145. package/src/lib/pipes/short-month-name.pipe.ts +0 -26
  146. package/src/lib/pipes/team-emoji.pipe.spec.ts +0 -27
  147. package/src/lib/pipes/team-emoji.pipe.ts +0 -26
  148. package/src/lib/save-event.ts +0 -5
  149. package/src/lib/test-ide-bug.ts +0 -24
  150. package/src/lib/user-country/user-country.component.html +0 -44
  151. package/src/lib/user-country/user-country.component.spec.ts +0 -136
  152. package/src/lib/user-country/user-country.component.ts +0 -172
  153. package/src/lib/virtual-slider/odd-even-virtual-slider.ts +0 -1
  154. package/src/lib/virtual-slider/virtual-slider.ts +0 -130
  155. package/src/lib/webstorm-type-err-demo.component.ts +0 -35
  156. package/src/test-setup.ts +0 -3
  157. package/tsconfig.json +0 -13
  158. package/tsconfig.lib.json +0 -19
  159. package/tsconfig.lib.prod.json +0 -7
  160. package/tsconfig.spec.json +0 -31
  161. package/vite.config.mts +0 -10
  162. /package/{src/index.ts → index.d.ts} +0 -0
  163. /package/{src/lib/app-version/index.ts → lib/app-version/index.d.ts} +0 -0
  164. /package/{src/lib/card-list/index.ts → lib/card-list/index.d.ts} +0 -0
  165. /package/{src/lib/copyright/index.ts → lib/copyright/index.d.ts} +0 -0
  166. /package/{src/lib/country-input/index.ts → lib/country-input/index.d.ts} +0 -0
  167. /package/{src/lib/country-selector/index.ts → lib/country-selector/index.d.ts} +0 -0
  168. /package/{src/lib/dialog-header/index.ts → lib/dialog-header/index.d.ts} +0 -0
  169. /package/{src/lib/error-card/index.ts → lib/error-card/index.d.ts} +0 -0
  170. /package/{src/lib/filter-item/index.ts → lib/filter-item/index.d.ts} +0 -0
  171. /package/{src/lib/pipes/index.ts → lib/pipes/index.d.ts} +0 -0
@@ -0,0 +1,7 @@
1
+ export * from './gender.pipes';
2
+ export * from './team-emoji.pipe';
3
+ export * from './long-month-name.pipe';
4
+ export * from './short-month-name.pipe';
5
+ export * from './country-emoji.pipe';
6
+ export * from './decimal64p2.pipe';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/pipes/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './gender.pipes';\nexport * from './team-emoji.pipe';\nexport * from './long-month-name.pipe';\nexport * from './short-month-name.pipe';\nexport * from './country-emoji.pipe';\nexport * from './decimal64p2.pipe';\n"]}
@@ -0,0 +1,41 @@
1
+ import { Pipe } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class LongMonthNamePipe {
4
+ transform(month) {
5
+ switch (month) {
6
+ case 0:
7
+ return 'January';
8
+ case 1:
9
+ return 'February';
10
+ case 2:
11
+ return 'March';
12
+ case 3:
13
+ return 'April';
14
+ case 4:
15
+ return 'May';
16
+ case 5:
17
+ return 'June';
18
+ case 6:
19
+ return 'July';
20
+ case 7:
21
+ return 'August';
22
+ case 8:
23
+ return 'September';
24
+ case 9:
25
+ return 'October';
26
+ case 10:
27
+ return 'November';
28
+ case 11:
29
+ return 'December';
30
+ default:
31
+ return '' + month;
32
+ }
33
+ }
34
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LongMonthNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
35
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: LongMonthNamePipe, isStandalone: true, name: "longMonthName" }); }
36
+ }
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LongMonthNamePipe, decorators: [{
38
+ type: Pipe,
39
+ args: [{ name: 'longMonthName' }]
40
+ }] });
41
+ //# sourceMappingURL=long-month-name.pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"long-month-name.pipe.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/pipes/long-month-name.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAGpD,MAAM,OAAO,iBAAiB;IAC5B,SAAS,CAAC,KAAc;QACtB,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,CAAC;gBACJ,OAAO,SAAS,CAAC;YACnB,KAAK,CAAC;gBACJ,OAAO,UAAU,CAAC;YACpB,KAAK,CAAC;gBACJ,OAAO,OAAO,CAAC;YACjB,KAAK,CAAC;gBACJ,OAAO,OAAO,CAAC;YACjB,KAAK,CAAC;gBACJ,OAAO,KAAK,CAAC;YACf,KAAK,CAAC;gBACJ,OAAO,MAAM,CAAC;YAChB,KAAK,CAAC;gBACJ,OAAO,MAAM,CAAC;YAChB,KAAK,CAAC;gBACJ,OAAO,QAAQ,CAAC;YAClB,KAAK,CAAC;gBACJ,OAAO,WAAW,CAAC;YACrB,KAAK,CAAC;gBACJ,OAAO,SAAS,CAAC;YACnB,KAAK,EAAE;gBACL,OAAO,UAAU,CAAC;YACpB,KAAK,EAAE;gBACL,OAAO,UAAU,CAAC;YACpB;gBACE,OAAO,EAAE,GAAG,KAAK,CAAC;QACtB,CAAC;IACH,CAAC;8GA9BU,iBAAiB;4GAAjB,iBAAiB;;2FAAjB,iBAAiB;kBAD7B,IAAI;mBAAC,EAAE,IAAI,EAAE,eAAe,EAAE","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'longMonthName' })\nexport class LongMonthNamePipe implements PipeTransform {\n transform(month?: number): string {\n switch (month) {\n case 0:\n return 'January';\n case 1:\n return 'February';\n case 2:\n return 'March';\n case 3:\n return 'April';\n case 4:\n return 'May';\n case 5:\n return 'June';\n case 6:\n return 'July';\n case 7:\n return 'August';\n case 8:\n return 'September';\n case 9:\n return 'October';\n case 10:\n return 'November';\n case 11:\n return 'December';\n default:\n return '' + month;\n }\n }\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import { Pipe } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export const shortMonthNamesByNumber = [
4
+ 'Jan',
5
+ 'Feb',
6
+ 'Mar',
7
+ 'Apr',
8
+ 'May',
9
+ 'Jun',
10
+ 'Jul',
11
+ 'Aug',
12
+ 'Sep',
13
+ 'Oct',
14
+ 'Nov',
15
+ 'Dec',
16
+ ];
17
+ export class ShortMonthNamePipe {
18
+ transform(month) {
19
+ if (month !== undefined && month >= 0 && month <= 11) {
20
+ return shortMonthNamesByNumber[month];
21
+ }
22
+ return '' + month;
23
+ }
24
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ShortMonthNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
25
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: ShortMonthNamePipe, isStandalone: true, name: "shortMonthName" }); }
26
+ }
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ShortMonthNamePipe, decorators: [{
28
+ type: Pipe,
29
+ args: [{ name: 'shortMonthName' }]
30
+ }] });
31
+ //# sourceMappingURL=short-month-name.pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"short-month-name.pipe.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/pipes/short-month-name.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAEpD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC;AAGF,MAAM,OAAO,kBAAkB;IAC7B,SAAS,CAAC,KAAc;QACtB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;YACrD,OAAO,uBAAuB,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,EAAE,GAAG,KAAK,CAAC;IACpB,CAAC;8GANU,kBAAkB;4GAAlB,kBAAkB;;2FAAlB,kBAAkB;kBAD9B,IAAI;mBAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\nexport const shortMonthNamesByNumber = [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec',\n];\n\n@Pipe({ name: 'shortMonthName' })\nexport class ShortMonthNamePipe implements PipeTransform {\n transform(month?: number): string {\n if (month !== undefined && month >= 0 && month <= 11) {\n return shortMonthNamesByNumber[month];\n }\n return '' + month;\n }\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import { Pipe } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class SpaceEmojiPipe {
4
+ transform(communeType) {
5
+ switch (communeType) {
6
+ case 'family':
7
+ return '👨‍👩‍👧‍👦';
8
+ case 'cohabit':
9
+ return '🤝';
10
+ case 'sport_club':
11
+ return '⚽';
12
+ case 'educator':
13
+ return '💃';
14
+ case 'realtor':
15
+ return '🏘️';
16
+ case 'parish':
17
+ return '⛪';
18
+ case 'private':
19
+ return '🕶️';
20
+ default:
21
+ return undefined;
22
+ }
23
+ }
24
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SpaceEmojiPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
25
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: SpaceEmojiPipe, isStandalone: true, name: "spaceEmoji" }); }
26
+ }
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: SpaceEmojiPipe, decorators: [{
28
+ type: Pipe,
29
+ args: [{ name: 'spaceEmoji' }]
30
+ }] });
31
+ //# sourceMappingURL=team-emoji.pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-emoji.pipe.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/pipes/team-emoji.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAIpD,MAAM,OAAO,cAAc;IACzB,SAAS,CAAC,WAAsB;QAC9B,QAAQ,WAAW,EAAE,CAAC;YACpB,KAAK,QAAQ;gBACX,OAAO,aAAa,CAAC;YACvB,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAC;YACd,KAAK,YAAY;gBACf,OAAO,GAAG,CAAC;YACb,KAAK,UAAU;gBACb,OAAO,IAAI,CAAC;YACd,KAAK,SAAS;gBACZ,OAAO,KAAK,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,GAAG,CAAC;YACb,KAAK,SAAS;gBACZ,OAAO,KAAK,CAAC;YACf;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;8GApBU,cAAc;4GAAd,cAAc;;2FAAd,cAAc;kBAD1B,IAAI;mBAAC,EAAE,IAAI,EAAE,YAAY,EAAE","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { SpaceType } from '@sneat/core';\n\n@Pipe({ name: 'spaceEmoji' })\nexport class SpaceEmojiPipe implements PipeTransform {\n transform(communeType: SpaceType): string | undefined {\n switch (communeType) {\n case 'family':\n return '👨‍👩‍👧‍👦';\n case 'cohabit':\n return '🤝';\n case 'sport_club':\n return '⚽';\n case 'educator':\n return '💃';\n case 'realtor':\n return '🏘️';\n case 'parish':\n return '⛪';\n case 'private':\n return '🕶️';\n default:\n return undefined;\n }\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=save-event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-event.js","sourceRoot":"","sources":["../../../../../libs/components/src/lib/save-event.ts"],"names":[],"mappings":"","sourcesContent":["export interface ISaveEvent<T> {\n readonly object?: T;\n readonly success: () => void;\n readonly error: (e: unknown) => void;\n}\n"]}
@@ -0,0 +1,136 @@
1
+ import { HttpClient, HttpHeaders } from '@angular/common/http';
2
+ import { ChangeDetectionStrategy, Component, computed, effect, Input, signal, inject, } from '@angular/core';
3
+ import { IonButton, IonCard, IonCardContent, IonCardHeader, IonCardTitle, IonIcon, IonLabel, } from '@ionic/angular/standalone';
4
+ import { SneatUserService } from '@sneat/auth-core';
5
+ import { ClassName, SneatBaseComponent } from '@sneat/ui';
6
+ import { map, race, takeUntil } from 'rxjs';
7
+ import { CountryInputComponent } from '../country-input';
8
+ import { CountriesLoaderService } from '../country-selector';
9
+ import * as i0 from "@angular/core";
10
+ let ipCountryCached; // TODO: Should have expiration?
11
+ export class UserCountryComponent extends SneatBaseComponent {
12
+ trackUserRecord() {
13
+ this.userService.userState
14
+ .pipe(takeUntil(this.destroyed$))
15
+ .subscribe((user) => {
16
+ if (user.record) {
17
+ this.$userCountryID.set(user?.record?.countryID || '--');
18
+ }
19
+ });
20
+ }
21
+ constructor() {
22
+ super();
23
+ this.httpClient = inject(HttpClient);
24
+ this.userService = inject(SneatUserService);
25
+ this.countriesLoader = inject(CountriesLoaderService);
26
+ this.$ipCountryID = signal('', ...(ngDevMode ? [{ debugName: "$ipCountryID" }] : []));
27
+ this.$ipCountry = signal(undefined, ...(ngDevMode ? [{ debugName: "$ipCountry" }] : []));
28
+ this.$userCountryID = signal('', ...(ngDevMode ? [{ debugName: "$userCountryID" }] : []));
29
+ this.$userHasCountry = computed(() => {
30
+ const userCountryID = this.$userCountryID();
31
+ return !!userCountryID && userCountryID !== '--';
32
+ }, ...(ngDevMode ? [{ debugName: "$userHasCountry" }] : []));
33
+ this.isCountryDetectionStarted = false;
34
+ this.$detectingCountry = signal(false, ...(ngDevMode ? [{ debugName: "$detectingCountry" }] : []));
35
+ this.$saving = signal(false, ...(ngDevMode ? [{ debugName: "$saving" }] : []));
36
+ this.doNotHide = false;
37
+ this.trackUserRecord();
38
+ // this.getIpCountry();
39
+ effect(() => {
40
+ const userCountryID = this.$userCountryID();
41
+ if (userCountryID === '--' &&
42
+ // It looks like using signal here can cause an infinite loop
43
+ !this.isCountryDetectionStarted) {
44
+ this.getIpCountry();
45
+ }
46
+ });
47
+ }
48
+ onCountryOfResidenceChanged(countryID) {
49
+ this.setCountry(countryID);
50
+ }
51
+ getIpCountry() {
52
+ if (this.isCountryDetectionStarted) {
53
+ return;
54
+ }
55
+ this.isCountryDetectionStarted = true;
56
+ if (ipCountryCached) {
57
+ this.$ipCountryID.set(ipCountryCached);
58
+ this.countriesLoader.getCountryByID(ipCountryCached).then((country) => {
59
+ this.$ipCountry.set(country);
60
+ });
61
+ return;
62
+ }
63
+ this.$detectingCountry.set(true);
64
+ // console.log('UserCountryComponent: Detecting IP country...');
65
+ race(this.httpClient
66
+ .get('https://ipapi.co/country', {
67
+ headers: new HttpHeaders({
68
+ Accept: 'text/plain',
69
+ }),
70
+ responseType: 'text',
71
+ })
72
+ .pipe(map((country) => ({ source: 'https://ipapi.co/country', country })))).subscribe({
73
+ next: (response) => {
74
+ // console.log('UserCountryComponent: Got IP country:', response);
75
+ const ipCountryID = response.country;
76
+ ipCountryCached = ipCountryID;
77
+ this.$ipCountryID.set(ipCountryID);
78
+ this.countriesLoader.getCountryByID(ipCountryID).then((country) => {
79
+ this.$ipCountry.set(country);
80
+ });
81
+ this.$detectingCountry.set(false);
82
+ },
83
+ error: (err) => {
84
+ this.$detectingCountry.set(false);
85
+ // console.error('UserCountryComponent: Failed to get IP country', err);
86
+ this.errorLogger.logError(err, 'UserCountryComponent: Failed to get IP country', {
87
+ show: false,
88
+ });
89
+ },
90
+ });
91
+ }
92
+ setCountry(countryID) {
93
+ if (!countryID) {
94
+ return;
95
+ }
96
+ this.$saving.set(true);
97
+ this.userService.setUserCountry(countryID).subscribe({
98
+ next: () => {
99
+ // console.log('UserCountryComponent: User country set to', countryID);
100
+ this.$userCountryID.set(countryID);
101
+ },
102
+ error: (err) => {
103
+ this.errorLogger.logError('UserCountryComponent: Failed to set user country', err);
104
+ this.$saving.set(false);
105
+ },
106
+ });
107
+ }
108
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UserCountryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
109
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: UserCountryComponent, isStandalone: true, selector: "sneat-user-country", inputs: { doNotHide: "doNotHide" }, providers: [
110
+ {
111
+ provide: ClassName,
112
+ useValue: 'UserCountryComponent',
113
+ },
114
+ ], usesInheritance: true, ngImport: i0, template: "@let userCountryID = $userCountryID();\n@let userHasCountry = $userHasCountry();\n\n@if (doNotHide || ($ipCountry() && !userHasCountry)) {\n <ion-card>\n @if (userHasCountry || !$ipCountry()) {\n <ion-card-content>\n <sneat-country-input\n label=\"Country of residence\"\n [canReset]=\"false\"\n [countryID]=\"userCountryID || ''\"\n (countryIDChange)=\"onCountryOfResidenceChanged($event)\"\n />\n </ion-card-content>\n } @else {\n <ion-card-header>\n <ion-card-title>\n Is {{ $ipCountry()?.emoji }} {{ $ipCountry()?.title }} your country of\n residence?\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <ion-button\n [disabled]=\"$saving()\"\n color=\"primary\"\n class=\"ion-padding-end\"\n (click)=\"setCountry($ipCountryID())\"\n >\n <ion-icon name=\"checkmark-outline\" slot=\"start\" />\n <ion-label style=\"text-transform: none\"\n ><b\n >Yes, my primary residence is in {{ $ipCountry()?.title }}\n {{ $ipCountry()?.emoji }}</b\n ></ion-label\n >\n </ion-button>\n <ion-button color=\"light\" [disabled]=\"$saving()\">\n <ion-icon name=\"list-outline\" slot=\"start\" />\n <ion-label style=\"text-transform: none\">Choose county</ion-label>\n </ion-button>\n </ion-card-content>\n }\n </ion-card>\n}\n", dependencies: [{ kind: "component", type: CountryInputComponent, selector: "sneat-country-input", inputs: ["canReset", "label", "countryID"], outputs: ["countryIDChange"] }, { kind: "component", type: IonCardContent, selector: "ion-card-content", inputs: ["mode"] }, { 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: 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: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
115
+ }
116
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: UserCountryComponent, decorators: [{
117
+ type: Component,
118
+ args: [{ imports: [
119
+ CountryInputComponent,
120
+ IonCardContent,
121
+ IonCardHeader,
122
+ IonCardTitle,
123
+ IonButton,
124
+ IonIcon,
125
+ IonLabel,
126
+ IonCard,
127
+ ], providers: [
128
+ {
129
+ provide: ClassName,
130
+ useValue: 'UserCountryComponent',
131
+ },
132
+ ], changeDetection: ChangeDetectionStrategy.OnPush, selector: 'sneat-user-country', template: "@let userCountryID = $userCountryID();\n@let userHasCountry = $userHasCountry();\n\n@if (doNotHide || ($ipCountry() && !userHasCountry)) {\n <ion-card>\n @if (userHasCountry || !$ipCountry()) {\n <ion-card-content>\n <sneat-country-input\n label=\"Country of residence\"\n [canReset]=\"false\"\n [countryID]=\"userCountryID || ''\"\n (countryIDChange)=\"onCountryOfResidenceChanged($event)\"\n />\n </ion-card-content>\n } @else {\n <ion-card-header>\n <ion-card-title>\n Is {{ $ipCountry()?.emoji }} {{ $ipCountry()?.title }} your country of\n residence?\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <ion-button\n [disabled]=\"$saving()\"\n color=\"primary\"\n class=\"ion-padding-end\"\n (click)=\"setCountry($ipCountryID())\"\n >\n <ion-icon name=\"checkmark-outline\" slot=\"start\" />\n <ion-label style=\"text-transform: none\"\n ><b\n >Yes, my primary residence is in {{ $ipCountry()?.title }}\n {{ $ipCountry()?.emoji }}</b\n ></ion-label\n >\n </ion-button>\n <ion-button color=\"light\" [disabled]=\"$saving()\">\n <ion-icon name=\"list-outline\" slot=\"start\" />\n <ion-label style=\"text-transform: none\">Choose county</ion-label>\n </ion-button>\n </ion-card-content>\n }\n </ion-card>\n}\n" }]
133
+ }], ctorParameters: () => [], propDecorators: { doNotHide: [{
134
+ type: Input
135
+ }] } });
136
+ //# sourceMappingURL=user-country.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-country.component.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/user-country/user-country.component.ts","../../../../../../libs/components/src/lib/user-country/user-country.component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rC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;QACT,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvB,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;YACnD,IAAI,EAAE,GAAG,EAAE;gBACT,uEAAuE;gBACvE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACrC,CAAC;YACD,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE;gBACb,IAAI,CAAC,WAAW,CAAC,QAAQ,CACvB,kDAAkD,EAClD,GAAG,CACJ,CAAC;gBACF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAC1B,CAAC;SACF,CAAC,CAAC;IACL,CAAC;8GAzHU,oBAAoB;kGAApB,oBAAoB,qGAVpB;YACT;gBACE,OAAO,EAAE,SAAS;gBAClB,QAAQ,EAAE,sBAAsB;aACjC;SACF,iDC5CH,y+CA4CA,4CDdI,qBAAqB,0IACrB,cAAc,+EACd,aAAa,sGACb,YAAY,sFACZ,SAAS,oPACT,OAAO,2JACP,QAAQ,6FACR,OAAO;;2FAYE,oBAAoB;kBArBhC,SAAS;8BACC;wBACP,qBAAqB;wBACrB,cAAc;wBACd,aAAa;wBACb,YAAY;wBACZ,SAAS;wBACT,OAAO;wBACP,QAAQ;wBACR,OAAO;qBACR,aACU;wBACT;4BACE,OAAO,EAAE,SAAS;4BAClB,QAAQ,EAAE,sBAAsB;yBACjC;qBACF,mBACgB,uBAAuB,CAAC,MAAM,YACrC,oBAAoB;;sBAwB7B,KAAK","sourcesContent":["import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n Input,\n OnDestroy,\n signal,\n inject,\n} from '@angular/core';\nimport {\n IonButton,\n IonCard,\n IonCardContent,\n IonCardHeader,\n IonCardTitle,\n IonIcon,\n IonLabel,\n} from '@ionic/angular/standalone';\nimport { SneatUserService } from '@sneat/auth-core';\nimport { ClassName, SneatBaseComponent } from '@sneat/ui';\nimport { map, race, takeUntil } from 'rxjs';\nimport { CountryInputComponent } from '../country-input';\nimport { ICountry, CountriesLoaderService } from '../country-selector';\n\nlet ipCountryCached: string | undefined; // TODO: Should have expiration?\n\n@Component({\n imports: [\n CountryInputComponent,\n IonCardContent,\n IonCardHeader,\n IonCardTitle,\n IonButton,\n IonIcon,\n IonLabel,\n IonCard,\n ],\n providers: [\n {\n provide: ClassName,\n useValue: 'UserCountryComponent',\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'sneat-user-country',\n templateUrl: './user-country.component.html',\n})\nexport class UserCountryComponent\n extends SneatBaseComponent\n implements OnDestroy\n{\n private readonly httpClient = inject(HttpClient);\n private readonly userService = inject(SneatUserService);\n private readonly countriesLoader = inject(CountriesLoaderService);\n\n protected readonly $ipCountryID = signal('');\n protected readonly $ipCountry = signal<ICountry | undefined>(undefined);\n\n protected readonly $userCountryID = signal<string>('');\n protected readonly $userHasCountry = computed(() => {\n const userCountryID = this.$userCountryID();\n return !!userCountryID && userCountryID !== '--';\n });\n\n protected isCountryDetectionStarted = false;\n protected readonly $detectingCountry = signal(false);\n protected readonly $saving = signal(false);\n\n @Input() public doNotHide = false;\n\n private trackUserRecord(): void {\n this.userService.userState\n .pipe(takeUntil(this.destroyed$))\n .subscribe((user) => {\n if (user.record) {\n this.$userCountryID.set(user?.record?.countryID || '--');\n }\n });\n }\n\n constructor() {\n super();\n this.trackUserRecord();\n // this.getIpCountry();\n effect(() => {\n const userCountryID = this.$userCountryID();\n if (\n userCountryID === '--' &&\n // It looks like using signal here can cause an infinite loop\n !this.isCountryDetectionStarted\n ) {\n this.getIpCountry();\n }\n });\n }\n\n protected onCountryOfResidenceChanged(countryID: string): void {\n this.setCountry(countryID);\n }\n\n private getIpCountry(): void {\n if (this.isCountryDetectionStarted) {\n return;\n }\n this.isCountryDetectionStarted = true;\n if (ipCountryCached) {\n this.$ipCountryID.set(ipCountryCached);\n this.countriesLoader.getCountryByID(ipCountryCached).then((country) => {\n this.$ipCountry.set(country);\n });\n return;\n }\n this.$detectingCountry.set(true);\n // console.log('UserCountryComponent: Detecting IP country...');\n race(\n this.httpClient\n .get<string>('https://ipapi.co/country', {\n headers: new HttpHeaders({\n Accept: 'text/plain',\n }),\n responseType: 'text' as 'json',\n })\n .pipe(\n map((country) => ({ source: 'https://ipapi.co/country', country })),\n ),\n ).subscribe({\n next: (response) => {\n // console.log('UserCountryComponent: Got IP country:', response);\n const ipCountryID = response.country;\n ipCountryCached = ipCountryID;\n this.$ipCountryID.set(ipCountryID);\n this.countriesLoader.getCountryByID(ipCountryID).then((country) => {\n this.$ipCountry.set(country);\n });\n this.$detectingCountry.set(false);\n },\n error: (err) => {\n this.$detectingCountry.set(false);\n // console.error('UserCountryComponent: Failed to get IP country', err);\n this.errorLogger.logError(\n err,\n 'UserCountryComponent: Failed to get IP country',\n {\n show: false,\n },\n );\n },\n });\n }\n\n protected setCountry(countryID?: string): void {\n if (!countryID) {\n return;\n }\n this.$saving.set(true);\n this.userService.setUserCountry(countryID).subscribe({\n next: () => {\n // console.log('UserCountryComponent: User country set to', countryID);\n this.$userCountryID.set(countryID);\n },\n error: (err) => {\n this.errorLogger.logError(\n 'UserCountryComponent: Failed to set user country',\n err,\n );\n this.$saving.set(false);\n },\n });\n }\n}\n","@let userCountryID = $userCountryID();\n@let userHasCountry = $userHasCountry();\n\n@if (doNotHide || ($ipCountry() && !userHasCountry)) {\n <ion-card>\n @if (userHasCountry || !$ipCountry()) {\n <ion-card-content>\n <sneat-country-input\n label=\"Country of residence\"\n [canReset]=\"false\"\n [countryID]=\"userCountryID || ''\"\n (countryIDChange)=\"onCountryOfResidenceChanged($event)\"\n />\n </ion-card-content>\n } @else {\n <ion-card-header>\n <ion-card-title>\n Is {{ $ipCountry()?.emoji }} {{ $ipCountry()?.title }} your country of\n residence?\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <ion-button\n [disabled]=\"$saving()\"\n color=\"primary\"\n class=\"ion-padding-end\"\n (click)=\"setCountry($ipCountryID())\"\n >\n <ion-icon name=\"checkmark-outline\" slot=\"start\" />\n <ion-label style=\"text-transform: none\"\n ><b\n >Yes, my primary residence is in {{ $ipCountry()?.title }}\n {{ $ipCountry()?.emoji }}</b\n ></ion-label\n >\n </ion-button>\n <ion-button color=\"light\" [disabled]=\"$saving()\">\n <ion-icon name=\"list-outline\" slot=\"start\" />\n <ion-label style=\"text-transform: none\">Choose county</ion-label>\n </ion-button>\n </ion-card-content>\n }\n </ion-card>\n}\n"]}
@@ -0,0 +1,83 @@
1
+ import { animate, animateChild, group, query, state, style, transition, trigger, } from '@angular/animations';
2
+ const defaultTiming = '250ms ease-out';
3
+ const defaultActiveOpacity = '1';
4
+ const defaultHiddenOpacity = '0.05';
5
+ export const showVirtualSlide = 'show';
6
+ export const hideVirtualSlide = 'hide';
7
+ export const VirtualSliderDirectPushedNext = 'direct-push-next';
8
+ export const VirtualSliderDirectPushedPrev = 'direct-push-prev';
9
+ export const VirtualSliderReversePushedNext = 'reverse-push-next';
10
+ export const VirtualSliderReversePushedPrev = 'reverse-push-prev';
11
+ const options = {
12
+ timing: defaultTiming,
13
+ activeOpacity: defaultActiveOpacity,
14
+ hiddenOpacity: defaultHiddenOpacity,
15
+ };
16
+ const slideLeft = group([
17
+ animate(options.timing, style({ transform: 'translateX(-50%)' })),
18
+ query('@virtualSlide', animateChild()),
19
+ ]);
20
+ const slideRight = group([
21
+ animate(options.timing, style({ transform: 'translateX(0)' })),
22
+ query('@virtualSlide', animateChild()),
23
+ ]);
24
+ export const virtualSliderAnimations = [
25
+ trigger('virtualSlide', [
26
+ transition('void => *', animate(0)),
27
+ state(showVirtualSlide, style({ opacity: options.activeOpacity || 0 })),
28
+ state(hideVirtualSlide, style({ opacity: options.hiddenOpacity || 0 })),
29
+ transition('* => *', animate(options.timing)),
30
+ ]),
31
+ trigger('virtualSlider', [
32
+ transition('void => *', animate(0)),
33
+ // Slides: A→B
34
+ state(VirtualSliderDirectPushedNext, style({
35
+ flexDirection: 'row',
36
+ transform: 'translateX(-50%)',
37
+ })),
38
+ transition(`* => ${VirtualSliderDirectPushedNext}`, [
39
+ style({
40
+ flexDirection: 'row',
41
+ transform: 'translateX(0)',
42
+ }),
43
+ slideLeft,
44
+ ]),
45
+ // Slides: A←B
46
+ state(VirtualSliderDirectPushedPrev, style({
47
+ flexDirection: 'row',
48
+ transform: 'translateX(0)',
49
+ })),
50
+ transition(`* => ${VirtualSliderDirectPushedPrev}`, [
51
+ style({
52
+ flexDirection: 'row',
53
+ transform: 'translateX(-50%)',
54
+ }),
55
+ slideRight,
56
+ ]),
57
+ // Slides: B→A
58
+ state(VirtualSliderReversePushedNext, style({
59
+ flexDirection: 'row-reverse',
60
+ transform: 'translateX(-50%)',
61
+ })),
62
+ transition(`* => ${VirtualSliderReversePushedNext}`, [
63
+ style({
64
+ flexDirection: 'row-reverse',
65
+ transform: 'translateX(0)',
66
+ }),
67
+ slideLeft,
68
+ ]),
69
+ // Slides: B←A
70
+ state(VirtualSliderReversePushedPrev, style({
71
+ flexDirection: 'row-reverse',
72
+ transform: 'translateX(0)',
73
+ })),
74
+ transition(`* => ${VirtualSliderReversePushedPrev}`, [
75
+ style({
76
+ flexDirection: 'row-reverse',
77
+ transform: 'translateX(-50%)',
78
+ }),
79
+ slideRight,
80
+ ]),
81
+ ]),
82
+ ];
83
+ //# sourceMappingURL=virtual-slider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-slider.js","sourceRoot":"","sources":["../../../../../../libs/components/src/lib/virtual-slider/virtual-slider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,YAAY,EAEZ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,UAAU,EACV,OAAO,GACR,MAAM,qBAAqB,CAAC;AAE7B,MAAM,aAAa,GAAG,gBAAgB,CAAC;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gBAC5B,SAAS,EAAE,kBAAkB;aAC9B,CAAC;YACF,UAAU;SACX,CAAC;KACH,CAAC;CACH,CAAC","sourcesContent":["import {\n animate,\n animateChild,\n AnimationTriggerMetadata,\n group,\n query,\n state,\n style,\n transition,\n trigger,\n} from '@angular/animations';\n\nconst defaultTiming = '250ms ease-out';\n\nconst defaultActiveOpacity = '1';\nconst defaultHiddenOpacity = '0.05';\n\ninterface IVirtualSliderOptions {\n timing: string;\n activeOpacity?: string;\n hiddenOpacity?: string;\n}\n\ntype VirtualSlideStateShow = 'show';\ntype VirtualSlideStateHide = 'hide';\n\nexport const showVirtualSlide: VirtualSlideStateShow = 'show';\nexport const hideVirtualSlide: VirtualSlideStateHide = 'hide';\n\nexport type VirtualSlideAnimationsStates =\n | VirtualSlideStateShow\n | VirtualSlideStateHide;\n\nexport const VirtualSliderDirectPushedNext = 'direct-push-next';\nexport const VirtualSliderDirectPushedPrev = 'direct-push-prev';\nexport const VirtualSliderReversePushedNext = 'reverse-push-next';\nexport const VirtualSliderReversePushedPrev = 'reverse-push-prev';\n\nexport type VirtualSliderAnimationStates =\n | 'direct-push-next'\n | 'direct-push-prev'\n | 'reverse-push-next'\n | 'reverse-push-prev';\n\nconst options: IVirtualSliderOptions = {\n timing: defaultTiming,\n activeOpacity: defaultActiveOpacity,\n hiddenOpacity: defaultHiddenOpacity,\n};\n\nconst slideLeft = group([\n animate(options.timing, style({ transform: 'translateX(-50%)' })),\n query('@virtualSlide', animateChild()),\n]);\nconst slideRight = group([\n animate(options.timing, style({ transform: 'translateX(0)' })),\n query('@virtualSlide', animateChild()),\n]);\n\nexport const virtualSliderAnimations: AnimationTriggerMetadata[] = [\n trigger('virtualSlide', [\n transition('void => *', animate(0)),\n state(showVirtualSlide, style({ opacity: options.activeOpacity || 0 })),\n state(hideVirtualSlide, style({ opacity: options.hiddenOpacity || 0 })),\n transition('* => *', animate(options.timing)),\n ]),\n trigger('virtualSlider', [\n transition('void => *', animate(0)),\n // Slides: A→B\n state(\n VirtualSliderDirectPushedNext,\n style({\n flexDirection: 'row',\n transform: 'translateX(-50%)',\n }),\n ),\n transition(`* => ${VirtualSliderDirectPushedNext}`, [\n style({\n flexDirection: 'row',\n transform: 'translateX(0)',\n }),\n slideLeft,\n ]),\n // Slides: A←B\n state(\n VirtualSliderDirectPushedPrev,\n style({\n flexDirection: 'row',\n transform: 'translateX(0)',\n }),\n ),\n transition(`* => ${VirtualSliderDirectPushedPrev}`, [\n style({\n flexDirection: 'row',\n transform: 'translateX(-50%)',\n }),\n slideRight,\n ]),\n // Slides: B→A\n state(\n VirtualSliderReversePushedNext,\n style({\n flexDirection: 'row-reverse',\n transform: 'translateX(-50%)',\n }),\n ),\n transition(`* => ${VirtualSliderReversePushedNext}`, [\n style({\n flexDirection: 'row-reverse',\n transform: 'translateX(0)',\n }),\n slideLeft,\n ]),\n // Slides: B←A\n state(\n VirtualSliderReversePushedPrev,\n style({\n flexDirection: 'row-reverse',\n transform: 'translateX(0)',\n }),\n ),\n transition(`* => ${VirtualSliderReversePushedPrev}`, [\n style({\n flexDirection: 'row-reverse',\n transform: 'translateX(-50%)',\n }),\n slideRight,\n ]),\n ]),\n];\n"]}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=sneat-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sneat-components.js","sourceRoot":"","sources":["../../../../libs/components/src/sneat-components.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"]}
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class AppVersionComponent {
3
+ protected readonly buildInfo: {
4
+ readonly gitHash: string;
5
+ readonly buildTimestamp: string;
6
+ };
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppVersionComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<AppVersionComponent, "sneat-app-version", never, {}, {}, never, never, true, never>;
9
+ }
@@ -0,0 +1,4 @@
1
+ export declare const buildInfo: {
2
+ readonly gitHash: string;
3
+ readonly buildTimestamp: string;
4
+ };
@@ -0,0 +1,43 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { IonInput } from '@ionic/angular/standalone';
3
+ import { IRecord } from '@sneat/data';
4
+ import { Observable } from 'rxjs';
5
+ import * as i0 from "@angular/core";
6
+ export interface ICardTab {
7
+ id: string;
8
+ title: string;
9
+ }
10
+ interface IOptionallyTitled {
11
+ id?: string;
12
+ title?: string;
13
+ }
14
+ export declare class SneatCardListComponent {
15
+ private readonly errorLogger;
16
+ title?: string;
17
+ isFilterable?: boolean;
18
+ isLoading?: boolean;
19
+ items?: {
20
+ id?: unknown;
21
+ title?: string;
22
+ }[];
23
+ create?: (name: string) => Observable<IRecord<IOptionallyTitled>>;
24
+ itemIcon?: string;
25
+ tab?: string;
26
+ tabs?: ICardTab[];
27
+ noItemsText?: string;
28
+ getRouterLink: (item: unknown) => string;
29
+ readonly cardTitleClick: EventEmitter<void>;
30
+ readonly itemClick: EventEmitter<unknown>;
31
+ readonly tabChanged: EventEmitter<string>;
32
+ addInput?: IonInput;
33
+ filter: string;
34
+ protected mode: 'list' | 'add';
35
+ protected name: string;
36
+ protected isAdding?: boolean;
37
+ protected click(event: Event, item: unknown): void;
38
+ protected showAddForm(event: Event): void;
39
+ protected tryCreate(): void;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<SneatCardListComponent, never>;
41
+ static ɵcmp: i0.ɵɵComponentDeclaration<SneatCardListComponent, "sneat-card-list", never, { "title": { "alias": "title"; "required": false; }; "isFilterable": { "alias": "isFilterable"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "items": { "alias": "items"; "required": false; }; "create": { "alias": "create"; "required": false; }; "itemIcon": { "alias": "itemIcon"; "required": false; }; "tab": { "alias": "tab"; "required": false; }; "tabs": { "alias": "tabs"; "required": false; }; "noItemsText": { "alias": "noItemsText"; "required": false; }; "getRouterLink": { "alias": "getRouterLink"; "required": false; }; }, { "cardTitleClick": "cardTitleClick"; "itemClick": "itemClick"; "tabChanged": "tabChanged"; }, never, never, true, never>;
42
+ }
43
+ export {};
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class CopyrightComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<CopyrightComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<CopyrightComponent, "sneat-copyright", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,16 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { ICountry } from '../country-selector';
3
+ import * as i0 from "@angular/core";
4
+ export declare class CountryInputComponent implements OnInit {
5
+ private readonly countriesLoader;
6
+ canReset: boolean;
7
+ label: string;
8
+ countryID: string;
9
+ countryIDChange: EventEmitter<string>;
10
+ readonly countries: import("@angular/core").WritableSignal<readonly ICountry[]>;
11
+ ngOnInit(): void;
12
+ onCountryChanged(): void;
13
+ reset(event: Event): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<CountryInputComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<CountryInputComponent, "sneat-country-input", never, { "canReset": { "alias": "canReset"; "required": false; }; "label": { "alias": "label"; "required": false; }; "countryID": { "alias": "countryID"; "required": false; }; }, { "countryIDChange": "countryIDChange"; }, never, never, true, never>;
16
+ }
@@ -0,0 +1,43 @@
1
+ import { GeoRegion, ICountry } from './countries';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Service to lazy load country data.
5
+ * This reduces the initial bundle size by loading country data on-demand.
6
+ */
7
+ export declare class CountriesLoaderService {
8
+ private readonly http;
9
+ private countriesData?;
10
+ private loadPromise?;
11
+ /**
12
+ * Loads country data from JSON file.
13
+ * Subsequent calls return the same promise (singleton pattern).
14
+ */
15
+ private loadCountries;
16
+ /**
17
+ * Gets all countries as an array.
18
+ * Automatically loads country data if not yet loaded.
19
+ */
20
+ getCountries(): Promise<readonly ICountry[]>;
21
+ /**
22
+ * Gets countries by ID lookup.
23
+ * Automatically loads country data if not yet loaded.
24
+ */
25
+ getCountriesByID(): Promise<Record<string, ICountry>>;
26
+ /**
27
+ * Gets a specific country by ID.
28
+ * Automatically loads country data if not yet loaded.
29
+ */
30
+ getCountryByID(id: string): Promise<ICountry | undefined>;
31
+ /**
32
+ * Gets the unknown country constant.
33
+ * Automatically loads country data if not yet loaded.
34
+ */
35
+ getUnknownCountry(): Promise<ICountry>;
36
+ /**
37
+ * Gets countries filtered by geo region.
38
+ * Automatically loads country data if not yet loaded.
39
+ */
40
+ getCountriesByRegion(region: GeoRegion): Promise<readonly ICountry[]>;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<CountriesLoaderService, never>;
42
+ static ɵprov: i0.ɵɵInjectableDeclaration<CountriesLoaderService>;
43
+ }
@@ -0,0 +1,25 @@
1
+ export type GeoRegion = 'Europe' | 'Asia' | 'Americas' | 'South America' | 'North America' | 'Pacific Ocean' | 'Africa';
2
+ export interface ICountry {
3
+ id: string;
4
+ id3: string;
5
+ geoRegions: GeoRegion[];
6
+ title: string;
7
+ longTitle?: string;
8
+ shortTitle?: string;
9
+ emoji: string;
10
+ }
11
+ /**
12
+ * @deprecated Use CountriesLoaderService.getCountriesByID() instead.
13
+ * Country data is now lazy-loaded to reduce bundle size.
14
+ */
15
+ export declare const countriesByID: Record<string, ICountry>;
16
+ /**
17
+ * @deprecated Use CountriesLoaderService.getUnknownCountry() instead.
18
+ * Country data is now lazy-loaded to reduce bundle size.
19
+ */
20
+ export declare const unknownCountry: ICountry;
21
+ /**
22
+ * @deprecated Use CountriesLoaderService.getCountries() instead.
23
+ * Country data is now lazy-loaded to reduce bundle size.
24
+ */
25
+ export declare const countries: ICountry[];
@@ -0,0 +1,31 @@
1
+ import { EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
+ import { ISelectItem } from '@sneat/ui';
3
+ import { GeoRegion, ICountry } from './countries';
4
+ import * as i0 from "@angular/core";
5
+ export declare class CountrySelectorComponent implements OnInit, OnChanges {
6
+ private readonly countriesLoader;
7
+ protected readonly geoRegions: readonly {
8
+ readonly id: string;
9
+ title?: string;
10
+ }[];
11
+ countryID?: string;
12
+ defaultCountryID?: string;
13
+ readonly: boolean;
14
+ disabled: boolean;
15
+ label: string;
16
+ canBeUnknown: boolean;
17
+ readonly countryIDChange: EventEmitter<string>;
18
+ protected readonly filter: import("@angular/core").WritableSignal<string>;
19
+ protected readonly geoRegion: import("@angular/core").WritableSignal<GeoRegion | "All">;
20
+ protected readonly allCountries: import("@angular/core").WritableSignal<readonly ICountry[]>;
21
+ protected readonly unknownCountry: import("@angular/core").WritableSignal<ICountry | undefined>;
22
+ protected readonly countries: import("@angular/core").Signal<readonly ISelectItem[]>;
23
+ ngOnInit(): void;
24
+ protected onChanged(): void;
25
+ protected onFilterChanged(filter: string): void;
26
+ ngOnChanges(changes: SimpleChanges): void;
27
+ protected onRegionChanged(event: Event): void;
28
+ protected readonly filterCountryByCode: (item: ISelectItem, filter: string) => boolean;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<CountrySelectorComponent, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<CountrySelectorComponent, "sneat-country-selector", never, { "countryID": { "alias": "countryID"; "required": true; }; "defaultCountryID": { "alias": "defaultCountryID"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; "canBeUnknown": { "alias": "canBeUnknown"; "required": false; }; }, { "countryIDChange": "countryIDChange"; }, never, never, true, never>;
31
+ }
@@ -0,0 +1,8 @@
1
+ import { SelectorBaseService } from '@sneat/ui';
2
+ import { ICountry } from './countries';
3
+ import * as i0 from "@angular/core";
4
+ export declare class CountrySelectorService extends SelectorBaseService<ICountry> {
5
+ constructor();
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<CountrySelectorService, never>;
7
+ static ɵprov: i0.ɵɵInjectableDeclaration<CountrySelectorService>;
8
+ }