@smartsoft001/crud-shell-angular 1.1.734 → 1.1.736

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 (210) hide show
  1. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  2. package/{esm2015/lib/+state/crud.actions.js → esm2020/lib/+state/crud.actions.mjs} +0 -0
  3. package/esm2020/lib/+state/crud.effects.mjs +182 -0
  4. package/esm2020/lib/+state/crud.facade.mjs +88 -0
  5. package/esm2020/lib/+state/crud.reducer.mjs +212 -0
  6. package/{esm2015/lib/+state/crud.selectors.js → esm2020/lib/+state/crud.selectors.mjs} +0 -0
  7. package/esm2020/lib/components/components.module.mjs +109 -0
  8. package/esm2020/lib/components/export/export.component.mjs +47 -0
  9. package/esm2020/lib/components/filter/base/base.component.mjs +140 -0
  10. package/esm2020/lib/components/filter/check/check.component.mjs +36 -0
  11. package/esm2020/lib/components/filter/date/date.component.mjs +41 -0
  12. package/esm2020/lib/components/filter/date-with-edit/date-with-edit.component.mjs +45 -0
  13. package/esm2020/lib/components/filter/filter.component.mjs +29 -0
  14. package/esm2020/lib/components/filter/flag/flag.component.mjs +16 -0
  15. package/{esm2015/lib/components/filter/index.js → esm2020/lib/components/filter/index.mjs} +0 -0
  16. package/esm2020/lib/components/filter/int/int.component.mjs +33 -0
  17. package/esm2020/lib/components/filter/radio/radio.component.mjs +16 -0
  18. package/esm2020/lib/components/filter/text/text.component.mjs +16 -0
  19. package/esm2020/lib/components/filters/filters.component.mjs +111 -0
  20. package/esm2020/lib/components/filters-config/filters-config.component.mjs +37 -0
  21. package/esm2020/lib/components/group/group.component.mjs +54 -0
  22. package/{esm2015/lib/components/index.js → esm2020/lib/components/index.mjs} +0 -0
  23. package/esm2020/lib/components/multiselect/multiselect.component.mjs +68 -0
  24. package/esm2020/lib/crud-full.module.mjs +105 -0
  25. package/esm2020/lib/crud.config.mjs +17 -0
  26. package/esm2020/lib/crud.module.mjs +107 -0
  27. package/esm2020/lib/factories/list-pagination/list-pagination.factory.mjs +69 -0
  28. package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
  29. package/{esm2015/lib/models/interfaces.js → esm2020/lib/models/interfaces.mjs} +0 -0
  30. package/esm2020/lib/pages/index.mjs +7 -0
  31. package/esm2020/lib/pages/item/base/base.component.mjs +44 -0
  32. package/esm2020/lib/pages/item/item.component.mjs +393 -0
  33. package/esm2020/lib/pages/item/standard/standard.component.mjs +15 -0
  34. package/esm2020/lib/pages/list/base/base.component.mjs +23 -0
  35. package/esm2020/lib/pages/list/list.component.mjs +343 -0
  36. package/esm2020/lib/pages/list/standard/standard.component.mjs +34 -0
  37. package/esm2020/lib/pipes/form-options/form-options.pipe.mjs +55 -0
  38. package/{esm2015/lib/pipes/index.js → esm2020/lib/pipes/index.mjs} +0 -0
  39. package/esm2020/lib/pipes/pipes.module.mjs +20 -0
  40. package/{esm2015/lib/providers/model-possibilities/model-possibilities.provider.js → esm2020/lib/providers/model-possibilities/model-possibilities.provider.mjs} +0 -0
  41. package/esm2020/lib/services/crud/crud.service.mjs +138 -0
  42. package/esm2020/lib/services/list-group/list-group.service.mjs +60 -0
  43. package/esm2020/lib/services/page/page.service.mjs +41 -0
  44. package/{esm2015/lib/services/search/search.service.js → esm2020/lib/services/search/search.service.mjs} +9 -8
  45. package/esm2020/lib/services/socket/socket.service.mjs +17 -0
  46. package/esm2020/smartsoft001-crud-shell-angular.mjs +5 -0
  47. package/fesm2015/smartsoft001-crud-shell-angular.mjs +2569 -0
  48. package/fesm2015/smartsoft001-crud-shell-angular.mjs.map +1 -0
  49. package/fesm2020/smartsoft001-crud-shell-angular.mjs +2729 -0
  50. package/fesm2020/smartsoft001-crud-shell-angular.mjs.map +1 -0
  51. package/lib/+state/crud.effects.d.ts +3 -0
  52. package/lib/+state/crud.effects.d.ts.map +1 -1
  53. package/lib/+state/crud.facade.d.ts +3 -0
  54. package/lib/+state/crud.facade.d.ts.map +1 -1
  55. package/lib/components/components.module.d.ts +22 -0
  56. package/lib/components/components.module.d.ts.map +1 -1
  57. package/lib/components/export/export.component.d.ts +3 -0
  58. package/lib/components/export/export.component.d.ts.map +1 -1
  59. package/lib/components/filter/base/base.component.d.ts +3 -0
  60. package/lib/components/filter/base/base.component.d.ts.map +1 -1
  61. package/lib/components/filter/check/check.component.d.ts +3 -0
  62. package/lib/components/filter/check/check.component.d.ts.map +1 -1
  63. package/lib/components/filter/date/date.component.d.ts +3 -0
  64. package/lib/components/filter/date/date.component.d.ts.map +1 -1
  65. package/lib/components/filter/date-with-edit/date-with-edit.component.d.ts +3 -0
  66. package/lib/components/filter/date-with-edit/date-with-edit.component.d.ts.map +1 -1
  67. package/lib/components/filter/filter.component.d.ts +3 -0
  68. package/lib/components/filter/filter.component.d.ts.map +1 -1
  69. package/lib/components/filter/flag/flag.component.d.ts +3 -0
  70. package/lib/components/filter/flag/flag.component.d.ts.map +1 -1
  71. package/lib/components/filter/int/int.component.d.ts +3 -0
  72. package/lib/components/filter/int/int.component.d.ts.map +1 -1
  73. package/lib/components/filter/radio/radio.component.d.ts +3 -0
  74. package/lib/components/filter/radio/radio.component.d.ts.map +1 -1
  75. package/lib/components/filter/text/text.component.d.ts +3 -0
  76. package/lib/components/filter/text/text.component.d.ts.map +1 -1
  77. package/lib/components/filters/filters.component.d.ts +3 -0
  78. package/lib/components/filters/filters.component.d.ts.map +1 -1
  79. package/lib/components/filters-config/filters-config.component.d.ts +3 -0
  80. package/lib/components/filters-config/filters-config.component.d.ts.map +1 -1
  81. package/lib/components/group/group.component.d.ts +3 -0
  82. package/lib/components/group/group.component.d.ts.map +1 -1
  83. package/lib/components/multiselect/multiselect.component.d.ts +3 -0
  84. package/lib/components/multiselect/multiselect.component.d.ts.map +1 -1
  85. package/lib/crud-full.module.d.ts +20 -0
  86. package/lib/crud-full.module.d.ts.map +1 -1
  87. package/lib/crud.config.d.ts +5 -0
  88. package/lib/crud.config.d.ts.map +1 -1
  89. package/lib/crud.module.d.ts +13 -0
  90. package/lib/crud.module.d.ts.map +1 -1
  91. package/lib/factories/list-pagination/list-pagination.factory.d.ts +3 -0
  92. package/lib/factories/list-pagination/list-pagination.factory.d.ts.map +1 -1
  93. package/lib/pages/index.d.ts +5 -1
  94. package/lib/pages/index.d.ts.map +1 -1
  95. package/lib/pages/item/base/base.component.d.ts +3 -0
  96. package/lib/pages/item/base/base.component.d.ts.map +1 -1
  97. package/lib/pages/item/item.component.d.ts +3 -0
  98. package/lib/pages/item/item.component.d.ts.map +1 -1
  99. package/lib/pages/item/standard/standard.component.d.ts +3 -0
  100. package/lib/pages/item/standard/standard.component.d.ts.map +1 -1
  101. package/lib/pages/list/base/base.component.d.ts +3 -0
  102. package/lib/pages/list/base/base.component.d.ts.map +1 -1
  103. package/lib/pages/list/list.component.d.ts +3 -0
  104. package/lib/pages/list/list.component.d.ts.map +1 -1
  105. package/lib/pages/list/standard/standard.component.d.ts +3 -0
  106. package/lib/pages/list/standard/standard.component.d.ts.map +1 -1
  107. package/lib/pipes/form-options/form-options.pipe.d.ts +3 -0
  108. package/lib/pipes/form-options/form-options.pipe.d.ts.map +1 -1
  109. package/lib/pipes/pipes.module.d.ts +5 -0
  110. package/lib/pipes/pipes.module.d.ts.map +1 -1
  111. package/lib/services/crud/crud.service.d.ts +3 -0
  112. package/lib/services/crud/crud.service.d.ts.map +1 -1
  113. package/lib/services/list-group/list-group.service.d.ts +3 -0
  114. package/lib/services/list-group/list-group.service.d.ts.map +1 -1
  115. package/lib/services/page/page.service.d.ts +3 -0
  116. package/lib/services/page/page.service.d.ts.map +1 -1
  117. package/lib/services/search/search.service.d.ts +3 -0
  118. package/lib/services/search/search.service.d.ts.map +1 -1
  119. package/lib/services/socket/socket.service.d.ts +5 -0
  120. package/lib/services/socket/socket.service.d.ts.map +1 -1
  121. package/package.json +38 -25
  122. package/smartsoft001-crud-shell-angular.d.ts +1 -17
  123. package/smartsoft001-crud-shell-angular.d.ts.map +1 -1
  124. package/bundles/smartsoft001-crud-shell-angular.umd.js +0 -3332
  125. package/bundles/smartsoft001-crud-shell-angular.umd.js.map +0 -1
  126. package/esm2015/lib/+state/crud.effects.js +0 -178
  127. package/esm2015/lib/+state/crud.facade.js +0 -92
  128. package/esm2015/lib/+state/crud.reducer.js +0 -92
  129. package/esm2015/lib/components/components.module.js +0 -65
  130. package/esm2015/lib/components/export/export.component.js +0 -55
  131. package/esm2015/lib/components/filter/base/base.component.js +0 -144
  132. package/esm2015/lib/components/filter/check/check.component.js +0 -34
  133. package/esm2015/lib/components/filter/date/date.component.js +0 -42
  134. package/esm2015/lib/components/filter/date-with-edit/date-with-edit.component.js +0 -43
  135. package/esm2015/lib/components/filter/filter.component.js +0 -30
  136. package/esm2015/lib/components/filter/flag/flag.component.js +0 -13
  137. package/esm2015/lib/components/filter/int/int.component.js +0 -31
  138. package/esm2015/lib/components/filter/radio/radio.component.js +0 -13
  139. package/esm2015/lib/components/filter/text/text.component.js +0 -13
  140. package/esm2015/lib/components/filters/filters.component.js +0 -124
  141. package/esm2015/lib/components/filters-config/filters-config.component.js +0 -46
  142. package/esm2015/lib/components/group/group.component.js +0 -65
  143. package/esm2015/lib/components/multiselect/multiselect.component.js +0 -74
  144. package/esm2015/lib/crud-full.module.js +0 -83
  145. package/esm2015/lib/crud.config.js +0 -14
  146. package/esm2015/lib/crud.module.js +0 -84
  147. package/esm2015/lib/factories/list-pagination/list-pagination.factory.js +0 -73
  148. package/esm2015/lib/pages/index.js +0 -3
  149. package/esm2015/lib/pages/item/base/base.component.js +0 -44
  150. package/esm2015/lib/pages/item/item.component.js +0 -383
  151. package/esm2015/lib/pages/item/standard/standard.component.js +0 -13
  152. package/esm2015/lib/pages/list/base/base.component.js +0 -30
  153. package/esm2015/lib/pages/list/list.component.js +0 -319
  154. package/esm2015/lib/pages/list/standard/standard.component.js +0 -39
  155. package/esm2015/lib/pipes/form-options/form-options.pipe.js +0 -56
  156. package/esm2015/lib/pipes/pipes.module.js +0 -16
  157. package/esm2015/lib/services/crud/crud.service.js +0 -143
  158. package/esm2015/lib/services/list-group/list-group.service.js +0 -61
  159. package/esm2015/lib/services/page/page.service.js +0 -48
  160. package/esm2015/lib/services/socket/socket.service.js +0 -14
  161. package/esm2015/smartsoft001-crud-shell-angular.js +0 -22
  162. package/fesm2015/smartsoft001-crud-shell-angular.js +0 -2676
  163. package/fesm2015/smartsoft001-crud-shell-angular.js.map +0 -1
  164. package/lib/+state/crud.effects.ngfactory.d.ts.map +0 -1
  165. package/lib/+state/crud.facade.ngfactory.d.ts.map +0 -1
  166. package/lib/components/components.module.ngfactory.d.ts.map +0 -1
  167. package/lib/components/export/export.component.ngfactory.d.ts.map +0 -1
  168. package/lib/components/export/export.component.scss.shim.ngstyle.d.ts.map +0 -1
  169. package/lib/components/filter/check/check.component.ngfactory.d.ts.map +0 -1
  170. package/lib/components/filter/check/check.component.scss.shim.ngstyle.d.ts.map +0 -1
  171. package/lib/components/filter/date/date.component.ngfactory.d.ts.map +0 -1
  172. package/lib/components/filter/date/date.component.scss.shim.ngstyle.d.ts.map +0 -1
  173. package/lib/components/filter/date-with-edit/date-with-edit.component.ngfactory.d.ts.map +0 -1
  174. package/lib/components/filter/date-with-edit/date-with-edit.component.scss.shim.ngstyle.d.ts.map +0 -1
  175. package/lib/components/filter/filter.component.ngfactory.d.ts.map +0 -1
  176. package/lib/components/filter/filter.component.scss.shim.ngstyle.d.ts.map +0 -1
  177. package/lib/components/filter/flag/flag.component.ngfactory.d.ts.map +0 -1
  178. package/lib/components/filter/flag/flag.component.scss.shim.ngstyle.d.ts.map +0 -1
  179. package/lib/components/filter/int/int.component.ngfactory.d.ts.map +0 -1
  180. package/lib/components/filter/int/int.component.scss.shim.ngstyle.d.ts.map +0 -1
  181. package/lib/components/filter/radio/radio.component.ngfactory.d.ts.map +0 -1
  182. package/lib/components/filter/radio/radio.component.scss.shim.ngstyle.d.ts.map +0 -1
  183. package/lib/components/filter/text/text.component.ngfactory.d.ts.map +0 -1
  184. package/lib/components/filter/text/text.component.scss.shim.ngstyle.d.ts.map +0 -1
  185. package/lib/components/filters/filters.component.ngfactory.d.ts.map +0 -1
  186. package/lib/components/filters/filters.component.scss.shim.ngstyle.d.ts.map +0 -1
  187. package/lib/components/filters-config/filters-config.component.ngfactory.d.ts.map +0 -1
  188. package/lib/components/filters-config/filters-config.component.scss.shim.ngstyle.d.ts.map +0 -1
  189. package/lib/components/group/group.component.ngfactory.d.ts.map +0 -1
  190. package/lib/components/group/group.component.scss.shim.ngstyle.d.ts.map +0 -1
  191. package/lib/components/multiselect/multiselect.component.ngfactory.d.ts.map +0 -1
  192. package/lib/components/multiselect/multiselect.component.scss.shim.ngstyle.d.ts.map +0 -1
  193. package/lib/crud-full.module.ngfactory.d.ts.map +0 -1
  194. package/lib/crud.config.ngfactory.d.ts.map +0 -1
  195. package/lib/crud.module.ngfactory.d.ts.map +0 -1
  196. package/lib/factories/list-pagination/list-pagination.factory.ngfactory.d.ts.map +0 -1
  197. package/lib/pages/item/item.component.ngfactory.d.ts.map +0 -1
  198. package/lib/pages/item/standard/standard.component.ngfactory.d.ts.map +0 -1
  199. package/lib/pages/item/standard/standard.component.scss.shim.ngstyle.d.ts.map +0 -1
  200. package/lib/pages/list/list.component.ngfactory.d.ts.map +0 -1
  201. package/lib/pages/list/standard/standard.component.ngfactory.d.ts.map +0 -1
  202. package/lib/pages/list/standard/standard.component.scss.shim.ngstyle.d.ts.map +0 -1
  203. package/lib/pipes/form-options/form-options.pipe.ngfactory.d.ts.map +0 -1
  204. package/lib/pipes/pipes.module.ngfactory.d.ts.map +0 -1
  205. package/lib/services/crud/crud.service.ngfactory.d.ts.map +0 -1
  206. package/lib/services/list-group/list-group.service.ngfactory.d.ts.map +0 -1
  207. package/lib/services/page/page.service.ngfactory.d.ts.map +0 -1
  208. package/lib/services/search/search.service.ngfactory.d.ts.map +0 -1
  209. package/lib/services/socket/socket.service.ngfactory.d.ts.map +0 -1
  210. package/smartsoft001-crud-shell-angular.metadata.json +0 -1
