@anglr/common 21.3.0-beta.20241115051814 → 21.3.0-beta.20241115055546

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.
Files changed (75) hide show
  1. package/changelog.md +86 -1
  2. package/es2022/src/index.js +2 -1
  3. package/es2022/src/index.js.map +1 -1
  4. package/es2022/src/modules/file/components/file/file.component.js +119 -0
  5. package/es2022/src/modules/file/components/file/file.component.js.map +1 -0
  6. package/es2022/src/modules/file/components/fileInput/fileInput.component.js +62 -0
  7. package/es2022/src/modules/file/components/fileInput/fileInput.component.js.map +1 -0
  8. package/es2022/src/modules/file/components/index.js +4 -0
  9. package/es2022/src/modules/file/components/index.js.map +1 -0
  10. package/es2022/src/modules/file/components/uploadButton/uploadButton.component.js +59 -0
  11. package/es2022/src/modules/file/components/uploadButton/uploadButton.component.js.map +1 -0
  12. package/es2022/src/modules/file/directive/fileInput/fileInput.directive.js +154 -0
  13. package/es2022/src/modules/file/directive/fileInput/fileInput.directive.js.map +1 -0
  14. package/es2022/src/modules/file/directive/fileTemplate/fileTemplate.context.js +2 -0
  15. package/es2022/src/modules/file/directive/fileTemplate/fileTemplate.context.js.map +1 -0
  16. package/es2022/src/modules/file/directive/fileTemplate/fileTemplate.directive.js +24 -0
  17. package/es2022/src/modules/file/directive/fileTemplate/fileTemplate.directive.js.map +1 -0
  18. package/es2022/src/modules/file/directive/index.js +4 -0
  19. package/es2022/src/modules/file/directive/index.js.map +1 -0
  20. package/es2022/src/modules/file/index.js +6 -0
  21. package/es2022/src/modules/file/index.js.map +1 -0
  22. package/es2022/src/modules/file/interfaces/fileVisual/fileVisual.interface.js +2 -0
  23. package/es2022/src/modules/file/interfaces/fileVisual/fileVisual.interface.js.map +1 -0
  24. package/es2022/src/modules/file/interfaces/index.js +2 -0
  25. package/es2022/src/modules/file/interfaces/index.js.map +1 -0
  26. package/es2022/src/modules/file/misc/tokens.js +6 -0
  27. package/es2022/src/modules/file/misc/tokens.js.map +1 -0
  28. package/es2022/src/modules/file/modules/file.module.js +40 -0
  29. package/es2022/src/modules/file/modules/file.module.js.map +1 -0
  30. package/es2022/src/modules/file/modules/index.js +2 -0
  31. package/es2022/src/modules/file/modules/index.js.map +1 -0
  32. package/es2022/src/pipes/firstUppercase/firstUppercase.pipe.js.map +1 -1
  33. package/es2022/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/index.d.ts +2 -1
  36. package/src/index.d.ts.map +1 -1
  37. package/src/modules/file/components/file/file.component.css +16 -0
  38. package/src/modules/file/components/file/file.component.d.ts +85 -0
  39. package/src/modules/file/components/file/file.component.d.ts.map +1 -0
  40. package/src/modules/file/components/file/file.component.html +14 -0
  41. package/src/modules/file/components/fileInput/fileInput.component.css +27 -0
  42. package/src/modules/file/components/fileInput/fileInput.component.d.ts +37 -0
  43. package/src/modules/file/components/fileInput/fileInput.component.d.ts.map +1 -0
  44. package/src/modules/file/components/fileInput/fileInput.component.html +7 -0
  45. package/src/modules/file/components/index.d.ts +4 -0
  46. package/src/modules/file/components/index.d.ts.map +1 -0
  47. package/src/modules/file/components/uploadButton/uploadButton.component.css +52 -0
  48. package/src/modules/file/components/uploadButton/uploadButton.component.d.ts +36 -0
  49. package/src/modules/file/components/uploadButton/uploadButton.component.d.ts.map +1 -0
  50. package/src/modules/file/components/uploadButton/uploadButton.component.html +16 -0
  51. package/src/modules/file/directive/fileInput/fileInput.directive.d.ts +69 -0
  52. package/src/modules/file/directive/fileInput/fileInput.directive.d.ts.map +1 -0
  53. package/src/modules/file/directive/fileTemplate/fileTemplate.context.d.ts +30 -0
  54. package/src/modules/file/directive/fileTemplate/fileTemplate.context.d.ts.map +1 -0
  55. package/src/modules/file/directive/fileTemplate/fileTemplate.directive.d.ts +14 -0
  56. package/src/modules/file/directive/fileTemplate/fileTemplate.directive.d.ts.map +1 -0
  57. package/src/modules/file/directive/index.d.ts +4 -0
  58. package/src/modules/file/directive/index.d.ts.map +1 -0
  59. package/src/modules/file/index.d.ts +6 -0
  60. package/src/modules/file/index.d.ts.map +1 -0
  61. package/src/modules/file/interfaces/fileVisual/fileVisual.interface.d.ts +12 -0
  62. package/src/modules/file/interfaces/fileVisual/fileVisual.interface.d.ts.map +1 -0
  63. package/src/modules/file/interfaces/index.d.ts +2 -0
  64. package/src/modules/file/interfaces/index.d.ts.map +1 -0
  65. package/src/modules/file/misc/tokens.d.ts +7 -0
  66. package/src/modules/file/misc/tokens.d.ts.map +1 -0
  67. package/src/modules/file/modules/file.module.d.ts +15 -0
  68. package/src/modules/file/modules/file.module.d.ts.map +1 -0
  69. package/src/modules/file/modules/index.d.ts +2 -0
  70. package/src/modules/file/modules/index.d.ts.map +1 -0
  71. package/src/pipes/firstUppercase/firstUppercase.pipe.d.ts +1 -1
  72. package/src/pipes/firstUppercase/firstUppercase.pipe.d.ts.map +1 -1
  73. package/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.d.ts +1 -1
  74. package/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.d.ts.map +1 -1
  75. package/version.bak +1 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fileTemplate.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileTemplate.context.js","sourceRoot":"","sources":["../../../../../../src/modules/file/directive/fileTemplate/fileTemplate.context.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Context passed to file template\n */\nexport interface FileTemplateContext\n{\n /**\n * Instance of selected file or null if none is selected\n */\n file: File|undefined|null;\n\n /**\n * Name of selected file\n */\n fileName: string|undefined|null;\n\n /**\n * Instance of selected array of files or null if none is selected\n */\n files: File[]|undefined|null;\n\n /**\n * Array of names of selected files\n */\n filesNames: string[]|undefined|null;\n\n /**\n * Indication whether multiple files selection is enabled\n */\n multiple: boolean;\n\n /**\n * Clears selected file\n */\n clearFile(): void;\n}"]}
