@decaf-ts/for-angular 0.0.66 → 0.0.68
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/assets/i18n/en.json
CHANGED
package/assets/i18n/ew/en.json
CHANGED
|
@@ -24,8 +24,6 @@ import * as allIcons from 'ionicons/icons';
|
|
|
24
24
|
import { chevronUpOutline, chevronDownOutline, createOutline, trashOutline, addOutline, alertCircleOutline, arrowUpOutline, arrowDownOutline, searchOutline, closeOutline, chevronForwardOutline, chevronBackOutline, arrowBackOutline, arrowForwardOutline } from 'ionicons/icons';
|
|
25
25
|
import { modalController } from '@ionic/core';
|
|
26
26
|
import { DomSanitizer, Title } from '@angular/platform-browser';
|
|
27
|
-
import { ListComponentsTypes as ListComponentsTypes$1, SelectFieldInterfaces as SelectFieldInterfaces$1, ActionRoles as ActionRoles$1, Dynamic as Dynamic$1 } from 'src/lib/engine';
|
|
28
|
-
import { isValidDate as isValidDate$2, formatDate as formatDate$1 } from 'src/lib/utils/helpers';
|
|
29
27
|
import { MenuController } from '@ionic/angular';
|
|
30
28
|
|
|
31
29
|
/**
|
|
@@ -2940,18 +2938,22 @@ var errors = {
|
|
|
2940
2938
|
};
|
|
2941
2939
|
var operations = {
|
|
2942
2940
|
read: {
|
|
2941
|
+
title: "Read",
|
|
2943
2942
|
success: "Successfully read item with {0} {1}.",
|
|
2944
2943
|
error: "Error reading item with {0} {1}."
|
|
2945
2944
|
},
|
|
2946
2945
|
create: {
|
|
2946
|
+
title: "Create",
|
|
2947
2947
|
success: "Successfully created item.",
|
|
2948
2948
|
error: "Error creating item."
|
|
2949
2949
|
},
|
|
2950
2950
|
update: {
|
|
2951
|
+
title: "Update",
|
|
2951
2952
|
success: "Successfully updated item with {0} {1}.",
|
|
2952
2953
|
error: "Error updating item with {0} {1}."
|
|
2953
2954
|
},
|
|
2954
2955
|
"delete": {
|
|
2956
|
+
title: "Delete",
|
|
2955
2957
|
success: "Successfully deleted item with {0} {1}.",
|
|
2956
2958
|
error: "Error deleting item with {0} {1}."
|
|
2957
2959
|
},
|
|
@@ -3230,7 +3232,7 @@ class I18nParser extends TranslateParser {
|
|
|
3230
3232
|
if (typeof params === Primitives.STRING) {
|
|
3231
3233
|
params = { '0': params };
|
|
3232
3234
|
}
|
|
3233
|
-
return sf(value, ...Object.values(params));
|
|
3235
|
+
return sf(value, ...Object.values(params)).replace(/undefined/g, "");
|
|
3234
3236
|
}
|
|
3235
3237
|
}
|
|
3236
3238
|
/**
|
|
@@ -5169,37 +5171,6 @@ function Dynamic() {
|
|
|
5169
5171
|
NgxRenderingEngine.registerComponent(metadata.selector, original);
|
|
5170
5172
|
}, metadata(Metadata.key(AngularEngineKeys.REFLECT, AngularEngineKeys.DYNAMIC), true));
|
|
5171
5173
|
}
|
|
5172
|
-
// export interface UICustomEvents {
|
|
5173
|
-
// render: () => HandlerLike;
|
|
5174
|
-
// init: () => FunctionLike;
|
|
5175
|
-
// }
|
|
5176
|
-
// export function uion(event: string, handler: FunctionLike) {
|
|
5177
|
-
// return (target: any, propertyKey?: any) => {
|
|
5178
|
-
// const metadata = {
|
|
5179
|
-
// [event]: handler,
|
|
5180
|
-
// };
|
|
5181
|
-
// propMetadata(getUIAttributeKey(propertyKey, 'handlers'), metadata)(
|
|
5182
|
-
// target,
|
|
5183
|
-
// propertyKey
|
|
5184
|
-
// );
|
|
5185
|
-
// };
|
|
5186
|
-
// // return (model: unknown, property: unknown) => {
|
|
5187
|
-
// // const meta: UIHandlerMetadata = {
|
|
5188
|
-
// // [event]: handler,
|
|
5189
|
-
// // };
|
|
5190
|
-
// // return metadata(
|
|
5191
|
-
// // getUIAttributeKey(property as string, 'on'),
|
|
5192
|
-
// // meta
|
|
5193
|
-
// // )(model, property);
|
|
5194
|
-
// // };
|
|
5195
|
-
// }
|
|
5196
|
-
// export function uionrender(handler: FunctionLike) {
|
|
5197
|
-
// return uion("render", handler);
|
|
5198
|
-
// }
|
|
5199
|
-
// @uion(op, handler)
|
|
5200
|
-
// @uionrender(handler){
|
|
5201
|
-
// return uion("redenr", handler)
|
|
5202
|
-
// }
|
|
5203
5174
|
|
|
5204
5175
|
/**
|
|
5205
5176
|
* @module module:lib/components/model-renderer/model-renderer.component
|
|
@@ -12623,7 +12594,7 @@ let TableComponent = class TableComponent extends ListComponent {
|
|
|
12623
12594
|
.map(([key]) => key);
|
|
12624
12595
|
}
|
|
12625
12596
|
async ngOnInit() {
|
|
12626
|
-
this.type = ListComponentsTypes
|
|
12597
|
+
this.type = ListComponentsTypes.PAGINATED;
|
|
12627
12598
|
this.cols = this._cols;
|
|
12628
12599
|
this.allowOperations = this.isAllowed(OperationKeys.UPDATE) || this.isAllowed(OperationKeys.DELETE);
|
|
12629
12600
|
this.searchValue = undefined;
|
|
@@ -12646,53 +12617,59 @@ let TableComponent = class TableComponent extends ListComponent {
|
|
|
12646
12617
|
}
|
|
12647
12618
|
};
|
|
12648
12619
|
}
|
|
12620
|
+
if (this.filterModel)
|
|
12621
|
+
await this.getFilterOptions();
|
|
12649
12622
|
await this.refresh();
|
|
12650
12623
|
}
|
|
12651
|
-
|
|
12652
|
-
const
|
|
12653
|
-
|
|
12654
|
-
|
|
12655
|
-
|
|
12656
|
-
|
|
12657
|
-
|
|
12658
|
-
|
|
12659
|
-
|
|
12660
|
-
|
|
12661
|
-
|
|
12662
|
-
}
|
|
12663
|
-
acc[curr] = value;
|
|
12624
|
+
async getFilterOptions() {
|
|
12625
|
+
const repo = getModelAndRepository(this.filterModel);
|
|
12626
|
+
if (repo) {
|
|
12627
|
+
const { repository, pk } = repo;
|
|
12628
|
+
if (!this.filterBy)
|
|
12629
|
+
this.filterBy = pk;
|
|
12630
|
+
if (!this.filterOptionsMapper) {
|
|
12631
|
+
this.filterOptionsMapper = this.filterOptionsMapper || ((item) => ({
|
|
12632
|
+
text: `${item[pk]}`,
|
|
12633
|
+
value: `${item[pk]}`,
|
|
12634
|
+
}));
|
|
12664
12635
|
}
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
|
|
12636
|
+
const query = await repository.select().execute();
|
|
12637
|
+
if (query?.length)
|
|
12638
|
+
this.filterOptions = query.map((item) => this.filterOptionsMapper(item));
|
|
12639
|
+
}
|
|
12640
|
+
}
|
|
12641
|
+
itemMapper(item, mapper, props = {}) {
|
|
12642
|
+
item = super.itemMapper(item, this.cols.filter(c => c !== 'actions'), props);
|
|
12643
|
+
return Object.keys(item).reduce((accum, curr, index) => {
|
|
12644
|
+
const parserFn = mapper[this.cols[index]]?.valueParserFn || undefined;
|
|
12645
|
+
return { ...accum, [curr]: parserFn ? parserFn(item[curr], this) : item[curr] };
|
|
12646
|
+
}, { ...props });
|
|
12668
12647
|
}
|
|
12669
12648
|
mapResults(data) {
|
|
12670
12649
|
if (!data || !data.length)
|
|
12671
12650
|
return [];
|
|
12672
|
-
return data.reduce((accum, curr) =>
|
|
12673
|
-
accum
|
|
12674
|
-
|
|
12675
|
-
|
|
12676
|
-
return accum;
|
|
12677
|
-
}, []);
|
|
12651
|
+
return data.reduce((accum, curr) => [
|
|
12652
|
+
...accum,
|
|
12653
|
+
this.itemMapper(curr, this.mapper, { uid: curr[this.pk] })
|
|
12654
|
+
], []);
|
|
12678
12655
|
}
|
|
12679
12656
|
async handleAction(event, action, uid) {
|
|
12680
12657
|
event.stopImmediatePropagation();
|
|
12681
12658
|
await this.router.navigate([`/${this.route}/${action}/${uid}`]);
|
|
12682
12659
|
}
|
|
12683
12660
|
async openFilterSelectOptions(event) {
|
|
12684
|
-
const type = (this.
|
|
12685
|
-
if (type === SelectFieldInterfaces
|
|
12661
|
+
const type = (this.filterOptions.length > 10 ? SelectFieldInterfaces.MODAL : SelectFieldInterfaces.POPOVER);
|
|
12662
|
+
if (type === SelectFieldInterfaces.MODAL) {
|
|
12686
12663
|
event.preventDefault();
|
|
12687
12664
|
event.stopImmediatePropagation();
|
|
12688
12665
|
const title = await this.translate(`${this.locale}.filter_by`);
|
|
12689
|
-
const modal = await getNgxSelectOptionsModal(title, this.
|
|
12666
|
+
const modal = await getNgxSelectOptionsModal(title, this.filterOptions, this.injector);
|
|
12690
12667
|
this.changeDetectorRef.detectChanges();
|
|
12691
12668
|
const { data, role } = await modal.onWillDismiss();
|
|
12692
|
-
if (role === ActionRoles
|
|
12669
|
+
if (role === ActionRoles.confirm && data !== this.filterValue) {
|
|
12693
12670
|
this.filterValue = data;
|
|
12694
12671
|
await this.handleSearch({ query: [
|
|
12695
|
-
{ index:
|
|
12672
|
+
{ index: this.filterBy, value: this.filterValue, condition: 'Contains' }
|
|
12696
12673
|
] });
|
|
12697
12674
|
}
|
|
12698
12675
|
}
|
|
@@ -12706,10 +12683,10 @@ let TableComponent = class TableComponent extends ListComponent {
|
|
|
12706
12683
|
}
|
|
12707
12684
|
}
|
|
12708
12685
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
12709
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: TableComponent, isStandalone: true, selector: "ngx-decaf-table", inputs: {
|
|
12686
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: TableComponent, isStandalone: true, selector: "ngx-decaf-table", inputs: { filterModel: "filterModel", filterOptions: "filterOptions", filterBy: "filterBy", filterLabel: "filterLabel", filterOptionsMapper: "filterOptionsMapper" }, usesInheritance: true, ngImport: i0, template: "\n@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 class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\">\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 fill=\"clear\" (click)=\"handleFilterSelectClear($event)\" slot=\"end\" size=\"small\" [disabled]=\"!filterValue\">\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\n<div class=\"dcf-table-container\">\n @if(initialized && data?.length) {\n <table class=\"dcf-table\">\n <thead>\n <tr>\n @for(col of cols; track $index) {\n <th>{{ locale + '.' + col + '.label' | translate}}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for(item of items; track trackItemFn($index, item)) {\n <tr (click)=\"handleAction($event, OperationKeys.READ, item.uid)\">\n @for(col of item | keyvalue; track $index) {\n @if(!['actions', 'uid'].includes(col.key)) {\n <td>{{ col.value }}</td>\n } @else {\n @if(allowOperations) {\n <td class=\"dcf-col-actions\">\n <div class=\"dcf-flex dcf-flex-center\">\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"handleAction($event, OperationKeys.UPDATE, item.uid)\"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"primary\"\n name=\"ti-pencil\"\n />\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"handleAction($event,OperationKeys.DELETE, item.uid)\"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"danger\"\n name=\"ti-trash\"\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]=\"model\"\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\n <ngx-decaf-empty-state\n icon=\"search-outline\"\n [model]=\"model\"\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) {\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 }\n </div>\n}\n\n", styles: [".dcf-table-container{display:block;overflow-x:auto!important;box-sizing:border-box;overflow-y:hidden;scrollbar-width:thin;box-shadow:var(--dcf-box-shadow-small);border:1px solid var(--dcf-color-gray-2);border-radius:var(--dcf-border-radius-small)}.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" }] }); }
|
|
12710
12687
|
};
|
|
12711
12688
|
TableComponent = __decorate([
|
|
12712
|
-
Dynamic
|
|
12689
|
+
Dynamic()
|
|
12713
12690
|
], TableComponent);
|
|
12714
12691
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TableComponent, decorators: [{
|
|
12715
12692
|
type: Component,
|
|
@@ -12722,13 +12699,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
12722
12699
|
EmptyStateComponent,
|
|
12723
12700
|
IconComponent,
|
|
12724
12701
|
PaginationComponent
|
|
12725
|
-
], template: "\n@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(
|
|
12726
|
-
}], propDecorators: {
|
|
12702
|
+
], template: "\n@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 class=\"dcf-width-1-3@s dcf-width-1-4@m dcf-select-filter-container dcf-flex dcf-flex-middle\">\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 fill=\"clear\" (click)=\"handleFilterSelectClear($event)\" slot=\"end\" size=\"small\" [disabled]=\"!filterValue\">\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\n<div class=\"dcf-table-container\">\n @if(initialized && data?.length) {\n <table class=\"dcf-table\">\n <thead>\n <tr>\n @for(col of cols; track $index) {\n <th>{{ locale + '.' + col + '.label' | translate}}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for(item of items; track trackItemFn($index, item)) {\n <tr (click)=\"handleAction($event, OperationKeys.READ, item.uid)\">\n @for(col of item | keyvalue; track $index) {\n @if(!['actions', 'uid'].includes(col.key)) {\n <td>{{ col.value }}</td>\n } @else {\n @if(allowOperations) {\n <td class=\"dcf-col-actions\">\n <div class=\"dcf-flex dcf-flex-center\">\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"handleAction($event, OperationKeys.UPDATE, item.uid)\"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"primary\"\n name=\"ti-pencil\"\n />\n <ngx-decaf-icon\n [button]=\"true\"\n (click)=\"handleAction($event,OperationKeys.DELETE, item.uid)\"\n fill=\"clear\"\n slot=\"icon-only\"\n color=\"danger\"\n name=\"ti-trash\"\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]=\"model\"\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\n <ngx-decaf-empty-state\n icon=\"search-outline\"\n [model]=\"model\"\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) {\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 }\n </div>\n}\n\n", styles: [".dcf-table-container{display:block;overflow-x:auto!important;box-sizing:border-box;overflow-y:hidden;scrollbar-width:thin;box-shadow:var(--dcf-box-shadow-small);border:1px solid var(--dcf-color-gray-2);border-radius:var(--dcf-border-radius-small)}.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"] }]
|
|
12703
|
+
}], propDecorators: { filterModel: [{
|
|
12704
|
+
type: Input
|
|
12705
|
+
}], filterOptions: [{
|
|
12727
12706
|
type: Input
|
|
12728
|
-
}],
|
|
12707
|
+
}], filterBy: [{
|
|
12729
12708
|
type: Input
|
|
12730
12709
|
}], filterLabel: [{
|
|
12731
12710
|
type: Input
|
|
12711
|
+
}], filterOptionsMapper: [{
|
|
12712
|
+
type: Input
|
|
12732
12713
|
}] } });
|
|
12733
12714
|
|
|
12734
12715
|
/**
|
|
@@ -12974,8 +12955,8 @@ class NgxPageDirective extends NgxComponentDirective {
|
|
|
12974
12955
|
if (this.locale)
|
|
12975
12956
|
return `${this.locale}.title`;
|
|
12976
12957
|
if (this.currentRoute)
|
|
12977
|
-
return this.currentRoute
|
|
12978
|
-
return
|
|
12958
|
+
return `${this.currentRoute}.title`;
|
|
12959
|
+
return `${this.model.constructor.name}.title`;
|
|
12979
12960
|
}
|
|
12980
12961
|
async ngOnInit() {
|
|
12981
12962
|
// connect component to media service for color scheme toggling
|
|
@@ -12999,8 +12980,8 @@ class NgxPageDirective extends NgxComponentDirective {
|
|
|
12999
12980
|
this.currentRoute = url;
|
|
13000
12981
|
if (this.hasMenu)
|
|
13001
12982
|
this.hasMenu = url !== "login" && url !== "";
|
|
13002
|
-
this.setPageTitle(this.currentRoute);
|
|
13003
12983
|
this.title = this.pageTitle;
|
|
12984
|
+
await this.setPageTitle(url);
|
|
13004
12985
|
}
|
|
13005
12986
|
if (event instanceof NavigationStart) {
|
|
13006
12987
|
const url = (event?.url || "").replace('/', '');
|
|
@@ -13031,8 +13012,9 @@ class NgxPageDirective extends NgxComponentDirective {
|
|
|
13031
13012
|
menu = this.menu;
|
|
13032
13013
|
const activeMenu = menu.find(item => item?.url?.includes(route));
|
|
13033
13014
|
if (activeMenu) {
|
|
13034
|
-
const
|
|
13035
|
-
|
|
13015
|
+
const label = `${(activeMenu?.title || activeMenu?.label || "").toLowerCase()}`;
|
|
13016
|
+
const title = `${await this.translate(label ? "menu." + label : label)} ${this.appName ? `- ${this.appName}` : ''}`;
|
|
13017
|
+
this.titleService.setTitle(title);
|
|
13036
13018
|
if (!this.title)
|
|
13037
13019
|
this.title = title;
|
|
13038
13020
|
}
|
|
@@ -13105,15 +13087,6 @@ class NgxModelPageDirective extends NgxPageDirective {
|
|
|
13105
13087
|
// constructor(@Inject(CPTKN) hm: boolean = true, @Inject(CPTKN) protected toastController?: ToastController) {
|
|
13106
13088
|
// super("NgxModelPageDirective");
|
|
13107
13089
|
// }
|
|
13108
|
-
get pageTitle() {
|
|
13109
|
-
if (!this.modelName && this.model instanceof Model)
|
|
13110
|
-
this.modelName = this.model?.constructor?.name || '';
|
|
13111
|
-
if (!this.operation)
|
|
13112
|
-
return this.title ? this.title : `Listing ${this.modelName}`;
|
|
13113
|
-
const operation = this.operation.charAt(0).toUpperCase() +
|
|
13114
|
-
this.operation.slice(1).toLowerCase();
|
|
13115
|
-
return this.modelName ? `${operation} ${this.modelName}` : this.title;
|
|
13116
|
-
}
|
|
13117
13090
|
/**
|
|
13118
13091
|
* @description Lazy-initialized repository getter with model resolution.
|
|
13119
13092
|
* @summary Creates and returns a repository instance for the specified model name.
|
|
@@ -13490,5 +13463,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
13490
13463
|
* Generated bundle index. Do not edit.
|
|
13491
13464
|
*/
|
|
13492
13465
|
|
|
13493
|
-
export { ActionRoles, AngularEngineKeys, BaseComponentProps, CPTKN, CardComponent, ComponentEventNames, ComponentRendererComponent, ComponentsTagNames, CrudFieldComponent, CrudFormComponent, CssClasses, DB_ADAPTER_FLAVOUR_TOKEN, DB_ADAPTER_PROVIDER_TOKEN, DecafFakerRepository, DefaultFormReactiveOptions, DefaultListEmptyOptions, DefaultModalOptions, Dynamic, DynamicModule, ElementPositions, ElementSizes, EmptyStateComponent, FieldsetComponent, FileUploadComponent, FilterComponent, ForAngularCommonModule, ForAngularComponentsModule, FormConstants, I18N_CONFIG_TOKEN, I18nLoader, I18nLoaderFactory, I18nParser, IconComponent, LOCALE_ROOT_TOKEN, LayoutComponent, LayoutGridGaps, ListComponent, ListComponentsTypes, ListItemComponent, ListItemPositions, LoggerLevels, ModalComponent, ModelRendererComponent, NgxComponentDirective, NgxEventHandler, NgxFormDirective, NgxFormFieldDirective, NgxFormService, NgxMediaService, NgxModelPageDirective, NgxPageDirective, NgxParentComponentDirective, NgxRenderingEngine, NgxSvgDirective, PaginationComponent, RouteDirections, SearchbarComponent, SelectFieldInterfaces, SteppedFormComponent, TableComponent, WindowColorSchemes, cleanSpaces, dataMapper, decafPageTransition, filterString, formatDate, generateRandomValue, getDbAdapterFlavour, getFakerData, getInjectablesRegistry, getLocaleContext, getLocaleContextByKey, getLocaleFromClassName, getLocaleLanguage, getLogger, getMenuIcon, getModelAndRepository, getNgxInlineModal, getNgxModalComponent, getNgxModalCrudComponent, getNgxSelectOptionsModal, getOnWindow, getOnWindowDocument, getWindow, getWindowDocument, getWindowWidth, isDarkMode, isDevelopmentMode, isNotUndefined, isValidDate, itemMapper, parseToValidDate, presentNgxInlineModal, presentNgxLightBoxModal, provideDecafDarkMode, provideDecafDbAdapter, provideDecafDynamicComponents, provideDecafI18nConfig, provideDecafI18nLoader, provideDecafPageTransition, removeFocusTrap, setOnWindow, stringToBoolean, windowEventEmitter };
|
|
13466
|
+
export { ActionRoles, AngularEngineKeys, BaseComponentProps, CPTKN, CardComponent, ComponentEventNames, ComponentRendererComponent, ComponentsTagNames, CrudFieldComponent, CrudFormComponent, CssClasses, DB_ADAPTER_FLAVOUR_TOKEN, DB_ADAPTER_PROVIDER_TOKEN, DecafFakerRepository, DefaultFormReactiveOptions, DefaultListEmptyOptions, DefaultModalOptions, Dynamic, DynamicModule, ElementPositions, ElementSizes, EmptyStateComponent, FieldsetComponent, FileUploadComponent, FilterComponent, ForAngularCommonModule, ForAngularComponentsModule, FormConstants, I18N_CONFIG_TOKEN, I18nLoader, I18nLoaderFactory, I18nParser, IconComponent, LOCALE_ROOT_TOKEN, LayoutComponent, LayoutGridGaps, ListComponent, ListComponentsTypes, ListItemComponent, ListItemPositions, LoggerLevels, ModalComponent, ModelRendererComponent, NgxComponentDirective, NgxEventHandler, NgxFormDirective, NgxFormFieldDirective, NgxFormService, NgxMediaService, NgxModelPageDirective, NgxPageDirective, NgxParentComponentDirective, NgxRenderingEngine, NgxRouterService, NgxSvgDirective, PaginationComponent, RouteDirections, SearchbarComponent, SelectFieldInterfaces, SteppedFormComponent, TableComponent, WindowColorSchemes, cleanSpaces, dataMapper, decafPageTransition, filterString, formatDate, generateRandomValue, getDbAdapterFlavour, getFakerData, getInjectablesRegistry, getLocaleContext, getLocaleContextByKey, getLocaleFromClassName, getLocaleLanguage, getLogger, getMenuIcon, getModelAndRepository, getNgxInlineModal, getNgxModalComponent, getNgxModalCrudComponent, getNgxSelectOptionsModal, getOnWindow, getOnWindowDocument, getWindow, getWindowDocument, getWindowWidth, isDarkMode, isDevelopmentMode, isNotUndefined, isValidDate, itemMapper, parseToValidDate, presentNgxInlineModal, presentNgxLightBoxModal, provideDecafDarkMode, provideDecafDbAdapter, provideDecafDynamicComponents, provideDecafI18nConfig, provideDecafI18nLoader, provideDecafPageTransition, removeFocusTrap, setOnWindow, stringToBoolean, windowEventEmitter };
|
|
13494
13467
|
//# sourceMappingURL=decaf-ts-for-angular.mjs.map
|