@@ -0,0 +1,2569 @@
1
+ import * as i1 from '@ngrx/store';
2
+ import { createFeatureSelector, createSelector, select as select$1, StoreModule } from '@ngrx/store';
3
+ import * as i0 from '@angular/core';
4
+ import { Injectable, Component, InjectionToken, Directive, Optional, Inject, Input, ViewChild, Pipe, NgModule, ViewContainerRef, QueryList, TemplateRef, ViewChildren, EventEmitter, Output } from '@angular/core';
5
+ import * as i3 from '@smartsoft001/angular';
6
+ import { NgrxStoreService, BaseComponent as BaseComponent$1, SharedModule, PaginationMode, CreateDynamicComponent, ListMode, DynamicContentDirective, FormComponent, NgrxSharedModule, FILE_SERVICE_CONFIG } from '@smartsoft001/angular';
7
+ import { map, tap, first, catchError } from 'rxjs/operators';
8
+ import { FieldType, getModelOptions, getModelFieldsWithOptions } from '@smartsoft001/models';
9
+ import * as i1$1 from '@ionic/angular';
10
+ import { IonDatetime, IonContent } from '@ionic/angular';
11
+ import * as moment from 'moment';
12
+ import { __decorate, __metadata, __awaiter } from 'tslib';
13
+ import { Debounce, debounce } from 'lodash-decorators';
14
+ import * as i2 from '@angular/forms';
15
+ import { FormsModule, FormControl, FormGroup, FormArray } from '@angular/forms';
16
+ import * as i3$1 from '@angular/common';
17
+ import { CommonModule } from '@angular/common';
18
+ import * as i4 from '@ngx-translate/core';
19
+ import { Subscription, combineLatest, forkJoin, of, BehaviorSubject } from 'rxjs';
20
+ import * as _ from 'lodash';
21
+ import * as i2$1 from '@angular/common/http';
22
+ import 'reflect-metadata';
23
+ import * as i1$2 from '@angular/router';
24
+ import { RouterModule } from '@angular/router';
25
+
26
+ const getCrudState = (entity) => createFeatureSelector(entity);
27
+ const getCrudSelected = (entity) => createSelector(getCrudState(entity), (state) => state.selected);
28
+ const getCrudMultiSelected = (entity) => createSelector(getCrudState(entity), (state) => state.multiSelected);
29
+ const getCrudList = (entity) => createSelector(getCrudState(entity), (state) => state.list);
30
+ const getCrudTotalCount = (entity) => createSelector(getCrudState(entity), (state) => state.totalCount);
31
+ const getCrudLinks = (entity) => createSelector(getCrudState(entity), (state) => state.links);
32
+ const getCrudLoaded = (entity) => createSelector(getCrudState(entity), (state) => state.loaded);
33
+ const getCrudFilter = (entity) => createSelector(getCrudState(entity), (state) => state.filter);
34
+ const getCrudError = (entity) => createSelector(getCrudState(entity), (state) => state.error);
35
+
36
+ /*
37
+ * Create
38
+ */
39
+ const create = function (entity, item) {
40
+ return {
41
+ type: `[${entity}] Create`,
42
+ item
43
+ };
44
+ };
45
+ const createSuccess = function (entity, item) {
46
+ return {
47
+ type: `[${entity}] Create Success`,
48
+ item
49
+ };
50
+ };
51
+ const createFailure = function (entity, item, error) {
52
+ return {
53
+ type: `[${entity}] Create Failure`,
54
+ item,
55
+ error
56
+ };
57
+ };
58
+ /*
59
+ * Create many
60
+ */
61
+ const createMany = function (entity, data) {
62
+ return {
63
+ type: `[${entity}] Create Many`,
64
+ data
65
+ };
66
+ };
67
+ const createManySuccess = function (entity, data) {
68
+ return {
69
+ type: `[${entity}] Create Many Success`,
70
+ data
71
+ };
72
+ };
73
+ const createManyFailure = function (entity, data, error) {
74
+ return {
75
+ type: `[${entity}] Create Many Failure`,
76
+ data,
77
+ error
78
+ };
79
+ };
80
+ /*
81
+ * Read
82
+ */
83
+ const read = function (entity, filter = null) {
84
+ return {
85
+ type: `[${entity}] Read`,
86
+ filter
87
+ };
88
+ };
89
+ const readSuccess = function (entity, filter, result) {
90
+ return {
91
+ type: `[${entity}] Read Success`,
92
+ result,
93
+ filter
94
+ };
95
+ };
96
+ const readFailure = function (entity, filter, error) {
97
+ return {
98
+ type: `[${entity}] Read Failure`,
99
+ filter,
100
+ error
101
+ };
102
+ };
103
+ /*
104
+ * Export
105
+ */
106
+ const exportList = function (entity, filter = null, format) {
107
+ return {
108
+ type: `[${entity}] Export`,
109
+ filter,
110
+ format
111
+ };
112
+ };
113
+ const exportListSuccess = function (entity, filter) {
114
+ return {
115
+ type: `[${entity}] Export Success`,
116
+ filter
117
+ };
118
+ };
119
+ const exportListFailure = function (entity, filter, error) {
120
+ return {
121
+ type: `[${entity}] Export Failure`,
122
+ filter,
123
+ error
124
+ };
125
+ };
126
+ /*
127
+ * Select
128
+ */
129
+ const select = function (entity, id) {
130
+ return {
131
+ type: `[${entity}] Select`,
132
+ id
133
+ };
134
+ };
135
+ const selectSuccess = function (entity, id, item) {
136
+ return {
137
+ type: `[${entity}] Select Success`,
138
+ id,
139
+ item
140
+ };
141
+ };
142
+ const selectFailure = function (entity, id, error) {
143
+ return {
144
+ type: `[${entity}] Select Failure`,
145
+ id,
146
+ error
147
+ };
148
+ };
149
+ const unselect = function (entity) {
150
+ return {
151
+ type: `[${entity}] Unselect`
152
+ };
153
+ };
154
+ /*
155
+ * MultiSelect
156
+ */
157
+ const multiSelect = function (entity, items) {
158
+ return {
159
+ type: `[${entity}] MultiSelect`,
160
+ items
161
+ };
162
+ };
163
+ /*
164
+ * Update
165
+ */
166
+ const update = function (entity, item) {
167
+ return {
168
+ type: `[${entity}] Update`,
169
+ item
170
+ };
171
+ };
172
+ const updateSuccess = function (entity, item) {
173
+ return {
174
+ type: `[${entity}] Update Success`,
175
+ item
176
+ };
177
+ };
178
+ const updateFailure = function (entity, item, error) {
179
+ return {
180
+ type: `[${entity}] Update Failure`,
181
+ item,
182
+ error
183
+ };
184
+ };
185
+ /*
186
+ * Update partial
187
+ */
188
+ const updatePartial = function (entity, item) {
189
+ return {
190
+ type: `[${entity}] Update partial`,
191
+ item
192
+ };
193
+ };
194
+ const updatePartialSuccess = function (entity, item) {
195
+ return {
196
+ type: `[${entity}] Update partial Success`,
197
+ item
198
+ };
199
+ };
200
+ const updatePartialFailure = function (entity, item, error) {
201
+ return {
202
+ type: `[${entity}] Update partial Failure`,
203
+ item,
204
+ error
205
+ };
206
+ };
207
+ /*
208
+ * Update partial many
209
+ */
210
+ const updatePartialMany = function (entity, items) {
211
+ return {
212
+ type: `[${entity}] Update partial many`,
213
+ items
214
+ };
215
+ };
216
+ const updatePartialManySuccess = function (entity, items) {
217
+ return {
218
+ type: `[${entity}] Update partial many Success`,
219
+ items
220
+ };
221
+ };
222
+ const updatePartialManyFailure = function (entity, items, error) {
223
+ return {
224
+ type: `[${entity}] Update partial many Failure`,
225
+ items,
226
+ error
227
+ };
228
+ };
229
+ /*
230
+ * Delete
231
+ */
232
+ const deleteItem = function (entity, id) {
233
+ return {
234
+ type: `[${entity}] Delete`,
235
+ id
236
+ };
237
+ };
238
+ const deleteSuccess = function (entity, id) {
239
+ return {
240
+ type: `[${entity}] Delete Success`,
241
+ id
242
+ };
243
+ };
244
+ const deleteFailure = function (entity, id, error) {
245
+ return {
246
+ type: `[${entity}] Delete Failure`,
247
+ id,
248
+ error
249
+ };
250
+ };
251
+
252
+ class CrudConfig {
253
+ }
254
+ /** @nocollapse */ /** @nocollapse */ CrudConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
255
+ /** @nocollapse */ /** @nocollapse */ CrudConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudConfig });
256
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudConfig, decorators: [{
257
+ type: Injectable
258
+ }] });
259
+ class CrudFullConfig extends CrudConfig {
260
+ }
261
+ /** @nocollapse */ /** @nocollapse */ CrudFullConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudFullConfig, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
262
+ /** @nocollapse */ /** @nocollapse */ CrudFullConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudFullConfig });
263
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudFullConfig, decorators: [{
264
+ type: Injectable
265
+ }] });
266
+
267
+ class CrudFacade {
268
+ constructor(store, config) {
269
+ this.store = store;
270
+ this.config = config;
271
+ this.loaded$ = this.store.pipe(select$1(getCrudLoaded(this.config.entity)));
272
+ this.loading$ = this.store.pipe(select$1(getCrudLoaded(this.config.entity)), map(l => !l));
273
+ this.selected$ = this.store.pipe(select$1(getCrudSelected(this.config.entity)), tap(s => {
274
+ this.selected = s;
275
+ }));
276
+ this.multiSelected$ = this.store.pipe(select$1(getCrudMultiSelected(this.config.entity)), tap(s => {
277
+ this.multiSelected = s;
278
+ }));
279
+ this.list$ = this.store.pipe(select$1(getCrudList(this.config.entity)), tap(l => {
280
+ this.list = l;
281
+ }));
282
+ this.filter$ = this.store.pipe(select$1(getCrudFilter(this.config.entity)), tap(f => {
283
+ this.filter = f;
284
+ }));
285
+ this.totalCount$ = this.store.pipe(select$1(getCrudTotalCount(this.config.entity)));
286
+ this.links$ = this.store.pipe(select$1(getCrudLinks(this.config.entity)));
287
+ this.error$ = this.store.pipe(select$1(getCrudError(this.config.entity)));
288
+ if (NgrxStoreService.store) {
289
+ this.store = NgrxStoreService.store;
290
+ }
291
+ }
292
+ create(item) {
293
+ this.store.dispatch(create(this.config.entity, item));
294
+ }
295
+ createMany(items, options) {
296
+ this.store.dispatch(createMany(this.config.entity, { items, options }));
297
+ }
298
+ read(filter = null) {
299
+ let baseQuery = [];
300
+ if (this.config.baseQuery) {
301
+ baseQuery = this.config.baseQuery;
302
+ }
303
+ const fullFilter = Object.assign(Object.assign({}, (filter ? filter : {})), { query: filter && filter.query ? filter.query : baseQuery });
304
+ this.store.dispatch(read(this.config.entity, fullFilter));
305
+ }
306
+ select(id) {
307
+ this.store.dispatch(select(this.config.entity, id));
308
+ }
309
+ unselect() {
310
+ this.store.dispatch(unselect(this.config.entity));
311
+ }
312
+ multiSelect(items) {
313
+ this.store.dispatch(multiSelect(this.config.entity, items));
314
+ }
315
+ update(item) {
316
+ this.getStore().dispatch(update(this.config.entity, item));
317
+ }
318
+ export(filter = null, format = null) {
319
+ this.getStore().dispatch(exportList(this.config.entity, filter, format));
320
+ }
321
+ updatePartial(item) {
322
+ this.getStore().dispatch(updatePartial(this.config.entity, item));
323
+ }
324
+ updatePartialMany(items) {
325
+ this.getStore().dispatch(updatePartialMany(this.config.entity, items));
326
+ }
327
+ delete(id) {
328
+ this.getStore().dispatch(deleteItem(this.config.entity, id));
329
+ }
330
+ getStore() {
331
+ if (NgrxStoreService.store)
332
+ return NgrxStoreService.store;
333
+ return this.store;
334
+ }
335
+ }
336
+ /** @nocollapse */ /** @nocollapse */ CrudFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudFacade, deps: [{ token: i1.Store }, { token: CrudConfig }], target: i0.ɵɵFactoryTarget.Injectable });
337
+ /** @nocollapse */ /** @nocollapse */ CrudFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudFacade });
338
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudFacade, decorators: [{
339
+ type: Injectable
340
+ }], ctorParameters: function () { return [{ type: i1.Store }, { type: CrudConfig }]; } });
341
+
342
+ class ExportComponent extends BaseComponent$1 {
343
+ constructor(facade, popoverService, styleService, elementRef) {
344
+ super();
345
+ this.facade = facade;
346
+ this.popoverService = popoverService;
347
+ this.styleService = styleService;
348
+ this.elementRef = elementRef;
349
+ this.buttonExportCsvOptions = this.initButtonExportOptions('csv');
350
+ this.buttonExportXlsxOptions = this.initButtonExportOptions('xlsx');
351
+ this.loading$ = this.facade.loading$;
352
+ }
353
+ ngOnInit() {
354
+ this.styleService.init(this.elementRef);
355
+ }
356
+ initButtonExportOptions(format) {
357
+ return {
358
+ click: () => {
359
+ this.facade.export(Object.assign(Object.assign({}, this.facade.filter), { offset: null, limit: null }), format);
360
+ const subscription = this.facade.loaded$.subscribe(val => {
361
+ if (!val)
362
+ return;
363
+ this.popoverService.close();
364
+ subscription.unsubscribe();
365
+ });
366
+ },
367
+ loading$: this.facade.loading$,
368
+ expand: 'block'
369
+ };
370
+ }
371
+ }
372
+ /** @nocollapse */ /** @nocollapse */ ExportComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ExportComponent, deps: [{ token: CrudFacade }, { token: i3.PopoverService }, { token: i3.StyleService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
373
+ /** @nocollapse */ /** @nocollapse */ ExportComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: ExportComponent, selector: "smart-crud-export", usesInheritance: true, ngImport: i0, template: "<div class=\"smart-content\">\n <p>\n <smart-button [options]=\"buttonExportCsvOptions\">CSV</smart-button>\n </p>\n <p>\n <smart-button [options]=\"buttonExportXlsxOptions\">XLSX</smart-button>\n </p>\n</div>", styles: [".smart-content{padding:1.2rem}.smart-content p{margin:.6rem 0}.smart-content smart-button{width:100%;display:block}\n"], components: [{ type: i3.ButtonComponent, selector: "smart-button", inputs: ["options", "disabled"] }] });
374
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ExportComponent, decorators: [{
375
+ type: Component,
376
+ args: [{ selector: 'smart-crud-export', template: "<div class=\"smart-content\">\n <p>\n <smart-button [options]=\"buttonExportCsvOptions\">CSV</smart-button>\n </p>\n <p>\n <smart-button [options]=\"buttonExportXlsxOptions\">XLSX</smart-button>\n </p>\n</div>", styles: [".smart-content{padding:1.2rem}.smart-content p{margin:.6rem 0}.smart-content smart-button{width:100%;display:block}\n"] }]
377
+ }], ctorParameters: function () { return [{ type: CrudFacade }, { type: i3.PopoverService }, { type: i3.StyleService }, { type: i0.ElementRef }]; } });
378
+
379
+ /**
380
+ * @deprecated - please, use IModelPossibilitiesProvider from @smartsoft001/angular
381
+ */
382
+ class ICrudModelPossibilitiesProvider {
383
+ }
384
+ /**
385
+ * @deprecated - please, use MODEL_POSSIBILITIES_PROVIDER from @smartsoft001/angular
386
+ */
387
+ const CRUD_MODEL_POSSIBILITIES_PROVIDER = new InjectionToken("CRUD_MODEL_POSSIBILITIES_PROVIDER");
388
+
389
+ class BaseComponent {
390
+ constructor(facade, config, modelPossibilitiesProvider) {
391
+ this.facade = facade;
392
+ this.config = config;
393
+ this.modelPossibilitiesProvider = modelPossibilitiesProvider;
394
+ }
395
+ get value() {
396
+ if (this.isArrayType()) {
397
+ return this.filter.query
398
+ .filter((q) => q.key === this.item.key && q.type === this.item.type)
399
+ .map(q => q.value);
400
+ }
401
+ const query = this.filter.query.find((q) => q.key === this.item.key && q.type === this.item.type);
402
+ return query === null || query === void 0 ? void 0 : query.value;
403
+ }
404
+ set value(val) {
405
+ this.refresh(val);
406
+ }
407
+ get minValue() {
408
+ if (this.isArrayType()) {
409
+ return this.filter.query
410
+ .filter((q) => q.key === this.item.key && q.type === ">=")
411
+ .map(q => q.value);
412
+ }
413
+ const query = this.filter.query.find((q) => q.key === this.item.key && q.type === ">=");
414
+ return query === null || query === void 0 ? void 0 : query.value;
415
+ }
416
+ set minValue(val) {
417
+ this.refresh(val, ">=");
418
+ }
419
+ get maxValue() {
420
+ if (this.isArrayType()) {
421
+ return this.filter.query
422
+ .filter((q) => q.key === this.item.key && q.type === "<=")
423
+ .map(q => q.value);
424
+ }
425
+ const query = this.filter.query.find((q) => q.key === this.item.key && q.type === "<=");
426
+ return query === null || query === void 0 ? void 0 : query.value;
427
+ }
428
+ set maxValue(val) {
429
+ this.refresh(val, "<=");
430
+ }
431
+ refresh(val, type = null) {
432
+ if (!type)
433
+ type = this.item.type;
434
+ if (this.isArrayType()) {
435
+ this.refreshForArray(val, type);
436
+ return;
437
+ }
438
+ let query = this.filter.query.find((q) => q.key === this.item.key && q.type === type);
439
+ if (val === null || val === undefined || val === '') {
440
+ const index = this.filter.query.indexOf(query);
441
+ if (index > -1) {
442
+ this.filter.query.splice(index, 1);
443
+ }
444
+ this.facade.read(this.filter);
445
+ return;
446
+ }
447
+ if (!query) {
448
+ query = {
449
+ key: this.item.key,
450
+ type: type,
451
+ value: null,
452
+ };
453
+ this.filter.query.push(query);
454
+ }
455
+ query.value = val;
456
+ query.label = this.item.label;
457
+ this.facade.read(this.filter);
458
+ }
459
+ ngOnInit() {
460
+ this.initPossibilities();
461
+ }
462
+ initPossibilities() {
463
+ let possibilities = this.item.possibilities$;
464
+ if (this.modelPossibilitiesProvider) {
465
+ const possibilitiesFromProvider = this.modelPossibilitiesProvider.get(this.config.type);
466
+ if (possibilitiesFromProvider && possibilitiesFromProvider[this.item.key])
467
+ possibilities = possibilitiesFromProvider[this.item.key];
468
+ }
469
+ this.possibilities$ = possibilities;
470
+ }
471
+ isArrayType() {
472
+ var _a;
473
+ return (((_a = this.item) === null || _a === void 0 ? void 0 : _a.fieldType) === FieldType.check);
474
+ }
475
+ refreshForArray(vals, type) {
476
+ const queries = this.filter.query.filter((q) => q.key === this.item.key && q.type === type);
477
+ queries.forEach(query => {
478
+ const index = this.filter.query.indexOf(query);
479
+ if (index > -1) {
480
+ this.filter.query.splice(index, 1);
481
+ }
482
+ });
483
+ if (vals === null || vals === undefined || !vals.length) {
484
+ this.facade.read(this.filter);
485
+ return;
486
+ }
487
+ vals.forEach(val => {
488
+ const query = {
489
+ key: this.item.key,
490
+ type: type,
491
+ value: val,
492
+ };
493
+ this.filter.query.push(query);
494
+ });
495
+ this.facade.read(this.filter);
496
+ }
497
+ }
498
+ /** @nocollapse */ /** @nocollapse */ BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: BaseComponent, deps: [{ token: CrudFacade }, { token: CrudConfig }, { token: CRUD_MODEL_POSSIBILITIES_PROVIDER, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
499
+ /** @nocollapse */ /** @nocollapse */ BaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.7", type: BaseComponent, inputs: { item: "item", filter: "filter" }, ngImport: i0 });
500
+ __decorate([
501
+ Debounce(500),
502
+ __metadata("design:type", Function),
503
+ __metadata("design:paramtypes", [Object, Object]),
504
+ __metadata("design:returntype", void 0)
505
+ ], BaseComponent.prototype, "refresh", null);
506
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: BaseComponent, decorators: [{
507
+ type: Directive
508
+ }], ctorParameters: function () {
509
+ return [{ type: CrudFacade }, { type: CrudConfig }, { type: ICrudModelPossibilitiesProvider, decorators: [{
510
+ type: Optional
511
+ }, {
512
+ type: Inject,
513
+ args: [CRUD_MODEL_POSSIBILITIES_PROVIDER]
514
+ }] }];
515
+ }, propDecorators: { item: [{
516
+ type: Input
517
+ }], filter: [{
518
+ type: Input
519
+ }], refresh: [] } });
520
+
521
+ class FilterDateComponent extends BaseComponent {
522
+ get allowAdvanced() {
523
+ var _a;
524
+ return ((_a = this.item) === null || _a === void 0 ? void 0 : _a.type) === '=';
525
+ }
526
+ set customValue(val) {
527
+ const momentDate = moment(val);
528
+ this.value = (val === null || val === void 0 ? void 0 : val.length) >= 10 && momentDate.isValid() ? momentDate.format('YYYY-MM-DD') : val;
529
+ }
530
+ get customValue() {
531
+ return this.value;
532
+ }
533
+ set customMinValue(val) {
534
+ const momentDate = moment(val);
535
+ this.minValue = (val === null || val === void 0 ? void 0 : val.length) >= 10 && momentDate.isValid() ? momentDate.format('YYYY-MM-DD') : val;
536
+ }
537
+ get customMinValue() {
538
+ return this.minValue;
539
+ }
540
+ set customMaxValue(val) {
541
+ const momentDate = moment(val);
542
+ this.maxValue = (val === null || val === void 0 ? void 0 : val.length) >= 10 && momentDate.isValid() ? momentDate.format('YYYY-MM-DD') : val;
543
+ }
544
+ get customMaxValue() {
545
+ return this.maxValue;
546
+ }
547
+ }
548
+ /** @nocollapse */ /** @nocollapse */ FilterDateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
549
+ /** @nocollapse */ /** @nocollapse */ FilterDateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: FilterDateComponent, selector: "smart-crud-filter-date", usesInheritance: true, ngImport: i0, template: "<ion-row>\n <ion-col>\n <ion-label position=\"floating\">\n {{ item.label | translate }}\n </ion-label>\n <ion-datetime displayFormat=\"YYYY-MM-DD\"\n pickerFormat=\"YYYY-MM-DD\"\n [(ngModel)]=\"customValue\"></ion-datetime>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>", styles: [":host{width:100%}:host .squere-button{height:var(--smart-button-height)!important;margin:.8rem}\n"], components: [{ type: i1$1.IonRow, selector: "ion-row" }, { type: i1$1.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { type: i1$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { type: i1$1.IonDatetime, selector: "ion-datetime", inputs: ["cancelText", "dayNames", "dayShortNames", "dayValues", "disabled", "displayFormat", "displayTimezone", "doneText", "hourValues", "max", "min", "minuteValues", "mode", "monthNames", "monthShortNames", "monthValues", "name", "pickerFormat", "pickerOptions", "placeholder", "readonly", "value", "yearValues"] }, { type: i1$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i1$1.IonIcon, selector: "ion-icon", inputs: ["ariaHidden", "ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }], directives: [{ type: i1$1.SelectValueAccessor, selector: "ion-range, ion-select, ion-radio-group, ion-segment, ion-datetime" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i4.TranslatePipe } });
550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterDateComponent, decorators: [{
551
+ type: Component,
552
+ args: [{ selector: 'smart-crud-filter-date', template: "<ion-row>\n <ion-col>\n <ion-label position=\"floating\">\n {{ item.label | translate }}\n </ion-label>\n <ion-datetime displayFormat=\"YYYY-MM-DD\"\n pickerFormat=\"YYYY-MM-DD\"\n [(ngModel)]=\"customValue\"></ion-datetime>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>", styles: [":host{width:100%}:host .squere-button{height:var(--smart-button-height)!important;margin:.8rem}\n"] }]
553
+ }] });
554
+
555
+ class FilterDateWithEditComponent extends FilterDateComponent {
556
+ constructor() {
557
+ super(...arguments);
558
+ this._subscriptions = new Subscription();
559
+ this.advanced = false;
560
+ }
561
+ open() {
562
+ this.dateTimePicker.open();
563
+ }
564
+ ngOnInit() {
565
+ super.ngOnInit();
566
+ if (this.dateTimePicker) {
567
+ this._subscriptions.add(this.dateTimePicker.ionChange.subscribe((val) => {
568
+ this.customValue = val.detail.value;
569
+ }));
570
+ }
571
+ else {
572
+ console.error('dateTimePicker not found!');
573
+ }
574
+ }
575
+ ngOnDestroy() {
576
+ if (this._subscriptions) {
577
+ this._subscriptions.unsubscribe();
578
+ }
579
+ }
580
+ }
581
+ /** @nocollapse */ /** @nocollapse */ FilterDateWithEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterDateWithEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
582
+ /** @nocollapse */ /** @nocollapse */ FilterDateWithEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: FilterDateWithEditComponent, selector: "smart-crud-filter-date-with-edit", viewQueries: [{ propertyName: "dateTimePicker", first: true, predicate: IonDatetime, descendants: true, read: IonDatetime }], usesInheritance: true, ngImport: i0, template: "<ion-row>\n <ion-col>\n <ion-label>\n {{ item.label | translate }}\n </ion-label>\n\n <ion-input placeholder=\"YYYY-MM-DD\"\n [(ngModel)]=\"customValue\"\n [pattern]=\"'([12]\\\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\\\d|3[01]))'\"\n ></ion-input>\n <ion-datetime [hidden]=\"true\"\n displayFormat=\"YYYY-MM-DD\"\n pickerFormat=\"YYYY-MM-DD\"\n [(ngModel)]=\"customValue\"></ion-datetime>\n </ion-col>\n <ion-col size=\"auto\">\n <ion-button (click)=\"open()\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"calendar-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"allowAdvanced\">\n <ion-button (click)=\"advanced = !advanced\" class=\"squere-button\" [disabled]=\"minValue || maxValue\">\n <ion-icon *ngIf=\"!advanced\" slot=\"icon-only\" name=\"settings-outline\"></ion-icon>\n <ion-icon *ngIf=\"advanced\" slot=\"icon-only\" name=\"settings\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>\n<ion-row *ngIf=\"(advanced || minValue || maxValue) && allowAdvanced\">\n <ion-col>\n <ion-item>\n <ion-label>\n {{ 'from' | translate }}\n </ion-label>\n <ion-input placeholder=\"YYYY-MM-DD\"\n [(ngModel)]=\"customMinValue\"\n [pattern]=\"'([12]\\\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\\\d|3[01]))'\"\n ></ion-input>\n <ion-datetime [hidden]=\"true\"\n [(ngModel)]=\"customMinValue\"\n displayFormat=\"YYYY-MM-DD\"\n pickerFormat=\"YYYY-MM-DD\"></ion-datetime>\n </ion-item>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"customMinValue\">\n <ion-button color=\"danger\" (click)=\"refresh(null, '>=')\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col>\n <ion-item>\n <ion-label>\n {{ 'to' | translate }}\n </ion-label>\n <ion-input placeholder=\"YYYY-MM-DD\"\n [(ngModel)]=\"customMaxValue\"\n [pattern]=\"'([12]\\\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\\\d|3[01]))'\"\n ></ion-input>\n <ion-datetime [hidden]=\"true\"\n displayFormat=\"YYYY-MM-DD\"\n pickerFormat=\"YYYY-MM-DD\"\n [(ngModel)]=\"customMaxValue\"></ion-datetime>\n </ion-item>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"customMaxValue\">\n <ion-button color=\"danger\" (click)=\"refresh(null, '<=')\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>", styles: [":host{width:100%}:host .squere-button{height:var(--smart-button-height)!important;margin:.8rem}\n"], components: [{ type: i1$1.IonRow, selector: "ion-row" }, { type: i1$1.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { type: i1$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { type: i1$1.IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "type", "value"] }, { type: i1$1.IonDatetime, selector: "ion-datetime", inputs: ["cancelText", "dayNames", "dayShortNames", "dayValues", "disabled", "displayFormat", "displayTimezone", "doneText", "hourValues", "max", "min", "minuteValues", "mode", "monthNames", "monthShortNames", "monthValues", "name", "pickerFormat", "pickerOptions", "placeholder", "readonly", "value", "yearValues"] }, { type: i1$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i1$1.IonIcon, selector: "ion-icon", inputs: ["ariaHidden", "ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { type: i1$1.IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }], directives: [{ type: i1$1.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1$1.SelectValueAccessor, selector: "ion-range, ion-select, ion-radio-group, ion-segment, ion-datetime" }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i4.TranslatePipe } });
583
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterDateWithEditComponent, decorators: [{
584
+ type: Component,
585
+ args: [{ selector: 'smart-crud-filter-date-with-edit', template: "<ion-row>\n <ion-col>\n <ion-label>\n {{ item.label | translate }}\n </ion-label>\n\n <ion-input placeholder=\"YYYY-MM-DD\"\n [(ngModel)]=\"customValue\"\n [pattern]=\"'([12]\\\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\\\d|3[01]))'\"\n ></ion-input>\n <ion-datetime [hidden]=\"true\"\n displayFormat=\"YYYY-MM-DD\"\n pickerFormat=\"YYYY-MM-DD\"\n [(ngModel)]=\"customValue\"></ion-datetime>\n </ion-col>\n <ion-col size=\"auto\">\n <ion-button (click)=\"open()\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"calendar-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"allowAdvanced\">\n <ion-button (click)=\"advanced = !advanced\" class=\"squere-button\" [disabled]=\"minValue || maxValue\">\n <ion-icon *ngIf=\"!advanced\" slot=\"icon-only\" name=\"settings-outline\"></ion-icon>\n <ion-icon *ngIf=\"advanced\" slot=\"icon-only\" name=\"settings\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>\n<ion-row *ngIf=\"(advanced || minValue || maxValue) && allowAdvanced\">\n <ion-col>\n <ion-item>\n <ion-label>\n {{ 'from' | translate }}\n </ion-label>\n <ion-input placeholder=\"YYYY-MM-DD\"\n [(ngModel)]=\"customMinValue\"\n [pattern]=\"'([12]\\\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\\\d|3[01]))'\"\n ></ion-input>\n <ion-datetime [hidden]=\"true\"\n [(ngModel)]=\"customMinValue\"\n displayFormat=\"YYYY-MM-DD\"\n pickerFormat=\"YYYY-MM-DD\"></ion-datetime>\n </ion-item>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"customMinValue\">\n <ion-button color=\"danger\" (click)=\"refresh(null, '>=')\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col>\n <ion-item>\n <ion-label>\n {{ 'to' | translate }}\n </ion-label>\n <ion-input placeholder=\"YYYY-MM-DD\"\n [(ngModel)]=\"customMaxValue\"\n [pattern]=\"'([12]\\\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\\\d|3[01]))'\"\n ></ion-input>\n <ion-datetime [hidden]=\"true\"\n displayFormat=\"YYYY-MM-DD\"\n pickerFormat=\"YYYY-MM-DD\"\n [(ngModel)]=\"customMaxValue\"></ion-datetime>\n </ion-item>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"customMaxValue\">\n <ion-button color=\"danger\" (click)=\"refresh(null, '<=')\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>", styles: [":host{width:100%}:host .squere-button{height:var(--smart-button-height)!important;margin:.8rem}\n"] }]
586
+ }], propDecorators: { dateTimePicker: [{
587
+ type: ViewChild,
588
+ args: [IonDatetime, { read: IonDatetime, static: false }]
589
+ }] } });
590
+
591
+ class FilterRadioComponent extends BaseComponent {
592
+ }
593
+ /** @nocollapse */ /** @nocollapse */ FilterRadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterRadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
594
+ /** @nocollapse */ /** @nocollapse */ FilterRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: FilterRadioComponent, selector: "smart-crud-filter-radio", usesInheritance: true, ngImport: i0, template: "<ion-row>\n <ion-col>\n <ion-radio-group [(ngModel)]=\"value\">\n <ion-item-divider>\n <ion-icon slot=\"start\" name=\"filter-outline\"></ion-icon>\n <ion-label>\n {{ item.label | translate }}\n </ion-label>\n <ion-button *ngIf=\"value\" slot=\"end\" color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-item-divider>\n\n <ion-item *ngFor=\"let item of possibilities$ | async\">\n <ion-label>{{ item.text | translate }}</ion-label>\n <ion-radio [value]=\"item.id\"></ion-radio>\n </ion-item>\n </ion-radio-group>\n </ion-col>\n <!-- <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col> -->\n</ion-row>", styles: [":host{width:100%;margin-bottom:1.2rem}:host ion-radio{margin-right:2.4rem}:host ion-item-divider{font-weight:300;--padding-end: .8rem;font-size:1.2rem;--ion-background-color: linear-gradient(90deg, transparent, var(--ion-color-light))}:host ion-item-divider ion-icon{margin-right:1.6rem;font-size:1.6rem;--color: var(--ion-color-primary)}:host ion-item-divider ion-label{--padding: var(--smart-button-padding-left)/2 var(--smart-button-padding-top)/2 var(--smart-button-padding-right)/2 var(--smart-button-padding-bottom)/2}:host ion-item-divider .squere-button{margin:0;font-size:18px;height:36px;width:36px;padding:0;--padding-start: .2em;--padding-end: .2em}:host ion-item-divider .squere-button ion-icon{margin:0;padding:0}\n"], components: [{ type: i1$1.IonRow, selector: "ion-row" }, { type: i1$1.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { type: i1$1.IonRadioGroup, selector: "ion-radio-group", inputs: ["allowEmptySelection", "name", "value"] }, { type: i1$1.IonItemDivider, selector: "ion-item-divider", inputs: ["color", "mode", "sticky"] }, { type: i1$1.IonIcon, selector: "ion-icon", inputs: ["ariaHidden", "ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { type: i1$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { type: i1$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i1$1.IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { type: i1$1.IonRadio, selector: "ion-radio", inputs: ["color", "disabled", "mode", "name", "value"] }], directives: [{ type: i1$1.SelectValueAccessor, selector: "ion-range, ion-select, ion-radio-group, ion-segment, ion-datetime" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.RadioValueAccessor, selector: "ion-radio" }], pipes: { "translate": i4.TranslatePipe, "async": i3$1.AsyncPipe } });
595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterRadioComponent, decorators: [{
596
+ type: Component,
597
+ args: [{ selector: 'smart-crud-filter-radio', template: "<ion-row>\n <ion-col>\n <ion-radio-group [(ngModel)]=\"value\">\n <ion-item-divider>\n <ion-icon slot=\"start\" name=\"filter-outline\"></ion-icon>\n <ion-label>\n {{ item.label | translate }}\n </ion-label>\n <ion-button *ngIf=\"value\" slot=\"end\" color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-item-divider>\n\n <ion-item *ngFor=\"let item of possibilities$ | async\">\n <ion-label>{{ item.text | translate }}</ion-label>\n <ion-radio [value]=\"item.id\"></ion-radio>\n </ion-item>\n </ion-radio-group>\n </ion-col>\n <!-- <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col> -->\n</ion-row>", styles: [":host{width:100%;margin-bottom:1.2rem}:host ion-radio{margin-right:2.4rem}:host ion-item-divider{font-weight:300;--padding-end: .8rem;font-size:1.2rem;--ion-background-color: linear-gradient(90deg, transparent, var(--ion-color-light))}:host ion-item-divider ion-icon{margin-right:1.6rem;font-size:1.6rem;--color: var(--ion-color-primary)}:host ion-item-divider ion-label{--padding: var(--smart-button-padding-left)/2 var(--smart-button-padding-top)/2 var(--smart-button-padding-right)/2 var(--smart-button-padding-bottom)/2}:host ion-item-divider .squere-button{margin:0;font-size:18px;height:36px;width:36px;padding:0;--padding-start: .2em;--padding-end: .2em}:host ion-item-divider .squere-button ion-icon{margin:0;padding:0}\n"] }]
598
+ }] });
599
+
600
+ class FilterCheckComponent extends BaseComponent {
601
+ ngAfterContentInit() {
602
+ this.list$ = combineLatest([this.possibilities$, this.facade.filter$]).pipe((map(([possibilities]) => {
603
+ return possibilities.map(pos => ({
604
+ value: pos,
605
+ isCheck: this.value.some(r => r === pos.id)
606
+ }));
607
+ })));
608
+ }
609
+ onCheckChange(checked, entry) {
610
+ if (checked && !this.value.some(r => r === entry.value.id)) {
611
+ this.value = [
612
+ ...this.value,
613
+ entry.value.id
614
+ ];
615
+ }
616
+ if (!checked && this.value.some(r => r === entry.value.id)) {
617
+ this.value = this.value.filter(r => r !== entry.value.id);
618
+ }
619
+ }
620
+ }
621
+ /** @nocollapse */ /** @nocollapse */ FilterCheckComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterCheckComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
622
+ /** @nocollapse */ /** @nocollapse */ FilterCheckComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: FilterCheckComponent, selector: "smart-crud-filter-check", usesInheritance: true, ngImport: i0, template: "<ion-row>\n <ion-col>\n <ion-item-divider>\n <ion-icon slot=\"start\" name=\"filter-outline\"></ion-icon>\n <ion-label>\n {{ item.label | translate }}\n </ion-label>\n <ion-button *ngIf=\"value && value.length\" slot=\"end\" color=\"danger\" (click)=\"refresh([])\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-item-divider>\n <ion-item *ngFor=\"let entry of list$ | async\">\n <ion-label>{{entry.value.text | translate}}</ion-label>\n <ion-checkbox slot=\"end\" [checked]=\"entry.isCheck\" (ionChange)=\"onCheckChange($event.detail.checked, entry)\"></ion-checkbox>\n </ion-item>\n </ion-col>\n <!-- <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col> -->\n</ion-row>", styles: [":host{width:100%;margin-bottom:1.2rem}:host ion-radio{margin-right:2.4rem}:host ion-item-divider{font-weight:300;--padding-end: .8rem;font-size:1.2rem;--ion-background-color: linear-gradient(90deg, transparent, var(--ion-color-light))}:host ion-item-divider ion-icon{margin-right:1.6rem;font-size:1.6rem;--color: var(--ion-color-primary)}:host ion-item-divider ion-label{--padding: var(--smart-button-padding-left)/2 var(--smart-button-padding-top)/2 var(--smart-button-padding-right)/2 var(--smart-button-padding-bottom)/2}:host ion-item-divider .squere-button{margin:0;font-size:18px;height:36px;width:36px;padding:0;--padding-start: .2em;--padding-end: .2em}:host ion-item-divider .squere-button ion-icon{margin:0;padding:0}\n"], components: [{ type: i1$1.IonRow, selector: "ion-row" }, { type: i1$1.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { type: i1$1.IonItemDivider, selector: "ion-item-divider", inputs: ["color", "mode", "sticky"] }, { type: i1$1.IonIcon, selector: "ion-icon", inputs: ["ariaHidden", "ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { type: i1$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { type: i1$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i1$1.IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { type: i1$1.IonCheckbox, selector: "ion-checkbox", inputs: ["checked", "color", "disabled", "indeterminate", "mode", "name", "value"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.BooleanValueAccessor, selector: "ion-checkbox,ion-toggle" }], pipes: { "translate": i4.TranslatePipe, "async": i3$1.AsyncPipe } });
623
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterCheckComponent, decorators: [{
624
+ type: Component,
625
+ args: [{ selector: 'smart-crud-filter-check', template: "<ion-row>\n <ion-col>\n <ion-item-divider>\n <ion-icon slot=\"start\" name=\"filter-outline\"></ion-icon>\n <ion-label>\n {{ item.label | translate }}\n </ion-label>\n <ion-button *ngIf=\"value && value.length\" slot=\"end\" color=\"danger\" (click)=\"refresh([])\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-item-divider>\n <ion-item *ngFor=\"let entry of list$ | async\">\n <ion-label>{{entry.value.text | translate}}</ion-label>\n <ion-checkbox slot=\"end\" [checked]=\"entry.isCheck\" (ionChange)=\"onCheckChange($event.detail.checked, entry)\"></ion-checkbox>\n </ion-item>\n </ion-col>\n <!-- <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col> -->\n</ion-row>", styles: [":host{width:100%;margin-bottom:1.2rem}:host ion-radio{margin-right:2.4rem}:host ion-item-divider{font-weight:300;--padding-end: .8rem;font-size:1.2rem;--ion-background-color: linear-gradient(90deg, transparent, var(--ion-color-light))}:host ion-item-divider ion-icon{margin-right:1.6rem;font-size:1.6rem;--color: var(--ion-color-primary)}:host ion-item-divider ion-label{--padding: var(--smart-button-padding-left)/2 var(--smart-button-padding-top)/2 var(--smart-button-padding-right)/2 var(--smart-button-padding-bottom)/2}:host ion-item-divider .squere-button{margin:0;font-size:18px;height:36px;width:36px;padding:0;--padding-start: .2em;--padding-end: .2em}:host ion-item-divider .squere-button ion-icon{margin:0;padding:0}\n"] }]
626
+ }] });
627
+
628
+ class FilterFlagComponent extends BaseComponent {
629
+ }
630
+ /** @nocollapse */ /** @nocollapse */ FilterFlagComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterFlagComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
631
+ /** @nocollapse */ /** @nocollapse */ FilterFlagComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: FilterFlagComponent, selector: "smart-crud-filter-flag", usesInheritance: true, ngImport: i0, template: "<ion-row>\n <ion-col>\n <div class=\"flag-container\">\n <ion-label position=\"static\">\n {{ item.label | translate }}\n </ion-label>\n <ion-checkbox [(ngModel)]=\"value\" slot=\"end\"></ion-checkbox>\n </div>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>", styles: [":host{width:100%}:host .flag-container{width:100%;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;padding:0 1.2rem 0 0}:host .flag-container ion-label{--color: var(--smart-color-dark);vertical-align:middle;padding:1.6rem 0}:host .squere-button{height:var(--smart-button-height)!important;margin:.8rem}\n"], components: [{ type: i1$1.IonRow, selector: "ion-row" }, { type: i1$1.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { type: i1$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { type: i1$1.IonCheckbox, selector: "ion-checkbox", inputs: ["checked", "color", "disabled", "indeterminate", "mode", "name", "value"] }, { type: i1$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i1$1.IonIcon, selector: "ion-icon", inputs: ["ariaHidden", "ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }], directives: [{ type: i1$1.BooleanValueAccessor, selector: "ion-checkbox,ion-toggle" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i4.TranslatePipe } });
632
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterFlagComponent, decorators: [{
633
+ type: Component,
634
+ args: [{ selector: 'smart-crud-filter-flag', template: "<ion-row>\n <ion-col>\n <div class=\"flag-container\">\n <ion-label position=\"static\">\n {{ item.label | translate }}\n </ion-label>\n <ion-checkbox [(ngModel)]=\"value\" slot=\"end\"></ion-checkbox>\n </div>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>", styles: [":host{width:100%}:host .flag-container{width:100%;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;padding:0 1.2rem 0 0}:host .flag-container ion-label{--color: var(--smart-color-dark);vertical-align:middle;padding:1.6rem 0}:host .squere-button{height:var(--smart-button-height)!important;margin:.8rem}\n"] }]
635
+ }] });
636
+
637
+ class FilterIntComponent extends BaseComponent {
638
+ constructor() {
639
+ super(...arguments);
640
+ this._subscriptions = new Subscription();
641
+ this.advanced = false;
642
+ }
643
+ get allowAdvanced() {
644
+ var _a;
645
+ return ((_a = this.item) === null || _a === void 0 ? void 0 : _a.type) === '=';
646
+ }
647
+ ngOnInit() {
648
+ super.ngOnInit();
649
+ }
650
+ ngOnDestroy() {
651
+ if (this._subscriptions) {
652
+ this._subscriptions.unsubscribe();
653
+ }
654
+ }
655
+ }
656
+ /** @nocollapse */ /** @nocollapse */ FilterIntComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterIntComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
657
+ /** @nocollapse */ /** @nocollapse */ FilterIntComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: FilterIntComponent, selector: "smart-crud-filter-int", usesInheritance: true, ngImport: i0, template: "<ion-row>\n <ion-col>\n <ion-label>\n {{ item.label | translate }}\n </ion-label>\n <ion-input [(ngModel)]=\"value\" type=\"number\" step=\"1\"></ion-input>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"allowAdvanced\">\n <ion-button (click)=\"advanced = !advanced\" class=\"squere-button\" [disabled]=\"minValue || maxValue\">\n <ion-icon *ngIf=\"!advanced\" slot=\"icon-only\" name=\"settings-outline\"></ion-icon>\n <ion-icon *ngIf=\"advanced\" slot=\"icon-only\" name=\"settings\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>\n<ion-row *ngIf=\"(advanced || minValue || maxValue) && allowAdvanced\">\n <ion-col>\n <ion-item>\n <ion-label>\n {{ 'from' | translate }}\n </ion-label>\n <ion-input [(ngModel)]=\"minValue\" type=\"number\" step=\"1\"></ion-input>\n </ion-item>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"minValue\">\n <ion-button color=\"danger\" (click)=\"refresh(null, '>=')\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col>\n <ion-item>\n <ion-label>\n {{ 'to' | translate }}\n </ion-label>\n <ion-input [(ngModel)]=\"maxValue\" type=\"number\" step=\"1\"></ion-input>\n </ion-item>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"maxValue\">\n <ion-button color=\"danger\" (click)=\"refresh(null, '<=')\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>", styles: [":host{width:100%}:host .squere-button{height:var(--smart-button-height)!important;margin:.8rem}\n"], components: [{ type: i1$1.IonRow, selector: "ion-row" }, { type: i1$1.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { type: i1$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { type: i1$1.IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "type", "value"] }, { type: i1$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i1$1.IonIcon, selector: "ion-icon", inputs: ["ariaHidden", "ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { type: i1$1.IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }], directives: [{ type: i1$1.NumericValueAccessor, selector: "ion-input[type=number]" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i4.TranslatePipe } });
658
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterIntComponent, decorators: [{
659
+ type: Component,
660
+ args: [{ selector: 'smart-crud-filter-int', template: "<ion-row>\n <ion-col>\n <ion-label>\n {{ item.label | translate }}\n </ion-label>\n <ion-input [(ngModel)]=\"value\" type=\"number\" step=\"1\"></ion-input>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"allowAdvanced\">\n <ion-button (click)=\"advanced = !advanced\" class=\"squere-button\" [disabled]=\"minValue || maxValue\">\n <ion-icon *ngIf=\"!advanced\" slot=\"icon-only\" name=\"settings-outline\"></ion-icon>\n <ion-icon *ngIf=\"advanced\" slot=\"icon-only\" name=\"settings\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>\n<ion-row *ngIf=\"(advanced || minValue || maxValue) && allowAdvanced\">\n <ion-col>\n <ion-item>\n <ion-label>\n {{ 'from' | translate }}\n </ion-label>\n <ion-input [(ngModel)]=\"minValue\" type=\"number\" step=\"1\"></ion-input>\n </ion-item>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"minValue\">\n <ion-button color=\"danger\" (click)=\"refresh(null, '>=')\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n <ion-col>\n <ion-item>\n <ion-label>\n {{ 'to' | translate }}\n </ion-label>\n <ion-input [(ngModel)]=\"maxValue\" type=\"number\" step=\"1\"></ion-input>\n </ion-item>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"maxValue\">\n <ion-button color=\"danger\" (click)=\"refresh(null, '<=')\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>", styles: [":host{width:100%}:host .squere-button{height:var(--smart-button-height)!important;margin:.8rem}\n"] }]
661
+ }] });
662
+
663
+ class FilterTextComponent extends BaseComponent {
664
+ }
665
+ /** @nocollapse */ /** @nocollapse */ FilterTextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
666
+ /** @nocollapse */ /** @nocollapse */ FilterTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: FilterTextComponent, selector: "smart-crud-filter-text", usesInheritance: true, ngImport: i0, template: "<ion-row>\n <ion-col>\n <ion-label position=\"floating\">\n {{ item.label | translate }}\n </ion-label>\n <ion-input [(ngModel)]=\"value\"></ion-input>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>", styles: [":host{width:100%}:host .squere-button{height:var(--smart-button-height)!important;margin:.8rem}\n"], components: [{ type: i1$1.IonRow, selector: "ion-row" }, { type: i1$1.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { type: i1$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { type: i1$1.IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "type", "value"] }, { type: i1$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i1$1.IonIcon, selector: "ion-icon", inputs: ["ariaHidden", "ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }], directives: [{ type: i1$1.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i4.TranslatePipe } });
667
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterTextComponent, decorators: [{
668
+ type: Component,
669
+ args: [{ selector: 'smart-crud-filter-text', template: "<ion-row>\n <ion-col>\n <ion-label position=\"floating\">\n {{ item.label | translate }}\n </ion-label>\n <ion-input [(ngModel)]=\"value\"></ion-input>\n </ion-col>\n <ion-col size=\"auto\" *ngIf=\"value\">\n <ion-button color=\"danger\" (click)=\"refresh(null)\" class=\"squere-button\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-col>\n</ion-row>", styles: [":host{width:100%}:host .squere-button{height:var(--smart-button-height)!important;margin:.8rem}\n"] }]
670
+ }] });
671
+
672
+ class FilterComponent {
673
+ constructor() {
674
+ this.FieldType = FieldType;
675
+ }
676
+ ngOnInit() { }
677
+ }
678
+ /** @nocollapse */ /** @nocollapse */ FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
679
+ /** @nocollapse */ /** @nocollapse */ FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: FilterComponent, selector: "smart-crud-filter", inputs: { item: "item", filter: "filter" }, ngImport: i0, template: "<ion-item [ngSwitch]=\"item.fieldType\">\n <smart-crud-filter-date\n *ngSwitchCase=\"FieldType.date\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-date>\n\n <smart-crud-filter-date-with-edit\n *ngSwitchCase=\"FieldType.dateWithEdit\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-date-with-edit>\n\n <smart-crud-filter-radio\n *ngSwitchCase=\"FieldType.radio\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-radio>\n\n <smart-crud-filter-check\n *ngSwitchCase=\"FieldType.check\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-check>\n\n <smart-crud-filter-flag\n *ngSwitchCase=\"FieldType.flag\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-flag>\n\n <smart-crud-filter-int\n *ngSwitchCase=\"FieldType.int\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-int>\n\n <smart-crud-filter-text\n *ngSwitchDefault\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-text>\n</ion-item>\n", styles: [""], components: [{ type: i1$1.IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { type: FilterDateComponent, selector: "smart-crud-filter-date" }, { type: FilterDateWithEditComponent, selector: "smart-crud-filter-date-with-edit" }, { type: FilterRadioComponent, selector: "smart-crud-filter-radio" }, { type: FilterCheckComponent, selector: "smart-crud-filter-check" }, { type: FilterFlagComponent, selector: "smart-crud-filter-flag" }, { type: FilterIntComponent, selector: "smart-crud-filter-int" }, { type: FilterTextComponent, selector: "smart-crud-filter-text" }], directives: [{ type: i3$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
680
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FilterComponent, decorators: [{
681
+ type: Component,
682
+ args: [{ selector: "smart-crud-filter", template: "<ion-item [ngSwitch]=\"item.fieldType\">\n <smart-crud-filter-date\n *ngSwitchCase=\"FieldType.date\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-date>\n\n <smart-crud-filter-date-with-edit\n *ngSwitchCase=\"FieldType.dateWithEdit\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-date-with-edit>\n\n <smart-crud-filter-radio\n *ngSwitchCase=\"FieldType.radio\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-radio>\n\n <smart-crud-filter-check\n *ngSwitchCase=\"FieldType.check\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-check>\n\n <smart-crud-filter-flag\n *ngSwitchCase=\"FieldType.flag\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-flag>\n\n <smart-crud-filter-int\n *ngSwitchCase=\"FieldType.int\"\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-int>\n\n <smart-crud-filter-text\n *ngSwitchDefault\n [item]=\"item\"\n [filter]=\"filter\"\n ></smart-crud-filter-text>\n</ion-item>\n", styles: [""] }]
683
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
684
+ type: Input
685
+ }], filter: [{
686
+ type: Input
687
+ }] } });
688
+
689
+ /**
690
+ * This component is only to use in crud module
691
+ * @requires CrudModule
692
+ * @example
693
+ *
694
+ * html: <smart-crud-filters></smart-crud-filters>
695
+ *
696
+ * use on the model:
697
+ * @Model({
698
+ titleKey: 'body',
699
+ filters: [
700
+ {
701
+ label: 'testNegation',
702
+ key: 'body',
703
+ type: '!=',
704
+ },
705
+ {
706
+ label: 'fromDate',
707
+ key: 'createDate',
708
+ type: '<=',
709
+ fieldType: FieldType.dateWithEdit
710
+ },
711
+ {
712
+ label: 'select',
713
+ key: 'type',
714
+ type: '=',
715
+ fieldType: FieldType.radio,
716
+ possibilities$: of([
717
+ {
718
+ id: 1, text: 'Test 1'
719
+ },
720
+ {
721
+ id: 2, text: 'Test 2'
722
+ }
723
+ ])
724
+ }
725
+ ]
726
+ })
727
+ *
728
+ * use on the field (list.filter property):
729
+ * @Field({
730
+ create: modifyMetdata,
731
+ update: {
732
+ ...modifyMetdata,
733
+ multi: true
734
+ },
735
+ type: FieldType.longText,
736
+ details: true,
737
+ list: {
738
+ order: 2,
739
+ filter: true
740
+ }
741
+ })
742
+ body: string;
743
+ */
744
+ class FiltersComponent {
745
+ constructor(menuService, config, facade, styleService, elementRef) {
746
+ this.menuService = menuService;
747
+ this.config = config;
748
+ this.facade = facade;
749
+ this.styleService = styleService;
750
+ this.elementRef = elementRef;
751
+ }
752
+ onClose() {
753
+ return __awaiter(this, void 0, void 0, function* () {
754
+ yield this.menuService.closeEnd();
755
+ });
756
+ }
757
+ ngOnInit() {
758
+ this.styleService.init(this.elementRef);
759
+ const modelFilters = getModelOptions(this.config.type).filters;
760
+ this.list = [
761
+ ...(modelFilters ? modelFilters.map(item => {
762
+ if (!item.label) {
763
+ item.label = 'MODEL.' + item.key;
764
+ }
765
+ return item;
766
+ }) : []),
767
+ ...getModelFieldsWithOptions(new this.config.type())
768
+ .filter(item => { var _a, _b; return (_b = (_a = item.options) === null || _a === void 0 ? void 0 : _a.list) === null || _b === void 0 ? void 0 : _b.filter; })
769
+ .map(item => ({
770
+ key: item.key,
771
+ type: item.options.type === FieldType.text || item.options.type === FieldType.longText
772
+ ? '~=' : '=',
773
+ label: 'MODEL.' + item.key,
774
+ fieldType: item.options.type
775
+ }))
776
+ ];
777
+ this.filter$ = this.facade.filter$;
778
+ }
779
+ }
780
+ /** @nocollapse */ /** @nocollapse */ FiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FiltersComponent, deps: [{ token: i3.MenuService }, { token: CrudConfig }, { token: CrudFacade }, { token: i3.StyleService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
781
+ /** @nocollapse */ /** @nocollapse */ FiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: FiltersComponent, selector: "smart-crud-filters", inputs: { hideMenu: "hideMenu" }, ngImport: i0, template: "<ion-header [hidden]=\"hideMenu\">\n <ion-toolbar>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"onClose()\">\n <ion-icon slot=\"icon-only\" name=\"close\"> </ion-icon>\n </ion-button>\n </ion-buttons>\n <ion-title>{{ 'filters' | translate }}</ion-title>\n </ion-toolbar>\n</ion-header>\n<div class=\"filter-content\">\n <ng-container *ngIf=\"filter$ | async; let filter\">\n <ng-container *ngFor=\"let item of list\">\n <smart-crud-filter [item]=\"item\" [filter]=\"filter\"></smart-crud-filter>\n </ng-container>\n </ng-container>\n <div class=\"menu-bottom-space\">\n &nbsp;\n </div>\n</div>", styles: [":host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}ion-modal :host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){:host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}ion-modal :host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}}@media only screen and (max-width: 420px){:host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}ion-modal :host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}}:host ion-toolbar.ios{height:4.6rem;--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){:host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}:host ion-toolbar.ios ion-title{text-align:left;padding-left:5.2rem}:host ion-toolbar.ios ion-icon{color:var(--ion-color-light)}}@media only screen and (max-width: 420px){:host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}:host ion-toolbar.ios ion-title{text-align:left;padding-left:5.2rem}:host ion-toolbar.ios ion-icon{color:var(--ion-color-light)}}.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-title{text-align:left;padding-left:1.2rem}.modal-wrapper :host ion-toolbar.ios ion-icon{color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-buttons{margin:0}}@media only screen and (max-width: 420px){.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-title{text-align:left;padding-left:1.2rem}.modal-wrapper :host ion-toolbar.ios ion-icon{color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-buttons{margin:0}}:host ion-toolbar.ios.toolbar-searchbar ion-buttons{height:var(--smart-button-height);margin:.4rem}:host ion-toolbar ion-menu-button{color:var(--ion-color-light)}:host ion-toolbar ion-buttons.ios{height:var(--smart-button-height);margin:0}:host .filter-content{display:block;overflow:auto;overflow-x:hidden}:host .menu-bottom-space{height:75px}\n"], components: [{ type: i1$1.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { type: i1$1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { type: i1$1.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { type: i1$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i1$1.IonIcon, selector: "ion-icon", inputs: ["ariaHidden", "ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { type: i1$1.IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { type: FilterComponent, selector: "smart-crud-filter", inputs: ["item", "filter"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i4.TranslatePipe, "async": i3$1.AsyncPipe } });
782
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FiltersComponent, decorators: [{
783
+ type: Component,
784
+ args: [{ selector: 'smart-crud-filters', template: "<ion-header [hidden]=\"hideMenu\">\n <ion-toolbar>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"onClose()\">\n <ion-icon slot=\"icon-only\" name=\"close\"> </ion-icon>\n </ion-button>\n </ion-buttons>\n <ion-title>{{ 'filters' | translate }}</ion-title>\n </ion-toolbar>\n</ion-header>\n<div class=\"filter-content\">\n <ng-container *ngIf=\"filter$ | async; let filter\">\n <ng-container *ngFor=\"let item of list\">\n <smart-crud-filter [item]=\"item\" [filter]=\"filter\"></smart-crud-filter>\n </ng-container>\n </ng-container>\n <div class=\"menu-bottom-space\">\n &nbsp;\n </div>\n</div>", styles: [":host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}ion-modal :host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){:host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}ion-modal :host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}}@media only screen and (max-width: 420px){:host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}ion-modal :host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}}:host ion-toolbar.ios{height:4.6rem;--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){:host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}:host ion-toolbar.ios ion-title{text-align:left;padding-left:5.2rem}:host ion-toolbar.ios ion-icon{color:var(--ion-color-light)}}@media only screen and (max-width: 420px){:host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}:host ion-toolbar.ios ion-title{text-align:left;padding-left:5.2rem}:host ion-toolbar.ios ion-icon{color:var(--ion-color-light)}}.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-title{text-align:left;padding-left:1.2rem}.modal-wrapper :host ion-toolbar.ios ion-icon{color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-buttons{margin:0}}@media only screen and (max-width: 420px){.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-title{text-align:left;padding-left:1.2rem}.modal-wrapper :host ion-toolbar.ios ion-icon{color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-buttons{margin:0}}:host ion-toolbar.ios.toolbar-searchbar ion-buttons{height:var(--smart-button-height);margin:.4rem}:host ion-toolbar ion-menu-button{color:var(--ion-color-light)}:host ion-toolbar ion-buttons.ios{height:var(--smart-button-height);margin:0}:host .filter-content{display:block;overflow:auto;overflow-x:hidden}:host .menu-bottom-space{height:75px}\n"] }]
785
+ }], ctorParameters: function () { return [{ type: i3.MenuService }, { type: CrudConfig }, { type: CrudFacade }, { type: i3.StyleService }, { type: i0.ElementRef }]; }, propDecorators: { hideMenu: [{
786
+ type: Input
787
+ }] } });
788
+
789
+ class FiltersConfigComponent {
790
+ constructor(facade, styleService, elementRef) {
791
+ this.facade = facade;
792
+ this.styleService = styleService;
793
+ this.elementRef = elementRef;
794
+ }
795
+ onRemoveQuery(item) {
796
+ const index = this.facade.filter.query.indexOf(item);
797
+ if (index > -1) {
798
+ this.facade.filter.query.splice(index, 1);
799
+ }
800
+ this.facade.read(this.facade.filter);
801
+ }
802
+ ngOnInit() {
803
+ this.styleService.init(this.elementRef);
804
+ this.query$ = this.facade.filter$.pipe(map(filter => {
805
+ var _a;
806
+ return (_a = filter === null || filter === void 0 ? void 0 : filter.query) === null || _a === void 0 ? void 0 : _a.filter(i => !i.hidden);
807
+ }));
808
+ }
809
+ }
810
+ /** @nocollapse */ /** @nocollapse */ FiltersConfigComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FiltersConfigComponent, deps: [{ token: CrudFacade }, { token: i3.StyleService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
811
+ /** @nocollapse */ /** @nocollapse */ FiltersConfigComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: FiltersConfigComponent, selector: "smart-crud-filters-config", ngImport: i0, template: " <ng-container *ngIf=\"query$ | async; let query\">\n <ion-toolbar *ngIf=\"query?.length\">\n <ion-chip *ngFor=\"let item of query\" (click)=\"onRemoveQuery(item)\" color=\"medium\" outline=\"true\">\n <ion-icon name=\"filter-circle-outline\" color=\"primary\"></ion-icon>\n <ion-label>{{ 'MODEL.' + item.key | translate }} {{ item.type }} {{ item.value | translate }}</ion-label>\n <ion-icon name=\"close\" color=\"danger\"></ion-icon>\n </ion-chip>\n </ion-toolbar>\n</ng-container>", styles: [":host ion-label{font-size:calc(var(--default-font-size) - 2px)}\n"], components: [{ type: i1$1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { type: i1$1.IonChip, selector: "ion-chip", inputs: ["color", "disabled", "mode", "outline"] }, { type: i1$1.IonIcon, selector: "ion-icon", inputs: ["ariaHidden", "ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { type: i1$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i3$1.AsyncPipe, "translate": i4.TranslatePipe } });
812
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FiltersConfigComponent, decorators: [{
813
+ type: Component,
814
+ args: [{ selector: 'smart-crud-filters-config', template: " <ng-container *ngIf=\"query$ | async; let query\">\n <ion-toolbar *ngIf=\"query?.length\">\n <ion-chip *ngFor=\"let item of query\" (click)=\"onRemoveQuery(item)\" color=\"medium\" outline=\"true\">\n <ion-icon name=\"filter-circle-outline\" color=\"primary\"></ion-icon>\n <ion-label>{{ 'MODEL.' + item.key | translate }} {{ item.type }} {{ item.value | translate }}</ion-label>\n <ion-icon name=\"close\" color=\"danger\"></ion-icon>\n </ion-chip>\n </ion-toolbar>\n</ng-container>", styles: [":host ion-label{font-size:calc(var(--default-font-size) - 2px)}\n"] }]
815
+ }], ctorParameters: function () { return [{ type: CrudFacade }, { type: i3.StyleService }, { type: i0.ElementRef }]; } });
816
+
817
+ class FormOptionsPipe {
818
+ constructor(modelPossibilitiesProvider) {
819
+ this.modelPossibilitiesProvider = modelPossibilitiesProvider;
820
+ }
821
+ transform(item, mode, type, uniqueProvider, inputComponents) {
822
+ if (!mode || !type)
823
+ return null;
824
+ let possibilities = {};
825
+ if (type && this.modelPossibilitiesProvider) {
826
+ possibilities = this.modelPossibilitiesProvider.get(type);
827
+ }
828
+ if (mode === "create") {
829
+ return {
830
+ mode: "create",
831
+ possibilities,
832
+ inputComponents,
833
+ uniqueProvider,
834
+ model: new type(),
835
+ };
836
+ }
837
+ else {
838
+ const model = new type();
839
+ if (item) {
840
+ Object.keys(item).forEach((key) => {
841
+ model[key] = item[key];
842
+ });
843
+ }
844
+ return {
845
+ mode: mode,
846
+ uniqueProvider,
847
+ possibilities: possibilities,
848
+ inputComponents,
849
+ model: model,
850
+ };
851
+ }
852
+ }
853
+ }
854
+ /** @nocollapse */ /** @nocollapse */ FormOptionsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FormOptionsPipe, deps: [{ token: CRUD_MODEL_POSSIBILITIES_PROVIDER, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
855
+ /** @nocollapse */ /** @nocollapse */ FormOptionsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FormOptionsPipe, name: "smartFormOptions" });
856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: FormOptionsPipe, decorators: [{
857
+ type: Pipe,
858
+ args: [{
859
+ name: "smartFormOptions",
860
+ }]
861
+ }], ctorParameters: function () {
862
+ return [{ type: ICrudModelPossibilitiesProvider, decorators: [{
863
+ type: Optional
864
+ }, {
865
+ type: Inject,
866
+ args: [CRUD_MODEL_POSSIBILITIES_PROVIDER]
867
+ }] }];
868
+ } });
869
+
870
+ class MultiselectComponent {
871
+ constructor(facade, config, menuService) {
872
+ this.facade = facade;
873
+ this.config = config;
874
+ this.menuService = menuService;
875
+ this.buttonOptions = {
876
+ click: () => __awaiter(this, void 0, void 0, function* () {
877
+ const result = this._list.map(item => {
878
+ return Object.assign(Object.assign({}, this._changes), { id: item.id });
879
+ });
880
+ this.facade.updatePartialMany(result);
881
+ yield this.menuService.closeEnd();
882
+ }),
883
+ confirm: true
884
+ };
885
+ this.list$ = this.facade.multiSelected$.pipe(tap(list => {
886
+ this.lock = true;
887
+ const model = new this.config.type();
888
+ const fieldsWithOptions = getModelFieldsWithOptions(model)
889
+ .filter(f => { var _a; return (_a = f.options.update) === null || _a === void 0 ? void 0 : _a.multi; });
890
+ fieldsWithOptions.forEach(({ key }) => {
891
+ const uniques = _.uniq(list.map(i => i[key]));
892
+ if (uniques.length === 1) {
893
+ model[key] = uniques[0];
894
+ }
895
+ });
896
+ this.item = model;
897
+ }));
898
+ }
899
+ onClose() {
900
+ return __awaiter(this, void 0, void 0, function* () {
901
+ yield this.menuService.closeEnd();
902
+ });
903
+ }
904
+ onPartialChange(changes, list) {
905
+ this.lock = false;
906
+ this._list = list;
907
+ this._changes = changes;
908
+ }
909
+ onValidChange(valid) {
910
+ this.valid = valid;
911
+ }
912
+ ngOnInit() {
913
+ }
914
+ }
915
+ /** @nocollapse */ /** @nocollapse */ MultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: MultiselectComponent, deps: [{ token: CrudFacade }, { token: CrudConfig }, { token: i3.MenuService }], target: i0.ɵɵFactoryTarget.Component });
916
+ /** @nocollapse */ /** @nocollapse */ MultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: MultiselectComponent, selector: "smart-crud-multiselect", ngImport: i0, template: "<ng-container *ngIf=\"list$ | async; let list\">\n <ion-header>\n <ion-toolbar>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"onClose()\">\n <ion-icon slot=\"icon-only\" name=\"close\"> </ion-icon>\n </ion-button>\n </ion-buttons>\n <ion-title>{{ 'selected' | translate }}: {{ list?.length }}</ion-title>\n </ion-toolbar>\n </ion-header>\n\n <div *ngIf=\"item\">\n <smart-form [options]=\"item | smartFormOptions : 'multiUpdate' : config.type\" (valuePartialChange)=\"onPartialChange($event, list)\" (validChange)=\"onValidChange($event)\"></smart-form>\n\n <smart-button style=\"float: right\" [disabled]=\"lock || !valid\" [options]=\"buttonOptions\">{{ 'change' | translate }}</smart-button>\n </div>\n</ng-container>", styles: [":host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){:host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}}@media only screen and (max-width: 420px){:host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}}:host ion-toolbar.ios{height:4.6rem;--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){:host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}:host ion-toolbar.ios ion-title{text-align:left;padding-left:5.2rem}:host ion-toolbar.ios ion-icon{color:var(--ion-color-light)}}@media only screen and (max-width: 420px){:host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}:host ion-toolbar.ios ion-title{text-align:left;padding-left:5.2rem}:host ion-toolbar.ios ion-icon{color:var(--ion-color-light)}}.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-title{text-align:left;padding-left:1.2rem}.modal-wrapper :host ion-toolbar.ios ion-icon{color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-buttons{margin:0}}@media only screen and (max-width: 420px){.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-title{text-align:left;padding-left:1.2rem}.modal-wrapper :host ion-toolbar.ios ion-icon{color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-buttons{margin:0}}:host ion-toolbar ion-menu-button{color:var(--ion-color-light)}:host ion-toolbar ion-buttons.ios{height:var(--smart-button-height);margin:0}\n"], components: [{ type: i1$1.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { type: i1$1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { type: i1$1.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { type: i1$1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { type: i1$1.IonIcon, selector: "ion-icon", inputs: ["ariaHidden", "ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { type: i1$1.IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { type: i3.FormComponent, selector: "smart-form", inputs: ["options"], outputs: ["invokeSubmit", "valueChange", "valuePartialChange", "validChange"] }, { type: i3.ButtonComponent, selector: "smart-button", inputs: ["options", "disabled"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3$1.AsyncPipe, "translate": i4.TranslatePipe, "smartFormOptions": FormOptionsPipe } });
917
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: MultiselectComponent, decorators: [{
918
+ type: Component,
919
+ args: [{ selector: 'smart-crud-multiselect', template: "<ng-container *ngIf=\"list$ | async; let list\">\n <ion-header>\n <ion-toolbar>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"onClose()\">\n <ion-icon slot=\"icon-only\" name=\"close\"> </ion-icon>\n </ion-button>\n </ion-buttons>\n <ion-title>{{ 'selected' | translate }}: {{ list?.length }}</ion-title>\n </ion-toolbar>\n </ion-header>\n\n <div *ngIf=\"item\">\n <smart-form [options]=\"item | smartFormOptions : 'multiUpdate' : config.type\" (valuePartialChange)=\"onPartialChange($event, list)\" (validChange)=\"onValidChange($event)\"></smart-form>\n\n <smart-button style=\"float: right\" [disabled]=\"lock || !valid\" [options]=\"buttonOptions\">{{ 'change' | translate }}</smart-button>\n </div>\n</ng-container>", styles: [":host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){:host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}}@media only screen and (max-width: 420px){:host ion-toolbar{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}}:host ion-toolbar.ios{height:4.6rem;--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){:host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}:host ion-toolbar.ios ion-title{text-align:left;padding-left:5.2rem}:host ion-toolbar.ios ion-icon{color:var(--ion-color-light)}}@media only screen and (max-width: 420px){:host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-primary), var(--ion-color-tertiary));--color: var(--ion-color-light)}:host ion-toolbar.ios ion-title{text-align:left;padding-left:5.2rem}:host ion-toolbar.ios ion-icon{color:var(--ion-color-light)}}.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));--color: var(--ion-color-dark)}@media only screen and (max-width: 992px){.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-title{text-align:left;padding-left:1.2rem}.modal-wrapper :host ion-toolbar.ios ion-icon{color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-buttons{margin:0}}@media only screen and (max-width: 420px){.modal-wrapper :host ion-toolbar.ios{--background: linear-gradient(33deg, var(--ion-color-light), var(--ion-color-light-shade));color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-title{text-align:left;padding-left:1.2rem}.modal-wrapper :host ion-toolbar.ios ion-icon{color:var(--ion-color-dark)}.modal-wrapper :host ion-toolbar.ios ion-buttons{margin:0}}:host ion-toolbar ion-menu-button{color:var(--ion-color-light)}:host ion-toolbar ion-buttons.ios{height:var(--smart-button-height);margin:0}\n"] }]
920
+ }], ctorParameters: function () { return [{ type: CrudFacade }, { type: CrudConfig }, { type: i3.MenuService }]; } });
921
+
922
+ class CrudListGroupService {
923
+ constructor(facade) {
924
+ this.facade = facade;
925
+ this._destroyed = [];
926
+ }
927
+ change(val, item, groups, force) {
928
+ if (val || force) {
929
+ item.changed = true;
930
+ let current = this.facade.filter.query.find(q => q.key === item.key && q.type === '=');
931
+ if (!current) {
932
+ current = {
933
+ key: item.key,
934
+ type: "=",
935
+ value: null
936
+ };
937
+ this.facade.filter.query.push(current);
938
+ }
939
+ current.value = item.value;
940
+ current.hidden = true;
941
+ this.facade.read(Object.assign(Object.assign({}, this.facade.filter), { offset: 0 }));
942
+ }
943
+ }
944
+ destroy(groups) {
945
+ this._destroyed = [
946
+ ...(this._destroyed ? this._destroyed : []),
947
+ ...groups.filter(g => g.changed)
948
+ ];
949
+ this.refresh();
950
+ }
951
+ refresh() {
952
+ const list = this._destroyed;
953
+ this._destroyed = [];
954
+ const newQuery = this.facade.filter.query.filter(q => !list.some(i => q.key === i.key));
955
+ this.facade.read(Object.assign(Object.assign({}, this.facade.filter), { query: newQuery }));
956
+ }
957
+ }
958
+ /** @nocollapse */ /** @nocollapse */ CrudListGroupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudListGroupService, deps: [{ token: CrudFacade }], target: i0.ɵɵFactoryTarget.Injectable });
959
+ /** @nocollapse */ /** @nocollapse */ CrudListGroupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudListGroupService });
960
+ __decorate([
961
+ debounce(250),
962
+ __metadata("design:type", Function),
963
+ __metadata("design:paramtypes", []),
964
+ __metadata("design:returntype", void 0)
965
+ ], CrudListGroupService.prototype, "refresh", null);
966
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudListGroupService, decorators: [{
967
+ type: Injectable
968
+ }], ctorParameters: function () { return [{ type: CrudFacade }]; }, propDecorators: { refresh: [] } });
969
+
970
+ class GroupComponent extends BaseComponent$1 {
971
+ constructor(styleService, elementRef, facade, cd, groupService) {
972
+ super();
973
+ this.styleService = styleService;
974
+ this.elementRef = elementRef;
975
+ this.facade = facade;
976
+ this.cd = cd;
977
+ this.groupService = groupService;
978
+ }
979
+ change(val, item, force = false) {
980
+ this.groups.filter(i => i.value !== item.value || i.key !== item.key).forEach(i => {
981
+ i.show = false;
982
+ });
983
+ this.groupService.change(val, item, this.groups, force);
984
+ if (val) {
985
+ setTimeout(() => {
986
+ item.show = val;
987
+ this.cd.detectChanges();
988
+ });
989
+ }
990
+ else {
991
+ item.show = val;
992
+ this.cd.detectChanges();
993
+ }
994
+ }
995
+ ngOnInit() {
996
+ this.styleService.init(this.elementRef);
997
+ }
998
+ ngOnDestroy() {
999
+ this.groupService.destroy(this.groups);
1000
+ super.ngOnDestroy();
1001
+ }
1002
+ }
1003
+ /** @nocollapse */ /** @nocollapse */ GroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: GroupComponent, deps: [{ token: i3.StyleService }, { token: i0.ElementRef }, { token: CrudFacade }, { token: i0.ChangeDetectorRef }, { token: CrudListGroupService }], target: i0.ɵɵFactoryTarget.Component });
1004
+ /** @nocollapse */ /** @nocollapse */ GroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: GroupComponent, selector: "smart-crud-group", inputs: { groups: "groups", listOptions: "listOptions" }, usesInheritance: true, ngImport: i0, template: "<smart-accordion *ngFor=\"let item of groups\" [(show)]=\"item.show\" (showChange)=\"change($event, item)\">\n <smart-accordion-header [ngClass]=\"{ 'accordion-show': item.show }\">{{ item.text | translate }}</smart-accordion-header>\n <smart-accordion-body>\n <smart-list *ngIf=\"item.show && !item.children && listOptions\" [options]=\"listOptions\"></smart-list>\n <div *ngIf=\"item.children\" style=\"margin-left: 50px\">\n <smart-crud-group [groups]=\"item.children\" [listOptions]=\"listOptions\"></smart-crud-group>\n </div>\n </smart-accordion-body>\n</smart-accordion>\n<br/><br/><br/>", styles: [".accordion-show{font-weight:bolder}\n"], components: [{ type: i3.AccordionComponent, selector: "smart-accordion", inputs: ["show"], outputs: ["showChange"] }, { type: i3.AccordionHeaderComponent, selector: "smart-accordion-header" }, { type: i3.AccordionBodyComponent, selector: "smart-accordion-body" }, { type: i3.ListComponent, selector: "smart-list", inputs: ["options"] }, { type: GroupComponent, selector: "smart-crud-group", inputs: ["groups", "listOptions"] }], directives: [{ type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i4.TranslatePipe } });
1005
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: GroupComponent, decorators: [{
1006
+ type: Component,
1007
+ args: [{ selector: 'smart-crud-group', template: "<smart-accordion *ngFor=\"let item of groups\" [(show)]=\"item.show\" (showChange)=\"change($event, item)\">\n <smart-accordion-header [ngClass]=\"{ 'accordion-show': item.show }\">{{ item.text | translate }}</smart-accordion-header>\n <smart-accordion-body>\n <smart-list *ngIf=\"item.show && !item.children && listOptions\" [options]=\"listOptions\"></smart-list>\n <div *ngIf=\"item.children\" style=\"margin-left: 50px\">\n <smart-crud-group [groups]=\"item.children\" [listOptions]=\"listOptions\"></smart-crud-group>\n </div>\n </smart-accordion-body>\n</smart-accordion>\n<br/><br/><br/>", styles: [".accordion-show{font-weight:bolder}\n"] }]
1008
+ }], ctorParameters: function () { return [{ type: i3.StyleService }, { type: i0.ElementRef }, { type: CrudFacade }, { type: i0.ChangeDetectorRef }, { type: CrudListGroupService }]; }, propDecorators: { groups: [{
1009
+ type: Input
1010
+ }], listOptions: [{
1011
+ type: Input
1012
+ }] } });
1013
+
1014
+ class SocketService {
1015
+ }
1016
+ /** @nocollapse */ /** @nocollapse */ SocketService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SocketService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1017
+ /** @nocollapse */ /** @nocollapse */ SocketService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SocketService });
1018
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SocketService, decorators: [{
1019
+ type: Injectable
1020
+ }] });
1021
+ class NotSocketService {
1022
+ }
1023
+ /** @nocollapse */ /** @nocollapse */ NotSocketService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: NotSocketService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1024
+ /** @nocollapse */ /** @nocollapse */ NotSocketService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: NotSocketService });
1025
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: NotSocketService, decorators: [{
1026
+ type: Injectable
1027
+ }] });
1028
+
1029
+ class CrudPipesModule {
1030
+ }
1031
+ /** @nocollapse */ /** @nocollapse */ CrudPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1032
+ /** @nocollapse */ /** @nocollapse */ CrudPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudPipesModule, declarations: [FormOptionsPipe], exports: [FormOptionsPipe] });
1033
+ /** @nocollapse */ /** @nocollapse */ CrudPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudPipesModule });
1034
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudPipesModule, decorators: [{
1035
+ type: NgModule,
1036
+ args: [{
1037
+ declarations: [
1038
+ FormOptionsPipe
1039
+ ],
1040
+ exports: [
1041
+ FormOptionsPipe
1042
+ ]
1043
+ }]
1044
+ }] });
1045
+
1046
+ class CrudService {
1047
+ constructor(config, http, socket) {
1048
+ this.config = config;
1049
+ this.http = http;
1050
+ this.socket = socket;
1051
+ this._formatMap = {
1052
+ csv: "text/csv",
1053
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1054
+ };
1055
+ }
1056
+ // changes(criteria: { id?: string } = {}): Observable<ItemChangedData> {
1057
+ // this.socket.emit("changes", criteria);
1058
+ // return this.socket.fromEvent("changes");
1059
+ // }
1060
+ // TODO : Location is null
1061
+ create(item) {
1062
+ return this.http
1063
+ .post(this.config.apiUrl, item, { observe: "response" })
1064
+ .pipe(map((response) => {
1065
+ const location = response.headers["Location"];
1066
+ if (!location)
1067
+ return null;
1068
+ const array = location.split("/");
1069
+ return array[array.length - 1];
1070
+ }));
1071
+ }
1072
+ createMany(items, options) {
1073
+ return this.http.post(this.config.apiUrl + "/bulk?mode=" + options.mode, items);
1074
+ }
1075
+ getById(id) {
1076
+ return this.http.get(this.config.apiUrl + "/" + id);
1077
+ }
1078
+ getList(filter = null) {
1079
+ return this.http.get(this.config.apiUrl + this.getQuery(filter));
1080
+ }
1081
+ exportList(filter = null, format) {
1082
+ if (!format) {
1083
+ format = "csv";
1084
+ }
1085
+ if (format === "xlsx") {
1086
+ return this.http
1087
+ .get(this.config.apiUrl + this.getQuery(filter), {
1088
+ headers: {
1089
+ "Content-Type": this._formatMap[format],
1090
+ },
1091
+ observe: "response",
1092
+ reportProgress: false,
1093
+ responseType: "blob",
1094
+ })
1095
+ .pipe(map((res) => {
1096
+ const downloadLink = document.createElement("a");
1097
+ const blob = res.body;
1098
+ const url = URL.createObjectURL(blob);
1099
+ downloadLink.href = url;
1100
+ downloadLink.download = "data." + format;
1101
+ document.body.appendChild(downloadLink);
1102
+ downloadLink.click();
1103
+ document.body.removeChild(downloadLink);
1104
+ }));
1105
+ }
1106
+ return this.http
1107
+ .get(this.config.apiUrl + this.getQuery(filter), {
1108
+ headers: {
1109
+ "Content-Type": this._formatMap[format],
1110
+ },
1111
+ responseType: "text",
1112
+ })
1113
+ .pipe(map((res) => {
1114
+ const downloadLink = document.createElement("a");
1115
+ const blob = new Blob(["\ufeff", res]);
1116
+ const url = URL.createObjectURL(blob);
1117
+ downloadLink.href = url;
1118
+ downloadLink.download = "data." + format;
1119
+ document.body.appendChild(downloadLink);
1120
+ downloadLink.click();
1121
+ document.body.removeChild(downloadLink);
1122
+ }));
1123
+ }
1124
+ update(item) {
1125
+ return this.http.put(this.config.apiUrl + "/" + item.id, item);
1126
+ }
1127
+ updatePartial(item) {
1128
+ return this.http.patch(this.config.apiUrl + "/" + item.id, item);
1129
+ }
1130
+ updatePartialMany(items) {
1131
+ return forkJoin(items.map(item => {
1132
+ return this.updatePartial(item);
1133
+ }));
1134
+ }
1135
+ delete(id) {
1136
+ return this.http.delete(this.config.apiUrl + "/" + id);
1137
+ }
1138
+ getQuery(filter) {
1139
+ let query = "";
1140
+ if (filter && filter.searchText) {
1141
+ query += "&$search=" + filter.searchText;
1142
+ }
1143
+ if (filter && filter.limit) {
1144
+ query += `&limit=${filter.limit}&offset=${filter.offset ? filter.offset : 0}`;
1145
+ }
1146
+ if (filter && filter.sortBy) {
1147
+ query += `&sort=${(filter.sortDesc ? "-" : "") + filter.sortBy}`;
1148
+ }
1149
+ if (filter && filter.query) {
1150
+ filter.query.forEach((q) => {
1151
+ if (q.value
1152
+ && (typeof q.value === 'string')
1153
+ && q.value.match(/^-?\d+$/)
1154
+ && q.value[0] !== "'"
1155
+ && q.value[0] !== '"') {
1156
+ query += "&" + q.key + q.type + `'${q.value}'`;
1157
+ }
1158
+ else {
1159
+ query += "&" + q.key + q.type + q.value;
1160
+ }
1161
+ });
1162
+ }
1163
+ return query ? "?" + query.replace("&", "") : "";
1164
+ }
1165
+ }
1166
+ /** @nocollapse */ /** @nocollapse */ CrudService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudService, deps: [{ token: CrudConfig }, { token: i2$1.HttpClient }, { token: SocketService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1167
+ /** @nocollapse */ /** @nocollapse */ CrudService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudService });
1168
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudService, decorators: [{
1169
+ type: Injectable
1170
+ }], ctorParameters: function () {
1171
+ return [{ type: CrudConfig }, { type: i2$1.HttpClient }, { type: SocketService, decorators: [{
1172
+ type: Optional
1173
+ }] }];
1174
+ } });
1175
+
1176
+ class CrudEffects {
1177
+ constructor(actions$, service, config, store, state) {
1178
+ this.actions$ = actions$;
1179
+ this.service = service;
1180
+ this.config = config;
1181
+ this.store = store;
1182
+ this.state = state;
1183
+ }
1184
+ init() {
1185
+ const metadata = Reflect.getMetadata(this.config.entity, CrudEffects);
1186
+ if (metadata)
1187
+ return;
1188
+ Reflect.defineMetadata(this.config.entity, true, CrudEffects);
1189
+ this.actions$.subscribe((action) => {
1190
+ switch (action.type) {
1191
+ case `[${this.config.entity}] Create`:
1192
+ this.service
1193
+ .create(action.item)
1194
+ .pipe(tap(() => this.store.dispatch(createSuccess(this.config.entity, action.item))), catchError((error) => {
1195
+ this.store.dispatch(createFailure(this.config.entity, action.item, error));
1196
+ return of();
1197
+ }))
1198
+ .subscribe();
1199
+ break;
1200
+ case `[${this.config.entity}] Create Success`:
1201
+ const createState = this.state.getValue()[this.config.entity];
1202
+ this.store.dispatch(read(this.config.entity, createState.filter ? Object.assign(Object.assign({}, createState.filter), { offset: 0 }) : null));
1203
+ break;
1204
+ case `[${this.config.entity}] Create Many`:
1205
+ this.service
1206
+ .createMany(action.data.items, action.data.options)
1207
+ .pipe(tap(() => this.store.dispatch(createManySuccess(this.config.entity, {
1208
+ items: action.data.items,
1209
+ options: action.data.options,
1210
+ }))), catchError((error) => {
1211
+ this.store.dispatch(createManyFailure(this.config.entity, {
1212
+ items: action.data.items,
1213
+ options: action.data.options,
1214
+ }, error));
1215
+ return of();
1216
+ }))
1217
+ .subscribe();
1218
+ break;
1219
+ case `[${this.config.entity}] Create Many Success`:
1220
+ const createManyState = this.state.getValue()[this.config.entity];
1221
+ this.store.dispatch(read(this.config.entity, createManyState.filter
1222
+ ? Object.assign(Object.assign({}, createManyState.filter), { offset: 0 }) : null));
1223
+ break;
1224
+ case `[${this.config.entity}] Read`:
1225
+ this.service
1226
+ .getList(action.filter)
1227
+ .pipe(tap((result) => this.store.dispatch(readSuccess(this.config.entity, action.filter, result))), catchError((error) => {
1228
+ this.store.dispatch(readFailure(this.config.entity, action.filter, error));
1229
+ return of();
1230
+ }))
1231
+ .subscribe();
1232
+ break;
1233
+ case `[${this.config.entity}] Export`:
1234
+ this.service
1235
+ .exportList(action.filter, action.format)
1236
+ .pipe(tap((result) => this.store.dispatch(exportListSuccess(this.config.entity, action.filter))), catchError((error) => {
1237
+ this.store.dispatch(exportListFailure(this.config.entity, action.filter, error));
1238
+ return of();
1239
+ }))
1240
+ .subscribe();
1241
+ break;
1242
+ case `[${this.config.entity}] Select`:
1243
+ this.service
1244
+ .getById(action.id)
1245
+ .pipe(tap((result) => this.store.dispatch(selectSuccess(this.config.entity, action.id, result))), catchError((error) => {
1246
+ this.store.dispatch(selectFailure(this.config.entity, action.id, error));
1247
+ return of();
1248
+ }))
1249
+ .subscribe();
1250
+ break;
1251
+ case `[${this.config.entity}] Update`:
1252
+ this.service
1253
+ .updatePartial(action.item)
1254
+ .pipe(tap(() => this.store.dispatch(updateSuccess(this.config.entity, action.item))), catchError((error) => {
1255
+ this.store.dispatch(updateFailure(this.config.entity, action.item, error));
1256
+ this.store.dispatch(read(this.config.entity));
1257
+ return of();
1258
+ }))
1259
+ .subscribe();
1260
+ break;
1261
+ case `[${this.config.entity}] Update Success`:
1262
+ this.store
1263
+ .pipe(select$1(getCrudFilter(this.config.entity)), first())
1264
+ .subscribe((filter) => {
1265
+ this.store.dispatch(read(this.config.entity, Object.assign(Object.assign({}, filter), { offset: 0 })));
1266
+ this.store.dispatch(select(this.config.entity, action.item.id));
1267
+ });
1268
+ break;
1269
+ case `[${this.config.entity}] Update partial`:
1270
+ this.service
1271
+ .updatePartial(action.item)
1272
+ .pipe(tap(() => this.store.dispatch(updatePartialSuccess(this.config.entity, action.item))), catchError((error) => {
1273
+ this.store.dispatch(updatePartialFailure(this.config.entity, action.item, error));
1274
+ this.store.dispatch(read(this.config.entity));
1275
+ return of();
1276
+ }))
1277
+ .subscribe();
1278
+ break;
1279
+ case `[${this.config.entity}] Update partial Success`:
1280
+ this.store
1281
+ .pipe(select$1(getCrudFilter(this.config.entity)), first())
1282
+ .subscribe((filter) => {
1283
+ this.store.dispatch(read(this.config.entity, Object.assign(Object.assign({}, filter), { offset: 0 })));
1284
+ this.store.dispatch(select(this.config.entity, action.item.id));
1285
+ });
1286
+ break;
1287
+ case `[${this.config.entity}] Update partial many`:
1288
+ this.service
1289
+ .updatePartialMany(action.items)
1290
+ .pipe(tap(() => this.store.dispatch(updatePartialManySuccess(this.config.entity, action.items))), catchError((error) => {
1291
+ this.store.dispatch(updatePartialManyFailure(this.config.entity, action.items, error));
1292
+ this.store.dispatch(read(this.config.entity));
1293
+ return of();
1294
+ }))
1295
+ .subscribe();
1296
+ break;
1297
+ case `[${this.config.entity}] Update partial many Success`:
1298
+ this.store
1299
+ .pipe(select$1(getCrudFilter(this.config.entity)), first())
1300
+ .subscribe((filter) => {
1301
+ this.store.dispatch(read(this.config.entity, Object.assign(Object.assign({}, filter), { offset: 0 })));
1302
+ });
1303
+ break;
1304
+ case `[${this.config.entity}] Delete`:
1305
+ this.service
1306
+ .delete(action.id)
1307
+ .pipe(tap(() => this.store.dispatch(deleteSuccess(this.config.entity, action.id))), catchError((error) => {
1308
+ this.store.dispatch(deleteFailure(this.config.entity, action.id, error));
1309
+ return of();
1310
+ }))
1311
+ .subscribe();
1312
+ break;
1313
+ case `[${this.config.entity}] Delete Success`:
1314
+ this.store
1315
+ .pipe(select$1(getCrudFilter(this.config.entity)), first())
1316
+ .subscribe((filter) => {
1317
+ this.store.dispatch(read(this.config.entity, Object.assign(Object.assign({}, filter), { offset: 0 })));
1318
+ });
1319
+ break;
1320
+ default:
1321
+ break;
1322
+ }
1323
+ });
1324
+ }
1325
+ }
1326
+ /** @nocollapse */ /** @nocollapse */ CrudEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudEffects, deps: [{ token: i1.ActionsSubject }, { token: CrudService }, { token: CrudConfig }, { token: i1.Store }, { token: i1.State }], target: i0.ɵɵFactoryTarget.Injectable });
1327
+ /** @nocollapse */ /** @nocollapse */ CrudEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudEffects });
1328
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudEffects, decorators: [{
1329
+ type: Injectable
1330
+ }], ctorParameters: function () { return [{ type: i1.ActionsSubject }, { type: CrudService }, { type: CrudConfig }, { type: i1.Store }, { type: i1.State }]; } });
1331
+
1332
+ class CrudListPaginationFactory {
1333
+ constructor(facade) {
1334
+ this.facade = facade;
1335
+ }
1336
+ create(options) {
1337
+ return __awaiter(this, void 0, void 0, function* () {
1338
+ return {
1339
+ mode: options.mode,
1340
+ limit: options.limit,
1341
+ loadNextPage: () => {
1342
+ if (!options.provider.getLinks() || !options.provider.getLinks().next)
1343
+ return Promise.resolve(false);
1344
+ return new Promise((res) => {
1345
+ const sub = this.facade.loaded$.subscribe((l) => {
1346
+ if (l) {
1347
+ // if (sub && !sub.closed) sub.unsubscribe();
1348
+ setTimeout(() => {
1349
+ res(options.provider.getLinks() &&
1350
+ options.provider.getLinks().next);
1351
+ });
1352
+ }
1353
+ });
1354
+ this.facade.read(Object.assign(Object.assign({}, options.provider.getFilter()), { offset: options.provider.getFilter().offset +
1355
+ options.provider.getFilter().limit }));
1356
+ });
1357
+ },
1358
+ loadPrevPage: () => {
1359
+ if (!options.provider.getLinks() || !options.provider.getLinks().prev)
1360
+ return Promise.resolve(false);
1361
+ return new Promise((res) => {
1362
+ const sub = this.facade.loaded$.subscribe((l) => {
1363
+ if (l) {
1364
+ // if (sub && !sub.closed) sub.unsubscribe();
1365
+ setTimeout(() => {
1366
+ res(options.provider.getLinks() &&
1367
+ options.provider.getLinks().prev);
1368
+ });
1369
+ }
1370
+ });
1371
+ this.facade.read(Object.assign(Object.assign({}, options.provider.getFilter()), { offset: options.provider.getFilter().offset -
1372
+ options.provider.getFilter().limit }));
1373
+ });
1374
+ },
1375
+ page$: this.facade.filter$.pipe(map((f) => {
1376
+ return (f === null || f === void 0 ? void 0 : f.limit) ? f.offset / f.limit + 1 : 0;
1377
+ })),
1378
+ totalPages$: combineLatest(this.facade.filter$, this.facade.totalCount$).pipe(map(([filter, totalCount]) => {
1379
+ return (filter === null || filter === void 0 ? void 0 : filter.limit) ? Math.ceil(totalCount / filter.limit) : 0;
1380
+ })),
1381
+ };
1382
+ });
1383
+ }
1384
+ }
1385
+ /** @nocollapse */ /** @nocollapse */ CrudListPaginationFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudListPaginationFactory, deps: [{ token: CrudFacade }], target: i0.ɵɵFactoryTarget.Injectable });
1386
+ /** @nocollapse */ /** @nocollapse */ CrudListPaginationFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudListPaginationFactory });
1387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudListPaginationFactory, decorators: [{
1388
+ type: Injectable
1389
+ }], ctorParameters: function () { return [{ type: CrudFacade }]; } });
1390
+
1391
+ const COMPONENTS = [
1392
+ ExportComponent,
1393
+ FilterComponent,
1394
+ FilterTextComponent,
1395
+ FiltersConfigComponent,
1396
+ FilterDateComponent,
1397
+ FilterDateWithEditComponent,
1398
+ FilterRadioComponent,
1399
+ FiltersComponent,
1400
+ FilterFlagComponent,
1401
+ FilterCheckComponent,
1402
+ FilterIntComponent,
1403
+ MultiselectComponent,
1404
+ GroupComponent
1405
+ ];
1406
+ class CrudComponentsModule {
1407
+ }
1408
+ /** @nocollapse */ /** @nocollapse */ CrudComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1409
+ /** @nocollapse */ /** @nocollapse */ CrudComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudComponentsModule, declarations: [ExportComponent,
1410
+ FilterComponent,
1411
+ FilterTextComponent,
1412
+ FiltersConfigComponent,
1413
+ FilterDateComponent,
1414
+ FilterDateWithEditComponent,
1415
+ FilterRadioComponent,
1416
+ FiltersComponent,
1417
+ FilterFlagComponent,
1418
+ FilterCheckComponent,
1419
+ FilterIntComponent,
1420
+ MultiselectComponent,
1421
+ GroupComponent], imports: [
1422
+ //AuthSharedModule,
1423
+ StoreModule,
1424
+ SharedModule,
1425
+ CrudPipesModule,
1426
+ FormsModule,
1427
+ CommonModule
1428
+ ], exports: [CrudPipesModule, ExportComponent,
1429
+ FilterComponent,
1430
+ FilterTextComponent,
1431
+ FiltersConfigComponent,
1432
+ FilterDateComponent,
1433
+ FilterDateWithEditComponent,
1434
+ FilterRadioComponent,
1435
+ FiltersComponent,
1436
+ FilterFlagComponent,
1437
+ FilterCheckComponent,
1438
+ FilterIntComponent,
1439
+ MultiselectComponent,
1440
+ GroupComponent] });
1441
+ /** @nocollapse */ /** @nocollapse */ CrudComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudComponentsModule, providers: [
1442
+ CrudService,
1443
+ CrudEffects,
1444
+ CrudFacade,
1445
+ SocketService,
1446
+ CrudListPaginationFactory,
1447
+ ], imports: [[
1448
+ //AuthSharedModule,
1449
+ StoreModule,
1450
+ SharedModule,
1451
+ CrudPipesModule,
1452
+ FormsModule,
1453
+ CommonModule
1454
+ ], CrudPipesModule] });
1455
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudComponentsModule, decorators: [{
1456
+ type: NgModule,
1457
+ args: [{
1458
+ declarations: [
1459
+ ...COMPONENTS
1460
+ ],
1461
+ imports: [
1462
+ //AuthSharedModule,
1463
+ StoreModule,
1464
+ SharedModule,
1465
+ CrudPipesModule,
1466
+ FormsModule,
1467
+ CommonModule
1468
+ ],
1469
+ exports: [
1470
+ CrudPipesModule,
1471
+ ...COMPONENTS
1472
+ ],
1473
+ providers: [
1474
+ CrudService,
1475
+ CrudEffects,
1476
+ CrudFacade,
1477
+ SocketService,
1478
+ CrudListPaginationFactory,
1479
+ ]
1480
+ }]
1481
+ }] });
1482
+
1483
+ const initialState = {
1484
+ loaded: false
1485
+ };
1486
+ const crudReducer = (state = initialState, action, entity) => {
1487
+ switch (action.type) {
1488
+ case `[${entity}] Create`:
1489
+ return Object.assign(Object.assign({}, state), { loaded: false, error: null });
1490
+ case `[${entity}] Create Success`:
1491
+ return Object.assign(Object.assign({}, state), { loaded: true, error: null });
1492
+ case `[${entity}] Create Failure`:
1493
+ return Object.assign(Object.assign({}, state), { loaded: true, error: action.error });
1494
+ case `[${entity}] Create Many`:
1495
+ return Object.assign(Object.assign({}, state), { loaded: false, error: null });
1496
+ case `[${entity}] Create Many Success`:
1497
+ return Object.assign(Object.assign({}, state), { loaded: true, error: null });
1498
+ case `[${entity}] Create Many Failure`:
1499
+ return Object.assign(Object.assign({}, state), { loaded: true, error: action.error });
1500
+ case `[${entity}] Export`:
1501
+ return Object.assign(Object.assign({}, state), { loaded: false });
1502
+ case `[${entity}] Export Success`:
1503
+ return Object.assign(Object.assign({}, state), { loaded: true });
1504
+ case `[${entity}] Export Failure`:
1505
+ return Object.assign(Object.assign({}, state), { loaded: true });
1506
+ case `[${entity}] Read`:
1507
+ return Object.assign(Object.assign({}, state), { loaded: false, filter: action.filter, error: null, totalCount: null, links: null });
1508
+ case `[${entity}] Read Success`:
1509
+ let list = [];
1510
+ if (action.filter
1511
+ && action.filter.offset
1512
+ && state.list
1513
+ && action.filter.paginationMode !== PaginationMode.singlePage) {
1514
+ state.list.forEach(i => {
1515
+ list.push(i);
1516
+ });
1517
+ list = [
1518
+ ...list,
1519
+ ...action.result.data
1520
+ ];
1521
+ }
1522
+ else {
1523
+ list = action.result.data;
1524
+ }
1525
+ return Object.assign(Object.assign({}, state), { loaded: true, list, totalCount: action.result.totalCount, links: action.result.links, error: null });
1526
+ case `[${entity}] Read Failure`:
1527
+ return Object.assign(Object.assign({}, state), { loaded: true, error: action.error });
1528
+ case `[${entity}] Select`:
1529
+ return Object.assign(Object.assign({}, state), { loaded: false, selected: null, error: null });
1530
+ case `[${entity}] Select Success`:
1531
+ return Object.assign(Object.assign({}, state), { loaded: true, selected: action.item, error: null });
1532
+ case `[${entity}] Select Failure`:
1533
+ return Object.assign(Object.assign({}, state), { loaded: true, error: action.error });
1534
+ case `[${entity}] MultiSelect`:
1535
+ return Object.assign(Object.assign({}, state), { multiSelected: [...action.items] });
1536
+ case `[${entity}] Unselect`:
1537
+ return Object.assign(Object.assign({}, state), { loaded: true, selected: null, error: null });
1538
+ case `[${entity}] Update`:
1539
+ return Object.assign(Object.assign({}, state), { loaded: false, error: null });
1540
+ case `[${entity}] Update Success`:
1541
+ return Object.assign(Object.assign({}, state), { loaded: true, error: null });
1542
+ case `[${entity}] Update Failure`:
1543
+ return Object.assign(Object.assign({}, state), { loaded: true, error: action.error });
1544
+ case `[${entity}] Update partial`:
1545
+ return Object.assign(Object.assign({}, state), { loaded: false, error: null });
1546
+ case `[${entity}] Update partial Success`:
1547
+ return Object.assign(Object.assign({}, state), { loaded: true, error: null });
1548
+ case `[${entity}] Update partial Failure`:
1549
+ return Object.assign(Object.assign({}, state), { loaded: true, error: action.error });
1550
+ case `[${entity}] Update partial many`:
1551
+ return Object.assign(Object.assign({}, state), { loaded: false, error: null });
1552
+ case `[${entity}] Update partial many Success`:
1553
+ return Object.assign(Object.assign({}, state), { multiSelected: [], loaded: true, error: null });
1554
+ case `[${entity}] Update partial many Failure`:
1555
+ return Object.assign(Object.assign({}, state), { loaded: true, error: action.error });
1556
+ case `[${entity}] Delete`:
1557
+ return Object.assign(Object.assign({}, state), { loaded: false, error: null });
1558
+ case `[${entity}] Delete Success`:
1559
+ return Object.assign(Object.assign({}, state), { loaded: true, error: null });
1560
+ case `[${entity}] Delete Failure`:
1561
+ return Object.assign(Object.assign({}, state), { loaded: true, error: action.error });
1562
+ default:
1563
+ return state;
1564
+ }
1565
+ };
1566
+ function getReducer(entity) {
1567
+ return (state, action) => {
1568
+ return crudReducer(state, action, entity);
1569
+ };
1570
+ }
1571
+
1572
+ class PageService {
1573
+ constructor(authService, config) {
1574
+ this.authService = authService;
1575
+ this.config = config;
1576
+ }
1577
+ checkPermissions() {
1578
+ const val = this.config;
1579
+ const modelOptions = getModelOptions(val.type);
1580
+ if (val.add &&
1581
+ modelOptions.create &&
1582
+ modelOptions.create.permissions &&
1583
+ !this.authService.expectPermissions(modelOptions.create.permissions)) {
1584
+ val.add = false;
1585
+ }
1586
+ if (val.edit &&
1587
+ modelOptions.update &&
1588
+ modelOptions.update.permissions &&
1589
+ !this.authService.expectPermissions(modelOptions.update.permissions)) {
1590
+ val.edit = false;
1591
+ }
1592
+ if (val.remove &&
1593
+ modelOptions.remove &&
1594
+ modelOptions.remove.permissions &&
1595
+ !this.authService.expectPermissions(modelOptions.remove.permissions)) {
1596
+ val.remove = false;
1597
+ }
1598
+ }
1599
+ }
1600
+ /** @nocollapse */ /** @nocollapse */ PageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: PageService, deps: [{ token: i3.AuthService }, { token: CrudFullConfig }], target: i0.ɵɵFactoryTarget.Injectable });
1601
+ /** @nocollapse */ /** @nocollapse */ PageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: PageService });
1602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: PageService, decorators: [{
1603
+ type: Injectable
1604
+ }], ctorParameters: function () { return [{ type: i3.AuthService }, { type: CrudFullConfig }]; } });
1605
+
1606
+ class CrudSearchService {
1607
+ constructor() {
1608
+ this._filterSource = new BehaviorSubject(null);
1609
+ this._enabledSource = new BehaviorSubject(false);
1610
+ this.enabled$ = this._enabledSource.asObservable();
1611
+ this.filter$ = combineLatest([
1612
+ this._filterSource.asObservable(), this.enabled$
1613
+ ]).pipe(map(([filter, enabled]) => {
1614
+ if (!enabled)
1615
+ return {};
1616
+ return filter;
1617
+ }));
1618
+ }
1619
+ get filter() {
1620
+ if (!this._enabledSource.value)
1621
+ return {};
1622
+ return this._filterSource.value;
1623
+ }
1624
+ get enabled() {
1625
+ return this._enabledSource.value;
1626
+ }
1627
+ setFilter(val) {
1628
+ this._filterSource.next(val);
1629
+ }
1630
+ setEnabled(val) {
1631
+ this._enabledSource.next(val);
1632
+ }
1633
+ }
1634
+ /** @nocollapse */ /** @nocollapse */ CrudSearchService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudSearchService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1635
+ /** @nocollapse */ /** @nocollapse */ CrudSearchService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudSearchService, providedIn: 'root' });
1636
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudSearchService, decorators: [{
1637
+ type: Injectable,
1638
+ args: [{
1639
+ providedIn: 'root'
1640
+ }]
1641
+ }] });
1642
+
1643
+ class CrudListPageBaseComponent extends BaseComponent$1 {
1644
+ constructor(config) {
1645
+ super();
1646
+ this.config = config;
1647
+ }
1648
+ }
1649
+ CrudListPageBaseComponent.smartType = "crud-list-page";
1650
+ /** @nocollapse */ /** @nocollapse */ CrudListPageBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudListPageBaseComponent, deps: [{ token: CrudFullConfig }], target: i0.ɵɵFactoryTarget.Directive });
1651
+ /** @nocollapse */ /** @nocollapse */ CrudListPageBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.7", type: CrudListPageBaseComponent, inputs: { listOptions: "listOptions" }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: ["contentTpl"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0 });
1652
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudListPageBaseComponent, decorators: [{
1653
+ type: Directive
1654
+ }], ctorParameters: function () { return [{ type: CrudFullConfig }]; }, propDecorators: { contentTpl: [{
1655
+ type: ViewChild,
1656
+ args: ["contentTpl", { read: ViewContainerRef, static: true }]
1657
+ }], listOptions: [{
1658
+ type: Input
1659
+ }] } });
1660
+
1661
+ class ListStandardComponent extends CrudListPageBaseComponent {
1662
+ constructor(facade, config) {
1663
+ super(config);
1664
+ this.facade = facade;
1665
+ this.config = config;
1666
+ this.isSearch$ = this.facade.filter$.pipe(map(filter => {
1667
+ return !!(filter === null || filter === void 0 ? void 0 : filter.searchText);
1668
+ }));
1669
+ }
1670
+ }
1671
+ /** @nocollapse */ /** @nocollapse */ ListStandardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListStandardComponent, deps: [{ token: CrudFacade }, { token: CrudFullConfig }], target: i0.ɵɵFactoryTarget.Component });
1672
+ /** @nocollapse */ /** @nocollapse */ ListStandardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: ListStandardComponent, selector: "smart-crud-list-standard-page", providers: [
1673
+ CrudListGroupService
1674
+ ], usesInheritance: true, ngImport: i0, template: "<smart-crud-filters-config></smart-crud-filters-config>\n<smart-list *ngIf=\"listOptions\"\n [hidden]=\"!(!config.list?.groups || (isSearch$ | async))\"\n [options]=\"listOptions\"\n></smart-list>\n<smart-crud-group *ngIf=\"config.list?.groups && !(isSearch$ | async)\"\n [groups]=\"config.list?.groups\"\n [listOptions]=\"listOptions\"\n>\n</smart-crud-group>", styles: [""], components: [{ type: FiltersConfigComponent, selector: "smart-crud-filters-config" }, { type: i3.ListComponent, selector: "smart-list", inputs: ["options"] }, { type: GroupComponent, selector: "smart-crud-group", inputs: ["groups", "listOptions"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3$1.AsyncPipe } });
1675
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListStandardComponent, decorators: [{
1676
+ type: Component,
1677
+ args: [{ selector: "smart-crud-list-standard-page", providers: [
1678
+ CrudListGroupService
1679
+ ], template: "<smart-crud-filters-config></smart-crud-filters-config>\n<smart-list *ngIf=\"listOptions\"\n [hidden]=\"!(!config.list?.groups || (isSearch$ | async))\"\n [options]=\"listOptions\"\n></smart-list>\n<smart-crud-group *ngIf=\"config.list?.groups && !(isSearch$ | async)\"\n [groups]=\"config.list?.groups\"\n [listOptions]=\"listOptions\"\n>\n</smart-crud-group>", styles: [""] }]
1680
+ }], ctorParameters: function () { return [{ type: CrudFacade }, { type: CrudFullConfig }]; } });
1681
+
1682
+ class ListComponent extends CreateDynamicComponent('crud-list-page') {
1683
+ constructor(facade, router, dynamicComponentLoader, injector, cd, menuService, hardwareService, paginationFacade, styleService, elementRef, pageService, config, searchService, moduleRef, componentFactoryResolver) {
1684
+ super(cd, moduleRef, componentFactoryResolver);
1685
+ this.facade = facade;
1686
+ this.router = router;
1687
+ this.dynamicComponentLoader = dynamicComponentLoader;
1688
+ this.injector = injector;
1689
+ this.cd = cd;
1690
+ this.menuService = menuService;
1691
+ this.hardwareService = hardwareService;
1692
+ this.paginationFacade = paginationFacade;
1693
+ this.styleService = styleService;
1694
+ this.elementRef = elementRef;
1695
+ this.pageService = pageService;
1696
+ this.config = config;
1697
+ this.searchService = searchService;
1698
+ this.moduleRef = moduleRef;
1699
+ this.componentFactoryResolver = componentFactoryResolver;
1700
+ this.filter$ = this.facade.filter$.pipe(tap((filter) => {
1701
+ this.filter = filter;
1702
+ }));
1703
+ this.dynamicContents = new QueryList();
1704
+ this.facade.links$.pipe(this.takeUntilDestroy).subscribe((links) => {
1705
+ this.links = links;
1706
+ });
1707
+ }
1708
+ refreshProperties() {
1709
+ this.baseInstance.listOptions = this.listOptions;
1710
+ }
1711
+ ngOnInit() {
1712
+ var _a, _b, _c, _d, _e, _f, _g;
1713
+ return __awaiter(this, void 0, void 0, function* () {
1714
+ yield this.pageService.checkPermissions();
1715
+ let newFilter = null;
1716
+ if (((_a = this.config.list) === null || _a === void 0 ? void 0 : _a.resetQuery) === 'beforeInit') {
1717
+ newFilter = Object.assign({ query: this.config.baseQuery ? [...this.config.baseQuery] : [], paginationMode: this.config.list.paginationMode, limit: this.config.pagination ? this.config.pagination.limit : null, offset: this.config.pagination ? 0 : null, sortBy: this.config.sort ? this.config.sort["default"] : null, sortDesc: this.config.sort ? this.config.sort["defaultDesc"] : null }, this.searchService.filter);
1718
+ }
1719
+ else if (this.filter) {
1720
+ newFilter = this.filter;
1721
+ }
1722
+ else {
1723
+ newFilter = Object.assign({ paginationMode: this.config.list.paginationMode, limit: ((_b = this.searchService.filter) === null || _b === void 0 ? void 0 : _b.limit) ? this.searchService.filter.limit : this.config.pagination
1724
+ ? this.config.pagination.limit : null, offset: ((_c = this.searchService.filter) === null || _c === void 0 ? void 0 : _c.offset) || ((_d = this.searchService.filter) === null || _d === void 0 ? void 0 : _d.offset) === 0
1725
+ ? this.searchService.filter.offset : this.config.pagination ? 0 : null, sortBy: ((_e = this.searchService.filter) === null || _e === void 0 ? void 0 : _e.sortBy) ? this.searchService.filter.sortBy : this.config.sort
1726
+ ? this.config.sort["default"] : null, sortDesc: ((_f = this.searchService.filter) === null || _f === void 0 ? void 0 : _f.sortDesc) ? this.searchService.filter.sortDesc : this.config.sort
1727
+ ? this.config.sort["defaultDesc"] : null, query: this.config.baseQuery ? [...this.config.baseQuery] : [] }, this.searchService.filter);
1728
+ }
1729
+ this.facade.read(newFilter);
1730
+ const endButtons = this.getEndButtons();
1731
+ this.pageOptions = {
1732
+ title: this.config.title,
1733
+ search: this.config.search
1734
+ ? {
1735
+ text$: this.filter$.pipe(map((f) => (f ? f.searchText : null))),
1736
+ set: (txt) => {
1737
+ if (txt !== this.filter.searchText)
1738
+ this.facade.read(Object.assign(Object.assign({}, this.filter), { searchText: txt, offset: 0 }));
1739
+ },
1740
+ }
1741
+ : null,
1742
+ endButtons: endButtons,
1743
+ };
1744
+ const compiledComponents = yield this.dynamicComponentLoader.getComponentsWithFactories({
1745
+ components: [
1746
+ ...(this.config.details &&
1747
+ this.config.details["components"] &&
1748
+ this.config.details["components"].top
1749
+ ? [this.config.details["components"].top]
1750
+ : []),
1751
+ ...(this.config.details &&
1752
+ this.config.details["components"] &&
1753
+ this.config.details["components"].bottom
1754
+ ? [this.config.details["components"].bottom]
1755
+ : []),
1756
+ ...(this.config.list &&
1757
+ this.config.list["components"] &&
1758
+ this.config.list["components"].top
1759
+ ? [this.config.list["components"].top]
1760
+ : []),
1761
+ ],
1762
+ });
1763
+ this.listOptions = {
1764
+ provider: {
1765
+ getData: (filter) => {
1766
+ const global = Object.assign(Object.assign({}, this.filter), filter);
1767
+ this.facade.read(global);
1768
+ },
1769
+ onChangeMultiSelected: (list) => __awaiter(this, void 0, void 0, function* () {
1770
+ if (list.length && !this.menuService.openedEnd) {
1771
+ yield this.menuService.openEnd({
1772
+ injector: this.injector,
1773
+ component: MultiselectComponent,
1774
+ });
1775
+ }
1776
+ else if (!list.length && this.menuService.openedEnd) {
1777
+ yield this.menuService.closeEnd();
1778
+ }
1779
+ this.facade.multiSelect(list);
1780
+ }),
1781
+ list$: this.facade.list$,
1782
+ loading$: this.facade.loaded$.pipe(map((l) => !l)),
1783
+ },
1784
+ cellPipe: this.config.list ? this.config.list.cellPipe : null,
1785
+ mode: (_g = this.config.list) === null || _g === void 0 ? void 0 : _g.mode,
1786
+ type: this.config.type,
1787
+ details: this.config.details
1788
+ ? {
1789
+ provider: {
1790
+ getData: (id) => {
1791
+ this.facade.select(id);
1792
+ },
1793
+ clearData: () => {
1794
+ this.facade.unselect();
1795
+ },
1796
+ item$: this.facade.selected$,
1797
+ loading$: this.facade.loaded$.pipe(map((l) => !l)),
1798
+ },
1799
+ componentFactories: {
1800
+ top: this.config.details &&
1801
+ this.config.details["components"] &&
1802
+ this.config.details["components"].top
1803
+ ? compiledComponents.find((cc) => cc.component === this.config.details["components"].top).factory
1804
+ : null,
1805
+ bottom: this.config.details &&
1806
+ this.config.details["components"] &&
1807
+ this.config.details["components"].bottom
1808
+ ? compiledComponents.find((cc) => cc.component ===
1809
+ this.config.details["components"].bottom).factory
1810
+ : null,
1811
+ },
1812
+ }
1813
+ : null,
1814
+ item: !!this.config.edit || this.config.details
1815
+ ? {
1816
+ options: {
1817
+ routingPrefix: "/" + this.router.routerState.snapshot.url + "/",
1818
+ edit: !!this.config.edit,
1819
+ },
1820
+ }
1821
+ : null,
1822
+ remove: this.config.remove
1823
+ ? {
1824
+ provider: {
1825
+ invoke: (id) => this.facade.delete(id),
1826
+ },
1827
+ }
1828
+ : null,
1829
+ pagination: yield this.paginationFacade.create({
1830
+ mode: this.config.list.paginationMode,
1831
+ limit: this.config.pagination.limit,
1832
+ provider: {
1833
+ getFilter: () => {
1834
+ return this.filter;
1835
+ },
1836
+ getLinks: () => this.links,
1837
+ },
1838
+ }),
1839
+ sort: this.config.sort,
1840
+ };
1841
+ this.cd.detectChanges();
1842
+ this.initCloseMenu();
1843
+ this.initTopComponent(compiledComponents);
1844
+ this.refreshDynamicInstance();
1845
+ });
1846
+ }
1847
+ initCloseMenu() {
1848
+ this.router.events.pipe(this.takeUntilDestroy).subscribe(() => __awaiter(this, void 0, void 0, function* () {
1849
+ yield this.clear();
1850
+ }));
1851
+ }
1852
+ clear() {
1853
+ return __awaiter(this, void 0, void 0, function* () {
1854
+ yield this.menuService.closeEnd();
1855
+ this.listOptions = Object.assign(Object.assign({}, this.listOptions), { select: null });
1856
+ this.facade.multiSelect([]);
1857
+ });
1858
+ }
1859
+ getEndButtons() {
1860
+ var _a, _b, _c, _d, _e;
1861
+ const fieldsWithOptions = getModelFieldsWithOptions(new this.config.type());
1862
+ const modelOptions = getModelOptions(this.config.type);
1863
+ const showFilters = fieldsWithOptions.some((x) => { var _a, _b; return (_b = (_a = x.options) === null || _a === void 0 ? void 0 : _a.list) === null || _b === void 0 ? void 0 : _b.filter; }) || ((_a = modelOptions === null || modelOptions === void 0 ? void 0 : modelOptions.filters) === null || _a === void 0 ? void 0 : _a.length);
1864
+ const showMultiEdit = this.config.edit &&
1865
+ fieldsWithOptions.some((x) => { var _a, _b; return (_b = (_a = x.options) === null || _a === void 0 ? void 0 : _a.update) === null || _b === void 0 ? void 0 : _b.multi; }) &&
1866
+ !this.hardwareService.isMobile &&
1867
+ (!((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.list) === null || _c === void 0 ? void 0 : _c.mode) ||
1868
+ ((_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.list) === null || _e === void 0 ? void 0 : _e.mode) === ListMode.desktop);
1869
+ return [
1870
+ ...(showMultiEdit
1871
+ ? [
1872
+ {
1873
+ icon: "checkbox-outline",
1874
+ text: "multi",
1875
+ handler: () => __awaiter(this, void 0, void 0, function* () {
1876
+ this.listOptions = Object.assign(Object.assign({}, this.listOptions), { select: this.listOptions.select === "multi" ? null : "multi" });
1877
+ this.facade.multiSelect([]);
1878
+ if (this.menuService.openedEnd)
1879
+ yield this.menuService.closeEnd();
1880
+ this.cd.detectChanges();
1881
+ }),
1882
+ },
1883
+ ]
1884
+ : []),
1885
+ ...(showFilters
1886
+ ? [
1887
+ {
1888
+ icon: "filter-outline",
1889
+ text: "filters",
1890
+ handler: () => __awaiter(this, void 0, void 0, function* () {
1891
+ yield this.menuService.openEnd({
1892
+ injector: this.injector,
1893
+ component: FiltersComponent,
1894
+ });
1895
+ }),
1896
+ },
1897
+ ]
1898
+ : []),
1899
+ ...(this.config.add
1900
+ ? [
1901
+ {
1902
+ icon: "add",
1903
+ text: "add",
1904
+ handler: () => {
1905
+ this.router.navigate([
1906
+ "/" + this.router.routerState.snapshot.url + "/add",
1907
+ ]);
1908
+ },
1909
+ },
1910
+ ]
1911
+ : []),
1912
+ ...(this.config.export
1913
+ ? [
1914
+ {
1915
+ text: "export",
1916
+ icon: "download-outline",
1917
+ type: "popover",
1918
+ component: ExportComponent,
1919
+ },
1920
+ ]
1921
+ : []),
1922
+ ...(this.config.buttons ? this.config.buttons : []),
1923
+ ];
1924
+ }
1925
+ initTopComponent(compiledComponents) {
1926
+ const factory = this.config.list &&
1927
+ this.config.list["components"] &&
1928
+ this.config.list["components"].top
1929
+ ? compiledComponents.find((cc) => cc.component === this.config.list["components"].top).factory
1930
+ : null;
1931
+ setTimeout(() => {
1932
+ if (factory && !this.topTpl.get(0)) {
1933
+ this.topTpl.createComponent(factory);
1934
+ }
1935
+ });
1936
+ }
1937
+ }
1938
+ /** @nocollapse */ /** @nocollapse */ ListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListComponent, deps: [{ token: CrudFacade }, { token: i1$2.Router }, { token: i3.DynamicComponentLoader }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }, { token: i3.MenuService }, { token: i3.HardwareService }, { token: CrudListPaginationFactory }, { token: i3.StyleService }, { token: i0.ElementRef }, { token: PageService }, { token: CrudFullConfig }, { token: CrudSearchService }, { token: i0.NgModuleRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component });
1939
+ /** @nocollapse */ /** @nocollapse */ ListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: ListComponent, selector: "smart-crud-list-page", viewQueries: [{ propertyName: "topTpl", first: true, predicate: ["topTpl"], descendants: true, read: ViewContainerRef }, { propertyName: "contentTpl", first: true, predicate: ["contentTpl"], descendants: true, read: TemplateRef }, { propertyName: "dynamicContents", predicate: DynamicContentDirective, descendants: true, read: DynamicContentDirective }], usesInheritance: true, ngImport: i0, template: `
1940
+ <smart-page [options]="pageOptions" *ngIf="filter$ | async">
1941
+ <div #topTpl></div>
1942
+ <smart-crud-list-standard-page *ngIf="template === 'default'" [listOptions]="listOptions">
1943
+ <ng-container [ngTemplateOutlet]="contentTpl"></ng-container>
1944
+ </smart-crud-list-standard-page>
1945
+ <ng-template #contentTpl>
1946
+ <ng-content></ng-content>
1947
+ </ng-template>
1948
+ <div class="dynamic-content"></div>
1949
+ </smart-page>
1950
+ `, isInline: true, components: [{ type: i3.PageComponent, selector: "smart-page", inputs: ["options"] }, { type: ListStandardComponent, selector: "smart-crud-list-standard-page" }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.DynamicContentDirective, selector: ".dynamic-content" }], pipes: { "async": i3$1.AsyncPipe } });
1951
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ListComponent, decorators: [{
1952
+ type: Component,
1953
+ args: [{
1954
+ selector: "smart-crud-list-page",
1955
+ template: `
1956
+ <smart-page [options]="pageOptions" *ngIf="filter$ | async">
1957
+ <div #topTpl></div>
1958
+ <smart-crud-list-standard-page *ngIf="template === 'default'" [listOptions]="listOptions">
1959
+ <ng-container [ngTemplateOutlet]="contentTpl"></ng-container>
1960
+ </smart-crud-list-standard-page>
1961
+ <ng-template #contentTpl>
1962
+ <ng-content></ng-content>
1963
+ </ng-template>
1964
+ <div class="dynamic-content"></div>
1965
+ </smart-page>
1966
+ `
1967
+ }]
1968
+ }], ctorParameters: function () { return [{ type: CrudFacade }, { type: i1$2.Router }, { type: i3.DynamicComponentLoader }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: i3.MenuService }, { type: i3.HardwareService }, { type: CrudListPaginationFactory }, { type: i3.StyleService }, { type: i0.ElementRef }, { type: PageService }, { type: CrudFullConfig }, { type: CrudSearchService }, { type: i0.NgModuleRef }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { topTpl: [{
1969
+ type: ViewChild,
1970
+ args: ["topTpl", { read: ViewContainerRef, static: false }]
1971
+ }], contentTpl: [{
1972
+ type: ViewChild,
1973
+ args: ["contentTpl", { read: TemplateRef, static: false }]
1974
+ }], dynamicContents: [{
1975
+ type: ViewChildren,
1976
+ args: [DynamicContentDirective, { read: DynamicContentDirective }]
1977
+ }] } });
1978
+
1979
+ class CrudItemPageBaseComponent extends BaseComponent$1 {
1980
+ constructor(config, facade) {
1981
+ super();
1982
+ this.config = config;
1983
+ this.facade = facade;
1984
+ this.formComponents = new QueryList();
1985
+ this.onPartialChange = new EventEmitter();
1986
+ this.onChange = new EventEmitter();
1987
+ this.onValidChange = new EventEmitter();
1988
+ this.selected$ = facade.selected$;
1989
+ }
1990
+ }
1991
+ CrudItemPageBaseComponent.smartType = "crud-item-page";
1992
+ /** @nocollapse */ /** @nocollapse */ CrudItemPageBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudItemPageBaseComponent, deps: [{ token: CrudFullConfig }, { token: CrudFacade }], target: i0.ɵɵFactoryTarget.Directive });
1993
+ /** @nocollapse */ /** @nocollapse */ CrudItemPageBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.7", type: CrudItemPageBaseComponent, inputs: { detailsOptions: "detailsOptions", mode: "mode", uniqueProvider: "uniqueProvider" }, outputs: { onPartialChange: "onPartialChange", onChange: "onChange", onValidChange: "onValidChange" }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: ["contentTpl"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "formComponents", predicate: FormComponent, descendants: true, read: FormComponent }], usesInheritance: true, ngImport: i0 });
1994
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudItemPageBaseComponent, decorators: [{
1995
+ type: Directive
1996
+ }], ctorParameters: function () { return [{ type: CrudFullConfig }, { type: CrudFacade }]; }, propDecorators: { contentTpl: [{
1997
+ type: ViewChild,
1998
+ args: ["contentTpl", { read: ViewContainerRef, static: true }]
1999
+ }], formComponents: [{
2000
+ type: ViewChildren,
2001
+ args: [FormComponent, { read: FormComponent }]
2002
+ }], detailsOptions: [{
2003
+ type: Input
2004
+ }], mode: [{
2005
+ type: Input
2006
+ }], uniqueProvider: [{
2007
+ type: Input
2008
+ }], onPartialChange: [{
2009
+ type: Output
2010
+ }], onChange: [{
2011
+ type: Output
2012
+ }], onValidChange: [{
2013
+ type: Output
2014
+ }] } });
2015
+
2016
+ class ItemStandardComponent extends CrudItemPageBaseComponent {
2017
+ }
2018
+ /** @nocollapse */ /** @nocollapse */ ItemStandardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ItemStandardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2019
+ /** @nocollapse */ /** @nocollapse */ ItemStandardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: ItemStandardComponent, selector: "smart-crud-item-standard-page", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"mode === 'details'; else editTpl\">\n <smart-details *ngIf=\"detailsOptions\" [options]='detailsOptions'></smart-details>\n</ng-container>\n\n<ng-template #editTpl>\n <smart-form\n [options]=\"\n (selected$ | async)\n | smartFormOptions : mode:config?.type:uniqueProvider : config.inputComponents\n \"\n (valuePartialChange)=\"onPartialChange.emit($event)\"\n (valueChange)=\"onChange.emit($event)\"\n (validChange)=\"onValidChange.emit($event)\"\n ></smart-form>\n</ng-template>\n\n<br/><br/>", styles: [""], components: [{ type: i3.DetailsComponent, selector: "smart-details", inputs: ["options"] }, { type: i3.FormComponent, selector: "smart-form", inputs: ["options"], outputs: ["invokeSubmit", "valueChange", "valuePartialChange", "validChange"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "smartFormOptions": FormOptionsPipe, "async": i3$1.AsyncPipe } });
2020
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ItemStandardComponent, decorators: [{
2021
+ type: Component,
2022
+ args: [{ selector: "smart-crud-item-standard-page", template: "<ng-container *ngIf=\"mode === 'details'; else editTpl\">\n <smart-details *ngIf=\"detailsOptions\" [options]='detailsOptions'></smart-details>\n</ng-container>\n\n<ng-template #editTpl>\n <smart-form\n [options]=\"\n (selected$ | async)\n | smartFormOptions : mode:config?.type:uniqueProvider : config.inputComponents\n \"\n (valuePartialChange)=\"onPartialChange.emit($event)\"\n (valueChange)=\"onChange.emit($event)\"\n (validChange)=\"onValidChange.emit($event)\"\n ></smart-form>\n</ng-template>\n\n<br/><br/>", styles: [""] }]
2023
+ }] });
2024
+
2025
+ class ItemComponent extends CreateDynamicComponent('crud-item-page') {
2026
+ constructor(router, activeRoute, facade, service, route, dynamicComponentLoader, translateService, config, location, cd, authService, styleService, elementRef, toastService, pageService, moduleRef, componentFactoryResolver, detailsService) {
2027
+ super(cd, moduleRef, componentFactoryResolver);
2028
+ this.router = router;
2029
+ this.activeRoute = activeRoute;
2030
+ this.facade = facade;
2031
+ this.service = service;
2032
+ this.route = route;
2033
+ this.dynamicComponentLoader = dynamicComponentLoader;
2034
+ this.translateService = translateService;
2035
+ this.config = config;
2036
+ this.location = location;
2037
+ this.cd = cd;
2038
+ this.styleService = styleService;
2039
+ this.elementRef = elementRef;
2040
+ this.toastService = toastService;
2041
+ this.pageService = pageService;
2042
+ this.moduleRef = moduleRef;
2043
+ this.componentFactoryResolver = componentFactoryResolver;
2044
+ this.detailsService = detailsService;
2045
+ this.pageOptions = {
2046
+ title: "",
2047
+ showBackButton: true,
2048
+ hideMenuButton: true,
2049
+ };
2050
+ this.formValid = false;
2051
+ this.standardComponents = new QueryList();
2052
+ this.dynamicContents = new QueryList();
2053
+ this.selected$ = this.facade.selected$;
2054
+ }
2055
+ set mode(val) {
2056
+ this._mode = val;
2057
+ this.refreshDynamicInstance();
2058
+ }
2059
+ get mode() {
2060
+ return this._mode;
2061
+ }
2062
+ refreshProperties() {
2063
+ this.baseInstance.detailsOptions = this.detailsOptions;
2064
+ this.baseInstance.mode = this.mode;
2065
+ this.baseInstance.uniqueProvider = this.uniqueProvider;
2066
+ this.baseInstance.onPartialChange.pipe(this.takeUntilDestroy).subscribe(val => this.onPartialChange(val));
2067
+ this.baseInstance.onChange.pipe(this.takeUntilDestroy).subscribe(val => this.onChange(val));
2068
+ this.baseInstance.onValidChange.pipe(this.takeUntilDestroy).subscribe(val => this.onValidChange(val));
2069
+ }
2070
+ ngOnInit() {
2071
+ return __awaiter(this, void 0, void 0, function* () {
2072
+ this.detailsService.init();
2073
+ this.styleService.init(this.elementRef);
2074
+ this.pageService.checkPermissions();
2075
+ if (this.router.routerState.snapshot.url.endsWith("/add")) {
2076
+ this.mode = "create";
2077
+ yield this.generateComponents('add');
2078
+ }
2079
+ else {
2080
+ this.mode = this.config.details ? "details" : "update";
2081
+ if (this.mode === 'update') {
2082
+ yield this.generateComponents('edit');
2083
+ }
2084
+ this.activeRoute.params
2085
+ .pipe(this.takeUntilDestroy)
2086
+ .subscribe(({ id }) => {
2087
+ this.facade.select(id);
2088
+ this.id = id;
2089
+ });
2090
+ this.activeRoute.queryParams
2091
+ .pipe(this.takeUntilDestroy)
2092
+ .subscribe(({ edit }) => {
2093
+ if (edit) {
2094
+ this.mode = "update";
2095
+ this.generateComponents('edit');
2096
+ }
2097
+ });
2098
+ }
2099
+ this.uniqueProvider = (values) => __awaiter(this, void 0, void 0, function* () {
2100
+ const filter = {
2101
+ query: [],
2102
+ };
2103
+ Object.keys(values).forEach((key) => {
2104
+ filter.query.push({
2105
+ key: key,
2106
+ value: values[key],
2107
+ type: "=",
2108
+ });
2109
+ });
2110
+ if (this.id) {
2111
+ filter.query.push({
2112
+ key: "id",
2113
+ value: this.id,
2114
+ type: "!=",
2115
+ });
2116
+ }
2117
+ const { totalCount } = yield this.service.getList(filter).toPromise();
2118
+ return !totalCount;
2119
+ });
2120
+ if (this.config.details) {
2121
+ const compiledComponents = yield this.dynamicComponentLoader.getComponentsWithFactories({
2122
+ components: [
2123
+ ...(this.config.details &&
2124
+ this.config.details["components"] &&
2125
+ this.config.details["components"].top
2126
+ ? [this.config.details["components"].top]
2127
+ : []),
2128
+ ...(this.config.details &&
2129
+ this.config.details["components"] &&
2130
+ this.config.details["components"].bottom
2131
+ ? [this.config.details["components"].bottom]
2132
+ : []),
2133
+ ],
2134
+ });
2135
+ this.detailsOptions = {
2136
+ type: this.config.type,
2137
+ item$: this.facade.selected$,
2138
+ cellPipe: this.config.details ? this.config.details.cellPipe : null,
2139
+ componentFactories: {
2140
+ top: this.config.details &&
2141
+ this.config.details["components"] &&
2142
+ this.config.details["components"].top
2143
+ ? compiledComponents.find((cc) => cc.component === this.config.details["components"].top).factory
2144
+ : null,
2145
+ bottom: this.config.details &&
2146
+ this.config.details["components"] &&
2147
+ this.config.details["components"].bottom
2148
+ ? compiledComponents.find((cc) => cc.component === this.config.details["components"].bottom).factory
2149
+ : null,
2150
+ },
2151
+ };
2152
+ }
2153
+ this.initPageOptions();
2154
+ this.facade.selected$.pipe(this.takeUntilDestroy).subscribe(item => {
2155
+ this.item = item;
2156
+ this.initPageOptions();
2157
+ this.cd.detectChanges();
2158
+ });
2159
+ this.refreshDynamicInstance();
2160
+ });
2161
+ }
2162
+ generateComponents(mode) {
2163
+ var _a, _b;
2164
+ return __awaiter(this, void 0, void 0, function* () {
2165
+ const compiledComponents = yield this.dynamicComponentLoader.getComponentsWithFactories({
2166
+ components: [
2167
+ ...(this.config[mode] &&
2168
+ this.config[mode]["components"] &&
2169
+ this.config[mode]["components"].top
2170
+ ? [this.config[mode]["components"].top]
2171
+ : []),
2172
+ ...(this.config[mode] &&
2173
+ this.config[mode]["components"] &&
2174
+ this.config[mode]["components"].bottom
2175
+ ? [this.config[mode]["components"].bottom]
2176
+ : []),
2177
+ ],
2178
+ });
2179
+ const topComponentFactory = (_a = compiledComponents.find((cc) => { var _a; return cc.component === ((_a = this.config[mode]["components"]) === null || _a === void 0 ? void 0 : _a.top); })) === null || _a === void 0 ? void 0 : _a.factory;
2180
+ const bottomComponentFactory = (_b = compiledComponents.find((cc) => { var _a; return cc.component === ((_a = this.config[mode]["components"]) === null || _a === void 0 ? void 0 : _a.bottom); })) === null || _b === void 0 ? void 0 : _b.factory;
2181
+ if (!this.topTpl.get(0) && topComponentFactory) {
2182
+ this.topTpl.createComponent(topComponentFactory);
2183
+ }
2184
+ if (!this.bottomTpl.get(0) && bottomComponentFactory) {
2185
+ this.bottomTpl.createComponent(bottomComponentFactory);
2186
+ }
2187
+ });
2188
+ }
2189
+ onPartialChange(val) {
2190
+ this.formPartialValue = val;
2191
+ }
2192
+ onChange(val) {
2193
+ this.formValue = val;
2194
+ }
2195
+ onValidChange(val) {
2196
+ this.formValid = val;
2197
+ }
2198
+ initPageOptions() {
2199
+ this.pageOptions = Object.assign(Object.assign({}, this.pageOptions), { title: this.getTitle(), endButtons: this.getButtons() });
2200
+ }
2201
+ getButtons() {
2202
+ switch (this.mode) {
2203
+ case "create":
2204
+ return [
2205
+ {
2206
+ icon: "add",
2207
+ text: "add",
2208
+ handler: () => {
2209
+ if (this.checkFirstInvalid()) {
2210
+ return;
2211
+ }
2212
+ this.facade.create(this.formValue);
2213
+ this.location.back();
2214
+ },
2215
+ },
2216
+ ];
2217
+ case "update":
2218
+ return [
2219
+ ...(this.config.details
2220
+ ? [
2221
+ {
2222
+ icon: "close",
2223
+ text: "cancel",
2224
+ handler: () => {
2225
+ this.mode = "details";
2226
+ this.initPageOptions();
2227
+ this.topTpl.clear();
2228
+ this.bottomTpl.clear();
2229
+ },
2230
+ disabled$: new BehaviorSubject(false),
2231
+ },
2232
+ ]
2233
+ : []),
2234
+ {
2235
+ icon: "save",
2236
+ text: "save",
2237
+ handler: () => {
2238
+ if (this.checkFirstInvalid()) {
2239
+ return;
2240
+ }
2241
+ this.formPartialValue.id = this.id;
2242
+ this.facade.updatePartial(this.formPartialValue);
2243
+ if (this.config.details) {
2244
+ this.mode = "details";
2245
+ this.initPageOptions();
2246
+ }
2247
+ else {
2248
+ this.location.back();
2249
+ }
2250
+ },
2251
+ },
2252
+ ];
2253
+ case "details":
2254
+ return this.config.edit
2255
+ ? [
2256
+ {
2257
+ icon: "create",
2258
+ text: "edit",
2259
+ handler: () => {
2260
+ this.mode = "update";
2261
+ this.generateComponents('edit');
2262
+ this.initPageOptions();
2263
+ },
2264
+ disabled$: new BehaviorSubject(false),
2265
+ },
2266
+ ]
2267
+ : [];
2268
+ }
2269
+ }
2270
+ getTitle() {
2271
+ const options = getModelOptions(this.config.type);
2272
+ const prefix = options.titleKey && this.item ? this.removeParagraph(this.item[options.titleKey]) + ' - ' : '';
2273
+ switch (this.mode) {
2274
+ case "create":
2275
+ return "add";
2276
+ case "update":
2277
+ return prefix + this.translateService.instant("change");
2278
+ case "details":
2279
+ return prefix + this.translateService.instant("details");
2280
+ }
2281
+ }
2282
+ removeParagraph(val) {
2283
+ if (!val || val.indexOf('<p>') !== 0)
2284
+ return val;
2285
+ const div = document.createElement("div");
2286
+ div.innerHTML = val;
2287
+ const item = div.querySelectorAll("p").item(0);
2288
+ return item.innerHTML;
2289
+ }
2290
+ checkFirstInvalid() {
2291
+ this.cd.detectChanges();
2292
+ const form = this.template === 'default'
2293
+ ? this.standardComponents.first.formComponents.first.form
2294
+ : this.baseInstance.formComponents.first.form;
2295
+ this.cd.detectChanges();
2296
+ if (form.valid)
2297
+ return false;
2298
+ const invalidFields = [];
2299
+ this.getInvalidFields(form, invalidFields, '');
2300
+ this.toastService.info({
2301
+ title: this.translateService.instant('INPUT.ERRORS.requires'),
2302
+ message: invalidFields.slice(0, 3).join('<br/>')
2303
+ });
2304
+ return true;
2305
+ }
2306
+ getInvalidFields(control, invalidFields, baseField, key = null) {
2307
+ var _a;
2308
+ if (control.valid)
2309
+ return;
2310
+ const field = key ? baseField + ' > ' + this.translateService.instant('MODEL.' + key) : baseField;
2311
+ if ((_a = control.errors) === null || _a === void 0 ? void 0 : _a.customMessage) {
2312
+ invalidFields.push(field + ` (${control.errors.customMessage})`);
2313
+ return;
2314
+ }
2315
+ if (control instanceof FormControl) {
2316
+ invalidFields.push(field);
2317
+ }
2318
+ if (control instanceof FormGroup) {
2319
+ Object.keys(control.controls).forEach(groupKey => {
2320
+ this.getInvalidFields(control.controls[groupKey], invalidFields, field, groupKey);
2321
+ });
2322
+ }
2323
+ if (control instanceof FormArray) {
2324
+ control.controls.forEach((c, index) => {
2325
+ this.getInvalidFields(c, invalidFields, field + `(${index + 1})`);
2326
+ });
2327
+ }
2328
+ }
2329
+ }
2330
+ /** @nocollapse */ /** @nocollapse */ ItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ItemComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: CrudFacade }, { token: CrudService }, { token: i1$2.ActivatedRoute }, { token: i3.DynamicComponentLoader }, { token: i4.TranslateService }, { token: CrudFullConfig }, { token: i3$1.Location }, { token: i0.ChangeDetectorRef }, { token: i3.AuthService }, { token: i3.StyleService }, { token: i0.ElementRef }, { token: i3.ToastService }, { token: PageService }, { token: i0.NgModuleRef }, { token: i0.ComponentFactoryResolver }, { token: i3.DetailsService }], target: i0.ɵɵFactoryTarget.Component });
2331
+ /** @nocollapse */ /** @nocollapse */ ItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: ItemComponent, selector: "smart-crud-item-page", viewQueries: [{ propertyName: "content", first: true, predicate: IonContent, descendants: true, static: true }, { propertyName: "contentTpl", first: true, predicate: ["contentTpl"], descendants: true, read: TemplateRef }, { propertyName: "topTpl", first: true, predicate: ["topTpl"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "bottomTpl", first: true, predicate: ["bottomTpl"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "standardComponents", predicate: ItemStandardComponent, descendants: true, read: ItemStandardComponent }, { propertyName: "dynamicContents", predicate: DynamicContentDirective, descendants: true, read: DynamicContentDirective }], usesInheritance: true, ngImport: i0, template: `
2332
+ <smart-page [options]="pageOptions">
2333
+ <div #topTpl class="top-content"></div>
2334
+ <smart-crud-item-standard-page *ngIf="template === 'default'"
2335
+ [detailsOptions]="detailsOptions"
2336
+ [mode]="mode"
2337
+ [uniqueProvider]="uniqueProvider"
2338
+ (onPartialChange)="onPartialChange($event)"
2339
+ (onChange)="onChange($event)"
2340
+ (onValidChange)="onValidChange($event)"
2341
+ >
2342
+ <ng-container [ngTemplateOutlet]="contentTpl"></ng-container>
2343
+ </smart-crud-item-standard-page>
2344
+ <ng-template #contentTpl>
2345
+ <ng-content></ng-content>
2346
+ </ng-template>
2347
+ <div class="dynamic-content"></div>
2348
+ <div #bottomTpl class="bottom-content"></div>
2349
+ </smart-page>
2350
+ `, isInline: true, components: [{ type: i3.PageComponent, selector: "smart-page", inputs: ["options"] }, { type: ItemStandardComponent, selector: "smart-crud-item-standard-page" }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.DynamicContentDirective, selector: ".dynamic-content" }] });
2351
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ItemComponent, decorators: [{
2352
+ type: Component,
2353
+ args: [{
2354
+ selector: "smart-crud-item-page",
2355
+ template: `
2356
+ <smart-page [options]="pageOptions">
2357
+ <div #topTpl class="top-content"></div>
2358
+ <smart-crud-item-standard-page *ngIf="template === 'default'"
2359
+ [detailsOptions]="detailsOptions"
2360
+ [mode]="mode"
2361
+ [uniqueProvider]="uniqueProvider"
2362
+ (onPartialChange)="onPartialChange($event)"
2363
+ (onChange)="onChange($event)"
2364
+ (onValidChange)="onValidChange($event)"
2365
+ >
2366
+ <ng-container [ngTemplateOutlet]="contentTpl"></ng-container>
2367
+ </smart-crud-item-standard-page>
2368
+ <ng-template #contentTpl>
2369
+ <ng-content></ng-content>
2370
+ </ng-template>
2371
+ <div class="dynamic-content"></div>
2372
+ <div #bottomTpl class="bottom-content"></div>
2373
+ </smart-page>
2374
+ `
2375
+ }]
2376
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: CrudFacade }, { type: CrudService }, { type: i1$2.ActivatedRoute }, { type: i3.DynamicComponentLoader }, { type: i4.TranslateService }, { type: CrudFullConfig }, { type: i3$1.Location }, { type: i0.ChangeDetectorRef }, { type: i3.AuthService }, { type: i3.StyleService }, { type: i0.ElementRef }, { type: i3.ToastService }, { type: PageService }, { type: i0.NgModuleRef }, { type: i0.ComponentFactoryResolver }, { type: i3.DetailsService }]; }, propDecorators: { standardComponents: [{
2377
+ type: ViewChildren,
2378
+ args: [ItemStandardComponent, { read: ItemStandardComponent }]
2379
+ }], content: [{
2380
+ type: ViewChild,
2381
+ args: [IonContent, { static: true }]
2382
+ }], contentTpl: [{
2383
+ type: ViewChild,
2384
+ args: ["contentTpl", { read: TemplateRef, static: false }]
2385
+ }], topTpl: [{
2386
+ type: ViewChild,
2387
+ args: ["topTpl", { read: ViewContainerRef, static: true }]
2388
+ }], bottomTpl: [{
2389
+ type: ViewChild,
2390
+ args: ["bottomTpl", { read: ViewContainerRef, static: true }]
2391
+ }], dynamicContents: [{
2392
+ type: ViewChildren,
2393
+ args: [DynamicContentDirective, { read: DynamicContentDirective }]
2394
+ }] } });
2395
+
2396
+ const PAGES = [
2397
+ ItemComponent,
2398
+ ListComponent,
2399
+ ListStandardComponent,
2400
+ ItemStandardComponent
2401
+ ];
2402
+ class CrudFullModule {
2403
+ constructor(store, config, effects) {
2404
+ NgrxStoreService.addReducer(config.entity, config.reducerFactory
2405
+ ? config.reducerFactory()
2406
+ : getReducer(config.entity));
2407
+ effects.init();
2408
+ }
2409
+ }
2410
+ /** @nocollapse */ /** @nocollapse */ CrudFullModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudFullModule, deps: [{ token: i1.Store }, { token: CrudConfig }, { token: CrudEffects }], target: i0.ɵɵFactoryTarget.NgModule });
2411
+ /** @nocollapse */ /** @nocollapse */ CrudFullModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudFullModule, declarations: [ItemComponent,
2412
+ ListComponent,
2413
+ ListStandardComponent,
2414
+ ItemStandardComponent], imports: [StoreModule,
2415
+ SharedModule,
2416
+ CrudPipesModule, i1$2.RouterModule, FormsModule,
2417
+ CommonModule,
2418
+ CrudComponentsModule], exports: [ItemComponent,
2419
+ ListComponent,
2420
+ ListStandardComponent,
2421
+ ItemStandardComponent, CrudComponentsModule] });
2422
+ /** @nocollapse */ /** @nocollapse */ CrudFullModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudFullModule, providers: [
2423
+ CrudService,
2424
+ CrudListGroupService,
2425
+ PageService,
2426
+ CrudEffects,
2427
+ CrudFacade,
2428
+ CrudListPaginationFactory,
2429
+ ], imports: [[
2430
+ StoreModule,
2431
+ SharedModule,
2432
+ CrudPipesModule,
2433
+ RouterModule.forChild([
2434
+ { path: '', component: ListComponent },
2435
+ { path: 'add', component: ItemComponent },
2436
+ { path: ':id', component: ItemComponent }
2437
+ ]),
2438
+ FormsModule,
2439
+ CommonModule,
2440
+ CrudComponentsModule
2441
+ ], CrudComponentsModule] });
2442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudFullModule, decorators: [{
2443
+ type: NgModule,
2444
+ args: [{
2445
+ declarations: [
2446
+ ...PAGES
2447
+ ],
2448
+ imports: [
2449
+ StoreModule,
2450
+ SharedModule,
2451
+ CrudPipesModule,
2452
+ RouterModule.forChild([
2453
+ { path: '', component: ListComponent },
2454
+ { path: 'add', component: ItemComponent },
2455
+ { path: ':id', component: ItemComponent }
2456
+ ]),
2457
+ FormsModule,
2458
+ CommonModule,
2459
+ CrudComponentsModule
2460
+ ],
2461
+ exports: [
2462
+ ...PAGES,
2463
+ CrudComponentsModule
2464
+ ],
2465
+ providers: [
2466
+ CrudService,
2467
+ CrudListGroupService,
2468
+ PageService,
2469
+ CrudEffects,
2470
+ CrudFacade,
2471
+ CrudListPaginationFactory,
2472
+ ]
2473
+ }]
2474
+ }], ctorParameters: function () { return [{ type: i1.Store }, { type: CrudConfig }, { type: CrudEffects }]; } });
2475
+
2476
+ class CrudCoreModule {
2477
+ constructor(config, effects) {
2478
+ NgrxStoreService.addReducer(config.entity, config.reducerFactory
2479
+ ? config.reducerFactory()
2480
+ : getReducer(config.entity));
2481
+ effects.init();
2482
+ }
2483
+ }
2484
+ /** @nocollapse */ /** @nocollapse */ CrudCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudCoreModule, deps: [{ token: CrudConfig }, { token: CrudEffects }], target: i0.ɵɵFactoryTarget.NgModule });
2485
+ /** @nocollapse */ /** @nocollapse */ CrudCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudCoreModule, imports: [
2486
+ //AuthSharedModule,
2487
+ StoreModule,
2488
+ SharedModule,
2489
+ CrudPipesModule,
2490
+ FormsModule,
2491
+ CommonModule,
2492
+ CrudComponentsModule,
2493
+ NgrxSharedModule
2494
+ ], exports: [CrudComponentsModule] });
2495
+ /** @nocollapse */ /** @nocollapse */ CrudCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudCoreModule, providers: [
2496
+ CrudService,
2497
+ CrudListGroupService,
2498
+ PageService,
2499
+ CrudEffects,
2500
+ CrudFacade,
2501
+ SocketService,
2502
+ CrudListPaginationFactory,
2503
+ ], imports: [[
2504
+ //AuthSharedModule,
2505
+ StoreModule,
2506
+ SharedModule,
2507
+ CrudPipesModule,
2508
+ FormsModule,
2509
+ CommonModule,
2510
+ CrudComponentsModule,
2511
+ NgrxSharedModule,
2512
+ ], CrudComponentsModule] });
2513
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudCoreModule, decorators: [{
2514
+ type: NgModule,
2515
+ args: [{
2516
+ imports: [
2517
+ //AuthSharedModule,
2518
+ StoreModule,
2519
+ SharedModule,
2520
+ CrudPipesModule,
2521
+ FormsModule,
2522
+ CommonModule,
2523
+ CrudComponentsModule,
2524
+ NgrxSharedModule,
2525
+ ],
2526
+ exports: [CrudComponentsModule],
2527
+ providers: [
2528
+ CrudService,
2529
+ CrudListGroupService,
2530
+ PageService,
2531
+ CrudEffects,
2532
+ CrudFacade,
2533
+ SocketService,
2534
+ CrudListPaginationFactory,
2535
+ ],
2536
+ }]
2537
+ }], ctorParameters: function () { return [{ type: CrudConfig }, { type: CrudEffects }]; } });
2538
+ class CrudModule {
2539
+ static forFeature(options) {
2540
+ return {
2541
+ ngModule: options.routing ? CrudFullModule : CrudCoreModule,
2542
+ providers: [
2543
+ { provide: CrudConfig, useValue: options.config },
2544
+ { provide: CrudFullConfig, useValue: options.config },
2545
+ {
2546
+ provide: FILE_SERVICE_CONFIG,
2547
+ useValue: { apiUrl: options.config.apiUrl },
2548
+ },
2549
+ ...(options.socket
2550
+ ? [SocketService]
2551
+ : [{ provide: SocketService, useClass: NotSocketService }]),
2552
+ ],
2553
+ };
2554
+ }
2555
+ }
2556
+ /** @nocollapse */ /** @nocollapse */ CrudModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2557
+ /** @nocollapse */ /** @nocollapse */ CrudModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudModule });
2558
+ /** @nocollapse */ /** @nocollapse */ CrudModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudModule });
2559
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: CrudModule, decorators: [{
2560
+ type: NgModule,
2561
+ args: [{}]
2562
+ }] });
2563
+
2564
+ /**
2565
+ * Generated bundle index. Do not edit.
2566
+ */
2567
+
2568
+ export { CRUD_MODEL_POSSIBILITIES_PROVIDER, CrudComponentsModule, CrudConfig, CrudCoreModule, CrudEffects, CrudFacade, CrudFullConfig, CrudFullModule, CrudItemPageBaseComponent, CrudListPageBaseComponent, CrudListPaginationFactory, CrudModule, CrudPipesModule, CrudSearchService, CrudService, ExportComponent, FilterCheckComponent, FilterComponent, FilterDateComponent, FilterDateWithEditComponent, FilterFlagComponent, FilterIntComponent, FilterRadioComponent, FilterTextComponent, FiltersComponent, FiltersConfigComponent, FormOptionsPipe, GroupComponent, ICrudModelPossibilitiesProvider, ItemComponent, ItemStandardComponent, ListComponent, ListStandardComponent, MultiselectComponent, PAGES, PageService, create, createFailure, createMany, createManyFailure, createManySuccess, createSuccess, deleteFailure, deleteItem, deleteSuccess, exportList, exportListFailure, exportListSuccess, getCrudError, getCrudFilter, getCrudLinks, getCrudList, getCrudLoaded, getCrudMultiSelected, getCrudSelected, getCrudState, getCrudTotalCount, getReducer, initialState, multiSelect, read, readFailure, readSuccess, select, selectFailure, selectSuccess, unselect, update, updateFailure, updatePartial, updatePartialFailure, updatePartialMany, updatePartialManyFailure, updatePartialManySuccess, updatePartialSuccess, updateSuccess };
2569
+ //# sourceMappingURL=smartsoft001-crud-shell-angular.mjs.map