@anglr/common 22.0.0-beta.20241115045223 → 22.0.0-beta.20250123101532
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/changelog.md +106 -1
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js +5 -4
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
- package/es2022/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +4 -4
- package/es2022/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -1
- package/es2022/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js +4 -4
- package/es2022/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js.map +1 -1
- package/es2022/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js +4 -4
- package/es2022/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js.map +1 -1
- package/es2022/forms/src/directives/groupHasError/groupHasError.directive.js +4 -5
- package/es2022/forms/src/directives/groupHasError/groupHasError.directive.js.map +1 -1
- package/es2022/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js +3 -4
- package/es2022/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js.map +1 -1
- package/es2022/forms/src/directives/hasError/hasError.directive.js +3 -4
- package/es2022/forms/src/directives/hasError/hasError.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/maxValueNumberValidator.directive.js +5 -5
- package/es2022/forms/src/directives/numberInput/maxValueNumberValidator.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/minValueNumberValidator.directive.js +5 -5
- package/es2022/forms/src/directives/numberInput/minValueNumberValidator.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.js +4 -4
- package/es2022/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/numberInputValidator.directive.js +5 -5
- package/es2022/forms/src/directives/numberInput/numberInputValidator.directive.js.map +1 -1
- package/es2022/forms/src/directives/requiredClass/requiredClass.directive.js +3 -4
- package/es2022/forms/src/directives/requiredClass/requiredClass.directive.js.map +1 -1
- package/es2022/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js +3 -4
- package/es2022/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js.map +1 -1
- package/es2022/forms/src/misc/utils.js +2 -1
- package/es2022/forms/src/misc/utils.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +14 -9
- package/es2022/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.js +4 -4
- package/es2022/forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.js +4 -4
- package/es2022/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/modules/errorMessage.module.js +5 -13
- package/es2022/forms/src/modules/errorMessage/modules/errorMessage.module.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.js +3 -3
- package/es2022/forms/src/modules/formPipes/modules/formPipes.module.js +5 -5
- package/es2022/forms/src/modules/formPipes/modules/formPipes.module.js.map +1 -1
- package/es2022/forms/src/modules/formPipes/pipes/asFormArray/asFormArray.pipe.js +3 -3
- package/es2022/forms/src/modules/formPipes/pipes/asFormControl/asFormControl.pipe.js +3 -3
- package/es2022/forms/src/modules/formPipes/pipes/asFormGroup/asFormGroup.pipe.js +3 -3
- package/es2022/forms/src/modules/formPipes/pipes/getControl/getControl.pipe.js +3 -3
- package/es2022/forms/src/modules/hasError.module.js +4 -4
- package/es2022/forms/src/modules/numberInput.module.js +7 -7
- package/es2022/forms/src/modules/numberInput.module.js.map +1 -1
- package/es2022/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js +5 -4
- package/es2022/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js.map +1 -1
- package/es2022/forms/src/services/formModelBuilder/formModelBuilder.service.js +3 -3
- package/es2022/forms/src/services/submitted/submitted.service.js +3 -3
- package/es2022/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js +4 -4
- package/es2022/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js.map +1 -1
- package/es2022/hotkeys/src/components/cheatSheet/cheatSheet.component.js +4 -4
- package/es2022/hotkeys/src/components/cheatSheet/cheatSheet.component.js.map +1 -1
- package/es2022/hotkeys/src/services/appHotkeys.service.js +3 -3
- package/es2022/material/src/components/confirmationDialog/confirmationDialog.component.js +10 -7
- package/es2022/material/src/components/confirmationDialog/confirmationDialog.component.js.map +1 -1
- package/es2022/material/src/components/movableTitledDialog/movableTitledDialog.component.js +12 -7
- package/es2022/material/src/components/movableTitledDialog/movableTitledDialog.component.js.map +1 -1
- package/es2022/material/src/components/titledDialog/titledDialog.component.js +9 -6
- package/es2022/material/src/components/titledDialog/titledDialog.component.js.map +1 -1
- package/es2022/material/src/directives/confirmationDialog/confirmationDialog.directive.js +3 -4
- package/es2022/material/src/directives/confirmationDialog/confirmationDialog.directive.js.map +1 -1
- package/es2022/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.js +3 -4
- package/es2022/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.js.map +1 -1
- package/es2022/material/src/modules/confirmationDialog.module.js +6 -15
- package/es2022/material/src/modules/confirmationDialog.module.js.map +1 -1
- package/es2022/material/src/modules/debugDataCopyClick.module.js +4 -4
- package/es2022/material/src/modules/movableTitledDialog.module.js +7 -8
- package/es2022/material/src/modules/movableTitledDialog.module.js.map +1 -1
- package/es2022/material/src/modules/titledDialog.module.js +5 -16
- package/es2022/material/src/modules/titledDialog.module.js.map +1 -1
- package/es2022/material/src/services/titledDialog/titledDialog.service.js +3 -3
- package/es2022/router/src/services/routing/dataRouter.js +3 -3
- package/es2022/router/src/services/routing/dataRouterData.js +3 -3
- package/es2022/src/components/collapsibleIcon/collapsibleIcon.component.js +6 -6
- package/es2022/src/components/collapsibleIcon/collapsibleIcon.component.js.map +1 -1
- package/es2022/src/components/collapsibleTitle/collapsibleTitle.component.js +4 -4
- package/es2022/src/components/collapsibleTitle/collapsibleTitle.component.js.map +1 -1
- package/es2022/src/decorators/asSignal/asSignal.decorator.js.map +1 -1
- package/es2022/src/decorators/componentDisplay/componentDisplay.decorator.js.map +1 -1
- package/es2022/src/decorators/componentDisplayBlock/componentDisplayBlock.decorator.js.map +1 -1
- package/es2022/src/decorators/componentDisplayFlex/componentDisplayFlex.decorator.js.map +1 -1
- package/es2022/src/decorators/componentHostStyle/componentHostStyle.decorator.js.map +1 -1
- package/es2022/src/decorators/scrollableContent/scrollableContent.decorator.js.map +1 -1
- package/es2022/src/decorators/typeProvider/typeProvider.decorator.js +0 -1
- package/es2022/src/decorators/typeProvider/typeProvider.decorator.js.map +1 -1
- package/es2022/src/decorators/withFullscreenContentCssClass/withFullscreenContentCssClass.decorator.js.map +1 -1
- package/es2022/src/directives/bodyRender/bodyRender.directive.js +3 -4
- package/es2022/src/directives/bodyRender/bodyRender.directive.js.map +1 -1
- package/es2022/src/directives/clickOutside/clickOutside.directive.js +4 -5
- package/es2022/src/directives/clickOutside/clickOutside.directive.js.map +1 -1
- package/es2022/src/directives/ellipsisTooltip/ellipsisTooltip.directive.js +3 -4
- package/es2022/src/directives/ellipsisTooltip/ellipsisTooltip.directive.js.map +1 -1
- package/es2022/src/directives/goBack/goBack.directive.js +3 -4
- package/es2022/src/directives/goBack/goBack.directive.js.map +1 -1
- package/es2022/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.js +3 -4
- package/es2022/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.js.map +1 -1
- package/es2022/src/directives/positionTo/positionTo.directive.js +4 -5
- package/es2022/src/directives/positionTo/positionTo.directive.js.map +1 -1
- package/es2022/src/index.js +2 -1
- package/es2022/src/index.js.map +1 -1
- package/es2022/src/modules/castPipes/modules/castPipes.module.js +5 -5
- package/es2022/src/modules/castPipes/modules/castPipes.module.js.map +1 -1
- package/es2022/src/modules/castPipes/pipes/asHtmlElement/asHtmlElement.pipe.js +3 -3
- package/es2022/src/modules/castPipes/pipes/asNgClassRequired/asNgClassRequired.pipe.js +3 -3
- package/es2022/src/modules/castPipes/pipes/asRequired/asRequired.pipe.js +3 -3
- package/es2022/src/modules/castPipes/pipes/castType/castType.pipe.js +3 -3
- package/es2022/src/modules/commonDynamic.module.js +4 -4
- package/es2022/src/modules/commonLocalize.module.js +7 -7
- package/es2022/src/modules/commonLocalize.module.js.map +1 -1
- package/es2022/src/modules/commonUtils.module.js +9 -9
- package/es2022/src/modules/commonUtils.module.js.map +1 -1
- package/es2022/src/modules/debugData/components/debugData/debugData.component.js +4 -4
- package/es2022/src/modules/debugData/components/debugData/debugData.component.js.map +1 -1
- package/es2022/src/modules/debugData/modules/debugData.module.js +4 -4
- package/es2022/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.js +3 -3
- package/es2022/src/modules/file/components/file/file.component.js +119 -0
- package/es2022/src/modules/file/components/file/file.component.js.map +1 -0
- package/es2022/src/modules/file/components/fileInput/fileInput.component.js +62 -0
- package/es2022/src/modules/file/components/fileInput/fileInput.component.js.map +1 -0
- package/es2022/src/modules/file/components/index.js +4 -0
- package/es2022/src/modules/file/components/index.js.map +1 -0
- package/es2022/src/modules/file/components/uploadButton/uploadButton.component.js +59 -0
- package/es2022/src/modules/file/components/uploadButton/uploadButton.component.js.map +1 -0
- package/es2022/src/modules/file/directive/fileInput/fileInput.directive.js +153 -0
- package/es2022/src/modules/file/directive/fileInput/fileInput.directive.js.map +1 -0
- package/es2022/src/modules/file/directive/fileTemplate/fileTemplate.context.js +2 -0
- package/es2022/src/modules/file/directive/fileTemplate/fileTemplate.context.js.map +1 -0
- package/es2022/src/modules/file/directive/fileTemplate/fileTemplate.directive.js +23 -0
- package/es2022/src/modules/file/directive/fileTemplate/fileTemplate.directive.js.map +1 -0
- package/es2022/src/modules/file/directive/index.js +4 -0
- package/es2022/src/modules/file/directive/index.js.map +1 -0
- package/es2022/src/modules/file/index.js +6 -0
- package/es2022/src/modules/file/index.js.map +1 -0
- package/es2022/src/modules/file/interfaces/fileVisual/fileVisual.interface.js +2 -0
- package/es2022/src/modules/file/interfaces/fileVisual/fileVisual.interface.js.map +1 -0
- package/es2022/src/modules/file/interfaces/index.js +2 -0
- package/es2022/src/modules/file/interfaces/index.js.map +1 -0
- package/es2022/src/modules/file/misc/tokens.js +6 -0
- package/es2022/src/modules/file/misc/tokens.js.map +1 -0
- package/es2022/src/modules/file/modules/file.module.js +40 -0
- package/es2022/src/modules/file/modules/file.module.js.map +1 -0
- package/es2022/src/modules/file/modules/index.js +2 -0
- package/es2022/src/modules/file/modules/index.js.map +1 -0
- package/es2022/src/modules/logger/components/console/console.component.js +5 -5
- package/es2022/src/modules/logger/components/console/console.component.js.map +1 -1
- package/es2022/src/modules/logger/services/console/consoleComponent.service.js +3 -3
- package/es2022/src/modules/logger/services/console/consoleComponentService.options.js +3 -3
- package/es2022/src/modules/logger/services/logger/logger.service.js +3 -3
- package/es2022/src/modules/logger/services/rest/restSink.options.js +3 -3
- package/es2022/src/modules/logger/types/loggerOptions.js +3 -3
- package/es2022/src/modules/multiButton/components/multiButton/multiButton.component.js +9 -7
- package/es2022/src/modules/multiButton/components/multiButton/multiButton.component.js.map +1 -1
- package/es2022/src/modules/multiButton/modules/multiButton.module.js +5 -9
- package/es2022/src/modules/multiButton/modules/multiButton.module.js.map +1 -1
- package/es2022/src/modules/progressIndicator/components/progressIndicator/progressIndicator.component.js +9 -6
- package/es2022/src/modules/progressIndicator/components/progressIndicator/progressIndicator.component.js.map +1 -1
- package/es2022/src/modules/progressIndicator/directives/progressOverlay/progressOverlay.directive.js +4 -4
- package/es2022/src/modules/progressIndicator/directives/progressOverlay/progressOverlay.directive.js.map +1 -1
- package/es2022/src/modules/progressIndicator/interceptors/progressInterceptor.js +4 -4
- package/es2022/src/modules/progressIndicator/interceptors/progressInterceptor.js.map +1 -1
- package/es2022/src/modules/progressIndicator/modules/progressIndicator.module.js +7 -15
- package/es2022/src/modules/progressIndicator/modules/progressIndicator.module.js.map +1 -1
- package/es2022/src/modules/progressIndicator/services/progressIndicator.service.js +3 -3
- package/es2022/src/modules/progressIndicator/services/progressIndicatorOptions.js.map +1 -1
- package/es2022/src/modules/tooltip/components/tooltip/tooltip.component.js +7 -5
- package/es2022/src/modules/tooltip/components/tooltip/tooltip.component.js.map +1 -1
- package/es2022/src/modules/tooltip/directives/tooltip/tooltip.directive.js +5 -5
- package/es2022/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +1 -1
- package/es2022/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.js +3 -3
- package/es2022/src/modules/tooltip/modules/tooltip.module.js +6 -10
- package/es2022/src/modules/tooltip/modules/tooltip.module.js.map +1 -1
- package/es2022/src/pipes/displayProperties/displayProperties.pipe.js +3 -4
- package/es2022/src/pipes/displayProperties/displayProperties.pipe.js.map +1 -1
- package/es2022/src/pipes/firstUppercase/firstUppercase.pipe.js +4 -5
- package/es2022/src/pipes/firstUppercase/firstUppercase.pipe.js.map +1 -1
- package/es2022/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.js +8 -9
- package/es2022/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.js.map +1 -1
- package/es2022/src/pipes/isNaN/isNaN.pipe.js +3 -4
- package/es2022/src/pipes/isNaN/isNaN.pipe.js.map +1 -1
- package/es2022/src/pipes/isPresent/isPresent.pipe.js +3 -4
- package/es2022/src/pipes/isPresent/isPresent.pipe.js.map +1 -1
- package/es2022/src/pipes/keys/keys.pipe.js +4 -4
- package/es2022/src/pipes/keys/keys.pipe.js.map +1 -1
- package/es2022/src/pipes/localize/localize.pipe.js +4 -5
- package/es2022/src/pipes/localize/localize.pipe.js.map +1 -1
- package/es2022/src/pipes/mergeCssClasses/mergeCssClasses.pipe.js +5 -5
- package/es2022/src/pipes/mergeCssClasses/mergeCssClasses.pipe.js.map +1 -1
- package/es2022/src/pipes/numeral/numeral.pipe.js +4 -4
- package/es2022/src/pipes/numeral/numeral.pipe.js.map +1 -1
- package/es2022/src/pipes/trimText/trimText.pipe.js +4 -4
- package/es2022/src/pipes/trimText/trimText.pipe.js.map +1 -1
- package/es2022/src/pipes/urlEncode/urlEncode.pipe.js +4 -4
- package/es2022/src/pipes/urlEncode/urlEncode.pipe.js.map +1 -1
- package/es2022/src/services/cookies/cookies.service.js +3 -3
- package/es2022/src/services/notifications/defaultNotifications.service.js +3 -3
- package/es2022/src/services/permanentStorage/cookiePermanentStorage.service.js +3 -3
- package/es2022/src/services/statusCode/statusCode.service.js +3 -3
- package/es2022/src/services/stringLocalization/noStringLocalization.service.js +3 -3
- package/es2022/src/services/temporaryStorage/memoryTemporaryStorage.service.js +3 -3
- package/es2022/store/src/services/permanentStorage/localPermanentStorage.service.js +3 -3
- package/es2022/store/src/services/temporaryStorage/sessionTemporaryStorage.service.js +3 -3
- package/eslint.config.js +6 -0
- package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
- package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.d.ts.map +1 -1
- package/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.d.ts.map +1 -1
- package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.d.ts.map +1 -1
- package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.html +1 -1
- package/forms/src/directives/groupHasError/groupHasError.directive.d.ts.map +1 -1
- package/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.d.ts.map +1 -1
- package/forms/src/directives/hasError/hasError.directive.d.ts.map +1 -1
- package/forms/src/directives/numberInput/maxValueNumberValidator.directive.d.ts +1 -1
- package/forms/src/directives/numberInput/minValueNumberValidator.directive.d.ts +1 -1
- package/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.d.ts +1 -1
- package/forms/src/directives/numberInput/numberInputValidator.directive.d.ts +1 -1
- package/forms/src/directives/requiredClass/requiredClass.directive.d.ts.map +1 -1
- package/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.d.ts.map +1 -1
- package/forms/src/misc/utils.d.ts.map +1 -1
- package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.d.ts +1 -1
- package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.d.ts.map +1 -1
- package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.html +4 -3
- package/forms/src/modules/errorMessage/directives/errorMessage/errorMessage.directive.d.ts +1 -1
- package/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.d.ts +1 -1
- package/forms/src/modules/errorMessage/modules/errorMessage.module.d.ts +1 -3
- package/forms/src/modules/errorMessage/modules/errorMessage.module.d.ts.map +1 -1
- package/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.d.ts +1 -1
- package/forms/src/modules/formPipes/modules/formPipes.module.d.ts +1 -1
- package/forms/src/modules/formPipes/pipes/asFormArray/asFormArray.pipe.d.ts +1 -1
- package/forms/src/modules/formPipes/pipes/asFormControl/asFormControl.pipe.d.ts +1 -1
- package/forms/src/modules/formPipes/pipes/asFormGroup/asFormGroup.pipe.d.ts +1 -1
- package/forms/src/modules/formPipes/pipes/getControl/getControl.pipe.d.ts +1 -1
- package/forms/src/modules/numberInput.module.d.ts +1 -1
- package/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.d.ts.map +1 -1
- package/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.d.ts.map +1 -1
- package/hotkeys/src/components/cheatSheet/cheatSheet.component.d.ts.map +1 -1
- package/material/src/components/confirmationDialog/confirmationDialog.component.d.ts +1 -1
- package/material/src/components/confirmationDialog/confirmationDialog.component.d.ts.map +1 -1
- package/material/src/components/movableTitledDialog/movableTitledDialog.component.d.ts +1 -1
- package/material/src/components/movableTitledDialog/movableTitledDialog.component.d.ts.map +1 -1
- package/material/src/components/movableTitledDialog/movableTitledDialog.component.html +1 -1
- package/material/src/components/titledDialog/titledDialog.component.d.ts +1 -1
- package/material/src/components/titledDialog/titledDialog.component.d.ts.map +1 -1
- package/material/src/components/titledDialog/titledDialog.component.html +2 -2
- package/material/src/directives/confirmationDialog/confirmationDialog.directive.d.ts.map +1 -1
- package/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.d.ts.map +1 -1
- package/material/src/modules/confirmationDialog.module.d.ts +4 -6
- package/material/src/modules/confirmationDialog.module.d.ts.map +1 -1
- package/material/src/modules/movableTitledDialog.module.d.ts +5 -5
- package/material/src/modules/movableTitledDialog.module.d.ts.map +1 -1
- package/material/src/modules/titledDialog.module.d.ts +2 -4
- package/material/src/modules/titledDialog.module.d.ts.map +1 -1
- package/package.json +44 -44
- package/router/src/decorators/moduleRoutes.decorator.d.ts.map +1 -1
- package/src/components/collapsibleIcon/collapsibleIcon.component.d.ts.map +1 -1
- package/src/components/collapsibleTitle/collapsibleTitle.component.d.ts.map +1 -1
- package/src/decorators/typeProvider/typeProvider.decorator.d.ts.map +1 -1
- package/src/directives/bodyRender/bodyRender.directive.d.ts.map +1 -1
- package/src/directives/clickOutside/clickOutside.directive.d.ts +3 -3
- package/src/directives/clickOutside/clickOutside.directive.d.ts.map +1 -1
- package/src/directives/ellipsisTooltip/ellipsisTooltip.directive.d.ts.map +1 -1
- package/src/directives/goBack/goBack.directive.d.ts.map +1 -1
- package/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.d.ts.map +1 -1
- package/src/directives/positionTo/positionTo.directive.d.ts +3 -3
- package/src/directives/positionTo/positionTo.directive.d.ts.map +1 -1
- package/src/index.d.ts +2 -1
- package/src/index.d.ts.map +1 -1
- package/src/modules/castPipes/modules/castPipes.module.d.ts +1 -1
- package/src/modules/castPipes/pipes/asHtmlElement/asHtmlElement.pipe.d.ts +1 -1
- package/src/modules/castPipes/pipes/asNgClassRequired/asNgClassRequired.pipe.d.ts +1 -1
- package/src/modules/castPipes/pipes/asRequired/asRequired.pipe.d.ts +1 -1
- package/src/modules/castPipes/pipes/castType/castType.pipe.d.ts +1 -1
- package/src/modules/commonLocalize.module.d.ts +1 -1
- package/src/modules/commonUtils.module.d.ts +1 -1
- package/src/modules/debugData/components/debugData/debugData.component.d.ts.map +1 -1
- package/src/modules/file/components/file/file.component.css +16 -0
- package/src/modules/file/components/file/file.component.d.ts +85 -0
- package/src/modules/file/components/file/file.component.d.ts.map +1 -0
- package/src/modules/file/components/file/file.component.html +14 -0
- package/src/modules/file/components/fileInput/fileInput.component.css +27 -0
- package/src/modules/file/components/fileInput/fileInput.component.d.ts +37 -0
- package/src/modules/file/components/fileInput/fileInput.component.d.ts.map +1 -0
- package/src/modules/file/components/fileInput/fileInput.component.html +7 -0
- package/src/modules/file/components/index.d.ts +4 -0
- package/src/modules/file/components/index.d.ts.map +1 -0
- package/src/modules/file/components/uploadButton/uploadButton.component.css +52 -0
- package/src/modules/file/components/uploadButton/uploadButton.component.d.ts +36 -0
- package/src/modules/file/components/uploadButton/uploadButton.component.d.ts.map +1 -0
- package/src/modules/file/components/uploadButton/uploadButton.component.html +16 -0
- package/src/modules/file/directive/fileInput/fileInput.directive.d.ts +69 -0
- package/src/modules/file/directive/fileInput/fileInput.directive.d.ts.map +1 -0
- package/src/modules/file/directive/fileTemplate/fileTemplate.context.d.ts +30 -0
- package/src/modules/file/directive/fileTemplate/fileTemplate.context.d.ts.map +1 -0
- package/src/modules/file/directive/fileTemplate/fileTemplate.directive.d.ts +14 -0
- package/src/modules/file/directive/fileTemplate/fileTemplate.directive.d.ts.map +1 -0
- package/src/modules/file/directive/index.d.ts +4 -0
- package/src/modules/file/directive/index.d.ts.map +1 -0
- package/src/modules/file/index.d.ts +6 -0
- package/src/modules/file/index.d.ts.map +1 -0
- package/src/modules/file/interfaces/fileVisual/fileVisual.interface.d.ts +12 -0
- package/src/modules/file/interfaces/fileVisual/fileVisual.interface.d.ts.map +1 -0
- package/src/modules/file/interfaces/index.d.ts +2 -0
- package/src/modules/file/interfaces/index.d.ts.map +1 -0
- package/src/modules/file/misc/tokens.d.ts +7 -0
- package/src/modules/file/misc/tokens.d.ts.map +1 -0
- package/src/modules/file/modules/file.module.d.ts +15 -0
- package/src/modules/file/modules/file.module.d.ts.map +1 -0
- package/src/modules/file/modules/index.d.ts +2 -0
- package/src/modules/file/modules/index.d.ts.map +1 -0
- package/src/modules/logger/components/console/console.component.d.ts +3 -3
- package/src/modules/logger/components/console/console.component.d.ts.map +1 -1
- package/src/modules/multiButton/components/multiButton/multiButton.component.d.ts +1 -1
- package/src/modules/multiButton/components/multiButton/multiButton.component.d.ts.map +1 -1
- package/src/modules/multiButton/components/multiButton/multiButton.component.html +1 -1
- package/src/modules/multiButton/modules/multiButton.module.d.ts +1 -2
- package/src/modules/multiButton/modules/multiButton.module.d.ts.map +1 -1
- package/src/modules/progressIndicator/components/progressIndicator/progressIndicator.component.d.ts +1 -1
- package/src/modules/progressIndicator/components/progressIndicator/progressIndicator.component.d.ts.map +1 -1
- package/src/modules/progressIndicator/components/progressIndicator/progressIndicator.component.html +4 -1
- package/src/modules/progressIndicator/directives/progressOverlay/progressOverlay.directive.d.ts +1 -1
- package/src/modules/progressIndicator/directives/progressOverlay/progressOverlay.directive.d.ts.map +1 -1
- package/src/modules/progressIndicator/modules/progressIndicator.module.d.ts +1 -3
- package/src/modules/progressIndicator/modules/progressIndicator.module.d.ts.map +1 -1
- package/src/modules/tooltip/components/tooltip/tooltip.component.d.ts +1 -1
- package/src/modules/tooltip/components/tooltip/tooltip.component.d.ts.map +1 -1
- package/src/modules/tooltip/components/tooltip/tooltip.component.html +13 -5
- package/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts.map +1 -1
- package/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.d.ts +1 -1
- package/src/modules/tooltip/modules/tooltip.module.d.ts +4 -5
- package/src/modules/tooltip/modules/tooltip.module.d.ts.map +1 -1
- package/src/pipes/displayProperties/displayProperties.pipe.d.ts.map +1 -1
- package/src/pipes/firstUppercase/firstUppercase.pipe.d.ts +4 -4
- package/src/pipes/firstUppercase/firstUppercase.pipe.d.ts.map +1 -1
- package/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.d.ts +8 -8
- package/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.d.ts.map +1 -1
- package/src/pipes/isNaN/isNaN.pipe.d.ts.map +1 -1
- package/src/pipes/isPresent/isPresent.pipe.d.ts.map +1 -1
- package/src/pipes/localize/localize.pipe.d.ts +3 -3
- package/src/pipes/localize/localize.pipe.d.ts.map +1 -1
- package/src/pipes/mergeCssClasses/mergeCssClasses.pipe.d.ts +3 -3
- package/src/pipes/mergeCssClasses/mergeCssClasses.pipe.d.ts.map +1 -1
- package/version.bak +1 -1
|
@@ -5,11 +5,11 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
* Module that contains debug data component
|
|
6
6
|
*/
|
|
7
7
|
export class DebugDataModule {
|
|
8
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
9
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
10
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
8
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: DebugDataModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
9
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0", ngImport: i0, type: DebugDataModule, imports: [DebugDataComponent], exports: [DebugDataComponent] }); }
|
|
10
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: DebugDataModule }); }
|
|
11
11
|
}
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: DebugDataModule, decorators: [{
|
|
13
13
|
type: NgModule,
|
|
14
14
|
args: [{
|
|
15
15
|
imports: [
|
|
@@ -26,10 +26,10 @@ export class DebugDataEnabledService {
|
|
|
26
26
|
setEnabled(enabled = true) {
|
|
27
27
|
this._enabled.set(enabled);
|
|
28
28
|
}
|
|
29
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
30
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
29
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: DebugDataEnabledService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
30
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: DebugDataEnabledService, providedIn: 'root' }); }
|
|
31
31
|
}
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: DebugDataEnabledService, decorators: [{
|
|
33
33
|
type: Injectable,
|
|
34
34
|
args: [{ providedIn: 'root' }]
|
|
35
35
|
}] });
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, contentChild, TemplateRef, viewChild, computed, signal, input, booleanAttribute, output, effect } from '@angular/core';
|
|
2
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
3
|
+
import { FileInputDirective, FileTemplateDirective } from '../../directive';
|
|
4
|
+
import { FILE_VISUAL } from '../../misc/tokens';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Component used for obtaining file contents from disk
|
|
8
|
+
*/
|
|
9
|
+
export class FileComponent {
|
|
10
|
+
//######################### constructor #########################
|
|
11
|
+
constructor() {
|
|
12
|
+
/**
|
|
13
|
+
* Holds current value of file for file input
|
|
14
|
+
*/
|
|
15
|
+
this.file = signal(null);
|
|
16
|
+
/**
|
|
17
|
+
* Holds current value of files for file input
|
|
18
|
+
*/
|
|
19
|
+
this.files = signal(null);
|
|
20
|
+
/**
|
|
21
|
+
* Holds current value of file name for file input
|
|
22
|
+
*/
|
|
23
|
+
this.name = signal(null);
|
|
24
|
+
/**
|
|
25
|
+
* Holds current value of files names for file input
|
|
26
|
+
*/
|
|
27
|
+
this.names = signal(null);
|
|
28
|
+
//######################### protected properties - children #########################
|
|
29
|
+
/**
|
|
30
|
+
* Instance template to be displayed as file input
|
|
31
|
+
*/
|
|
32
|
+
this.fileTemplate = contentChild.required(FileTemplateDirective, { read: (TemplateRef) });
|
|
33
|
+
/**
|
|
34
|
+
* Contains file input directive instance
|
|
35
|
+
*/
|
|
36
|
+
this.fileInput = viewChild.required(FileInputDirective);
|
|
37
|
+
/**
|
|
38
|
+
* Instance of file visual implementation if available
|
|
39
|
+
*/
|
|
40
|
+
this.fileVisual = contentChild(FILE_VISUAL);
|
|
41
|
+
//######################### public properties - inputs #########################
|
|
42
|
+
/**
|
|
43
|
+
* Indication whether is multiple files selection enabled
|
|
44
|
+
*/
|
|
45
|
+
this.multiple = input(false, { transform: booleanAttribute });
|
|
46
|
+
/**
|
|
47
|
+
* Indication whether read file content, working only when `multiple` is not set (for single file)
|
|
48
|
+
*/
|
|
49
|
+
this.readContent = input(false, { transform: booleanAttribute });
|
|
50
|
+
/**
|
|
51
|
+
* Indication whether content of file is binary and it will be read as ArrayBuffer instead of string
|
|
52
|
+
*/
|
|
53
|
+
this.binaryContent = input(false, { transform: booleanAttribute });
|
|
54
|
+
/**
|
|
55
|
+
* Text encoding of read string file content
|
|
56
|
+
*/
|
|
57
|
+
this.textEncoding = input();
|
|
58
|
+
//######################### public properties - outputs #########################
|
|
59
|
+
/**
|
|
60
|
+
* Occurs when file changes and `binaryContent` is not set and `readContent` is set
|
|
61
|
+
*/
|
|
62
|
+
this.stringContentChange = output();
|
|
63
|
+
/**
|
|
64
|
+
* Occurs when file changes and `binaryContent` is set and `readContent` is set
|
|
65
|
+
*/
|
|
66
|
+
this.arrayBufferContentChange = output();
|
|
67
|
+
/**
|
|
68
|
+
* Occurs when selected file changes, occurs only when `multiple` is not set
|
|
69
|
+
*/
|
|
70
|
+
this.fileChange = output();
|
|
71
|
+
/**
|
|
72
|
+
* Occurs when selected files changes, occurs only when `multiple` is set
|
|
73
|
+
*/
|
|
74
|
+
this.filesChange = output();
|
|
75
|
+
/**
|
|
76
|
+
* Occurs when selected file changes, occurs only when `multiple` is not set, contains name of selected file
|
|
77
|
+
*/
|
|
78
|
+
this.fileName = output();
|
|
79
|
+
/**
|
|
80
|
+
* Occurs when selected files changes, occurs only when `multiple` is set, contains names of selected files
|
|
81
|
+
*/
|
|
82
|
+
this.filesNames = output();
|
|
83
|
+
effect(() => {
|
|
84
|
+
const fileVisual = this.fileVisual();
|
|
85
|
+
if (fileVisual) {
|
|
86
|
+
const fileInput = this.fileInput();
|
|
87
|
+
fileVisual.fileTemplateContext.set({
|
|
88
|
+
file: this.file(),
|
|
89
|
+
files: this.files(),
|
|
90
|
+
clearFile: fileInput.clearFile,
|
|
91
|
+
fileName: this.name(),
|
|
92
|
+
filesNames: this.names(),
|
|
93
|
+
multiple: this.multiple(),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}, { allowSignalWrites: true });
|
|
97
|
+
this.templateContext = computed(() => {
|
|
98
|
+
const fileInput = this.fileInput();
|
|
99
|
+
return {
|
|
100
|
+
file: this.file(),
|
|
101
|
+
files: this.files(),
|
|
102
|
+
clearFile: fileInput.clearFile,
|
|
103
|
+
fileName: this.name(),
|
|
104
|
+
filesNames: this.names(),
|
|
105
|
+
multiple: this.multiple(),
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: FileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
110
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.1.0", type: FileComponent, isStandalone: true, selector: "file", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, readContent: { classPropertyName: "readContent", publicName: "readContent", isSignal: true, isRequired: false, transformFunction: null }, binaryContent: { classPropertyName: "binaryContent", publicName: "binaryContent", isSignal: true, isRequired: false, transformFunction: null }, textEncoding: { classPropertyName: "textEncoding", publicName: "textEncoding", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stringContentChange: "stringContentChange", arrayBufferContentChange: "arrayBufferContentChange", fileChange: "fileChange", filesChange: "filesChange", fileName: "fileName", filesNames: "filesNames" }, queries: [{ propertyName: "fileTemplate", first: true, predicate: FileTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "fileVisual", first: true, predicate: FILE_VISUAL, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: FileInputDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"fileTemplate(); context: templateContext()\"/>\n\n<input type=\"file\" \n class=\"input-file\"\n (fileChange)=\"file.set($event); fileChange.emit($event)\"\n (filesChange)=\"files.set($event); filesChange.emit($event)\"\n (fileName)=\"name.set($event); fileName.emit($event)\"\n (filesNames)=\"names.set($event); filesNames.emit($event)\"\n (stringContentChange)=\"stringContentChange.emit($event)\"\n (arrayBufferContentChange)=\"arrayBufferContentChange.emit($event)\"\n [multiple]=\"multiple()\"\n [binaryContent]=\"binaryContent()\"\n [readContent]=\"readContent()\"\n [textEncoding]=\"textEncoding()\">", styles: [":host\n{\n display: block;\n position: relative;\n}\n\n.input-file\n{\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n cursor: pointer;\n opacity: 0;\n}"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: FileInputDirective, selector: "input[type=file]", inputs: ["multiple", "readContent", "binaryContent", "textEncoding"], outputs: ["stringContentChange", "arrayBufferContentChange", "fileChange", "filesChange", "fileName", "filesNames"], exportAs: ["file"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
111
|
+
}
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: FileComponent, decorators: [{
|
|
113
|
+
type: Component,
|
|
114
|
+
args: [{ selector: 'file', imports: [
|
|
115
|
+
NgTemplateOutlet,
|
|
116
|
+
FileInputDirective,
|
|
117
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngTemplateOutlet=\"fileTemplate(); context: templateContext()\"/>\n\n<input type=\"file\" \n class=\"input-file\"\n (fileChange)=\"file.set($event); fileChange.emit($event)\"\n (filesChange)=\"files.set($event); filesChange.emit($event)\"\n (fileName)=\"name.set($event); fileName.emit($event)\"\n (filesNames)=\"names.set($event); filesNames.emit($event)\"\n (stringContentChange)=\"stringContentChange.emit($event)\"\n (arrayBufferContentChange)=\"arrayBufferContentChange.emit($event)\"\n [multiple]=\"multiple()\"\n [binaryContent]=\"binaryContent()\"\n [readContent]=\"readContent()\"\n [textEncoding]=\"textEncoding()\">", styles: [":host\n{\n display: block;\n position: relative;\n}\n\n.input-file\n{\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n cursor: pointer;\n opacity: 0;\n}"] }]
|
|
118
|
+
}], ctorParameters: () => [] });
|
|
119
|
+
//# sourceMappingURL=file.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.component.js","sourceRoot":"","sources":["../../../../../../src/modules/file/components/file/file.component.ts","../../../../../../src/modules/file/components/file/file.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,YAAY,EAAU,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,EAA4B,KAAK,EAAE,gBAAgB,EAAiC,MAAM,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACnP,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAC,kBAAkB,EAAuB,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;;AAG9C;;GAEG;AAaH,MAAM,OAAO,aAAa;IAoGtB,iEAAiE;IACjE;QA5FA;;WAEG;QACO,SAAI,GAAwC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEnE;;WAEG;QACO,UAAK,GAA0C,MAAM,CAAC,IAAI,CAAC,CAAC;QAEtE;;WAEG;QACO,SAAI,GAA0C,MAAM,CAAC,IAAI,CAAC,CAAC;QAErE;;WAEG;QACO,UAAK,GAA4C,MAAM,CAAC,IAAI,CAAC,CAAC;QAExE,qFAAqF;QAErF;;WAEG;QACO,iBAAY,GAA6C,YAAY,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAC,IAAI,EAAE,CAAA,WAAgC,CAAA,EAAC,CAAC,CAAC;QAE1J;;WAEG;QACO,cAAS,GAA+B,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QAEzF;;WAEG;QACO,eAAU,GAAsC,YAAY,CAAC,WAAW,CAAC,CAAC;QAEpF,gFAAgF;QAEhF;;WAEG;QACI,aAAQ,GAAsD,KAAK,CAA0B,KAAK,EAAE,EAAC,SAAS,EAAE,g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AAE;YAEjC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAEnC,OAAO;gBACH,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;gBACjB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;gBACnB,SAAS,EAAE,SAAS,CAAC,SAAS;gBAC9B,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE;gBACrB,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE;gBACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;aAC5B,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;8GAxIQ,aAAa;kGAAb,aAAa,m3BAkCmE,qBAAqB,2BAAS,WAAW,0EAU3D,WAAW,2GALb,kBAAkB,gEC7D3F,qsBAauC,wQDI/B,gBAAgB,oJAChB,kBAAkB;;2FAIb,aAAa;kBAZzB,SAAS;+BAEI,MAAM,WAIhB;wBACI,gBAAgB;wBAChB,kBAAkB;qBACrB,mBACgB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, contentChild, Signal, TemplateRef, viewChild, computed, WritableSignal, signal, InputSignalWithTransform, input, booleanAttribute, InputSignal, OutputEmitterRef, output, effect} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\n\nimport {FileInputDirective, FileTemplateContext, FileTemplateDirective} from '../../directive';\nimport {FILE_VISUAL} from '../../misc/tokens';\nimport {FileVisual} from '../../interfaces';\n\n/**\n * Component used for obtaining file contents from disk\n */\n@Component(\n{\n selector: 'file',\n templateUrl: 'file.component.html',\n styleUrl: 'file.component.css',\n imports:\n [\n NgTemplateOutlet,\n FileInputDirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FileComponent\n{\n //######################### protected properties - template bindings #########################\n\n /**\n * Instance of context for file template\n */\n protected templateContext: Signal<FileTemplateContext>;\n\n /**\n * Holds current value of file for file input\n */\n protected file: WritableSignal<File|null|undefined> = signal(null);\n\n /**\n * Holds current value of files for file input\n */\n protected files: WritableSignal<File[]|null|undefined> = signal(null);\n\n /**\n * Holds current value of file name for file input\n */\n protected name: WritableSignal<string|null|undefined> = signal(null);\n\n /**\n * Holds current value of files names for file input\n */\n protected names: WritableSignal<string[]|null|undefined> = signal(null);\n\n //######################### protected properties - children #########################\n\n /**\n * Instance template to be displayed as file input\n */\n protected fileTemplate: Signal<TemplateRef<FileTemplateContext>> = contentChild.required(FileTemplateDirective, {read: TemplateRef<FileTemplateContext>});\n\n /**\n * Contains file input directive instance\n */\n protected fileInput: Signal<FileInputDirective> = viewChild.required(FileInputDirective);\n\n /**\n * Instance of file visual implementation if available\n */\n protected fileVisual: Signal<FileVisual|undefined|null> = contentChild(FILE_VISUAL);\n\n //######################### public properties - inputs #########################\n\n /**\n * Indication whether is multiple files selection enabled\n */\n public multiple: InputSignalWithTransform<boolean, string|boolean> = input<boolean, boolean|string>(false, {transform: booleanAttribute});\n\n /**\n * Indication whether read file content, working only when `multiple` is not set (for single file)\n */\n public readContent: InputSignalWithTransform<boolean, string|boolean> = input<boolean, boolean|string>(false, {transform: booleanAttribute});\n\n /**\n * Indication whether content of file is binary and it will be read as ArrayBuffer instead of string\n */\n public binaryContent: InputSignalWithTransform<boolean, string|boolean> = input<boolean, boolean|string>(false, {transform: booleanAttribute});\n\n /**\n * Text encoding of read string file content\n */\n public textEncoding: InputSignal<string|undefined> = input();\n\n //######################### public properties - outputs #########################\n\n /**\n * Occurs when file changes and `binaryContent` is not set and `readContent` is set\n */\n public stringContentChange: OutputEmitterRef<string|undefined|null> = output<string|undefined|null>();\n\n /**\n * Occurs when file changes and `binaryContent` is set and `readContent` is set\n */\n public arrayBufferContentChange: OutputEmitterRef<ArrayBuffer|undefined|null> = output<ArrayBuffer|undefined|null>();\n\n /**\n * Occurs when selected file changes, occurs only when `multiple` is not set\n */\n public fileChange: OutputEmitterRef<File|null|undefined> = output<File|undefined|null>();\n\n /**\n * Occurs when selected files changes, occurs only when `multiple` is set\n */\n public filesChange: OutputEmitterRef<File[]|null|undefined> = output<File[]|undefined|null>();\n\n /**\n * Occurs when selected file changes, occurs only when `multiple` is not set, contains name of selected file\n */\n public fileName: OutputEmitterRef<string|null|undefined> = output<string|undefined|null>();\n\n /**\n * Occurs when selected files changes, occurs only when `multiple` is set, contains names of selected files\n */\n public filesNames: OutputEmitterRef<string[]|null|undefined> = output<string[]|undefined|null>();\n\n //######################### constructor #########################\n constructor()\n {\n effect(() =>\n {\n const fileVisual = this.fileVisual();\n\n if(fileVisual)\n {\n const fileInput = this.fileInput();\n \n fileVisual.fileTemplateContext.set(\n {\n file: this.file(),\n files: this.files(),\n clearFile: fileInput.clearFile,\n fileName: this.name(),\n filesNames: this.names(),\n multiple: this.multiple(),\n });\n }\n }, {allowSignalWrites: true});\n\n this.templateContext = computed(() =>\n {\n const fileInput = this.fileInput();\n\n return {\n file: this.file(),\n files: this.files(),\n clearFile: fileInput.clearFile,\n fileName: this.name(),\n filesNames: this.names(),\n multiple: this.multiple(),\n };\n });\n }\n}","<ng-container *ngTemplateOutlet=\"fileTemplate(); context: templateContext()\"/>\n\n<input type=\"file\" \n class=\"input-file\"\n (fileChange)=\"file.set($event); fileChange.emit($event)\"\n (filesChange)=\"files.set($event); filesChange.emit($event)\"\n (fileName)=\"name.set($event); fileName.emit($event)\"\n (filesNames)=\"names.set($event); filesNames.emit($event)\"\n (stringContentChange)=\"stringContentChange.emit($event)\"\n (arrayBufferContentChange)=\"arrayBufferContentChange.emit($event)\"\n [multiple]=\"multiple()\"\n [binaryContent]=\"binaryContent()\"\n [readContent]=\"readContent()\"\n [textEncoding]=\"textEncoding()\">"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, forwardRef, signal, input, computed } from '@angular/core';
|
|
2
|
+
import { NgClass } from '@angular/common';
|
|
3
|
+
import { FirstUppercaseLocalizePipe } from '@anglr/common';
|
|
4
|
+
import { FILE_VISUAL } from '../../misc/tokens';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Component that represents file input template
|
|
8
|
+
*/
|
|
9
|
+
export class FileInputComponent {
|
|
10
|
+
//######################### constructor #########################
|
|
11
|
+
constructor() {
|
|
12
|
+
//######################### public properties - implementation of FileVisual #########################
|
|
13
|
+
/**
|
|
14
|
+
* @inheritdoc
|
|
15
|
+
*/
|
|
16
|
+
this.fileTemplateContext = signal(null);
|
|
17
|
+
//######################### public properties - inputs #########################
|
|
18
|
+
/**
|
|
19
|
+
* Text to be displayed for file button
|
|
20
|
+
*/
|
|
21
|
+
this.buttonText = input('browse');
|
|
22
|
+
/**
|
|
23
|
+
* Css classes applied to file button
|
|
24
|
+
*/
|
|
25
|
+
this.buttonClass = input('btn btn-primary');
|
|
26
|
+
/**
|
|
27
|
+
* Css classes applied to file text, text displaying selected files
|
|
28
|
+
*/
|
|
29
|
+
this.textClass = input('form-control');
|
|
30
|
+
/**
|
|
31
|
+
* Text to be displayed as selected
|
|
32
|
+
*/
|
|
33
|
+
this.selectedText = input();
|
|
34
|
+
this.selectedTextValue = computed(() => {
|
|
35
|
+
const context = this.fileTemplateContext();
|
|
36
|
+
if (context?.multiple) {
|
|
37
|
+
return this.selectedText() ?? context.filesNames?.join(', ');
|
|
38
|
+
}
|
|
39
|
+
return this.selectedText() ?? context?.fileName;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: FileInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
43
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.0", type: FileInputComponent, isStandalone: true, selector: "file-input", inputs: { buttonText: { classPropertyName: "buttonText", publicName: "buttonText", isSignal: true, isRequired: false, transformFunction: null }, buttonClass: { classPropertyName: "buttonClass", publicName: "buttonClass", isSignal: true, isRequired: false, transformFunction: null }, textClass: { classPropertyName: "textClass", publicName: "textClass", isSignal: true, isRequired: false, transformFunction: null }, selectedText: { classPropertyName: "selectedText", publicName: "selectedText", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
44
|
+
{
|
|
45
|
+
provide: FILE_VISUAL,
|
|
46
|
+
useExisting: forwardRef(() => FileInputComponent),
|
|
47
|
+
}
|
|
48
|
+
], ngImport: i0, template: "<div class=\"file-input\">\n <div [ngClass]=\"buttonClass()\">\n <span>{{buttonText() | firstUppercaseLocalize}}</span>\n </div>\n\n <div [ngClass]=\"textClass()\">{{selectedTextValue()}}</div>\n</div>\n", styles: [":host\n{\n display: block;\n}\n\n.file-input\n{\n display: grid;\n\n grid-template-areas: 'button filename';\n grid-template-rows: auto;\n grid-template-columns: auto 1fr;\n\n :nth-child(1),\n :nth-child(1):before\n {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n :nth-child(2),\n :nth-child(2):before\n {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: FirstUppercaseLocalizePipe, name: "firstUppercaseLocalize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
49
|
+
}
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: FileInputComponent, decorators: [{
|
|
51
|
+
type: Component,
|
|
52
|
+
args: [{ selector: 'file-input', imports: [
|
|
53
|
+
NgClass,
|
|
54
|
+
FirstUppercaseLocalizePipe,
|
|
55
|
+
], providers: [
|
|
56
|
+
{
|
|
57
|
+
provide: FILE_VISUAL,
|
|
58
|
+
useExisting: forwardRef(() => FileInputComponent),
|
|
59
|
+
}
|
|
60
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"file-input\">\n <div [ngClass]=\"buttonClass()\">\n <span>{{buttonText() | firstUppercaseLocalize}}</span>\n </div>\n\n <div [ngClass]=\"textClass()\">{{selectedTextValue()}}</div>\n</div>\n", styles: [":host\n{\n display: block;\n}\n\n.file-input\n{\n display: grid;\n\n grid-template-areas: 'button filename';\n grid-template-rows: auto;\n grid-template-columns: auto 1fr;\n\n :nth-child(1),\n :nth-child(1):before\n {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n :nth-child(2),\n :nth-child(2):before\n {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n}\n"] }]
|
|
61
|
+
}], ctorParameters: () => [] });
|
|
62
|
+
//# sourceMappingURL=fileInput.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileInput.component.js","sourceRoot":"","sources":["../../../../../../src/modules/file/components/fileInput/fileInput.component.ts","../../../../../../src/modules/file/components/fileInput/fileInput.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAoB,UAAU,EAAkB,MAAM,EAAE,KAAK,EAAuB,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC7J,OAAO,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAC,0BAA0B,EAAC,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;;AAI9C;;GAEG;AAqBH,MAAM,OAAO,kBAAkB;IAsC3B,iEAAiE;IACjE;QA9BA,sGAAsG;QAEtG;;WAEG;QACI,wBAAmB,GAAuD,MAAM,CAAqC,IAAI,CAAC,CAAC;QAElI,gFAAgF;QAEhF;;WAEG;QACI,eAAU,GAAwB,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEzD;;WAEG;QACI,gBAAW,GAAwB,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAEnE;;WAEG;QACI,cAAS,GAAwB,KAAK,CAAC,cAAc,CAAC,CAAC;QAE9D;;WAEG;QACI,iBAAY,GAAuC,KAAK,EAAE,CAAC;QAK9D,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,GAAG,EAAE;YAEnC,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAE3C,IAAG,OAAO,EAAE,QAAQ,EACpB,CAAC;gBACG,OAAO,IAAI,CAAC,YAAY,EAAE,IAAI,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACjE,CAAC;YAED,OAAO,IAAI,CAAC,YAAY,EAAE,IAAI,OAAO,EAAE,QAAQ,CAAC;QACpD,CAAC,CAAC,CAAC;IACP,CAAC;8GApDQ,kBAAkB;kGAAlB,kBAAkB,umBAT3B;YAEI;gBACI,OAAO,EAAE,WAAW;gBACpB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC;aACpD;SACJ,0BC5BL,6NAOA,6gBDWQ,OAAO,+EACP,0BAA0B;;2FAYrB,kBAAkB;kBApB9B,SAAS;+BAEI,YAAY,WAItB;wBACI,OAAO;wBACP,0BAA0B;qBAC7B,aAED;wBAEI;4BACI,OAAO,EAAE,WAAW;4BACpB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,mBAAmB,CAAC;yBACpD;qBACJ,mBACgB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, ExistingProvider, forwardRef, WritableSignal, signal, input, InputSignal, Signal, computed} from '@angular/core';\nimport {NgClass} from '@angular/common';\nimport {FirstUppercaseLocalizePipe} from '@anglr/common';\n\nimport {FILE_VISUAL} from '../../misc/tokens';\nimport {FileVisual} from '../../interfaces';\nimport {FileTemplateContext} from '../../directive';\n\n/**\n * Component that represents file input template\n */\n@Component(\n{\n selector: 'file-input',\n templateUrl: 'fileInput.component.html',\n styleUrl: 'fileInput.component.css',\n imports:\n [\n NgClass,\n FirstUppercaseLocalizePipe,\n ],\n providers:\n [\n <ExistingProvider>\n {\n provide: FILE_VISUAL,\n useExisting: forwardRef(() => FileInputComponent),\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FileInputComponent implements FileVisual\n{\n //######################### protected properties - template bindings #########################\n\n /**\n * Selected text value based on file template context or selected text input\n */\n protected selectedTextValue: Signal<string|undefined|null>;\n \n //######################### public properties - implementation of FileVisual #########################\n\n /**\n * @inheritdoc\n */\n public fileTemplateContext: WritableSignal<FileTemplateContext|undefined|null> = signal<FileTemplateContext|undefined|null>(null);\n\n //######################### public properties - inputs #########################\n\n /**\n * Text to be displayed for file button\n */\n public buttonText: InputSignal<string> = input('browse');\n\n /**\n * Css classes applied to file button\n */\n public buttonClass: InputSignal<string> = input('btn btn-primary');\n\n /**\n * Css classes applied to file text, text displaying selected files\n */\n public textClass: InputSignal<string> = input('form-control');\n\n /**\n * Text to be displayed as selected\n */\n public selectedText: InputSignal<string|undefined|null> = input();\n\n //######################### constructor #########################\n constructor()\n {\n this.selectedTextValue = computed(() =>\n {\n const context = this.fileTemplateContext();\n\n if(context?.multiple)\n {\n return this.selectedText() ?? context.filesNames?.join(', ');\n }\n\n return this.selectedText() ?? context?.fileName;\n });\n }\n}","<div class=\"file-input\">\n <div [ngClass]=\"buttonClass()\">\n <span>{{buttonText() | firstUppercaseLocalize}}</span>\n </div>\n\n <div [ngClass]=\"textClass()\">{{selectedTextValue()}}</div>\n</div>\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/file/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC","sourcesContent":["export * from './file/file.component';\nexport * from './fileInput/fileInput.component';\nexport * from './uploadButton/uploadButton.component';\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, forwardRef, signal, input, numberAttribute } from '@angular/core';
|
|
2
|
+
import { NgClass } from '@angular/common';
|
|
3
|
+
import { IsPresentPipe, LocalizePipe } from '@anglr/common';
|
|
4
|
+
import { FILE_VISUAL } from '../../misc/tokens';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Component that represents upload button file template
|
|
8
|
+
*/
|
|
9
|
+
export class UploadButtonComponent {
|
|
10
|
+
constructor() {
|
|
11
|
+
//######################### public properties - implementation of FileVisual #########################
|
|
12
|
+
/**
|
|
13
|
+
* @inheritdoc
|
|
14
|
+
*/
|
|
15
|
+
this.fileTemplateContext = signal(null);
|
|
16
|
+
//######################### public properties - inputs #########################
|
|
17
|
+
/**
|
|
18
|
+
* Css classes applied tu button icon
|
|
19
|
+
*/
|
|
20
|
+
this.uploadIconClass = input('fas fa-file-upload');
|
|
21
|
+
/**
|
|
22
|
+
* Text to be displayed as button text
|
|
23
|
+
*/
|
|
24
|
+
this.uploadText = input('');
|
|
25
|
+
/**
|
|
26
|
+
* Css classes for displayed text for button
|
|
27
|
+
*/
|
|
28
|
+
this.uploadTextClass = input('first-letter-uppercase');
|
|
29
|
+
/**
|
|
30
|
+
* Css class applied to button
|
|
31
|
+
*/
|
|
32
|
+
this.cssClass = input('btn btn-icon', { alias: 'class' });
|
|
33
|
+
/**
|
|
34
|
+
* Current progress to be displayed
|
|
35
|
+
*/
|
|
36
|
+
this.progress = input(null, { transform: numberAttribute });
|
|
37
|
+
}
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: UploadButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
39
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.0", type: UploadButtonComponent, isStandalone: true, selector: "upload-button", inputs: { uploadIconClass: { classPropertyName: "uploadIconClass", publicName: "uploadIconClass", isSignal: true, isRequired: false, transformFunction: null }, uploadText: { classPropertyName: "uploadText", publicName: "uploadText", isSignal: true, isRequired: false, transformFunction: null }, uploadTextClass: { classPropertyName: "uploadTextClass", publicName: "uploadTextClass", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
40
|
+
{
|
|
41
|
+
provide: FILE_VISUAL,
|
|
42
|
+
useExisting: forwardRef(() => UploadButtonComponent),
|
|
43
|
+
}
|
|
44
|
+
], ngImport: i0, template: "@if(progress() | isPresent)\n{\n <div class=\"progress\">\n <span class=\"progress-value\">{{progress()}}%</span>\n <div class=\"progress-indicator\"></div>\n </div>\n}\n\n<button [ngClass]=\"cssClass()\" type=\"button\">\n <span [ngClass]=\"uploadIconClass()\"></span>\n \n @if(uploadText())\n {\n <span [ngClass]=\"uploadTextClass()\">{{uploadText() | localize}}</span>\n }\n</button>", styles: [":host\n{\n display: flex;\n flex-direction: row;\n}\n\n.progress\n{\n font-size: 0.75em;\n position: relative;\n width: 33px;\n height: 33px;\n text-align: center;\n margin-right: 4px;\n display: flex;\n justify-content: center;\n}\n\n.progress-value\n{\n align-self: center;\n}\n\n.progress-indicator\n{\n position: absolute;\n width: 33px;\n height: 16.5px;\n top: 0;\n left: 0;\n border: 2px solid #009dd6;\n border-bottom: none;\n border-top-left-radius: 100px;\n border-top-right-radius: 100px;\n animation-name: rotate-progress;\n animation-duration: 550ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n transform-origin: calc(50%) calc(50% + 8.25px);\n}\n\n@keyframes rotate-progress\n{\n from\n {\n transform: rotate(0deg);\n }\n to\n {\n transform: rotate(360deg);\n }\n}"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: IsPresentPipe, name: "isPresent" }, { kind: "pipe", type: LocalizePipe, name: "localize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: UploadButtonComponent, decorators: [{
|
|
47
|
+
type: Component,
|
|
48
|
+
args: [{ selector: 'upload-button', imports: [
|
|
49
|
+
NgClass,
|
|
50
|
+
IsPresentPipe,
|
|
51
|
+
LocalizePipe,
|
|
52
|
+
], providers: [
|
|
53
|
+
{
|
|
54
|
+
provide: FILE_VISUAL,
|
|
55
|
+
useExisting: forwardRef(() => UploadButtonComponent),
|
|
56
|
+
}
|
|
57
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if(progress() | isPresent)\n{\n <div class=\"progress\">\n <span class=\"progress-value\">{{progress()}}%</span>\n <div class=\"progress-indicator\"></div>\n </div>\n}\n\n<button [ngClass]=\"cssClass()\" type=\"button\">\n <span [ngClass]=\"uploadIconClass()\"></span>\n \n @if(uploadText())\n {\n <span [ngClass]=\"uploadTextClass()\">{{uploadText() | localize}}</span>\n }\n</button>", styles: [":host\n{\n display: flex;\n flex-direction: row;\n}\n\n.progress\n{\n font-size: 0.75em;\n position: relative;\n width: 33px;\n height: 33px;\n text-align: center;\n margin-right: 4px;\n display: flex;\n justify-content: center;\n}\n\n.progress-value\n{\n align-self: center;\n}\n\n.progress-indicator\n{\n position: absolute;\n width: 33px;\n height: 16.5px;\n top: 0;\n left: 0;\n border: 2px solid #009dd6;\n border-bottom: none;\n border-top-left-radius: 100px;\n border-top-right-radius: 100px;\n animation-name: rotate-progress;\n animation-duration: 550ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n transform-origin: calc(50%) calc(50% + 8.25px);\n}\n\n@keyframes rotate-progress\n{\n from\n {\n transform: rotate(0deg);\n }\n to\n {\n transform: rotate(360deg);\n }\n}"] }]
|
|
58
|
+
}] });
|
|
59
|
+
//# sourceMappingURL=uploadButton.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploadButton.component.js","sourceRoot":"","sources":["../../../../../../src/modules/file/components/uploadButton/uploadButton.component.ts","../../../../../../src/modules/file/components/uploadButton/uploadButton.component.html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BACvD;qBACJ,mBACgB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, ExistingProvider, forwardRef, WritableSignal, signal, InputSignal, input, numberAttribute, InputSignalWithTransform} from '@angular/core';\nimport {NgClass} from '@angular/common';\nimport {IsPresentPipe, LocalizePipe} from '@anglr/common';\n\nimport {FILE_VISUAL} from '../../misc/tokens';\nimport {FileVisual} from '../../interfaces';\nimport {FileTemplateContext} from '../../directive';\n\n/**\n * Component that represents upload button file template\n */\n@Component(\n{\n selector: 'upload-button',\n templateUrl: 'uploadButton.component.html',\n styleUrl: 'uploadButton.component.css',\n imports:\n [\n NgClass,\n IsPresentPipe,\n LocalizePipe,\n ],\n providers:\n [\n <ExistingProvider>\n {\n provide: FILE_VISUAL,\n useExisting: forwardRef(() => UploadButtonComponent),\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class UploadButtonComponent implements FileVisual\n{\n //######################### public properties - implementation of FileVisual #########################\n\n /**\n * @inheritdoc\n */\n public fileTemplateContext: WritableSignal<FileTemplateContext|undefined|null> = signal<FileTemplateContext|undefined|null>(null);\n\n //######################### public properties - inputs #########################\n\n /**\n * Css classes applied tu button icon\n */\n public uploadIconClass: InputSignal<string> = input('fas fa-file-upload');\n\n /**\n * Text to be displayed as button text\n */\n public uploadText: InputSignal<string> = input('');\n\n /**\n * Css classes for displayed text for button\n */\n public uploadTextClass: InputSignal<string> = input('first-letter-uppercase');\n\n /**\n * Css class applied to button\n */\n public cssClass: InputSignal<string> = input('btn btn-icon', {alias: 'class'});\n\n /**\n * Current progress to be displayed\n */\n public progress: InputSignalWithTransform<number|undefined|null, number|string|undefined|null> = input<number|undefined|null, number|string|undefined|null>(null, {transform: numberAttribute});\n}","@if(progress() | isPresent)\n{\n <div class=\"progress\">\n <span class=\"progress-value\">{{progress()}}%</span>\n <div class=\"progress-indicator\"></div>\n </div>\n}\n\n<button [ngClass]=\"cssClass()\" type=\"button\">\n <span [ngClass]=\"uploadIconClass()\"></span>\n \n @if(uploadText())\n {\n <span [ngClass]=\"uploadTextClass()\">{{uploadText() | localize}}</span>\n }\n</button>"]}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { booleanAttribute, Directive, effect, ElementRef, input, output, Renderer2 } from '@angular/core';
|
|
3
|
+
import { BindThis, isString } from '@jscrpt/common';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Directive that allows better communication with input file
|
|
7
|
+
*/
|
|
8
|
+
export class FileInputDirective {
|
|
9
|
+
//######################### constructors #########################
|
|
10
|
+
constructor(element, renderer) {
|
|
11
|
+
this.element = element;
|
|
12
|
+
//######################### public properties - inputs #########################
|
|
13
|
+
/**
|
|
14
|
+
* Indication whether is multiple files selection enabled
|
|
15
|
+
*/
|
|
16
|
+
this.multiple = input(false, { transform: booleanAttribute });
|
|
17
|
+
/**
|
|
18
|
+
* Indication whether read file content, working only when `multiple` is not set (for single file)
|
|
19
|
+
*/
|
|
20
|
+
this.readContent = input(false, { transform: booleanAttribute });
|
|
21
|
+
/**
|
|
22
|
+
* Indication whether content of file is binary and it will be read as ArrayBuffer instead of string
|
|
23
|
+
*/
|
|
24
|
+
this.binaryContent = input(false, { transform: booleanAttribute });
|
|
25
|
+
/**
|
|
26
|
+
* Text encoding of read string file content
|
|
27
|
+
*/
|
|
28
|
+
this.textEncoding = input();
|
|
29
|
+
//######################### public properties - outputs #########################
|
|
30
|
+
/**
|
|
31
|
+
* Occurs when file changes and `binaryContent` is not set and `readContent` is set
|
|
32
|
+
*/
|
|
33
|
+
this.stringContentChange = output();
|
|
34
|
+
/**
|
|
35
|
+
* Occurs when file changes and `binaryContent` is set and `readContent` is set
|
|
36
|
+
*/
|
|
37
|
+
this.arrayBufferContentChange = output();
|
|
38
|
+
/**
|
|
39
|
+
* Occurs when selected file changes, occurs only when `multiple` is not set
|
|
40
|
+
*/
|
|
41
|
+
this.fileChange = output();
|
|
42
|
+
/**
|
|
43
|
+
* Occurs when selected files changes, occurs only when `multiple` is set
|
|
44
|
+
*/
|
|
45
|
+
this.filesChange = output();
|
|
46
|
+
/**
|
|
47
|
+
* Occurs when selected file changes, occurs only when `multiple` is not set, contains name of selected file
|
|
48
|
+
*/
|
|
49
|
+
this.fileName = output();
|
|
50
|
+
/**
|
|
51
|
+
* Occurs when selected files changes, occurs only when `multiple` is set, contains names of selected files
|
|
52
|
+
*/
|
|
53
|
+
this.filesNames = output();
|
|
54
|
+
this.changeListenerUnlisten = renderer.listen(element.nativeElement, 'change', this.handleFileChange);
|
|
55
|
+
effect(() => renderer.setProperty(element.nativeElement, 'multiple', this.multiple()));
|
|
56
|
+
}
|
|
57
|
+
//######################### public methods - implementation of OnDestroy #########################
|
|
58
|
+
/**
|
|
59
|
+
* @inheritdoc
|
|
60
|
+
*/
|
|
61
|
+
ngOnDestroy() {
|
|
62
|
+
this.changeListenerUnlisten();
|
|
63
|
+
}
|
|
64
|
+
//######################### public methods #########################
|
|
65
|
+
/**
|
|
66
|
+
* Clears selection of file/files
|
|
67
|
+
*/
|
|
68
|
+
clearFile() {
|
|
69
|
+
this.element.nativeElement.value = '';
|
|
70
|
+
this.fileChange.emit(null);
|
|
71
|
+
this.fileName.emit(null);
|
|
72
|
+
this.filesChange.emit(null);
|
|
73
|
+
this.filesNames.emit(null);
|
|
74
|
+
this.arrayBufferContentChange.emit(null);
|
|
75
|
+
this.stringContentChange.emit(null);
|
|
76
|
+
}
|
|
77
|
+
//######################### protected methods #########################
|
|
78
|
+
/**
|
|
79
|
+
* Handles changes in file input
|
|
80
|
+
*/
|
|
81
|
+
handleFileChange(event) {
|
|
82
|
+
if (!event.target) {
|
|
83
|
+
throw new Error('FileOutputDirective: missing input file target!');
|
|
84
|
+
}
|
|
85
|
+
if (this.multiple()) {
|
|
86
|
+
const files = event.target.files;
|
|
87
|
+
const filesArray = [];
|
|
88
|
+
if (files) {
|
|
89
|
+
for (let x = 0; x < files.length; x++) {
|
|
90
|
+
filesArray.push(files[x]);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
this.filesChange.emit(filesArray);
|
|
94
|
+
this.filesNames.emit(filesArray.map(itm => itm.name));
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
const file = event.target.files?.[0];
|
|
98
|
+
this.fileChange.emit(file);
|
|
99
|
+
this.fileName.emit(file?.name);
|
|
100
|
+
}
|
|
101
|
+
//read file contents
|
|
102
|
+
if (!this.multiple() && this.readContent()) {
|
|
103
|
+
const file = event.target.files?.[0];
|
|
104
|
+
//no file selected
|
|
105
|
+
if (!file) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const fileReader = new FileReader();
|
|
109
|
+
fileReader.onloadend = () => {
|
|
110
|
+
const result = fileReader.result;
|
|
111
|
+
if (!result) {
|
|
112
|
+
this.stringContentChange.emit(null);
|
|
113
|
+
this.arrayBufferContentChange.emit(null);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (isString(result)) {
|
|
117
|
+
this.stringContentChange.emit(result);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this.arrayBufferContentChange.emit(result);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
if (this.binaryContent()) {
|
|
124
|
+
fileReader.readAsArrayBuffer(file);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
fileReader.readAsText(file, this.textEncoding());
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: FileInputDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
132
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.0", type: FileInputDirective, isStandalone: true, selector: "input[type=file]", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, readContent: { classPropertyName: "readContent", publicName: "readContent", isSignal: true, isRequired: false, transformFunction: null }, binaryContent: { classPropertyName: "binaryContent", publicName: "binaryContent", isSignal: true, isRequired: false, transformFunction: null }, textEncoding: { classPropertyName: "textEncoding", publicName: "textEncoding", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stringContentChange: "stringContentChange", arrayBufferContentChange: "arrayBufferContentChange", fileChange: "fileChange", filesChange: "filesChange", fileName: "fileName", filesNames: "filesNames" }, exportAs: ["file"], ngImport: i0 }); }
|
|
133
|
+
}
|
|
134
|
+
__decorate([
|
|
135
|
+
BindThis,
|
|
136
|
+
__metadata("design:type", Function),
|
|
137
|
+
__metadata("design:paramtypes", []),
|
|
138
|
+
__metadata("design:returntype", void 0)
|
|
139
|
+
], FileInputDirective.prototype, "clearFile", null);
|
|
140
|
+
__decorate([
|
|
141
|
+
BindThis,
|
|
142
|
+
__metadata("design:type", Function),
|
|
143
|
+
__metadata("design:paramtypes", [MouseEvent]),
|
|
144
|
+
__metadata("design:returntype", void 0)
|
|
145
|
+
], FileInputDirective.prototype, "handleFileChange", null);
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: FileInputDirective, decorators: [{
|
|
147
|
+
type: Directive,
|
|
148
|
+
args: [{
|
|
149
|
+
selector: 'input[type=file]',
|
|
150
|
+
exportAs: 'file',
|
|
151
|
+
}]
|
|
152
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { clearFile: [], handleFileChange: [] } });
|
|
153
|
+
//# sourceMappingURL=fileInput.directive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/file/directive/fileInput/fileInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,gBAAgB,EAAE,SAAS,EAAE,MAAM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,iBAAiB,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;iBAED,CAAC;gBACG,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YACrD,CAAC;QACL,CAAC;IACL,CAAC;8GApLQ,kBAAkB;kGAAlB,kBAAkB;;AAwFpB;IADN,QAAQ;;;;mDAUR;AAQS;IADT,QAAQ;;qCACyB,UAAU;;0DA2E3C;2FApLQ,kBAAkB;kBAL9B,SAAS;mBACV;oBACI,QAAQ,EAAE,kBAAkB;oBAC5B,QAAQ,EAAE,MAAM;iBACnB;uGAyFU,SAAS,MAiBN,gBAAgB","sourcesContent":["import {booleanAttribute, Directive, effect, ElementRef, input, InputSignal, InputSignalWithTransform, OnDestroy, output, OutputEmitterRef, Renderer2} from '@angular/core';\nimport {BindThis, isString, NoopAction} from '@jscrpt/common';\n\n/**\n * Directive that allows better communication with input file\n */\n@Directive(\n{\n selector: 'input[type=file]',\n exportAs: 'file',\n})\nexport class FileInputDirective implements OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Unlistener for input file change event\n */\n protected changeListenerUnlisten: NoopAction;\n\n //######################### public properties - inputs #########################\n\n /**\n * Indication whether is multiple files selection enabled\n */\n public multiple: InputSignalWithTransform<boolean, string|boolean> = input<boolean, boolean|string>(false, {transform: booleanAttribute});\n\n /**\n * Indication whether read file content, working only when `multiple` is not set (for single file)\n */\n public readContent: InputSignalWithTransform<boolean, string|boolean> = input<boolean, boolean|string>(false, {transform: booleanAttribute});\n\n /**\n * Indication whether content of file is binary and it will be read as ArrayBuffer instead of string\n */\n public binaryContent: InputSignalWithTransform<boolean, string|boolean> = input<boolean, boolean|string>(false, {transform: booleanAttribute});\n\n /**\n * Text encoding of read string file content\n */\n public textEncoding: InputSignal<string|undefined> = input();\n\n //######################### public properties - outputs #########################\n\n /**\n * Occurs when file changes and `binaryContent` is not set and `readContent` is set\n */\n public stringContentChange: OutputEmitterRef<string|undefined|null> = output<string|undefined|null>();\n\n /**\n * Occurs when file changes and `binaryContent` is set and `readContent` is set\n */\n public arrayBufferContentChange: OutputEmitterRef<ArrayBuffer|undefined|null> = output<ArrayBuffer|undefined|null>();\n\n /**\n * Occurs when selected file changes, occurs only when `multiple` is not set\n */\n public fileChange: OutputEmitterRef<File|null|undefined> = output<File|undefined|null>();\n\n /**\n * Occurs when selected files changes, occurs only when `multiple` is set\n */\n public filesChange: OutputEmitterRef<File[]|null|undefined> = output<File[]|undefined|null>();\n\n /**\n * Occurs when selected file changes, occurs only when `multiple` is not set, contains name of selected file\n */\n public fileName: OutputEmitterRef<string|null|undefined> = output<string|undefined|null>();\n\n /**\n * Occurs when selected files changes, occurs only when `multiple` is set, contains names of selected files\n */\n public filesNames: OutputEmitterRef<string[]|null|undefined> = output<string[]|undefined|null>();\n\n //######################### constructors #########################\n constructor(protected element: ElementRef<HTMLInputElement>,\n renderer: Renderer2,)\n {\n this.changeListenerUnlisten = renderer.listen(element.nativeElement, 'change', this.handleFileChange);\n\n effect(() => renderer.setProperty(element.nativeElement, 'multiple', this.multiple()));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy(): void\n {\n this.changeListenerUnlisten();\n }\n\n //######################### public methods #########################\n\n /**\n * Clears selection of file/files\n */\n @BindThis\n public clearFile(): void\n {\n this.element.nativeElement.value = '';\n this.fileChange.emit(null);\n this.fileName.emit(null);\n this.filesChange.emit(null);\n this.filesNames.emit(null);\n this.arrayBufferContentChange.emit(null);\n this.stringContentChange.emit(null);\n }\n\n //######################### protected methods #########################\n\n /**\n * Handles changes in file input\n */\n @BindThis\n protected handleFileChange(event: MouseEvent): void\n {\n if(!event.target)\n {\n throw new Error('FileOutputDirective: missing input file target!');\n }\n\n if(this.multiple())\n {\n const files = (event.target as HTMLInputElement).files;\n const filesArray: File[] = [];\n\n if(files)\n {\n for(let x = 0; x < files.length; x++)\n {\n filesArray.push(files[x]);\n }\n }\n\n this.filesChange.emit(filesArray);\n this.filesNames.emit(filesArray.map(itm => itm.name));\n }\n else\n {\n const file = (event.target as HTMLInputElement).files?.[0];\n\n this.fileChange.emit(file);\n this.fileName.emit(file?.name);\n }\n\n //read file contents\n if(!this.multiple() && this.readContent())\n {\n const file = (event.target as HTMLInputElement).files?.[0];\n\n //no file selected\n if(!file)\n {\n return;\n }\n\n const fileReader = new FileReader();\n \n fileReader.onloadend = () =>\n {\n const result = fileReader.result;\n\n if(!result)\n {\n this.stringContentChange.emit(null);\n this.arrayBufferContentChange.emit(null);\n\n return;\n }\n\n if(isString(result))\n {\n this.stringContentChange.emit(result);\n }\n else\n {\n this.arrayBufferContentChange.emit(result);\n }\n };\n \n if(this.binaryContent())\n {\n fileReader.readAsArrayBuffer(file);\n }\n else\n {\n fileReader.readAsText(file, this.textEncoding());\n }\n }\n }\n}"]}
|
|
@@ -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,23 @@
|
|
|
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: "19.1.0", ngImport: i0, type: FileTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
15
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0", type: FileTemplateDirective, isStandalone: true, selector: "[fileTemplate]", ngImport: i0 }); }
|
|
16
|
+
}
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: FileTemplateDirective, decorators: [{
|
|
18
|
+
type: Directive,
|
|
19
|
+
args: [{
|
|
20
|
+
selector: '[fileTemplate]',
|
|
21
|
+
}]
|
|
22
|
+
}] });
|
|
23
|
+
//# 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;AAKH,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;kBAJjC,SAAS;mBACV;oBACI,QAAQ,EAAE,gBAAgB;iBAC7B","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})\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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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"]}
|