@smartsoft001/crud-shell-angular 1.1.733 → 1.1.737

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