udos86/ng-dynamic-forms

Outdated build for ui-material package (v10.1.0)

Opened this issue · 3 comments

I'm submitting a


[x] Bug / Regression
[ ] Feature Request / Proposal

I'm using


NG Dynamic Forms Version: `X.Y.Z`

[ ] Basic UI
[ ] Bootstrap UI  
[ ] Foundation UI
[ ] Ionic UI
[ ] Kendo UI
[x] Material  
[ ] NG Bootstrap
[ ] Prime NG

Description

Hi, it seems that the current version of @ng-dynamic-forms/ui-material does not match code on master.

I wanted to use a custom template for Autocomplete in DynamicMaterialInputComponent, using the feature here implemented in #931 about 1 year ago.

After some investigation, I found out that the version v10.1.0 in NPM didn't have this patch. Here is a part of the compiled output (fesm2015 version):


DynamicMaterialInputComponent.decorators = [
    { type: Component, args: [{
                selector: "dynamic-material-input",
                template: "<mat-form-field [appearance]=\"model.getAdditional('appearance', 'legacy')\"\n                [color]=\"model.getAdditional('color', 'primary')\"\n                [floatLabel]=\"model.getAdditional('floatLabel', LABEL_OPTIONS && LABEL_OPTIONS['float'] || 'auto')\"\n                [formGroup]=\"group\"\n                [hideRequiredMarker]=\"model.getAdditional('hideRequiredMarker', false)\"\n                [ngClass]=\"getClass('grid','control')\"\n                [textMask]=\"{mask: (model.mask || false), showMask: model.mask && !(model.placeholder)}\">\n\n    <ng-container *ngIf=\"model.label\" ngProjectAs=\"mat-label\">\n\n        <mat-label [innerHTML]=\"model.label\"></mat-label>\n\n    </ng-container>\n\n    <span *ngIf=\"model.prefix\" matPrefix [innerHTML]=\"model.prefix\"></span>\n\n    <input matInput\n           [attr.accept]=\"model.accept\"\n           [attr.max]=\"model.max\"\n           [attr.min]=\"model.min\"\n           [attr.multiple]=\"model.multiple\"\n           [attr.step]=\"model.step\"\n           [autocomplete]=\"model.autoComplete\"\n           [autofocus]=\"model.autoFocus\"\n           [errorStateMatcher]=\"model.getAdditional('errorStateMatcher', errorStateMatcher)\"\n           [formControlName]=\"model.id\"\n           [id]=\"id\"\n           [maxlength]=\"model.maxLength\"\n           [matAutocomplete]=\"matAutocomplete\"\n           [minlength]=\"model.minLength\"\n           [name]=\"model.name\"\n           [ngClass]=\"getClass('element', 'control')\"\n           [pattern]=\"model.pattern\"\n           [placeholder]=\"model.placeholder\"\n           [readonly]=\"model.readOnly\"\n           [required]=\"model.required\"\n           [spellcheck]=\"model.spellCheck\"\n           [tabindex]=\"model.tabIndex\"\n           [type]=\"model.inputType\"\n           (blur)=\"onBlur($event)\"\n           (change)=\"onChange($event)\"\n           (focus)=\"onFocus($event)\"/>\n\n    <span *ngIf=\"model.suffix\" matSuffix [innerHTML]=\"model.suffix\"></span>\n\n    <mat-hint *ngIf=\"model.hint !== null\" align=\"start\" [innerHTML]=\"model.hint\"></mat-hint>\n\n    <mat-hint *ngIf=\"showCharacterHint\" align=\"end\">{{ characterHint }}</mat-hint>\n\n    <mat-error *ngFor=\"let message of errorMessages\">{{ message }}</mat-error>\n\n</mat-form-field>\n\n<mat-autocomplete #matAutocomplete=\"matAutocomplete\"\n                  [autoActiveFirstOption]=\"model.getAdditional('autoActiveFirstOption', AUTOCOMPLETE_OPTIONS['autoActiveFirstOption'])\"\n                  [disableRipple]=\"model.getAdditional('disableRipple', RIPPLE_OPTIONS && RIPPLE_OPTIONS['disabled'] || false)\"\n                  [displayWith]=\"model.getAdditional('displayWith', null)\"\n                  (optionSelected)=\"onChange($event)\">\n\n    <mat-option *ngFor=\"let option of model.list$ | async\" [value]=\"option\">{{ option }}</mat-option>\n\n</mat-autocomplete>\n"
            }] }
];

After cloning the repo and compiled it myself, the patch is here.

There is probably other outdated code, but didn't have the chance to check.
I think it would be useful to have an script that deletes the dist folder before publishing (maybe there is already something I didn't saw, sorry).

cufeo commented

Confirmed. How did you solve your problem ?

Confirmed. How did you solve your problem ?

I tried to use the fork here but didn't get any response.

I had to make yet another fork here with the updated version.

Multiple notes:

  • I released from the development branch (after rebasing from master).
  • I released packages to Github registry, not NPM registry. You'll need to add a .npmrc or .yarnrc file like this
  • I only released core and ui-material (cf. here )

Also, I didn't updated it to the latest version yet (didn't see it)