@decaf-ts/for-angular 0.0.81 → 0.0.83
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.
- package/fesm2022/decaf-ts-for-angular.mjs +165 -114
- package/fesm2022/decaf-ts-for-angular.mjs.map +1 -1
- package/index.d.ts +19 -16
- package/package.json +1 -1
|
@@ -1799,10 +1799,11 @@ class NgxFormService {
|
|
|
1799
1799
|
}
|
|
1800
1800
|
continue;
|
|
1801
1801
|
}
|
|
1802
|
-
data[key] =
|
|
1802
|
+
data[key] = NgxFormService.getFormData(control);
|
|
1803
1803
|
continue;
|
|
1804
1804
|
}
|
|
1805
1805
|
const props = NgxFormService.getPropsFromControl(control);
|
|
1806
|
+
// const { readonly } = (props as IFormComponentProperties) || false; TODO: dont send readonly fields?
|
|
1806
1807
|
let value = control.value;
|
|
1807
1808
|
if (!HTML5CheckTypes.includes(props['type'])) {
|
|
1808
1809
|
switch (props['type']) {
|
|
@@ -1811,7 +1812,7 @@ class NgxFormService {
|
|
|
1811
1812
|
break;
|
|
1812
1813
|
case HTML5InputTypes.DATE:
|
|
1813
1814
|
case HTML5InputTypes.DATETIME_LOCAL:
|
|
1814
|
-
value = typeof value === Primitives.STRING ? new Date(value) : value;
|
|
1815
|
+
value = typeof value === Primitives.STRING ? new Date(`${value}T00:00:00`) : value;
|
|
1815
1816
|
break;
|
|
1816
1817
|
default:
|
|
1817
1818
|
value = escapeHtml(value)?.trim();
|
|
@@ -2394,8 +2395,10 @@ class NgxRenderingEngine extends RenderingEngine {
|
|
|
2394
2395
|
delete inputs[input];
|
|
2395
2396
|
return !isMapped;
|
|
2396
2397
|
});
|
|
2397
|
-
if (unmappedKeys.length > 0 && isDevelopmentMode())
|
|
2398
|
-
|
|
2398
|
+
// if (unmappedKeys.length > 0 && isDevelopmentMode())
|
|
2399
|
+
// getLogger(this).warn(
|
|
2400
|
+
// `Unmapped input properties for component ${fieldDef.tag}: ${unmappedKeys.join(', ')}`,
|
|
2401
|
+
// );
|
|
2399
2402
|
const operation = NgxRenderingEngine._operation;
|
|
2400
2403
|
const hiddenOn = inputs?.hidden || [];
|
|
2401
2404
|
if (hiddenOn.includes(operation))
|
|
@@ -3152,7 +3155,7 @@ class NgxMediaService {
|
|
|
3152
3155
|
*/
|
|
3153
3156
|
this.resizeSubject = new BehaviorSubject({
|
|
3154
3157
|
width: this._window.innerWidth,
|
|
3155
|
-
height: this._window.innerHeight
|
|
3158
|
+
height: this._window.innerHeight,
|
|
3156
3159
|
});
|
|
3157
3160
|
/**
|
|
3158
3161
|
* @description Angular's NgZone service for running code outside Angular's zone.
|
|
@@ -3211,7 +3214,6 @@ class NgxMediaService {
|
|
|
3211
3214
|
}
|
|
3212
3215
|
darkModeEnabled() {
|
|
3213
3216
|
return this._document.documentElement.classList.contains('has-dark-mode');
|
|
3214
|
-
;
|
|
3215
3217
|
}
|
|
3216
3218
|
/**
|
|
3217
3219
|
* @description Observes window resize events and emits the updated dimensions.
|
|
@@ -3236,7 +3238,7 @@ class NgxMediaService {
|
|
|
3236
3238
|
.subscribe(() => {
|
|
3237
3239
|
const dimensions = {
|
|
3238
3240
|
width: win.innerWidth,
|
|
3239
|
-
height: win.innerHeight
|
|
3241
|
+
height: win.innerHeight,
|
|
3240
3242
|
};
|
|
3241
3243
|
// update within the zone to reflect in Angular
|
|
3242
3244
|
this.angularZone.run(() => this.resizeSubject.next(dimensions));
|
|
@@ -3278,24 +3280,25 @@ class NgxMediaService {
|
|
|
3278
3280
|
}
|
|
3279
3281
|
return merge(of(mediaFn.matches ? WindowColorSchemes.dark : WindowColorSchemes.light),
|
|
3280
3282
|
// observe media query changes
|
|
3281
|
-
new Observable(observer => {
|
|
3283
|
+
new Observable((observer) => {
|
|
3282
3284
|
this.angularZone.runOutsideAngular(() => {
|
|
3283
3285
|
const mediaQuery = mediaFn;
|
|
3284
3286
|
const subscription = fromEvent(mediaQuery, 'change')
|
|
3285
|
-
.pipe(map(event => (event.matches ? WindowColorSchemes.dark : WindowColorSchemes.light)))
|
|
3286
|
-
.subscribe(value => {
|
|
3287
|
+
.pipe(map((event) => (event.matches ? WindowColorSchemes.dark : WindowColorSchemes.light)))
|
|
3288
|
+
.subscribe((value) => {
|
|
3287
3289
|
this.angularZone.run(() => observer.next(value));
|
|
3288
3290
|
});
|
|
3289
3291
|
return () => subscription.unsubscribe();
|
|
3290
3292
|
});
|
|
3291
3293
|
}),
|
|
3292
3294
|
// observe ngx-dcf-palettedark class changes
|
|
3293
|
-
new Observable(observer => {
|
|
3295
|
+
new Observable((observer) => {
|
|
3294
3296
|
this.angularZone.runOutsideAngular(() => {
|
|
3295
3297
|
const observerConfig = { attributes: true, attributeFilter: ['class'] };
|
|
3296
3298
|
const mutationObserver = new MutationObserver(() => {
|
|
3297
|
-
const theme = documentElement.classList.contains(AngularEngineKeys.DARK_PALETTE_CLASS)
|
|
3298
|
-
WindowColorSchemes.dark
|
|
3299
|
+
const theme = documentElement.classList.contains(AngularEngineKeys.DARK_PALETTE_CLASS)
|
|
3300
|
+
? WindowColorSchemes.dark
|
|
3301
|
+
: WindowColorSchemes.light;
|
|
3299
3302
|
this.angularZone.run(() => observer.next(theme));
|
|
3300
3303
|
});
|
|
3301
3304
|
mutationObserver.observe(documentElement, observerConfig);
|
|
@@ -3303,7 +3306,7 @@ class NgxMediaService {
|
|
|
3303
3306
|
// this.angularZone.run(() => observer.next(theme));
|
|
3304
3307
|
return () => mutationObserver.disconnect();
|
|
3305
3308
|
});
|
|
3306
|
-
})).pipe(distinctUntilChanged(), tap(scheme => {
|
|
3309
|
+
})).pipe(distinctUntilChanged(), tap((scheme) => {
|
|
3307
3310
|
const shouldAdd = scheme === WindowColorSchemes.dark;
|
|
3308
3311
|
if (shouldAdd) {
|
|
3309
3312
|
// always add when the emitted scheme is dark
|
|
@@ -3337,12 +3340,14 @@ class NgxMediaService {
|
|
|
3337
3340
|
*/
|
|
3338
3341
|
observePageScroll(offset, awaitDelay = 500) {
|
|
3339
3342
|
// await delay for page change to complete
|
|
3340
|
-
return timer(awaitDelay)
|
|
3341
|
-
.pipe(switchMap(() => new Observable(observer => {
|
|
3343
|
+
return timer(awaitDelay).pipe(switchMap(() => new Observable((observer) => {
|
|
3342
3344
|
const activeContent = this._document.querySelector('ion-router-outlet .ion-page:not(.ion-page-hidden) ion-content');
|
|
3343
|
-
if (!(activeContent &&
|
|
3345
|
+
if (!(activeContent &&
|
|
3346
|
+
typeof activeContent.getScrollElement === 'function'))
|
|
3344
3347
|
return this.angularZone.run(() => observer.next(false));
|
|
3345
|
-
activeContent
|
|
3348
|
+
activeContent
|
|
3349
|
+
.getScrollElement()
|
|
3350
|
+
.then((element) => {
|
|
3346
3351
|
const emitScrollState = () => {
|
|
3347
3352
|
const scrollTop = element.scrollTop || 0;
|
|
3348
3353
|
this.angularZone.run(() => observer.next(scrollTop > offset));
|
|
@@ -3371,8 +3376,10 @@ class NgxMediaService {
|
|
|
3371
3376
|
*/
|
|
3372
3377
|
loadSvgObserver(http, path, target) {
|
|
3373
3378
|
this.angularZone.runOutsideAngular(() => {
|
|
3374
|
-
const svg$ = http
|
|
3375
|
-
|
|
3379
|
+
const svg$ = http
|
|
3380
|
+
.get(path, { responseType: 'text' })
|
|
3381
|
+
.pipe(takeUntil(this.destroy$), shareReplay(1));
|
|
3382
|
+
svg$.subscribe((svg) => {
|
|
3376
3383
|
this.angularZone.run(() => {
|
|
3377
3384
|
target.innerHTML = svg;
|
|
3378
3385
|
});
|
|
@@ -3396,7 +3403,8 @@ class NgxMediaService {
|
|
|
3396
3403
|
if (!this.darkModeEnabled())
|
|
3397
3404
|
return of(false);
|
|
3398
3405
|
const documentElement = this._document.documentElement;
|
|
3399
|
-
return this.colorScheme$.pipe(map(scheme => documentElement.classList.contains(AngularEngineKeys.DARK_PALETTE_CLASS) ||
|
|
3406
|
+
return this.colorScheme$.pipe(map((scheme) => documentElement.classList.contains(AngularEngineKeys.DARK_PALETTE_CLASS) ||
|
|
3407
|
+
scheme === WindowColorSchemes.dark), distinctUntilChanged(), shareReplay(1), takeUntil(this.destroy$));
|
|
3400
3408
|
}
|
|
3401
3409
|
/**
|
|
3402
3410
|
* @description Toggles dark mode for a specific component.
|
|
@@ -3439,7 +3447,7 @@ class NgxMediaService {
|
|
|
3439
3447
|
*/
|
|
3440
3448
|
toggleClass(component, className, add = true) {
|
|
3441
3449
|
const components = Array.isArray(component) ? component : [component];
|
|
3442
|
-
components.forEach(element => {
|
|
3450
|
+
components.forEach((element) => {
|
|
3443
3451
|
if (element?.nativeElement)
|
|
3444
3452
|
element = element.nativeElement;
|
|
3445
3453
|
if (element instanceof HTMLElement) {
|
|
@@ -3558,12 +3566,18 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3558
3566
|
async initialize() {
|
|
3559
3567
|
if (this.repository) {
|
|
3560
3568
|
if (this.filter) {
|
|
3561
|
-
this.
|
|
3569
|
+
const value = !this.modelId || !`${this.modelId}`.trim().length ? null : this.modelId;
|
|
3570
|
+
if (value === null) {
|
|
3571
|
+
this._data = [];
|
|
3572
|
+
return;
|
|
3573
|
+
}
|
|
3574
|
+
this._data = await this.query(this.filter.eq(value));
|
|
3562
3575
|
if (this._data) {
|
|
3563
3576
|
await this.refresh();
|
|
3564
3577
|
}
|
|
3565
3578
|
}
|
|
3566
3579
|
else {
|
|
3580
|
+
// this._data = await this.read(this.modelId as PrimaryKeyType);
|
|
3567
3581
|
// if (String(this.modelName) === this.model?.constructor.name) {
|
|
3568
3582
|
// const model = await this.repository.read(this.modelId as PrimaryKeyType);
|
|
3569
3583
|
// if (model) {
|
|
@@ -3596,14 +3610,14 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3596
3610
|
if (!attr) {
|
|
3597
3611
|
attr = (this.filterBy || this.pk);
|
|
3598
3612
|
}
|
|
3599
|
-
const
|
|
3613
|
+
const condition = this.filter || Condition.attribute(attr);
|
|
3600
3614
|
const type = this.getModelPropertyType(this.repository.class, attr);
|
|
3601
3615
|
if (this.modelId) {
|
|
3602
|
-
return
|
|
3616
|
+
return condition.eq([Primitives.NUMBER, Primitives.BIGINT].includes(type)
|
|
3603
3617
|
? Number(this.modelId)
|
|
3604
3618
|
: this.modelId);
|
|
3605
3619
|
}
|
|
3606
|
-
return
|
|
3620
|
+
return condition.dif(null);
|
|
3607
3621
|
}
|
|
3608
3622
|
async read(uid) {
|
|
3609
3623
|
return (await this.repository.read(uid));
|
|
@@ -3622,11 +3636,26 @@ class NgxRepositoryDirective extends DecafComponent {
|
|
|
3622
3636
|
}
|
|
3623
3637
|
await this.repository.deleteAll(data);
|
|
3624
3638
|
}
|
|
3625
|
-
async query(
|
|
3626
|
-
if (!
|
|
3627
|
-
|
|
3639
|
+
async query(condition, sortBy = (this.sortBy || this.pk), sortDirection = this.sortDirection) {
|
|
3640
|
+
if (!condition) {
|
|
3641
|
+
condition = this.buildCondition();
|
|
3628
3642
|
}
|
|
3629
|
-
|
|
3643
|
+
try {
|
|
3644
|
+
return (await this.repository.query(condition, sortBy, sortDirection));
|
|
3645
|
+
}
|
|
3646
|
+
catch (error) {
|
|
3647
|
+
this.log.for(this).error(error?.message || String(error));
|
|
3648
|
+
return [];
|
|
3649
|
+
}
|
|
3650
|
+
// const paginator = await this.repository
|
|
3651
|
+
// .select()
|
|
3652
|
+
// .where(condition)
|
|
3653
|
+
// .orderBy([(this.sortBy || this.pk) as keyof M, sortDirection])
|
|
3654
|
+
// .paginate(250);
|
|
3655
|
+
// if (paginator.total === 0) {
|
|
3656
|
+
// return [];
|
|
3657
|
+
// }
|
|
3658
|
+
// return await paginator.page(1);
|
|
3630
3659
|
}
|
|
3631
3660
|
async paginate(limit = this.limit, sortDirection = this.sortDirection, condition) {
|
|
3632
3661
|
if (!condition) {
|
|
@@ -4174,6 +4203,9 @@ class NgxComponentDirective extends NgxRepositoryDirective {
|
|
|
4174
4203
|
if (!this.initialized && Object.keys(this.props || {}).length) {
|
|
4175
4204
|
this.parseProps(this);
|
|
4176
4205
|
}
|
|
4206
|
+
if (this.operation === OperationKeys.CREATE) {
|
|
4207
|
+
this.refreshing = false;
|
|
4208
|
+
}
|
|
4177
4209
|
this.router.events
|
|
4178
4210
|
.pipe(shareReplay$1(1), takeUntil$1(this.destroySubscriptions$))
|
|
4179
4211
|
.subscribe(async (event) => {
|
|
@@ -4958,6 +4990,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
4958
4990
|
class NgxModelPageDirective extends NgxPageDirective {
|
|
4959
4991
|
constructor() {
|
|
4960
4992
|
super(...arguments);
|
|
4993
|
+
this.refreshing = true;
|
|
4961
4994
|
/**
|
|
4962
4995
|
* @description The CRUD operation type to be performed on the model.
|
|
4963
4996
|
* @summary Specifies which operation (Create, Read, Update, Delete) this component instance
|
|
@@ -5017,10 +5050,11 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5017
5050
|
}
|
|
5018
5051
|
async initialize() {
|
|
5019
5052
|
await super.initialize();
|
|
5020
|
-
await this.refresh(this.modelId);
|
|
5021
|
-
this.changeDetectorRef.detectChanges();
|
|
5022
5053
|
this.getLocale(this.modelName);
|
|
5023
5054
|
}
|
|
5055
|
+
async ionViewWillEnter() {
|
|
5056
|
+
await this.refresh(this.modelId);
|
|
5057
|
+
}
|
|
5024
5058
|
// /**
|
|
5025
5059
|
// * @description Angular lifecycle hook for component initialization.
|
|
5026
5060
|
// * @summary Initializes the component by setting up the logger instance using the getLogger
|
|
@@ -5040,6 +5074,7 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5040
5074
|
* @param {string} [uid] - The unique identifier of the model to load; defaults to modelId
|
|
5041
5075
|
*/
|
|
5042
5076
|
async refresh(uid) {
|
|
5077
|
+
this.refreshing = true;
|
|
5043
5078
|
if (!uid) {
|
|
5044
5079
|
uid = this.modelId;
|
|
5045
5080
|
}
|
|
@@ -5050,8 +5085,7 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5050
5085
|
case OperationKeys.UPDATE:
|
|
5051
5086
|
case OperationKeys.DELETE:
|
|
5052
5087
|
{
|
|
5053
|
-
|
|
5054
|
-
this.changeDetectorRef.detectChanges();
|
|
5088
|
+
await this.handleRead(uid);
|
|
5055
5089
|
}
|
|
5056
5090
|
break;
|
|
5057
5091
|
}
|
|
@@ -5062,6 +5096,7 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5062
5096
|
}
|
|
5063
5097
|
this.log.error(error);
|
|
5064
5098
|
}
|
|
5099
|
+
this.refreshing = false;
|
|
5065
5100
|
}
|
|
5066
5101
|
/**
|
|
5067
5102
|
* @description Enables CRUD operations except those specified.
|
|
@@ -5227,17 +5262,16 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5227
5262
|
this.pkType = pkType;
|
|
5228
5263
|
}
|
|
5229
5264
|
uid = this.parsePkValue(uid, this.pkType);
|
|
5230
|
-
if (!this.modelId)
|
|
5265
|
+
if (!this.modelId) {
|
|
5231
5266
|
this.modelId = uid;
|
|
5232
|
-
|
|
5233
|
-
.select()
|
|
5234
|
-
.where(Condition.attribute(this.pk).eq(uid))
|
|
5235
|
-
.execute();
|
|
5267
|
+
}
|
|
5236
5268
|
if (modelName === this.modelName) {
|
|
5237
|
-
const data =
|
|
5269
|
+
const data = await repository.read(uid);
|
|
5238
5270
|
acc[prop] = data;
|
|
5239
|
-
const
|
|
5240
|
-
|
|
5271
|
+
const _model = (await this.transactionEnd(data, repository, OperationKeys.READ)) ||
|
|
5272
|
+
Model.build(data, model.constructor.name);
|
|
5273
|
+
this.name = prop;
|
|
5274
|
+
this.model = Model.build({ [prop]: _model }, modelName);
|
|
5241
5275
|
}
|
|
5242
5276
|
else {
|
|
5243
5277
|
// model[parent] = {
|
|
@@ -5259,8 +5293,7 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
5259
5293
|
try {
|
|
5260
5294
|
if (!this.pk)
|
|
5261
5295
|
this.pk = Model.pk(repository.class);
|
|
5262
|
-
|
|
5263
|
-
return res;
|
|
5296
|
+
return await repository.read(this.parsePkValue(uid, this.getModelPkType(repository.class)));
|
|
5264
5297
|
}
|
|
5265
5298
|
catch (error) {
|
|
5266
5299
|
this.log
|
|
@@ -6285,6 +6318,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
6285
6318
|
class NgxParentComponentDirective extends NgxComponentDirective {
|
|
6286
6319
|
constructor() {
|
|
6287
6320
|
super(...arguments);
|
|
6321
|
+
this.refreshing = false;
|
|
6288
6322
|
/**
|
|
6289
6323
|
* @description Unique identifier for the current record.
|
|
6290
6324
|
* @summary A unique identifier for the current record being displayed or manipulated.
|
|
@@ -6398,9 +6432,6 @@ class NgxParentComponentDirective extends NgxComponentDirective {
|
|
|
6398
6432
|
*/
|
|
6399
6433
|
this.preloadCards = new Array(1);
|
|
6400
6434
|
}
|
|
6401
|
-
ngOnInit() {
|
|
6402
|
-
throw new Error('Method not implemented.');
|
|
6403
|
-
}
|
|
6404
6435
|
async initialize(model) {
|
|
6405
6436
|
await super.initialize();
|
|
6406
6437
|
if (model) {
|
|
@@ -6428,11 +6459,13 @@ class NgxParentComponentDirective extends NgxComponentDirective {
|
|
|
6428
6459
|
}
|
|
6429
6460
|
}
|
|
6430
6461
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxParentComponentDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6431
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: NgxParentComponentDirective, isStandalone: true, inputs: { page: "page", pages: "pages", parentForm: "parentForm", children: "children", cols: "cols", rows: "rows", cardBody: "cardBody", cardType: "cardType", breakpoint: "breakpoint", match: "match" }, usesInheritance: true, ngImport: i0 }); }
|
|
6462
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: NgxParentComponentDirective, isStandalone: true, inputs: { refreshing: "refreshing", page: "page", pages: "pages", parentForm: "parentForm", children: "children", cols: "cols", rows: "rows", cardBody: "cardBody", cardType: "cardType", breakpoint: "breakpoint", match: "match" }, usesInheritance: true, ngImport: i0 }); }
|
|
6432
6463
|
}
|
|
6433
6464
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxParentComponentDirective, decorators: [{
|
|
6434
6465
|
type: Directive
|
|
6435
|
-
}], propDecorators: {
|
|
6466
|
+
}], propDecorators: { refreshing: [{
|
|
6467
|
+
type: Input
|
|
6468
|
+
}], page: [{
|
|
6436
6469
|
type: Input
|
|
6437
6470
|
}], pages: [{
|
|
6438
6471
|
type: Input
|
|
@@ -8211,7 +8244,7 @@ let LayoutComponent = class LayoutComponent extends NgxParentComponentDirective
|
|
|
8211
8244
|
await super.initialize();
|
|
8212
8245
|
}
|
|
8213
8246
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8214
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: LayoutComponent, isStandalone: true, selector: "ngx-decaf-layout", inputs: { gap: "gap", grid: "grid", flexMode: "flexMode", rowCard: "rowCard", maxColsLength: "maxColsLength" }, usesInheritance: true, ngImport: i0, template: "<section class=\"dcf-layout-container\">\n @if (initialized) {\n @for (row of rows; track trackItemFn($index, row); let rowIndex = $index) {\n @if (row?.cols?.length) {\n <div\n [id]=\"uid\"\n [class]=\"\n (!grid ? 'dcf-layout-row ' : 'dcf-layout-row dcf-grid ' + 'dcf-grid-' + gap) +\n ' ' +\n (className || '')\n \"\n [class.dcf-grid-match]=\"match\"\n [class.dcf-grid-bordered]=\"borders\"\n >\n @if (row?.title?.length) {\n <div class=\"dcf-width-1-1 dcf-grid-title\">\n <h3 class=\"\">{{ row.title | translate }}</h3>\n </div>\n }\n @for (child of row.cols; track trackItemFn($index, child.col); let colIndex = $index) {\n <div\n [class]=\"'dcf-grid-col ' + child.colClass\"\n [class.dcf-first-column]=\"$index === 0\"\n [class.dcf-hidden]=\"child.props?.hidden?.includes(operation)\"\n >\n <div>\n @if (child.tag === 'ngx-decaf-crud-form') {\n <ngx-decaf-card\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [body]=\"cardBody\"\n [type]=\"cardType\"\n >\n <ngx-decaf-model-renderer\n [model]=\"child.props.name\"\n [pk]=\"pk\"\n (listenEvent)=\"handleEvent($event)\"\n />\n </ngx-decaf-card>\n } @else {\n <ngx-decaf-component-renderer\n
|
|
8247
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: LayoutComponent, isStandalone: true, selector: "ngx-decaf-layout", inputs: { gap: "gap", grid: "grid", flexMode: "flexMode", rowCard: "rowCard", maxColsLength: "maxColsLength" }, usesInheritance: true, ngImport: i0, template: "<section class=\"dcf-layout-container\">\n @if (initialized) {\n @for (row of rows; track trackItemFn($index, row); let rowIndex = $index) {\n @if (row?.cols?.length) {\n <div\n [id]=\"uid\"\n [class]=\"\n (!grid ? 'dcf-layout-row ' : 'dcf-layout-row dcf-grid ' + 'dcf-grid-' + gap) +\n ' ' +\n (className || '')\n \"\n [class.dcf-grid-match]=\"match\"\n [class.dcf-grid-bordered]=\"borders\"\n >\n @if (row?.title?.length) {\n <div class=\"dcf-width-1-1 dcf-grid-title\">\n <h3 class=\"\">{{ row.title | translate }}</h3>\n </div>\n }\n @for (child of row.cols; track trackItemFn($index, child.col); let colIndex = $index) {\n <div\n [class]=\"'dcf-grid-col ' + child.colClass\"\n [class.dcf-first-column]=\"$index === 0\"\n [class.dcf-hidden]=\"child.props?.hidden?.includes(operation)\"\n >\n <div>\n @if (child.tag === 'ngx-decaf-crud-form') {\n <ngx-decaf-card\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [body]=\"cardBody\"\n [type]=\"cardType\"\n >\n <ngx-decaf-model-renderer\n [model]=\"child.props.name\"\n [pk]=\"pk\"\n (listenEvent)=\"handleEvent($event)\"\n />\n </ngx-decaf-card>\n } @else {\n @if (refreshing) {\n <ion-item>\n <ion-label>\n <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n <ion-text style=\"width: 100%\">\n <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n </ion-text>\n </ion-label>\n </ion-item>\n } @else {\n <ngx-decaf-component-renderer\n [tag]=\"child.tag\"\n [pk]=\"pk\"\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [parentForm]=\"parentForm || child.parentForm || child?.formGroup\"\n [children]=\"child?.children || []\"\n (listenEvent)=\"handleEvent($event)\"\n [globals]=\"{ props: child.props }\"\n />\n }\n }\n </div>\n </div>\n }\n </div>\n }\n }\n }\n</section>\n", styles: [".dcf-grid:first-of-type .dcf-grid .dcf-first-column{padding-top:.25rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div{padding-top:.5rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div~div{padding-top:.25rem!important}.dcf-grid.dcf-grid-collapse.read>div{margin:var(--dcf-margin-small) 0!important}.dcf-grid.dcf-grid-bordered>div>div{padding:var(--dcf-padding-small) var(--dcf-padding);border-radius:var(--dcf-border-radius-small);border:1px solid var(--dcf-color-gray-2);background:var(--dcf-card-background)!important}.dcf-grid .dcf-grid-title{padding:unset;margin:unset}.dcf-grid .dcf-grid-title>*{padding:unset;margin:unset;padding-left:var(--dcf-padding-small);font-size:1.05rem!important;font-weight:600;background:none;box-shadow:none;display:flex;align-items:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dcf-grid.dcf-grid-match ::ng-deep ngx-decaf-component-renderer>*>*{height:100%!important}.dcf-grid.dcf-grid-small.dcf-grid-nested{padding:0 .5rem!important}.dcf-grid.dcf-grid-small>div{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small>div:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small>div.dcf-layout-separator{margin-bottom:1rem}.dcf-grid.dcf-grid-small>div.dcf-grid-bordered:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small+.dcf-grid-small{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small+.dcf-grid-small.dcf-layout-separator{margin-bottom:1rem}::ng-deep ngx-decaf-component-renderer>*>div{margin-bottom:0!important}\n"], dependencies: [{ kind: "component", type: CardComponent, selector: "ngx-decaf-card", inputs: ["type", "title", "body", "subtitle", "color", "separator", "borders", "inlineContent", "inlineContentPosition"] }, { kind: "component", type: ModelRendererComponent, selector: "ngx-decaf-model-renderer", inputs: ["projectable"] }, { kind: "component", type: ComponentRendererComponent, selector: "ngx-decaf-component-renderer", inputs: ["tag", "children", "projectable", "pk", "parent"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
8215
8248
|
};
|
|
8216
8249
|
LayoutComponent = __decorate([
|
|
8217
8250
|
Dynamic(),
|
|
@@ -8219,7 +8252,7 @@ LayoutComponent = __decorate([
|
|
|
8219
8252
|
], LayoutComponent);
|
|
8220
8253
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LayoutComponent, decorators: [{
|
|
8221
8254
|
type: Component,
|
|
8222
|
-
args: [{ selector: 'ngx-decaf-layout', imports: [TranslatePipe, CardComponent, ModelRendererComponent, ComponentRendererComponent], standalone: true, template: "<section class=\"dcf-layout-container\">\n @if (initialized) {\n @for (row of rows; track trackItemFn($index, row); let rowIndex = $index) {\n @if (row?.cols?.length) {\n <div\n [id]=\"uid\"\n [class]=\"\n (!grid ? 'dcf-layout-row ' : 'dcf-layout-row dcf-grid ' + 'dcf-grid-' + gap) +\n ' ' +\n (className || '')\n \"\n [class.dcf-grid-match]=\"match\"\n [class.dcf-grid-bordered]=\"borders\"\n >\n @if (row?.title?.length) {\n <div class=\"dcf-width-1-1 dcf-grid-title\">\n <h3 class=\"\">{{ row.title | translate }}</h3>\n </div>\n }\n @for (child of row.cols; track trackItemFn($index, child.col); let colIndex = $index) {\n <div\n [class]=\"'dcf-grid-col ' + child.colClass\"\n [class.dcf-first-column]=\"$index === 0\"\n [class.dcf-hidden]=\"child.props?.hidden?.includes(operation)\"\n >\n <div>\n @if (child.tag === 'ngx-decaf-crud-form') {\n <ngx-decaf-card\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [body]=\"cardBody\"\n [type]=\"cardType\"\n >\n <ngx-decaf-model-renderer\n [model]=\"child.props.name\"\n [pk]=\"pk\"\n (listenEvent)=\"handleEvent($event)\"\n />\n </ngx-decaf-card>\n } @else {\n <ngx-decaf-component-renderer\n
|
|
8255
|
+
args: [{ selector: 'ngx-decaf-layout', imports: [TranslatePipe, CardComponent, ModelRendererComponent, ComponentRendererComponent], standalone: true, template: "<section class=\"dcf-layout-container\">\n @if (initialized) {\n @for (row of rows; track trackItemFn($index, row); let rowIndex = $index) {\n @if (row?.cols?.length) {\n <div\n [id]=\"uid\"\n [class]=\"\n (!grid ? 'dcf-layout-row ' : 'dcf-layout-row dcf-grid ' + 'dcf-grid-' + gap) +\n ' ' +\n (className || '')\n \"\n [class.dcf-grid-match]=\"match\"\n [class.dcf-grid-bordered]=\"borders\"\n >\n @if (row?.title?.length) {\n <div class=\"dcf-width-1-1 dcf-grid-title\">\n <h3 class=\"\">{{ row.title | translate }}</h3>\n </div>\n }\n @for (child of row.cols; track trackItemFn($index, child.col); let colIndex = $index) {\n <div\n [class]=\"'dcf-grid-col ' + child.colClass\"\n [class.dcf-first-column]=\"$index === 0\"\n [class.dcf-hidden]=\"child.props?.hidden?.includes(operation)\"\n >\n <div>\n @if (child.tag === 'ngx-decaf-crud-form') {\n <ngx-decaf-card\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [body]=\"cardBody\"\n [type]=\"cardType\"\n >\n <ngx-decaf-model-renderer\n [model]=\"child.props.name\"\n [pk]=\"pk\"\n (listenEvent)=\"handleEvent($event)\"\n />\n </ngx-decaf-card>\n } @else {\n @if (refreshing) {\n <ion-item>\n <ion-label>\n <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n <ion-text style=\"width: 100%\">\n <ion-skeleton-text [animated]=\"true\"></ion-skeleton-text>\n </ion-text>\n </ion-label>\n </ion-item>\n } @else {\n <ngx-decaf-component-renderer\n [tag]=\"child.tag\"\n [pk]=\"pk\"\n [className]=\"(match ? 'dcf-height-1-1 dcf-card-layout' : '') + className\"\n [parentForm]=\"parentForm || child.parentForm || child?.formGroup\"\n [children]=\"child?.children || []\"\n (listenEvent)=\"handleEvent($event)\"\n [globals]=\"{ props: child.props }\"\n />\n }\n }\n </div>\n </div>\n }\n </div>\n }\n }\n }\n</section>\n", styles: [".dcf-grid:first-of-type .dcf-grid .dcf-first-column{padding-top:.25rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div{padding-top:.5rem!important}.dcf-grid:first-of-type .dcf-grid .dcf-first-column+div~div{padding-top:.25rem!important}.dcf-grid.dcf-grid-collapse.read>div{margin:var(--dcf-margin-small) 0!important}.dcf-grid.dcf-grid-bordered>div>div{padding:var(--dcf-padding-small) var(--dcf-padding);border-radius:var(--dcf-border-radius-small);border:1px solid var(--dcf-color-gray-2);background:var(--dcf-card-background)!important}.dcf-grid .dcf-grid-title{padding:unset;margin:unset}.dcf-grid .dcf-grid-title>*{padding:unset;margin:unset;padding-left:var(--dcf-padding-small);font-size:1.05rem!important;font-weight:600;background:none;box-shadow:none;display:flex;align-items:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dcf-grid.dcf-grid-match ::ng-deep ngx-decaf-component-renderer>*>*{height:100%!important}.dcf-grid.dcf-grid-small.dcf-grid-nested{padding:0 .5rem!important}.dcf-grid.dcf-grid-small>div{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small>div:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small>div.dcf-layout-separator{margin-bottom:1rem}.dcf-grid.dcf-grid-small>div.dcf-grid-bordered:last-child{margin-bottom:0}.dcf-grid.dcf-grid-small+.dcf-grid-small{margin-bottom:1.75rem}.dcf-grid.dcf-grid-small+.dcf-grid-small.dcf-layout-separator{margin-bottom:1rem}::ng-deep ngx-decaf-component-renderer>*>div{margin-bottom:0!important}\n"] }]
|
|
8223
8256
|
}], ctorParameters: () => [], propDecorators: { gap: [{
|
|
8224
8257
|
type: Input
|
|
8225
8258
|
}], grid: [{
|
|
@@ -8270,7 +8303,7 @@ let CrudFormComponent = class CrudFormComponent extends NgxFormDirective {
|
|
|
8270
8303
|
super.submitEventEmit(this.model, 'CrudFormComponent', ComponentEventNames.Submit, this.handlers, OperationKeys.DELETE);
|
|
8271
8304
|
}
|
|
8272
8305
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CrudFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8273
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: CrudFormComponent, isStandalone: true, selector: "ngx-decaf-crud-form", host: { properties: { "attr.id": "uid" } }, usesInheritance: true, ngImport: i0, template: "@if (operation !== 'read' && operation !== 'delete') {\n <form\n [class]=\"'dcf-form-grid ' + operation\"\n #component\n [id]=\"rendererId\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submit($event)\"\n novalidate\n [target]=\"target\"\n >\n @if (!children?.length) {\n <ng-content #formContent></ng-content>\n } @else {\n <ngx-decaf-layout\n [className]=\"'dcf-crud-form-grid dcf-grid-nested '\"\n [children]=\"children || []\"\n [pk]=\"pk\"\n
|
|
8306
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: CrudFormComponent, isStandalone: true, selector: "ngx-decaf-crud-form", host: { properties: { "attr.id": "uid" } }, usesInheritance: true, ngImport: i0, template: "@if (operation !== 'read' && operation !== 'delete') {\n <form\n [class]=\"'dcf-form-grid ' + operation\"\n #component\n [id]=\"rendererId\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submit($event)\"\n novalidate\n [target]=\"target\"\n >\n @if (!children?.length) {\n <ng-content #formContent></ng-content>\n } @else {\n <ngx-decaf-layout\n [className]=\"'dcf-crud-form-grid dcf-grid-nested '\"\n [children]=\"children || []\"\n [pk]=\"pk\"\n (listenEvent)=\"handleEvent($event)\"\n [parentForm]=\"formGroup || parentForm\"\n [operation]=\"operation\"\n [modelId]=\"modelId\"\n [cardType]=\"cardType ?? 'blank'\"\n [match]=\"match ?? false\"\n [refreshing]=\"refreshing\"\n [gap]=\"'small'\"\n [flexMode]=\"props.flexMode || false\"\n [rows]=\"rows\"\n [borders]=\"borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [cols]=\"cols\"\n />\n }\n @if (initialized) {\n <div class=\"dcf-buttons-grid dcf-grid dcf-grid-small dcf-flex dcf-flex-right\">\n @if (!action) {\n <div>\n <ion-button fill=\"clear\" (click)=\"handleReset()\">\n @if (options.buttons.clear?.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.clear?.iconSlot\"\n [name]=\"options.buttons.clear?.icon\"\n ></ion-icon>\n }\n {{ locale + '.' + (allowClear ? options.buttons.clear?.text : 'back') | translate }}\n </ion-button>\n </div>\n }\n <div>\n <ion-button type=\"submit\" [expand]=\"action ? 'block' : 'default'\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ action ? action : (locale + '.' + options.buttons.submit.text | translate) }}\n </ion-button>\n </div>\n </div>\n }\n </form>\n} @else {\n <section #component [id]=\"uid\">\n <ngx-decaf-layout\n [className]=\"''\"\n [pk]=\"pk\"\n [modelId]=\"modelId\"\n [children]=\"children || []\"\n [operation]=\"operation\"\n [cardType]=\"cardType ?? 'blank'\"\n [modelId]=\"modelId\"\n [match]=\"match ?? false\"\n [gap]=\"'small'\"\n (listenEvent)=\"handleEvent($event)\"\n [flexMode]=\"props.flexMode || false\"\n [rows]=\"rows\"\n [borders]=\"borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [cols]=\"cols\"\n />\n </section>\n\n <section\n [class]=\"'dcf-buttons-grid dcf-grid dcf-grid-small dcf-flex dcf-flex-left ' + operation\"\n [id]=\"uid\"\n >\n @if ([OperationKeys.READ, OperationKeys.DELETE].includes(operation) && modelId) {\n <div>\n <ion-button (click)=\"handleDelete()\" color=\"danger\" type=\"button\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ locale + '.delete' | translate }}\n </ion-button>\n </div>\n }\n @if (operation === OperationKeys.CREATE || operation === OperationKeys.UPDATE) {\n <div>\n <ion-button type=\"submit\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ action ? action : (locale + '.' + options.buttons.submit.text | translate) }}\n </ion-button>\n </div>\n }\n <div>\n <ion-button fill=\"clear\" (click)=\"handleReset()\">\n @if (options.buttons.clear?.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.clear?.iconSlot\"\n [name]=\"options.buttons.clear?.icon\"\n ></ion-icon>\n }\n {{\n [OperationKeys.DELETE, OperationKeys.READ, OperationKeys.UPDATE].includes(operation)\n ? (locale + '.back' | translate)\n : options.buttons.clear?.text\n }}\n </ion-button>\n </div>\n </section>\n}\n", styles: [".dcf-buttons-grid{margin-top:var(--dcf-margin-medium);margin-bottom:var(--dcf-margin)}@media (min-width: 577px){.dcf-buttons-grid.dcf-flex.read,.dcf-buttons-grid.dcf-flex.delete{flex-direction:row-reverse}}@media (max-width: 576px){.dcf-buttons-grid.dcf-flex{flex-direction:column-reverse}.dcf-buttons-grid.dcf-flex>div{width:100%}.dcf-buttons-grid.dcf-flex>div+div{margin-top:1rem}.dcf-buttons-grid.dcf-flex ion-button{width:100%}}.dcf-form-grid.create,.dcf-form-grid.update{margin-top:var(--dcf-margin-small)}.dcf-form-grid .dcf-form-item{margin-top:0!important}.dcf-form-grid.read .dcf-form-item{margin-bottom:var(--dcf-margin-small)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: LayoutComponent, selector: "ngx-decaf-layout", inputs: ["gap", "grid", "flexMode", "rowCard", "maxColsLength"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
8274
8307
|
};
|
|
8275
8308
|
CrudFormComponent = __decorate([
|
|
8276
8309
|
Dynamic(),
|
|
@@ -8278,7 +8311,7 @@ CrudFormComponent = __decorate([
|
|
|
8278
8311
|
], CrudFormComponent);
|
|
8279
8312
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CrudFormComponent, decorators: [{
|
|
8280
8313
|
type: Component,
|
|
8281
|
-
args: [{ standalone: true, selector: 'ngx-decaf-crud-form', imports: [TranslatePipe, ReactiveFormsModule, LayoutComponent, IonButton, IonIcon], host: { '[attr.id]': 'uid' }, template: "@if (operation !== 'read' && operation !== 'delete') {\n <form\n [class]=\"'dcf-form-grid ' + operation\"\n #component\n [id]=\"rendererId\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submit($event)\"\n novalidate\n [target]=\"target\"\n >\n @if (!children?.length) {\n <ng-content #formContent></ng-content>\n } @else {\n <ngx-decaf-layout\n [className]=\"'dcf-crud-form-grid dcf-grid-nested '\"\n [children]=\"children || []\"\n [pk]=\"pk\"\n
|
|
8314
|
+
args: [{ standalone: true, selector: 'ngx-decaf-crud-form', imports: [TranslatePipe, ReactiveFormsModule, LayoutComponent, IonButton, IonIcon], host: { '[attr.id]': 'uid' }, template: "@if (operation !== 'read' && operation !== 'delete') {\n <form\n [class]=\"'dcf-form-grid ' + operation\"\n #component\n [id]=\"rendererId\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submit($event)\"\n novalidate\n [target]=\"target\"\n >\n @if (!children?.length) {\n <ng-content #formContent></ng-content>\n } @else {\n <ngx-decaf-layout\n [className]=\"'dcf-crud-form-grid dcf-grid-nested '\"\n [children]=\"children || []\"\n [pk]=\"pk\"\n (listenEvent)=\"handleEvent($event)\"\n [parentForm]=\"formGroup || parentForm\"\n [operation]=\"operation\"\n [modelId]=\"modelId\"\n [cardType]=\"cardType ?? 'blank'\"\n [match]=\"match ?? false\"\n [refreshing]=\"refreshing\"\n [gap]=\"'small'\"\n [flexMode]=\"props.flexMode || false\"\n [rows]=\"rows\"\n [borders]=\"borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [cols]=\"cols\"\n />\n }\n @if (initialized) {\n <div class=\"dcf-buttons-grid dcf-grid dcf-grid-small dcf-flex dcf-flex-right\">\n @if (!action) {\n <div>\n <ion-button fill=\"clear\" (click)=\"handleReset()\">\n @if (options.buttons.clear?.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.clear?.iconSlot\"\n [name]=\"options.buttons.clear?.icon\"\n ></ion-icon>\n }\n {{ locale + '.' + (allowClear ? options.buttons.clear?.text : 'back') | translate }}\n </ion-button>\n </div>\n }\n <div>\n <ion-button type=\"submit\" [expand]=\"action ? 'block' : 'default'\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ action ? action : (locale + '.' + options.buttons.submit.text | translate) }}\n </ion-button>\n </div>\n </div>\n }\n </form>\n} @else {\n <section #component [id]=\"uid\">\n <ngx-decaf-layout\n [className]=\"''\"\n [pk]=\"pk\"\n [modelId]=\"modelId\"\n [children]=\"children || []\"\n [operation]=\"operation\"\n [cardType]=\"cardType ?? 'blank'\"\n [modelId]=\"modelId\"\n [match]=\"match ?? false\"\n [gap]=\"'small'\"\n (listenEvent)=\"handleEvent($event)\"\n [flexMode]=\"props.flexMode || false\"\n [rows]=\"rows\"\n [borders]=\"borders ?? false\"\n [breakpoint]=\"breakpoint ?? 'large'\"\n [cols]=\"cols\"\n />\n </section>\n\n <section\n [class]=\"'dcf-buttons-grid dcf-grid dcf-grid-small dcf-flex dcf-flex-left ' + operation\"\n [id]=\"uid\"\n >\n @if ([OperationKeys.READ, OperationKeys.DELETE].includes(operation) && modelId) {\n <div>\n <ion-button (click)=\"handleDelete()\" color=\"danger\" type=\"button\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ locale + '.delete' | translate }}\n </ion-button>\n </div>\n }\n @if (operation === OperationKeys.CREATE || operation === OperationKeys.UPDATE) {\n <div>\n <ion-button type=\"submit\">\n @if (options.buttons.submit.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.submit.iconSlot\"\n [name]=\"options.buttons.submit.icon\"\n ></ion-icon>\n }\n {{ action ? action : (locale + '.' + options.buttons.submit.text | translate) }}\n </ion-button>\n </div>\n }\n <div>\n <ion-button fill=\"clear\" (click)=\"handleReset()\">\n @if (options.buttons.clear?.icon) {\n <ion-icon\n aria-hidden=\"true\"\n [slot]=\"options.buttons.clear?.iconSlot\"\n [name]=\"options.buttons.clear?.icon\"\n ></ion-icon>\n }\n {{\n [OperationKeys.DELETE, OperationKeys.READ, OperationKeys.UPDATE].includes(operation)\n ? (locale + '.back' | translate)\n : options.buttons.clear?.text\n }}\n </ion-button>\n </div>\n </section>\n}\n", styles: [".dcf-buttons-grid{margin-top:var(--dcf-margin-medium);margin-bottom:var(--dcf-margin)}@media (min-width: 577px){.dcf-buttons-grid.dcf-flex.read,.dcf-buttons-grid.dcf-flex.delete{flex-direction:row-reverse}}@media (max-width: 576px){.dcf-buttons-grid.dcf-flex{flex-direction:column-reverse}.dcf-buttons-grid.dcf-flex>div{width:100%}.dcf-buttons-grid.dcf-flex>div+div{margin-top:1rem}.dcf-buttons-grid.dcf-flex ion-button{width:100%}}.dcf-form-grid.create,.dcf-form-grid.update{margin-top:var(--dcf-margin-small)}.dcf-form-grid .dcf-form-item{margin-top:0!important}.dcf-form-grid.read .dcf-form-item{margin-bottom:var(--dcf-margin-small)}\n"] }]
|
|
8282
8315
|
}], ctorParameters: () => [] });
|
|
8283
8316
|
|
|
8284
8317
|
/**
|
|
@@ -11329,7 +11362,7 @@ let ListComponent = class ListComponent extends NgxComponentDirective {
|
|
|
11329
11362
|
const repo = this._repository;
|
|
11330
11363
|
//TODO: fix check observerHandler
|
|
11331
11364
|
const observeHandler = repo['observerHandler'];
|
|
11332
|
-
if (observeHandler) {
|
|
11365
|
+
if (observeHandler && observeHandler?.observers?.length) {
|
|
11333
11366
|
try {
|
|
11334
11367
|
repo.unObserve(this.repositoryObserver);
|
|
11335
11368
|
}
|
|
@@ -11522,21 +11555,21 @@ let ListComponent = class ListComponent extends NgxComponentDirective {
|
|
|
11522
11555
|
* @memberOf ListComponent
|
|
11523
11556
|
*/
|
|
11524
11557
|
async handleUpdate(uid) {
|
|
11525
|
-
const item =
|
|
11558
|
+
const item = await this._repository?.read(uid);
|
|
11559
|
+
// const item: KeyValue = this.itemMapper((await this._repository?.read(uid)) || {}, this.mapper);
|
|
11526
11560
|
this.data = [];
|
|
11527
11561
|
this.changeDetectorRef.detectChanges();
|
|
11528
11562
|
for (const key in this.items) {
|
|
11529
11563
|
const child = this.items[key];
|
|
11530
11564
|
if (`${child['uid']}`.trim() === `${uid}`.trim()) {
|
|
11531
|
-
this.items[key] = Object.assign({}, child, item)
|
|
11565
|
+
this.items[key] = Object.assign({}, child, this.itemMapper(item || {}, this.mapper), {
|
|
11566
|
+
model: item || {},
|
|
11567
|
+
});
|
|
11532
11568
|
break;
|
|
11533
11569
|
}
|
|
11534
11570
|
}
|
|
11535
|
-
|
|
11536
|
-
|
|
11537
|
-
this.changeDetectorRef.detectChanges();
|
|
11538
|
-
updateSubsriber$.unsubscribe();
|
|
11539
|
-
});
|
|
11571
|
+
this.data = [...this.items];
|
|
11572
|
+
this.changeDetectorRef.detectChanges();
|
|
11540
11573
|
}
|
|
11541
11574
|
/**
|
|
11542
11575
|
* @description Removes an item from the list by ID.
|
|
@@ -11812,13 +11845,15 @@ let ListComponent = class ListComponent extends NgxComponentDirective {
|
|
|
11812
11845
|
if (!this._repository) {
|
|
11813
11846
|
this._repository = this.repository;
|
|
11814
11847
|
}
|
|
11815
|
-
if (!this.repositoryObserver) {
|
|
11816
|
-
|
|
11817
|
-
|
|
11818
|
-
|
|
11819
|
-
}
|
|
11848
|
+
// if (!this.repositoryObserver) {
|
|
11849
|
+
// this.repositoryObserver = {
|
|
11850
|
+
// refresh: async (...args) => this.handleRepositoryRefresh(...args),
|
|
11851
|
+
// };
|
|
11852
|
+
// }
|
|
11820
11853
|
try {
|
|
11821
|
-
this._repository
|
|
11854
|
+
const observerHandler = this._repository['observerHandler'];
|
|
11855
|
+
if (!observerHandler)
|
|
11856
|
+
this._repository.observe(this.repositoryObserver);
|
|
11822
11857
|
}
|
|
11823
11858
|
catch (error) {
|
|
11824
11859
|
this.log.info(error?.message);
|
|
@@ -13606,8 +13641,12 @@ class NgxRouterService {
|
|
|
13606
13641
|
* @memberOf RouterService
|
|
13607
13642
|
*/
|
|
13608
13643
|
parseAllQueryParams(params) {
|
|
13609
|
-
if (
|
|
13644
|
+
if (!params) {
|
|
13645
|
+
params = Object.keys(this.route.snapshot.queryParams);
|
|
13646
|
+
}
|
|
13647
|
+
if (typeof params === Primitives.STRING) {
|
|
13610
13648
|
params = [params];
|
|
13649
|
+
}
|
|
13611
13650
|
return params.reduce((acc, param) => {
|
|
13612
13651
|
const item = {
|
|
13613
13652
|
[param]: this.route.snapshot.queryParamMap.get(param) || null,
|
|
@@ -13947,63 +13986,75 @@ let TableComponent = class TableComponent extends ListComponent {
|
|
|
13947
13986
|
}
|
|
13948
13987
|
async itemMapper(item, mapper, props = {}) {
|
|
13949
13988
|
this.model = item;
|
|
13950
|
-
const mapped =
|
|
13989
|
+
const mapped = super.itemMapper(item, this.cols.filter((c) => c !== 'actions'), props);
|
|
13951
13990
|
const { children } = this.props || [];
|
|
13952
13991
|
const entries = Object.entries(mapped);
|
|
13953
|
-
|
|
13954
|
-
|
|
13955
|
-
|
|
13956
|
-
|
|
13957
|
-
|
|
13958
|
-
|
|
13959
|
-
|
|
13960
|
-
|
|
13961
|
-
|
|
13962
|
-
const
|
|
13963
|
-
|
|
13964
|
-
if (
|
|
13965
|
-
|
|
13992
|
+
for (const [curr, value] of entries) {
|
|
13993
|
+
const getEvents = async (index, name) => {
|
|
13994
|
+
try {
|
|
13995
|
+
const child = children.find((c) => c?.['props']?.name === name);
|
|
13996
|
+
if (child) {
|
|
13997
|
+
const { events, name } = child?.['props'] || {};
|
|
13998
|
+
if (events) {
|
|
13999
|
+
const sequence = String(index);
|
|
14000
|
+
const evts = this.parseEvents(events, this);
|
|
14001
|
+
for (const [key, evt] of Object.entries(evts)) {
|
|
14002
|
+
const handler = evt;
|
|
14003
|
+
if (key === ComponentEventNames.Render) {
|
|
14004
|
+
if (handler?.name === ComponentEventNames.Render) {
|
|
14005
|
+
mapped[sequence] = {
|
|
14006
|
+
...mapped[sequence],
|
|
14007
|
+
value: await handler.bind(this)(this, name, value),
|
|
14008
|
+
};
|
|
14009
|
+
}
|
|
14010
|
+
else {
|
|
14011
|
+
const handlerFn = await handler(this, name, value);
|
|
14012
|
+
mapped[sequence] = {
|
|
14013
|
+
...mapped[sequence],
|
|
14014
|
+
value: name + ' ' + typeof handlerFn === 'function' || handlerFn instanceof Promise
|
|
14015
|
+
? await handlerFn.bind(this)(this, name, value)
|
|
14016
|
+
: handlerFn,
|
|
14017
|
+
};
|
|
14018
|
+
}
|
|
13966
14019
|
}
|
|
13967
|
-
|
|
13968
|
-
|
|
13969
|
-
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
:
|
|
14020
|
+
if (key === 'handleClick' || key === 'handleAction') {
|
|
14021
|
+
mapped[sequence] = {
|
|
14022
|
+
...mapped[sequence],
|
|
14023
|
+
handler: {
|
|
14024
|
+
index: Number(sequence),
|
|
14025
|
+
handle: handler.bind(this),
|
|
14026
|
+
},
|
|
14027
|
+
};
|
|
13973
14028
|
}
|
|
13974
14029
|
}
|
|
13975
|
-
if (key === 'handleClick' || key === 'handleAction') {
|
|
13976
|
-
props = {
|
|
13977
|
-
...props,
|
|
13978
|
-
handler: {
|
|
13979
|
-
col: String(sequence),
|
|
13980
|
-
handle: handler.bind(this),
|
|
13981
|
-
},
|
|
13982
|
-
};
|
|
13983
|
-
}
|
|
13984
14030
|
}
|
|
13985
14031
|
}
|
|
14032
|
+
return value;
|
|
13986
14033
|
}
|
|
13987
|
-
|
|
13988
|
-
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
|
|
13992
|
-
}
|
|
13993
|
-
const
|
|
13994
|
-
const
|
|
13995
|
-
const
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
14000
|
-
|
|
14034
|
+
catch (error) {
|
|
14035
|
+
this.log
|
|
14036
|
+
.for(this.itemMapper)
|
|
14037
|
+
.error(`Error mapping child events. ${error?.message || error}`);
|
|
14038
|
+
}
|
|
14039
|
+
};
|
|
14040
|
+
const name = this.cols[Number(curr)];
|
|
14041
|
+
const index = Number(curr);
|
|
14042
|
+
const parserFn = mapper[name]?.valueParserFn || undefined;
|
|
14043
|
+
const resolvedValue = parserFn ? await parserFn(this, name, value) : value;
|
|
14044
|
+
mapped[curr] = {
|
|
14045
|
+
prop: name ?? this.pk,
|
|
14046
|
+
value: resolvedValue,
|
|
14047
|
+
index: index || 0,
|
|
14048
|
+
};
|
|
14049
|
+
await getEvents(index, name);
|
|
14050
|
+
}
|
|
14051
|
+
return mapped;
|
|
14001
14052
|
}
|
|
14002
14053
|
async mapResults(data) {
|
|
14003
14054
|
this._data = [...data];
|
|
14004
14055
|
if (!data || !data.length)
|
|
14005
14056
|
return [];
|
|
14006
|
-
return await Promise.all(data.map((curr) => this.itemMapper(curr, this.mapper, { uid: curr[this.pk] })));
|
|
14057
|
+
return await Promise.all(data.map(async (curr) => await this.itemMapper(curr, this.mapper, { uid: curr[this.pk] })));
|
|
14007
14058
|
}
|
|
14008
14059
|
async handleAction(event, handler, uid, action) {
|
|
14009
14060
|
if (handler) {
|
|
@@ -14053,7 +14104,7 @@ let TableComponent = class TableComponent extends ListComponent {
|
|
|
14053
14104
|
}
|
|
14054
14105
|
}
|
|
14055
14106
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
14056
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: TableComponent, isStandalone: true, selector: "ngx-decaf-table", inputs: { filterModel: "filterModel", filterOptions: "filterOptions", filterLabel: "filterLabel", filterOptionsMapper: "filterOptionsMapper", allowOperations: "allowOperations" }, usesInheritance: true, ngImport: i0, template: "@if (showSearchbar && (data?.length || searching)) {\n <div class=\"dcf-grid-actions\">\n <div class=\"dcf-grid dcf-grid-small\">\n <div class=\"dcf-width-expand@s\">\n <ngx-decaf-searchbar\n [emitEventToWindow]=\"false\"\n [debounce]=\"500\"\n (searchEvent)=\"handleSearch($event)\"\n />\n </div>\n @if (filterOptions?.length) {\n <div\n class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\"\n >\n <ion-select\n [id]=\"name\"\n toggleIcon=\"chevron-down-outline\"\n expandedIcon=\"chevron-up-outline\"\n [mode]=\"'md'\"\n fill=\"outline\"\n [value]=\"filterValue ?? ''\"\n [labelPlacement]=\"'floating'\"\n [label]=\"locale + '.filter.label' | translate\"\n (click)=\"openFilterSelectOptions($event)\"\n [placeholder]=\"locale + '.filter.label' | translate\"\n interface=\"popover\"\n >\n <ion-select-option value=\"\">{{ locale + '.filter.all' | translate }}</ion-select-option>\n @for (option of filterOptions; track $index) {\n <ion-select-option value=\"{{ option.value }}\">{{ option.text }}</ion-select-option>\n }\n <ion-button\n fill=\"clear\"\n (click)=\"handleFilterSelectClear($event)\"\n slot=\"end\"\n size=\"small\"\n [disabled]=\"!filterValue\"\n >\n <ngx-decaf-icon fill=\"clear\" slot=\"icon-only\" [name]=\"'ti-input-x'\" />\n </ion-button>\n </ion-select>\n </div>\n }\n </div>\n </div>\n}\n<div class=\"dcf-table-container\" [class.dcf-empty]=\"!data?.length\">\n @if (initialized && data?.length) {\n <table class=\"dcf-table\">\n <thead>\n <tr>\n @for (header of headers; track $index) {\n <th>{{ locale + '.' + header + '.label' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (item of items; track trackItemFn($index, item)) {\n <tr>\n @for (col of item | keyvalue; track $index) {\n @if (!['handler', 'actions', 'uid'].includes(col.key)) {\n <td\n (click)=\"\n handleAction(\n $event,\n
|
|
14107
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: TableComponent, isStandalone: true, selector: "ngx-decaf-table", inputs: { filterModel: "filterModel", filterOptions: "filterOptions", filterLabel: "filterLabel", filterOptionsMapper: "filterOptionsMapper", allowOperations: "allowOperations" }, usesInheritance: true, ngImport: i0, template: "@if (showSearchbar && (data?.length || searching)) {\n <div class=\"dcf-grid-actions\">\n <div class=\"dcf-grid dcf-grid-small\">\n <div class=\"dcf-width-expand@s\">\n <ngx-decaf-searchbar\n [emitEventToWindow]=\"false\"\n [debounce]=\"500\"\n (searchEvent)=\"handleSearch($event)\"\n />\n </div>\n @if (filterOptions?.length) {\n <div\n class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\"\n >\n <ion-select\n [id]=\"name\"\n toggleIcon=\"chevron-down-outline\"\n expandedIcon=\"chevron-up-outline\"\n [mode]=\"'md'\"\n fill=\"outline\"\n [value]=\"filterValue ?? ''\"\n [labelPlacement]=\"'floating'\"\n [label]=\"locale + '.filter.label' | translate\"\n (click)=\"openFilterSelectOptions($event)\"\n [placeholder]=\"locale + '.filter.label' | translate\"\n interface=\"popover\"\n >\n <ion-select-option value=\"\">{{ locale + '.filter.all' | translate }}</ion-select-option>\n @for (option of filterOptions; track $index) {\n <ion-select-option value=\"{{ option.value }}\">{{ option.text }}</ion-select-option>\n }\n <ion-button\n fill=\"clear\"\n (click)=\"handleFilterSelectClear($event)\"\n slot=\"end\"\n size=\"small\"\n [disabled]=\"!filterValue\"\n >\n <ngx-decaf-icon fill=\"clear\" slot=\"icon-only\" [name]=\"'ti-input-x'\" />\n </ion-button>\n </ion-select>\n </div>\n }\n </div>\n </div>\n}\n<div class=\"dcf-table-container\" [class.dcf-empty]=\"!data?.length\">\n @if (initialized && data?.length) {\n <table class=\"dcf-table\">\n <thead>\n <tr>\n @for (header of headers; track $index) {\n <th>{{ locale + '.' + header + '.label' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (item of items; track trackItemFn($index, item)) {\n <tr>\n @for (col of item | keyvalue; track $index) {\n @if (!['handler', 'actions', 'uid'].includes(col.key)) {\n <td\n (click)=\"\n handleAction(\n $event,\n col?.value.handler ? col.value.handler.handle : undefined,\n item.uid.value,\n OperationKeys.READ\n )\n \"\n [innerHTML]=\"col.value.value\"\n ></td>\n } @else {\n @if (allowOperations && col.key !== 'handler') {\n <td class=\"dcf-col-actions\">\n <div class=\"\">\n @if (operations?.includes(OperationKeys.UPDATE)) {\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"\n handleRedirect($event, item.uid.value, OperationKeys.UPDATE, true)\n \"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"primary\"\n name=\"ti-edit\"\n />\n }\n @if (operations?.includes(OperationKeys.DELETE)) {\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"\n handleRedirect($event, item.uid.value, OperationKeys.DELETE, true)\n \"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"danger\"\n name=\"ti-trash\"\n />\n }\n </div>\n </td>\n }\n }\n }\n </tr>\n }\n </tbody>\n </table>\n } @else {\n @if (!searching) {\n <ngx-decaf-empty-state\n [title]=\"'component.list.empty.title' | translate\"\n [subtitle]=\"'component.list.empty.subtitle' | translate\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [buttonLink]=\"empty?.link ?? undefined\"\n [borders]=\"borders\"\n [icon]=\"(item?.icon ?? 'folder-open-outline') || empty.icon\"\n className=\"dcf-empty-data\"\n />\n } @else {\n <ngx-decaf-empty-state\n icon=\"search-outline\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [borders]=\"borders\"\n [operations]=\"operations\"\n [body]=\"'small'\"\n [translatable]=\"true\"\n [title]=\"'component.list.search.title' | translate\"\n [subtitle]=\"'component.list.search.subtitle' | translate: { '0': parseSearchValue() }\"\n [searchValue]=\"searchValue\"\n />\n }\n }\n</div>\n@if (loadMoreData && !refreshing) {\n <div class=\"dcf-table-pagination\">\n @if (pages > 0 && !searchValue?.length) {\n <ngx-decaf-pagination\n [totalPages]=\"pages\"\n [current]=\"page\"\n (clickEvent)=\"handlePaginate($event)\"\n />\n }\n </div>\n}\n", styles: [".dcf-table-container{display:block;overflow-x:auto!important;box-sizing:border-box;overflow-y:hidden;scrollbar-width:thin;border-radius:var(--dcf-border-radius-small);box-shadow:var(--dcf-box-shadow-small)!important;background-color:var(--dcf-card-background);border:1px solid var(--dcf-color-gray-2)}.dcf-table-container::-webkit-scrollbar{width:5px}.dcf-table-container table{min-width:680px}.dcf-table{width:100%;border-collapse:collapse;border-radius:var(--dcf-border-radius-xsmall);overflow:hidden;background:var(--dcf-card-background);color:var(--dcf-text-color);font-size:.8rem}.dcf-table thead{background:rgba(var(--dcf-color-primary-rgb),.075);text-transform:uppercase;color:var(--dcf-color-dark);letter-spacing:.06em;font-size:.825rem;white-space:nowrap;width:auto}.dcf-table thead th{text-align:left;padding:.875rem 1rem;font-weight:600;max-width:max-content}.dcf-table tbody tr{transition:background .12s ease,box-shadow .12s ease}.dcf-table tbody tr:hover{background:rgba(var(--dcf-color-primary-rgb),.05);cursor:pointer}.dcf-table tbody tr:not(:last-child){border-bottom:1px solid var(--dcf-color-gray-2)}.dcf-table tbody td{padding:1rem 1.125rem;font-size:.875rem}.dcf-table tbody td:first-child{font-weight:600}.dcf-table tbody td.dcf-col-actions{padding-top:0!important;padding-bottom:0!important}.dcf-table tfoot{font-size:.85rem}.dcf-table tfoot td{padding:.875rem 1.125rem;border-top:1px solid 1px solid var(--dcf-color-gray-2)}.dcf-select-filter-container{min-width:200px}.dcf-buttons-grid{margin-top:var(--dcf-margin-medium);margin-bottom:var(--dcf-margin)}@media (max-width: 480px){.dcf-buttons-grid{flex-direction:row-reverse!important}.dcf-buttons-grid>div{width:100%}.dcf-buttons-grid>div+div{margin-top:1rem}.dcf-buttons-grid ion-button{width:100%}}ion-select{margin-top:.5rem;max-height:40px!important}ion-select ion-button{transform:scale(.75)!important;margin:0!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IonSelect, selector: "ion-select", inputs: ["cancelText", "color", "compareWith", "disabled", "errorText", "expandedIcon", "fill", "helperText", "interface", "interfaceOptions", "justify", "label", "labelPlacement", "mode", "multiple", "name", "okText", "placeholder", "selectedText", "shape", "toggleIcon", "value"] }, { kind: "component", type: IonSelectOption, selector: "ion-select-option", inputs: ["disabled", "value"] }, { kind: "component", type: SearchbarComponent, selector: "ngx-decaf-searchbar", inputs: ["autocomplete", "autocorrect", "animated", "buttonCancelText", "clearIcon", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "placeholder", "searchIcon", "showCancelButton", "showClearButton", "spellcheck", "type", "value", "queryKeys", "isVisible", "wrapper", "wrapperColor", "emitEventToWindow"], outputs: ["searchEvent"] }, { kind: "component", type: EmptyStateComponent, selector: "ngx-decaf-empty-state", inputs: ["title", "titleColor", "subtitle", "subtitleColor", "showIcon", "icon", "iconSize", "iconColor", "buttonLink", "buttonText", "buttonFill", "buttonColor", "buttonSize", "searchValue"] }, { kind: "component", type: IconComponent, selector: "ngx-decaf-icon", inputs: ["name", "color", "slot", "button", "buttonFill", "buttonShape", "width", "size", "inline"] }, { kind: "component", type: PaginationComponent, selector: "ngx-decaf-pagination", inputs: ["totalPages", "current"], outputs: ["clickEvent"] }, { kind: "pipe", type: i1$1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
14057
14108
|
};
|
|
14058
14109
|
TableComponent = __decorate([
|
|
14059
14110
|
Dynamic()
|
|
@@ -14069,7 +14120,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
14069
14120
|
EmptyStateComponent,
|
|
14070
14121
|
IconComponent,
|
|
14071
14122
|
PaginationComponent,
|
|
14072
|
-
], template: "@if (showSearchbar && (data?.length || searching)) {\n <div class=\"dcf-grid-actions\">\n <div class=\"dcf-grid dcf-grid-small\">\n <div class=\"dcf-width-expand@s\">\n <ngx-decaf-searchbar\n [emitEventToWindow]=\"false\"\n [debounce]=\"500\"\n (searchEvent)=\"handleSearch($event)\"\n />\n </div>\n @if (filterOptions?.length) {\n <div\n class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\"\n >\n <ion-select\n [id]=\"name\"\n toggleIcon=\"chevron-down-outline\"\n expandedIcon=\"chevron-up-outline\"\n [mode]=\"'md'\"\n fill=\"outline\"\n [value]=\"filterValue ?? ''\"\n [labelPlacement]=\"'floating'\"\n [label]=\"locale + '.filter.label' | translate\"\n (click)=\"openFilterSelectOptions($event)\"\n [placeholder]=\"locale + '.filter.label' | translate\"\n interface=\"popover\"\n >\n <ion-select-option value=\"\">{{ locale + '.filter.all' | translate }}</ion-select-option>\n @for (option of filterOptions; track $index) {\n <ion-select-option value=\"{{ option.value }}\">{{ option.text }}</ion-select-option>\n }\n <ion-button\n fill=\"clear\"\n (click)=\"handleFilterSelectClear($event)\"\n slot=\"end\"\n size=\"small\"\n [disabled]=\"!filterValue\"\n >\n <ngx-decaf-icon fill=\"clear\" slot=\"icon-only\" [name]=\"'ti-input-x'\" />\n </ion-button>\n </ion-select>\n </div>\n }\n </div>\n </div>\n}\n<div class=\"dcf-table-container\" [class.dcf-empty]=\"!data?.length\">\n @if (initialized && data?.length) {\n <table class=\"dcf-table\">\n <thead>\n <tr>\n @for (header of headers; track $index) {\n <th>{{ locale + '.' + header + '.label' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (item of items; track trackItemFn($index, item)) {\n <tr>\n @for (col of item | keyvalue; track $index) {\n @if (!['handler', 'actions', 'uid'].includes(col.key)) {\n <td\n (click)=\"\n handleAction(\n $event,\n
|
|
14123
|
+
], template: "@if (showSearchbar && (data?.length || searching)) {\n <div class=\"dcf-grid-actions\">\n <div class=\"dcf-grid dcf-grid-small\">\n <div class=\"dcf-width-expand@s\">\n <ngx-decaf-searchbar\n [emitEventToWindow]=\"false\"\n [debounce]=\"500\"\n (searchEvent)=\"handleSearch($event)\"\n />\n </div>\n @if (filterOptions?.length) {\n <div\n class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\"\n >\n <ion-select\n [id]=\"name\"\n toggleIcon=\"chevron-down-outline\"\n expandedIcon=\"chevron-up-outline\"\n [mode]=\"'md'\"\n fill=\"outline\"\n [value]=\"filterValue ?? ''\"\n [labelPlacement]=\"'floating'\"\n [label]=\"locale + '.filter.label' | translate\"\n (click)=\"openFilterSelectOptions($event)\"\n [placeholder]=\"locale + '.filter.label' | translate\"\n interface=\"popover\"\n >\n <ion-select-option value=\"\">{{ locale + '.filter.all' | translate }}</ion-select-option>\n @for (option of filterOptions; track $index) {\n <ion-select-option value=\"{{ option.value }}\">{{ option.text }}</ion-select-option>\n }\n <ion-button\n fill=\"clear\"\n (click)=\"handleFilterSelectClear($event)\"\n slot=\"end\"\n size=\"small\"\n [disabled]=\"!filterValue\"\n >\n <ngx-decaf-icon fill=\"clear\" slot=\"icon-only\" [name]=\"'ti-input-x'\" />\n </ion-button>\n </ion-select>\n </div>\n }\n </div>\n </div>\n}\n<div class=\"dcf-table-container\" [class.dcf-empty]=\"!data?.length\">\n @if (initialized && data?.length) {\n <table class=\"dcf-table\">\n <thead>\n <tr>\n @for (header of headers; track $index) {\n <th>{{ locale + '.' + header + '.label' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (item of items; track trackItemFn($index, item)) {\n <tr>\n @for (col of item | keyvalue; track $index) {\n @if (!['handler', 'actions', 'uid'].includes(col.key)) {\n <td\n (click)=\"\n handleAction(\n $event,\n col?.value.handler ? col.value.handler.handle : undefined,\n item.uid.value,\n OperationKeys.READ\n )\n \"\n [innerHTML]=\"col.value.value\"\n ></td>\n } @else {\n @if (allowOperations && col.key !== 'handler') {\n <td class=\"dcf-col-actions\">\n <div class=\"\">\n @if (operations?.includes(OperationKeys.UPDATE)) {\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"\n handleRedirect($event, item.uid.value, OperationKeys.UPDATE, true)\n \"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"primary\"\n name=\"ti-edit\"\n />\n }\n @if (operations?.includes(OperationKeys.DELETE)) {\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"\n handleRedirect($event, item.uid.value, OperationKeys.DELETE, true)\n \"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"danger\"\n name=\"ti-trash\"\n />\n }\n </div>\n </td>\n }\n }\n }\n </tr>\n }\n </tbody>\n </table>\n } @else {\n @if (!searching) {\n <ngx-decaf-empty-state\n [title]=\"'component.list.empty.title' | translate\"\n [subtitle]=\"'component.list.empty.subtitle' | translate\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [buttonLink]=\"empty?.link ?? undefined\"\n [borders]=\"borders\"\n [icon]=\"(item?.icon ?? 'folder-open-outline') || empty.icon\"\n className=\"dcf-empty-data\"\n />\n } @else {\n <ngx-decaf-empty-state\n icon=\"search-outline\"\n [model]=\"empty?.showButton ? model : undefined\"\n [route]=\"route\"\n [modelId]=\"modelId\"\n [borders]=\"borders\"\n [operations]=\"operations\"\n [body]=\"'small'\"\n [translatable]=\"true\"\n [title]=\"'component.list.search.title' | translate\"\n [subtitle]=\"'component.list.search.subtitle' | translate: { '0': parseSearchValue() }\"\n [searchValue]=\"searchValue\"\n />\n }\n }\n</div>\n@if (loadMoreData && !refreshing) {\n <div class=\"dcf-table-pagination\">\n @if (pages > 0 && !searchValue?.length) {\n <ngx-decaf-pagination\n [totalPages]=\"pages\"\n [current]=\"page\"\n (clickEvent)=\"handlePaginate($event)\"\n />\n }\n </div>\n}\n", styles: [".dcf-table-container{display:block;overflow-x:auto!important;box-sizing:border-box;overflow-y:hidden;scrollbar-width:thin;border-radius:var(--dcf-border-radius-small);box-shadow:var(--dcf-box-shadow-small)!important;background-color:var(--dcf-card-background);border:1px solid var(--dcf-color-gray-2)}.dcf-table-container::-webkit-scrollbar{width:5px}.dcf-table-container table{min-width:680px}.dcf-table{width:100%;border-collapse:collapse;border-radius:var(--dcf-border-radius-xsmall);overflow:hidden;background:var(--dcf-card-background);color:var(--dcf-text-color);font-size:.8rem}.dcf-table thead{background:rgba(var(--dcf-color-primary-rgb),.075);text-transform:uppercase;color:var(--dcf-color-dark);letter-spacing:.06em;font-size:.825rem;white-space:nowrap;width:auto}.dcf-table thead th{text-align:left;padding:.875rem 1rem;font-weight:600;max-width:max-content}.dcf-table tbody tr{transition:background .12s ease,box-shadow .12s ease}.dcf-table tbody tr:hover{background:rgba(var(--dcf-color-primary-rgb),.05);cursor:pointer}.dcf-table tbody tr:not(:last-child){border-bottom:1px solid var(--dcf-color-gray-2)}.dcf-table tbody td{padding:1rem 1.125rem;font-size:.875rem}.dcf-table tbody td:first-child{font-weight:600}.dcf-table tbody td.dcf-col-actions{padding-top:0!important;padding-bottom:0!important}.dcf-table tfoot{font-size:.85rem}.dcf-table tfoot td{padding:.875rem 1.125rem;border-top:1px solid 1px solid var(--dcf-color-gray-2)}.dcf-select-filter-container{min-width:200px}.dcf-buttons-grid{margin-top:var(--dcf-margin-medium);margin-bottom:var(--dcf-margin)}@media (max-width: 480px){.dcf-buttons-grid{flex-direction:row-reverse!important}.dcf-buttons-grid>div{width:100%}.dcf-buttons-grid>div+div{margin-top:1rem}.dcf-buttons-grid ion-button{width:100%}}ion-select{margin-top:.5rem;max-height:40px!important}ion-select ion-button{transform:scale(.75)!important;margin:0!important}\n"] }]
|
|
14073
14124
|
}], propDecorators: { filterModel: [{
|
|
14074
14125
|
type: Input
|
|
14075
14126
|
}], filterOptions: [{
|