@indice/ng-components 0.2.139 → 0.2.141

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 (228) hide show
  1. package/README.md +4 -4
  2. package/{src/assets/styles/indice-ng-icons-inline.css → _styles.css} +3501 -2286
  3. package/esm2020/indice-ng-components.mjs +5 -0
  4. package/esm2020/lib/controls/avatar-initials/avatar-initials.component.mjs +48 -0
  5. package/esm2020/lib/controls/collapsible-panel/collapsible-panel.component.mjs +20 -0
  6. package/esm2020/lib/controls/date-picker/date-picker.component.mjs +260 -0
  7. package/esm2020/lib/controls/drop-down-menu/drop-down-menu.component.mjs +68 -0
  8. package/esm2020/lib/controls/kpi-tile/kpi-tile.component.mjs +36 -0
  9. package/esm2020/lib/controls/list-view/list-column.component.mjs +25 -0
  10. package/esm2020/lib/controls/list-view/list-details-section.component.mjs +17 -0
  11. package/esm2020/lib/controls/list-view/list-tile.component.mjs +17 -0
  12. package/esm2020/lib/controls/list-view/list-view-empty-state.component.mjs +29 -0
  13. package/esm2020/lib/controls/list-view/list-view.component.mjs +183 -0
  14. package/esm2020/lib/controls/nav-links-list/nav-links-list.component.mjs +37 -0
  15. package/esm2020/lib/controls/notifications-indicator/notifications-indicator.component.mjs +77 -0
  16. package/esm2020/lib/controls/pager/pager.component.mjs +130 -0
  17. package/esm2020/lib/controls/side-pane/side-pane.component.mjs +72 -0
  18. package/esm2020/lib/controls/skeleton-loader/skeleton-loader.component.mjs +25 -0
  19. package/esm2020/lib/controls/toaster/toaster-container.component.mjs +28 -0
  20. package/esm2020/lib/controls/toaster/toaster.component.mjs +31 -0
  21. package/esm2020/lib/controls/toggle/toggle.component.mjs +64 -0
  22. package/esm2020/lib/directives/click-outside.directive.mjs +189 -0
  23. package/esm2020/lib/directives/dynamic-component-host.directive.mjs +17 -0
  24. package/esm2020/lib/helpers/base-list.component.mjs +181 -0
  25. package/esm2020/lib/icons.mjs +32 -0
  26. package/esm2020/lib/layouts/shell/shell-footer/shell-footer.component.mjs +19 -0
  27. package/esm2020/lib/layouts/shell/shell-header/shell-header.component.mjs +135 -0
  28. package/esm2020/lib/layouts/shell/shell-layout/shell-layout.component.mjs +101 -0
  29. package/esm2020/lib/layouts/views/form-layout/form-layout.component.mjs +80 -0
  30. package/esm2020/lib/layouts/views/model-view-layout/model-view-layout.component.mjs +49 -0
  31. package/esm2020/lib/layouts/views/side-view-layout/side-view-layout.component.mjs +98 -0
  32. package/esm2020/lib/layouts/views/view-layout/view-layout.component.mjs +104 -0
  33. package/esm2020/lib/ng-components.module.mjs +221 -0
  34. package/esm2020/lib/pages/auth/auth-callback/auth-callback.component.mjs +30 -0
  35. package/esm2020/lib/pages/auth/auth-renew/auth-renew.component.mjs +31 -0
  36. package/esm2020/lib/pages/auth/logged-out/logged-out.component.mjs +28 -0
  37. package/esm2020/lib/pages/http-status/error/error.component.mjs +17 -0
  38. package/esm2020/lib/pages/http-status/page-not-found/page-not-found.component.mjs +15 -0
  39. package/esm2020/lib/pages/http-status/unauthorized/unauthorized.component.mjs +14 -0
  40. package/esm2020/lib/pipes/address.pipe.mjs +21 -0
  41. package/esm2020/lib/pipes/duration-format.pipe.mjs +64 -0
  42. package/esm2020/lib/services/component-loader/component-loader-options.class.mjs +8 -0
  43. package/esm2020/lib/services/component-loader/component-loader.class.mjs +188 -0
  44. package/esm2020/lib/services/component-loader/component-loader.factory.mjs +32 -0
  45. package/esm2020/lib/services/component-loader/content-ref.class.mjs +13 -0
  46. package/esm2020/lib/services/modal-service/modal-backdrop-component.mjs +44 -0
  47. package/esm2020/lib/services/modal-service/modal-container-component.mjs +126 -0
  48. package/esm2020/lib/services/modal-service/modal-options.class.mjs +35 -0
  49. package/esm2020/lib/services/modal-service/modal-service.mjs +219 -0
  50. package/esm2020/lib/services/modal-service/modal-styles.class.mjs +11 -0
  51. package/esm2020/lib/services/modal-service/modal.class.mjs +27 -0
  52. package/esm2020/lib/services/toaster.service.mjs +24 -0
  53. package/esm2020/lib/tokens.mjs +5 -0
  54. package/esm2020/lib/types.mjs +117 -0
  55. package/esm2020/public-api.mjs +53 -0
  56. package/fesm2015/indice-ng-components.mjs +3268 -0
  57. package/fesm2015/indice-ng-components.mjs.map +1 -0
  58. package/fesm2020/indice-ng-components.mjs +3225 -0
  59. package/fesm2020/indice-ng-components.mjs.map +1 -0
  60. package/indice-ng-components.d.ts +5 -0
  61. package/lib/controls/avatar-initials/avatar-initials.component.d.ts +14 -0
  62. package/lib/controls/collapsible-panel/collapsible-panel.component.d.ts +10 -0
  63. package/lib/controls/date-picker/date-picker.component.d.ts +48 -0
  64. package/lib/controls/drop-down-menu/drop-down-menu.component.d.ts +25 -0
  65. package/lib/controls/kpi-tile/kpi-tile.component.d.ts +13 -0
  66. package/lib/controls/list-view/list-column.component.d.ts +9 -0
  67. package/lib/controls/list-view/list-details-section.component.d.ts +7 -0
  68. package/lib/controls/list-view/list-tile.component.d.ts +7 -0
  69. package/lib/controls/list-view/list-view-empty-state.component.d.ts +11 -0
  70. package/lib/controls/list-view/list-view.component.d.ts +55 -0
  71. package/lib/controls/nav-links-list/nav-links-list.component.d.ts +15 -0
  72. package/lib/controls/notifications-indicator/notifications-indicator.component.d.ts +23 -0
  73. package/lib/controls/pager/pager.component.d.ts +36 -0
  74. package/lib/controls/side-pane/side-pane.component.d.ts +18 -0
  75. package/lib/controls/skeleton-loader/skeleton-loader.component.d.ts +11 -0
  76. package/lib/controls/toaster/toaster-container.component.d.ts +13 -0
  77. package/lib/controls/toaster/toaster.component.d.ts +15 -0
  78. package/lib/controls/toggle/toggle.component.d.ts +19 -0
  79. package/lib/directives/click-outside.directive.d.ts +40 -0
  80. package/lib/directives/dynamic-component-host.directive.d.ts +9 -0
  81. package/lib/helpers/base-list.component.d.ts +42 -0
  82. package/lib/icons.d.ts +30 -0
  83. package/lib/layouts/shell/shell-footer/shell-footer.component.d.ts +8 -0
  84. package/lib/layouts/shell/shell-header/shell-header.component.d.ts +41 -0
  85. package/lib/layouts/shell/shell-layout/shell-layout.component.d.ts +28 -0
  86. package/lib/layouts/views/form-layout/form-layout.component.d.ts +24 -0
  87. package/lib/layouts/views/model-view-layout/model-view-layout.component.d.ts +25 -0
  88. package/lib/layouts/views/side-view-layout/side-view-layout.component.d.ts +28 -0
  89. package/lib/layouts/views/view-layout/view-layout.component.d.ts +31 -0
  90. package/lib/ng-components.module.d.ts +49 -0
  91. package/lib/pages/auth/auth-callback/auth-callback.component.d.ts +13 -0
  92. package/lib/pages/auth/auth-renew/auth-renew.component.d.ts +12 -0
  93. package/lib/pages/auth/logged-out/logged-out.component.d.ts +12 -0
  94. package/lib/pages/http-status/error/error.component.d.ts +8 -0
  95. package/lib/pages/http-status/page-not-found/page-not-found.component.d.ts +8 -0
  96. package/lib/pages/http-status/unauthorized/unauthorized.component.d.ts +8 -0
  97. package/lib/pipes/address.pipe.d.ts +8 -0
  98. package/lib/pipes/duration-format.pipe.d.ts +8 -0
  99. package/lib/services/component-loader/component-loader-options.class.d.ts +30 -0
  100. package/lib/services/component-loader/component-loader.class.d.ts +92 -0
  101. package/lib/services/component-loader/component-loader.factory.d.ts +24 -0
  102. package/lib/services/component-loader/content-ref.class.d.ts +12 -0
  103. package/lib/services/modal-service/modal-backdrop-component.d.ts +20 -0
  104. package/lib/services/modal-service/modal-container-component.d.ts +33 -0
  105. package/lib/services/modal-service/modal-options.class.d.ts +81 -0
  106. package/lib/services/modal-service/modal-service.d.ts +58 -0
  107. package/lib/services/modal-service/modal-styles.class.d.ts +10 -0
  108. package/lib/services/modal-service/modal.class.d.ts +43 -0
  109. package/lib/services/toaster.service.d.ts +11 -0
  110. package/lib/tokens.d.ts +5 -0
  111. package/lib/types.d.ts +153 -0
  112. package/{src/assets/styles/modal.css → modal.css} +157 -157
  113. package/package.json +24 -20
  114. package/{src/public-api.ts → public-api.d.ts} +43 -60
  115. package/CHANGELOG.md +0 -1
  116. package/karma.conf.js +0 -44
  117. package/ng-package.json +0 -10
  118. package/scripts/css-bundle.ts +0 -33
  119. package/src/_styles.css +0 -36
  120. package/src/_tests/utilities.service.spec.ts +0 -16
  121. package/src/assets/styles/avatar-initials.css +0 -37
  122. package/src/assets/styles/base.css +0 -46
  123. package/src/assets/styles/cards.css +0 -71
  124. package/src/assets/styles/collapsible-panel.css +0 -25
  125. package/src/assets/styles/components.css +0 -34
  126. package/src/assets/styles/date-picker.component.css +0 -0
  127. package/src/assets/styles/drop-down-menu.css +0 -50
  128. package/src/assets/styles/form-layout.css +0 -49
  129. package/src/assets/styles/list-view-empty-state.css +0 -0
  130. package/src/assets/styles/list-view.css +0 -64
  131. package/src/assets/styles/model-view-layout.css +0 -45
  132. package/src/assets/styles/nav-links.css +0 -35
  133. package/src/assets/styles/notifications-indicator.component.css +0 -43
  134. package/src/assets/styles/pager.css +0 -29
  135. package/src/assets/styles/shell-layout.css +0 -232
  136. package/src/assets/styles/side-pane.css +0 -46
  137. package/src/assets/styles/side-view-layout.css +0 -58
  138. package/src/assets/styles/toast.css +0 -72
  139. package/src/assets/styles/toggle.css +0 -26
  140. package/src/assets/styles/view-layout.css +0 -58
  141. package/src/lib/controls/avatar-initials/avatar-initials.component.html +0 -3
  142. package/src/lib/controls/avatar-initials/avatar-initials.component.ts +0 -47
  143. package/src/lib/controls/collapsible-panel/collapsible-panel.component.html +0 -15
  144. package/src/lib/controls/collapsible-panel/collapsible-panel.component.ts +0 -16
  145. package/src/lib/controls/date-picker/date-picker.component.html +0 -133
  146. package/src/lib/controls/date-picker/date-picker.component.ts +0 -258
  147. package/src/lib/controls/drop-down-menu/drop-down-menu.component.html +0 -61
  148. package/src/lib/controls/drop-down-menu/drop-down-menu.component.ts +0 -59
  149. package/src/lib/controls/kpi-tile/kpi-tile.component.html +0 -18
  150. package/src/lib/controls/kpi-tile/kpi-tile.component.ts +0 -26
  151. package/src/lib/controls/list-view/list-column.component.ts +0 -10
  152. package/src/lib/controls/list-view/list-details-section.component.ts +0 -8
  153. package/src/lib/controls/list-view/list-tile.component.ts +0 -8
  154. package/src/lib/controls/list-view/list-view-empty-state.component.html +0 -20
  155. package/src/lib/controls/list-view/list-view-empty-state.component.ts +0 -19
  156. package/src/lib/controls/list-view/list-view.component.html +0 -151
  157. package/src/lib/controls/list-view/list-view.component.ts +0 -146
  158. package/src/lib/controls/nav-links-list/nav-links-list.component.html +0 -27
  159. package/src/lib/controls/nav-links-list/nav-links-list.component.ts +0 -25
  160. package/src/lib/controls/notifications-indicator/notifications-indicator.component.html +0 -78
  161. package/src/lib/controls/notifications-indicator/notifications-indicator.component.ts +0 -75
  162. package/src/lib/controls/pager/pager.component.html +0 -33
  163. package/src/lib/controls/pager/pager.component.ts +0 -106
  164. package/src/lib/controls/side-pane/side-pane.component.html +0 -10
  165. package/src/lib/controls/side-pane/side-pane.component.ts +0 -59
  166. package/src/lib/controls/skeleton-loader/skeleton-loader.component.html +0 -112
  167. package/src/lib/controls/skeleton-loader/skeleton-loader.component.ts +0 -20
  168. package/src/lib/controls/toaster/toaster-container.component.html +0 -1
  169. package/src/lib/controls/toaster/toaster-container.component.ts +0 -27
  170. package/src/lib/controls/toaster/toaster.component.html +0 -103
  171. package/src/lib/controls/toaster/toaster.component.ts +0 -26
  172. package/src/lib/controls/toggle/toggle.component.html +0 -15
  173. package/src/lib/controls/toggle/toggle.component.ts +0 -58
  174. package/src/lib/directives/click-outside.directive.ts +0 -196
  175. package/src/lib/directives/dynamic-component-host.directive.ts +0 -7
  176. package/src/lib/directives/screen-size.directive.ts +0 -67
  177. package/src/lib/helpers/base-list.component.ts +0 -204
  178. package/src/lib/icons.ts +0 -39
  179. package/src/lib/layouts/shell/shell-footer/shell-footer.component.html +0 -71
  180. package/src/lib/layouts/shell/shell-footer/shell-footer.component.ts +0 -14
  181. package/src/lib/layouts/shell/shell-header/shell-header.component.html +0 -199
  182. package/src/lib/layouts/shell/shell-header/shell-header.component.ts +0 -111
  183. package/src/lib/layouts/shell/shell-layout/shell-layout.component.html +0 -36
  184. package/src/lib/layouts/shell/shell-layout/shell-layout.component.ts +0 -91
  185. package/src/lib/layouts/views/form-layout/form-layout.component.html +0 -67
  186. package/src/lib/layouts/views/form-layout/form-layout.component.ts +0 -66
  187. package/src/lib/layouts/views/model-view-layout/model-view-layout.component.html +0 -43
  188. package/src/lib/layouts/views/model-view-layout/model-view-layout.component.ts +0 -37
  189. package/src/lib/layouts/views/side-view-layout/side-view-layout.component.html +0 -36
  190. package/src/lib/layouts/views/side-view-layout/side-view-layout.component.ts +0 -67
  191. package/src/lib/layouts/views/view-layout/view-layout.component.html +0 -68
  192. package/src/lib/layouts/views/view-layout/view-layout.component.ts +0 -82
  193. package/src/lib/ng-components.module.ts +0 -135
  194. package/src/lib/pages/auth/auth-callback/auth-callback.component.html +0 -1
  195. package/src/lib/pages/auth/auth-callback/auth-callback.component.ts +0 -22
  196. package/src/lib/pages/auth/auth-renew/auth-renew.component.ts +0 -20
  197. package/src/lib/pages/auth/logged-out/logged-out.component.html +0 -1
  198. package/src/lib/pages/auth/logged-out/logged-out.component.ts +0 -22
  199. package/src/lib/pages/http-status/error/error.component.html +0 -13
  200. package/src/lib/pages/http-status/error/error.component.ts +0 -13
  201. package/src/lib/pages/http-status/page-not-found/page-not-found.component.html +0 -14
  202. package/src/lib/pages/http-status/page-not-found/page-not-found.component.ts +0 -14
  203. package/src/lib/pages/http-status/unauthorized/unauthorized.component.html +0 -15
  204. package/src/lib/pages/http-status/unauthorized/unauthorized.component.ts +0 -11
  205. package/src/lib/pipes/address.pipe.ts +0 -17
  206. package/src/lib/pipes/duration-format.pipe.ts +0 -67
  207. package/src/lib/services/component-loader/component-loader-options.class.ts +0 -31
  208. package/src/lib/services/component-loader/component-loader.class.ts +0 -226
  209. package/src/lib/services/component-loader/component-loader.factory.ts +0 -27
  210. package/src/lib/services/component-loader/content-ref.class.ts +0 -10
  211. package/src/lib/services/interceptors/bad-request.interceptor.ts +0 -34
  212. package/src/lib/services/modal-service/modal-backdrop-component.ts +0 -40
  213. package/src/lib/services/modal-service/modal-container-component.ts +0 -125
  214. package/src/lib/services/modal-service/modal-options.class.ts +0 -92
  215. package/src/lib/services/modal-service/modal-service.ts +0 -237
  216. package/src/lib/services/modal-service/modal-styles.class.ts +0 -11
  217. package/src/lib/services/modal-service/modal.class.ts +0 -45
  218. package/src/lib/services/shell-state-service.service.ts +0 -10
  219. package/src/lib/services/toaster.service.ts +0 -23
  220. package/src/lib/services/utilities.service.ts +0 -40
  221. package/src/lib/tokens.ts +0 -6
  222. package/src/lib/types.ts +0 -210
  223. package/src/test.ts +0 -28
  224. package/tsconfig.lib.json +0 -26
  225. package/tsconfig.lib.prod.json +0 -10
  226. package/tsconfig.spec.json +0 -17
  227. package/tslint.json +0 -17
  228. package/webpack.config.js +0 -36
