@anglr/common 19.0.0-beta.20231109094203 → 19.0.0-beta.20231109102631
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 +18 -0
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js +6 -7
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
- package/es2022/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +5 -6
- package/es2022/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -1
- package/es2022/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js +5 -6
- package/es2022/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js.map +1 -1
- package/es2022/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js +4 -5
- package/es2022/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js.map +1 -1
- package/es2022/forms/src/directives/groupHasError/groupHasError.directive.js +5 -6
- package/es2022/forms/src/directives/groupHasError/groupHasError.directive.js.map +1 -1
- package/es2022/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js +4 -5
- package/es2022/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js.map +1 -1
- package/es2022/forms/src/directives/hasError/hasError.directive.js +6 -7
- package/es2022/forms/src/directives/hasError/hasError.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/maxValueNumberValidator.directive.js +6 -7
- package/es2022/forms/src/directives/numberInput/maxValueNumberValidator.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/minValueNumberValidator.directive.js +6 -7
- package/es2022/forms/src/directives/numberInput/minValueNumberValidator.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.js +5 -6
- package/es2022/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/numberInputValidator.directive.js +4 -5
- package/es2022/forms/src/directives/numberInput/numberInputValidator.directive.js.map +1 -1
- package/es2022/forms/src/directives/requiredClass/requiredClass.directive.js +6 -7
- package/es2022/forms/src/directives/requiredClass/requiredClass.directive.js.map +1 -1
- package/es2022/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js +6 -7
- package/es2022/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +6 -7
- 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 +6 -7
- 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 +5 -6
- 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 -6
- package/es2022/forms/src/modules/errorMessage/modules/errorMessage.module.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.js +6 -7
- package/es2022/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.js.map +1 -1
- package/es2022/forms/src/modules/formPipes/modules/formPipes.module.js +5 -6
- package/es2022/forms/src/modules/formPipes/modules/formPipes.module.js.map +1 -1
- package/es2022/forms/src/modules/formPipes/pipes/asFormArray/asFormArray.pipe.js +6 -7
- package/es2022/forms/src/modules/formPipes/pipes/asFormArray/asFormArray.pipe.js.map +1 -1
- package/es2022/forms/src/modules/formPipes/pipes/asFormControl/asFormControl.pipe.js +6 -7
- package/es2022/forms/src/modules/formPipes/pipes/asFormControl/asFormControl.pipe.js.map +1 -1
- package/es2022/forms/src/modules/formPipes/pipes/asFormGroup/asFormGroup.pipe.js +6 -7
- package/es2022/forms/src/modules/formPipes/pipes/asFormGroup/asFormGroup.pipe.js.map +1 -1
- package/es2022/forms/src/modules/formPipes/pipes/getControl/getControl.pipe.js +4 -5
- package/es2022/forms/src/modules/formPipes/pipes/getControl/getControl.pipe.js.map +1 -1
- package/es2022/forms/src/modules/hasError.module.js +5 -6
- package/es2022/forms/src/modules/hasError.module.js.map +1 -1
- package/es2022/forms/src/modules/numberInput.module.js +5 -6
- package/es2022/forms/src/modules/numberInput.module.js.map +1 -1
- package/es2022/forms/src/modules/requiredClass.module.js +5 -6
- package/es2022/forms/src/modules/requiredClass.module.js.map +1 -1
- package/es2022/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js +6 -7
- package/es2022/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js.map +1 -1
- package/es2022/forms/src/services/formModelBuilder/formModelBuilder.service.js +5 -6
- package/es2022/forms/src/services/formModelBuilder/formModelBuilder.service.js.map +1 -1
- package/es2022/forms/src/services/submitted/submitted.service.js +4 -5
- package/es2022/forms/src/services/submitted/submitted.service.js.map +1 -1
- package/es2022/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js +6 -7
- package/es2022/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js.map +1 -1
- package/es2022/hotkeys/src/components/cheatSheet/cheatSheet.component.js +5 -6
- package/es2022/hotkeys/src/components/cheatSheet/cheatSheet.component.js.map +1 -1
- package/es2022/hotkeys/src/services/appHotkeys.service.js +5 -6
- package/es2022/hotkeys/src/services/appHotkeys.service.js.map +1 -1
- package/es2022/material/src/components/confirmationDialog/confirmationDialog.component.js +6 -7
- package/es2022/material/src/components/confirmationDialog/confirmationDialog.component.js.map +1 -1
- package/es2022/material/src/components/movableTitledDialog/movableTitledDialog.component.js +4 -5
- package/es2022/material/src/components/movableTitledDialog/movableTitledDialog.component.js.map +1 -1
- package/es2022/material/src/components/titledDialog/titledDialog.component.js +6 -7
- package/es2022/material/src/components/titledDialog/titledDialog.component.js.map +1 -1
- package/es2022/material/src/directives/confirmationDialog/confirmationDialog.directive.js +5 -6
- package/es2022/material/src/directives/confirmationDialog/confirmationDialog.directive.js.map +1 -1
- package/es2022/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.js +5 -6
- package/es2022/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.js.map +1 -1
- package/es2022/material/src/modules/confirmationDialog.module.js +5 -6
- package/es2022/material/src/modules/confirmationDialog.module.js.map +1 -1
- package/es2022/material/src/modules/debugDataCopyClick.module.js +5 -6
- package/es2022/material/src/modules/debugDataCopyClick.module.js.map +1 -1
- package/es2022/material/src/modules/movableTitledDialog.module.js +5 -6
- package/es2022/material/src/modules/movableTitledDialog.module.js.map +1 -1
- package/es2022/material/src/modules/titledDialog.module.js +5 -6
- package/es2022/material/src/modules/titledDialog.module.js.map +1 -1
- package/es2022/material/src/services/titledDialog/titledDialog.service.js +6 -7
- package/es2022/material/src/services/titledDialog/titledDialog.service.js.map +1 -1
- package/es2022/moment/src/modules/moment.module.js +5 -6
- package/es2022/moment/src/modules/moment.module.js.map +1 -1
- package/es2022/moment/src/pipes/momentConvert/momentConvert.pipe.js +4 -5
- package/es2022/moment/src/pipes/momentConvert/momentConvert.pipe.js.map +1 -1
- package/es2022/moment/src/pipes/momentFormat/momentFormat.pipe.js +4 -5
- package/es2022/moment/src/pipes/momentFormat/momentFormat.pipe.js.map +1 -1
- package/es2022/numeral/src/pipes/numeral.pipe.js +5 -6
- package/es2022/numeral/src/pipes/numeral.pipe.js.map +1 -1
- package/es2022/router/src/services/routing/dataRouter.js +5 -6
- package/es2022/router/src/services/routing/dataRouter.js.map +1 -1
- package/es2022/router/src/services/routing/dataRouterData.js +5 -6
- package/es2022/router/src/services/routing/dataRouterData.js.map +1 -1
- package/es2022/src/components/collapsibleIcon/collapsibleIcon.component.js +4 -5
- package/es2022/src/components/collapsibleIcon/collapsibleIcon.component.js.map +1 -1
- package/es2022/src/components/collapsibleTitle/collapsibleTitle.component.js +4 -5
- package/es2022/src/components/collapsibleTitle/collapsibleTitle.component.js.map +1 -1
- package/es2022/src/directives/bodyRender/bodyRender.directive.js +6 -7
- package/es2022/src/directives/bodyRender/bodyRender.directive.js.map +1 -1
- package/es2022/src/directives/clickOutside/clickOutside.directive.js +6 -7
- package/es2022/src/directives/clickOutside/clickOutside.directive.js.map +1 -1
- package/es2022/src/directives/goBack/goBack.directive.js +5 -6
- package/es2022/src/directives/goBack/goBack.directive.js.map +1 -1
- package/es2022/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.js +5 -7
- package/es2022/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.js.map +1 -1
- package/es2022/src/directives/positionTo/positionTo.directive.js +6 -7
- package/es2022/src/directives/positionTo/positionTo.directive.js.map +1 -1
- package/es2022/src/modules/castPipes/modules/castPipes.module.js +5 -6
- package/es2022/src/modules/castPipes/modules/castPipes.module.js.map +1 -1
- package/es2022/src/modules/castPipes/pipes/asHtmlElement/asHtmlElement.pipe.js +4 -5
- package/es2022/src/modules/castPipes/pipes/asHtmlElement/asHtmlElement.pipe.js.map +1 -1
- package/es2022/src/modules/castPipes/pipes/asNgClassRequired/asNgClassRequired.pipe.js +4 -5
- package/es2022/src/modules/castPipes/pipes/asNgClassRequired/asNgClassRequired.pipe.js.map +1 -1
- package/es2022/src/modules/castPipes/pipes/asRequired/asRequired.pipe.js +4 -5
- package/es2022/src/modules/castPipes/pipes/asRequired/asRequired.pipe.js.map +1 -1
- package/es2022/src/modules/castPipes/pipes/castType/castType.pipe.js +6 -7
- package/es2022/src/modules/castPipes/pipes/castType/castType.pipe.js.map +1 -1
- package/es2022/src/modules/commonDynamic.module.js +5 -6
- package/es2022/src/modules/commonDynamic.module.js.map +1 -1
- package/es2022/src/modules/commonLocalize.module.js +5 -6
- package/es2022/src/modules/commonLocalize.module.js.map +1 -1
- package/es2022/src/modules/commonUtils.module.js +5 -6
- package/es2022/src/modules/commonUtils.module.js.map +1 -1
- package/es2022/src/modules/debugData/components/debugData/debugData.component.js +5 -6
- package/es2022/src/modules/debugData/components/debugData/debugData.component.js.map +1 -1
- package/es2022/src/modules/debugData/modules/debugData.module.js +5 -6
- package/es2022/src/modules/debugData/modules/debugData.module.js.map +1 -1
- package/es2022/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.js +4 -5
- package/es2022/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.js.map +1 -1
- package/es2022/src/modules/logger/components/console/console.component.js +5 -6
- package/es2022/src/modules/logger/components/console/console.component.js.map +1 -1
- package/es2022/src/modules/logger/services/console/consoleComponent.service.js +4 -5
- package/es2022/src/modules/logger/services/console/consoleComponent.service.js.map +1 -1
- package/es2022/src/modules/logger/services/console/consoleComponent.sink.js.map +1 -1
- package/es2022/src/modules/logger/services/console/consoleComponentService.options.js +5 -6
- package/es2022/src/modules/logger/services/console/consoleComponentService.options.js.map +1 -1
- package/es2022/src/modules/logger/services/developmentConsoleSink/developmentConsole.sink.js.map +1 -1
- package/es2022/src/modules/logger/services/logger/logger.service.js +5 -6
- package/es2022/src/modules/logger/services/logger/logger.service.js.map +1 -1
- package/es2022/src/modules/logger/services/rest/rest.sink.js.map +1 -1
- package/es2022/src/modules/logger/services/rest/restSink.options.js +5 -6
- package/es2022/src/modules/logger/services/rest/restSink.options.js.map +1 -1
- package/es2022/src/modules/logger/types/loggerOptions.js +4 -5
- package/es2022/src/modules/logger/types/loggerOptions.js.map +1 -1
- package/es2022/src/modules/multiButton/components/multiButton/multiButton.component.js +6 -7
- package/es2022/src/modules/multiButton/components/multiButton/multiButton.component.js.map +1 -1
- package/es2022/src/modules/multiButton/modules/multiButton.module.js +5 -6
- package/es2022/src/modules/multiButton/modules/multiButton.module.js.map +1 -1
- package/es2022/src/modules/progressIndicator/components/progressIndicator/progressIndicator.component.js +5 -6
- package/es2022/src/modules/progressIndicator/components/progressIndicator/progressIndicator.component.js.map +1 -1
- package/es2022/src/modules/progressIndicator/directives/progressOverlay/progressOverlay.directive.js +6 -7
- package/es2022/src/modules/progressIndicator/directives/progressOverlay/progressOverlay.directive.js.map +1 -1
- package/es2022/src/modules/progressIndicator/interceptors/progressInterceptor.js +5 -6
- package/es2022/src/modules/progressIndicator/interceptors/progressInterceptor.js.map +1 -1
- package/es2022/src/modules/progressIndicator/modules/progressIndicator.module.js +5 -6
- package/es2022/src/modules/progressIndicator/modules/progressIndicator.module.js.map +1 -1
- package/es2022/src/modules/progressIndicator/services/progressIndicator.service.js +10 -16
- package/es2022/src/modules/progressIndicator/services/progressIndicator.service.js.map +1 -1
- package/es2022/src/modules/tooltip/components/tooltip/tooltip.component.js +5 -6
- package/es2022/src/modules/tooltip/components/tooltip/tooltip.component.js.map +1 -1
- package/es2022/src/modules/tooltip/directives/tooltip/tooltip.directive.js +6 -7
- package/es2022/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +1 -1
- package/es2022/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.js +5 -6
- package/es2022/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.js.map +1 -1
- package/es2022/src/modules/tooltip/modules/tooltip.module.js +5 -6
- package/es2022/src/modules/tooltip/modules/tooltip.module.js.map +1 -1
- package/es2022/src/pipes/displayProperties/displayProperties.pipe.js +4 -5
- 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 +6 -7
- package/es2022/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.js.map +1 -1
- package/es2022/src/pipes/isNaN/isNaN.pipe.js +4 -5
- package/es2022/src/pipes/isNaN/isNaN.pipe.js.map +1 -1
- package/es2022/src/pipes/isPresent/isPresent.pipe.js +4 -5
- package/es2022/src/pipes/isPresent/isPresent.pipe.js.map +1 -1
- package/es2022/src/pipes/keys/keys.pipe.js +4 -5
- package/es2022/src/pipes/keys/keys.pipe.js.map +1 -1
- package/es2022/src/pipes/localize/localize.pipe.js +6 -7
- package/es2022/src/pipes/localize/localize.pipe.js.map +1 -1
- package/es2022/src/pipes/mergeCssClasses/mergeCssClasses.pipe.js +8 -6
- package/es2022/src/pipes/mergeCssClasses/mergeCssClasses.pipe.js.map +1 -1
- package/es2022/src/pipes/urlEncode/urlEncode.pipe.js +4 -5
- package/es2022/src/pipes/urlEncode/urlEncode.pipe.js.map +1 -1
- package/es2022/src/services/cookies/cookies.service.js +6 -7
- package/es2022/src/services/cookies/cookies.service.js.map +1 -1
- package/es2022/src/services/notifications/defaultNotifications.service.js +6 -7
- package/es2022/src/services/notifications/defaultNotifications.service.js.map +1 -1
- package/es2022/src/services/permanentStorage/cookiePermanentStorage.service.js +7 -8
- package/es2022/src/services/permanentStorage/cookiePermanentStorage.service.js.map +1 -1
- package/es2022/src/services/statusCode/statusCode.service.js +4 -5
- package/es2022/src/services/statusCode/statusCode.service.js.map +1 -1
- package/es2022/src/services/stringLocalization/noStringLocalization.service.js +4 -5
- package/es2022/src/services/stringLocalization/noStringLocalization.service.js.map +1 -1
- package/es2022/src/services/temporaryStorage/memoryTemporaryStorage.service.js +4 -5
- package/es2022/src/services/temporaryStorage/memoryTemporaryStorage.service.js.map +1 -1
- package/es2022/store/src/services/permanentStorage/localPermanentStorage.service.js +7 -8
- package/es2022/store/src/services/permanentStorage/localPermanentStorage.service.js.map +1 -1
- package/es2022/store/src/services/temporaryStorage/sessionTemporaryStorage.service.js +6 -7
- package/es2022/store/src/services/temporaryStorage/sessionTemporaryStorage.service.js.map +1 -1
- package/package.json +41 -42
- package/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.d.ts.map +1 -1
- package/src/modules/progressIndicator/services/progressIndicator.service.d.ts +2 -3
- package/src/modules/progressIndicator/services/progressIndicator.service.d.ts.map +1 -1
- package/src/pipes/mergeCssClasses/mergeCssClasses.pipe.d.ts +1 -1
- package/src/pipes/mergeCssClasses/mergeCssClasses.pipe.d.ts.map +1 -1
- package/styles/themes/dark.scss +6 -0
- package/styles/themes/light.scss +0 -6
- package/version.bak +1 -1
package/changelog.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Version 19.0.0 (2023-11-09)
|
|
4
|
+
|
|
5
|
+
### Feature
|
|
6
|
+
|
|
7
|
+
- updated `MergeCssClassesSAPipe` pipe
|
|
8
|
+
- now supports also `undefined` and `null` values as it should
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
- minimal supported version of `node.js` is `18`
|
|
13
|
+
- minimal supported version of `@angular` is `17.0.1`
|
|
14
|
+
- minimal supported version of `@angular` material is `17.0.0`
|
|
15
|
+
- minimal supported version of `@jscrpt/common` is `5.0.0`
|
|
16
|
+
- minimal supported version of `angular2-hotkeys` is `16.0.1`
|
|
17
|
+
- minimal supported version of `@floating-ui/dom` is `1.5.3`
|
|
18
|
+
- minimal supported version of `tslib` is `2.6.2`
|
|
19
|
+
- tooltip themes changed, previous *dark* is not *light* and vice versa, dark background should be identified as light theme since it is normally used within light app theme
|
|
20
|
+
|
|
3
21
|
## Version 18.2.0 (2023-11-09)
|
|
4
22
|
|
|
5
23
|
### Features
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var FloatingUiDomPosition_1;
|
|
2
1
|
import { __decorate } from "tslib";
|
|
3
2
|
import { Injectable, forwardRef } from '@angular/core';
|
|
4
3
|
import { PositionOffset, PositionPlacement, POSITION, TypeProvider } from '@anglr/common';
|
|
@@ -18,7 +17,7 @@ const defaultOptions = {
|
|
|
18
17
|
/**
|
|
19
18
|
* Service that is used for positioning two elements against each other, using floating-ui dom implementation
|
|
20
19
|
*/
|
|
21
|
-
let FloatingUiDomPosition =
|
|
20
|
+
let FloatingUiDomPosition = class FloatingUiDomPosition {
|
|
22
21
|
//######################### public methods - implementation of Position #########################
|
|
23
22
|
/**
|
|
24
23
|
* @inheritdoc
|
|
@@ -230,14 +229,14 @@ let FloatingUiDomPosition = FloatingUiDomPosition_1 = class FloatingUiDomPositio
|
|
|
230
229
|
}
|
|
231
230
|
}
|
|
232
231
|
}
|
|
233
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
234
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
232
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: FloatingUiDomPosition, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
233
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: FloatingUiDomPosition });
|
|
235
234
|
};
|
|
236
|
-
FloatingUiDomPosition =
|
|
237
|
-
TypeProvider({ provide: POSITION, useClass: forwardRef(() =>
|
|
235
|
+
FloatingUiDomPosition = __decorate([
|
|
236
|
+
TypeProvider({ provide: POSITION, useClass: forwardRef(() => FloatingUiDomPosition) })
|
|
238
237
|
], FloatingUiDomPosition);
|
|
239
238
|
export { FloatingUiDomPosition };
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: FloatingUiDomPosition, decorators: [{
|
|
241
240
|
type: Injectable
|
|
242
241
|
}] });
|
|
243
242
|
//# sourceMappingURL=floatingUiDomPosition.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floatingUiDomPosition.service.js","sourceRoot":"","sources":["../../../../floating-ui/src/services/floatingUiDomPosition.service.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAA4C,cAAc,EAAE,iBAAiB,EAAqB,QAAQ,EAAyC,YAAY,EAAC,M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AQ,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,uBAAqB,CAAC,EAAC,CAAC;GACxE,qBAAqB,CAoRjC;SApRY,qBAAqB;2FAArB,qBAAqB;kBAFjC,UAAU","sourcesContent":["import {Injectable, forwardRef} from '@angular/core';\nimport {Position, PositionResult, PositionOptions, PositionOffset, PositionPlacement, AutoUpdateOptions, POSITION, PositionOffsetString, PositionOffsets, TypeProvider} from '@anglr/common';\nimport {extend, isEmptyObject, isFunction, isJsObject, isNumber, nameof} from '@jscrpt/common';\nimport {computePosition, Placement, autoUpdate, Middleware, offset, flip} from '@floating-ui/dom';\nimport {Observable} from 'rxjs';\n\n/**\n * Default options for `FloatingUiDomPosition` implementation\n */\nconst defaultOptions: PositionOptions =\n{\n autoUpdate: false,\n flip: false,\n offset: nameof<typeof PositionOffset>('None') as PositionOffsetString,\n placement: PositionPlacement.TopStart,\n};\n\n/**\n * Service that is used for positioning two elements against each other, using floating-ui dom implementation\n */\n@Injectable()\n@TypeProvider({provide: POSITION, useClass: forwardRef(() => FloatingUiDomPosition)})\nexport class FloatingUiDomPosition implements Position\n{\n //######################### public methods - implementation of Position #########################\n\n /**\n * @inheritdoc\n */\n public placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>\n {\n return new Observable(subscriber =>\n {\n (async () =>\n {\n const computedOptions = extend({}, defaultOptions, options);\n const middlewares: Middleware[] = [];\n\n this._setOffset(middlewares, computedOptions);\n this._setFlip(middlewares, computedOptions);\n\n const runComputation = async () =>\n {\n const result = await computePosition(source,\n target as HTMLElement,\n {\n placement: this._getPlacement(computedOptions),\n middleware: middlewares,\n });\n\n if(computedOptions.autoUpdate)\n {\n subscriber.next(\n {\n target,\n dispose,\n flip: !!result.middlewareData.flip && !isEmptyObject(result.middlewareData.flip),\n x: result.x,\n y: result.y\n });\n }\n\n return result;\n };\n \n let dispose = () => {};\n\n if(computedOptions.autoUpdate)\n {\n let options: AutoUpdateOptions;\n\n if(computedOptions.autoUpdate === true)\n {\n options =\n {\n ancestorResize: true,\n ancestorScroll: true,\n elementResize: true\n };\n }\n else\n {\n options = computedOptions.autoUpdate;\n }\n\n dispose = autoUpdate(source,\n target as HTMLElement,\n runComputation,\n options);\n }\n\n const result = await runComputation();\n\n subscriber.next(\n {\n target,\n dispose,\n flip: !!result.middlewareData.flip && !isEmptyObject(result.middlewareData.flip),\n x: result.x,\n y: result.y\n });\n\n if(!computedOptions.autoUpdate)\n {\n subscriber.complete();\n }\n })();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets flip middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of flip\n */\n protected _setFlip(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.flip)\n {\n middlewares.push(flip());\n }\n }\n\n /**\n * Sets offset middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of offset\n */\n protected _setOffset(middlewares: Middleware[], options: PositionOptions): void\n {\n //no offset\n if(options.offset === PositionOffset[PositionOffset.None])\n {\n return;\n }\n\n if(options.offset === PositionOffset[PositionOffset.MouseEnter])\n {\n //fallback if not supported placement used\n if(options.placement == PositionPlacement.Left ||\n options.placement == PositionPlacement.LeftStart ||\n options.placement == PositionPlacement.LeftEnd ||\n options.placement == PositionPlacement.Right ||\n options.placement == PositionPlacement.RightStart ||\n options.placement == PositionPlacement.RightEnd ||\n options.placement == PositionPlacement.Bottom ||\n options.placement == PositionPlacement.BottomEnd ||\n options.placement == PositionPlacement.Top ||\n options.placement == PositionPlacement.TopEnd)\n {\n options.placement = PositionPlacement.TopStart;\n }\n }\n\n middlewares.push(offset(({elements, placement, x, y}) =>\n {\n //offset is function\n if(isFunction(options.offset))\n {\n return options.offset({elements, x, y});\n }\n\n const floating = elements.floating as Element;\n\n if(options.offset === PositionOffset[PositionOffset.MouseEnter] && options.mouseEvent)\n {\n return {\n crossAxis: options.mouseEvent.x - (options.mouseEvent.target as HTMLElement).getBoundingClientRect().x\n };\n }\n\n const stringOffset = options.offset as PositionOffsetString|number;\n\n //offset is object\n if(isJsObject(options.offset))\n {\n return options.offset as PositionOffsets;\n }\n\n //offset is skidding number\n if(isNumber(stringOffset))\n {\n return {\n crossAxis: stringOffset,\n };\n }\n\n let dimension: number;\n\n if(placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||\n placement == 'top' || placement == 'top-start' || placement == 'top-end')\n {\n dimension = floating.clientWidth;\n }\n else\n {\n dimension = floating.clientHeight;\n }\n\n switch(stringOffset)\n {\n default:\n {\n dimension = 0;\n\n break;\n }\n case PositionOffset[PositionOffset.Full]:\n {\n break;\n }\n case PositionOffset[PositionOffset.Half]:\n {\n dimension /= 2;\n\n break;\n }\n case PositionOffset[PositionOffset.NegativeFull]:\n {\n dimension *= -1;\n\n break;\n }\n case PositionOffset[PositionOffset.NegativeHalf]:\n {\n dimension *= -.5;\n\n break;\n }\n }\n\n return {\n crossAxis: dimension\n };\n }));\n }\n\n /**\n * Gets floating ui placement from position placement\n * @param options - Options containing position placement\n */\n protected _getPlacement(options: PositionOptions): Placement\n {\n switch(options.placement)\n {\n default:\n // case PositionPlacement.Top:\n {\n return 'top';\n }\n case PositionPlacement.TopStart:\n {\n return 'top-start';\n }\n case PositionPlacement.TopEnd:\n {\n return 'top-end';\n }\n case PositionPlacement.Bottom:\n {\n return 'bottom';\n }\n case PositionPlacement.BottomStart:\n {\n return 'bottom-start';\n }\n case PositionPlacement.BottomEnd:\n {\n return 'bottom-end';\n }\n case PositionPlacement.Left:\n {\n return 'left';\n }\n case PositionPlacement.LeftStart:\n {\n return 'left-start';\n }\n case PositionPlacement.LeftEnd:\n {\n return 'left-end';\n }\n case PositionPlacement.Right:\n {\n return 'right';\n }\n case PositionPlacement.RightStart:\n {\n return 'right-start';\n }\n case PositionPlacement.RightEnd:\n {\n return 'right-end';\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"floatingUiDomPosition.service.js","sourceRoot":"","sources":["../../../../floating-ui/src/services/floatingUiDomPosition.service.ts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oBACI,OAAO,WAAW,CAAC;iBACtB;SACJ;IACL,CAAC;uGAnRQ,qBAAqB;2GAArB,qBAAqB;;AAArB,qBAAqB;IADjC,YAAY,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,EAAC,CAAC;GACxE,qBAAqB,CAoRjC;;2FApRY,qBAAqB;kBAFjC,UAAU","sourcesContent":["import {Injectable, forwardRef} from '@angular/core';\nimport {Position, PositionResult, PositionOptions, PositionOffset, PositionPlacement, AutoUpdateOptions, POSITION, PositionOffsetString, PositionOffsets, TypeProvider} from '@anglr/common';\nimport {extend, isEmptyObject, isFunction, isJsObject, isNumber, nameof} from '@jscrpt/common';\nimport {computePosition, Placement, autoUpdate, Middleware, offset, flip} from '@floating-ui/dom';\nimport {Observable} from 'rxjs';\n\n/**\n * Default options for `FloatingUiDomPosition` implementation\n */\nconst defaultOptions: PositionOptions =\n{\n autoUpdate: false,\n flip: false,\n offset: nameof<typeof PositionOffset>('None') as PositionOffsetString,\n placement: PositionPlacement.TopStart,\n};\n\n/**\n * Service that is used for positioning two elements against each other, using floating-ui dom implementation\n */\n@Injectable()\n@TypeProvider({provide: POSITION, useClass: forwardRef(() => FloatingUiDomPosition)})\nexport class FloatingUiDomPosition implements Position\n{\n //######################### public methods - implementation of Position #########################\n\n /**\n * @inheritdoc\n */\n public placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>\n {\n return new Observable(subscriber =>\n {\n (async () =>\n {\n const computedOptions = extend({}, defaultOptions, options);\n const middlewares: Middleware[] = [];\n\n this._setOffset(middlewares, computedOptions);\n this._setFlip(middlewares, computedOptions);\n\n const runComputation = async () =>\n {\n const result = await computePosition(source,\n target as HTMLElement,\n {\n placement: this._getPlacement(computedOptions),\n middleware: middlewares,\n });\n\n if(computedOptions.autoUpdate)\n {\n subscriber.next(\n {\n target,\n dispose,\n flip: !!result.middlewareData.flip && !isEmptyObject(result.middlewareData.flip),\n x: result.x,\n y: result.y\n });\n }\n\n return result;\n };\n \n let dispose = () => {};\n\n if(computedOptions.autoUpdate)\n {\n let options: AutoUpdateOptions;\n\n if(computedOptions.autoUpdate === true)\n {\n options =\n {\n ancestorResize: true,\n ancestorScroll: true,\n elementResize: true\n };\n }\n else\n {\n options = computedOptions.autoUpdate;\n }\n\n dispose = autoUpdate(source,\n target as HTMLElement,\n runComputation,\n options);\n }\n\n const result = await runComputation();\n\n subscriber.next(\n {\n target,\n dispose,\n flip: !!result.middlewareData.flip && !isEmptyObject(result.middlewareData.flip),\n x: result.x,\n y: result.y\n });\n\n if(!computedOptions.autoUpdate)\n {\n subscriber.complete();\n }\n })();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets flip middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of flip\n */\n protected _setFlip(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.flip)\n {\n middlewares.push(flip());\n }\n }\n\n /**\n * Sets offset middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of offset\n */\n protected _setOffset(middlewares: Middleware[], options: PositionOptions): void\n {\n //no offset\n if(options.offset === PositionOffset[PositionOffset.None])\n {\n return;\n }\n\n if(options.offset === PositionOffset[PositionOffset.MouseEnter])\n {\n //fallback if not supported placement used\n if(options.placement == PositionPlacement.Left ||\n options.placement == PositionPlacement.LeftStart ||\n options.placement == PositionPlacement.LeftEnd ||\n options.placement == PositionPlacement.Right ||\n options.placement == PositionPlacement.RightStart ||\n options.placement == PositionPlacement.RightEnd ||\n options.placement == PositionPlacement.Bottom ||\n options.placement == PositionPlacement.BottomEnd ||\n options.placement == PositionPlacement.Top ||\n options.placement == PositionPlacement.TopEnd)\n {\n options.placement = PositionPlacement.TopStart;\n }\n }\n\n middlewares.push(offset(({elements, placement, x, y}) =>\n {\n //offset is function\n if(isFunction(options.offset))\n {\n return options.offset({elements, x, y});\n }\n\n const floating = elements.floating as Element;\n\n if(options.offset === PositionOffset[PositionOffset.MouseEnter] && options.mouseEvent)\n {\n return {\n crossAxis: options.mouseEvent.x - (options.mouseEvent.target as HTMLElement).getBoundingClientRect().x\n };\n }\n\n const stringOffset = options.offset as PositionOffsetString|number;\n\n //offset is object\n if(isJsObject(options.offset))\n {\n return options.offset as PositionOffsets;\n }\n\n //offset is skidding number\n if(isNumber(stringOffset))\n {\n return {\n crossAxis: stringOffset,\n };\n }\n\n let dimension: number;\n\n if(placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||\n placement == 'top' || placement == 'top-start' || placement == 'top-end')\n {\n dimension = floating.clientWidth;\n }\n else\n {\n dimension = floating.clientHeight;\n }\n\n switch(stringOffset)\n {\n default:\n {\n dimension = 0;\n\n break;\n }\n case PositionOffset[PositionOffset.Full]:\n {\n break;\n }\n case PositionOffset[PositionOffset.Half]:\n {\n dimension /= 2;\n\n break;\n }\n case PositionOffset[PositionOffset.NegativeFull]:\n {\n dimension *= -1;\n\n break;\n }\n case PositionOffset[PositionOffset.NegativeHalf]:\n {\n dimension *= -.5;\n\n break;\n }\n }\n\n return {\n crossAxis: dimension\n };\n }));\n }\n\n /**\n * Gets floating ui placement from position placement\n * @param options - Options containing position placement\n */\n protected _getPlacement(options: PositionOptions): Placement\n {\n switch(options.placement)\n {\n default:\n // case PositionPlacement.Top:\n {\n return 'top';\n }\n case PositionPlacement.TopStart:\n {\n return 'top-start';\n }\n case PositionPlacement.TopEnd:\n {\n return 'top-end';\n }\n case PositionPlacement.Bottom:\n {\n return 'bottom';\n }\n case PositionPlacement.BottomStart:\n {\n return 'bottom-start';\n }\n case PositionPlacement.BottomEnd:\n {\n return 'bottom-end';\n }\n case PositionPlacement.Left:\n {\n return 'left';\n }\n case PositionPlacement.LeftStart:\n {\n return 'left-start';\n }\n case PositionPlacement.LeftEnd:\n {\n return 'left-end';\n }\n case PositionPlacement.Right:\n {\n return 'right';\n }\n case PositionPlacement.RightStart:\n {\n return 'right-start';\n }\n case PositionPlacement.RightEnd:\n {\n return 'right-end';\n }\n }\n }\n}\n"]}
|
package/es2022/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as i1 from "@angular/common";
|
|
|
5
5
|
/**
|
|
6
6
|
* Default validation errors component, displaying validation errors
|
|
7
7
|
*/
|
|
8
|
-
class DefaultValidationErrorsComponent {
|
|
8
|
+
export class DefaultValidationErrorsComponent {
|
|
9
9
|
_changeDetector;
|
|
10
10
|
//######################### public properties - template bindings #########################
|
|
11
11
|
/**
|
|
@@ -36,20 +36,19 @@ class DefaultValidationErrorsComponent {
|
|
|
36
36
|
this.options = options;
|
|
37
37
|
this._changeDetector.detectChanges();
|
|
38
38
|
}
|
|
39
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
40
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: DefaultValidationErrorsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.1", type: DefaultValidationErrorsComponent, selector: "default-validation-errors", host: { properties: { "@animateChildren": "this.animate" } }, ngImport: i0, template: "<div [ngClass]=\"options?.wrapperDivClass\" *ngIf=\"errors?.errorMessages?.length\" @slideInOut>\n <div *ngFor=\"let error of errors?.errorMessages\">{{error}}</div>\n</div>", styles: [":host\n{\n display: contents;\n}"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
|
|
41
41
|
slideInOutTrigger,
|
|
42
42
|
animateChildrenTrigger
|
|
43
43
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DefaultValidationErrorsComponent, decorators: [{
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: DefaultValidationErrorsComponent, decorators: [{
|
|
47
46
|
type: Component,
|
|
48
47
|
args: [{ selector: 'default-validation-errors', animations: [
|
|
49
48
|
slideInOutTrigger,
|
|
50
49
|
animateChildrenTrigger
|
|
51
50
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"options?.wrapperDivClass\" *ngIf=\"errors?.errorMessages?.length\" @slideInOut>\n <div *ngFor=\"let error of errors?.errorMessages\">{{error}}</div>\n</div>", styles: [":host\n{\n display: contents;\n}"] }]
|
|
52
|
-
}], ctorParameters:
|
|
51
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { animate: [{
|
|
53
52
|
type: HostBinding,
|
|
54
53
|
args: ['@animateChildren']
|
|
55
54
|
}] } });
|
package/es2022/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultValidationErrors.component.js","sourceRoot":"","sources":["../../../../../forms/src/components/defaultValidationErrors/defaultValidationErrors.component.ts","../../../../../forms/src/components/defaultValidationErrors/defaultValidationErrors.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACjG,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;;;AAK5E;;GAEG;
|
|
1
|
+
{"version":3,"file":"defaultValidationErrors.component.js","sourceRoot":"","sources":["../../../../../forms/src/components/defaultValidationErrors/defaultValidationErrors.component.ts","../../../../../forms/src/components/defaultValidationErrors/defaultValidationErrors.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACjG,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;;;AAK5E;;GAEG;AAaH,MAAM,OAAO,gCAAgC;IAyBnB;IAvBtB,2FAA2F;IAE3F;;;OAGG;IACI,MAAM,CAAyB;IAEtC;;;OAGG;IACI,OAAO,CAA0B;IAExC,8EAA8E;IAE9E;;OAEG;IAEI,OAAO,GAAY,IAAI,CAAC;IAE/B,iEAAiE;IACjE,YAAsB,eAAkC;QAAlC,oBAAe,GAAf,eAAe,CAAmB;IAExD,CAAC;IAED,kHAAkH;IAElH;;OAEG;IACI,IAAI,CAAC,MAA8B,EAAE,OAAgC;QAExE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;uGAxCQ,gCAAgC;2FAAhC,gCAAgC,+HCrB7C,kLAEM,8YDaF;YACI,iBAAiB;YACjB,sBAAsB;SACzB;;2FAGQ,gCAAgC;kBAZ5C,SAAS;+BAEI,2BAA2B,cAIrC;wBACI,iBAAiB;wBACjB,sBAAsB;qBACzB,mBACgB,uBAAuB,CAAC,MAAM;sFAwBxC,OAAO;sBADb,WAAW;uBAAC,kBAAkB","sourcesContent":["import {Component, ChangeDetectionStrategy, ChangeDetectorRef, HostBinding} from '@angular/core';\nimport {slideInOutTrigger, animateChildrenTrigger} from '@anglr/animations';\n\nimport {ValidationErrorsResult} from '../../services/errorMessagesExtractor/errorMessagesExtractor.interface';\nimport {ValidationErrorsComponent, ValidationErrorsOptions} from '../../services/validationErrorRenderer/validationErrorRenderer.interface';\n\n/**\n * Default validation errors component, displaying validation errors\n */\n@Component(\n{\n selector: 'default-validation-errors',\n templateUrl: 'defaultValidationErrors.component.html',\n styleUrls: ['defaultValidationErrors.component.css'],\n animations: \n [\n slideInOutTrigger,\n animateChildrenTrigger\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DefaultValidationErrorsComponent implements ValidationErrorsComponent\n{\n //######################### public properties - template bindings #########################\n\n /**\n * Errors to be shown\n * @internal\n */\n public errors: ValidationErrorsResult;\n \n /**\n * Options used for displaying validation errors\n * @internal\n */\n public options: ValidationErrorsOptions;\n\n //######################### public properties - host #########################\n\n /**\n * Enables leave animations for internal stuff\n */\n @HostBinding('@animateChildren')\n public animate: boolean = true;\n\n //######################### constructor #########################\n constructor(protected _changeDetector: ChangeDetectorRef)\n {\n }\n\n //######################### public methods - implementation of ValidationErrorsComponent #########################\n\n /**\n * @inheritdoc\n */\n public show(errors: ValidationErrorsResult, options: ValidationErrorsOptions): void\n {\n this.errors = errors;\n this.options = options;\n\n this._changeDetector.detectChanges();\n }\n}","<div [ngClass]=\"options?.wrapperDivClass\" *ngIf=\"errors?.errorMessages?.length\" @slideInOut>\n <div *ngFor=\"let error of errors?.errorMessages\">{{error}}</div>\n</div>"]}
|
|
@@ -3,7 +3,7 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
/**
|
|
4
4
|
* Component that serves as container for validation errors, either component or templates
|
|
5
5
|
*/
|
|
6
|
-
class DefaultValidationErrorsContainerComponent {
|
|
6
|
+
export class DefaultValidationErrorsContainerComponent {
|
|
7
7
|
_viewContainer;
|
|
8
8
|
//######################### protected fields #########################
|
|
9
9
|
/**
|
|
@@ -85,12 +85,11 @@ class DefaultValidationErrorsContainerComponent {
|
|
|
85
85
|
this._template.detectChanges();
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
89
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
88
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: DefaultValidationErrorsContainerComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
89
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.1", type: DefaultValidationErrorsContainerComponent, selector: "default-validation-errors-container", ngImport: i0, template: '', isInline: true, styles: [":host\n{\n display: contents;\n}"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DefaultValidationErrorsContainerComponent, decorators: [{
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: DefaultValidationErrorsContainerComponent, decorators: [{
|
|
93
92
|
type: Component,
|
|
94
93
|
args: [{ selector: 'default-validation-errors-container', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host\n{\n display: contents;\n}"] }]
|
|
95
|
-
}], ctorParameters:
|
|
94
|
+
}], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
|
|
96
95
|
//# sourceMappingURL=defaultValidationErrorsContainer.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultValidationErrorsContainer.component.js","sourceRoot":"","sources":["../../../../../forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,gBAAgB,EAAgC,MAAM,eAAe,CAAC;;AAKlH;;GAEG;
|
|
1
|
+
{"version":3,"file":"defaultValidationErrorsContainer.component.js","sourceRoot":"","sources":["../../../../../forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.ts"],"names":[],"mappings":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CAAC;IAED;;OAEG;IACO,eAAe;QAErB,IAAG,CAAC,IAAI,CAAC,SAAS,EAClB;YACI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAC9E;gBACI,SAAS,EAAE,IAAI,CAAC,OAAO;gBACvB,OAAO,EAAE,IAAI,CAAC,QAAQ;aACzB,CAAC,CAAC;SACN;aAED;YACI,IAAI,CAAC,SAAS,CAAC,OAAO;gBACtB;oBACI,SAAS,EAAE,IAAI,CAAC,OAAO;oBACvB,OAAO,EAAE,IAAI,CAAC,QAAQ;iBACzB,CAAC;YAEF,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;SAClC;IACL,CAAC;uGA1GQ,yCAAyC;2FAAzC,yCAAyC,2EAJxC,EAAE;;2FAIH,yCAAyC;kBAPrD,SAAS;+BAEI,qCAAqC,YACrC,EAAE,mBAEK,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, ViewContainerRef, ComponentRef, EmbeddedViewRef} from '@angular/core';\n\nimport {ValidationErrorsResult} from '../../services/errorMessagesExtractor/errorMessagesExtractor.interface';\nimport {ValidationErrorsComponent, ValidationErrorsContainerComponent, ValidationErrorsContainerOptions, ValidationErrorsTemplateContext} from '../../services/validationErrorRenderer/validationErrorRenderer.interface';\n\n/**\n * Component that serves as container for validation errors, either component or templates\n */\n@Component(\n{\n selector: 'default-validation-errors-container',\n template: '',\n styleUrls: ['defaultValidationErrorsContainer.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DefaultValidationErrorsContainerComponent implements ValidationErrorsContainerComponent\n{\n //######################### protected fields #########################\n\n /**\n * Errors to be shown\n * @internal\n */\n protected _errors: ValidationErrorsResult;\n \n /**\n * Options used for displaying validation errors\n * @internal\n */\n protected _options: ValidationErrorsContainerOptions;\n\n /**\n * Instance of component reference for rendered errors\n */\n protected _component: ComponentRef<ValidationErrorsComponent>;\n\n /**\n * Instance of template reference for rendered errors\n */\n protected _template: EmbeddedViewRef<ValidationErrorsTemplateContext>;\n\n //######################### constructor #########################\n constructor(protected _viewContainer: ViewContainerRef)\n {\n }\n\n //######################### public methods - implementation of #########################\n\n /**\n * Shows validation errors\n * @param errors - Errors to be shown\n * @param options - Options used for displaying validation errors\n * @param errorClasses - Array of css error classes\n */\n public show(errors: ValidationErrorsResult, options: ValidationErrorsContainerOptions): void\n {\n this._errors = errors;\n this._options = options;\n\n if(options.template)\n {\n this._renderTemplate();\n }\n else if(options.component)\n {\n this._renderComponent();\n }\n else\n {\n throw new Error('Missing template or component for rendering validation errors!');\n }\n }\n\n /**\n * Hides validation errors\n */\n public hide(): void\n {\n this._viewContainer.clear();\n this._component = null;\n this._template = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Renders validation errors component\n */\n protected _renderComponent(): void\n {\n if(!this._component)\n {\n this._component = this._viewContainer.createComponent(this._options.component);\n }\n\n this._component.instance.show(this._errors, this._options);\n }\n\n /**\n * Renders validation errors template\n */\n protected _renderTemplate(): void\n {\n if(!this._template)\n {\n this._template = this._viewContainer.createEmbeddedView(this._options.template,\n {\n $implicit: this._errors,\n options: this._options\n });\n }\n else\n {\n this._template.context =\n {\n $implicit: this._errors,\n options: this._options\n };\n\n this._template.detectChanges();\n }\n }\n}"]}
|
|
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
/**
|
|
5
5
|
* Component that serves as container for validation errors, either component or templates with reserved space for errors
|
|
6
6
|
*/
|
|
7
|
-
class ReservedSpaceValidationErrorsContainerComponent {
|
|
7
|
+
export class ReservedSpaceValidationErrorsContainerComponent {
|
|
8
8
|
//######################### protected fields #########################
|
|
9
9
|
/**
|
|
10
10
|
* Errors to be shown
|
|
@@ -86,11 +86,10 @@ class ReservedSpaceValidationErrorsContainerComponent {
|
|
|
86
86
|
this._template.detectChanges();
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
90
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
89
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ReservedSpaceValidationErrorsContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
90
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.1", type: ReservedSpaceValidationErrorsContainerComponent, selector: "reserved-space-validation-errors-container", viewQueries: [{ propertyName: "viewContainer", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div>\n <ng-container #container></ng-container>\n</div>", styles: [":host\n{\n display: contents;\n}"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ReservedSpaceValidationErrorsContainerComponent, decorators: [{
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ReservedSpaceValidationErrorsContainerComponent, decorators: [{
|
|
94
93
|
type: Component,
|
|
95
94
|
args: [{ selector: 'reserved-space-validation-errors-container', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div>\n <ng-container #container></ng-container>\n</div>", styles: [":host\n{\n display: contents;\n}"] }]
|
|
96
95
|
}], propDecorators: { viewContainer: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reservedSpaceValidationErrorsContainer.component.js","sourceRoot":"","sources":["../../../../../forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.ts","../../../../../forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,gBAAgB,EAAiC,SAAS,EAAC,MAAM,eAAe,CAAC;;AAK7H,8BAA8B;AAE9B;;GAEG;
|
|
1
|
+
{"version":3,"file":"reservedSpaceValidationErrorsContainer.component.js","sourceRoot":"","sources":["../../../../../forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.ts","../../../../../forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,gBAAgB,EAAiC,SAAS,EAAC,MAAM,eAAe,CAAC;;AAK7H,8BAA8B;AAE9B;;GAEG;AAQH,MAAM,OAAO,+CAA+C;IAExD,sEAAsE;IAEtE;;;OAGG;IACO,OAAO,CAAyB;IAE1C;;;OAGG;IACO,QAAQ,CAAmC;IAErD;;OAEG;IACO,UAAU,CAA0C;IAE9D;;OAEG;IACO,SAAS,CAAmD;IAEtE,kFAAkF;IAElF;;OAEG;IAEI,aAAa,CAAmB;IAEvC,yFAAyF;IAEzF;;;;;OAKG;IACI,IAAI,CAAC,MAA8B,EAAE,OAAyC;QAEjF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAExB,IAAG,OAAO,CAAC,QAAQ,EACnB;YACI,IAAI,CAAC,eAAe,EAAE,CAAC;SAC1B;aACI,IAAG,OAAO,CAAC,SAAS,EACzB;YACI,IAAI,CAAC,gBAAgB,EAAE,CAAC;SAC3B;aAED;YACI,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;SACrF;IACL,CAAC;IAED;;OAEG;IACI,IAAI;QAEP,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,gBAAgB;QAEtB,IAAG,CAAC,IAAI,CAAC,UAAU,EACnB;YACI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;SACjF;QAED,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACO,eAAe;QAErB,IAAG,CAAC,IAAI,CAAC,SAAS,EAClB;YACI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAC7E;gBACI,SAAS,EAAE,IAAI,CAAC,OAAO;gBACvB,OAAO,EAAE,IAAI,CAAC,QAAQ;aACzB,CAAC,CAAC;SACN;aAED;YACI,IAAI,CAAC,SAAS,CAAC,OAAO;gBACtB;oBACI,SAAS,EAAE,IAAI,CAAC,OAAO;oBACvB,OAAO,EAAE,IAAI,CAAC,QAAQ;iBACzB,CAAC;YAEF,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;SAClC;IACL,CAAC;uGA7GQ,+CAA+C;2FAA/C,+CAA+C,yKA+BX,gBAAgB,2CChDjE,6DAEM;;2FDeO,+CAA+C;kBAP3D,SAAS;+BAEI,4CAA4C,mBAGrC,uBAAuB,CAAC,MAAM;8BAkCxC,aAAa;sBADnB,SAAS;uBAAC,WAAW,EAAE,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAC","sourcesContent":["import {Component, ChangeDetectionStrategy, ViewContainerRef, ComponentRef, EmbeddedViewRef, ViewChild} from '@angular/core';\n\nimport {ValidationErrorsResult} from '../../services/errorMessagesExtractor/errorMessagesExtractor.interface';\nimport {ValidationErrorsComponent, ValidationErrorsContainerComponent, ValidationErrorsContainerOptions, ValidationErrorsTemplateContext} from '../../services/validationErrorRenderer/validationErrorRenderer.interface';\n\n//TODO: optimize duplicit code\n\n/**\n * Component that serves as container for validation errors, either component or templates with reserved space for errors\n */\n@Component(\n{\n selector: 'reserved-space-validation-errors-container',\n templateUrl: 'reservedSpaceValidationErrorsContainer.component.html',\n styleUrls: ['reservedSpaceValidationErrorsContainer.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ReservedSpaceValidationErrorsContainerComponent implements ValidationErrorsContainerComponent\n{\n //######################### protected fields #########################\n\n /**\n * Errors to be shown\n * @internal\n */\n protected _errors: ValidationErrorsResult;\n \n /**\n * Options used for displaying validation errors\n * @internal\n */\n protected _options: ValidationErrorsContainerOptions;\n\n /**\n * Instance of component reference for rendered errors\n */\n protected _component: ComponentRef<ValidationErrorsComponent>;\n\n /**\n * Instance of template reference for rendered errors\n */\n protected _template: EmbeddedViewRef<ValidationErrorsTemplateContext>;\n\n //######################### public properties - children #########################\n\n /**\n * View container for rendering validation errors\n */\n @ViewChild('container', {static: true, read: ViewContainerRef})\n public viewContainer: ViewContainerRef;\n\n //######################### public methods - implementation of #########################\n\n /**\n * Shows validation errors\n * @param errors - Errors to be shown\n * @param options - Options used for displaying validation errors\n * @param errorClasses - Array of css error classes\n */\n public show(errors: ValidationErrorsResult, options: ValidationErrorsContainerOptions): void\n {\n this._errors = errors;\n this._options = options;\n\n if(options.template)\n {\n this._renderTemplate();\n }\n else if(options.component)\n {\n this._renderComponent();\n }\n else\n {\n throw new Error('Missing template or component for rendering validation errors!');\n }\n }\n\n /**\n * Hides validation errors\n */\n public hide(): void\n {\n this.viewContainer.clear();\n this._component = null;\n this._template = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Renders validation errors component\n */\n protected _renderComponent(): void\n {\n if(!this._component)\n {\n this._component = this.viewContainer.createComponent(this._options.component);\n }\n\n this._component.instance.show(this._errors, this._options);\n }\n\n /**\n * Renders validation errors template\n */\n protected _renderTemplate(): void\n {\n if(!this._template)\n {\n this._template = this.viewContainer.createEmbeddedView(this._options.template,\n {\n $implicit: this._errors,\n options: this._options\n });\n }\n else\n {\n this._template.context =\n {\n $implicit: this._errors,\n options: this._options\n };\n\n this._template.detectChanges();\n }\n }\n}","<div>\n <ng-container #container></ng-container>\n</div>"]}
|
|
@@ -10,7 +10,7 @@ const defaultOptions = {
|
|
|
10
10
|
/**
|
|
11
11
|
* Directive that is attached to parent element of inputs group and handles css class that is added to this element
|
|
12
12
|
*/
|
|
13
|
-
class GroupHasErrorDirective {
|
|
13
|
+
export class GroupHasErrorDirective {
|
|
14
14
|
_element;
|
|
15
15
|
//######################### private fields #########################
|
|
16
16
|
/**
|
|
@@ -61,14 +61,13 @@ class GroupHasErrorDirective {
|
|
|
61
61
|
this._element.nativeElement.classList.remove(this._options.cssClass);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
65
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
64
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: GroupHasErrorDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
65
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.1", type: GroupHasErrorDirective, selector: "[groupHasError]", ngImport: i0 });
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: GroupHasErrorDirective, decorators: [{
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: GroupHasErrorDirective, decorators: [{
|
|
69
68
|
type: Directive,
|
|
70
69
|
args: [{
|
|
71
70
|
selector: '[groupHasError]'
|
|
72
71
|
}]
|
|
73
|
-
}], ctorParameters:
|
|
72
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
74
73
|
//# sourceMappingURL=groupHasError.directive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupHasError.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/groupHasError/groupHasError.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;;AAEtC;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,QAAQ,EAAE,WAAW;CACxB,CAAC;AAaF;;GAEG;
|
|
1
|
+
{"version":3,"file":"groupHasError.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/groupHasError/groupHasError.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;;AAEtC;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,QAAQ,EAAE,WAAW;CACxB,CAAC;AAaF;;GAEG;AAKH,MAAM,OAAO,sBAAsB;IAeX;IAbpB,oEAAoE;IAEpE;;OAEG;IACK,QAAQ,GAAyB,IAAI,CAAC;IAE9C;;OAEG;IACK,gBAAgB,GAAa,EAAE,CAAC;IAExC,iEAAiE;IACjE,YAAoB,QAAiC;QAAjC,aAAQ,GAAR,QAAQ,CAAyB;QAEjD,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;IACrD,CAAC;IAED,oEAAoE;IAEpE;;;OAGG;IACI,eAAe,CAAC,EAAU;QAE7B,+BAA+B;QAC/B,IAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAChD;YACI,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAClC;QAED,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,iBAAiB,CAAC,EAAU;QAE/B,gCAAgC;QAChC,IAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAC/C;YACI,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SACtE;QAED,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAED,qEAAqE;IAErE;;OAEG;IACK,aAAa;QAEjB,IAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAC/B;YACI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;SACrE;aAED;YACI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;SACxE;IACL,CAAC;uGAnEQ,sBAAsB;2FAAtB,sBAAsB;;2FAAtB,sBAAsB;kBAJlC,SAAS;mBACV;oBACI,QAAQ,EAAE,iBAAiB;iBAC9B","sourcesContent":["import {Directive, ElementRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\n/**\n * Default options for GroupHasErrorDirective\n */\nconst defaultOptions: GroupHasErrorOptions =\n{\n cssClass: 'has-error'\n};\n\n/**\n * Options for GroupHasErrorDirective\n */\nexport interface GroupHasErrorOptions\n{\n /**\n * Css class applied to element when there is an error\n */\n cssClass?: string;\n}\n\n/**\n * Directive that is attached to parent element of inputs group and handles css class that is added to this element\n */\n@Directive(\n{\n selector: '[groupHasError]'\n})\nexport class GroupHasErrorDirective\n{\n //######################### private fields #########################\n\n /**\n * Options for this directive\n */\n private _options: GroupHasErrorOptions = null;\n\n /**\n * Array of invalid controls\n */\n private _invalidControls: string[] = [];\n\n //######################### constructor #########################\n constructor(private _element: ElementRef<HTMLElement>)\n {\n this._options = extend(true, {}, defaultOptions);\n }\n\n //######################### public methods #########################\n\n /**\n * Registers control as invalid control\n * @param id - Name of control to be registered\n */\n public registerControl(id: string): void\n {\n //control is not registered yet\n if(!this._invalidControls.find(itm => itm == id))\n {\n this._invalidControls.push(id);\n }\n\n this._updateStatus();\n }\n\n /**\n * Unregisters control from invalid controls\n * @param id - Id of control to be unregistered\n */\n public unregisterControl(id: string): void\n {\n //control was registered already\n if(this._invalidControls.find(itm => itm == id))\n {\n this._invalidControls.splice(this._invalidControls.indexOf(id), 1);\n }\n\n this._updateStatus();\n }\n\n //######################### private methods #########################\n\n /**\n * Updates status of element (css classes)\n */\n private _updateStatus(): void\n {\n if(this._invalidControls.length)\n {\n this._element.nativeElement.classList.add(this._options.cssClass);\n }\n else\n {\n this._element.nativeElement.classList.remove(this._options.cssClass);\n }\n }\n}"]}
|
package/es2022/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js
CHANGED
|
@@ -5,9 +5,9 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
/**
|
|
6
6
|
* Directive that is attached to parent element of inputs group and handles css class that is added to this element and registers provider for ValidationErrorsContainerView
|
|
7
7
|
*/
|
|
8
|
-
class GroupHasErrorContainerDirective extends GroupHasErrorDirective {
|
|
9
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
10
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
8
|
+
export class GroupHasErrorContainerDirective extends GroupHasErrorDirective {
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: GroupHasErrorContainerDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
10
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.1", type: GroupHasErrorContainerDirective, selector: "[groupHasErrorContainer]", providers: [
|
|
11
11
|
{
|
|
12
12
|
provide: GroupHasErrorDirective,
|
|
13
13
|
useExisting: GroupHasErrorContainerDirective
|
|
@@ -15,8 +15,7 @@ class GroupHasErrorContainerDirective extends GroupHasErrorDirective {
|
|
|
15
15
|
ValidationErrorsContainerView
|
|
16
16
|
], usesInheritance: true, ngImport: i0 });
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: GroupHasErrorContainerDirective, decorators: [{
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: GroupHasErrorContainerDirective, decorators: [{
|
|
20
19
|
type: Directive,
|
|
21
20
|
args: [{
|
|
22
21
|
selector: '[groupHasErrorContainer]',
|
package/es2022/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupHasErrorContainer.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAmB,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAC,6BAA6B,EAAC,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAC,sBAAsB,EAAC,MAAM,0CAA0C,CAAC;;AAEhF;;GAEG;
|
|
1
|
+
{"version":3,"file":"groupHasErrorContainer.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAmB,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAC,6BAA6B,EAAC,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAC,sBAAsB,EAAC,MAAM,0CAA0C,CAAC;;AAEhF;;GAEG;AAcH,MAAM,OAAO,+BAAgC,SAAQ,sBAAsB;uGAA9D,+BAA+B;2FAA/B,+BAA+B,mDATxC;YAEI;gBACI,OAAO,EAAE,sBAAsB;gBAC/B,WAAW,EAAE,+BAA+B;aAC/C;YACD,6BAA6B;SAChC;;2FAEQ,+BAA+B;kBAb3C,SAAS;mBACV;oBACI,QAAQ,EAAE,0BAA0B;oBACpC,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,sBAAsB;4BAC/B,WAAW,iCAAiC;yBAC/C;wBACD,6BAA6B;qBAChC;iBACJ","sourcesContent":["import {Directive, ExistingProvider} from '@angular/core';\n\nimport {ValidationErrorsContainerView} from '../../misc/validationErrorsContainerView';\nimport {GroupHasErrorDirective} from '../groupHasError/groupHasError.directive';\n\n/**\n * Directive that is attached to parent element of inputs group and handles css class that is added to this element and registers provider for ValidationErrorsContainerView\n */\n@Directive(\n{\n selector: '[groupHasErrorContainer]',\n providers:\n [\n <ExistingProvider>\n {\n provide: GroupHasErrorDirective,\n useExisting: GroupHasErrorContainerDirective\n },\n ValidationErrorsContainerView\n ]\n})\nexport class GroupHasErrorContainerDirective extends GroupHasErrorDirective\n{\n}"]}
|
|
@@ -18,7 +18,7 @@ import * as i5 from "../../misc/validationErrorsContainerView";
|
|
|
18
18
|
/**
|
|
19
19
|
* Directive that is attached to control element and handles css classes that are added to this element
|
|
20
20
|
*/
|
|
21
|
-
class HasErrorDirective {
|
|
21
|
+
export class HasErrorDirective {
|
|
22
22
|
_element;
|
|
23
23
|
_rendererFactory;
|
|
24
24
|
_viewContainer;
|
|
@@ -180,8 +180,8 @@ class HasErrorDirective {
|
|
|
180
180
|
attributes: true
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
184
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
183
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: HasErrorDirective, deps: [{ token: i0.ElementRef }, { token: i1.ValidationErrorRendererFactory }, { token: i0.ViewContainerRef }, { token: i2.GroupHasErrorDirective, optional: true, skipSelf: true }, { token: i3.FormControlDirective, optional: true }, { token: i3.FormControlName, optional: true }, { token: i3.NgModel, optional: true }, { token: i4.SubmittedService, optional: true }, { token: i5.ValidationErrorsContainerView, optional: true }, { token: STRING_LOCALIZATION }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
184
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.1", type: HasErrorDirective, selector: "[hasError]", inputs: { errorMessages: "errorMessages", errorsComponent: "errorsComponent", errorsTemplate: "errorsTemplate" }, ngImport: i0 });
|
|
185
185
|
}
|
|
186
186
|
__decorate([
|
|
187
187
|
BindThis,
|
|
@@ -189,13 +189,12 @@ __decorate([
|
|
|
189
189
|
__metadata("design:paramtypes", [Function, Function, Boolean]),
|
|
190
190
|
__metadata("design:returntype", void 0)
|
|
191
191
|
], HasErrorDirective.prototype, "_isSubmittedOrDirty", null);
|
|
192
|
-
|
|
193
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: HasErrorDirective, decorators: [{
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: HasErrorDirective, decorators: [{
|
|
194
193
|
type: Directive,
|
|
195
194
|
args: [{
|
|
196
195
|
selector: '[hasError]'
|
|
197
196
|
}]
|
|
198
|
-
}], ctorParameters:
|
|
197
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.ValidationErrorRendererFactory }, { type: i0.ViewContainerRef }, { type: i2.GroupHasErrorDirective, decorators: [{
|
|
199
198
|
type: Optional
|
|
200
199
|
}, {
|
|
201
200
|
type: SkipSelf
|
|
@@ -212,7 +211,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
|
212
211
|
}] }, { type: undefined, decorators: [{
|
|
213
212
|
type: Inject,
|
|
214
213
|
args: [STRING_LOCALIZATION]
|
|
215
|
-
}] }, { type: i0.Injector }]
|
|
214
|
+
}] }, { type: i0.Injector }], propDecorators: { errorMessages: [{
|
|
216
215
|
type: Input
|
|
217
216
|
}], errorsComponent: [{
|
|
218
217
|
type: Input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasError.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/hasError/hasError.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAqB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAiB,IAAI,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACxK,OAAO,EAAC,oBAAoB,EAAE,eAAe,EAAe,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAqB,mBAAmB,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,8BAA8B,EAAC,MAAM,wEAAwE,CAAC;AAEtH,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAC,sBAAsB,EAAC,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAC,6BAA6B,EAAC,MAAM,0CAA0C,CAAC;;;;;;;AAEvF,qEAAqE;AAErE;;GAEG;AACH,MAIa,iBAAiB;IAmEN;IACA;IACA;IACwB;IACZ;IACA;IACA;IACA;IACA;IACmB;IAC7B;IA3EtB,oEAAoE;IAEpE;;OAEG;IACK,cAAc,GAAiB,IAAI,YAAY,EAAE,CAAC;IAE1D;;OAEG;IACK,GAAG,GAAW,U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,EAAE,CAAC;aACxB;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAClD;YACI,eAAe,EAAE,CAAC,OAAO,CAAC;YAC1B,UAAU,EAAE,IAAI;SACnB,CAAC,CAAC;IACP,CAAC;uGApNQ,iBAAiB,ubA4EN,mBAAmB;2FA5E9B,iBAAiB;;AAmLlB;IADP,QAAQ;;;;4DAcR;SAhMQ,iBAAiB;2FAAjB,iBAAiB;kBAJ7B,SAAS;mBACV;oBACI,QAAQ,EAAE,YAAY;iBACzB;;0BAuEgB,QAAQ;;0BAAI,QAAQ;;0BACpB,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,MAAM;2BAAC,mBAAmB;mEAxBhC,aAAa;sBADnB,KAAK;gBAOC,eAAe;sBADrB,KAAK;gBAOC,cAAc;sBADpB,KAAK;gBAoHE,mBAAmB","sourcesContent":["import {Directive, ElementRef, Optional, SkipSelf, OnInit, OnDestroy, Inject, Input, Injector, ViewContainerRef, AfterViewInit, Type, TemplateRef} from '@angular/core';\nimport {FormControlDirective, FormControlName, FormControl, NgModel} from '@angular/forms';\nimport {StringLocalization, STRING_LOCALIZATION} from '@anglr/common';\nimport {generateId, BindThis, StringDictionary} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {ValidationErrorRendererFactory} from '../../services/validationErrorRenderer/validationErrorRenderer.service';\nimport {ValidationErrorRenderer, ValidationErrorsComponent, ValidationErrorsRendererOptions, ValidationErrorsTemplateContext} from '../../services/validationErrorRenderer/validationErrorRenderer.interface';\nimport {SubmittedService} from '../../services/submitted/submitted.service';\nimport {GroupHasErrorDirective} from '../groupHasError/groupHasError.directive';\nimport {ValidationErrorsContainerView} from '../../misc/validationErrorsContainerView';\n\n//TODO - add support for setting renderer factory options using input\n\n/**\n * Directive that is attached to control element and handles css classes that are added to this element\n */\n@Directive(\n{\n selector: '[hasError]'\n})\nexport class HasErrorDirective implements OnInit, AfterViewInit, OnDestroy\n{\n //######################### private fields #########################\n\n /**\n * Subscriptions that are destroyed with destruction of this directive\n */\n private _subscriptions: Subscription = new Subscription();\n\n /**\n * Unique generated id of control\n */\n private _id: string = generateId(10);\n\n /**\n * Last value of control pristine attribute\n */\n private _previousDirty: boolean = false;\n\n /**\n * Indication whether currently are any errors rendered\n */\n private _hasErrors: boolean = false;\n\n /**\n * Mutation observer used for observing changes on class of element\n */\n private _observer: MutationObserver;\n\n //######################### private properties #########################\n\n /**\n * Gets control which was assigned to this element\n */\n private get control(): FormControl\n {\n return this._formControl?.control || this._formControlName?.control || this._ngModel?.control;\n }\n\n //######################### public properties #########################\n\n /**\n * Instance of validation error renderer\n */\n public renderer: ValidationErrorRenderer;\n\n //######################### public propeties - inputs #########################\n\n /**\n * Customized error messages\n */\n @Input()\n public errorMessages: StringDictionary;\n\n /**\n * Custom component used for rendering validation errors\n */\n @Input()\n public errorsComponent?: Type<ValidationErrorsComponent>;\n\n /**\n * Custom template used for rendering validation errors\n */\n @Input()\n public errorsTemplate?: TemplateRef<ValidationErrorsTemplateContext>;\n\n //######################### constructor #########################\n constructor(private _element: ElementRef<HTMLElement>,\n private _rendererFactory: ValidationErrorRendererFactory,\n private _viewContainer: ViewContainerRef,\n @Optional() @SkipSelf() private _groupHasError: GroupHasErrorDirective,\n @Optional() private _formControl: FormControlDirective,\n @Optional() private _formControlName: FormControlName,\n @Optional() private _ngModel: NgModel,\n @Optional() private _submittedSvc: SubmittedService,\n @Optional() private _containerView: ValidationErrorsContainerView,\n @Inject(STRING_LOCALIZATION) protected _stringLocalization: StringLocalization,\n protected _injector: Injector)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._containerView ??= new ValidationErrorsContainerView();\n this._containerView.viewContainer ??= this._viewContainer;\n\n this._registerMutationObserver();\n\n this._subscriptions.add(this._stringLocalization.textsChange.subscribe(() => this._updateStatus()));\n this._subscriptions.add(this.control.statusChanges.subscribe(() => this._updateStatus()));\n\n if(this._submittedSvc)\n {\n this._subscriptions.add(this._submittedSvc.submittedChange.subscribe(() => this._isSubmittedOrDirty(() => this._updateStatus())));\n }\n }\n\n //######################### public methods - implementation of AfterViewInit #########################\n \n /**\n * Called when view was initialized\n */\n public ngAfterViewInit(): void\n {\n this.renderer = this._rendererFactory.create(this.control,\n this._containerView,\n this._injector,\n this._isSubmittedOrDirty);\n\n this._updateStatus();\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._subscriptions.unsubscribe();\n\n this._groupHasError?.unregisterControl(this._id);\n this._observer?.disconnect();\n this.renderer?.destroy();\n }\n\n //######################### private methods #########################\n\n /**\n * Updates status of control and css classes\n */\n private _updateStatus(): void\n {\n if(!this.renderer)\n {\n return;\n }\n\n const opts: ValidationErrorsRendererOptions = {};\n\n if(this.errorsTemplate)\n {\n opts.template = this.errorsTemplate;\n }\n else if(this.errorsComponent)\n {\n opts.component = this.errorsComponent;\n }\n\n this._previousDirty = this.control.dirty;\n this._hasErrors = this.renderer.update(opts, this.errorMessages);\n this._toggleGroupHasError();\n }\n\n /**\n * Toggles registration of control in parent group\n */\n private _toggleGroupHasError(): void\n {\n if(this._groupHasError)\n {\n this._isSubmittedOrDirty(() => this._groupHasError.registerControl(this._id),\n () => this._groupHasError.unregisterControl(this._id),\n this._hasErrors);\n }\n }\n\n /**\n * Calls action when form is submitted or control is dirty\n * @param action - Action to be called when form is submitted or control dirty\n * @param falseAction - Action to be called when form is not submitted and control is not dirty\n * @param additionalCondition - Additional condition to be evaluated\n */\n @BindThis\n private _isSubmittedOrDirty(action: () => void, falseAction: () => void = () => {}, additionalCondition: boolean = true): void\n {\n //submitted form or dirty control\n if((this._submittedSvc?.submitted ||\n this.control?.dirty) &&\n additionalCondition)\n {\n action();\n }\n else\n {\n falseAction();\n }\n }\n\n /**\n * Registers mutation observer which watch for changes of class list\n */\n private _registerMutationObserver(): void\n {\n this._observer = new MutationObserver(() =>\n {\n if(this.control.dirty != this._previousDirty)\n {\n this._updateStatus();\n }\n });\n\n this._observer.observe(this._element.nativeElement, \n {\n attributeFilter: ['class'],\n attributes: true\n });\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"hasError.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/hasError/hasError.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAqB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAiB,IAAI,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACxK,OAAO,EAAC,oBAAoB,EAAE,eAAe,EAAe,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAqB,mBAAmB,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,8BAA8B,EAAC,MAAM,wEAAwE,CAAC;AAEtH,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAC,sBAAsB,EAAC,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAC,6BAA6B,EAAC,MAAM,0CAA0C,CAAC;;;;;;;AAEvF,qEAAqE;AAErE;;GAEG;AAKH,MAAM,OAAO,iBAAiB;IAmEN;IACA;IACA;IACwB;IACZ;IACA;IACA;IACA;IACA;IACmB;IAC7B;IA3EtB,oEAAoE;IAEpE;;OAEG;IACK,cAAc,GAAiB,IAAI,YAAY,EAAE,CAAC;IAE1D;;OAEG;IACK,GAAG,GAAW,UAAU,CAAC,EAAE,CAAC,CAAC;IAErC;;OAEG;IACK,cAAc,GAAY,KAAK,CAAC;IAExC;;OAEG;I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AAI,CAAC,QAAQ,CAAC,aAAa,EAClD;YACI,eAAe,EAAE,CAAC,OAAO,CAAC;YAC1B,UAAU,EAAE,IAAI;SACnB,CAAC,CAAC;IACP,CAAC;uGApNQ,iBAAiB,ubA4EN,mBAAmB;2FA5E9B,iBAAiB;;AAmLlB;IADP,QAAQ;;;;4DAcR;2FAhMQ,iBAAiB;kBAJ7B,SAAS;mBACV;oBACI,QAAQ,EAAE,YAAY;iBACzB;;0BAuEgB,QAAQ;;0BAAI,QAAQ;;0BACpB,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,MAAM;2BAAC,mBAAmB;gEAxBhC,aAAa;sBADnB,KAAK;gBAOC,eAAe;sBADrB,KAAK;gBAOC,cAAc;sBADpB,KAAK;gBAoHE,mBAAmB","sourcesContent":["import {Directive, ElementRef, Optional, SkipSelf, OnInit, OnDestroy, Inject, Input, Injector, ViewContainerRef, AfterViewInit, Type, TemplateRef} from '@angular/core';\nimport {FormControlDirective, FormControlName, FormControl, NgModel} from '@angular/forms';\nimport {StringLocalization, STRING_LOCALIZATION} from '@anglr/common';\nimport {generateId, BindThis, StringDictionary} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {ValidationErrorRendererFactory} from '../../services/validationErrorRenderer/validationErrorRenderer.service';\nimport {ValidationErrorRenderer, ValidationErrorsComponent, ValidationErrorsRendererOptions, ValidationErrorsTemplateContext} from '../../services/validationErrorRenderer/validationErrorRenderer.interface';\nimport {SubmittedService} from '../../services/submitted/submitted.service';\nimport {GroupHasErrorDirective} from '../groupHasError/groupHasError.directive';\nimport {ValidationErrorsContainerView} from '../../misc/validationErrorsContainerView';\n\n//TODO - add support for setting renderer factory options using input\n\n/**\n * Directive that is attached to control element and handles css classes that are added to this element\n */\n@Directive(\n{\n selector: '[hasError]'\n})\nexport class HasErrorDirective implements OnInit, AfterViewInit, OnDestroy\n{\n //######################### private fields #########################\n\n /**\n * Subscriptions that are destroyed with destruction of this directive\n */\n private _subscriptions: Subscription = new Subscription();\n\n /**\n * Unique generated id of control\n */\n private _id: string = generateId(10);\n\n /**\n * Last value of control pristine attribute\n */\n private _previousDirty: boolean = false;\n\n /**\n * Indication whether currently are any errors rendered\n */\n private _hasErrors: boolean = false;\n\n /**\n * Mutation observer used for observing changes on class of element\n */\n private _observer: MutationObserver;\n\n //######################### private properties #########################\n\n /**\n * Gets control which was assigned to this element\n */\n private get control(): FormControl\n {\n return this._formControl?.control || this._formControlName?.control || this._ngModel?.control;\n }\n\n //######################### public properties #########################\n\n /**\n * Instance of validation error renderer\n */\n public renderer: ValidationErrorRenderer;\n\n //######################### public propeties - inputs #########################\n\n /**\n * Customized error messages\n */\n @Input()\n public errorMessages: StringDictionary;\n\n /**\n * Custom component used for rendering validation errors\n */\n @Input()\n public errorsComponent?: Type<ValidationErrorsComponent>;\n\n /**\n * Custom template used for rendering validation errors\n */\n @Input()\n public errorsTemplate?: TemplateRef<ValidationErrorsTemplateContext>;\n\n //######################### constructor #########################\n constructor(private _element: ElementRef<HTMLElement>,\n private _rendererFactory: ValidationErrorRendererFactory,\n private _viewContainer: ViewContainerRef,\n @Optional() @SkipSelf() private _groupHasError: GroupHasErrorDirective,\n @Optional() private _formControl: FormControlDirective,\n @Optional() private _formControlName: FormControlName,\n @Optional() private _ngModel: NgModel,\n @Optional() private _submittedSvc: SubmittedService,\n @Optional() private _containerView: ValidationErrorsContainerView,\n @Inject(STRING_LOCALIZATION) protected _stringLocalization: StringLocalization,\n protected _injector: Injector)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._containerView ??= new ValidationErrorsContainerView();\n this._containerView.viewContainer ??= this._viewContainer;\n\n this._registerMutationObserver();\n\n this._subscriptions.add(this._stringLocalization.textsChange.subscribe(() => this._updateStatus()));\n this._subscriptions.add(this.control.statusChanges.subscribe(() => this._updateStatus()));\n\n if(this._submittedSvc)\n {\n this._subscriptions.add(this._submittedSvc.submittedChange.subscribe(() => this._isSubmittedOrDirty(() => this._updateStatus())));\n }\n }\n\n //######################### public methods - implementation of AfterViewInit #########################\n \n /**\n * Called when view was initialized\n */\n public ngAfterViewInit(): void\n {\n this.renderer = this._rendererFactory.create(this.control,\n this._containerView,\n this._injector,\n this._isSubmittedOrDirty);\n\n this._updateStatus();\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._subscriptions.unsubscribe();\n\n this._groupHasError?.unregisterControl(this._id);\n this._observer?.disconnect();\n this.renderer?.destroy();\n }\n\n //######################### private methods #########################\n\n /**\n * Updates status of control and css classes\n */\n private _updateStatus(): void\n {\n if(!this.renderer)\n {\n return;\n }\n\n const opts: ValidationErrorsRendererOptions = {};\n\n if(this.errorsTemplate)\n {\n opts.template = this.errorsTemplate;\n }\n else if(this.errorsComponent)\n {\n opts.component = this.errorsComponent;\n }\n\n this._previousDirty = this.control.dirty;\n this._hasErrors = this.renderer.update(opts, this.errorMessages);\n this._toggleGroupHasError();\n }\n\n /**\n * Toggles registration of control in parent group\n */\n private _toggleGroupHasError(): void\n {\n if(this._groupHasError)\n {\n this._isSubmittedOrDirty(() => this._groupHasError.registerControl(this._id),\n () => this._groupHasError.unregisterControl(this._id),\n this._hasErrors);\n }\n }\n\n /**\n * Calls action when form is submitted or control is dirty\n * @param action - Action to be called when form is submitted or control dirty\n * @param falseAction - Action to be called when form is not submitted and control is not dirty\n * @param additionalCondition - Additional condition to be evaluated\n */\n @BindThis\n private _isSubmittedOrDirty(action: () => void, falseAction: () => void = () => {}, additionalCondition: boolean = true): void\n {\n //submitted form or dirty control\n if((this._submittedSvc?.submitted ||\n this.control?.dirty) &&\n additionalCondition)\n {\n action();\n }\n else\n {\n falseAction();\n }\n }\n\n /**\n * Registers mutation observer which watch for changes of class list\n */\n private _registerMutationObserver(): void\n {\n this._observer = new MutationObserver(() =>\n {\n if(this.control.dirty != this._previousDirty)\n {\n this._updateStatus();\n }\n });\n\n this._observer.observe(this._element.nativeElement, \n {\n attributeFilter: ['class'],\n attributes: true\n });\n }\n}"]}
|
|
@@ -14,7 +14,7 @@ const MAX_NUMBER_VALIDATOR = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Directive injecting checking for number max value validator
|
|
16
16
|
*/
|
|
17
|
-
class MaxValueNumberValidatorDirective {
|
|
17
|
+
export class MaxValueNumberValidatorDirective {
|
|
18
18
|
//######################### private fields #########################
|
|
19
19
|
/**
|
|
20
20
|
* Current max value that is allowed
|
|
@@ -60,20 +60,19 @@ class MaxValueNumberValidatorDirective {
|
|
|
60
60
|
validate(control) {
|
|
61
61
|
return this._validator(control);
|
|
62
62
|
}
|
|
63
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
64
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
63
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: MaxValueNumberValidatorDirective, deps: [{ token: 'maxValue', attribute: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
64
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.1", type: MaxValueNumberValidatorDirective, selector: "input[number][maxValue][formControlName],input[number][maxValue][formControl],input[number][maxValue][ngModel]", inputs: { maxValue: "maxValue" }, providers: [MAX_NUMBER_VALIDATOR], usesOnChanges: true, ngImport: i0 });
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: MaxValueNumberValidatorDirective, decorators: [{
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: MaxValueNumberValidatorDirective, decorators: [{
|
|
68
67
|
type: Directive,
|
|
69
68
|
args: [{
|
|
70
69
|
selector: 'input[number][maxValue][formControlName],input[number][maxValue][formControl],input[number][maxValue][ngModel]',
|
|
71
70
|
providers: [MAX_NUMBER_VALIDATOR]
|
|
72
71
|
}]
|
|
73
|
-
}], ctorParameters:
|
|
72
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
74
73
|
type: Attribute,
|
|
75
74
|
args: ['maxValue']
|
|
76
|
-
}] }]
|
|
75
|
+
}] }], propDecorators: { maxValue: [{
|
|
77
76
|
type: Input
|
|
78
77
|
}] } });
|
|
79
78
|
//# sourceMappingURL=maxValueNumberValidator.directive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maxValueNumberValidator.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/numberInput/maxValueNumberValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAA2B,MAAM,eAAe,CAAC;AAClH,OAAO,EAAC,aAAa,EAA4D,MAAM,gBAAgB,CAAC;AACxG,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;;AAEjD;;GAEG;AACH,MAAM,oBAAoB,GAC1B;IACI,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,gCAAgC,CAAC;IAC/D,KAAK,EAAE,IAAI;CACd,CAAC;AAEF;;GAEG;
|
|
1
|
+
{"version":3,"file":"maxValueNumberValidator.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/numberInput/maxValueNumberValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAA2B,MAAM,eAAe,CAAC;AAClH,OAAO,EAAC,aAAa,EAA4D,MAAM,gBAAgB,CAAC;AACxG,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB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IG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;uGAnEQ,gCAAgC,kBA4BlB,UAAU;2FA5BxB,gCAAgC,2KAF9B,CAAC,oBAAoB,CAAC;;2FAExB,gCAAgC;kBAL5C,SAAS;mBACV;oBACI,QAAQ,EAAE,gHAAgH;oBAC1H,SAAS,EAAE,CAAC,oBAAoB,CAAC;iBACpC;;0BA6BgB,SAAS;2BAAC,UAAU;yCAH1B,QAAQ;sBADd,KAAK","sourcesContent":["import {ExistingProvider, Input, forwardRef, Directive, Attribute, OnChanges, SimpleChanges} from '@angular/core';\nimport {NG_VALIDATORS, AbstractControl, Validator, ValidatorFn, ValidationErrors} from '@angular/forms';\nimport {isBlank, isPresent} from '@jscrpt/common';\n\nimport {Validators} from '../../misc/validators';\n\n/**\n * Validator that is injected with directive MaxValueNumberValidatorDirective\n */\nconst MAX_NUMBER_VALIDATOR = <ExistingProvider>\n{\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => MaxValueNumberValidatorDirective),\n multi: true\n};\n\n/**\n * Directive injecting checking for number max value validator\n */\n@Directive(\n{\n selector: 'input[number][maxValue][formControlName],input[number][maxValue][formControl],input[number][maxValue][ngModel]',\n providers: [MAX_NUMBER_VALIDATOR]\n})\nexport class MaxValueNumberValidatorDirective implements Validator, OnChanges\n{\n //######################### private fields #########################\n\n /**\n * Current max value that is allowed\n */\n private _maxValue: number|null;\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn;\n\n /**\n * Indication whether validator was initialized\n */\n private _initialized: boolean = false;\n\n //######################### public properties - inputs #########################\n\n /**\n * Bound max value that is allowed, which overrides value set to attribute maxValue\n */\n @Input()\n public maxValue?: number;\n\n //######################### constructor #########################\n constructor(@Attribute('maxValue') maxValue: string)\n {\n let value;\n\n if(isBlank(maxValue) || maxValue.length < 1 || isNaN(value = parseFloat(maxValue.replace(',', '.'))))\n {\n value = null;\n }\n\n this._maxValue = value;\n }\n\n //######################### public methods - implementation of OnChanges #########################\n\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(!this._initialized)\n {\n this._initialized = true;\n\n this._validator = Validators.max(this._maxValue);\n }\n\n if ('maxValue' in changes)\n {\n this._validator = Validators.max(isPresent(this.maxValue) ? <number>this.maxValue! : this._maxValue);\n }\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n}"]}
|