@smartsoft001/crud-shell-angular 1.2.72 → 1.2.75

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