@@ -1,133 +0,0 @@
1
- <div class="relative flex"
2
- (clickOutside)="closeCalendar()">
3
-
4
- <input type="text"
5
- #dateInput
6
- [readonly]="readonly"
7
- name="dateInput"
8
- (blur)="onBlur($event)"
9
- id="dateInput"
10
- (focus)="showCalendar = false"
11
- [value]="value | date: displayFormat"
12
- class="w-full focus:ring-0 focus:outline-none rounded-none sm:text-sm border-gray-300 focus:border-0"
13
- [ngClass]="{'cursor-not-allowed': disabled}"
14
- [placeholder]="disabled ? '' : placeholder">
15
-
16
- <button type="button"
17
- class="relative inline-flex items-center px-2 py-2 border border-gray-300 text-sm font-medium rounded-r-sm text-gray-700 bg-gray-50 hover:bg-gray-100 focus:outline-none focus:ring-1 focus:ring-gray-500 focus:border-gray-500"
18
- [disabled]="disabled"
19
- (click)="openCalendar()"
20
- [ngClass]="{'cursor-not-allowed': disabled}">
21
- <i class="ms-Icon ms-Icon--DateTime2"></i>
22
- </button>
23
-
24
- <div *ngIf="showCalendar"
25
- class="bg-gray-100 mt-10 rounded-sm shadow-md p-4 absolute left-0 z-50 w-full"
26
- style="height:18rem;min-width:16rem;"
27
- name="calendar">
28
- <div class="flex justify-between items-center mb-2">
29
- <div>
30
- <button type="button"
31
- (click)="openYears()">
32
- <span class="text-lg font-bold text-gray-800">
33
- {{monthNames[month]}}
34
- </span>
35
- <span class="ml-1 text-lg text-gray-600 font-normal">
36
- {{year}}</span>
37
- </button>
38
- </div>
39
- <div *ngIf="!showYears; else showYearsPickerTmpl">
40
- <button type="button"
41
- class="transition ease-in-out duration-100 inline-flex cursor-pointer hover:bg-gray-200 p-1 rounded-full disabled:opacity-25"
42
- (click)="previousMonth();">
43
- <svg class="h-6 w-6 text-gray-500 inline-flex"
44
- fill="none"
45
- viewBox="0 0 24 24"
46
- stroke="currentColor">
47
- <path stroke-linecap="round"
48
- stroke-linejoin="round"
49
- stroke-width="2"
50
- d="M15 19l-7-7 7-7" />
51
- </svg>
52
- </button>
53
- <button type="button"
54
- class="transition ease-in-out duration-100 inline-flex cursor-pointer hover:bg-gray-200 p-1 rounded-full disabled:opacity-25"
55
- (click)="nextMonth()">
56
- <svg class="h-6 w-6 text-gray-500 inline-flex"
57
- fill="none"
58
- viewBox="0 0 24 24"
59
- stroke="currentColor">
60
- <path stroke-linecap="round"
61
- stroke-linejoin="round"
62
- stroke-width="2"
63
- d="M9 5l7 7-7 7" />
64
- </svg>
65
- </button>
66
- </div>
67
- <ng-template #showYearsPickerTmpl>
68
- <div>
69
- <button type="button"
70
- class="transition ease-in-out duration-100 inline-flex cursor-pointer hover:bg-gray-200 p-1 rounded-full disabled:opacity-25 w-1/2"
71
- (click)="previousYear();">
72
- <svg class="h-6 w-6 text-gray-500 inline-flex"
73
- fill="none"
74
- viewBox="0 0 24 24"
75
- stroke="currentColor">
76
- <path stroke-linecap="round"
77
- stroke-linejoin="round"
78
- stroke-width="2"
79
- d="M15 19l-7-7 7-7" />
80
- </svg>
81
- </button>
82
- <button type="button"
83
- class="transition ease-in-out duration-100 inline-flex cursor-pointer hover:bg-gray-200 p-1 rounded-full disabled:opacity-25 w-1/2"
84
- (click)="nextYear()">
85
- <svg class="h-6 w-6 text-gray-500 inline-flex"
86
- fill="none"
87
- viewBox="0 0 24 24"
88
- stroke="currentColor">
89
- <path stroke-linecap="round"
90
- stroke-linejoin="round"
91
- stroke-width="2"
92
- d="M9 5l7 7-7 7" />
93
- </svg>
94
- </button>
95
- </div>
96
- </ng-template>
97
- </div>
98
-
99
- <div class="flex flex-wrap mb-3 -mx-1"
100
- *ngIf="!showYears; else showCalYearsTmpl">
101
- <div *ngFor="let day of dayNames"
102
- class="text-gray-800 font-medium text-center text-sm uppercase"
103
- style="width: 14.28%">{{day}}</div>
104
- </div>
105
-
106
- <ng-template #showCalYearsTmpl>
107
- <div class="flex flex-wrap -mx-1 items-center">
108
- <div *ngFor="let year of showCalendarYears"
109
- style="width: 18.28%"
110
- class="px-1 mb-1">
111
- <div (click)="selectYearValue(year)"
112
- class="cursor-pointer text-center hover:text-blue-600 text-sm leading-none rounded-full leading-loose transition ease-in-out duration-100"
113
- [class]="year.selected ? 'bg-gray-700 text-blue-600 font-medium' : 'text-gray-800 hover:bg-gray-800'">{{year.year}}</div>
114
- </div>
115
- </div>
116
- </ng-template>
117
-
118
- <div class="flex flex-wrap -mx-1 items-center"
119
- *ngIf="!showYears">
120
- <div *ngFor="let blankday of blankDays"
121
- style="width: 14.28%"
122
- class="text-center border p-1 border-transparent text-sm opacity-50">{{blankday}}</div>
123
- <div *ngFor="let date of calendarDates"
124
- style="width: 14.28%"
125
- class="px-1 mb-1">
126
- <div (click)="selectDateValue(date)"
127
- class="cursor-pointer text-center hover:text-blue-600 text-sm leading-none rounded-full leading-loose transition ease-in-out duration-100"
128
- [class]="date.selected ? 'bg-gray-700 text-blue-600 font-medium' : 'text-gray-800 hover:bg-gray-800'">{{date.day}}</div>
129
- </div>
130
- </div>
131
- </div>
132
-
133
- </div>
@@ -1,258 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, forwardRef, Input, OnInit, Output, ViewChild } from '@angular/core';
2
- import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
3
-
4
- // freaksly simple date picker : https://tailwind-elements.com/docs/standard/forms/datepicker/
5
- @Component({
6
- selector: 'lib-date-picker',
7
- templateUrl: './date-picker.component.html',
8
- providers: [
9
- {
10
- provide: NG_VALUE_ACCESSOR,
11
- useExisting: forwardRef(() => DatepickerComponent),
12
- multi: true
13
- }
14
- ]
15
- })
16
- export class DatepickerComponent implements OnInit, ControlValueAccessor {
17
- @Input() readonly: boolean = false;
18
- @Input() disabled: boolean = false;
19
- @Input('display-format') displayFormat: string | undefined = 'dd/MM/yyyy';
20
- @Input() placeholder: string | undefined = '';
21
- @Input() value: Date | undefined | null = null;
22
- @Output() valueChange: EventEmitter<Date> = new EventEmitter<Date>();
23
- @ViewChild('dateInput') dateInput: ElementRef | undefined;
24
- public showCalendar = false;
25
- public showYears = false;
26
- public monthNames = [
27
- 'Ιανουάριος',
28
- 'Φεβρουάριος',
29
- 'Μάρτιος',
30
- 'Απρίλιος',
31
- 'Μάϊος',
32
- 'Ιούνιος',
33
- 'Ιούλιος',
34
- 'Αύγουστος',
35
- 'Σεπτέμβριος',
36
- 'Οκτώβριος',
37
- 'Νοεμβριος',
38
- 'Δεκέμβριος',
39
- ];
40
- public dayNames = ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'];
41
-
42
- public month: number = -1;
43
- public year: number = -1;
44
- public calendarDates: any[] = [];
45
- public calendarYears: any[] = [];
46
- public showCalendarYears: any[] = [];
47
- public blankDays: any[] = [];
48
- public calendarYearPage = 1;
49
- private yearsPerPage = 30;
50
-
51
- private onChange$: any | undefined = undefined;
52
- private onTouched$: any | undefined = undefined;
53
-
54
- ngOnInit(): void {
55
- let today = new Date();
56
- this.month = today.getMonth();
57
- this.year = today.getFullYear();
58
- this.calendarDates = [{ day: this.value, today: this.value, selected: this.value }];
59
- this.calendarYears = [{ year: this.value?.getFullYear(), today: this.value, selected: this.value }];
60
- const yearsArray = [];
61
- for (let i = 1950; i <= today.getFullYear() + 2; i++) {
62
- yearsArray.push({ year: i, today: this.compareDates(today, null, i), selected: i == this.value?.getFullYear() });
63
- }
64
- this.calendarYears = yearsArray;
65
- this.showCalendarYears = this.paginate(this.calendarYears, 1);
66
- this.calcDays();
67
- }
68
-
69
- constructor() { }
70
-
71
- writeValue(obj: any): void {
72
- if (obj) {
73
- this.value = new Date(obj);
74
- this.month = this.value.getMonth();
75
- this.year = this.value.getFullYear();
76
- }
77
- }
78
-
79
- registerOnChange(fn: (_: any) => void): void {
80
- this.onChange$ = fn;
81
- }
82
-
83
- registerOnTouched(fn: any): void {
84
- this.onTouched$ = fn;
85
- }
86
-
87
- public onBlur(event: any): void {
88
- if (this.onTouched$) {
89
- this.onTouched$();
90
- }
91
- this.getDateFromInput();
92
- }
93
-
94
- public selectDateValue(date: any): void {
95
- // This should be in UTC
96
- let selectedDate = new Date(this.year, this.month, date.day, 3, 0, 0, 0);
97
- this.value = selectedDate;
98
- this.valueChange.emit(this.value);
99
- if (this.onChange$) {
100
- this.onChange$(this.value);
101
- }
102
- this.updateDays();
103
- if (this.onTouched$) {
104
- this.onTouched$();
105
- }
106
- this.showCalendar = false;
107
- }
108
-
109
- public selectYearValue(year: any): void {
110
- // This should be in UTC
111
- let selectedDate = new Date(year.year, this.month ?? 1, this.calendarDates?.find(x => x.selected == true).day ?? 1, 3, 0, 0, 0);
112
- this.year = year.year;
113
- this.value = selectedDate;
114
- this.valueChange.emit(this.value);
115
- if (this.onChange$) {
116
- this.onChange$(this.value);
117
- }
118
- this.updateDays();
119
- if (this.onTouched$) {
120
- this.onTouched$();
121
- }
122
- this.showYears = false;
123
- this.showCalendar = true;
124
- this.calcDays();
125
- }
126
-
127
- public previousMonth(): void {
128
- if (this.month !== 0) {
129
- this.month = this.month - 1;
130
- this.calcDays();
131
- } else {
132
- this.month = 11;
133
- this.year = this.year - 1;
134
- this.calcDays();
135
- }
136
- if (this.onTouched$) {
137
- this.onTouched$();
138
- }
139
- }
140
-
141
- public nextMonth(): void {
142
- if (this.month !== 11) {
143
- this.month = this.month + 1;
144
- this.calcDays();
145
- } else {
146
- this.month = 0;
147
- this.year = this.year + 1;
148
- this.calcDays();
149
- }
150
- if (this.onTouched$) {
151
- this.onTouched$();
152
- }
153
- }
154
-
155
- public previousYear(): void {
156
- this.showCalendarYears = this.paginate(
157
- this.calendarYears,
158
- this.calendarYearPage > 1 ? --this.calendarYearPage : 1);
159
- this.calcDays();
160
- if (this.onTouched$) {
161
- this.onTouched$();
162
- }
163
- }
164
-
165
- public nextYear(): void {
166
- this.showCalendarYears = this.paginate(
167
- this.calendarYears,
168
- this.calendarYearPage <= this.calendarYears.length / this.yearsPerPage
169
- ? ++this.calendarYearPage
170
- : this.calendarYearPage);
171
- this.calcDays();
172
- if (this.onTouched$) {
173
- this.onTouched$();
174
- }
175
- }
176
-
177
- private compareDates(date1: Date | undefined | null, day: number | null | undefined, year: number | null | undefined): boolean {
178
- if (!date1) {
179
- return false;
180
- }
181
- const d = new Date(year ?? this.year, this.month, day ?? this.value?.getDay());
182
- return date1.toDateString() === d.toDateString();
183
- };
184
-
185
- private calcDays(): void {
186
- const daysInMonth = new Date(this.year, this.month + 1, 0).getDate();
187
- // find where to start calendar day of week
188
- const dayOfWeek = new Date(this.year, this.month).getDay();
189
- const blankdaysArray = new Array<number>();
190
- for (var i = 1; i <= dayOfWeek; i++) {
191
- // check if month is February
192
- blankdaysArray.push(this.month != 2 ? (32 - i) : (29 - i));
193
- blankdaysArray.reverse().sort();
194
- }
195
- const daysArray = [];
196
- const today = new Date();
197
- for (var i = 1; i <= daysInMonth; i++) {
198
- daysArray.push({ day: i, today: this.compareDates(today, i, null), selected: this.compareDates(this.value ?? today, i, null) });
199
- }
200
- const yearsArray = [];
201
- for (let i = 1950; i <= today.getFullYear() + 2; i++) {
202
- yearsArray.push({ year: i, today: this.compareDates(today, null, i), selected: i == this.year });
203
- }
204
- this.calendarYears = yearsArray;
205
- this.blankDays = blankdaysArray;
206
- this.calendarDates = daysArray;
207
- }
208
-
209
- private updateDays(): void {
210
- const today = new Date();
211
- this.calendarDates.forEach(d => {
212
- d.today = this.compareDates(today, d, this.year);
213
- d.selected = this.compareDates(this.value, d, this.year);
214
- });
215
- }
216
-
217
- private paginate(array: any[], page_number: number): any[] {
218
- return array.slice((page_number - 1) * this.yearsPerPage, page_number * this.yearsPerPage);
219
- }
220
-
221
- private getDateFromInput() {
222
- if (this.dateInput?.nativeElement.value !== '') {
223
- var dateParts = this.dateInput?.nativeElement.value.split("/");
224
- let dateInGrFormat = new Date(+dateParts[2], dateParts[1] - 1, +dateParts[0], 3, 0, 0);
225
- if (dateInGrFormat.toString() !== 'Invalid Date') {
226
- this.writeValue(dateInGrFormat)
227
- this.calcDays();
228
- this.valueChange.emit(dateInGrFormat);
229
- }
230
- if (this.onChange$) {
231
- this.onChange$(this.value);
232
- }
233
- this.updateDays();
234
- if (this.onTouched$) {
235
- this.onTouched$();
236
- }
237
- }
238
- this.showCalendar = false;
239
- }
240
-
241
- public openYears() {
242
- this.showYears = !this.showYears;
243
- this.calendarYearPage = Math.ceil(this.calendarYears.map(x => x.year).indexOf(this.year) / this.yearsPerPage);
244
- this.showCalendarYears = this.paginate(this.calendarYears, this.calendarYearPage !== 0 ? this.calendarYearPage : 1);
245
- this.calcDays();
246
- }
247
-
248
- public openCalendar() {
249
- this.showCalendar = !this.showCalendar;
250
- this.calcDays();
251
- }
252
-
253
- public closeCalendar(){
254
- this.showCalendar = false;
255
- this.getDateFromInput();
256
- }
257
-
258
- }
@@ -1,61 +0,0 @@
1
- <div class="dropdown-container" (clickOutside)="onClickOutside($event)">
2
- <button
3
- type="button"
4
- (click)="expanded = !expanded"
5
- class="dropdown-button"
6
- aria-haspopup="listbox"
7
- aria-expanded="true"
8
- aria-labelledby="listbox-label"
9
- >
10
- <span class="dropdown-selected-text">
11
- {{ selectedOption?.text || placeholder }}
12
- </span>
13
- <span class="dropdown-button-icon">
14
- <!-- Heroicon name: solid/selector -->
15
- <svg class="dropdown-arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
16
- <path
17
- fill-rule="evenodd"
18
- d="M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z"
19
- clip-rule="evenodd"
20
- />
21
- </svg>
22
- </span>
23
- </button>
24
- <ul
25
- *ngIf="expanded && options && options.length > 0"
26
- class="dropdown-ul"
27
- tabindex="-1"
28
- role="listbox"
29
- aria-labelledby="listbox-label"
30
- aria-activedescendant="listbox-option-3"
31
- >
32
- <ng-container *ngFor="let option of options">
33
- <li
34
- [class]="isSelected(option) ? 'dropdown-li-selected' : 'dropdown-li'"
35
- (click)="selectOption(option)"
36
- id="listbox-option-0"
37
- role="option"
38
- >
39
- <span [class]="isSelected(option) ? 'dropdown-li-selected-text' : 'dropdown-li-text'">
40
- {{ option.text }}
41
- </span>
42
- <span *ngIf="isSelected(option)" class="dropdown-li-selected-indicator-container">
43
- <!-- Heroicon name: solid/check -->
44
- <svg
45
- class="dropdown-li-selected-indicator"
46
- xmlns="http://www.w3.org/2000/svg"
47
- viewBox="0 0 20 20"
48
- fill="currentColor"
49
- aria-hidden="true"
50
- >
51
- <path
52
- fill-rule="evenodd"
53
- d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
54
- clip-rule="evenodd"
55
- />
56
- </svg>
57
- </span>
58
- </li>
59
- </ng-container>
60
- </ul>
61
- </div>
@@ -1,59 +0,0 @@
1
- import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
2
- import { MenuOption } from '../../types';
3
-
4
- @Component({
5
- // tslint:disable-next-line:component-selector
6
- selector: 'lib-drop-down-menu',
7
- templateUrl: './drop-down-menu.component.html',
8
- })
9
- export class DropDownMenuComponent implements OnInit, OnChanges {
10
- @Input() options: MenuOption[] = [];
11
- // tslint:disable-next-line:no-input-rename
12
- @Input('selected') selectedValue: any | null = null;
13
- @Input() multiple = false;
14
- @Input() placeholder: string = 'Παρακαλώ επιλέξτε...';
15
-
16
- private selectedOption$: MenuOption | null = null;
17
- public get selectedOption(): MenuOption | null {
18
- return this.selectedOption$;
19
- }
20
- public set selectedOption(option: MenuOption | null) {
21
- this.selectedOption$ = option;
22
- this.selectedValue = option ? option.value : null;
23
- this.expanded = false;
24
- }
25
-
26
- @Output() selectedChange: EventEmitter<any> = new EventEmitter<any>();
27
- @Output() selectedChanged: EventEmitter<any> = new EventEmitter<any>();
28
-
29
- private expanded$ = false;
30
- public get expanded(): boolean {
31
- return this.expanded$;
32
- }
33
- public set expanded(value: boolean) {
34
- this.expanded$ = value;
35
- }
36
- constructor() {}
37
-
38
- ngOnChanges(changes: SimpleChanges): void {
39
- if (this.options && this.options.length > 0 && this.selectedValue !== null && this.selectedValue !== undefined) {
40
- this.selectedOption$ = this.options.filter((o) => o.value === this.selectedValue)[0];
41
- }
42
- }
43
-
44
- ngOnInit(): void {}
45
-
46
- public isSelected(option: MenuOption): boolean {
47
- return option != null && this.selectedValue != null && option.value === this.selectedValue;
48
- }
49
-
50
- public onClickOutside($event: any): void {
51
- this.expanded = false;
52
- }
53
-
54
- public selectOption(option: MenuOption): void {
55
- this.selectedOption = option;
56
- this.selectedChange.emit(option.value);
57
- this.selectedChanged.emit(option.value);
58
- }
59
- }
@@ -1,18 +0,0 @@
1
- <div class="card"
2
- [ngClass]="{'card-deck-busy' : busy }">
3
- <div class="card-body">
4
- <div class="kpi-tile-title-container">
5
- <a href="#"
6
- class="kpi-tile-action"
7
- (click)="emitTileAction($event)">{{title || '-'}}</a>
8
- </div>
9
- <p class="kpi-tile-value">{{kpi || '-'}}</p>
10
- <div class="card-footer">
11
- <div class="text-xs">
12
- <a href="#"
13
- class="kpi-tile-action"
14
- (click)="emitTileAction($event)">Περισσότερα</a>
15
- </div>
16
- </div>
17
- </div>
18
- </div>
@@ -1,26 +0,0 @@
1
- import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'lib-kpi-tile',
5
- templateUrl: './kpi-tile.component.html'
6
- })
7
- export class KpiTileComponent implements OnInit {
8
-
9
- @Input() title: string | undefined = undefined;
10
- @Input() busy = false;
11
- @Input() kpi: any | undefined = undefined;
12
- // tslint:disable-next-line:no-output-rename
13
- @Output('tile-action') tileAction: EventEmitter<any> = new EventEmitter<any>();
14
- constructor() { }
15
-
16
- ngOnInit(): void {
17
- }
18
-
19
- public emitTileAction($event: any): boolean {
20
- $event.preventDefault();
21
- $event.stopPropagation();
22
- this.tileAction.emit($event);
23
- return false;
24
- }
25
-
26
- }
@@ -1,10 +0,0 @@
1
- import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';
2
-
3
- @Component({selector: 'lib-list-column', template: '<ng-content></ng-content>'})
4
- export class ListColumnComponent {
5
- @Input() title: string | null = null;
6
- // tslint:disable-next-line:no-input-rename
7
- @Input('full-width') fullWidth = false;
8
- @ContentChild(TemplateRef) template: any | null = null;
9
- constructor() { }
10
- }
@@ -1,8 +0,0 @@
1
- import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';
2
-
3
- @Component({ selector: 'lib-list-details-section', template: '<ng-content></ng-content>' })
4
- export class ListDetailsSectionComponent{
5
- @ContentChild(TemplateRef) template: any | null = null;
6
- constructor() {
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';
2
-
3
- @Component({ selector: 'lib-list-tile', template: '<ng-content></ng-content>' })
4
- export class ListTileComponent{
5
- @ContentChild(TemplateRef) template: any | null = null;
6
- constructor() {
7
- }
8
- }
@@ -1,20 +0,0 @@
1
- <div class="p-20">
2
- <div class="text-center p-2">
3
- <svg xmlns="http://www.w3.org/2000/svg" class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
4
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4" />
5
- </svg>
6
- <h3 class="mt-2 text-sm font-medium text-gray-900">{{title}}</h3>
7
- <p class="mt-1 text-sm text-gray-500">
8
- {{subTitle}}
9
- </p>
10
- <div class="mt-6" *ngIf="false">
11
- <button type="button" class="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-gray-600 hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-gray-500">
12
- <!-- Heroicon name: solid/plus -->
13
- <svg class="-ml-1 mr-2 h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
14
- <path vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z" />
15
- </svg>
16
- {{newItemLabel}}
17
- </button>
18
- </div>
19
- </div>
20
- </div>
@@ -1,19 +0,0 @@
1
- import { Component, Input, OnInit } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'lib-list-view-empty-state',
5
- templateUrl: './list-view-empty-state.component.html'
6
- })
7
- export class ListViewEmptyStateComponent implements OnInit {
8
-
9
- @Input() title = 'Δεν βρέθηκαν εγγραφές.';
10
- // tslint:disable-next-line:no-input-rename
11
- @Input('sub-title') subTitle = 'Παρακαλώ αλλάξτε τα κριτήρια αναζήτησης σας ή ξεκινήστε προσθέτοντας μια νέα εγγραφή';
12
- // tslint:disable-next-line:no-input-rename
13
- @Input('new-item-label') newItemLabel = 'Νέα εγγραφή';
14
- constructor() { }
15
-
16
- ngOnInit(): void {
17
- }
18
-
19
- }