@@ -0,0 +1,24 @@
1
+ import { Directive } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Directive used for obtaining file component visual template
5
+ */
6
+ export class FileTemplateDirective {
7
+ //######################### ng language server #########################
8
+ /**
9
+ * Allows typechecking for template
10
+ */
11
+ static ngTemplateContextGuard(_dir, _ctx) {
12
+ return true;
13
+ }
14
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FileTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
15
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FileTemplateDirective, isStandalone: true, selector: "[fileTemplate]", ngImport: i0 }); }
16
+ }
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FileTemplateDirective, decorators: [{
18
+ type: Directive,
19
+ args: [{
20
+ selector: '[fileTemplate]',
21
+ standalone: true,
22
+ }]
23
+ }] });
24
+ //# sourceMappingURL=fileTemplate.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileTemplate.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/file/directive/fileTemplate/fileTemplate.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;;AAIxC;;GAEG;AAMH,MAAM,OAAO,qBAAqB;IAE9B,wEAAwE;IAExE;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,IAA2B,EAAE,IAAa;QAEpE,OAAO,IAAI,CAAC;IAChB,CAAC;8GAVQ,qBAAqB;kGAArB,qBAAqB;;2FAArB,qBAAqB;kBALjC,SAAS;mBACV;oBACI,QAAQ,EAAE,gBAAgB;oBAC1B,UAAU,EAAE,IAAI;iBACnB","sourcesContent":["import {Directive} from '@angular/core';\n\nimport {FileTemplateContext} from './fileTemplate.context';\n\n/**\n * Directive used for obtaining file component visual template\n */\n@Directive(\n{\n selector: '[fileTemplate]',\n standalone: true,\n})\nexport class FileTemplateDirective\n{\n //######################### ng language server #########################\n \n /**\n * Allows typechecking for template\n */\n static ngTemplateContextGuard(_dir: FileTemplateDirective, _ctx: unknown): _ctx is FileTemplateContext\n {\n return true;\n }\n}"]}
@@ -0,0 +1,4 @@
1
+ export * from './fileInput/fileInput.directive';
2
+ export * from './fileTemplate/fileTemplate.context';
3
+ export * from './fileTemplate/fileTemplate.directive';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/file/directive/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC","sourcesContent":["export * from './fileInput/fileInput.directive';\nexport * from './fileTemplate/fileTemplate.context';\nexport * from './fileTemplate/fileTemplate.directive';\n"]}
@@ -0,0 +1,6 @@
1
+ export * from './components';
2
+ export * from './directive';
3
+ export * from './interfaces';
4
+ export * from './misc/tokens';
5
+ export * from './modules';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/file/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC","sourcesContent":["export * from './components';\nexport * from './directive';\nexport * from './interfaces';\nexport * from './misc/tokens';\nexport * from './modules';\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fileVisual.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileVisual.interface.js","sourceRoot":"","sources":["../../../../../../src/modules/file/interfaces/fileVisual/fileVisual.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {WritableSignal} from '@angular/core';\n\nimport {FileTemplateContext} from '../../directive';\n\n/**\n * Represents type that handles visualizing of file input value\n */\nexport interface FileVisual\n{\n /**\n * Instance of file template context passed to file visual to display info about selected files\n */\n fileTemplateContext: WritableSignal<FileTemplateContext|undefined|null>;\n}"]}
@@ -0,0 +1,2 @@
1
+ export * from './fileVisual/fileVisual.interface';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/file/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './fileVisual/fileVisual.interface';\n"]}
@@ -0,0 +1,6 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ /**
3
+ * Injection token used for obtaining implementation of file visual component
4
+ */
5
+ export const FILE_VISUAL = new InjectionToken('FILE_VISUAL');
6
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../src/modules/file/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAI7C;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAA+B,IAAI,cAAc,CAAa,aAAa,CAAC,CAAC","sourcesContent":["import {InjectionToken} from '@angular/core';\n\nimport {FileVisual} from '../interfaces';\n\n/**\n * Injection token used for obtaining implementation of file visual component\n */\nexport const FILE_VISUAL: InjectionToken<FileVisual> = new InjectionToken<FileVisual>('FILE_VISUAL');\n"]}
@@ -0,0 +1,40 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { FileComponent, FileInputComponent, UploadButtonComponent } from '../components';
3
+ import { FileInputDirective, FileTemplateDirective } from '../directive';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Module for grouping File components and directives
7
+ */
8
+ export class FileModule {
9
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.1", ngImport: i0, type: FileModule, imports: [FileComponent,
11
+ FileInputDirective,
12
+ FileTemplateDirective,
13
+ UploadButtonComponent,
14
+ FileInputComponent], exports: [FileComponent,
15
+ FileInputComponent,
16
+ UploadButtonComponent,
17
+ FileInputDirective,
18
+ FileTemplateDirective] }); }
19
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FileModule }); }
20
+ }
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FileModule, decorators: [{
22
+ type: NgModule,
23
+ args: [{
24
+ imports: [
25
+ FileComponent,
26
+ FileInputDirective,
27
+ FileTemplateDirective,
28
+ UploadButtonComponent,
29
+ FileInputComponent,
30
+ ],
31
+ exports: [
32
+ FileComponent,
33
+ FileInputComponent,
34
+ UploadButtonComponent,
35
+ FileInputDirective,
36
+ FileTemplateDirective,
37
+ ]
38
+ }]
39
+ }] });
40
+ //# sourceMappingURL=file.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.module.js","sourceRoot":"","sources":["../../../../../src/modules/file/modules/file.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAE,qBAAqB,EAAC,MAAM,eAAe,CAAC;AACvF,OAAO,EAAC,kBAAkB,EAAE,qBAAqB,EAAC,MAAM,cAAc,CAAC;;AAEvE;;GAEG;AAoBH,MAAM,OAAO,UAAU;8GAAV,UAAU;+GAAV,UAAU,YAff,aAAa;YACb,kBAAkB;YAClB,qBAAqB;YACrB,qBAAqB;YACrB,kBAAkB,aAIlB,aAAa;YACb,kBAAkB;YAClB,qBAAqB;YACrB,kBAAkB;YAClB,qBAAqB;+GAGhB,UAAU;;2FAAV,UAAU;kBAnBtB,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,aAAa;wBACb,kBAAkB;wBAClB,qBAAqB;wBACrB,qBAAqB;wBACrB,kBAAkB;qBACrB;oBACD,OAAO,EACP;wBACI,aAAa;wBACb,kBAAkB;wBAClB,qBAAqB;wBACrB,kBAAkB;wBAClB,qBAAqB;qBACxB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {FileComponent, FileInputComponent, UploadButtonComponent} from '../components';\nimport {FileInputDirective, FileTemplateDirective} from '../directive';\n\n/**\n * Module for grouping File components and directives\n */\n@NgModule(\n{\n imports:\n [\n FileComponent,\n FileInputDirective,\n FileTemplateDirective,\n UploadButtonComponent,\n FileInputComponent,\n ],\n exports:\n [\n FileComponent,\n FileInputComponent,\n UploadButtonComponent,\n FileInputDirective,\n FileTemplateDirective,\n ]\n})\nexport class FileModule\n{\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './file.module';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/file/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC","sourcesContent":["export * from './file.module';"]}
@@ -1 +1 @@
1
- {"version":3,"file":"firstUppercase.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/firstUppercase/firstUppercase.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;;AAElD;;GAEG;AAMH,MAAM,OAAO,oBAAoB;IAE7B;;;OAGG;IACI,SAAS,CAAC,KAA4B;QAEzC,IAAG,CAAC,KAAK,EACT,CAAC;YACG,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC;8GAdQ,oBAAoB;4GAApB,oBAAoB;;2FAApB,oBAAoB;kBALhC,IAAI;mBACL;oBACI,IAAI,EAAE,gBAAgB;oBACtB,UAAU,EAAE,IAAI;iBACnB","sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * Converts first letter of text to uppercase\n */\n@Pipe(\n{\n name: 'firstUppercase',\n standalone: true,\n})\nexport class FirstUppercaseSAPipe implements PipeTransform\n{\n /**\n * Converts first letter of text to uppercase\n * @param value - Value to be converted\n */\n public transform(value: string|undefined|null): string|undefined|null \n {\n if(!value)\n {\n return value;\n }\n\n return value[0].toUpperCase() + value.substring(1);\n }\n}"]}
1
+ {"version":3,"file":"firstUppercase.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/firstUppercase/firstUppercase.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;;AAElD;;GAEG;AAMH,MAAM,OAAO,oBAAoB;IAE7B;;;OAGG;IACA,SAAS,CAAuC,KAAa;QAE5D,IAAG,CAAC,KAAK,EACT,CAAC;YACG,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAW,CAAC;IACjE,CAAC;8GAdQ,oBAAoB;4GAApB,oBAAoB;;2FAApB,oBAAoB;kBALhC,IAAI;mBACL;oBACI,IAAI,EAAE,gBAAgB;oBACtB,UAAU,EAAE,IAAI;iBACnB","sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * Converts first letter of text to uppercase\n */\n@Pipe(\n{\n name: 'firstUppercase',\n standalone: true,\n})\nexport class FirstUppercaseSAPipe implements PipeTransform\n{\n /**\n * Converts first letter of text to uppercase\n * @param value - Value to be converted\n */\npublic transform<TValue extends string|undefined|null>(value: TValue): TValue \n {\n if(!value)\n {\n return value;\n }\n\n return value[0].toUpperCase() + value.substring(1) as TValue;\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"firstUppercaseLocalize.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/first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AI;oBAChB,IAAI,EAAE,KAAK;iBACd;;0BAqBgB,MAAM;2BAAC,mBAAmB","sourcesContent":["import {Pipe, PipeTransform, Inject, ChangeDetectorRef, OnDestroy} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {STRING_LOCALIZATION} from '../../types/tokens';\nimport {StringLocalization} from '../../services/stringLocalization';\nimport {LocalizeSAPipe} from '../localize/localize.pipe';\nimport {FirstUppercaseSAPipe} from '../firstUppercase/firstUppercase.pipe';\n\n/**\n * Localize strings using 'StringLocalization' and converts first letter of text to uppercase\n */\n@Pipe(\n{\n name: 'firstUppercaseLocalize',\n standalone: true,\n pure: false,\n})\nexport class FirstUppercaseLocalizeSAPipe implements PipeTransform, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Localize pipe used for localizing string\n */\n protected localizePipe: LocalizeSAPipe;\n\n /**\n * Pipe used for transforming first letter to uppercase\n */\n protected firstUppercasePipe: FirstUppercaseSAPipe;\n\n /**\n * Subscription for changes of texts\n */\n protected subscription: Subscription|undefined|null;\n\n //######################### constructor #########################\n constructor(@Inject(STRING_LOCALIZATION) protected localizationSvc: StringLocalization,\n protected changeDetector: ChangeDetectorRef,)\n {\n this.localizePipe = new LocalizeSAPipe(localizationSvc, changeDetector);\n this.firstUppercasePipe = new FirstUppercaseSAPipe();\n }\n\n //######################### public methods - PipeTransform #########################\n\n /**\n * Localize strings using 'StringLocalization' and converts first letter of text to uppercase\n * @param value - Value to be converted\n * @param interpolateParams - Optional object storing interpolation parameters\n */\n public transform(value: string|undefined|null, interpolateParams?: Object): string|undefined|null \n {\n return this.firstUppercasePipe.transform(this.localizePipe.transform(value, interpolateParams));\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this.subscription = this.localizationSvc.textsChange.subscribe(() => this.changeDetector.markForCheck());\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.localizePipe.ngOnDestroy();\n }\n}"]}
1
+ {"version":3,"file":"firstUppercaseLocalize.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAiB,MAAM,EAAE,iBAAiB,EAAY,MAAM,eAAe,CAAC;AAGxF,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAC,oBAAoB,EAAC,MAAM,uCAAuC,CAAC;;AAE3E;;GAEG;AAOH,MAAM,OAAO,4BAA4B;IAmBrC,iEAAiE;IACjE,YAAmD,eAAmC,EAChE,cAAiC;QADJ,oBAAe,GAAf,eAAe,CAAoB;QAChE,mBAAc,GAAd,cAAc,CAAmB;QAEnD,IAAI,CAAC,YAAY,GAAG,IAAI,cAAc,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;QACxE,IAAI,CAAC,kBAAkB,GAAG,IAAI,oBAAoB,EAAE,CAAC;IACzD,CAAC;IAED,oFAAoF;IAEpF;;;;OAIG;IACI,SAAS,CAAC,KAA4B,EAAE,iBAA0B;QAErE,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC;IACpG,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC;IAC7G,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IACpC,CAAC;8GAzDQ,4BAA4B,kBAoBjB,mBAAmB;4GApB9B,4BAA4B;;2FAA5B,4BAA4B;kBANxC,IAAI;mBACL;oBACI,IAAI,EAAE,wBAAwB;oBAC9B,UAAU,EAAE,IAAI;oBAChB,IAAI,EAAE,KAAK;iBACd;;0BAqBgB,MAAM;2BAAC,mBAAmB","sourcesContent":["import {Pipe, PipeTransform, Inject, ChangeDetectorRef, OnDestroy} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {STRING_LOCALIZATION} from '../../types/tokens';\nimport {StringLocalization} from '../../services/stringLocalization';\nimport {LocalizeSAPipe} from '../localize/localize.pipe';\nimport {FirstUppercaseSAPipe} from '../firstUppercase/firstUppercase.pipe';\n\n/**\n * Localize strings using 'StringLocalization' and converts first letter of text to uppercase\n */\n@Pipe(\n{\n name: 'firstUppercaseLocalize',\n standalone: true,\n pure: false,\n})\nexport class FirstUppercaseLocalizeSAPipe implements PipeTransform, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Localize pipe used for localizing string\n */\n protected localizePipe: LocalizeSAPipe;\n\n /**\n * Pipe used for transforming first letter to uppercase\n */\n protected firstUppercasePipe: FirstUppercaseSAPipe;\n\n /**\n * Subscription for changes of texts\n */\n protected subscription: Subscription|undefined|null;\n\n //######################### constructor #########################\n constructor(@Inject(STRING_LOCALIZATION) protected localizationSvc: StringLocalization,\n protected changeDetector: ChangeDetectorRef,)\n {\n this.localizePipe = new LocalizeSAPipe(localizationSvc, changeDetector);\n this.firstUppercasePipe = new FirstUppercaseSAPipe();\n }\n\n //######################### public methods - PipeTransform #########################\n\n /**\n * Localize strings using 'StringLocalization' and converts first letter of text to uppercase\n * @param value - Value to be converted\n * @param interpolateParams - Optional object storing interpolation parameters\n */\n public transform(value: string|undefined|null, interpolateParams?: Object): string\n {\n return this.firstUppercasePipe.transform(this.localizePipe.transform(value, interpolateParams));\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this.subscription = this.localizationSvc.textsChange.subscribe(() => this.changeDetector.markForCheck());\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.localizePipe.ngOnDestroy();\n }\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/common",
3
- "version": "21.3.0-beta.20241115051814",
3
+ "version": "21.3.0-beta.20241115055546",
4
4
  "description": "Angular module for common angular stuff",
5
5
  "type": "module",
6
6
  "sideEffects": false,
package/src/index.d.ts CHANGED
@@ -12,8 +12,9 @@ export { MultiButtonModule } from './modules/multiButton/modules/multiButton.mod
12
12
  export * from './components';
13
13
  export * from './decorators';
14
14
  export * from './modules/castPipes';
15
- export * from './modules/progressIndicator';
15
+ export * from './modules/file';
16
16
  export * from './modules/logger';
17
+ export * from './modules/progressIndicator';
17
18
  export * from './modules/tooltip';
18
19
  export * from './pipes';
19
20
  export * from './types/host';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,kBAAkB,EAAC,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wEAAwE,CAAC;AAC/G,OAAO,EAAC,oBAAoB,EAAC,MAAM,oEAAoE,CAAC;AACxG,OAAO,EAAC,qBAAqB,EAAC,MAAM,oEAAoE,CAAC;AACzG,OAAO,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAC,iBAAiB,EAAC,MAAM,kDAAkD,CAAC;AACnF,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E,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,OAAO,EAAC,mBAAmB,EAAC,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAC,UAAU,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,gBAAgB,EAAC,MAAM,SAAS,CAAC;AACnG,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,iCAAiC,EAAC,MAAM,0BAA0B,CAAC;AAC3P,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,16 @@
1
+ :host
2
+ {
3
+ display: block;
4
+ position: relative;
5
+ }
6
+
7
+ .input-file
8
+ {
9
+ position: absolute;
10
+ width: 100%;
11
+ height: 100%;
12
+ top: 0;
13
+ left: 0;
14
+ cursor: pointer;
15
+ opacity: 0;
16
+ }
@@ -0,0 +1,85 @@
1
+ import { Signal, TemplateRef, WritableSignal, InputSignalWithTransform, InputSignal, OutputEmitterRef } from '@angular/core';
2
+ import { FileInputDirective, FileTemplateContext } from '../../directive';
3
+ import { FileVisual } from '../../interfaces';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Component used for obtaining file contents from disk
7
+ */
8
+ export declare class FileComponent {
9
+ /**
10
+ * Instance of context for file template
11
+ */
12
+ protected templateContext: Signal<FileTemplateContext>;
13
+ /**
14
+ * Holds current value of file for file input
15
+ */
16
+ protected file: WritableSignal<File | null | undefined>;
17
+ /**
18
+ * Holds current value of files for file input
19
+ */
20
+ protected files: WritableSignal<File[] | null | undefined>;
21
+ /**
22
+ * Holds current value of file name for file input
23
+ */
24
+ protected name: WritableSignal<string | null | undefined>;
25
+ /**
26
+ * Holds current value of files names for file input
27
+ */
28
+ protected names: WritableSignal<string[] | null | undefined>;
29
+ /**
30
+ * Instance template to be displayed as file input
31
+ */
32
+ protected fileTemplate: Signal<TemplateRef<FileTemplateContext>>;
33
+ /**
34
+ * Contains file input directive instance
35
+ */
36
+ protected fileInput: Signal<FileInputDirective>;
37
+ /**
38
+ * Instance of file visual implementation if available
39
+ */
40
+ protected fileVisual: Signal<FileVisual | undefined | null>;
41
+ /**
42
+ * Indication whether is multiple files selection enabled
43
+ */
44
+ multiple: InputSignalWithTransform<boolean, string | boolean>;
45
+ /**
46
+ * Indication whether read file content, working only when `multiple` is not set (for single file)
47
+ */
48
+ readContent: InputSignalWithTransform<boolean, string | boolean>;
49
+ /**
50
+ * Indication whether content of file is binary and it will be read as ArrayBuffer instead of string
51
+ */
52
+ binaryContent: InputSignalWithTransform<boolean, string | boolean>;
53
+ /**
54
+ * Text encoding of read string file content
55
+ */
56
+ textEncoding: InputSignal<string | undefined>;
57
+ /**
58
+ * Occurs when file changes and `binaryContent` is not set and `readContent` is set
59
+ */
60
+ stringContentChange: OutputEmitterRef<string | undefined | null>;
61
+ /**
62
+ * Occurs when file changes and `binaryContent` is set and `readContent` is set
63
+ */
64
+ arrayBufferContentChange: OutputEmitterRef<ArrayBuffer | undefined | null>;
65
+ /**
66
+ * Occurs when selected file changes, occurs only when `multiple` is not set
67
+ */
68
+ fileChange: OutputEmitterRef<File | null | undefined>;
69
+ /**
70
+ * Occurs when selected files changes, occurs only when `multiple` is set
71
+ */
72
+ filesChange: OutputEmitterRef<File[] | null | undefined>;
73
+ /**
74
+ * Occurs when selected file changes, occurs only when `multiple` is not set, contains name of selected file
75
+ */
76
+ fileName: OutputEmitterRef<string | null | undefined>;
77
+ /**
78
+ * Occurs when selected files changes, occurs only when `multiple` is set, contains names of selected files
79
+ */
80
+ filesNames: OutputEmitterRef<string[] | null | undefined>;
81
+ constructor();
82
+ static ɵfac: i0.ɵɵFactoryDeclaration<FileComponent, never>;
83
+ static ɵcmp: i0.ɵɵComponentDeclaration<FileComponent, "file", never, { "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "readContent": { "alias": "readContent"; "required": false; "isSignal": true; }; "binaryContent": { "alias": "binaryContent"; "required": false; "isSignal": true; }; "textEncoding": { "alias": "textEncoding"; "required": false; "isSignal": true; }; }, { "stringContentChange": "stringContentChange"; "arrayBufferContentChange": "arrayBufferContentChange"; "fileChange": "fileChange"; "filesChange": "filesChange"; "fileName": "fileName"; "filesNames": "filesNames"; }, ["fileTemplate", "fileVisual"], never, true, never>;
84
+ }
85
+ //# sourceMappingURL=file.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.component.d.ts","sourceRoot":"","sources":["file.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmD,MAAM,EAAE,WAAW,EAAuB,cAAc,EAAU,wBAAwB,EAA2B,WAAW,EAAE,gBAAgB,EAAiB,MAAM,eAAe,CAAC;AAGnP,OAAO,EAAC,kBAAkB,EAAE,mBAAmB,EAAwB,MAAM,iBAAiB,CAAC;AAE/F,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;;AAE5C;;GAEG;AACH,qBAaa,aAAa;IAItB;;OAEG;IACH,SAAS,CAAC,eAAe,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAEvD;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,GAAC,IAAI,GAAC,SAAS,CAAC,CAAgB;IAEnE;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,GAAC,IAAI,GAAC,SAAS,CAAC,CAAgB;IAEtE;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM,GAAC,IAAI,GAAC,SAAS,CAAC,CAAgB;IAErE;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,GAAC,IAAI,GAAC,SAAS,CAAC,CAAgB;IAIxE;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAA0F;IAE1J;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAA0C;IAEzF;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,GAAC,SAAS,GAAC,IAAI,CAAC,CAA6B;IAIpF;;OAEG;IACI,QAAQ,EAAE,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAC,OAAO,CAAC,CAAwE;IAE1I;;OAEG;IACI,WAAW,EAAE,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAC,OAAO,CAAC,CAAwE;IAE7I;;OAEG;IACI,aAAa,EAAE,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAC,OAAO,CAAC,CAAwE;IAE/I;;OAEG;IACI,YAAY,EAAE,WAAW,CAAC,MAAM,GAAC,SAAS,CAAC,CAAW;IAI7D;;OAEG;IACI,mBAAmB,EAAE,gBAAgB,CAAC,MAAM,GAAC,SAAS,GAAC,IAAI,CAAC,CAAmC;IAEtG;;OAEG;IACI,wBAAwB,EAAE,gBAAgB,CAAC,WAAW,GAAC,SAAS,GAAC,IAAI,CAAC,CAAwC;IAErH;;OAEG;IACI,UAAU,EAAE,gBAAgB,CAAC,IAAI,GAAC,IAAI,GAAC,SAAS,CAAC,CAAiC;IAEzF;;OAEG;IACI,WAAW,EAAE,gBAAgB,CAAC,IAAI,EAAE,GAAC,IAAI,GAAC,SAAS,CAAC,CAAmC;IAE9F;;OAEG;IACI,QAAQ,EAAE,gBAAgB,CAAC,MAAM,GAAC,IAAI,GAAC,SAAS,CAAC,CAAmC;IAE3F;;OAEG;IACI,UAAU,EAAE,gBAAgB,CAAC,MAAM,EAAE,GAAC,IAAI,GAAC,SAAS,CAAC,CAAqC;;yCAlGxF,aAAa;2CAAb,aAAa;CAyIzB"}
@@ -0,0 +1,14 @@
1
+ <ng-container *ngTemplateOutlet="fileTemplate(); context: templateContext()"/>
2
+
3
+ <input type="file"
4
+ class="input-file"
5
+ (fileChange)="file.set($event); fileChange.emit($event)"
6
+ (filesChange)="files.set($event); filesChange.emit($event)"
7
+ (fileName)="name.set($event); fileName.emit($event)"
8
+ (filesNames)="names.set($event); filesNames.emit($event)"
9
+ (stringContentChange)="stringContentChange.emit($event)"
10
+ (arrayBufferContentChange)="arrayBufferContentChange.emit($event)"
11
+ [multiple]="multiple()"
12
+ [binaryContent]="binaryContent()"
13
+ [readContent]="readContent()"
14
+ [textEncoding]="textEncoding()">
@@ -0,0 +1,27 @@
1
+ :host
2
+ {
3
+ display: block;
4
+ }
5
+
6
+ .file-input
7
+ {
8
+ display: grid;
9
+
10
+ grid-template-areas: 'button filename';
11
+ grid-template-rows: auto;
12
+ grid-template-columns: auto 1fr;
13
+
14
+ :nth-child(1),
15
+ :nth-child(1):before
16
+ {
17
+ border-top-right-radius: 0;
18
+ border-bottom-right-radius: 0;
19
+ }
20
+
21
+ :nth-child(2),
22
+ :nth-child(2):before
23
+ {
24
+ border-top-left-radius: 0;
25
+ border-bottom-left-radius: 0;
26
+ }
27
+ }
@@ -0,0 +1,37 @@
1
+ import { WritableSignal, InputSignal, Signal } from '@angular/core';
2
+ import { FileVisual } from '../../interfaces';
3
+ import { FileTemplateContext } from '../../directive';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Component that represents file input template
7
+ */
8
+ export declare class FileInputComponent implements FileVisual {
9
+ /**
10
+ * Selected text value based on file template context or selected text input
11
+ */
12
+ protected selectedTextValue: Signal<string | undefined | null>;
13
+ /**
14
+ * @inheritdoc
15
+ */
16
+ fileTemplateContext: WritableSignal<FileTemplateContext | undefined | null>;
17
+ /**
18
+ * Text to be displayed for file button
19
+ */
20
+ buttonText: InputSignal<string>;
21
+ /**
22
+ * Css classes applied to file button
23
+ */
24
+ buttonClass: InputSignal<string>;
25
+ /**
26
+ * Css classes applied to file text, text displaying selected files
27
+ */
28
+ textClass: InputSignal<string>;
29
+ /**
30
+ * Text to be displayed as selected
31
+ */
32
+ selectedText: InputSignal<string | undefined | null>;
33
+ constructor();
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<FileInputComponent, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<FileInputComponent, "file-input", never, { "buttonText": { "alias": "buttonText"; "required": false; "isSignal": true; }; "buttonClass": { "alias": "buttonClass"; "required": false; "isSignal": true; }; "textClass": { "alias": "textClass"; "required": false; "isSignal": true; }; "selectedText": { "alias": "selectedText"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
36
+ }
37
+ //# sourceMappingURL=fileInput.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileInput.component.d.ts","sourceRoot":"","sources":["fileInput.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmE,cAAc,EAAiB,WAAW,EAAE,MAAM,EAAW,MAAM,eAAe,CAAC;AAK7J,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;;AAEpD;;GAEG;AACH,qBAqBa,kBAAmB,YAAW,UAAU;IAIjD;;OAEG;IACH,SAAS,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,GAAC,SAAS,GAAC,IAAI,CAAC,CAAC;IAI3D;;OAEG;IACI,mBAAmB,EAAE,cAAc,CAAC,mBAAmB,GAAC,SAAS,GAAC,IAAI,CAAC,CAAoD;IAIlI;;OAEG;IACI,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAmB;IAEzD;;OAEG;IACI,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAA4B;IAEnE;;OAEG;IACI,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAyB;IAE9D;;OAEG;IACI,YAAY,EAAE,WAAW,CAAC,MAAM,GAAC,SAAS,GAAC,IAAI,CAAC,CAAW;;yCApCzD,kBAAkB;2CAAlB,kBAAkB;CAqD9B"}
@@ -0,0 +1,7 @@
1
+ <div class="file-input">
2
+ <div [ngClass]="buttonClass()">
3
+ <span>{{buttonText() | firstUppercaseLocalize}}</span>
4
+ </div>
5
+
6
+ <div [ngClass]="textClass()">{{selectedTextValue()}}</div>
7
+ </div>
@@ -0,0 +1,4 @@
1
+ export * from './file/file.component';
2
+ export * from './fileInput/fileInput.component';
3
+ export * from './uploadButton/uploadButton.component';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC"}
@@ -0,0 +1,52 @@
1
+ :host
2
+ {
3
+ display: flex;
4
+ flex-direction: row;
5
+ }
6
+
7
+ .progress
8
+ {
9
+ font-size: 0.75em;
10
+ position: relative;
11
+ width: 33px;
12
+ height: 33px;
13
+ text-align: center;
14
+ margin-right: 4px;
15
+ display: flex;
16
+ justify-content: center;
17
+ }
18
+
19
+ .progress-value
20
+ {
21
+ align-self: center;
22
+ }
23
+
24
+ .progress-indicator
25
+ {
26
+ position: absolute;
27
+ width: 33px;
28
+ height: 16.5px;
29
+ top: 0;
30
+ left: 0;
31
+ border: 2px solid #009dd6;
32
+ border-bottom: none;
33
+ border-top-left-radius: 100px;
34
+ border-top-right-radius: 100px;
35
+ animation-name: rotate-progress;
36
+ animation-duration: 550ms;
37
+ animation-iteration-count: infinite;
38
+ animation-timing-function: linear;
39
+ transform-origin: calc(50%) calc(50% + 8.25px);
40
+ }
41
+
42
+ @keyframes rotate-progress
43
+ {
44
+ from
45
+ {
46
+ transform: rotate(0deg);
47
+ }
48
+ to
49
+ {
50
+ transform: rotate(360deg);
51
+ }
52
+ }
@@ -0,0 +1,36 @@
1
+ import { WritableSignal, InputSignal, InputSignalWithTransform } from '@angular/core';
2
+ import { FileVisual } from '../../interfaces';
3
+ import { FileTemplateContext } from '../../directive';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Component that represents upload button file template
7
+ */
8
+ export declare class UploadButtonComponent implements FileVisual {
9
+ /**
10
+ * @inheritdoc
11
+ */
12
+ fileTemplateContext: WritableSignal<FileTemplateContext | undefined | null>;
13
+ /**
14
+ * Css classes applied tu button icon
15
+ */
16
+ uploadIconClass: InputSignal<string>;
17
+ /**
18
+ * Text to be displayed as button text
19
+ */
20
+ uploadText: InputSignal<string>;
21
+ /**
22
+ * Css classes for displayed text for button
23
+ */
24
+ uploadTextClass: InputSignal<string>;
25
+ /**
26
+ * Css class applied to button
27
+ */
28
+ cssClass: InputSignal<string>;
29
+ /**
30
+ * Current progress to be displayed
31
+ */
32
+ progress: InputSignalWithTransform<number | undefined | null, number | string | undefined | null>;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<UploadButtonComponent, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<UploadButtonComponent, "upload-button", never, { "uploadIconClass": { "alias": "uploadIconClass"; "required": false; "isSignal": true; }; "uploadText": { "alias": "uploadText"; "required": false; "isSignal": true; }; "uploadTextClass": { "alias": "uploadTextClass"; "required": false; "isSignal": true; }; "cssClass": { "alias": "class"; "required": false; "isSignal": true; }; "progress": { "alias": "progress"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
35
+ }
36
+ //# sourceMappingURL=uploadButton.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadButton.component.d.ts","sourceRoot":"","sources":["uploadButton.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmE,cAAc,EAAU,WAAW,EAA0B,wBAAwB,EAAC,MAAM,eAAe,CAAC;AAKtL,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;;AAEpD;;GAEG;AACH,qBAsBa,qBAAsB,YAAW,UAAU;IAIpD;;OAEG;IACI,mBAAmB,EAAE,cAAc,CAAC,mBAAmB,GAAC,SAAS,GAAC,IAAI,CAAC,CAAoD;IAIlI;;OAEG;IACI,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAA+B;IAE1E;;OAEG;IACI,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAa;IAEnD;;OAEG;IACI,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAmC;IAE9E;;OAEG;IACI,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAA2C;IAE/E;;OAEG;IACI,QAAQ,EAAE,wBAAwB,CAAC,MAAM,GAAC,SAAS,GAAC,IAAI,EAAE,MAAM,GAAC,MAAM,GAAC,SAAS,GAAC,IAAI,CAAC,CAAkG;yCAlCvL,qBAAqB;2CAArB,qBAAqB;CAmCjC"}
@@ -0,0 +1,16 @@
1
+ @if(progress() | isPresent)
2
+ {
3
+ <div class="progress">
4
+ <span class="progress-value">{{progress()}}%</span>
5
+ <div class="progress-indicator"></div>
6
+ </div>
7
+ }
8
+
9
+ <button [ngClass]="cssClass()" type="button">
10
+ <span [ngClass]="uploadIconClass()"></span>
11
+
12
+ @if(uploadText())
13
+ {
14
+ <span [ngClass]="uploadTextClass()">{{uploadText() | localize}}</span>
15
+ }
16
+ </button>
@@ -0,0 +1,69 @@
1
+ import { ElementRef, InputSignal, InputSignalWithTransform, OnDestroy, OutputEmitterRef, Renderer2 } from '@angular/core';
2
+ import { NoopAction } from '@jscrpt/common';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Directive that allows better communication with input file
6
+ */
7
+ export declare class FileInputDirective implements OnDestroy {
8
+ protected element: ElementRef<HTMLInputElement>;
9
+ /**
10
+ * Unlistener for input file change event
11
+ */
12
+ protected changeListenerUnlisten: NoopAction;
13
+ /**
14
+ * Indication whether is multiple files selection enabled
15
+ */
16
+ multiple: InputSignalWithTransform<boolean, string | boolean>;
17
+ /**
18
+ * Indication whether read file content, working only when `multiple` is not set (for single file)
19
+ */
20
+ readContent: InputSignalWithTransform<boolean, string | boolean>;
21
+ /**
22
+ * Indication whether content of file is binary and it will be read as ArrayBuffer instead of string
23
+ */
24
+ binaryContent: InputSignalWithTransform<boolean, string | boolean>;
25
+ /**
26
+ * Text encoding of read string file content
27
+ */
28
+ textEncoding: InputSignal<string | undefined>;
29
+ /**
30
+ * Occurs when file changes and `binaryContent` is not set and `readContent` is set
31
+ */
32
+ stringContentChange: OutputEmitterRef<string | undefined | null>;
33
+ /**
34
+ * Occurs when file changes and `binaryContent` is set and `readContent` is set
35
+ */
36
+ arrayBufferContentChange: OutputEmitterRef<ArrayBuffer | undefined | null>;
37
+ /**
38
+ * Occurs when selected file changes, occurs only when `multiple` is not set
39
+ */
40
+ fileChange: OutputEmitterRef<File | null | undefined>;
41
+ /**
42
+ * Occurs when selected files changes, occurs only when `multiple` is set
43
+ */
44
+ filesChange: OutputEmitterRef<File[] | null | undefined>;
45
+ /**
46
+ * Occurs when selected file changes, occurs only when `multiple` is not set, contains name of selected file
47
+ */
48
+ fileName: OutputEmitterRef<string | null | undefined>;
49
+ /**
50
+ * Occurs when selected files changes, occurs only when `multiple` is set, contains names of selected files
51
+ */
52
+ filesNames: OutputEmitterRef<string[] | null | undefined>;
53
+ constructor(element: ElementRef<HTMLInputElement>, renderer: Renderer2);
54
+ /**
55
+ * @inheritdoc
56
+ */
57
+ ngOnDestroy(): void;
58
+ /**
59
+ * Clears selection of file/files
60
+ */
61
+ clearFile(): void;
62
+ /**
63
+ * Handles changes in file input
64
+ */
65
+ protected handleFileChange(event: MouseEvent): void;
66
+ static ɵfac: i0.ɵɵFactoryDeclaration<FileInputDirective, never>;
67
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FileInputDirective, "input[type=file]", ["file"], { "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "readContent": { "alias": "readContent"; "required": false; "isSignal": true; }; "binaryContent": { "alias": "binaryContent"; "required": false; "isSignal": true; }; "textEncoding": { "alias": "textEncoding"; "required": false; "isSignal": true; }; }, { "stringContentChange": "stringContentChange"; "arrayBufferContentChange": "arrayBufferContentChange"; "fileChange": "fileChange"; "filesChange": "filesChange"; "fileName": "fileName"; "filesNames": "filesNames"; }, never, never, true, never>;
68
+ }
69
+ //# sourceMappingURL=file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