@decaf-ts/for-angular 0.0.66 → 0.0.67

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.
@@ -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
  /**
@@ -5169,37 +5167,6 @@ function Dynamic() {
5169
5167
  NgxRenderingEngine.registerComponent(metadata.selector, original);
5170
5168
  }, metadata(Metadata.key(AngularEngineKeys.REFLECT, AngularEngineKeys.DYNAMIC), true));
5171
5169
  }
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
5170
 
5204
5171
  /**
5205
5172
  * @module module:lib/components/model-renderer/model-renderer.component
@@ -12623,7 +12590,7 @@ let TableComponent = class TableComponent extends ListComponent {
12623
12590
  .map(([key]) => key);
12624
12591
  }
12625
12592
  async ngOnInit() {
12626
- this.type = ListComponentsTypes$1.PAGINATED;
12593
+ this.type = ListComponentsTypes.PAGINATED;
12627
12594
  this.cols = this._cols;
12628
12595
  this.allowOperations = this.isAllowed(OperationKeys.UPDATE) || this.isAllowed(OperationKeys.DELETE);
12629
12596
  this.searchValue = undefined;
@@ -12657,8 +12624,8 @@ let TableComponent = class TableComponent extends ListComponent {
12657
12624
  value = parserFn(value, this);
12658
12625
  }
12659
12626
  else {
12660
- if (isValidDate$2(new Date(value)))
12661
- value = `${formatDate$1(value)}`;
12627
+ if (isValidDate(new Date(value)))
12628
+ value = `${formatDate(value)}`;
12662
12629
  }
12663
12630
  acc[curr] = value;
12664
12631
  }
@@ -12681,15 +12648,15 @@ let TableComponent = class TableComponent extends ListComponent {
12681
12648
  await this.router.navigate([`/${this.route}/${action}/${uid}`]);
12682
12649
  }
12683
12650
  async openFilterSelectOptions(event) {
12684
- const type = (this.filter.length > 10 ? SelectFieldInterfaces$1.MODAL : SelectFieldInterfaces$1.POPOVER);
12685
- if (type === SelectFieldInterfaces$1.MODAL) {
12651
+ const type = (this.filter.length > 10 ? SelectFieldInterfaces.MODAL : SelectFieldInterfaces.POPOVER);
12652
+ if (type === SelectFieldInterfaces.MODAL) {
12686
12653
  event.preventDefault();
12687
12654
  event.stopImmediatePropagation();
12688
12655
  const title = await this.translate(`${this.locale}.filter_by`);
12689
12656
  const modal = await getNgxSelectOptionsModal(title, this.filter, this.injector);
12690
12657
  this.changeDetectorRef.detectChanges();
12691
12658
  const { data, role } = await modal.onWillDismiss();
12692
- if (role === ActionRoles$1.confirm && data !== this.filterValue) {
12659
+ if (role === ActionRoles.confirm && data !== this.filterValue) {
12693
12660
  this.filterValue = data;
12694
12661
  await this.handleSearch({ query: [
12695
12662
  { index: 'productCode', value: this.filterValue, condition: 'Contains' }
@@ -12709,7 +12676,7 @@ let TableComponent = class TableComponent extends ListComponent {
12709
12676
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: TableComponent, isStandalone: true, selector: "ngx-decaf-table", inputs: { filter: "filter", filterIndex: "filterIndex", filterLabel: "filterLabel" }, 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(filter?.length && filterIndex) {\n <div class=\"dcf-width-auto@s 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(filterOption of filter; track $index) {\n <ion-select-option value=\"{{ filterOption.value }}\">{{ filterOption.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
12677
  };
12711
12678
  TableComponent = __decorate([
12712
- Dynamic$1()
12679
+ Dynamic()
12713
12680
  ], TableComponent);
12714
12681
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TableComponent, decorators: [{
12715
12682
  type: Component,