Skip to content

Commit

Permalink
Merge pull request #47 from klippa-app/add_option_for_custom_file_inp…
Browse files Browse the repository at this point in the history
…ut_text

Add option for custom file input text
  • Loading branch information
wouter-willems authored May 3, 2024
2 parents e130633 + 0fcdcae commit 232c735
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@
"@angular/compiler-cli": "^14.2.8",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"@types/lodash-es": "^4.17.6",
"codelyzer": "^6.0.2",
"@types/node": "^12.11.1",
"@babel/runtime": "^7.24.5",
"codelyzer": "^6.0.2",
"jasmine-core": "~3.10.1",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.4.1",
Expand Down
8 changes: 7 additions & 1 deletion projects/demo/src/app/demo/demo.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@
</klp-form-element>

<klp-form-element caption="file" direction="vertical">
<klp-form-file-input formControlName="file"></klp-form-file-input>
<klp-form-file-input formControlName="file" >
there is the file input with ng content
</klp-form-file-input>
</klp-form-element>
<!-- <klp-form-element caption="file" direction="vertical">-->
<!-- <klp-form-file-input formControlName="file" [buttonText]="'this one is with button text'">-->
<!-- </klp-form-file-input>-->
<!-- </klp-form-element>-->
</div>
</div>
<div>
Expand Down
2 changes: 1 addition & 1 deletion projects/klippa/ngx-enhancy-forms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klippa/ngx-enhancy-forms",
"version": "14.17.14",
"version": "14.18.0",
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
>
<klp-form-button class="uploadButton" [isLoading]="isLoading" [disabled]="disabled" (click)="uploadFileClicked()">
<div class="innerButton">
{{buttonText}}
<span *ngIf="buttonText">{{buttonText}}</span>
<div *ngIf="!buttonText"><ng-content></ng-content></div>
<div class="tail">
<ng-container [ngTemplateOutlet]="getTailTpl()"></ng-container>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class FileInputComponent extends MultipleValueAccessorBase<File> {
@Input() clearable = false;
@Input() onlyShowUploadButton = false;
@Input() useFullParentSize = false;
@Input() buttonText: string = 'Upload a file';
@Input() buttonText: string;
@ViewChild('nativeInputRef') nativeInputRef: ElementRef<HTMLInputElement>;

public onChange(files: FileList): void {
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,13 @@
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.24.5":
version "7.24.5"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.5.tgz#230946857c053a36ccc66e1dd03b17dd0c4ed02c"
integrity sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==
dependencies:
regenerator-runtime "^0.14.0"

"@babel/runtime@^7.8.4":
version "7.16.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5"
Expand Down Expand Up @@ -6497,6 +6504,11 @@ regenerator-runtime@0.13.9, regenerator-runtime@^0.13.4:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52"
integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==

regenerator-runtime@^0.14.0:
version "0.14.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==

regenerator-transform@^0.15.0:
version "0.15.0"
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.0.tgz#cbd9ead5d77fae1a48d957cf889ad0586adb6537"
Expand Down

0 comments on commit 232c735

Please sign in to comment.