@anglr/common 18.2.0-beta.20231109093816 → 18.2.1-beta.20231120095300
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 +6 -0
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js +3 -3
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
- package/es2022/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +3 -3
- package/es2022/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -1
- package/es2022/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js +3 -3
- package/es2022/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js.map +1 -1
- package/es2022/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js +3 -3
- package/es2022/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js.map +1 -1
- package/es2022/forms/src/directives/groupHasError/groupHasError.directive.js +3 -3
- package/es2022/forms/src/directives/groupHasError/groupHasError.directive.js.map +1 -1
- package/es2022/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js +3 -3
- package/es2022/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js.map +1 -1
- package/es2022/forms/src/directives/hasError/hasError.directive.js +3 -3
- package/es2022/forms/src/directives/hasError/hasError.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/maxValueNumberValidator.directive.js +3 -3
- package/es2022/forms/src/directives/numberInput/maxValueNumberValidator.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/minValueNumberValidator.directive.js +3 -3
- package/es2022/forms/src/directives/numberInput/minValueNumberValidator.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.js +3 -3
- package/es2022/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.js.map +1 -1
- package/es2022/forms/src/directives/numberInput/numberInputValidator.directive.js +3 -3
- package/es2022/forms/src/directives/numberInput/numberInputValidator.directive.js.map +1 -1
- package/es2022/forms/src/directives/requiredClass/requiredClass.directive.js +3 -3
- package/es2022/forms/src/directives/requiredClass/requiredClass.directive.js.map +1 -1
- package/es2022/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js +3 -3
- package/es2022/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +3 -3
- 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 +3 -3
- 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 +3 -3
- package/es2022/forms/src/modules/errorMessage/directives/groupErrorsTemplate/groupErrorsTemplate.directive.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/modules/errorMessage.module.js +4 -4
- package/es2022/forms/src/modules/errorMessage/modules/errorMessage.module.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.js +3 -3
- package/es2022/forms/src/modules/errorMessage/pipes/withErrorMessage/withErrorMessage.pipe.js.map +1 -1
- package/es2022/forms/src/modules/formPipes/modules/formPipes.module.js +4 -4
- package/es2022/forms/src/modules/formPipes/modules/formPipes.module.js.map +1 -1
- package/es2022/forms/src/modules/formPipes/pipes/asFormArray/asFormArray.pipe.js +3 -3
- package/es2022/forms/src/modules/formPipes/pipes/asFormArray/asFormArray.pipe.js.map +1 -1
- package/es2022/forms/src/modules/formPipes/pipes/asFormControl/asFormControl.pipe.js +3 -3
- 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 +3 -3
- 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 +3 -3
- package/es2022/forms/src/modules/formPipes/pipes/getControl/getControl.pipe.js.map +1 -1
- package/es2022/forms/src/modules/hasError.module.js +4 -4
- package/es2022/forms/src/modules/hasError.module.js.map +1 -1
- package/es2022/forms/src/modules/numberInput.module.js +4 -4
- package/es2022/forms/src/modules/numberInput.module.js.map +1 -1
- package/es2022/forms/src/modules/requiredClass.module.js +4 -4
- package/es2022/forms/src/modules/requiredClass.module.js.map +1 -1
- package/es2022/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js +3 -3
- package/es2022/forms/src/services/errorMessagesExtractor/errorMessagesExtractor.service.js.map +1 -1
- package/es2022/forms/src/services/formModelBuilder/formModelBuilder.service.js +3 -3
- package/es2022/forms/src/services/formModelBuilder/formModelBuilder.service.js.map +1 -1
- package/es2022/forms/src/services/submitted/submitted.service.js +3 -3
- package/es2022/forms/src/services/submitted/submitted.service.js.map +1 -1
- package/es2022/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js +3 -3
- package/es2022/forms/src/services/validationErrorRenderer/validationErrorRenderer.service.js.map +1 -1
- package/es2022/hotkeys/src/components/cheatSheet/cheatSheet.component.js +3 -3
- package/es2022/hotkeys/src/components/cheatSheet/cheatSheet.component.js.map +1 -1
- package/es2022/hotkeys/src/services/appHotkeys.service.js +3 -3
- package/es2022/hotkeys/src/services/appHotkeys.service.js.map +1 -1
- package/es2022/material/src/components/confirmationDialog/confirmationDialog.component.js +3 -3
- package/es2022/material/src/components/confirmationDialog/confirmationDialog.component.js.map +1 -1
- package/es2022/material/src/components/movableTitledDialog/movableTitledDialog.component.js +3 -3
- package/es2022/material/src/components/movableTitledDialog/movableTitledDialog.component.js.map +1 -1
- package/es2022/material/src/components/titledDialog/titledDialog.component.js +3 -3
- package/es2022/material/src/components/titledDialog/titledDialog.component.js.map +1 -1
- package/es2022/material/src/directives/confirmationDialog/confirmationDialog.directive.js +3 -3
- package/es2022/material/src/directives/confirmationDialog/confirmationDialog.directive.js.map +1 -1
- package/es2022/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.js +3 -3
- package/es2022/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.js.map +1 -1
- package/es2022/material/src/modules/confirmationDialog.module.js +4 -4
- package/es2022/material/src/modules/confirmationDialog.module.js.map +1 -1
- package/es2022/material/src/modules/debugDataCopyClick.module.js +4 -4
- package/es2022/material/src/modules/debugDataCopyClick.module.js.map +1 -1
- package/es2022/material/src/modules/movableTitledDialog.module.js +4 -4
- package/es2022/material/src/modules/movableTitledDialog.module.js.map +1 -1
- package/es2022/material/src/modules/titledDialog.module.js +4 -4
- package/es2022/material/src/modules/titledDialog.module.js.map +1 -1
- package/es2022/material/src/services/titledDialog/titledDialog.service.js +3 -3
- package/es2022/material/src/services/titledDialog/titledDialog.service.js.map +1 -1
- package/es2022/moment/src/modules/moment.module.js +4 -4
- package/es2022/moment/src/modules/moment.module.js.map +1 -1
- package/es2022/moment/src/pipes/momentConvert/momentConvert.pipe.js +3 -3
- package/es2022/moment/src/pipes/momentConvert/momentConvert.pipe.js.map +1 -1
- package/es2022/moment/src/pipes/momentFormat/momentFormat.pipe.js +3 -3
- package/es2022/moment/src/pipes/momentFormat/momentFormat.pipe.js.map +1 -1
- package/es2022/numeral/src/pipes/numeral.pipe.js +3 -3
- package/es2022/numeral/src/pipes/numeral.pipe.js.map +1 -1
- package/es2022/router/src/services/routing/dataRouter.js +3 -3
- package/es2022/router/src/services/routing/dataRouter.js.map +1 -1
- package/es2022/router/src/services/routing/dataRouterData.js +3 -3
- package/es2022/router/src/services/routing/dataRouterData.js.map +1 -1
- package/es2022/src/components/collapsibleIcon/collapsibleIcon.component.js +3 -3
- package/es2022/src/components/collapsibleIcon/collapsibleIcon.component.js.map +1 -1
- package/es2022/src/components/collapsibleTitle/collapsibleTitle.component.js +3 -3
- package/es2022/src/components/collapsibleTitle/collapsibleTitle.component.js.map +1 -1
- package/es2022/src/directives/bodyRender/bodyRender.directive.js +3 -3
- package/es2022/src/directives/bodyRender/bodyRender.directive.js.map +1 -1
- package/es2022/src/directives/clickOutside/clickOutside.directive.js +3 -3
- package/es2022/src/directives/clickOutside/clickOutside.directive.js.map +1 -1
- package/es2022/src/directives/goBack/goBack.directive.js +3 -3
- package/es2022/src/directives/goBack/goBack.directive.js.map +1 -1
- package/es2022/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.js +3 -3
- package/es2022/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.js.map +1 -1
- package/es2022/src/directives/positionTo/positionTo.directive.js +3 -3
- package/es2022/src/directives/positionTo/positionTo.directive.js.map +1 -1
- package/es2022/src/modules/castPipes/modules/castPipes.module.js +4 -4
- package/es2022/src/modules/castPipes/modules/castPipes.module.js.map +1 -1
- package/es2022/src/modules/castPipes/pipes/asHtmlElement/asHtmlElement.pipe.js +3 -3
- package/es2022/src/modules/castPipes/pipes/asHtmlElement/asHtmlElement.pipe.js.map +1 -1
- package/es2022/src/modules/castPipes/pipes/asNgClassRequired/asNgClassRequired.pipe.js +3 -3
- package/es2022/src/modules/castPipes/pipes/asNgClassRequired/asNgClassRequired.pipe.js.map +1 -1
- package/es2022/src/modules/castPipes/pipes/asRequired/asRequired.pipe.js +3 -3
- package/es2022/src/modules/castPipes/pipes/asRequired/asRequired.pipe.js.map +1 -1
- package/es2022/src/modules/castPipes/pipes/castType/castType.pipe.js +3 -3
- package/es2022/src/modules/castPipes/pipes/castType/castType.pipe.js.map +1 -1
- package/es2022/src/modules/commonDynamic.module.js +4 -4
- package/es2022/src/modules/commonDynamic.module.js.map +1 -1
- package/es2022/src/modules/commonLocalize.module.js +4 -4
- package/es2022/src/modules/commonLocalize.module.js.map +1 -1
- package/es2022/src/modules/commonUtils.module.js +4 -4
- package/es2022/src/modules/commonUtils.module.js.map +1 -1
- package/es2022/src/modules/debugData/components/debugData/debugData.component.js +3 -3
- package/es2022/src/modules/debugData/components/debugData/debugData.component.js.map +1 -1
- package/es2022/src/modules/debugData/modules/debugData.module.js +4 -4
- package/es2022/src/modules/debugData/modules/debugData.module.js.map +1 -1
- package/es2022/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.js +3 -3
- package/es2022/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.js.map +1 -1
- package/es2022/src/modules/logger/components/console/console.component.js +3 -3
- package/es2022/src/modules/logger/components/console/console.component.js.map +1 -1
- package/es2022/src/modules/logger/services/console/consoleComponent.service.js +3 -3
- package/es2022/src/modules/logger/services/console/consoleComponent.service.js.map +1 -1
- package/es2022/src/modules/logger/services/console/consoleComponentService.options.js +3 -3
- package/es2022/src/modules/logger/services/console/consoleComponentService.options.js.map +1 -1
- package/es2022/src/modules/logger/services/logger/logger.service.js +3 -3
- package/es2022/src/modules/logger/services/logger/logger.service.js.map +1 -1
- package/es2022/src/modules/logger/services/rest/restSink.options.js +3 -3
- package/es2022/src/modules/logger/services/rest/restSink.options.js.map +1 -1
- package/es2022/src/modules/logger/types/loggerOptions.js +3 -3
- package/es2022/src/modules/logger/types/loggerOptions.js.map +1 -1
- package/es2022/src/modules/multiButton/components/multiButton/multiButton.component.js +3 -3
- package/es2022/src/modules/multiButton/components/multiButton/multiButton.component.js.map +1 -1
- package/es2022/src/modules/multiButton/modules/multiButton.module.js +4 -4
- package/es2022/src/modules/multiButton/modules/multiButton.module.js.map +1 -1
- package/es2022/src/modules/progressIndicator/components/progressIndicator/progressIndicator.component.js +3 -3
- package/es2022/src/modules/progressIndicator/components/progressIndicator/progressIndicator.component.js.map +1 -1
- package/es2022/src/modules/progressIndicator/directives/progressOverlay/progressOverlay.directive.js +3 -3
- package/es2022/src/modules/progressIndicator/directives/progressOverlay/progressOverlay.directive.js.map +1 -1
- package/es2022/src/modules/progressIndicator/interceptors/progressInterceptor.js +3 -3
- package/es2022/src/modules/progressIndicator/interceptors/progressInterceptor.js.map +1 -1
- package/es2022/src/modules/progressIndicator/modules/progressIndicator.module.js +4 -4
- package/es2022/src/modules/progressIndicator/modules/progressIndicator.module.js.map +1 -1
- package/es2022/src/modules/progressIndicator/services/progressIndicator.service.js +7 -12
- package/es2022/src/modules/progressIndicator/services/progressIndicator.service.js.map +1 -1
- package/es2022/src/modules/tooltip/components/tooltip/tooltip.component.js +3 -3
- package/es2022/src/modules/tooltip/components/tooltip/tooltip.component.js.map +1 -1
- package/es2022/src/modules/tooltip/directives/tooltip/tooltip.directive.js +3 -3
- package/es2022/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +1 -1
- package/es2022/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.js +3 -3
- package/es2022/src/modules/tooltip/directives/tooltipTemplate/tooltipTemplate.directive.js.map +1 -1
- package/es2022/src/modules/tooltip/modules/tooltip.module.js +4 -4
- package/es2022/src/modules/tooltip/modules/tooltip.module.js.map +1 -1
- package/es2022/src/pipes/displayProperties/displayProperties.pipe.js +3 -3
- package/es2022/src/pipes/displayProperties/displayProperties.pipe.js.map +1 -1
- package/es2022/src/pipes/firstUppercase/firstUppercase.pipe.js +3 -3
- package/es2022/src/pipes/firstUppercase/firstUppercase.pipe.js.map +1 -1
- package/es2022/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.js +3 -3
- package/es2022/src/pipes/firstUppercaseLocalize/firstUppercaseLocalize.pipe.js.map +1 -1
- package/es2022/src/pipes/isNaN/isNaN.pipe.js +3 -3
- package/es2022/src/pipes/isNaN/isNaN.pipe.js.map +1 -1
- package/es2022/src/pipes/isPresent/isPresent.pipe.js +3 -3
- package/es2022/src/pipes/isPresent/isPresent.pipe.js.map +1 -1
- package/es2022/src/pipes/keys/keys.pipe.js +3 -3
- package/es2022/src/pipes/keys/keys.pipe.js.map +1 -1
- package/es2022/src/pipes/localize/localize.pipe.js +3 -3
- package/es2022/src/pipes/localize/localize.pipe.js.map +1 -1
- package/es2022/src/pipes/mergeCssClasses/mergeCssClasses.pipe.js +3 -3
- package/es2022/src/pipes/mergeCssClasses/mergeCssClasses.pipe.js.map +1 -1
- package/es2022/src/pipes/urlEncode/urlEncode.pipe.js +3 -3
- package/es2022/src/pipes/urlEncode/urlEncode.pipe.js.map +1 -1
- package/es2022/src/services/cookies/cookies.service.js +3 -3
- package/es2022/src/services/cookies/cookies.service.js.map +1 -1
- package/es2022/src/services/notifications/defaultNotifications.service.js +3 -3
- package/es2022/src/services/notifications/defaultNotifications.service.js.map +1 -1
- package/es2022/src/services/permanentStorage/cookiePermanentStorage.service.js +3 -3
- package/es2022/src/services/permanentStorage/cookiePermanentStorage.service.js.map +1 -1
- package/es2022/src/services/statusCode/statusCode.service.js +3 -3
- package/es2022/src/services/statusCode/statusCode.service.js.map +1 -1
- package/es2022/src/services/stringLocalization/noStringLocalization.service.js +3 -3
- package/es2022/src/services/stringLocalization/noStringLocalization.service.js.map +1 -1
- package/es2022/src/services/temporaryStorage/memoryTemporaryStorage.service.js +3 -3
- package/es2022/src/services/temporaryStorage/memoryTemporaryStorage.service.js.map +1 -1
- package/es2022/store/src/services/permanentStorage/localPermanentStorage.service.js +3 -3
- package/es2022/store/src/services/permanentStorage/localPermanentStorage.service.js.map +1 -1
- package/es2022/store/src/services/temporaryStorage/sessionTemporaryStorage.service.js +3 -3
- package/es2022/store/src/services/temporaryStorage/sessionTemporaryStorage.service.js.map +1 -1
- package/package.json +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/version.bak +1 -1
package/changelog.md
CHANGED
|
@@ -230,14 +230,14 @@ let FloatingUiDomPosition = FloatingUiDomPosition_1 = class FloatingUiDomPositio
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
234
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.
|
|
233
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FloatingUiDomPosition, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
234
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FloatingUiDomPosition });
|
|
235
235
|
};
|
|
236
236
|
FloatingUiDomPosition = FloatingUiDomPosition_1 = __decorate([
|
|
237
237
|
TypeProvider({ provide: POSITION, useClass: forwardRef(() => FloatingUiDomPosition_1) })
|
|
238
238
|
], FloatingUiDomPosition);
|
|
239
239
|
export { FloatingUiDomPosition };
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
240
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FloatingUiDomPosition, decorators: [{
|
|
241
241
|
type: Injectable
|
|
242
242
|
}] });
|
|
243
243
|
//# 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,MAAM,eAAe,CAAC;AAC7L,OAAO,EAAC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAC,eAAe,EAAa,UAAU,EAAc,MAAM,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAEhC;;GAEG;AACH,MAAM,cAAc,GAC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B;oBACI,OAAO,KAAK,CAAC;iBAChB;YACD,KAAK,iBAAiB,CAAC,QAAQ;gBAC/B;oBACI,OAAO,WAAW,CAAC;iBACtB;YACD,KAAK,iBAAiB,CAAC,MAAM;gBAC7B;oBACI,OAAO,SAAS,CAAC;iBACpB;YACD,KAAK,iBAAiB,CAAC,MAAM;gBAC7B;oBACI,OAAO,QAAQ,CAAC;iBACnB;YACD,KAAK,iBAAiB,CAAC,WAAW;gBAClC;oBACI,OAAO,cAAc,CAAC;iBACzB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,IAAI;gBAC3B;oBACI,OAAO,MAAM,CAAC;iBACjB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,OAAO;gBAC9B;oBACI,OAAO,UAAU,CAAC;iBACrB;YACD,KAAK,iBAAiB,CAAC,KAAK;gBAC5B;oBACI,OAAO,OAAO,CAAC;iBAClB;YACD,KAAK,iBAAiB,CAAC,UAAU;gBACjC;oBACI,OAAO,aAAa,CAAC;iBACxB;YACD,KAAK,iBAAiB,CAAC,QAAQ;gBAC/B;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,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"],"names":[],"mappings":";;AAAA,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAA4C,cAAc,EAAE,iBAAiB,EAAqB,QAAQ,EAAyC,YAAY,EAAC,MAAM,eAAe,CAAC;AAC7L,OAAO,EAAC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAC,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ectable, 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
|
@@ -36,14 +36,14 @@ class DefaultValidationErrorsComponent {
|
|
|
36
36
|
this.options = options;
|
|
37
37
|
this._changeDetector.detectChanges();
|
|
38
38
|
}
|
|
39
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
40
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DefaultValidationErrorsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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
45
|
export { DefaultValidationErrorsComponent };
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DefaultValidationErrorsComponent, decorators: [{
|
|
47
47
|
type: Component,
|
|
48
48
|
args: [{ selector: 'default-validation-errors', animations: [
|
|
49
49
|
slideInOutTrigger,
|
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;AACH,MAYa,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;
|
|
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;AACH,MAYa,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;wGAxCQ,gCAAgC;4FAAhC,gCAAgC,+HCrB7C,kLAEM,8YDaF;YACI,iBAAiB;YACjB,sBAAsB;SACzB;;SAGQ,gCAAgC;4FAAhC,gCAAgC;kBAZ5C,SAAS;+BAEI,2BAA2B,cAIrC;wBACI,iBAAiB;wBACjB,sBAAsB;qBACzB,mBACgB,uBAAuB,CAAC,MAAM;wGAwBxC,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>"]}
|
|
@@ -85,11 +85,11 @@ class DefaultValidationErrorsContainerComponent {
|
|
|
85
85
|
this._template.detectChanges();
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
89
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
88
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DefaultValidationErrorsContainerComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
89
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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
91
|
export { DefaultValidationErrorsContainerComponent };
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DefaultValidationErrorsContainerComponent, decorators: [{
|
|
93
93
|
type: Component,
|
|
94
94
|
args: [{ selector: 'default-validation-errors-container', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host\n{\n display: contents;\n}"] }]
|
|
95
95
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; } });
|
|
@@ -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;AACH,MAOa,yCAAyC;IA2B5B;IAzBtB,sEAAsE;IAEtE;;;OAGG;IACO,OAAO,CAAyB;IAE1C;;;OAGG;IACO,QAAQ,CAAmC;IAErD;;OAEG;IACO,UAAU,CAA0C;IAE9D;;OAEG;IACO,SAAS,CAAmD;IAEtE,iEAAiE;IACjE,YAAsB,cAAgC;QAAhC,mBAAc,GAAd,cAAc,CAAkB;IAEtD,CAAC;IAED,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,cAAc,CAAC,KAAK,EAAE,CAAC;QAC5B,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,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;SAClF;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,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;
|
|
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;AACH,MAOa,yCAAyC;IA2B5B;IAzBtB,sEAAsE;IAEtE;;;OAGG;IACO,OAAO,CAAyB;IAE1C;;;OAGG;IACO,QAAQ,CAAmC;IAErD;;OAEG;IACO,UAAU,CAA0C;IAE9D;;OAEG;IACO,SAAS,CAAmD;IAEtE,iEAAiE;IACjE,YAAsB,cAAgC;QAAhC,mBAAc,GAAd,cAAc,CAAkB;IAEtD,CAAC;IAED,yFAAyF;IAEzF;;;;;OAKG;IACI,IAAI,CAAC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;YAEF,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;SAClC;IACL,CAAC;wGA1GQ,yCAAyC;4FAAzC,yCAAyC,2EAJxC,EAAE;;SAIH,yCAAyC;4FAAzC,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}"]}
|
|
@@ -86,11 +86,11 @@ class ReservedSpaceValidationErrorsContainerComponent {
|
|
|
86
86
|
this._template.detectChanges();
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
90
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
89
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ReservedSpaceValidationErrorsContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
90
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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
92
|
export { ReservedSpaceValidationErrorsContainerComponent };
|
|
93
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ReservedSpaceValidationErrorsContainerComponent, decorators: [{
|
|
94
94
|
type: Component,
|
|
95
95
|
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
96
|
}], 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;AACH,MAOa,+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;
|
|
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,SA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,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;wGA7GQ,+CAA+C;4FAA/C,+CAA+C,yKA+BX,gBAAgB,2CChDjE,6DAEM;;SDeO,+CAA+C;4FAA/C,+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>"]}
|
|
@@ -61,11 +61,11 @@ 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: "16.
|
|
65
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
64
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GroupHasErrorDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
65
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: GroupHasErrorDirective, selector: "[groupHasError]", ngImport: i0 });
|
|
66
66
|
}
|
|
67
67
|
export { GroupHasErrorDirective };
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GroupHasErrorDirective, decorators: [{
|
|
69
69
|
type: Directive,
|
|
70
70
|
args: [{
|
|
71
71
|
selector: '[groupHasError]'
|
|
@@ -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;AACH,MAIa,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;
|
|
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;AACH,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AAC,CAAC;SACxE;IACL,CAAC;wGAnEQ,sBAAsB;4FAAtB,sBAAsB;;SAAtB,sBAAsB;4FAAtB,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
|
@@ -6,8 +6,8 @@ import * as i0 from "@angular/core";
|
|
|
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
8
|
class GroupHasErrorContainerDirective extends GroupHasErrorDirective {
|
|
9
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
10
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GroupHasErrorContainerDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
10
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: GroupHasErrorContainerDirective, selector: "[groupHasErrorContainer]", providers: [
|
|
11
11
|
{
|
|
12
12
|
provide: GroupHasErrorDirective,
|
|
13
13
|
useExisting: GroupHasErrorContainerDirective
|
|
@@ -16,7 +16,7 @@ class GroupHasErrorContainerDirective extends GroupHasErrorDirective {
|
|
|
16
16
|
], usesInheritance: true, ngImport: i0 });
|
|
17
17
|
}
|
|
18
18
|
export { GroupHasErrorContainerDirective };
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GroupHasErrorContainerDirective, decorators: [{
|
|
20
20
|
type: Directive,
|
|
21
21
|
args: [{
|
|
22
22
|
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;AACH,MAaa,+BAAgC,SAAQ,sBAAsB;
|
|
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,MAaa,+BAAgC,SAAQ,sBAAsB;wGAA9D,+BAA+B;4FAA/B,+BAA+B,mDATxC;YAEI;gBACI,OAAO,EAAE,sBAAsB;gBAC/B,WAAW,EAAE,+BAA+B;aAC/C;YACD,6BAA6B;SAChC;;SAEQ,+BAA+B;4FAA/B,+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}"]}
|
|
@@ -180,8 +180,8 @@ class HasErrorDirective {
|
|
|
180
180
|
attributes: true
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
184
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
183
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", 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: "16.2.12", type: HasErrorDirective, selector: "[hasError]", inputs: { errorMessages: "errorMessages", errorsComponent: "errorsComponent", errorsTemplate: "errorsTemplate" }, ngImport: i0 });
|
|
185
185
|
}
|
|
186
186
|
__decorate([
|
|
187
187
|
BindThis,
|
|
@@ -190,7 +190,7 @@ __decorate([
|
|
|
190
190
|
__metadata("design:returntype", void 0)
|
|
191
191
|
], HasErrorDirective.prototype, "_isSubmittedOrDirty", null);
|
|
192
192
|
export { HasErrorDirective };
|
|
193
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
193
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HasErrorDirective, decorators: [{
|
|
194
194
|
type: Directive,
|
|
195
195
|
args: [{
|
|
196
196
|
selector: '[hasError]'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasError.directive.js","sourceRoot":"","sources":["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AS;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,QAA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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}"]}
|
|
@@ -60,11 +60,11 @@ class MaxValueNumberValidatorDirective {
|
|
|
60
60
|
validate(control) {
|
|
61
61
|
return this._validator(control);
|
|
62
62
|
}
|
|
63
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
64
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
63
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MaxValueNumberValidatorDirective, deps: [{ token: 'maxValue', attribute: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
64
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", 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
66
|
export { MaxValueNumberValidatorDirective };
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MaxValueNumberValidatorDirective, decorators: [{
|
|
68
68
|
type: Directive,
|
|
69
69
|
args: [{
|
|
70
70
|
selector: 'input[number][maxValue][formControlName],input[number][maxValue][formControl],input[number][maxValue][ngModel]',
|
|
@@ -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;AACH,MAKa,gCAAgC;IAEzC,oEAAoE;IAEpE;;OAEG;IACK,SAAS,CAAc;IAE/B;;OAEG;IACK,UAAU,CAAc;IAEhC;;OAEG;IACK,YAAY,GAAY,KAAK,CAAC;IAEtC,gFAAgF;IAEhF;;OAEG;IAEI,QAAQ,CAAU;IAEzB,iEAAiE;IACjE,YAAmC,QAAgB;QAE/C,IAAI,KAAK,CAAC;QAEV,IAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EACpG;YACI,KAAK,GAAG,IAAI,CAAC;SAChB;QAED,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,kGAAkG;IAE3F,WAAW,CAAC,OAAsB;QAErC,IAAG,CAAC,IAAI,CAAC,YAAY,EACrB;YACI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YAEzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACpD;QAED,IAAI,UAAU,IAAI,OAAO,EACzB;YACI,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAS,IAAI,CAAC,QAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACxG;IACL,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;
|
|
1
|
+
{"version":3,"file":"maxValueNumberValidator.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/numberInput/maxValueNumberValidator.directive.ts"],"names":[],"mappings":"AAAA,OAA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,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAS,IAAI,CAAC,QAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACxG;IACL,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;wGAnEQ,gCAAgC,kBA4BlB,UAAU;4FA5BxB,gCAAgC,2KAF9B,CAAC,oBAAoB,CAAC;;SAExB,gCAAgC;4FAAhC,gCAAgC;kBAL5C,SAAS;mBACV;oBACI,QAAQ,EAAE,gHAAgH;oBAC1H,SAAS,EAAE,CAAC,oBAAoB,CAAC;iBACpC;;0BA6BgB,SAAS;2BAAC,UAAU;4CAH1B,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}"]}
|
|
@@ -60,11 +60,11 @@ class MinValueNumberValidatorDirective {
|
|
|
60
60
|
validate(control) {
|
|
61
61
|
return this._validator(control);
|
|
62
62
|
}
|
|
63
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
64
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
63
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MinValueNumberValidatorDirective, deps: [{ token: 'minValue', attribute: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
64
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: MinValueNumberValidatorDirective, selector: "input[number][minValue][formControlName],input[number][minValue][formControl],input[number][minValue][ngModel]", inputs: { minValue: "minValue" }, providers: [MIN_NUMBER_VALIDATOR], usesOnChanges: true, ngImport: i0 });
|
|
65
65
|
}
|
|
66
66
|
export { MinValueNumberValidatorDirective };
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MinValueNumberValidatorDirective, decorators: [{
|
|
68
68
|
type: Directive,
|
|
69
69
|
args: [{
|
|
70
70
|
selector: 'input[number][minValue][formControlName],input[number][minValue][formControl],input[number][minValue][ngModel]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minValueNumberValidator.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/numberInput/minValueNumberValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAA6C,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;AACH,MAKa,gCAAgC;IAEzC,oEAAoE;IAEpE;;OAEG;IACK,SAAS,CAAc;IAE/B;;OAEG;IACK,UAAU,CAAc;IAEhC;;OAEG;IACK,YAAY,GAAY,KAAK,CAAC;IAEtC,gFAAgF;IAChF;;OAEG;IAEI,QAAQ,CAAU;IAEzB,iEAAiE;IACjE,YAAmC,QAAgB;QAE/C,IAAI,KAAK,CAAC;QAEV,IAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EACpG;YACI,KAAK,GAAG,IAAI,CAAC;SAChB;QAED,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,kGAAkG;IAE3F,WAAW,CAAC,OAAsB;QAErC,IAAG,CAAC,IAAI,CAAC,YAAY,EACrB;YACI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YAEzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACpD;QAED,IAAI,UAAU,IAAI,OAAO,EACzB;YACI,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAS,IAAI,CAAC,QAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACxG;IACL,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;
|
|
1
|
+
{"version":3,"file":"minValueNumberValidator.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/numberInput/minValueNumberValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAA6C,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;AACH,MAKa,gCAAgC;IAEzC,oEAAoE;IAEpE;;OAEG;IAC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AC;iBACpC;;0BA4BgB,SAAS;2BAAC,UAAU;4CAH1B,QAAQ;sBADd,KAAK","sourcesContent":["import {forwardRef, Directive, Attribute, Input, ExistingProvider, 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 MinValueNumberValidatorDirective\n */\nconst MIN_NUMBER_VALIDATOR = <ExistingProvider>\n{\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => MinValueNumberValidatorDirective),\n multi: true\n};\n\n/**\n * Directive injecting checking for number min value validator\n */\n@Directive(\n{\n selector: 'input[number][minValue][formControlName],input[number][minValue][formControl],input[number][minValue][ngModel]',\n providers: [MIN_NUMBER_VALIDATOR]\n})\nexport class MinValueNumberValidatorDirective implements Validator, OnChanges\n{\n //######################### private fields #########################\n\n /**\n * Current min value that is allowed\n */\n private _minValue: 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 * Bound min value that is allowed, which overrides value set to attribute minValue\n */\n @Input()\n public minValue?: number;\n\n //######################### constructor #########################\n constructor(@Attribute('minValue') minValue: string)\n {\n let value;\n\n if(isBlank(minValue) || minValue.length < 1 || isNaN(value = parseFloat(minValue.replace(',', '.'))))\n {\n value = null;\n }\n\n this._minValue = 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.min(this._minValue);\n }\n\n if ('minValue' in changes)\n {\n this._validator = Validators.min(isPresent(this.minValue) ? <number>this.minValue! : this._minValue);\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}"]}
|
package/es2022/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.js
CHANGED
|
@@ -68,11 +68,11 @@ class NumberInputControlValueAccessor {
|
|
|
68
68
|
setDisabledState(isDisabled) {
|
|
69
69
|
this.disabled = isDisabled;
|
|
70
70
|
}
|
|
71
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
72
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
71
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NumberInputControlValueAccessor, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
72
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NumberInputControlValueAccessor, selector: "input[number][formControlName],input[number][formControl],input[number][ngModel]", host: { listeners: { "change": "onChange($event.target.value)", "input": "onChange($event.target.value)", "blur": "onTouched()" }, properties: { "disabled": "disabled" } }, providers: [NUMBER_INPUT_VALUE_ACCESSOR], ngImport: i0 });
|
|
73
73
|
}
|
|
74
74
|
export { NumberInputControlValueAccessor };
|
|
75
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NumberInputControlValueAccessor, decorators: [{
|
|
76
76
|
type: Directive,
|
|
77
77
|
args: [{
|
|
78
78
|
selector: 'input[number][formControlName],input[number][formControl],input[number][ngModel]',
|
package/es2022/forms/src/directives/numberInput/numberInputControlValueAccessor.directive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberInputControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/numberInput/numberInputControlValueAccess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yB,CAAC,IAAI,CAAC,KAAK,CAAC,EACzC;gBACI,EAAE,CAAC,GAAG,CAAC,CAAC;gBAER,OAAO;aACV;YAED,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,CAAC,CAAC;IACN,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,EAAa;QAElC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAE,UAAmB;QAExC,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC;IAC/B,CAAC;
|
|
1
|
+
{"version":3,"file":"numberInputControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/numberInput/numberInputControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,SAAS,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAC,iBAAiB,EAAuB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;;AAEvC;;GAEG;AACH,MAAM,2BAA2B,GACjC;IACI,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,+BAA+B,CAAC;IAC9D,KAAK,EAAE,IAAI;CACd,CAAC;AAEF;;GAEG;AACH,MAYa,+BAA+B;IAiBpB;IAA8B;IAflD,uEAAuE;IAEhE,QAAQ,GAAG,CAAC,CAAM,EAAE,EAAE,GAAE,CAAC,CAAC;IAEjC;;OAEG;IACI,SAAS,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;IAE5B;;OAEG;IACI,QAAQ,GAAY,KAAK,CAAC;IAEjC,iEAAiE;IACjE,YAAoB,SAAoB,EAAU,WAAuB;QAArD,cAAS,GAAT,SAAS,CAAW;QAAU,gBAAW,GAAX,WAAW,CAAY;IAEzE,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ACJ","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Renderer2, ElementRef} from '@angular/core';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';\nimport {isBlank} from '@jscrpt/common';\n\n/**\n * Value accessor provider for number inputs\n */\nconst NUMBER_INPUT_VALUE_ACCESSOR = <ExistingProvider>\n{\n provide: NG_VALUE_ACCESSOR, \n useExisting: forwardRef(() => NumberInputControlValueAccessor), \n multi: true\n};\n\n/**\n * Value accessor for getting and setting values for number inputs\n */\n@Directive(\n{\n selector: 'input[number][formControlName],input[number][formControl],input[number][ngModel]',\n providers: [NUMBER_INPUT_VALUE_ACCESSOR],\n host: \n {\n '(change)': 'onChange($event.target.value)',\n '(input)': 'onChange($event.target.value)',\n '(blur)': 'onTouched()',\n '[disabled]': 'disabled',\n }\n})\nexport class NumberInputControlValueAccessor implements ControlValueAccessor\n{\n //######################### public properties #########################\n \n public onChange = (_: any) => {};\n \n /**\n * Method that is called when picker was touched\n */\n public onTouched = () => {};\n\n /**\n * Indication whether is number input disabled\n */\n public disabled: boolean = false;\n \n //######################### constructor #########################\n constructor(private _renderer: Renderer2, private _elementRef: ElementRef)\n {\n }\n\n //######################### public methods - implementation of ControlValueAccessor #########################\n\n /**\n * @inheritdoc\n */\n public writeValue(value: any): void\n {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', value);\n }\n\n /**\n * @inheritdoc\n */\n public registerOnChange(fn: (data: any) => any): void\n {\n this.onChange = (value: string) => \n { \n if(isBlank(value) || value == '')\n {\n fn(null);\n \n return;\n }\n \n //removing all spaces\n value = value.replace(/\\s+/g, '');\n \n if(!/^[+-]?\\d+(?:[,.]\\d+)?$/g.test(value))\n {\n fn(NaN);\n \n return;\n }\n \n fn(parseFloat(value.replace(',', '.'))); \n };\n }\n\n /**\n * @inheritdoc\n */\n public registerOnTouched(fn: () => any): void\n {\n this.onTouched = fn;\n }\n\n /**\n * @inheritdoc\n */\n public setDisabledState?(isDisabled: boolean): void\n {\n this.disabled = isDisabled;\n }\n}\n"]}
|
|
@@ -23,11 +23,11 @@ class NumberInputValidatorDirective {
|
|
|
23
23
|
validate(control) {
|
|
24
24
|
return Validators.number(control);
|
|
25
25
|
}
|
|
26
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
27
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
26
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NumberInputValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
27
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NumberInputValidatorDirective, selector: "input[number][formControlName],input[number][formControl],input[number][ngModel]", providers: [NUMBER_VALIDATOR], ngImport: i0 });
|
|
28
28
|
}
|
|
29
29
|
export { NumberInputValidatorDirective };
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NumberInputValidatorDirective, decorators: [{
|
|
31
31
|
type: Directive,
|
|
32
32
|
args: [{
|
|
33
33
|
selector: 'input[number][formControlName],input[number][formControl],input[number][ngModel]',
|